allyhub 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/fonts.js +3 -3
- package/dist/node_modules/@allyhub/doc-print/dist/layout.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/pdf.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/export.js +2 -2
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/dist/ag-psd.js +2 -0
- package/dist/node_modules/@allyhub/image-psd/dist/read.js +12 -12
- package/dist/node_modules/@allyhub/image-psd/dist/write.js +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/dist/pdf.js +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -1
- package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +65 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +17 -0
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/pins/ag-psd/package-lock.json +49 -0
- package/dist/node_modules/@allyhub/runtimes/pins/ag-psd/package.json +7 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-caladea/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-caladea/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-carlito/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-carlito/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-cousine/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-cousine/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-lxgw-wenkai/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-lxgw-wenkai/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-color-emoji/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-color-emoji/package.json +17 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-sans-sc/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-sans-sc/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-serif-sc/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-serif-sc/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-tinos/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-tinos/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/mermaid/package-lock.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/mermaid/package.json +15 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pdf-lib/package-lock.json +55 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pdf-lib/package.json +7 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pptxgenjs/package-lock.json +169 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pptxgenjs/package.json +7 -0
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/index.js +262 -1
- package/dist/node_modules/@allyhub/x-view/dist/stage.js +325 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +12 -12
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-BHI0AbUY.js → abnfDiagram-WEYOIA3C-9z0ZEYUq.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-BMQS-OKZ.js → architecture-WOLXFQ4H-ELMO_PA6.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-DZp9CM6P.js → architectureDiagram-ZHVYKT53-C0yuCWU3.js} +1 -1
- package/editor-web/assets/article-DHFgHYjv.js +3 -0
- package/editor-web/assets/article-Dt9id9Y9.js +7 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-h6LWaev4.js → blockDiagram-RJAE7QA3-vi6JOg4o.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-BvSMs7J4.js → c4Diagram-XDPPPE54-Agf_H8uS.js} +1 -1
- package/editor-web/assets/channel-Dkg198L0.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-0EJTAmDF.js → chunk-2E7WHVMD-XalaZaha.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BeYB4AEY.js → chunk-4EMNKR2T-DUlRZkCS.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BPFOPTBe.js → chunk-55XCU76K-DTa7whGr.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CZ2C7ULu.js → chunk-7S6XSTFO-85zCPzj0.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-B5RtsZkj.js → chunk-AQDTSKZB-CWBseIyh.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-_3G4hddj.js → chunk-DSNLSHJZ-BFnyvrWg.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-DO5b4ll2.js → chunk-HAGFOTED-DFWda2Rk.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-C6XNI71Q.js → chunk-HNE4Q36P-aXibFitC.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-nDCX29rQ.js → chunk-NQOKRVIF-CtJUuFdN.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-CRCOiitq.js → chunk-UHW7PFBP-B6QKSKWE.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-hNPKKjCN.js → chunk-VQ5W62QI-CF6Al55P.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-KlnVtIDc.js → chunk-WQQL4CDK-w2TKLkyw.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-B76hDUrM.js → chunk-YZO67HFG-DVGOATM3.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-D9m1N0wI.js → chunk-ZAUX2LTX-Cq7MMjDP.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-443euxzo.js → chunk-ZCHMQSOR-GMW_lBh4.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Bbw-8Ons.js → classDiagram-v2-4MYWR3UA-C7AK5Bkj.js} +1 -1
- package/editor-web/assets/code-BID_OoRp.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-C4E7TlUr.js → cynefin-EF2NZ3EQ-ZnDieQsN.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-PBPGa_HS.js → cynefinDiagram-WF24UDRP-BrukKIBF.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-DwXdEtQG.js → dagre-NK4GIZVX-DfO0S2p_.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-BE3FwdX7.js → diagram-CBK3MWTC-D43RLesi.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BPl2ZY33.js → diagram-I5XIIV2D-bA1B1QQG.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-BLVPYSzw.js → diagram-ODIL2UCW-DAdXBD2K.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BVZk62FO.js → diagram-PFBEJUXE-C_KyEaws.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-Z75LSbxH.js → diagram-RJA3I4VV-oXTtENF7.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-BynGqDAg.js → diagram-TYUNFSNR-Czupe6mO.js} +1 -1
- package/editor-web/assets/dist-2lNSE-G_.js +82 -0
- package/editor-web/assets/{dist-D_xVYGnk.js → dist-5HNrQ9AU.js} +3 -3
- package/editor-web/assets/dist-BPecIPz6.js +530 -0
- package/editor-web/assets/dist-BXJKASX4.js +24 -0
- package/editor-web/assets/{dist-CIQUbiAd.js → dist-BeDRTqQ8.js} +11 -11
- package/editor-web/assets/{dist-CxlIyluY.js → dist-BlL-4sl3.js} +1 -1
- package/editor-web/assets/dist-BtRMClDw.js +40 -0
- package/editor-web/assets/{dist-Ch34PllS.js → dist-BuqBg8k8.js} +1 -1
- package/editor-web/assets/{dist-cUeSwqws.js → dist-BwW08gSh.js} +1 -1
- package/editor-web/assets/{dist-VP4ECMOk.js → dist-C30Thvb3.js} +1 -1
- package/editor-web/assets/dist-Cj5AmpVb.js +5 -0
- package/editor-web/assets/dist-CjjnDOa8.js +3 -0
- package/editor-web/assets/dist-D7ur8721.js +6 -0
- package/editor-web/assets/{dist-Nc_h0Jye.js → dist-DOHhp09C.js} +1 -1
- package/editor-web/assets/{dist-UG2TIZxP.js → dist-LhFEYZza.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-SwhqbeK4.js → ebnfDiagram-V4P3TTPT-BOhNZmtp.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Bb1GSt2Z.js → elk-QONTBCTQ-DoZH3OoE.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-qUy0NDKn.js → erDiagram-KYQIGQAA-Bv0KDJi4.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-BYBYso_j.js → eventmodeling-K75KTNOO-C-_xzqfj.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-C7ZmHJZW.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-Cw-BkZT8.js → ganttDiagram-R7GPNTJY-CAuJlaZX.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-CTXzWPq_.js → gitGraph-VSP46ZUC-Dx2xLi5C.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-Jd9HU3WA.js → gitGraphDiagram-PDYL7XHY-DHsk_UOT.js} +1 -1
- package/editor-web/assets/{index-CglHrLRS.js → index-BGAXezRR.js} +2 -2
- package/editor-web/assets/{info-OHQRW6UA-C4oj5BpF.js → info-OHQRW6UA-CnKQHx5m.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-D09aYJ28.js → infoDiagram-MVDRKAX5-ibAVFw_2.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BEdXoXb2.js → ishikawaDiagram-HPEHV2GE-C1OCHt3y.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DE-_0aww.js → journeyDiagram-BOSHW7O7-BDdqMOM1.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Cn3_bvPS.js → kanban-definition-FNSA4HC5-CSAS_zGn.js} +1 -1
- package/editor-web/assets/lib-KOEbW83T.js +3 -0
- package/editor-web/assets/{mermaid-parser.core-BK52JMZH.js → mermaid-parser.core-DTLyYXbn.js} +3 -3
- package/editor-web/assets/{mermaid.core-CmfBU89G.js → mermaid.core-B8478wZ1.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CtUhkv9I.js → mindmap-definition-6OY57UG3-DSWHcglH.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-C7nciBNp.js → packet-JDAUHWVQ-_k1BF29s.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-DUkbAcTs.js → pegDiagram-ECIUJNBX-B22YyWAa.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BIGyKhav.js → pie-XZMESJXO-CSwV32hj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-DrYj-JeG.js → pieDiagram-GNMPY74T-rSFNeWnq.js} +1 -1
- package/editor-web/assets/{props-form-DrZYDmSM.js → props-form-B6mYjTgZ.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-qkBoh1ep.js → quadrantDiagram-D57K4MC3-Xrntfg4j.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-BkJmvR6a.js → radar-ABXABTNO-Dwq5qiNw.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BFH-ip4B.js → railroad-I3PHUGI6-sIUGWcZh.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-BBlzHL6Z.js → railroad-abnf-LNEFI6M7-1rWlT9BX.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-CCVsG0ui.js → railroad-ebnf-DWYD2UWJ-DWdkzEHc.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-Puo7BFPl.js → railroad-peg-JR7BVNR7-CME0JBbV.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-DCwfkv35.js → railroadDiagram-Y72NRBL7-Ch4BpP22.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-DSTcDj32.js → requirementDiagram-EQYSW5RA-CgE-x3wN.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-Kqq4fCvG.js → sankeyDiagram-SY24JHO5-DBf4G6n3.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-B1uodEgL.js → sequenceDiagram-BLEHNHQU-Bz07CoUS.js} +1 -1
- package/editor-web/assets/{split-Cu0fidVK.js → split-mDSkdQkd.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-B6gG3vUm.js → stateDiagram-v2-A6IESKWZ-DuqAmDPP.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-CZayRtvU.js → swimlanes-B3ENRKFQ-C7sOL6rB.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CQ2aWYP-.js +8 -0
- package/editor-web/assets/syntax-BIEjjMZL.js +27 -0
- package/editor-web/assets/{tabs-B_K0Db1I.js → tabs-C0AHyuE5.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-5YoY8Xhw.js → timeline-definition-JXYKGLGB-CaLYz9mc.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-Brd_NUPx.js → treeView-D4JQ5SDB-D1P1Kyxc.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-DmfdnlWl.js → treemap-SAJKECNS-2YaFL53t.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-lcAkMviI.js → usecaseDiagram-WPOLBNNX-uYdbUhUS.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DY_n48hQ.js → vennDiagram-Q3Y3IDCW-DHepmX4t.js} +1 -1
- package/editor-web/assets/{video-Bv3rETBU.js → video-Xl-OaXRc.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DzIFSBQz.js → wardley-7MLQ67FV-Dx0MOPV1.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CsXNajIg.js → wardleyDiagram-IVAIDKWA-BX8ElwDW.js} +1 -1
- package/editor-web/assets/words-B2FXYyeZ.js +263 -0
- package/editor-web/assets/words-DFIhHhHF.js +3 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DDpGFEum.js → xychartDiagram-4URNHDU4-DoWQRJUS.js} +1 -1
- package/editor-web/index.html +1 -1
- package/package.json +2 -19
- package/editor-web/assets/article-C_mBG5a1.js +0 -8
- package/editor-web/assets/article-DWBxNvX0.js +0 -7
- package/editor-web/assets/bookmark-Dfji3syX.js +0 -1
- package/editor-web/assets/channel-BFHB0S0f.js +0 -1
- package/editor-web/assets/dist--ijXGgvi.js +0 -5
- package/editor-web/assets/dist-C-yi9AAi.js +0 -274
- package/editor-web/assets/dist-D9N4Fxqr.js +0 -84
- package/editor-web/assets/dist-DWKEqAou.js +0 -6
- package/editor-web/assets/dist-DX0VLTRV.js +0 -3
- package/editor-web/assets/dist-xpAaABxb.js +0 -24
- package/editor-web/assets/flowDiagram-IUGLLWBU-BSCBBtP3.js +0 -1
- package/editor-web/assets/katex-UWCZofcd.js +0 -257
- package/editor-web/assets/play-DvMyq5xW.js +0 -1
- package/editor-web/assets/repeat-2-DfPmKp4w.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B9tLTrym.js +0 -8
- package/editor-web/assets/syntax-PERQ2szW.js +0 -66
- package/editor-web/assets/words-BTRrBFUo.js +0 -2
- package/editor-web/assets/words-ll_94CD2.js +0 -3
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CmfBU89G.js","./index-CglHrLRS.js","./rolldown-runtime-COiEfhsA.js","./react-Bk7NnOLX.js","./jsx-runtime-DePvh3-m.js","./button-BVQH7zxz.js","./createLucideIcon-REX213UO.js","./snapshots-CTS2iez5.js","./layout-SWqqA0yV.js","./index-Br4a-QEv.css","./chunk-Y2CYZVJY-DsF7k-Jl.js","./d3-selection-COWvaQNI.js","./chunk-DSNLSHJZ-_3G4hddj.js","./chunk-YZO67HFG-B76hDUrM.js","./chunk-7S6XSTFO-CZ2C7ULu.js","./dist-DdXDFcej.js","./chunk-AQDTSKZB-B5RtsZkj.js","./chunk-DUW6YSOI-Dgx8z5s3.js","./chunk-UHW7PFBP-CRCOiitq.js","./chunk-HAGFOTED-DO5b4ll2.js","./chunk-J5ZVWO5B-oDCd-gWO.js","./rough.esm-Dy-Kn_BL.js","./chunk-ZAUX2LTX-D9m1N0wI.js","./chunk-WQQL4CDK-KlnVtIDc.js","./chunk-HNE4Q36P-C6XNI71Q.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{a as n,c as r,d as i,o as a,s as o,u as s,v as c}from"./react-Bk7NnOLX.js";import{A as l,At as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,N as v,O as y,Ot as b,P as x,S,St as C,T as w,Tt as T,_ as E,b as D,bt as O,c as k,d as A,f as j,g as M,gt as N,h as P,ht as F,j as I,k as L,l as R,m as z,mt as B,p as ee,s as te,u as ne,v as re,vt as ie,w as ae,x as V,y as oe,yt as se}from"./button-BVQH7zxz.js";import{A as ce,B as le,J as ue,P as de,Q as fe,S as pe,V as me,W as he,Y as ge,et as _e,it as ve,tt as ye,x as be}from"./snapshots-CTS2iez5.js";import{g as xe,i as Se}from"./slides-BdaWgL_N.js";import{t as Ce}from"./session-CUCSWPTE.js";import{t as we}from"./jsx-runtime-DePvh3-m.js";import{t as Te}from"./createLucideIcon-REX213UO.js";import{a as H,c as Ee,d as De,f as Oe,i as ke,l as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe,u as Ie}from"./props-form-DrZYDmSM.js";import{a as Le,b as Re,i as ze,n as Be,s as Ve,v as He,x as Ue,y as We}from"./chart-BC3kUUDD.js";import{C as Ge,D as Ke,b as qe,c as Je,i as Ye,v as Xe,w as Ze,x as Qe}from"./dist-DWKEqAou.js";import{n as $e,t as et}from"./katex-UWCZofcd.js";import{a as tt,i as nt,n as rt,o as it,r as at,t as ot}from"./svg-nJtFNJ-7.js";import{t as st}from"./copy-DvOiv9Ra.js";import{a as ct,c as lt,i as ut,l as dt,n as ft,s as pt,t as U}from"./syntax-DSsHrzWF.js";import{D as mt,O as ht,a as gt,i as _t,n as vt,o as yt,t as bt}from"./dist-BrGYx10E.js";import{t as xt}from"./minus-D1tgAHbU.js";import{$ as St,A as Ct,B as wt,D as Tt,E as Et,F as Dt,H as Ot,I as kt,J as At,L as jt,M as Mt,N as Nt,O as Pt,P as Ft,R as It,S as Lt,T as Rt,U as zt,V as Bt,a as Vt,at as Ht,b as Ut,c as Wt,d as Gt,et as Kt,f as qt,ft as Jt,g as Yt,i as Xt,l as Zt,m as Qt,n as $t,nt as en,o as tn,pt as nn,r as rn,st as an,tt as on,u as sn,ut as cn,v as ln,w as un,z as dn}from"./dist-D9N4Fxqr.js";import{t as fn}from"./repeat-2-DfPmKp4w.js";import{t as pn}from"./sigma-CY2Chbro.js";import{t as mn}from"./table-CTjNpE4W.js";import{n as hn,t as gn}from"./swatch-S8YuBYyj.js";import{t as _n}from"./switch-D5kPl2jO.js";import{i as vn,n as yn,r as bn,t as xn}from"./hint-mQB8slJ2.js";import{E as Sn,Q as Cn,Z as wn,_ as Tn,_t as En,a as Dn,bt as On,c as kn,et as An,f as jn,h as Mn,ht as Nn,i as Pn,l as Fn,mt as In,nt as Ln,o as Rn,ot as zn,p as Bn,pt as Vn,q as Hn,st as Un,t as Wn,tt as Gn,u as Kn,xt as qn}from"./index-CglHrLRS.js";import{t as Jn}from"./row-dgHEAE7h.js";import{A as Yn,B as Xn,D as Zn,E as Qn,F as $n,H as er,I as tr,P as nr,R as rr,S as ir,U as ar,V as or,h as sr,i as cr,k as lr,n as ur,p as dr,r as fr,t as pr,z as mr}from"./syntax-C0iPON60.js";import{a as hr,c as gr,t as _r}from"./browser-C9NP0ZYz.js";import{D as vr,E as yr,S as br,T as xr,_ as Sr,c as Cr,d as wr,f as Tr,g as Er,h as Dr,k as Or,l as kr,m as Ar,n as jr,o as Mr,s as Nr,t as Pr,u as Fr,w as Ir,y as Lr}from"./dist-YW8hS4IM.js";import{t as Rr}from"./textarea-mzr9Kfuf.js";var zr=Te(`a-large-small`,[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),Br=Te(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Vr=Te(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Hr=Te(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Ur=Te(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Wr=Te(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Gr=Te(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),Kr=Te(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),qr=Te(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),Jr=Te(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Yr=Te(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Xr=Te(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),Zr=Te(`notebook-text`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M9.5 8h5`,key:`11mslq`}],[`path`,{d:`M9.5 12H16`,key:`ktog6x`}],[`path`,{d:`M9.5 16H14`,key:`p1seyn`}]]),Qr=Te(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),$r=Te(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ei=Te(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),ti=Te(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),W=e(c(),1),G=we();function ni(e,t,n){let r=t*Math.min(n,1-n),i=t=>{let i=(t+e/30)%12;return 255*(n-r*Math.max(-1,Math.min(i-3,9-i,1)))};return[i(0),i(8),i(4)]}function ri(e,t){if(e===void 0)return;let n=(t[e]??e).trim().toLowerCase(),r=/^#([0-9a-f])([0-9a-f])([0-9a-f])f?$/.exec(n);if(r)return r.slice(1).map(e=>e+e).join(``).toUpperCase();let i=/^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(n);if(i?.[1]!==void 0)return i[1].toUpperCase();let a=/^(rgb|hsl)a?\(([^)]*)\)$/.exec(n),[o=NaN,s=NaN,c=NaN]=(a?.[2]??``).split(/[\s,/]+/).filter(Boolean).map(Number.parseFloat);if(a&&![o,s,c].some(Number.isNaN))return(a[1]===`rgb`?[o,s,c]:ni(o,s/100,c/100)).map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``).toUpperCase()}var ii=[`#2A78D6`,`#EB6834`,`#1BAF7A`,`#EDA100`,`#E87BA4`,`#008300`],K={ink:`#1F1D1A`,lead:`#605B51`,leadSoft:`#847F72`,rule:`#EAE6DE`,ruleStrong:`#959083`,ruleMid:`#D6D1C6`,stone:`#F8F6F1`,stone2:`#EFECE5`,stone3:`#E4E0D7`,sheet:`#FFFFFF`},ai={good:`#448361`,bad:`#D44C47`,flat:K.lead},oi=e=>{let t=Number.parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]};function si(e,t){let[n,r,i]=oi(e),a=0,o=1/0;return t.forEach((e,t)=>{let[s,c,l]=oi(e),u=2*(n-s)**2+4*(r-c)**2+3*(i-l)**2;u<o&&(o=u,a=t)}),a}function ci(e){let t=[...ii];if(e===void 0)return t;let n=si(e,t);return[e,...t.filter((e,t)=>t!==n)]}function li(e,t){let n=Number.parseInt(e.slice(1),16),r=e=>Math.round(255-(255-e)*t).toString(16).padStart(2,`0`);return`#${r(n>>16&255)}${r(n>>8&255)}${r(n&255)}`.toUpperCase()}function ui(e){let t=ci(e.accent),n=Object.fromEntries(Array.from({length:12},(e,n)=>{let r=t[n%t.length]??K.leadSoft;return[[`cScale${String(n)}`,li(r,.22)],[`cScaleLabel${String(n)}`,K.ink],[`cScalePeer${String(n)}`,li(r,.6)],[`cScaleInv${String(n)}`,li(r,.7)]]}).flat()),r=Object.fromEntries(t.map((e,t)=>[`pie${String(t+1)}`,e])),i=t[0]??ii[0];return{startOnLoad:!1,securityLevel:`strict`,htmlLabels:!1,fontFamily:e.font,theme:`base`,themeCSS:`.grid .tick line { stroke: ${K.rule}; } .grid .tick text { fill: ${K.lead}; } .grid path { stroke-width: 0; } .lineWrapper line, line.lineWrapper { stroke: ${K.leadSoft}; } .cluster-label text, .cluster-label tspan { font-weight: 600; }`,look:`classic`,layout:`dagre`,elk:{considerModelOrder:`NODES_AND_EDGES`,forceNodeModelOrder:!0,mergeEdges:!1},flowchart:{htmlLabels:!1,nodeSpacing:36,rankSpacing:44,padding:10,curve:`basis`},sequence:{actorMargin:40,width:120,height:44,boxMargin:8,messageFontSize:14,mirrorActors:!1},gantt:{barHeight:22,barGap:6,fontSize:12,sectionFontSize:12},themeVariables:{fontFamily:e.font,fontSize:`14px`,background:K.sheet,primaryColor:K.stone,primaryBorderColor:K.ruleMid,primaryTextColor:K.ink,secondaryColor:K.stone2,secondaryBorderColor:K.ruleMid,secondaryTextColor:K.ink,tertiaryColor:K.sheet,tertiaryBorderColor:K.rule,tertiaryTextColor:K.ink,mainBkg:K.stone,nodeBorder:K.ruleMid,clusterBkg:`#FCFBF8`,clusterBorder:K.rule,titleColor:K.ink,textColor:K.ink,lineColor:K.leadSoft,edgeLabelBackground:K.sheet,actorBkg:K.stone,actorBorder:K.ruleMid,actorTextColor:K.ink,actorLineColor:K.ruleMid,signalColor:K.lead,signalTextColor:K.ink,labelBoxBkgColor:K.stone,labelBoxBorderColor:K.ruleMid,noteBkgColor:`#FBF3DB`,noteBorderColor:`#E9D9A6`,noteTextColor:K.ink,sectionBkgColor:K.stone,altSectionBkgColor:K.sheet,sectionBkgColor2:K.stone,gridColor:K.rule,taskBkgColor:li(i,.35),taskBorderColor:li(i,.8),taskTextColor:K.ink,taskTextLightColor:K.ink,taskTextOutsideColor:K.ink,activeTaskBkgColor:li(i,.18),activeTaskBorderColor:li(i,.8),doneTaskBkgColor:K.stone2,doneTaskBorderColor:K.ruleMid,critBkgColor:li(`#D6403A`,.3),critBorderColor:`#D6403A`,...n,...r,pieStrokeColor:K.sheet,pieOuterStrokeColor:K.rule,pieTitleTextColor:K.ink,pieSectionTextColor:K.ink,pieLegendTextColor:K.ink}}}var di=[`apa`,`mla`,`gbt7714`];function fi(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function pi(e){let t=[],n;for(let r of e.split(`;`)){let e=/^\s*-?@([\w:.#$%&+?<>~/-]+)\s*(?:,\s*(.+?))?\s*$/u.exec(r);e?.[1]&&(t.push(e[1]),e[2]!==void 0&&(n=e[2]))}return{keys:t,...n===void 0?{}:{locator:n}}}function mi(e){let t=[],n=e=>{for(let n of e)if(n.cite!==void 0)for(let e of pi(n.cite).keys)t.includes(e)||t.push(e)};for(let t of da(e))if(`content`in t&&n(t.content),t.type===`table`)for(let e of t.rows)for(let t of e)n(t);return t}var hi=e=>{let t=e.issued?.[`date-parts`]?.[0];return t?.[0]===void 0?e.issued?.literal??`n.d.`:String(t[0])},gi=e=>e!==void 0&&/[㐀-鿿]/u.test(e);function _i(e){if(e.literal!==void 0)return e.literal;let t=e.family??``;if(gi(t))return`${t}${e.given??``}`;let n=(e.given??``).split(/[\s.-]+/u).filter(e=>e!==``).map(e=>e.charAt(0).toUpperCase()).join(``);return n===``?t:`${t} ${n}`}function vi(e){if(e.literal!==void 0)return e.literal;if(gi(e.family))return`${e.family??``}${e.given??``}`;let t=(e.given??``).split(/[\s.]+/u).filter(e=>e!==``).map(e=>`${e.charAt(0).toUpperCase()}.`).join(` `);return t===``?e.family??``:`${e.family??``}, ${t}`}var yi=`\0`,bi=e=>`${yi}${e.replaceAll(yi,``)}${yi}`,xi=e=>e.split(yi).map((e,t)=>t%2==1?{text:e,italic:!0}:{text:e}).filter(e=>e.text!==``);function Si(e){return e.literal===void 0?gi(e.family)?`${e.family??``}${e.given??``}`:e.given===void 0||e.given===``?e.family??``:`${e.family??``}, ${e.given}`:e.literal}function Ci(e){return e.literal===void 0?gi(e.family)?`${e.family??``}${e.given??``}`:[e.given,e.family].filter(e=>e!==void 0&&e!==``).join(` `):e.literal}var wi=e=>e[`container-title`]!==void 0||[`article-journal`,`article-magazine`,`article-newspaper`,`chapter`,`webpage`,`post-weblog`,`paper-conference`].includes(e.type??``);function Ti(e){let t=e.author??e.editor??[],[n,r]=t,i=n===void 0?``:t.length===1?Si(n):t.length===2&&r!==void 0?`${Si(n)}, and ${Ci(r)}`:`${Si(n)}, et al`,a=i===``?``:i.endsWith(`.`)?`${i} `:`${i}. `,o=e.title??``,s=wi(e)?`“${o}.” `:`${bi(o)}. `,c=e.issued?.[`date-parts`]?.[0],l=c?.[0]===void 0?e.issued?.literal:String(c[0]),u=e.page===void 0?void 0:`${/[-–]/u.test(e.page)?`pp.`:`p.`} ${e.page.replace(`-`,`–`)}`,d=e[`container-title`],f=[d===void 0?void 0:bi(d),e.volume===void 0?void 0:`vol. ${String(e.volume)}`,e.issue===void 0?void 0:`no. ${String(e.issue)}`,e.publisher,l,u].filter(e=>e!==void 0&&e!==``),p=e.DOI===void 0?e.URL:`https://doi.org/${e.DOI}`,m=[...f,...p===void 0?[]:[p]];return`${a}${s}${m.length===0?``:`${m.join(`, `)}.`}`.trim()}var Ei={"article-journal":`J`,article:`J`,"article-magazine":`J`,book:`M`,chapter:`M`,"paper-conference":`C`,thesis:`D`,report:`R`,webpage:`EB/OL`,"post-weblog":`EB/OL`,patent:`P`,"article-newspaper":`N`,standard:`S`,dataset:`DS`};function Di(e,t,n){return xi(Oi(e,t,n))}function Oi(e,t,n){if(t===`mla`)return Ti(e);let r=e.author??e.editor??[];if(t===`gbt7714`){let t=gi(e.title)||r.some(e=>gi(e.family)),i=r.slice(0,3).map(_i),a=r.length>3?`${i.join(`, `)}, ${t?`等`:`et al`}`:i.join(`, `),o=Ei[e.type??``]??`Z`,s=e[`container-title`],c=e.volume===void 0?``:`, ${String(e.volume)}${e.issue===void 0?``:`(${String(e.issue)})`}`,l=e.page===void 0?``:`: ${e.page}`,u=s===void 0?[e[`publisher-place`],e.publisher].filter(e=>e!==void 0).join(`: `)+`${e.publisher===void 0?``:`, `}${hi(e)}${l}`:`${s}, ${hi(e)}${c}${l}`,d=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}.`:` DOI: ${e.DOI}.`;return`${n===void 0?``:`[${String(n)}] `}${a===``?``:`${a}. `}${e.title??``}[${o}]. ${u}.${d}`}let i=r.map(vi),a=i.length<=1?i[0]??``:i.length<=20?`${i.slice(0,-1).join(`, `)}, & ${i.at(-1)??``}`:`${i.slice(0,19).join(`, `)}, … ${i.at(-1)??``}`,o=e[`container-title`],s=e.volume===void 0?``:`, ${bi(String(e.volume))}${e.issue===void 0?``:`(${String(e.issue)})`}`,c=e.page===void 0?``:`, ${e.page.replace(`-`,`–`)}`,l=o===void 0?e.publisher===void 0?``:` ${e.publisher}.`:` ${bi(o)}${s}${c}.`,u=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}`:` https://doi.org/${e.DOI}`,d=a===``?``:a.endsWith(`.`)?`${a} `:`${a}. `,f=e.title??``;return`${d}(${hi(e)}). ${o===void 0?bi(f):f}.${l}${u}`}function ki(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i=mi(e).flatMap(e=>{let t=r.get(e);return t===void 0?[]:[t]});return(n===`gbt7714`?i:[...i].sort((e,t)=>{let r=e=>(e.author?.[0]?.family??e.author?.[0]?.literal??e.title??``).toLowerCase();return r(e).localeCompare(r(t))||(n===`mla`?(e.title??``).localeCompare(t.title??``):hi(e).localeCompare(hi(t)))})).map((e,t)=>{let r=Di(e,n,n===`gbt7714`?t+1:void 0);return{item:e,n:t+1,text:r.map(e=>e.text).join(``),pieces:r}})}function Ai(e,t,n,r){let{keys:i,locator:a}=pi(e),o=new Map(t.map(e=>[e.id,e]));if(r===`gbt7714`){let t=i.map(e=>n.get(e));if(t.some(e=>e===void 0))return`[${e}]`;let r=[...new Set(t)].sort((e,t)=>e-t),o=[];for(let e=0;e<r.length;){let t=e;for(;t+1<r.length&&(r[t+1]??0)===(r[t]??0)+1;)t++;o.push(t-e>=2?`${String(r[e])}-${String(r[t])}`:r.slice(e,t+1).join(`, `)),e=t+1}return`[${o.join(`, `)}]${a===void 0?``:a.replace(/^p+\.\s*/u,``)}`}if(r===`mla`){let e=i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:gi(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return n.length===0?wi(t)?`“${t.title??e}”`:t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} and ${r(n[1])}`:`${r(n[0])} et al.`}),t=a?.replace(/^pp?\.\s*/u,``);return`(${e.join(`; `)}${t===void 0?``:` ${t}`})`}return`(${i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:gi(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return`${n.length===0?t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} & ${r(n[1])}`:`${r(n[0])} et al.`}, ${hi(t)}`}).join(`; `)}${a===void 0?``:`, ${a}`})`}var ji={a3:[297,420],a4:[210,297],a5:[148,210],b5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},Mi=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`,`xiaobiaosong`],Ni={初号:42,小初:36,一号:26,小一:24,二号:22,小二:18,三号:16,小三:15,四号:14,小四:12,五号:10.5,小五:9,六号:7.5,小六:6.5,七号:5.5,八号:5},Pi=[`left`,`center`,`right`,`outside`,`inside`],Fi=[`apa`,`mla`,`brief`,`memo`,`business-letter`],Ii=new Map([[`report`,`brief`]]),Li={apa:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`bold`,align:`center`},headings:{1:{size:12,weight:`bold`,align:`center`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`,italic:!0},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`apa`},mla:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`normal`,align:`center`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`mla`},brief:{size:10.5,lineHeight:1.2,paragraphSpacing:.7,title:{size:24,weight:`bold`},headings:{1:{size:18,weight:`bold`},2:{size:14,weight:`bold`,rule:!0},3:{size:11.5,weight:`bold`}}},memo:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:{center:`{page}`}},"business-letter":{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:!1,pageNumbers:!1}},Ri=e=>Li[e];function zi(e){if(e.preset===void 0)return e;let t=Li[e.preset],n={...t.headings};for(let[r,i]of Object.entries(e.headings??{}))n[Number(r)]={...t.headings?.[Number(r)],...i};return{...t,...e,...t.title||e.title?{title:{...t.title,...e.title}}:{},...Object.keys(n).length>0?{headings:n}:{}}}var Bi=e=>typeof e==`number`?e:Ni[e],Vi={paper:`letter`,margins:{top:18,right:20,bottom:18,left:20},size:11,lineHeight:1.15,textIndent:0,paragraphSpacing:.5,headingScale:{title:2.3,1:1.75,2:1.45,3:1.15,4:1,5:1,6:1},footer:{left:`{title}`,right:`{page} / {pages}`}},Hi=[`preset`,`paper`,`orientation`,`margins`,`font`,`size`,`line-height`,`text-indent`,`paragraph-spacing`,`text-align`,`grid`,`title`,`headings`,`header`,`footer`,`captions`,`bibliography`,`citation-style`,`accent`,`cover`,`cover-y`,`page-numbers`,`picture-dpi`],Ui=[`left`,`center`,`right`],Wi=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Gi=e=>typeof e==`number`&&Number.isFinite(e)&&e>0;function Ki(e){if(Gi(e))return e;if(typeof e==`string`){let t=e.trim();if(Object.hasOwn(Ni,t))return t;let n=/^(\d+(?:\.\d+)?)\s*pt$/u.exec(t);if(n)return Number(n[1])}}var qi=`a size in pt (12) or a Chinese size (${Object.keys(Ni).join(`, `)})`;function Ji(e,t,n){if(!Wi(e)){n(`${t} holds font, size, weight, align, italic and rule`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Mi.includes(a)?r.font=a:n(`${t}'s font is ${Mi.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Ki(a);e===void 0?n(`${t}'s size is ${qi}`):r.size=e}else i===`weight`?a===`normal`||a===`bold`?r.weight=a:n(`${t}'s weight is normal or bold, not ${JSON.stringify(a)}`):i===`align`?Ui.includes(a)?r.align=a:n(`${t}'s align is left, center or right, not ${JSON.stringify(a)}`):i===`italic`?typeof a==`boolean`?r.italic=a:n(`${t}'s italic is true or false, not ${JSON.stringify(a)}`):i===`rule`?typeof a==`boolean`?r.rule=a:n(`${t}'s rule is true or false, not ${JSON.stringify(a)}`):n(`${t} holds font, size, weight, align, italic and rule: ${i} is not one of them`);return r}function Yi(e,t,n){if(e===!1)return!1;if(typeof e==`string`)return{center:e};if(!Wi(e)){n(`a page's ${t} is false, words, or words by place (${Pi.join(`, `)}) with a font and a size`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Mi.includes(a)?r.font=a:n(`a page's ${t} font is ${Mi.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Ki(a);e===void 0?n(`a page's ${t} size is ${qi}`):r.size=e}else Pi.includes(i)?typeof a!=`string`&&typeof a!=`number`?n(`a page's ${t} ${i} is words`):r[i]=String(a):n(`a page's ${t} holds ${Pi.join(`, `)}, font and size: ${i} is not one of them`);return r}function Xi(e,t){let n={};for(let[r,i]of Object.entries(e))switch(r){case`preset`:{let e=typeof i==`string`?Ii.get(i):void 0;Fi.includes(i)?n.preset=i:e===void 0?t(`a page's preset is ${Fi.join(` or `)}, not ${JSON.stringify(i)}`):n.preset=e;break}case`paper`:{let e=typeof i==`string`?i.trim().toLowerCase():void 0;e!==void 0&&Object.hasOwn(ji,e)?n.paper=e:Array.isArray(i)&&i.length===2&&i.every(Gi)?n.paper=i:t(`a page's paper is ${Object.keys(ji).join(`, `)} or its width and height in mm ([210, 297]), not ${JSON.stringify(i)}`);break}case`orientation`:i===`portrait`||i===`landscape`?n.orientation=i:t(`a page's orientation is portrait or landscape, not ${JSON.stringify(i)}`);break;case`margins`:typeof i==`number`&&i>=0||Array.isArray(i)&&(i.length===2||i.length===4)&&i.every(e=>typeof e==`number`&&e>=0)?n.margins=i:t(`a page's margins are mm: one for all four, [top and bottom, sides], or [top, right, bottom, left]`);break;case`font`:Mi.includes(i)?n.font=i:t(`a page's font is ${Mi.join(`, `)}, not ${JSON.stringify(i)}`);break;case`size`:{let e=Ki(i);e===void 0?t(`a page's size is ${qi}`):n.size=e;break}case`line-height`:Gi(i)?n.lineHeight=i:typeof i==`string`&&/^\d+(\.\d+)?pt$/u.test(i.trim())?n.lineHeight=i.trim():t(`a page's line-height is a multiple (1.5) or pt (28pt), not ${JSON.stringify(i)}`);break;case`text-indent`:typeof i==`number`&&i>=0?n.textIndent=i:t(`a page's text-indent is how many characters a paragraph's first line is set in (2)`);break;case`paragraph-spacing`:typeof i==`number`&&i>=0?n.paragraphSpacing=i:t(`a page's paragraph-spacing is the space between paragraphs in em (0.5)`);break;case`text-align`:i===`left`||i===`justify`?n.textAlign=i:t(`a page's text-align is left or justify, not ${JSON.stringify(i)}`);break;case`grid`:{let e=Wi(i)?i.chars:void 0,r=Wi(i)?i.lines:void 0;Wi(i)&&Object.keys(i).length===2&&Gi(e)&&Gi(r)&&Number.isInteger(e)&&Number.isInteger(r)?n.grid={chars:e,lines:r}:t(`a page's grid is { chars, lines }: characters to a line and lines to a page`);break}case`title`:{let e=Ji(i,`the title`,t);e&&(n.title=e);break}case`headings`:{if(!Wi(i)){t(`a page's headings are by level: { 1: { font, size }, 2: … }`);break}let e={};for(let[n,r]of Object.entries(i)){let i=Number(n);if(!Number.isInteger(i)||i<1||i>6){t(`a heading's level is 1 to 6, not ${n}`);continue}let a=Ji(r,`heading ${n}`,t);a&&(e[i]=a)}n.headings=e;break}case`header`:case`footer`:{let e=Yi(i,r,t);e!==void 0&&(n[r]=e);break}case`captions`:i===`numbered`||i===`plain`?n.captions=i:t(`a page's captions are numbered or plain, not ${JSON.stringify(i)}`);break;case`bibliography`:typeof i==`string`&&i.trim()!==``?n.bibliography=i.trim():t(`a page's bibliography is a CSL-JSON file's path`);break;case`citation-style`:di.includes(i)?n.citationStyle=i:t(`a page's citation-style is ${di.join(` or `)}, not ${JSON.stringify(i)}`);break;case`accent`:typeof i==`string`&&i.trim()!==``?n.accent=i.trim():t(`a page's accent is a colour`);break;case`cover`:typeof i==`string`&&i.trim()!==``?n.cover=i.trim():t(`a page's cover is a picture's path`);break;case`cover-y`:typeof i==`number`&&i>=0&&i<=100?n.coverY=i:t(`a cover's cover-y is 0 (its top) to 100 (its bottom), not ${JSON.stringify(i)}`);break;case`picture-dpi`:i===!1?n.pictureDpi=!1:typeof i==`number`&&i>=72&&i<=2400?n.pictureDpi=i:t(`a page's picture-dpi is 72 to 2400 (dots an inch of paper), or false to print pictures as they are, not ${JSON.stringify(i)}`);break;case`page-numbers`:i===!1?n.pageNumbers=!1:i!==!0&&t(`a page's page-numbers is true or false, not ${JSON.stringify(i)}`);break;default:t(`the front matter holds ${Hi.join(`, `)}: ${r} is not one of them`)}return n}var Zi=e=>({...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.weight===void 0?{}:{weight:e.weight},...e.align===void 0?{}:{align:e.align},...e.italic===void 0?{}:{italic:e.italic},...e.rule===void 0?{}:{rule:e.rule}}),Qi=e=>e===!1?!1:Object.keys(e).length===1&&e.center!==void 0?e.center:{...e},$i=e=>/^[ab]\d$/u.test(e)?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ea(e){return{...e.preset===void 0?{}:{preset:e.preset},...e.paper===void 0?{}:{paper:typeof e.paper==`string`?$i(e.paper):[...e.paper]},...e.orientation===void 0?{}:{orientation:e.orientation},...e.margins===void 0?{}:{margins:typeof e.margins==`number`?e.margins:[...e.margins]},...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.lineHeight===void 0?{}:{"line-height":e.lineHeight},...e.textIndent===void 0?{}:{"text-indent":e.textIndent},...e.paragraphSpacing===void 0?{}:{"paragraph-spacing":e.paragraphSpacing},...e.textAlign===void 0?{}:{"text-align":e.textAlign},...e.grid===void 0?{}:{grid:{...e.grid}},...e.title===void 0?{}:{title:Zi(e.title)},...e.headings===void 0?{}:{headings:Object.fromEntries(Object.entries(e.headings).map(([e,t])=>[e,Zi(t)]))},...e.header===void 0?{}:{header:Qi(e.header)},...e.footer===void 0?{}:{footer:Qi(e.footer)},...e.captions===void 0?{}:{captions:e.captions},...e.bibliography===void 0?{}:{bibliography:e.bibliography},...e.citationStyle===void 0?{}:{"citation-style":e.citationStyle},...e.accent===void 0?{}:{accent:e.accent},...e.cover===void 0?{}:{cover:e.cover},...e.cover===void 0||e.coverY===void 0?{}:{"cover-y":e.coverY},...e.pageNumbers===!1?{"page-numbers":!1}:{},...e.pictureDpi===void 0?{}:{"picture-dpi":e.pictureDpi}}}function ta(e){let t=e.delta?.trim().charAt(0),n=t===`+`||t===`↑`;return!n&&t!==`-`&&t!==`−`&&t!==`–`&&t!==`↓`?`flat`:n===(e.downIsGood===!0)?`bad`:`good`}var na=[`value`,`percentage`,`category`,`series`],ra=[`bold`,`italic`,`underline`,`strike`],ia=(e,t)=>e.note===void 0&&t.note===void 0&&e.cite===void 0&&t.cite===void 0&&e.href===t.href&&JSON.stringify(sa(e.styles))===JSON.stringify(sa(t.styles));function aa(e){let t=[],n=(e,n,r)=>{if(e===``)return;let i={text:e,styles:n,...r===void 0?{}:{href:r}},a=t.at(-1);a&&ia(a,i)?a.text+=e:t.push(i)};return e.forEach((r,i)=>{if(r.note!==void 0||r.cite!==void 0||r.text===``&&r.href!==void 0){t.push({...r});return}let{styles:a,href:o}=r,s=!a.code&&o===void 0&&ra.some(e=>a[e])?/^(\s*)([\s\S]*?)(\s*)$/u.exec(r.text):null;if(!s){n(r.text,a,o);return}let[,c=``,l=``,u=``]=s,d={...a};delete d.bold,delete d.italic,delete d.underline,delete d.strike;let f=e[i-1]?.note!==void 0,p=e[i+1]?.note!==void 0;n(c,f?a:d,o),n(l,l===``?d:a,o),n(u,p?a:d,o)}),t}var oa=e=>e.length>0&&e.every(e=>typeof e==`object`&&!!e&&typeof e.text==`string`&&typeof e.styles==`object`);function sa(e){if(Array.isArray(e))return(oa(e)?aa(e):e).map(sa);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=sa(r))}return t}return e}var ca=e=>JSON.stringify(sa(e)),la=(e,t)=>e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&ca(e)===ca(r)}),ua=e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):`children`in e?e.children??[]:[];function*da(e){for(let t of e)yield t,yield*da(ua(t))}function fa(e){return pa(e).numbers}function pa(e){let t=new Map,n=new Set,r=new Set([...da(e)].flatMap(e=>e.type===`note`?[e.label.toLowerCase()]:[])),i=e=>{for(let i of e){let e=i.note?.toLowerCase();e!==void 0&&r.has(e)&&!t.has(e)&&(t.set(e,t.size+1),n.add(i))}};for(let t of da(e))if(t.type!==`note`&&(`content`in t&&i(t.content),t.type===`table`))for(let e of t.rows)for(let t of e)i(t);return{numbers:t,first:n}}var ma=e=>e.filter(e=>e.type!==`source`);function ha(e){let t=e.of.lastIndexOf(`#`),n=t<0?``:e.of.slice(t+1);return n!==``&&n!=="default"?n:((t<0?e.of:e.of.slice(0,t)).split(`/`).pop()??``).replace(/\.[^.]+$/u,``)}function ga(e){let t=e.width??720;return{name:e.of,props:{...e.props},width:t,height:e.height??Math.round(t*.5625),t:e.at??0}}var _a={gray:`#8B8A85`,brown:`#9A6B4B`,red:`#D6403A`,orange:`#EB6834`,yellow:`#EDA100`,green:`#1BAF7A`,blue:`#2A78D6`,purple:`#8A5CD6`,pink:`#E87BA4`},va=K.lead,ya={grid:K.rule,axis:K.ruleMid},ba={gap:80,overlap:-8},xa={size:10,title:13},Sa=e=>{let t=ri(e,_a);return t===void 0?void 0:`#${t}`},Ca=.55;function wa(e={},t=[]){let[n=ii[0],...r]=ci(e.accent===void 0?void 0:Sa(e.accent)),i=[n,n,...r];t.slice(0,i.length).forEach((e,t)=>{let n=Sa(e);n!==void 0&&(i[t]=n)}),t.length<2&&(i[1]=li(i[0]??n,Ca));let[a,o,s,c,l,u]=i;return{dk1:va,lt1:`#FFFFFF`,dk2:`#37352F`,lt2:`#EFEFED`,accent1:a,accent2:o,accent3:s,accent4:c,accent5:l,accent6:u,hlink:a,folHlink:a}}var Ta=new Set([`line`,`line-markers`,`scatter-lines`]),Ea={width:560,aspect:.6};function Da(e,t=720){let n=e.kind!==void 0&&ze(e.kind),r=e.width??(n?Math.min(t,Ea.width):t);return{width:r,height:e.height??Math.round(r*(n?Ea.aspect:.5625))}}function Oa(e){let t=e.trim().replace(/,/gu,``);if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:void 0}function ka(e,t){let n=Le(e.kind),r=e.labels,i=e.min!==void 0||e.max!==void 0||e.format!==void 0?{...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.format===void 0?{}:{format:e.format}}:void 0,a={...r===void 0?{}:{labels:{...r.includes(`value`)?{value:!0}:{},...r.includes(`percentage`)?{percentage:!0}:{},...r.includes(`category`)?{category:!0}:{},...r.includes(`series`)?{series:!0}:{},...e.format===void 0?{}:{format:e.format}}},...i===void 0?{}:{value_axis:i},...ze(e.kind)?{vary_by_categories:!0}:{}};if(e.table===void 0)return e.data===void 0||e.categories===void 0?void 0:{type:e.kind,data:e.data,categories:e.categories,series:e.series??[],...a};let[o=[],...s]=e.table,c=Math.max(0,...e.table.map(e=>e.length)),l=(e,t)=>e[t]??``,u=e=>s.map((n,r)=>{let i=Oa(l(n,e));return i===void 0?(t.push(`row ${String(r+1)} of its table: "${l(n,e)}" under ${l(o,e)||`column ${String(e+1)}`} is not a number`),null):i}),d=Array.from({length:Math.max(0,c-1)},(e,t)=>{let r=t+1;return{name:l(o,r)||`Series ${String(r)}`,values:u(r),...n?{x:u(0)}:{}}});if(d.length!==0)return{type:e.kind,...n?{}:{categories:s.map(e=>l(e,0))},series:d,...a}}function Aa(e,t){if(e.legend!==`none`)return e.legend===void 0?ze(e.kind)?`right`:t.series.length>1?`top`:void 0:e.legend}function ja(e,t={}){let n=[],r=ka(e,n);if(!r)return{problems:[...n,`it has no numbers to draw`]};let i=H(r,{title:e.title,base:t.base??``,rows:e=>{let n=t.data?.(e);if(n===void 0)throw Error(`there is no such file or table`);return n},problem:e=>n.push(e)});if(!i)return{problems:n};let a=Aa(e,i),o=wa(t.page,e.colors),s=[o.accent1,o.accent2,o.accent3,o.accent4,o.accent5,o.accent6],c=e=>({rgb:s[e%s.length]??`#000000`}),l=i.series.length===1&&!ze(e.kind)&&(e.colors?.length??0)>1?(e.colors??[]).map(Sa):void 0,u=l!==void 0||Ve(i),d=Le(e.kind),f=e.table===void 0?e.categories:e.table[0]?.[0],p=i.series.length===1?i.series[0]?.name:void 0,m={gridline_color:{rgb:ya.grid},line_color:{rgb:ya.axis}},h=Be(e.kind),g=e.kind.endsWith(`-clustered`),_={...i,category_axis:{...m,...i.category_axis,...d&&f!==void 0&&f!==``?{title:f}:{}},value_axis:{...m,...i.value_axis,...d&&p!==void 0&&p!==``?{title:p}:{}},...h&&i.gap_width===void 0?{gap_width:ba.gap}:{},...g&&i.series.length>1&&i.overlap===void 0?{overlap:ba.overlap}:{},series:i.series.map((t,n)=>{let r=u||t.color!==void 0?t:{...t,color:c(n)};return e.smooth&&Ta.has(e.kind)?{...r,smooth:!0}:r}),...l===void 0?{}:{vary_by_categories:!0},...u?{category_colors:i.categories.map((e,t)=>{let n=l?.[t%l.length];return n===void 0?c(l===void 0?t:0):{rgb:n}})}:{},...a===void 0?{}:{legend:a},font_size:xa.size,title_size:xa.title,font_color:{rgb:va}};return a===void 0&&delete _.legend,{chart:_,problems:n}}function Ma(e,t){if(e.alt!==void 0)return e.alt;let n=t?.series.map(e=>e.name).join(`, `)??``,r=[e.title,n].filter(e=>e!==void 0&&e!==``);return r.length>0?r.join(`: `):`Chart`}var Na={ink:`#D4D3CF`,grid:`#3A3936`,axis:`#5C5B57`};function Pa(e,t={}){let n=ja(e,t),{problems:r}=n;if(!n.chart)return{problems:r};let i=e=>({...e,gridline_color:{rgb:Na.grid},line_color:{rgb:Na.axis}}),a=t.dark===!0?{...n.chart,font_color:{rgb:Na.ink},value_axis:i(n.chart.value_axis),category_axis:i(n.chart.category_axis)}:n.chart,{width:o,height:s}=Da(e,t.room);return{svg:ot(a,o,s,{colors:wa(t.page,e.colors),paper:`none`,edge:`none`,...t.font===void 0?{}:{font:t.font},label:Ma(e,a)}),problems:r}}var Fa=`\\p{RI}\\p{RI}|[#*0-9]\\uFE0F?\\u20E3|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)\\p{EMod}?(?:\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F?)\\p{EMod}?)*`,Ia=`display:inline;width:1em;height:1em;margin:0 0.05em;vertical-align:-0.12em`;function La(e={}){let t=JSON.stringify(e.scope??`body`),n=e.face===void 0?`undefined`:JSON.stringify(e.face),r=String(e.size??128);return`(async () => {
|
|
3
|
-
const pattern = new RegExp(${JSON.stringify(Fa)}, "gu");
|
|
4
|
-
const root = document.querySelector(${t});
|
|
5
|
-
if (!root) return;
|
|
6
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
7
|
-
const nodes = [];
|
|
8
|
-
for (let n = walker.nextNode(); n; n = walker.nextNode()) {
|
|
9
|
-
pattern.lastIndex = 0;
|
|
10
|
-
const p = n.parentElement;
|
|
11
|
-
if (p && !p.closest("script, style, textarea, title") && pattern.test(n.data)) nodes.push(n);
|
|
12
|
-
}
|
|
13
|
-
pattern.lastIndex = 0;
|
|
14
|
-
if (nodes.length === 0) return;
|
|
15
|
-
const face = ${n};
|
|
16
|
-
if (face !== undefined) {
|
|
17
|
-
const all = nodes.map((n) => n.data.match(pattern).join("")).join("");
|
|
18
|
-
const faces = await document.fonts.load("64px " + JSON.stringify(face), all).catch(() => []);
|
|
19
|
-
if (faces.length === 0) return;
|
|
20
|
-
}
|
|
21
|
-
await document.fonts.ready;
|
|
22
|
-
const size = ${r};
|
|
23
|
-
const canvas = document.createElement("canvas");
|
|
24
|
-
canvas.width = canvas.height = size;
|
|
25
|
-
const ctx = canvas.getContext("2d");
|
|
26
|
-
ctx.textAlign = "center";
|
|
27
|
-
ctx.textBaseline = "middle";
|
|
28
|
-
const drawn = new Map();
|
|
29
|
-
const picture = (e, family) => {
|
|
30
|
-
const key = family + "\\u0000" + e;
|
|
31
|
-
if (!drawn.has(key)) {
|
|
32
|
-
ctx.clearRect(0, 0, size, size);
|
|
33
|
-
ctx.font = (size * 0.86) + "px " + family;
|
|
34
|
-
ctx.fillText(e, size / 2, size / 2);
|
|
35
|
-
drawn.set(key, canvas.toDataURL("image/png"));
|
|
36
|
-
}
|
|
37
|
-
const img = document.createElement("img");
|
|
38
|
-
img.className = "emoji";
|
|
39
|
-
img.alt = e;
|
|
40
|
-
img.setAttribute("style", ${JSON.stringify(Ia)});
|
|
41
|
-
img.src = drawn.get(key);
|
|
42
|
-
return img;
|
|
43
|
-
};
|
|
44
|
-
for (const n of nodes) {
|
|
45
|
-
const family = face !== undefined ? JSON.stringify(face) : getComputedStyle(n.parentElement).fontFamily;
|
|
46
|
-
const parts = [];
|
|
47
|
-
let at = 0;
|
|
48
|
-
for (const m of n.data.matchAll(pattern)) {
|
|
49
|
-
if (m.index > at) parts.push(document.createTextNode(n.data.slice(at, m.index)));
|
|
50
|
-
parts.push(picture(m[0], family));
|
|
51
|
-
at = m.index + m[0].length;
|
|
52
|
-
}
|
|
53
|
-
if (at < n.data.length) parts.push(document.createTextNode(n.data.slice(at)));
|
|
54
|
-
n.replaceWith(...parts);
|
|
55
|
-
}
|
|
56
|
-
await Promise.all([...root.querySelectorAll("img.emoji")].map((i) => i.decode().catch(() => undefined)));
|
|
57
|
-
})()`}function Ra(e,t=720){let n=e.columns.map(e=>e.width??1),r=n.reduce((e,t)=>e+t,0)||1,i=Math.max(0,t-32*(e.columns.length-1));return n.map(e=>Math.round(i*e/r))}function za(e){return e?{figure:`图`,table:`表`}:{figure:`Figure`,table:`Table`}}function Ba(e){switch(e.type){case`image`:case`component`:case`table`:return e.caption;case`chart`:return e.title;default:return}}function Va(e){return e.type===`image`||e.type===`component`||e.type===`table`||e.type===`chart`?e.id:void 0}function Ha(e){let t=0,n=0;for(let r of da(e))if(`content`in r)for(let e of r.content)t+=(e.text.match(/[㐀-鿿-ヿ]/gu)??[]).length,n+=(e.text.match(/[A-Za-z]+/gu)??[]).length;return t>n}function Ua(e,t={}){let n=new Map;if(zi(t).captions===`plain`)return n;let r=za(Ha(e)),i={figure:0,table:0};for(let t of da(e)){if(Ba(t)===void 0)continue;let e=t.type===`table`?`table`:`figure`;i[e]+=1,n.set(t,{kind:e,n:i[e],label:`${r[e]} ${String(i[e])}`})}return n}function Wa(e){try{return{html:et.renderToString(e,{displayMode:!0,throwOnError:!0,output:`htmlAndMathml`,strict:`ignore`})}}catch(t){let n=t instanceof Error?t.message:String(t);return{html:et.renderToString(e,{displayMode:!0,throwOnError:!1,output:`htmlAndMathml`,strict:`ignore`}),error:n}}}var Ga={math:`math`,mermaid:`mermaid`},Ka=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,qa=/^([—–-]|n\/a|N\/A|NA)$/u,Ja=e=>e.map(e=>e.text).join(``).trim();function Ya(e){let t=e.head===void 0||e.head===`both`,n=e.head===`column`||e.head===`both`,r=t?e.rows.slice(1):e.rows,i=Math.max(0,...e.rows.map(e=>e.length)),a=new Set;for(let e=+!!n;e<i;e++){let t=r.map(t=>Ja(t[e]??[]));t.some(e=>Ka.test(e))&&t.every(e=>e===``||Ka.test(e)||qa.test(e))&&a.add(e)}return a}function Xa(e){return e?.type===`heading`&&e.level===1&&e.toggle!==!0&&(e.children?.length??0)===0}function Za(e){let t=e[0];return Xa(t)?{title:t,body:e.slice(1)}:{title:void 0,body:[...e]}}function Qa(e){return Xa(e)?e.content.map(e=>e.text).join(``):``}function $a(e,t){let n=t.replace(/\s+/g,` `).trim();if(n===``)return;if(Xa(e)&&Qa(e)===n)return e;let r=[{text:n,styles:{}}];return{type:`heading`,level:1,...Xa(e)&&e.look?{look:e.look}:{},content:r}}function eo(e,t){return e?[e,...t]:[...t]}var to={sans:`Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`,serif:`Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif`,times:`Tinos, "Times New Roman", Times, "Noto Serif SC", serif`,mono:`Cousine, "Courier New", "Noto Sans SC", monospace`,song:`"Noto Serif SC", "Songti SC", SimSun, "宋体", serif`,hei:`"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif`,fangsong:`FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif`,kai:`"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif`,xiaobiaosong:`"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif`};function no(e={}){let t=zi(e).font??`sans`;return{text:to[t],heading:to[t],mono:to.mono}}var ro=(e={})=>e.accent===void 0?void 0:Sa(e.accent);function io(e){let t=new Map,n=new Map;for(let r of da(e)){if(r.type!==`heading`)continue;let e=r.content.map(e=>e.text).join(``).trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,``).replace(/\s/gu,`-`),i=e===``?`section`:e,a=n.get(i)??0;n.set(i,a+1),t.set(r,a===0?i:`${i}-${String(a)}`)}return t}function ao(e,t){let n=Math.min(...e),r=Math.max(...e)-n||1;return`<svg class="stat-trend" viewBox="0 0 100 24" preserveAspectRatio="none" aria-hidden="true"><path d="${e.map((t,i)=>[i/Math.max(1,e.length-1)*100,22-(t-n)/r*20]).map(([e,t],n)=>`${n===0?`M`:`L`}${(e??0).toFixed(1)} ${(t??0).toFixed(1)}`).join(` `)}" fill="none" stroke="${t}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}`${K.ink}${K.lead}${K.leadSoft}${K.ruleStrong}${K.ink}${K.ink}${K.leadSoft}${K.ruleStrong}${K.ruleStrong}${K.lead}${K.stone2}${K.stone}${K.stone}${K.ruleMid}${K.ruleStrong}${K.ruleStrong}${K.ruleStrong}${K.stone3}${K.leadSoft}${K.rule}${K.ruleStrong}${K.rule}${K.sheet}${K.lead}${K.rule}${K.sheet}${K.lead}${K.ink}${K.stone}${K.ruleMid}${K.leadSoft}${K.lead}${K.rule}${K.lead}${K.leadSoft}${K.ruleMid}`,`${La({scope:`main`,face:`Noto Color Emoji`})}`;function oo(){return{enter:{mdxFlowExpression:so,mdxTextExpression:co},exit:{mdxFlowExpression:lo,mdxFlowExpressionChunk:uo,mdxTextExpression:lo,mdxTextExpressionChunk:uo}}}function so(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function co(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function lo(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function uo(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}var fo=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),po={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function mo(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function ho(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function go(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function _o(e){return go(e)||mo(e)}var vo=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function yo(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?_o:u===`decimal`?mo:ho;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&fo.includes(y)&&(_=y,v=er(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&er(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):_o(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(bo(e))h(7,S),C=`�`;else if(e in po)h(6,S),C=po[e];else{let t=``;xo(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,vo[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function bo(e){return e>=55296&&e<=57343||e>1114111}function xo(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}function So(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new ut("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new ut(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new ut("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=yo(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new ut("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+ar(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new ut("Expected a closing tag for `"+S(r)+"` ("+ar({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new ut("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+ar(t.end)+") or another opening tag after the start of `"+t.type+"` ("+ar(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Co(){return{enter:{mdxjsEsm:wo},exit:{mdxjsEsm:To,mdxjsEsmData:Eo}}}function wo(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function To(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function Eo(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Do(){return[oo(),So(),Co()]}var Oo={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},ko={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Ao={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},jo=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Mo=[12288,12288,65281,65376,65504,65510],No=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Po=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Fo=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],Io=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},Lo=19968,[Ro,zo]=Bo(Fo);function Bo(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(Lo>=i&&Lo<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Vo=e=>e<161||e>1114109?!1:Io(jo,e),Ho=e=>e<12288||e>65510?!1:Io(Mo,e),Uo=e=>e<8361||e>65518?!1:Io(No,e),Wo=e=>e<32||e>10630?!1:Io(Po,e),Go=e=>e>=Ro&&e<=zo?!0:e<4352||e>262141?!1:Io(Fo,e);function Ko(e){return Vo(e)?`ambiguous`:Ho(e)?`fullwidth`:Uo(e)?`halfwidth`:Wo(e)?`narrow`:Go(e)?`wide`:`neutral`}function qo(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Jo(e){return qo(e),Ko(e)}function Yo(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function Xo(e){if(!e||e<4352)return!1;switch(Jo(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!Yo(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function Zo(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function Qo(e){return e!==null&&e>=65024&&e<=65038}var $o=ts(/\p{P}|\p{S}/u),es=ts(/\s/);function ts(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function ns(e){return!!(e&ko.characterGroupWhitespace)}function rs(e){return(e&cs.cjkPunctuation)===ko.characterGroupPunctuation}function is(e){return!!(e&cs.cjk)}function as(e){return!!(e&cs.cjkOrIvs)}function os(e){return e===cs.nonEmojiGeneralUseVS}function ss(e){return!!(e&cs.spaceOrPunctuation)}var cs;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(cs||={});function ls(e){if(e===Oo.eof||$n(e)||es(e))return ko.characterGroupWhitespace;let t=0;if(e>=4352){if(Qo(e))return cs.nonEmojiGeneralUseVS;switch(Xo(e)){case null:return cs.ivs;case!0:t|=cs.cjk}}return $o(e)&&(t|=ko.characterGroupPunctuation),t}function us(e,t,n){if(!os(e))return e;let r=t(),i=ls(r);return!r||ns(i)?e:Zo(r,n)?cs.cjkPunctuation:ds(i)}function ds(e){return e&~cs.ivs}function fs(e){return!!(e&&e>=55296&&e<=56319)}function ps(e){return!!(e&&e>=56320&&e<=57343)}function ms(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function hs(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var gs=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=hs(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function _s(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var vs={name:`attention`,resolveAll:ys,tokenize:bs};function ys(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xs(d,-c),xs(f,c),o={type:c>1?Ao.strongSequence:Ao.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Ao.strongSequence:Ao.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Ao.strongText:Ao.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Ao.strong:Ao.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Xn(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Xn(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Xn(l,Zn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Xn(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Xn(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,or(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function bs(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=ps(a)?ms(a,r(),i):a,s=ls(o),c=new gs(o,r(),i),l=us(s,c.value.bind(c),o),u;return d;function d(t){return t===Oo.asterisk||Oo.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=ls(fs(a)?_s(a,r(),i):a),d=rs(l),p=o===Oo.asterisk||o===Oo.underscore,m=d||ns(l)||p,h=rs(c),g=a===Oo.asterisk||a===Oo.underscore,_=h||ns(c)||g,v=as(l),y=!_||h&&(m||v)||n.includes(a)&&a!==Oo.asterisk&&a!==Oo.underscore,b=!m||d&&(_||is(c))||n.includes(o)&&o!==Oo.asterisk&&o!==Oo.underscore;return s._open=!!(u===Oo.asterisk?y:y&&(ss(l)||!b)),s._close=!!(u===Oo.asterisk?b:b&&(ss(c)||!y)),t(a)}}function xs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Ss(){return{text:{[Oo.asterisk]:vs,[Oo.underscore]:vs},insideSpan:{null:[vs]}}}var Cs=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],ws=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],Ts=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,Es=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,Ds={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},Os=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,ks={5:Os,"5module":Os+` export import`,6:Os+` const class extends export import super`},As=/^in(stanceof)?$/,js=RegExp(`[`+Es+`]`),Ms=RegExp(`[`+Es+Ts+`]`);function Ns(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ps(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&js.test(String.fromCharCode(e)):t!==!1&&Ns(e,ws)}function Fs(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ms.test(String.fromCharCode(e)):t===!1?!1:Ns(e,ws)||Ns(e,Cs)}var Is=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Ls(e,t){return new Is(e,{beforeExpr:!0,binop:t})}var Rs={beforeExpr:!0},zs={startsExpr:!0},Bs={};function Vs(e,t){return t===void 0&&(t={}),t.keyword=e,Bs[e]=new Is(e,t)}var q={num:new Is(`num`,zs),regexp:new Is(`regexp`,zs),string:new Is(`string`,zs),name:new Is(`name`,zs),privateId:new Is(`privateId`,zs),eof:new Is(`eof`),bracketL:new Is(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new Is(`]`),braceL:new Is(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new Is(`}`),parenL:new Is(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new Is(`)`),comma:new Is(`,`,Rs),semi:new Is(`;`,Rs),colon:new Is(`:`,Rs),dot:new Is(`.`),question:new Is(`?`,Rs),questionDot:new Is(`?.`),arrow:new Is(`=>`,Rs),template:new Is(`template`),invalidTemplate:new Is(`invalidTemplate`),ellipsis:new Is(`...`,Rs),backQuote:new Is("`",zs),dollarBraceL:new Is("${",{beforeExpr:!0,startsExpr:!0}),eq:new Is(`=`,{beforeExpr:!0,isAssign:!0}),assign:new Is(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new Is(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Is(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Ls(`||`,1),logicalAND:Ls(`&&`,2),bitwiseOR:Ls(`|`,3),bitwiseXOR:Ls(`^`,4),bitwiseAND:Ls(`&`,5),equality:Ls(`==/!=/===/!==`,6),relational:Ls(`</>/<=/>=`,7),bitShift:Ls(`<</>>/>>>`,8),plusMin:new Is(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Ls(`%`,10),star:Ls(`*`,10),slash:Ls(`/`,10),starstar:new Is(`**`,{beforeExpr:!0}),coalesce:Ls(`??`,1),_break:Vs(`break`),_case:Vs(`case`,Rs),_catch:Vs(`catch`),_continue:Vs(`continue`),_debugger:Vs(`debugger`),_default:Vs(`default`,Rs),_do:Vs(`do`,{isLoop:!0,beforeExpr:!0}),_else:Vs(`else`,Rs),_finally:Vs(`finally`),_for:Vs(`for`,{isLoop:!0}),_function:Vs(`function`,zs),_if:Vs(`if`),_return:Vs(`return`,Rs),_switch:Vs(`switch`),_throw:Vs(`throw`,Rs),_try:Vs(`try`),_var:Vs(`var`),_const:Vs(`const`),_while:Vs(`while`,{isLoop:!0}),_with:Vs(`with`),_new:Vs(`new`,{beforeExpr:!0,startsExpr:!0}),_this:Vs(`this`,zs),_super:Vs(`super`,zs),_class:Vs(`class`,zs),_extends:Vs(`extends`,Rs),_export:Vs(`export`),_import:Vs(`import`,zs),_null:Vs(`null`,zs),_true:Vs(`true`,zs),_false:Vs(`false`,zs),_in:Vs(`in`,{beforeExpr:!0,binop:7}),_instanceof:Vs(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:Vs(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Vs(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Vs(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},Hs=/\r\n?|\n|\u2028|\u2029/,Us=new RegExp(Hs.source,`g`);function Ws(e){return e===10||e===13||e===8232||e===8233}function Gs(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(Ws(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Ks=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,qs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Js=Object.prototype,Ys=Js.hasOwnProperty,Xs=Js.toString,Zs=Object.hasOwn||(function(e,t){return Ys.call(e,t)}),Qs=Array.isArray||(function(e){return Xs.call(e)===`[object Array]`}),$s=Object.create(null);function ec(e){return $s[e]||($s[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function tc(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var nc=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,rc=function(e,t){this.line=e,this.column=t};rc.prototype.offset=function(e){return new rc(this.line,this.column+e)};var ic=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function ac(e,t){for(var n=1,r=0;;){var i=Gs(e,r,t);if(i<0)return new rc(n,t-r);++n,r=i}}var oc={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},sc=!1;function cc(e){var t={};for(var n in oc)t[n]=e&&Zs(e,n)?e[n]:oc[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!sc&&typeof console==`object`&&console.warn&&(sc=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
58
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),Qs(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(Qs(t.onComment)&&(t.onComment=lc(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function lc(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new ic(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var uc=1,dc=2,fc=4,pc=8,mc=16,hc=32,gc=64,_c=128,vc=256,yc=512,bc=1024,xc=uc|dc|vc;function Sc(e,t){return dc|(e?fc:0)|(t?pc:0)}var Cc=0,wc=1,Tc=2,Ec=3,Dc=4,Oc=5,kc=function(e,t,n){this.options=e=cc(e),this.sourceFile=e.sourceFile,this.keywords=ec(ks[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=Ds[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=ec(r);var i=(r?r+` `:``)+Ds.strict;this.reservedWordsStrict=ec(i),this.reservedWordsStrictBind=ec(i+` `+Ds.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
|
|
59
|
-
`,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Hs).length)):this.lineStart=0,this.type=q.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?dc:uc),this.regexpState=null,this.privateNameStack=[]},Ac={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};kc.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},Ac.inFunction.get=function(){return(this.currentVarScope().flags&dc)>0},Ac.inGenerator.get=function(){return(this.currentVarScope().flags&pc)>0},Ac.inAsync.get=function(){return(this.currentVarScope().flags&fc)>0},Ac.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(vc|yc))return!1;if(t&dc)return(t&fc)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ac.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&uc)},Ac.allowSuper.get=function(){return(this.currentThisScope().flags&gc)>0||this.options.allowSuperOutsideMethod},Ac.allowDirectSuper.get=function(){return(this.currentThisScope().flags&_c)>0},Ac.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ac.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(vc|yc)||t&dc&&!(t&mc))return!0}return!1},Ac.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&bc||!this.inModule&&e&uc)},Ac.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&vc)>0},kc.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},kc.parse=function(e,t){return new this(t,e).parse()},kc.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},kc.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(kc.prototype,Ac);var jc=kc.prototype,Mc=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;jc.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){qs.lastIndex=e,e+=qs.exec(this.input)[0].length;var t=Mc.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){qs.lastIndex=e+t[0].length;var n=qs.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||Hs.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&Nc(this,r))}e+=t[0].length,qs.lastIndex=e,e+=qs.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function Nc(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!Fs(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}jc.eat=function(e){return this.type===e&&(this.next(),!0)},jc.isContextual=function(e){return this.type===q.name&&this.value===e&&!this.containsEsc},jc.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},jc.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},jc.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},jc.canInsertSemicolon=function(){return this.type===q.eof||this.type===q.braceR||Hs.test(this.input.slice(this.lastTokEnd,this.start))},jc.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},jc.semicolon=function(){!this.eat(q.semi)&&!this.insertSemicolon()&&this.unexpected()},jc.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},jc.expect=function(e){this.eat(e)||this.unexpected()},jc.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Pc=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};jc.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},jc.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},jc.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},jc.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var J=kc.prototype;J.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==q.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Fc={kind:`loop`},Ic={kind:`switch`};J.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;qs.lastIndex=this.pos;var t=qs.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(Ps(r)){var i=n;do n+=r<=65535?1:2;while(Fs(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!As.test(a))return!0}return!1},J.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;qs.lastIndex=this.pos;var e=qs.exec(this.input),t=this.pos+e[0].length,n;return!Hs.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(Fs(n=this.fullCharCodeAt(t+8))||n===92))},J.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;qs.lastIndex=this.pos;var n=qs.exec(this.input),r=this.pos+n[0].length;if(Hs.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||Fs(a=this.fullCharCodeAt(i))||a===92)return!1;qs.lastIndex=i;var o=qs.exec(this.input);if(r=i+o[0].length,o&&Hs.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!Ps(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(Fs(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);if(As.test(l))return!1;if(t&&!e&&l===`of`){qs.lastIndex=r;var u=qs.exec(this.input);if(r+=u[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},J.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},J.isUsing=function(e){return this.isUsingKeyword(!1,e)},J.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=q._var,a=`let`),r){case q._break:case q._continue:return this.parseBreakContinueStatement(i,r.keyword);case q._debugger:return this.parseDebuggerStatement(i);case q._do:return this.parseDoStatement(i);case q._for:return this.parseForStatement(i);case q._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case q._class:return e&&this.unexpected(),this.parseClass(i,!0);case q._if:return this.parseIfStatement(i);case q._return:return this.parseReturnStatement(i);case q._switch:return this.parseSwitchStatement(i);case q._throw:return this.parseThrowStatement(i);case q._try:return this.parseTryStatement(i);case q._const:case q._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case q._while:return this.parseWhileStatement(i);case q._with:return this.parseWithStatement(i);case q.braceL:return this.parseBlock(!0,i);case q.semi:return this.parseEmptyStatement(i);case q._export:case q._import:if(this.options.ecmaVersion>10&&r===q._import){qs.lastIndex=this.pos;var o=qs.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===q._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===q.name&&d.type===`Identifier`&&this.eat(q.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},J.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(q.semi)||this.insertSemicolon()?e.label=null:this.type===q.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},J.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},J.parseDoStatement=function(e){return this.next(),this.labels.push(Fc),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(q._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(q.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},J.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Fc),this.enterScope(0),this.expect(q.parenL),this.type===q.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===q._var||this.type===q._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Pc,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===q._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===q._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},J.parseForAfterInit=function(e,t,n){return(this.type===q._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===q._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},J.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Rc|(n?0:zc),!1,t)},J.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(q._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},J.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(q.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},J.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(q.braceL),this.labels.push(Ic),this.enterScope(bc);for(var t,n=!1;this.type!==q.braceR;)if(this.type===q._case||this.type===q._default){var r=this.type===q._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(q.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},J.parseThrowStatement=function(e){return this.next(),Hs.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Lc=[];J.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?hc:0),this.checkLValPattern(e,t?Dc:Tc),this.expect(q.parenR),e},J.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===q._catch){var t=this.startNode();this.next(),this.eat(q.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(q._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},J.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},J.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Fc),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},J.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},J.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},J.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===q._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},J.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},J.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(q.braceL),e&&this.enterScope(0);this.type!==q.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},J.parseFor=function(e,t){return e.init=t,this.expect(q.semi),e.test=this.type===q.semi?null:this.parseExpression(),this.expect(q.semi),e.update=this.type===q.parenR?null:this.parseExpression(),this.expect(q.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},J.parseForIn=function(e,t){var n=this.type===q._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(q.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},J.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(q.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===q._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==q._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==q._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(q.comma))break}return e},J.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?wc:Tc,!1)};var Rc=1,zc=2,Bc=4;J.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===q.star&&t&zc&&this.unexpected(),e.generator=this.eat(q.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Rc&&(e.id=t&Bc&&this.type!==q.name?null:this.parseIdent(),e.id&&!(t&zc)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?wc:Tc:Ec));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Sc(e.async,e.generator)),t&Rc||(e.id=this.type===q.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Rc?`FunctionDeclaration`:`FunctionExpression`)},J.parseFunctionParams=function(e){this.expect(q.parenL),e.params=this.parseBindingList(q.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},J.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(q.braceL);this.type!==q.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Vc(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},J.parseClassElement=function(e){if(this.eat(q.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(q.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===q.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===q.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(q.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===q.parenL||o!==`method`||i||a){var l=!n.static&&Hc(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},J.isClassElementNameStart=function(){return this.type===q.name||this.type===q.privateId||this.type===q.num||this.type===q.string||this.type===q.bracketL||this.type.keyword},J.parseClassElementName=function(e){this.type===q.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},J.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Hc(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},J.parseClassField=function(e){return Hc(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Hc(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(q.eq)?(this.enterScope(yc|gc),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},J.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(vc|gc);this.type!==q.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},J.parseClassId=function(e,t){this.type===q.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Tc,!1)):(t===!0&&this.unexpected(),e.id=null)},J.parseClassSuper=function(e){e.superClass=this.eat(q._extends)?this.parseExprSubscripts(null,!1):null},J.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},J.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];Zs(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Vc(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Hc(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}J.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==q.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},J.parseExport=function(e,t){if(this.next(),this.eat(q.star))return this.parseExportAllDeclaration(e,t);if(this.eat(q._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==q.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},J.parseExportDeclaration=function(e){return this.parseStatement(null)},J.parseExportDefaultDeclaration=function(){var e;if(this.type===q._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Rc|Bc,!1,e)}if(this.type===q._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},J.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),Zs(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},J.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},J.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},J.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},J.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},J.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(q.braceL);!this.eat(q.braceR);){if(n)n=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;t.push(this.parseExportSpecifier(e))}return t},J.parseImport=function(e){return this.next(),this.type===q.string?(e.specifiers=Lc,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===q.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},J.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Tc),this.finishNode(e,`ImportSpecifier`)},J.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Tc),this.finishNode(e,`ImportDefaultSpecifier`)},J.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,Tc),this.finishNode(e,`ImportNamespaceSpecifier`)},J.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===q.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(q.comma)))return e;if(this.type===q.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(q.braceL);!this.eat(q.braceR);){if(t)t=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;e.push(this.parseImportSpecifier())}return e},J.parseWithClause=function(){var e=[];if(!this.eat(q._with))return e;this.expect(q.braceL);for(var t={},n=!0;!this.eat(q.braceR);){if(n)n=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;Zs(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},J.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===q.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(q.colon),this.type!==q.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},J.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===q.string){var e=this.parseLiteral(this.value);return nc.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},J.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},J.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Uc=kc.prototype;Uc.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Uc.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Uc.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Uc.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==q.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Uc.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case q.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(q.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case q.braceL:return this.parseObj(!0)}return this.parseIdent()},Uc.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(q.comma),t&&this.type===q.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===q.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Uc.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Uc.parseBindingListItem=function(e){return e},Uc.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(q.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Uc.checkLValSimple=function(e,t,n){t===void 0&&(t=Cc);var r=t!==Cc;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===Tc&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(Zs(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Oc&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Uc.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Cc),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Uc.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Cc),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Wc=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Gc={b_stat:new Wc(`{`,!1),b_expr:new Wc(`{`,!0),b_tmpl:new Wc("${",!1),p_stat:new Wc(`(`,!1),p_expr:new Wc(`(`,!0),q_tmpl:new Wc("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Wc(`function`,!1),f_expr:new Wc(`function`,!0),f_expr_gen:new Wc(`function`,!0,!1,null,!0),f_gen:new Wc(`function`,!1,!1,null,!0)},Kc=kc.prototype;Kc.initialContext=function(){return[Gc.b_stat]},Kc.curContext=function(){return this.context[this.context.length-1]},Kc.braceIsBlock=function(e){var t=this.curContext();return t===Gc.f_expr||t===Gc.f_stat?!0:e===q.colon&&(t===Gc.b_stat||t===Gc.b_expr)?!t.isExpr:e===q._return||e===q.name&&this.exprAllowed?Hs.test(this.input.slice(this.lastTokEnd,this.start)):e===q._else||e===q.semi||e===q.eof||e===q.parenR||e===q.arrow?!0:e===q.braceL?t===Gc.b_stat:e===q._var||e===q._const||e===q.name?!1:!this.exprAllowed},Kc.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Kc.updateContext=function(e){var t,n=this.type;n.keyword&&e===q.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Kc.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},q.parenR.updateContext=q.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===Gc.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},q.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Gc.b_stat:Gc.b_expr),this.exprAllowed=!0},q.dollarBraceL.updateContext=function(){this.context.push(Gc.b_tmpl),this.exprAllowed=!0},q.parenL.updateContext=function(e){var t=e===q._if||e===q._for||e===q._with||e===q._while;this.context.push(t?Gc.p_stat:Gc.p_expr),this.exprAllowed=!0},q.incDec.updateContext=function(){},q._function.updateContext=q._class.updateContext=function(e){e.beforeExpr&&e!==q._else&&(e!==q.semi||this.curContext()===Gc.p_stat)&&!(e===q._return&&Hs.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==q.colon&&e!==q.braceL||this.curContext()!==Gc.b_stat)?this.context.push(Gc.f_expr):this.context.push(Gc.f_stat),this.exprAllowed=!1},q.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},q.backQuote.updateContext=function(){this.curContext()===Gc.q_tmpl?this.context.pop():this.context.push(Gc.q_tmpl),this.exprAllowed=!1},q.star.updateContext=function(e){if(e===q._function){var t=this.context.length-1;this.context[t]===Gc.f_expr?this.context[t]=Gc.f_expr_gen:this.context[t]=Gc.f_gen}this.exprAllowed=!0},q.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==q.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var qc=kc.prototype;qc.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},qc.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===q.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(q.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},qc.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Pc,r=!0);var s=this.start,c=this.startLoc;(this.type===q.parenL||this.type===q.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===q.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===q.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},qc.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(q.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(q.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},qc.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},qc.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==q._in)&&a>r){var o=this.type===q.logicalOR||this.type===q.logicalAND,s=this.type===q.coalesce;s&&(a=q.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===q.coalesce||s&&(this.type===q.logicalOR||this.type===q.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},qc.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},qc.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===q.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&Jc(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Yc(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===q.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==q._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(q.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Jc(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&Jc(e.expression)}function Yc(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Yc(e.expression)||e.type===`ParenthesizedExpression`&&Yc(e.expression)}qc.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},qc.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},qc.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(q.arrow)},qc.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},qc.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(q.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(q.bracketL);if(l||c&&this.type!==q.parenL&&this.type!==q.backQuote||this.eat(q.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(q.bracketR)):u.property=this.type===q.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(q.parenL)){var d=new Pc,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(q.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===q.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},qc.parseExprAtom=function(e,t,n){this.type===q.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case q._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===q.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==q.dot&&this.type!==q.bracketL&&this.type!==q.parenL&&this.unexpected(),this.finishNode(r,`Super`);case q._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case q.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(q._function))return this.overrideContext(Gc.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(q.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===q.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(q.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case q.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case q.num:case q.string:return this.parseLiteral(this.value);case q._null:case q._true:case q._false:return r=this.startNode(),r.value=this.type===q._null?null:this.type===q._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case q.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case q.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(q.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case q.braceL:return this.overrideContext(Gc.b_expr),this.parseObj(!1,e);case q._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case q._class:return this.parseClass(this.startNode(),!1);case q._new:return this.parseNew();case q.backQuote:return this.parseTemplate();case q._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},qc.parseExprAtomDefault=function(){this.unexpected()},qc.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===q.parenL&&!e)return this.parseDynamicImport(t);if(this.type===q.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},qc.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(q.parenR)?e.options=null:(this.expect(q.comma),this.afterTrailingComma(q.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(q.parenR)||(this.expect(q.comma),this.afterTrailingComma(q.parenR)||this.unexpected())));else if(!this.eat(q.parenR)){var t=this.start;this.eat(q.comma)&&this.eat(q.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},qc.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},qc.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},qc.parseParenExpression=function(){this.expect(q.parenL);var e=this.parseExpression();return this.expect(q.parenR),e},qc.shouldParseArrow=function(e){return!this.canInsertSemicolon()},qc.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Pc,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==q.parenR;){if(l?l=!1:this.expect(q.comma),a&&this.afterTrailingComma(q.parenR,!0)){u=!0;break}if(this.type===q.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(q.parenR),e&&this.shouldParseArrow(c)&&this.eat(q.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},qc.parseParenItem=function(e){return e},qc.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Xc=[];qc.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===q.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(q.parenL)?this.parseExprList(q.parenR,this.options.ecmaVersion>=8,!1):Xc,this.finishNode(e,`NewExpression`)},qc.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===q.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
60
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
61
|
-
`),cooked:this.value},this.next(),n.tail=this.type===q.backQuote,this.finishNode(n,`TemplateElement`)},qc.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===q.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(q.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(q.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},qc.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===q.name||this.type===q.num||this.type===q.string||this.type===q.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===q.star)&&!Hs.test(this.input.slice(this.lastTokEnd,this.start))},qc.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(q.braceR);){if(r)r=!1;else if(this.expect(q.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(q.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},qc.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(q.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===q.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(q.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(q.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},qc.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},qc.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===q.colon&&this.unexpected(),this.eat(q.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===q.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==q.comma&&this.type!==q.braceR&&this.type!==q.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===q.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},qc.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(q.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(q.bracketR),e.key;e.computed=!1}return e.key=this.type===q.num||this.type===q.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},qc.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},qc.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Sc(t,r.generator)|gc|(n?_c:0)),this.expect(q.parenL),r.params=this.parseBindingList(q.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},qc.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Sc(n,!1)|mc),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},qc.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==q.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Oc),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},qc.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},qc.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,wc,t?null:n)}},qc.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(q.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===q.comma?o=null:this.type===q.ellipsis?(o=this.parseSpread(r),r&&this.type===q.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},qc.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&xc)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},qc.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},qc.parseIdentNode=function(){var e=this.startNode();return this.type===q.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=q.name):this.unexpected(),e},qc.parsePrivateIdent=function(){var e=this.startNode();return this.type===q.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},qc.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===q.semi||this.canInsertSemicolon()||this.type!==q.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(q.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},qc.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Zc=kc.prototype;Zc.raise=function(e,t){var n=ac(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Zc.raiseRecoverable=Zc.raise,Zc.curPosition=function(){if(this.options.locations)return new rc(this.curLine,this.pos-this.lineStart)};var Qc=kc.prototype,$c=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Qc.enterScope=function(e){this.scopeStack.push(new $c(e))},Qc.exitScope=function(){this.scopeStack.pop()},Qc.treatFunctionsAsVarInScope=function(e){return e.flags&dc||!this.inModule&&e.flags&uc},Qc.declareName=function(e,t,n){var r=!1;if(t===Tc){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&uc&&delete this.undefinedExports[e]}else if(t===Dc)this.currentScope().lexical.push(e);else if(t===Ec){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&hc&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&uc&&delete this.undefinedExports[e],s.flags&xc)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Qc.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Qc.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Qc.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(xc|yc|vc))return t}},Qc.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(xc|yc|vc)&&!(t.flags&mc))return t}};var el=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new ic(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},tl=kc.prototype;tl.startNode=function(){return new el(this,this.start,this.startLoc)},tl.startNodeAt=function(e,t){return new el(this,e,t)};function nl(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}tl.finishNode=function(e,t){return nl.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},tl.finishNodeAt=function(e,t,n,r){return nl.call(this,e,t,n,r)},tl.copyNode=function(e){var t=new el(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var rl=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,il=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,al=il+` Extended_Pictographic`,ol=al,sl=ol+` EBase EComp EMod EPres ExtPict`,cl=sl,ll={9:il,10:al,11:ol,12:sl,13:cl,14:cl},ul={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},dl=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,fl=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,pl=fl+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,ml=pl+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,hl=ml+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,gl=hl+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,_l={9:fl,10:pl,11:ml,12:hl,13:gl,14:gl+` `+rl},vl={};function yl(e){var t=vl[e]={binary:ec(ll[e]+` `+dl),binaryOfStrings:ec(ul[e]),nonBinary:{General_Category:ec(dl),Script:ec(_l[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var bl=0,xl=[9,10,11,12,13,14];bl<xl.length;bl+=1){var Sl=xl[bl];yl(Sl)}var Y=kc.prototype,Cl=function(e,t){this.parent=e,this.base=t||this};Cl.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},Cl.prototype.sibling=function(){return new Cl(this.parent,this.base)};var wl=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=vl[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};wl.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},wl.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},wl.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},wl.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},wl.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},wl.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},wl.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},wl.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},wl.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Y.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function Tl(e){for(var t in e)return!0;return!1}Y.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Tl(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Y.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Y.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Cl(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Y.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Y.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Y.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Y.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Y.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Y.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Y.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Y.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Y.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Y.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Y.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&El(n);)t+=tc(n),e.advance();return t};function El(e){return e===105||e===109||e===115}Y.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Y.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Y.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Dl(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Dl(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Y.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Dl(n);)e.advance();return e.pos!==t},Y.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},Y.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Y.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Y.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=tc(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=tc(e.lastIntValue);return!0}return!1},Y.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Ol(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ol(e){return Ps(e,!0)||e===36||e===95}Y.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),kl(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function kl(e){return Fs(e,!0)||e===36||e===95||e===8204||e===8205}Y.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Y.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Y.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Y.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Y.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Y.regexp_eatZero=function(e){return e.current()===48&&!Vl(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Y.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},Y.regexp_eatControlLetter=function(e){var t=e.current();return Al(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Al(e){return e>=65&&e<=90||e>=97&&e<=122}Y.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&jl(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function jl(e){return e>=0&&e<=1114111}Y.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},Y.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ml=0,Nl=1,Pl=2;Y.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Fl(t))return e.lastIntValue=-1,e.advance(),Nl;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Pl&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ml};function Fl(e){return e===100||e===68||e===115||e===83||e===119||e===87}Y.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),Nl}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ml},Y.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Zs(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Y.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Nl;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Pl;e.raise(`Invalid property name`)},Y.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Il(t=e.current());)e.lastStringValue+=tc(t),e.advance();return e.lastStringValue!==``};function Il(e){return Al(e)||e===95}Y.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Ll(t=e.current());)e.lastStringValue+=tc(t),e.advance();return e.lastStringValue!==``};function Ll(e){return Il(e)||Vl(e)}Y.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Y.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Pl&&e.raise(`Negated character class may contain strings`),!0}return!1},Y.regexp_classContents=function(e){return e.current()===93?Nl:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Nl)},Y.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Y.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Wl(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},Y.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Y.regexp_classSetExpression=function(e){var t=Nl,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===Pl&&(t=Pl);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==Pl&&(t=Nl):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Pl&&(t=Pl)}},Y.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Y.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Nl:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Y.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Pl&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Y.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Y.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Pl&&(t=Pl);return t},Y.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Nl:Pl},Y.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Rl(n)||zl(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Rl(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function zl(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Y.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Bl(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Bl(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Y.regexp_eatClassControlLetter=function(e){var t=e.current();return Vl(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Y.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Y.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Vl(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Vl(e){return e>=48&&e<=57}Y.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Hl(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ul(n),e.advance();return e.pos!==t};function Hl(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ul(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Y.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},Y.regexp_eatOctalDigit=function(e){var t=e.current();return Wl(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Wl(e){return e>=48&&e<=55}Y.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Hl(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Ul(i),e.advance()}return!0};var Gl=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ic(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Kl=kc.prototype;Kl.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Gl(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Kl.getToken=function(){return this.next(),new Gl(this)},typeof Symbol<`u`&&(Kl[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===q.eof,value:t}}}}),Kl.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(q.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Kl.readToken=function(e){return Ps(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Kl.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Kl.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Kl.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Gs(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Kl.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Ws(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Kl.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&Ks.test(String.fromCharCode(e)))++this.pos;else break loop}}},Kl.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Kl.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(q.ellipsis)):(++this.pos,this.finishToken(q.dot))},Kl.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(q.assign,2):this.finishOp(q.slash,1)},Kl.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?q.star:q.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=q.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(q.assign,n+1):this.finishOp(r,n)},Kl.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(q.assign,3):this.finishOp(e===124?q.logicalOR:q.logicalAND,2):t===61?this.finishOp(q.assign,2):this.finishOp(e===124?q.bitwiseOR:q.bitwiseAND,1)},Kl.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(q.assign,2):this.finishOp(q.bitwiseXOR,1)},Kl.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Hs.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(q.incDec,2):t===61?this.finishOp(q.assign,2):this.finishOp(q.plusMin,1)},Kl.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(q.assign,n+1):this.finishOp(q.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(q.relational,n))},Kl.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(q.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(q.arrow)):this.finishOp(e===61?q.eq:q.prefix,1)},Kl.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(q.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(q.assign,3):this.finishOp(q.coalesce,2)}return this.finishOp(q.question,1)},Kl.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Ps(t,!0)||t===92))return this.finishToken(q.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+tc(t)+`'`)},Kl.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(q.parenL);case 41:return++this.pos,this.finishToken(q.parenR);case 59:return++this.pos,this.finishToken(q.semi);case 44:return++this.pos,this.finishToken(q.comma);case 91:return++this.pos,this.finishToken(q.bracketL);case 93:return++this.pos,this.finishToken(q.bracketR);case 123:return++this.pos,this.finishToken(q.braceL);case 125:return++this.pos,this.finishToken(q.braceR);case 58:return++this.pos,this.finishToken(q.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(q.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(q.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+tc(e)+`'`)},Kl.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Kl.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(Hs.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new wl(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(q.regexp,{pattern:i,flags:o,value:c})},Kl.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function ql(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Jl(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Kl.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Jl(this.input.slice(t,this.pos)),++this.pos):Ps(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(q.num,n)},Kl.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Jl(this.input.slice(t,this.pos));return++this.pos,Ps(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(q.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Ps(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=ql(this.input.slice(t,this.pos),n);return this.finishToken(q.num,a)},Kl.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Kl.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ws(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(q.string,t)};var Yl={};Kl.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Yl)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Kl.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yl;this.raise(e,t)},Kl.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===q.template||this.type===q.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(q.dollarBraceL)):(++this.pos,this.finishToken(q.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(q.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ws(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
62
|
-
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Kl.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(q.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
63
|
-
`&&++this.pos;case`
|
|
64
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Kl.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
65
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return tc(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Ws(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Kl.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Kl.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Fs(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Ps:Fs)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=tc(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Kl.readWord=function(){var e=this.readWord1(),t=q.name;return this.keywords.test(e)&&(t=Bs[e]),this.finishToken(t,e)},kc.acorn={Parser:kc,version:`8.19.0`,defaultOptions:oc,Position:rc,SourceLocation:ic,getLineInfo:ac,Node:el,TokenType:Is,tokTypes:q,keywordTypes:Bs,TokContext:Wc,tokContexts:Gc,isIdentifierChar:Fs,isIdentifierStart:Ps,Token:Gl,isNewLine:Ws,lineBreak:Hs,lineBreakG:Us,nonASCIIwhitespace:Ks};var Xl=t(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),Zl=t(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(n,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,D=Object.prototype,O=D.hasOwnProperty,k=D.toString,A=Object.hasOwn||(function(e,t){return O.call(e,t)}),j=Array.isArray||(function(e){return k.call(e)===`[object Array]`}),M=Object.create(null);function N(e){return M[e]||(M[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function P(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var F=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,I=function(e,t){this.line=e,this.column=t};I.prototype.offset=function(e){return new I(this.line,this.column+e)};var L=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new I(n,t-r);++n,r=i}}var z={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},B=!1;function ee(e){var t={};for(var n in z)t[n]=e&&A(e,n)?e[n]:z[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!B&&typeof console==`object`&&console.warn&&(B=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
66
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),j(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(j(t.onComment)&&(t.onComment=te(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function te(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new L(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ne=1,re=2,ie=4,ae=8,V=16,oe=32,se=64,ce=128,le=256,ue=512,de=1024,fe=ne|re|le;function pe(e,t){return re|(e?ie:0)|(t?ae:0)}var me=0,he=1,ge=2,_e=3,ve=4,ye=5,be=function(e,t,n){this.options=e=ee(e),this.sourceFile=e.sourceFile,this.keywords=N(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=N(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=N(i),this.reservedWordsStrictBind=N(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
|
|
67
|
-
`,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(x).length)):this.lineStart=0,this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?re:ne),this.regexpState=null,this.privateNameStack=[]},xe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};be.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},xe.inFunction.get=function(){return(this.currentVarScope().flags&re)>0},xe.inGenerator.get=function(){return(this.currentVarScope().flags&ae)>0},xe.inAsync.get=function(){return(this.currentVarScope().flags&ie)>0},xe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(le|ue))return!1;if(t&re)return(t&ie)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},xe.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ne)},xe.allowSuper.get=function(){return(this.currentThisScope().flags&se)>0||this.options.allowSuperOutsideMethod},xe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&ce)>0},xe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},xe.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(le|ue)||t&re&&!(t&V))return!0}return!1},xe.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&de||!this.inModule&&e&ne)},xe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&le)>0},be.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},be.parse=function(e,t){return new this(t,e).parse()},be.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},be.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(be.prototype,xe);var Se=be.prototype,Ce=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Se.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=Ce.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&we(this,r))}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function we(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!p(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}Se.eat=function(e){return this.type===e&&(this.next(),!0)},Se.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Se.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Se.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},Se.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Se.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Se.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Se.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Se.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Se.expect=function(e){this.eat(e)||this.unexpected()},Se.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Te=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Se.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Se.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Se.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Se.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var H=be.prototype;H.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Ee={kind:`loop`},De={kind:`switch`};H.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},H.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);if(c.test(u))return!1;if(t&&!e&&u===`of`){E.lastIndex=r;var d=E.exec(this.input);if(r+=d[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},H.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},H.isUsing=function(e){return this.isUsingKeyword(!1,e)},H.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},H.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},H.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},H.parseDoStatement=function(e){return this.next(),this.labels.push(Ee),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},H.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Ee),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Te,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},H.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===b._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},H.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ke|(n?0:Ae),!1,t)},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},H.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},H.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(De),this.enterScope(de);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},H.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Oe=[];H.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?oe:0),this.checkLValPattern(e,t?ve:ge),this.expect(b.parenR),e},H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},H.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ee),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},H.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},H.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},H.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},H.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},H.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},H.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?he:ge,!1)};var ke=1,Ae=2,je=4;H.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&Ae&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ke&&(e.id=t&je&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&Ae)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?he:ge:_e));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pe(e.async,e.generator)),t&ke||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&ke?`FunctionDeclaration`:`FunctionExpression`)},H.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Me(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},H.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Ne(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},H.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},H.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},H.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Ne(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},H.parseClassField=function(e){return Ne(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Ne(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(ue|se),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},H.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(le|se);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},H.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ge,!1)):(t===!0&&this.unexpected(),e.id=null)},H.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},H.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},H.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];A(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Me(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Ne(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}H.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},H.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},H.parseExportDeclaration=function(e){return this.parseStatement(null)},H.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ke|je,!1,e)}if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},H.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),A(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},H.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},H.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},H.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},H.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},H.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},H.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Oe,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},H.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportSpecifier`)},H.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportDefaultSpecifier`)},H.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportNamespaceSpecifier`)},H.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},H.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;A(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},H.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},H.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return F.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},H.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},H.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Pe=be.prototype;Pe.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Pe.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Pe.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Pe.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Pe.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Pe.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Pe.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Pe.parseBindingListItem=function(e){return e},Pe.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Pe.checkLValSimple=function(e,t,n){t===void 0&&(t=me);var r=t!==me;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===ge&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(A(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==ye&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Pe.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=me),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Pe.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=me),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Fe=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Ie={b_stat:new Fe(`{`,!1),b_expr:new Fe(`{`,!0),b_tmpl:new Fe("${",!1),p_stat:new Fe(`(`,!1),p_expr:new Fe(`(`,!0),q_tmpl:new Fe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Fe(`function`,!1),f_expr:new Fe(`function`,!0),f_expr_gen:new Fe(`function`,!0,!1,null,!0),f_gen:new Fe(`function`,!1,!1,null,!0)},Le=be.prototype;Le.initialContext=function(){return[Ie.b_stat]},Le.curContext=function(){return this.context[this.context.length-1]},Le.braceIsBlock=function(e){var t=this.curContext();return t===Ie.f_expr||t===Ie.f_stat?!0:e===b.colon&&(t===Ie.b_stat||t===Ie.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===Ie.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Le.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Le.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===Ie.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Ie.b_stat:Ie.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(Ie.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?Ie.p_stat:Ie.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===Ie.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==Ie.b_stat)?this.context.push(Ie.f_expr):this.context.push(Ie.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===Ie.q_tmpl?this.context.pop():this.context.push(Ie.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===Ie.f_expr?this.context[t]=Ie.f_expr_gen:this.context[t]=Ie.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Re=be.prototype;Re.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},Re.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===b.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(b.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},Re.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Te,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Re.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Re.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Re.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Re.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Re.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&ze(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Be(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function ze(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&ze(e.expression)}function Be(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Be(e.expression)||e.type===`ParenthesizedExpression`&&Be(e.expression)}Re.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},Re.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},Re.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},Re.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Re.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new Te,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Re.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(Ie.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(Ie.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Re.parseExprAtomDefault=function(){this.unexpected()},Re.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},Re.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Re.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Re.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Re.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},Re.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Re.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Te,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},Re.parseParenItem=function(e){return e},Re.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ve=[];Re.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Ve,this.finishNode(e,`NewExpression`)},Re.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
68
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
69
|
-
`),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},Re.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Re.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},Re.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Re.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Re.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Re.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Re.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Re.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Re.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pe(t,r.generator)|se|(n?ce:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Re.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(pe(n,!1)|V),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Re.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ye),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Re.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Re.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,he,t?null:n)}},Re.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Re.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&fe)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Re.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Re.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=b.name):this.unexpected(),e},Re.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Re.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Re.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var He=be.prototype;He.raise=function(e,t){var n=R(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},He.raiseRecoverable=He.raise,He.curPosition=function(){if(this.options.locations)return new I(this.curLine,this.pos-this.lineStart)};var Ue=be.prototype,We=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Ue.enterScope=function(e){this.scopeStack.push(new We(e))},Ue.exitScope=function(){this.scopeStack.pop()},Ue.treatFunctionsAsVarInScope=function(e){return e.flags&re||!this.inModule&&e.flags&ne},Ue.declareName=function(e,t,n){var r=!1;if(t===ge){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ne&&delete this.undefinedExports[e]}else if(t===ve)this.currentScope().lexical.push(e);else if(t===_e){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&oe&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ne&&delete this.undefinedExports[e],s.flags&fe)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Ue.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Ue.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ue.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(fe|ue|le))return t}},Ue.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(fe|ue|le)&&!(t.flags&V))return t}};var Ge=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new L(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ke=be.prototype;Ke.startNode=function(){return new Ge(this,this.start,this.startLoc)},Ke.startNodeAt=function(e,t){return new Ge(this,e,t)};function qe(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Ke.finishNode=function(e,t){return qe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ke.finishNodeAt=function(e,t,n,r){return qe.call(this,e,t,n,r)},Ke.copyNode=function(e){var t=new Ge(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Je=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,Ye=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,Xe=Ye+` Extended_Pictographic`,Ze=Xe,Qe=Ze+` EBase EComp EMod EPres ExtPict`,$e=Qe,et={9:Ye,10:Xe,11:Ze,12:Qe,13:$e,14:$e},tt={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},nt=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,rt=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,it=rt+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,at=it+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ot=at+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,st=ot+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,ct={9:rt,10:it,11:at,12:ot,13:st,14:st+` `+Je},lt={};function ut(e){var t=lt[e]={binary:N(et[e]+` `+nt),binaryOfStrings:N(tt[e]),nonBinary:{General_Category:N(nt),Script:N(ct[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var dt=0,ft=[9,10,11,12,13,14];dt<ft.length;dt+=1){var pt=ft[dt];ut(pt)}var U=be.prototype,mt=function(e,t){this.parent=e,this.base=t||this};mt.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},mt.prototype.sibling=function(){return new mt(this.parent,this.base)};var ht=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=lt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};ht.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},ht.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},ht.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},ht.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},ht.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},ht.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},ht.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},ht.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},ht.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},U.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function gt(e){for(var t in e)return!0;return!1}U.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&>(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},U.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},U.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new mt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},U.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},U.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},U.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},U.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},U.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},U.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},U.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},U.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},U.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},U.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},U.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&_t(n);)t+=P(n),e.advance();return t};function _t(e){return e===105||e===109||e===115}U.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},U.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},U.regexp_eatSyntaxCharacter=function(e){var t=e.current();return vt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function vt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}U.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!vt(n);)e.advance();return e.pos!==t},U.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},U.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},U.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},U.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=P(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=P(e.lastIntValue);return!0}return!1},U.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),yt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function yt(e){return f(e,!0)||e===36||e===95}U.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),bt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function bt(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}U.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},U.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},U.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},U.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},U.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},U.regexp_eatZero=function(e){return e.current()===48&&!Mt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},U.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},U.regexp_eatControlLetter=function(e){var t=e.current();return xt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function xt(e){return e>=65&&e<=90||e>=97&&e<=122}U.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&St(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function St(e){return e>=0&&e<=1114111}U.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},U.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ct=0,wt=1,Tt=2;U.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Et(t))return e.lastIntValue=-1,e.advance(),wt;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Tt&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ct};function Et(e){return e===100||e===68||e===115||e===83||e===119||e===87}U.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),wt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ct},U.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){A(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},U.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return wt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Tt;e.raise(`Invalid property name`)},U.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Dt(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Dt(e){return xt(e)||e===95}U.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Ot(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Ot(e){return Dt(e)||Mt(e)}U.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},U.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Tt&&e.raise(`Negated character class may contain strings`),!0}return!1},U.regexp_classContents=function(e){return e.current()===93?wt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),wt)},U.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},U.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Ft(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},U.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},U.regexp_classSetExpression=function(e){var t=wt,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===Tt&&(t=Tt);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==Tt&&(t=wt):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Tt&&(t=Tt)}},U.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},U.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?wt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},U.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Tt&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},U.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},U.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Tt&&(t=Tt);return t},U.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?wt:Tt},U.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&kt(n)||At(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function kt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function At(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}U.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function jt(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}U.regexp_eatClassControlLetter=function(e){var t=e.current();return Mt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},U.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},U.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Mt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Mt(e){return e>=48&&e<=57}U.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Nt(n=e.current());)e.lastIntValue=16*e.lastIntValue+Pt(n),e.advance();return e.pos!==t};function Nt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Pt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}U.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},U.regexp_eatOctalDigit=function(e){var t=e.current();return Ft(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ft(e){return e>=48&&e<=55}U.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Nt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Pt(i),e.advance()}return!0};var It=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new L(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Lt=be.prototype;Lt.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new It(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Lt.getToken=function(){return this.next(),new It(this)},typeof Symbol<`u`&&(Lt[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),Lt.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Lt.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Lt.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Lt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Lt.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Lt.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Lt.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e)))++this.pos;else break loop}}},Lt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Lt.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},Lt.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},Lt.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},Lt.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},Lt.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},Lt.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},Lt.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},Lt.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},Lt.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},Lt.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+P(t)+`'`)},Lt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+P(e)+`'`)},Lt.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Lt.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new ht(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},Lt.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Rt(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function zt(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Lt.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=zt(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},Lt.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=zt(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Rt(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},Lt.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Lt.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Bt={};Lt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Bt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Lt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Bt;this.raise(e,t)},Lt.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
70
|
-
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Lt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
71
|
-
`&&++this.pos;case`
|
|
72
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Lt.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
73
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return P(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Lt.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Lt.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=P(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Lt.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Vt=`8.19.0`;be.acorn={Parser:be,version:Vt,defaultOptions:z,Position:I,SourceLocation:L,getLineInfo:R,Node:Ge,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:Fe,tokContexts:Ie,isIdentifierChar:p,isIdentifierStart:f,Token:It,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Ht(e,t){return be.parse(e,t)}function Ut(e,t,n){return be.parseExpressionAt(e,t,n)}function Wt(e,t){return be.tokenizer(e,t)}e.Node=Ge,e.Parser=be,e.Position=I,e.SourceLocation=L,e.TokContext=Fe,e.Token=It,e.TokenType=m,e.defaultOptions=z,e.getLineInfo=R,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Ht,e.parseExpressionAt=Ut,e.tokContexts=Ie,e.tokTypes=b,e.tokenizer=Wt,e.version=Vt}))})),Ql=t(((e,t)=>{var n=Xl(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return o(Zl()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||Zl(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`>`:`}`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
|
|
74
|
-
`:`\r
|
|
75
|
-
`):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function $l(e){return e}var eu={}.hasOwnProperty,tu=Symbol(`continue`),nu=Symbol(`exit`),ru=Symbol(`skip`);function iu(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return ou(e)&&(s.displayName=`node (`+$l(e.type)+`)`),s;function s(){let s=n?au(n(e,t,a,o)):[];if(s[0]===nu)return s;if(s[0]!==ru){let t;for(t in e)if(eu.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(ou(r)){let e=i(r,t,a,n)();if(e[0]===nu)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(ou(r)){let e=i(r,t,void 0,n)();if(e[0]===nu)return e}}}return r?au(r(e,t,a,o)):s}}}function au(e){return Array.isArray(e)?e:typeof e==`number`?[tu,e]:[e]}function ou(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function su(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=lu(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&cu(m);if(g&&!t.allowEmpty)throw new ut(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(cu(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,iu(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=uu(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function cu(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function lu(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=du(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function uu(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function du(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
76
|
-
`;break;case-3:a=`\r
|
|
77
|
-
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function fu(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=pu(n.start,r[0]||t.start),a=pu(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function pu(e,t){if(e&&typeof e==`object`){let n=`line`in e?mu(e.line):void 0,r=`column`in e?mu(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:mu(t)}}}function mu(e){return typeof e==`number`&&e>-1?e:void 0}var hu=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,gu=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,_u=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,vu=`#unexpected-type-in-code-expected-an-object-spread-spread`,yu=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,bu=`#could-not-parse-expression-with-acorn`;function xu(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new ut("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=hu+gu,e}if(nr(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?Su.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||nr(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new ut("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=hu+_u,e}return tr(t)?lr(e,_,`linePrefix`,3)(t):_(t)}}function Su(e,t,n,r,i,a,o){let s=su(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=fu(e),n=new ut("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=hu+vu,n}if(e.expression.properties[1]){let t=fu(e.expression.properties[1]),n=new ut(`Unexpected extra content in spread: only a single spread is supported`,{place:t.start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw n.url=hu+yu,n}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=fu(e.expression.properties[0]),n=new ut("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=hu+vu,n}}if(s.error){let e=new ut(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=hu+bu,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function Cu(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return xu.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return tr(t)?lr(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||nr(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return xu.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var wu=`https://github.com/micromark/micromark-extension-mdx-jsx`;function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),I}function I(e){return $n(e)?n(e):(N=L,ve(e))}function L(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=R,ve;if(t===62)return _e(t);if(t!==null&&t>=0&&pt(t))return e.enter(d),e.enter(f),e.consume(t),z;xe(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function R(t){if(t===62)return _e(t);if(t!==null&&t>=0&&pt(t))return e.enter(d),e.enter(f),e.consume(t),z;xe(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function z(t){if(t!==null&&t>=0&&ct(t,{jsx:!0}))return e.consume(t),z;if(t===46||t===47||t===58||t===62||t===123||$n(t)||rr(t))return e.exit(f),N=B,ve(t);xe(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function B(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ee,ve;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=re,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&pt(t))return e.exit(d),V(t);xe(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ee(t){if(t!==null&&t>=0&&pt(t))return e.enter(m),e.consume(t),te;xe(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function te(t){if(t!==null&&t>=0&&ct(t,{jsx:!0}))return e.consume(t),te;if(t===46||t===47||t===62||t===123||$n(t)||rr(t))return e.exit(m),N=ne,ve(t);xe(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ne(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ee,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&pt(t))return e.exit(d),V(t);xe(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function re(t){if(t!==null&&t>=0&&pt(t))return e.enter(g),e.consume(t),ie;xe(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ie(t){if(t!==null&&t>=0&&ct(t,{jsx:!0}))return e.consume(t),ie;if(t===47||t===62||t===123||$n(t)||rr(t))return e.exit(g),N=ae,ve(t);xe(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ae(t){if(t===47||t===62||t===123||t!==null&&t>=0&&pt(t))return e.exit(d),V(t);xe(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function V(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=ge,ve;if(t===62)return _e(t);if(t===123)return xu.call(M,e,oe,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&pt(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),se;xe(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe(e){return N=V,ve(e)}function se(t){if(t!==null&&t>=0&&ct(t,{jsx:!0}))return e.consume(t),se;if(t===47||t===58||t===61||t===62||t===123||$n(t)||rr(t))return e.exit(S),N=ce,ve(t);xe(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ce(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=le,ve;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=fe,ve;if(t===47||t===62||t===123||$n(t)||rr(t)||t!==null&&t>=0&&pt(t))return e.exit(x),e.exit(b),N=V,ve(t);xe(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function le(t){if(t!==null&&t>=0&&pt(t))return e.enter(w),e.consume(t),ue;xe(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&ct(t,{jsx:!0}))return e.consume(t),ue;if(t===47||t===61||t===62||t===123||$n(t)||rr(t))return e.exit(w),e.exit(x),N=de,ve(t);xe(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function de(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=fe,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&pt(t))return e.exit(b),V(t);xe(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function fe(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,me;if(t===123)return xu.call(M,e,pe,k,A,j,r,i,a,!1,!1,o)(t);xe(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function pe(t){return e.exit(b),N=V,ve(t)}function me(t){return t===null&&xe(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=V,ve):nr(t)?(N=me,ve(t)):(e.enter(O),he(t))}function he(t){return t===null||t===P||nr(t)?(e.exit(O),me(t)):(e.consume(t),he)}function ge(e){if(e===62)return _e(e);xe(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function _e(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function ve(t){return nr(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),be):tr(t)||rr(t)?(e.enter(`esWhitespace`),ye(t)):N(t)}function ye(t){return nr(t)?(e.exit(`esWhitespace`),ve(t)):tr(t)||rr(t)?(e.consume(t),ye):(e.exit(`esWhitespace`),N(t))}function be(e){if(!o&&M.parser.lazy[M.now().line]){let e=new ut("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=wu+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return ve(e)}function xe(e,t,n){let r=new ut(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Eu(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=wu+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Eu(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Du(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return Tu.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function Ou(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return Tu.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return tr(e)?lr(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||nr(e)?r(e):i(e)}}}function ku(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Ou(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Du(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}var Au=e(Ql(),1);function ju(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var Mu={tokenize:Iu,partial:!0},Nu=`https://github.com/micromark/micromark-extension-mdxjs-esm`,Pu=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function Fu(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return Yn(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||nr(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):nr(e)?t.check(Mu,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=su(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
|
|
78
|
-
`:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new ut(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=Nu+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!Pu.has(e.type)){let t=new ut("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:fu(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=Nu+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function Iu(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(Qn,t,n)}}function Lu(e){let t=Object.assign({acorn:kc.extend((0,Au.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return mr([Fu(t),Cu(t),ku(t),ju()])}var Ru=`Block`,zu=`Callout`,Bu=`Table`,Vu=`Component`,Hu=[`of`,`width`,`height`,`at`,`alt`,`title`,`align`,`id`],Uu=`PageBreak`,Wu=`Card`,Gu=`Stats`,Ku=`Stat`,qu=[`label`,`value`,`delta`,`note`,`down-is-good`,`trend`],Ju=`Columns`,Yu=`Column`,Xu=`Chart`,Zu=[`type`,`title`,`data`,`categories`,`series`,`legend`,`labels`,`format`,`min`,`max`,`colors`,`smooth`,`width`,`height`,`alt`,`id`],Qu=`Bibliography`,$u=`TableOfContents`,ed=e=>e.split(`,`).map(e=>e.trim()).filter(e=>e!==``),td=new Set([`center`,`right`,`justify`]),nd=(e,t)=>{let n=t.position?.start.offset,r=t.position?.end.offset;return n===void 0||r===void 0?``:e.source.slice(n,r)};function rd(e,t,n){let r=t.position?.start;e.problems.push({message:n,...r?{line:r.line,column:r.column}:{}})}var id=(e,t)=>e.bold===t.bold&&e.italic===t.italic&&e.underline===t.underline&&e.strike===t.strike&&e.code===t.code&&e.color===t.color&&e.background===t.background&&e.tag===t.tag;function ad(e,t,n,r){if(t===``)return;let i=e.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&id(i.styles,n)?i.text+=t:e.push({text:t,styles:{...n},...r===void 0?{}:{href:r}})}function od(e,t,n){let r=new Map;for(let i of t.attributes)i.type!==`mdxJsxAttribute`||!n.includes(i.name)?rd(e,t,`<${t.name??``}> takes ${n.join(`, `)}: ${i.type===`mdxJsxAttribute`?i.name:`{…}`} is not one of them`):i.value===null||i.value===void 0?r.set(i.name,``):typeof i.value==`string`?r.set(i.name,i.value):rd(e,t,`${i.name} of <${t.name??``}> is a plain string`);return r}function sd(e,t,n){switch(t.name){case`u`:return{...n,underline:!0};case`strong`:case`b`:return{...n,bold:!0};case`em`:case`i`:return{...n,italic:!0};case`del`:case`s`:return{...n,strike:!0};case`code`:return{...n,code:!0};case`Tag`:{let r=od(e,t,[`color`]).get(`color`);return{...n,tag:r===void 0||r===``?`gray`:r}}case`span`:{let r=od(e,t,[`color`,`bg`]),i=r.get(`color`),a=r.get(`bg`);return{...n,...i?{color:i}:{},...a?{background:a}:{}}}default:return}}function cd(e,t,n,r,i){for(let a of t)switch(a.type){case`text`:for(let[,t]of a.value.matchAll(/\[\^([^\]\s]+)\]/gu))rd(e,a,`the footnote [^${t??``}] has no note: write [^${t??``}]: … on a line of its own`);for(let e of a.value.replace(/\r?\n/g,` `).split(/(\[-?@[^\]]+\])/u)){if(e===``)continue;let t=/^\[(-?@[^\]]+)\]$/u.exec(e)?.[1];t!==void 0&&pi(t).keys.length>0?i.push({text:e,styles:{...n},cite:t}):ad(i,e,n,r)}break;case`strong`:cd(e,a.children,{...n,bold:!0},r,i);break;case`emphasis`:cd(e,a.children,{...n,italic:!0},r,i);break;case`delete`:cd(e,a.children,{...n,strike:!0},r,i);break;case`inlineCode`:ad(i,a.value,{...n,code:!0},r);break;case`break`:ad(i,`
|
|
79
|
-
`,n,r);break;case`link`:a.children.length===0?i.push({text:``,styles:{...n},href:a.url}):cd(e,a.children,n,a.url,i);break;case`footnoteReference`:{let e=a.label??a.identifier;i.push({text:e,styles:{...n},...r===void 0?{}:{href:r},note:e});break}case`mdxJsxTextElement`:{if(a.name===`br`){ad(i,`
|
|
80
|
-
`,n,r);break}let t=sd(e,a,n);if(t){cd(e,a.children,t,r,i);break}rd(e,a,`<${a.name??``}> inside a line is not drawn: a tag the doc's code draws goes on lines of its own`),ad(i,nd(e,a),n,r);break}case`mdxTextExpression`:rd(e,a,`{…} in a line is not drawn: write \\{ for a brace`),ad(i,nd(e,a),n,r);break;default:rd(e,a,`${a.type} is not drawn in a doc`),ad(i,nd(e,a),n,r)}}function ld(e,t){let n=[];return cd(e,t,{},void 0,n),n}var ud=e=>e?.type===`mdxJsxFlowElement`&&e.name===`br`&&e.children.length===0;function dd(e,t){let[n,...r]=t;if(n?.type===`paragraph`){let t=ld(e,n.children);return{content:t.length===1&&t[0]?.text===`
|
|
81
|
-
`&&Object.keys(t[0].styles).length===0?[]:t,under:Dd(e,r)}}return ud(n)?{content:[],under:Dd(e,r)}:{content:[],under:Dd(e,t)}}var fd=(e,t)=>t.length>0?{...e,children:t}:e;function pd(e,t,n,r){let{content:i,under:a}=dd(e,t.children);return typeof t.checked==`boolean`?fd({type:`check`,checked:t.checked,content:i},a):fd(n?{type:`numbered`,...r===void 0||r===1?{}:{start:r},content:i}:{type:`bullet`,content:i},a)}function md(e,t){return t.children.map(t=>ld(e,t.children))}function hd(e,t){return t?{[e]:t}:{}}function gd(e,t){let n=od(e,t,[`align`,`color`,`bg`,`toggle`]),r=Dd(e,t.children),[i,...a]=r;if(i===void 0)return rd(e,t,`<${Ru}> holds a block: this one is empty`),[];if(i.type===`embed`||i.type===`source`)return rd(e,t,`<${Ru}> holds a block of the doc's own, not a tag or an import`),r;let o=n.get(`align`);o!==void 0&&!td.has(o)&&rd(e,t,`align is center, right or justify, not "${o}"`);let s={...o!==void 0&&td.has(o)?{align:o}:{},...hd(`color`,n.get(`color`)),...hd(`background`,n.get(`bg`))},c=i;if(n.has(`toggle`)&&(c.type===`heading`?c={...c,toggle:!0}:c.type===`paragraph`?c={type:`toggle`,content:c.content}:rd(e,t,`toggle is for a heading or a line of text`)),Object.keys(s).length>0&&(`content`in c?c={...c,look:s}:rd(e,t,`a ${c.type} has no look to set`)),a.length>0){if(`content`in c)c={...c,children:[...c.children??[],...a]};else return rd(e,t,`a ${c.type} holds no blocks under it`),[c,...a]}return[c]}function _d(e,t){let n=od(e,t,[`icon`,`color`,`bg`]),{content:r,under:i}=dd(e,t.children),a={...hd(`color`,n.get(`color`)),...hd(`background`,n.get(`bg`))};return[fd({type:`callout`,...hd(`icon`,n.get(`icon`)),...Object.keys(a).length>0?{look:a}:{},content:r},i)]}function vd(e,t){let n=od(e,t,[`title`,`subtitle`]),r=Dd(e,t.children);return[fd({type:`card`,...hd(`title`,n.get(`title`)),...hd(`subtitle`,n.get(`subtitle`))},r)]}function yd(e,t){od(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Stat`||r.children.length>0)return rd(e,r,`<${Gu}> holds <${Ku} label="…" value="…" />s, one to a line`),[];let t=od(e,r,qu),i=t.get(`label`),a=t.get(`value`);if(a===void 0||i===void 0)return rd(e,r,`a <${Ku}> has a label and a value`),[];let o=t.get(`trend`),s=o?.split(`,`).map(e=>Number(e.trim()));if(s!==void 0&&!s.every(e=>Number.isFinite(e)))return rd(e,r,`a stat's trend is numbers, oldest first, comma-separated ("12,15,14,19"), not "${o??``}"`),[];n.push({label:i,value:a,...hd(`delta`,t.get(`delta`)),...hd(`note`,t.get(`note`)),...t.has(`down-is-good`)&&t.get(`down-is-good`)!==`false`?{downIsGood:!0}:{},...s===void 0||s.length<2?{}:{trend:s}})}return n.length===0?(rd(e,t,`<${Gu}> holds one <${Ku} /> or more`),[]):[{type:`stats`,stats:n}]}function bd(e,t){let n=od(e,t,[`src`,`alt`,`title`,`width`,`align`,`id`]),r=n.get(`src`);if(!r)return rd(e,t,`<img> names its picture: src is missing`),[];let i=Number(n.get(`width`)),a=n.get(`align`);return a!==void 0&&a!==`center`&&a!==`right`&&rd(e,t,`a picture's align is center or right, not "${a}"`),[{type:`image`,src:r,...hd(`alt`,n.get(`alt`)),...hd(`caption`,n.get(`title`)),...Number.isFinite(i)&&i>0?{width:Math.round(i)}:{},...a===`center`||a===`right`?{align:a}:{},...hd(`id`,n.get(`id`))}]}function xd(e,t){if(t.children.length>0)return rd(e,t,`<${Vu}> holds nothing: its props are its attributes`),[];let n=new Map,r={};for(let i of t.attributes){if(i.type!==`mdxJsxAttribute`){rd(e,t,`<${Vu}>'s attributes are plain strings, not {…}`);continue}let a=i.value===null||i.value===void 0?``:typeof i.value==`string`?i.value:void 0;a===void 0?rd(e,t,`${i.name} of <${Vu}> is a plain string`):Hu.includes(i.name)?n.set(i.name,a):r[i.name]=a}let i=n.get(`of`)??``;if(i.trim()===``)return rd(e,t,`<${Vu}> names its component: of is missing (of="../ui.ts#Dialog")`),[];let a=r=>{let i=n.get(r);if(i===void 0)return;let a=Number(i);if(Number.isFinite(a)&&a>0)return Math.round(a);rd(e,t,`${r} of <${Vu}> is a number of pixels, not "${i}"`)},o=a(`width`),s=a(`height`),c=n.get(`at`),l=c===void 0?void 0:Number(c);l!==void 0&&!(Number.isFinite(l)&&l>=0)&&rd(e,t,`at of <${Vu}> is seconds, 0 or more, not "${c??``}"`);let u=n.get(`align`);return u!==void 0&&u!==`center`&&u!==`right`&&rd(e,t,`a component's align is center or right, not "${u}"`),[{type:`component`,of:i,...o===void 0?{}:{width:o},...s===void 0?{}:{height:s},...l!==void 0&&Number.isFinite(l)&&l>=0?{at:l}:{},...hd(`alt`,n.get(`alt`)),...hd(`caption`,n.get(`title`)),...u===`center`||u===`right`?{align:u}:{},...hd(`id`,n.get(`id`)),props:r}]}function Sd(e,t){let n=od(e,t,Zu),r=n=>{rd(e,t,n)},i=n.get(`type`);if(i===void 0||i===``)return r(`<${Xu}> says what it is drawn as: type is missing (${xe.join(`, `)})`),[];if(!xe.includes(i))return r(`a chart's type is ${xe.join(`, `)}, not "${i}"`),[];let[a,...o]=t.children;if(o.length>0||a!==void 0&&a.type!==`table`)return r(`<${Xu}> holds one table: its numbers`),[];let s=a?.type===`table`?a.children.map(t=>t.children.map(t=>ld(e,t.children).map(e=>e.text).join(``).trim())):void 0,c=n.get(`data`),l=n.get(`categories`),u=n.get(`series`);if(s!==void 0&&c!==void 0)return r(`a chart's numbers are its table or the file data names, not both`),[];if(s===void 0&&(c===void 0||c===``))return r(`<${Xu}> has numbers: a table inside it, or data="…" naming a file of them`),[];if(s!==void 0){(l!==void 0||u!==void 0)&&r(`categories and series name a file's columns: a chart's own table has its series in its head row and its categories in its first column`);let e=Math.min(...s.map(e=>e.length));(s.length<2||e<2)&&r(`a chart's table has a head row and a row of numbers, a column of categories and a column of numbers`)}else(l===void 0||l===``)&&r(`with data, categories names the column of the categories`),(u===void 0||ed(u).length===0)&&r(`with data, series names the columns of the numbers (series="revenue,cost")`);let d=n.get(`legend`),f=[...Se,`none`];d!==void 0&&!f.includes(d)&&r(`a chart's legend is ${f.join(`, `)}, not "${d}"`);let p=n.get(`labels`),m=p===void 0?void 0:p===``?[`value`]:ed(p),h=m?.filter(e=>!na.includes(e));h?.length&&r(`a chart's labels are ${na.join(`, `)}, not ${h.map(e=>`"${e}"`).join(`, `)}`);let g=(e,t)=>{let i=n.get(e);if(i===void 0)return;let a=Number(i);if(i.trim()!==``&&Number.isFinite(a)&&(!t||a>0))return t?Math.round(a):a;r(`${e} of <${Xu}> is ${t?`a number of pixels`:`a number`}, not "${i}"`)},_=g(`min`,!1),v=g(`max`,!1),y=g(`width`,!0),b=g(`height`,!0),x=n.get(`colors`);return[{type:`chart`,kind:i,...hd(`title`,n.get(`title`)),...s===void 0?{}:{table:s},...c===void 0||c===``?{}:{data:c},...s===void 0?hd(`categories`,l):{},...s===void 0&&u!==void 0&&ed(u).length>0?{series:ed(u)}:{},...d!==void 0&&f.includes(d)?{legend:d}:{},...m!==void 0&&!h?.length?{labels:m}:{},...hd(`format`,n.get(`format`)),..._===void 0?{}:{min:_},...v===void 0?{}:{max:v},...x!==void 0&&ed(x).length>0?{colors:ed(x)}:{},...n.has(`smooth`)&&n.get(`smooth`)!==`false`?{smooth:!0}:{},...y===void 0?{}:{width:y},...b===void 0?{}:{height:b},...hd(`alt`,n.get(`alt`)),...hd(`id`,n.get(`id`))}]}function Cd(e,t){od(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Column`)return rd(e,r,`<${Ju}> holds <${Yu}>s, each around its blocks`),[];let t=od(e,r,[`width`]).get(`width`),i=t===void 0?void 0:Number(t);t!==void 0&&!(Number.isFinite(i)&&(i??0)>0)&&rd(e,r,`a column's width is a share against the others' (1, 2, 0.5), not "${t}"`);let a=Dd(e,r.children);if(a.some(e=>e.type===`columns`))return rd(e,r,`a <${Yu}> holds no <${Ju}>`),[];n.push({...i!==void 0&&Number.isFinite(i)&&i>0&&i!==1?{width:i}:{},blocks:a})}return n.length<2?(rd(e,t,`<${Ju}> holds two or more <${Yu}>s`),[]):[{type:`columns`,columns:n}]}function wd(e,t){let n=od(e,t,[`widths`,`head`,`caption`,`id`]),r=Dd(e,t.children),[i,...a]=r;if(i?.type!==`table`||a.length>0)return rd(e,t,`<${Bu}> holds one table`),r;let o=n.get(`head`);o!==void 0&&![`none`,`column`,`both`,`row`].includes(o)&&rd(e,t,`a table's head is none, row, column or both, not "${o}"`);let s=n.get(`widths`)?.split(`,`).map(e=>{let t=Number(e.trim());return e.trim()!==``&&Number.isFinite(t)&&t>0?Math.round(t):null});return[{...i,...o===`none`||o===`column`||o===`both`?{head:o}:{},...s?.some(e=>e!==null)?{widths:s}:{},...hd(`caption`,n.get(`caption`)),...hd(`id`,n.get(`id`))}]}function Td(e,t){switch(t.type){case`paragraph`:{let n=t.children.length===1?t.children[0]:void 0;if(n?.type===`image`)return[{type:`image`,src:n.url,...n.alt?{alt:n.alt}:{},...n.title?{caption:n.title}:{}}];let r=ld(e,t.children),i=r.map(e=>e.text).join(``).trim();return i.startsWith(`$$`)&&i.endsWith(`$$`)&&i.length>4&&rd(e,t,"$$ is not drawn in a doc: an equation is a ```math code block"),[{type:`paragraph`,content:r}]}case`heading`:return[{type:`heading`,level:t.depth,content:ld(e,t.children)}];case`list`:{let n=t.ordered===!0;return t.children.map((r,i)=>pd(e,r,n,i===0&&n?t.start??void 0:void 0))}case`blockquote`:{let{content:n,under:r}=dd(e,t.children);return[fd({type:`quote`,content:n},r)]}case`code`:return[{type:`code`,...t.lang?{language:t.lang}:{},code:t.value}];case`table`:return[{type:`table`,rows:t.children.map(t=>md(e,t))}];case`thematicBreak`:return[{type:`divider`}];case`mdxJsxFlowElement`:{let n=n=>n.length>0?n:[{type:`embed`,source:nd(e,t)}];if(t.name===`Block`)return n(gd(e,t));if(t.name===`Table`)return wd(e,t);if(t.name===`Callout`)return _d(e,t);if(t.name===`Component`)return n(xd(e,t));if(t.name===`Chart`)return n(Sd(e,t));if(t.name===`Columns`)return n(Cd(e,t));if(t.name===`Card`)return n(vd(e,t));if(t.name===`Stats`)return n(yd(e,t));if(t.name===`Stat`)return rd(e,t,`a <${Ku} /> stands inside <${Gu}>`),n([]);if(t.name===`PageBreak`){let r=od(e,t,[`orientation`]).get(`orientation`);return t.children.length>0?(rd(e,t,`<${Uu} /> holds nothing`),n([])):r!==void 0&&r!==`portrait`&&r!==`landscape`?(rd(e,t,`a page break's orientation is portrait or landscape, not "${r}"`),n([])):[{type:`pagebreak`,...r===void 0?{}:{orientation:r}}]}if(t.name===`Bibliography`)return t.attributes.length>0||t.children.length>0?(rd(e,t,`<${Qu} /> takes nothing`),n([])):[{type:`bibliography`}];if(t.name===`TableOfContents`){let r=od(e,t,[`levels`,`title`]),i=r.get(`levels`),a=r.get(`title`),o=i===void 0?void 0:Number(i);return t.children.length>0||o!==void 0&&!(Number.isInteger(o)&&o>=1&&o<=6)?(rd(e,t,`<${$u} /> holds nothing, and its levels are 1 to 6 (the deepest heading it lists)`),n([])):[{type:`toc`,...o===void 0?{}:{levels:o},...a===void 0?{}:{title:a}}]}return t.name===`Column`?(rd(e,t,`a <${Yu}> stands inside <${Ju}>`),n([])):t.name===`img`&&t.children.length===0?n(bd(e,t)):ud(t)?[{type:`paragraph`,content:[]}]:[{type:`embed`,source:nd(e,t)}]}case`footnoteDefinition`:{let{content:n,under:r}=dd(e,t.children);return[fd({type:`note`,label:t.label??t.identifier,content:n},r)]}case`mdxjsEsm`:case`definition`:return[{type:`source`,source:nd(e,t)}];case`mdxFlowExpression`:return rd(e,t,`{…} on its own is not drawn in a doc`),[{type:`source`,source:nd(e,t)}];default:return rd(e,t,`${t.type} is not drawn in a doc`),[{type:`source`,source:nd(e,t)}]}}function Ed(e,t){return t.map((n,r)=>{let i=Td(e,n),a=t[r-1],o=i[0];return n.type===`list`&&n.ordered===!0&&a?.type===`list`&&a.ordered===!0&&o?.type===`numbered`&&o.start===void 0&&(i[0]={...o,start:n.start??1}),i})}function Dd(e,t){return Ed(e,t).flat()}function Od(e){let t={source:e,problems:[]},n;try{n=ir(e,{extensions:[Jt(),Lu(),fr(),pr(),ur(),U(),Ss()],mdastExtensions:[cn(),Do(),sr(),cr(),dr(),ft()]})}catch(t){let n=t;return{source:e,blocks:[],segments:[],page:{},problems:[{message:n.reason??n.message??`The file is not MDX`,...typeof n.line==`number`?{line:n.line}:{},...typeof n.column==`number`?{column:n.column}:{}}]}}let[r]=n.children,i=r?.type===`yaml`?r:void 0,a=i?n.children.slice(1):n.children,o=i?kd(t,i):{},s=[],c=Ed(t,a);a.forEach((e,t)=>{let n=e.position?.start.offset,r=e.position?.end.offset;n!==void 0&&r!==void 0&&s.push({start:n,end:r,blocks:c[t]??[]})});let l=i?.position?.start.offset,u=i?.position?.end.offset;return{source:e,blocks:s.flatMap(e=>e.blocks),segments:s,problems:t.problems,page:o,...l===void 0||u===void 0?{}:{frontMatter:{start:l,end:u}}}}function kd(e,t){let n;try{n=_r(t.value)}catch(n){return rd(e,t,`the front matter is not YAML: ${n instanceof Error?n.message:String(n)}`),{}}return n==null?{}:typeof n!=`object`||Array.isArray(n)?(rd(e,t,`the front matter holds keys: ${Hi.join(`, `)}`),{}):Xi(n,n=>{rd(e,t,n)})}var Ad=[`link`,`span`,`tag`,`underline`,`bold`,`italic`,`strike`,`code`];function jd(e,t){switch(t){case`link`:return e.href;case`tag`:return e.styles.tag;case`span`:return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??``}\n${e.styles.background??``}`:void 0;default:return e.styles[t]?`on`:void 0}}var Md=(e,t)=>t===void 0?``:` ${e}="${t.replace(/&/g,`&`).replace(/"/g,`"`)}"`,Nd=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function Pd(e,t,n=t){let r=``,i=Array.from(e);return i.forEach((e,a)=>{let o=i[a-1],s=i[a+1];switch(e){case`\\`:case`*`:case"`":case`[`:case`]`:case`<`:case`>`:case`{`:case`}`:case`~`:r+=`\\${e}`;break;case`_`:r+=Nd(o)&&Nd(s)?e:`\\${e}`;break;case`&`:r+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(i.slice(a,a+34).join(``))?`&`:e;break;case`|`:r+=t?`\\|`:e;break;case`!`:r+=s===void 0?`\\!`:e;break;case`
|
|
82
|
-
`:r+=n?`<br />`:`\\
|
|
83
|
-
`;break;default:r+=e}}),r}function Fd(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(e=>e.length)),n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${n}${r}${e}${r}${n}`}var Id={bold:`**`,italic:`*`,strike:`~~`},Ld={underline:`u`,bold:`strong`,italic:`em`,strike:`del`,code:`code`};function Rd(e,t){let n=``,r=0,i=!0;for(;r<e.length;){let a=e[r];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){n+=a.note===void 0?`[${a.cite??``}]`:`[^${a.note}]`,i=!1,r++;continue}let o=Ad.find(e=>!t.used.has(e)&&jd(a,e)!==void 0);if(o===void 0){n+=Pd(a.text,t.inTable,t.oneLine),i=!0,r++;continue}let s=jd(a,o),c=r+1;for(;c<e.length;){let n=e[c];if(n===void 0||jd(n,o)!==s||o===`code`&&Ad.some(e=>e!==`code`&&!t.used.has(e)&&jd(n,e)!==void 0))break;c++}let l=e.slice(r,c),u=new Set([...t.used,o]),d=l.map(e=>e.text).join(``),f=e[c],p=f===void 0||Ad.every(e=>t.used.has(e)||jd(f,e)===void 0);if(o===`code`)n+=d.includes(`
|
|
84
|
-
`)||t.inTable&&d.includes(`|`)?`<code>${Pd(d,t.inTable,t.oneLine)}</code>`:Fd(d);else if(o===`link`){let e=Rd(l,{...t,used:u}),r=(s??``).replace(/[\s<>\\]/g,e=>encodeURIComponent(e)),i=zd(r)?r:r.replace(/[()]/g,`\\$&`);n+=`[${e}](${i})`}else if(o===`tag`){let e=Rd(l,{...t,used:u});n+=`<Tag${Md(`color`,s)}>${e}</Tag>`}else if(o===`span`){let e=Rd(l,{...t,used:u}),r=l[0];n+=`<span${Md(`color`,r?.styles.color)}${Md(`bg`,r?.styles.background)}>${e}</span>`}else{let a=Rd(l,{...t,used:u}),s=Id[o],f=Array.from(d),m=r===0&&c===e.length,h=t.used.has(`bold`)||t.used.has(`italic`)||t.used.has(`strike`),g=e=>e!==void 0&&Ad.every(t=>u.has(t)||jd(e,t)===void 0),_=o===`bold`&&l.every(e=>e.styles.italic===!0&&Ad.every(t=>t===`italic`||u.has(t)||jd(e,t)===void 0)),v=s!==void 0&&Nd(f[0])&&Nd(f.at(-1))&&!d.includes(`
|
|
85
|
-
`)&&i&&p&&(!h||m&&o===`italic`&&t.used.has(`bold`))&&(g(l[0])&&g(l.at(-1))||_);n+=v?`${s}${a}${s}`:`<${Ld[o]}>${a}</${Ld[o]}>`}i=!1,r=c}return n}function zd(e){let t=0;for(let n of e)if(n===`(`)t+=1;else if(n===`)`&&--t<0)return!1;return t===0}function Bd(e){if(/^[ \t]/.test(e)||/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;let t=/^(\d{1,9})([.)])(\s|$)/.exec(e);return t?.[1]===void 0?e:`${t[1]}\\${e.slice(t[1].length)}`}function Vd(e,t=!1,n=t){let r=Rd(e.filter(e=>e.text!==``||e.href!==void 0).map((e,t,n)=>{if(e.note===void 0)return e;let r=n.slice(0,t).findLast(e=>e.note===void 0);return r===void 0?e:{...e,styles:{...r.styles},...r.href===void 0?{}:{href:r.href}}}),{inTable:t,oneLine:n,used:new Set}),i=e=>e.replace(/ +$/,``).replace(/^ +/,e=>` `.repeat(e.length));return n?i(r):r.split(`
|
|
86
|
-
`).map(e=>Bd(i(e))).join(`
|
|
87
|
-
`)}var Hd=(e,t)=>e.split(`
|
|
88
|
-
`).map((e,n)=>n===0||e===``?e:`${t}${e}`).join(`
|
|
89
|
-
`),Ud=e=>e.type===`bullet`||e.type===`numbered`||e.type===`check`,Wd=e=>`${Md(`align`,e?.align)}${Md(`color`,e?.color)}${Md(`bg`,e?.background)}`,Gd=e=>e!==void 0&&Object.keys(e).length>0;function Kd(e){return!(`content`in e)||e.type===`callout`?!1:Gd(e.look)||e.type===`toggle`||e.type===`heading`&&e.toggle?!0:(e.type===`paragraph`||e.type===`heading`)&&(e.children?.length??0)>0}function qd(e){let t=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(e=>e.trim().length));return"`".repeat(t+1)}function Jd(e,t,n){let r=e.type===`numbered`?`${String(t)}${n} `:e.type===`check`?`- [${e.checked?`x`:` `}] `:`- `,i=` `.repeat(e.type===`numbered`?r.length:2),a=e.children??[],o=Vd(e.content)||(e.type===`check`&&(e.children??[]).length===0?`<br />`:``);if(a.length===0)return`${r}${Hd(o,i)}`.trimEnd();let s=o===``?`<br />`:o,[c]=a,l=c!==void 0&&Ud(c)&&Vd(c.content)!==``&&(c.type!==`numbered`||(c.start??1)===1),u=a.every(Ud)&&o!==``&&l;return`${r}${Hd(s,i)}${u?`
|
|
90
|
-
`:`
|
|
91
|
-
|
|
92
|
-
`}${i}${Hd(tf(a),i)}`}function Yd(e){switch(e.type){case`paragraph`:{let t=Vd(e.content);return t===``?`<br />`:t}case`heading`:return`${`#`.repeat(e.level)} ${Vd(e.content,!1,!0).replace(/(^| )(#+)$/,`$1\\$2`)}`.trimEnd();case`toggle`:return Vd(e.content)||`<br />`;case`quote`:{let t=Vd(e.content);return(e.children?.length?[t===``?`<br />`:t,tf(e.children)]:[t]).join(`
|
|
93
|
-
|
|
94
|
-
`).split(`
|
|
95
|
-
`).map(e=>e===``?`>`:`> ${e}`).join(`
|
|
96
|
-
`)}case`callout`:{let t=Vd(e.content),n=[t===``?`<br />`:t,...e.children?.length?[tf(e.children)]:[]].join(`
|
|
97
|
-
|
|
98
|
-
`);return`<${zu}${Md(`icon`,e.icon)}${Md(`color`,e.look?.color)}${Md(`bg`,e.look?.background)}>\n\n${n}\n\n</${zu}>`}case`card`:{let t=e.children?.length?tf(e.children):``;return`<${Wu}${Md(`title`,e.title)}${Md(`subtitle`,e.subtitle)}>\n\n${t===``?`<br />`:t}\n\n</${Wu}>`}case`stats`:return[`<${Gu}>`,...e.stats.map(e=>`<${Ku}${Md(`label`,e.label)}${Md(`value`,e.value)}${Md(`delta`,e.delta)}${Md(`note`,e.note)}${e.downIsGood?` down-is-good`:``}${Md(`trend`,e.trend?.join(`,`))} />`),`</${Gu}>`].join(`
|
|
99
|
-
`);case`code`:{let t=qd(e.code);return`${t}${e.language??``}\n${e.code}\n${t}`}case`image`:{let t=e.src.replace(/[\s()<>\\]/g,e=>encodeURIComponent(e));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${Md(`src`,e.src)}${Md(`alt`,e.alt)}${Md(`title`,e.caption)}${Md(`width`,e.width===void 0?void 0:String(e.width))}${Md(`align`,e.align)}${Md(`id`,e.id)} />`;let n=e.caption===void 0?``:` "${e.caption.replace(/["\\]/g,`\\$&`)}"`;return``}case`table`:{let t=Math.max(1,...e.rows.map(e=>e.length)),n=e=>`| ${Array.from({length:t},(t,n)=>Vd(e[n]??[],!0)).join(` | `)} |`,[r,...i]=e.rows,a=[n(r??[]),`| ${Array.from({length:t},()=>`---`).join(` | `)} |`,...i.map(n)].join(`
|
|
100
|
-
`),o=e.widths?.some(e=>e!==null)?e.widths.map(e=>e===null?``:String(e)).join(`,`):void 0;return o===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${Bu}${Md(`widths`,o)}${Md(`head`,e.head)}${Md(`caption`,e.caption)}${Md(`id`,e.id)}>\n\n${a}\n\n</${Bu}>`}case`divider`:return`---`;case`component`:{let t=e=>e===void 0?void 0:String(e),n=Object.entries(e.props).map(([e,t])=>Md(e,t)).join(``);return`<${Vu}${Md(`of`,e.of)}${Md(`width`,t(e.width))}${Md(`height`,t(e.height))}${Md(`at`,t(e.at))}${n}${Md(`alt`,e.alt)}${Md(`title`,e.caption)}${Md(`align`,e.align)}${Md(`id`,e.id)} />`}case`chart`:return Xd(e);case`pagebreak`:return`<${Uu}${Md(`orientation`,e.orientation)} />`;case`bibliography`:return`<${Qu} />`;case`toc`:return`<${$u}${Md(`levels`,e.levels===void 0?void 0:String(e.levels))}${Md(`title`,e.title)} />`;case`note`:{let t=Vd(e.content)||`<br />`,n=e.children?.length?`\n\n${tf(e.children).split(`
|
|
101
|
-
`).map(e=>e===``?e:` ${e}`).join(`
|
|
102
|
-
`)}`:``;return`[^${e.label}]: ${Hd(t,` `)}${n}`}case`columns`:return[`<${Ju}>`,...e.columns.map(e=>{let t=tf(e.blocks);return`<${Yu}${Md(`width`,e.width===void 0?void 0:String(e.width))}>\n\n${t===``?`<br />`:t}\n\n</${Yu}>`}),`</${Ju}>`].join(`
|
|
103
|
-
|
|
104
|
-
`);case`embed`:case`source`:return e.source}}function Xd(e){let t=e=>e===void 0?void 0:String(e),n=e=>e===void 0?void 0:e.join(`,`),r=e.labels?.length===1&&e.labels[0]===`value`?` labels`:Md(`labels`,n(e.labels)),i=[Md(`type`,e.kind),Md(`title`,e.title),Md(`data`,e.data),Md(`categories`,e.categories),Md(`series`,n(e.series)),Md(`legend`,e.legend),r,Md(`format`,e.format),Md(`min`,t(e.min)),Md(`max`,t(e.max)),Md(`colors`,n(e.colors)),e.smooth?` smooth`:``,Md(`width`,t(e.width)),Md(`height`,t(e.height)),Md(`alt`,e.alt),Md(`id`,e.id)].join(``);if(e.table===void 0)return`<${Xu}${i} />`;let a=Math.max(1,...e.table.map(e=>e.length)),o=e=>`| ${Array.from({length:a},(t,n)=>Pd(e[n]??``,!0)).join(` | `)} |`,[s,...c]=e.table;return`<${Xu}${i}>\n\n${[o(s??[]),`| ${Array.from({length:a},()=>`---`).join(` | `)} |`,...c.map(o)].join(`
|
|
105
|
-
`)}\n\n</${Xu}>`}function Zd(e){let t=ea(e);if(Object.keys(t).length===0)return``;let n=new hr(t);return gr(n,{Seq:(e,t)=>{t.flow=!0},Map:(e,t,n)=>{n.length>1&&(t.flow=!0)}}),n.toString({lineWidth:0}).trimEnd()}function Qd(e,t){let n=Zd(t),r=n===``?``:`---\n${n}\n---`,i=e.frontMatter;if(i===void 0){if(r===``)return e.source;let t=e.source.replace(/^\s+/u,``);return t===``?`${r}\n`:`${r}\n\n${t}`}let a=e.source.slice(i.end).replace(/^\s+/u,``);return r===``?a:a===``?`${r}\n`:`${r}\n\n${a}`}function $d(e){let t=e.type===`toggle`||e.type===`heading`&&e.toggle,{children:n}=e,r={...e};delete r.look,delete r.children;let i=r.type===`toggle`?{type:`paragraph`,content:r.content}:r.type===`heading`?{type:`heading`,level:r.level,content:r.content}:r,a=Ud(i)||i.type===`quote`?tf([{...i,...n?{children:n}:{}}]):tf([i,...n??[]]);return`<${Ru}${Wd(e.look)}${t?` toggle`:``}>\n\n${a}\n\n</${Ru}>`}function ef(e,t){return Ud(e)&&Ud(t)&&!Kd(e)&&!Kd(t)&&e.type===`numbered`==(t.type===`numbered`)&&(t.type!==`numbered`||t.start===void 0)}function tf(e){let t=[],n=0,r;for(;n<e.length;){let i=e[n];if(i===void 0)break;if(Kd(i)){t.push($d(i)),r=void 0,n++;continue}if(!Ud(i)){t.push(n===0&&i.type===`divider`?`***`:Yd(i)),r=void 0,n++;continue}let a=i.type===`numbered`,o=i.type===`numbered`?i.start??1:1,s=a&&r===`.`?`)`:`.`,c=[],l=n;for(;l<e.length;){let t=e[l];if(t===void 0||!Ud(t)||Kd(t)||t.type===`numbered`!==a||l>n&&!ef(i,t))break;c.push(Jd(t,o+(l-n),s)),l++}let u=c.some(e=>e.includes(`
|
|
106
|
-
|
|
107
|
-
`));t.push(c.join(u?`
|
|
108
|
-
|
|
109
|
-
`:`
|
|
110
|
-
`)),r=a?s:void 0,n=l}return t.join(`
|
|
111
|
-
|
|
112
|
-
`)}function nf(e,t){let n=t.map(ca),r=e.segments.map(e=>({...e,keys:e.blocks.map(ca)})),i=r.length,a=n.length,o=(e,t)=>{let i=r[e]?.keys??[];return i.length>0&&t+i.length<=a&&i.every((e,r)=>n[t+r]===e)},s=Array.from({length:i+1},()=>Array(a+1).fill(0)),c=(e,t)=>s[e]?.[t]??0;for(let e=i-1;e>=0;e--)for(let t=a;t>=0;t--){let n=r[e]?.keys.length??0,i=Math.max(c(e+1,t),t<a?c(e,t+1):0);o(e,t)&&(i=Math.max(i,n+c(e+1,t+n)));let l=s[e];l&&(l[t]=i)}let l=[],u=0,d=0,f=[],p=()=>{f.length>0&&l.push({blocks:f}),f=[]};for(;u<i||d<a;){let e=r[u]?.keys.length??0;if(u<i&&o(u,d)&&c(u,d)===e+c(u+1,d+e))p(),l.push({kept:u}),d+=e,u++;else if(u<i&&c(u,d)===c(u+1,d))u++;else{let e=t[d];e&&f.push(e),d++}}p();let m=e.source,h=e=>{let t=r[e];return t!==void 0&&!m.slice(t.start,t.end).includes(`
|
|
113
|
-
|
|
114
|
-
`)};for(let e=0;e<l.length;e++){let t=l[e];if(!t||!(`kept`in t))continue;let n=r[t.kept]?.blocks??[],i=n[0],a=n.at(-1),o=l[e-1],s=l[e+1],c=o&&`blocks`in o?o.blocks.at(-1):void 0,u=s&&`blocks`in s?s.blocks[0]:void 0,d=c!==void 0&&i!==void 0&&ef(c,i),f=u!==void 0&&a!==void 0&&ef(a,u);(d||f)&&h(t.kept)&&(l[e]={blocks:[...n]})}for(let e=l.length-1;e>0;e--){let t=l[e],n=l[e-1];t&&n&&`blocks`in t&&`blocks`in n&&(n.blocks.push(...t.blocks),l.splice(e,1))}let g=r[0],_=r.at(-1),v=g?m.slice(0,g.start):e.frontMatter?`${m.slice(0,e.frontMatter.end)}\n\n`:``,y=_?m.slice(_.end):m===``?``:`
|
|
115
|
-
`,b=v,x;return l.forEach((e,t)=>{if(t>0){let n=l[t-1],i=`kept`in e&&n&&`kept`in n&&x!==void 0&&e.kept===x+1?m.slice(r[x]?.end??0,r[e.kept]?.start??0):`
|
|
116
|
-
|
|
117
|
-
`;b+=i}if(`kept`in e){let t=r[e.kept];t&&(b+=m.slice(t.start,t.end)),x=e.kept}else b+=tf(e.blocks),x=void 0}),l.length===0&&e.frontMatter!==void 0?`${m.slice(0,e.frontMatter.end)}\n`:(e.frontMatter===void 0&&t[0]?.type===`divider`&&(b=b.replace(/^---[ \t]*(?=\n|$)/u,`***`)),b+(y===``&&b!==``?`
|
|
118
|
-
`:y))}var rf={ground:`#ECE3CC`,ink:`#2F4A2E`,middle:`#5E7D3A`,soft:`#F6F0E0`,notes:[`#C4683A`,`#6F8FAE`,`#6B5A7A`,`#D9A93A`],tone:`#C4683A`},af={ground:`#E6D8BB`,ink:`#1F3B63`,middle:`#4A6F96`,soft:`#F4ECDB`,notes:[`#1F3B63`,`#4A6F96`,`#8FB3D9`,`#B7A27C`],tone:`#8FB3D9`},of={ground:`#E8E2D2`,ink:`#3E3A4C`,middle:`#7F7B9C`,soft:`#F4F0E6`,notes:[`#B9776A`,`#6B8AA6`,`#7D9474`,`#D2A874`],tone:`#A85F55`},sf={ground:`#DDE6E2`,ink:`#22303B`,middle:`#5B8299`,soft:`#EEF3F0`,notes:[`#5F8A6A`,`#3F6F9A`,`#9A5A40`,`#C4A066`],tone:`#C4A066`},cf=[`dots`,`scales`,`bay`,`stacks`,`steam`,`dusk`,`lake`],lf=1800,uf=600,df=`width="${String(lf)}" height="${String(uf)}"`,X=e=>String(Math.round(e*10)/10),ff=e=>String(Math.round(e));function pf(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function mf(e,t){let n=e[Math.min(e.length-1,Math.floor(t*e.length))];if(n===void 0)throw Error(`An empty list.`);return n}function hf(e,t){return`<linearGradient id="${e}" x1="0" y1="0" x2="0" y2="1">${t.map(([e,t,n])=>`<stop offset="${X(e)}" stop-color="${t}"${n===void 0?``:` stop-opacity="${X(n)}"`}/>`).join(``)}</linearGradient>`}var gf=`<filter id="grain" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency=".75" numOctaves="2" seed="3" stitchTiles="stitch"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0 0 0 -.18"/></filter>`,_f=`<rect ${df} filter="url(#grain)" opacity=".5"/>`;function vf(e,t,n=.012){return`<filter id="${e}" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency="${String(n)}" numOctaves="3" seed="7"/><feDisplacementMap in="SourceGraphic" scale="${String(t)}" xChannelSelector="R" yChannelSelector="G"/></filter>`}function yf(e,t){return`<filter id="${e}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${String(t)}"/></filter>`}function bf(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${String(lf)} ${String(uf)}" preserveAspectRatio="xMidYMid slice"><defs>${gf}${e}</defs>${t}${_f}</svg>`}var xf=class{by=new Map;add(e,t){this.by.set(e,`${this.by.get(e)??``}${t}`)}draw(e){let t=``;for(let[n,r]of this.by)t+=`<path d="${r}" stroke="${n}" stroke-width="${X(e)}" stroke-linecap="round" fill="none"/>`;return t}};function Sf(e,t,n){let r=(e,t)=>Number.parseInt(e.slice(1+t*2,3+t*2),16);return`#${[0,1,2].map(i=>Math.round(r(e,i)+(r(t,i)-r(e,i))*n).toString(16).padStart(2,`0`)).join(``)}`}function Cf(e,t,n,r){let i=``;for(let a=-20;a<=1820;a+=12){let o=e-t*(Math.sin(a*n+r)*.55+Math.sin(a*n*2.3+r*1.7)*.3+Math.sin(a*n*5.9+r*.6)*.12);i+=`${i===``?`M`:`L`}${ff(a)} ${ff(o)}`}return`${i}L1820 620L-20 620Z`}function wf(){let e=rf,t=pf(1884),n={base:`#E7E3CF`,own:[e.soft,e.ground,`#E9DDB0`,`#F1E7C6`],other:[`#BCCAD6`,`#CFC6DA`]},r={base:`#AEBBC8`,own:[`#94A9C0`,e.notes[1],`#C3CFDA`,e.soft],other:[`#E2C27E`,`#C99FB8`]},i={base:`#97A350`,own:[`#A6B262`,`#C6B65A`,e.notes[3],`#93A752`,`#D8B85A`],other:[e.notes[0],`#E09A68`]},a={base:`#34463E`,own:[e.ink,`#3E3A4C`,`#3B5848`,`#46506A`],other:[e.notes[2],e.notes[1],`#8C6A8E`]},o={base:`#3E5836`,own:[e.ink,`#46633A`,`#3B5848`,`#55703F`],other:[e.notes[2],e.notes[1]]},s={base:`#2F3A30`,own:[e.ink,`#2B3530`,`#3E3A4C`],other:[e.notes[2],`#4E4466`]},c={base:`#3A3550`,own:[`#3E3A4C`,`#4E4466`,`#2F3A4A`,`#5A4E74`],other:[e.notes[1],`#8C6A8E`]},l={base:`#4E4466`,own:[e.notes[2],`#5A4E74`,`#3E3A4C`,`#6E5E86`],other:[`#8C6A8E`]},u=e=>228+Math.sin(e/210)*5+Math.sin(e/47)*3,d=e=>300+Math.sin(e/260)*12+Math.sin(e/61)*4,f=e=>336+e*.17+Math.sin(e/140)*14,p=[[150,.05],[420,-.04],[1540,.06],[1720,-.03]],m=(e,t)=>t<470&&p.some(([n,r])=>Math.abs(e-(n+(t-400)*r))<8+Math.max(0,Math.min(1,t/420))*12),h=(e,t)=>p.some(([n])=>((e-n)/230)**2+((t-40)/150)**2<1+Math.sin(e/23+t/31)*.12),g=1180,_=(e,t)=>t>316&&t<414&&Math.abs(e-g-(t-316)*.08)<20+(t-316)*.2||((e-g-36)/26)**2+((t-344)/28)**2<1||((e-g)/18)**2+((t-298)/30)**2<1||((e-g+3)/13)**2+((t-258)/15)**2<1,v=(e,t)=>t<240&&((e-g+16)/78)**2+((t-240)/52)**2<1,y=(e,t)=>v(e,t)?l:_(e,t)?c:m(e,t)?s:h(e,t)?o:t<u(e)?n:t<d(e)?r:t>f(e)?a:i,b=new xf;for(let e=4;e<uf;e+=15*.82)for(let i=4+t()*15;i<lf;i+=15*(.8+t()*.4)){let a=i+(t()-.5)*15*.5,o=e+(t()-.5)*15*.5,s=y(a,o);if((s===n||s===r)&&t()<.3)continue;let c=t()<.72?mf(s.own,t()):mf(s.other,t()),l=(t()-.5)*1.6;b.add(c,`M${ff(a)} ${ff(o)}l${ff(Math.cos(l)*4)} ${ff(Math.sin(l)*4)}`)}let x=e=>Array.from({length:37},(t,n)=>`L${ff(n*50)} ${ff(e(n*50))}`).join(``);return bf(``,`${`<rect ${df} fill="${n.base}"/><path d="M0 600L0 ${ff(u(0))}${x(u)}L1800 600Z" fill="${r.base}"/><path d="M0 600L0 ${ff(d(0))}${x(d)}L1800 600Z" fill="${i.base}"/><path d="M0 600L0 ${ff(f(0))}${x(f)}L1800 600Z" fill="${a.base}"/>`}${b.draw(9)}`)}function Tf(){let e=af,[,,t,n]=e.notes,r=(t,n,r,i)=>`<g id="${t}"><circle r="110" fill="${n}" stroke="${e.ink}" stroke-width="3.6"/>${[.8,.62,.44,.26].map((e,t)=>`<circle r="${X(110*e)}" fill="none" stroke="${t===3?i:r}" stroke-width="${t===3?`4.4`:`3.4`}"/>`).join(``)}</g>`,i=``,a=0;for(let e=432;e<710;e+=55,a++)for(let t=a%2==0?0:110;t<2020;t+=220)i+=`<use href="#${a%4==2?`b`:`a`}" x="${X(t)}" y="${X(e)}"/>`;let o=``;for(let e=1;e<6;e++){let t=-96+e*32;o+=`M${X(t)} -206Q${X(t+14)} -112 ${X(t)} -24`}let s=`<g transform="translate(1250 ${X(346.2)}) scale(.62) rotate(-3)" stroke="${e.ink}" stroke-linejoin="round"><path d="M-96 -206H96Q124 -112 96 -24H-96Q-68 -112 -96 -206Z" fill="${Sf(e.soft,n,.3)}" stroke-width="4.6"/><path d="${o}" fill="none" stroke-width="3.4"/><g fill="${e.ink}"><path d="M-210 -26L-170 -6H150L232 -58L218 4Q160 30 40 30H-150Q-196 12 -210 -26Z"/><path d="M-4 -234H4V-6H-4Z"/><path d="M-110 -214H110" stroke-width="8"/></g></g>`;return bf(`${r(`a`,e.soft,e.middle,n)}${r(`b`,t,e.ink,e.soft)}${hf(`bokashi`,[[0,e.ink],[.22,e.middle],[.5,Sf(e.tone,e.soft,.5)],[.62,e.soft]])}${vf(`cut`,3,.04)}`,`<rect ${df} fill="url(#bokashi)"/><g filter="url(#cut)">${s}${i}</g>`)}function Ef(){let e=af,t=pf(1857),n=new xf;for(let r=0;r<22;r++){let i=r/21,a=342+i**1.6*250,o=10+i*34,s=o*(1.6+t()*.6);for(let r=-t()*s;r<lf;r+=s)n.add(i<.35?e.soft:i<.7?e.tone:e.middle,`M${ff(r)} ${ff(a+(t()-.5)*4)}h${ff(o)}`)}let r=(t,n,r)=>`<path d="M${X(t)} ${X(n)}l${X(r*.1)} ${X(-r)}l${X(r*.55)} ${X(r*.12)}l${X(-r*.05)} ${X(r*.88)}Z" fill="${e.soft}"/><path d="M${X(t-r*.2)} ${X(n)}h${X(r*1.1)}l${X(-r*.15)} ${X(r*.14)}h${X(-r*.8)}Z" fill="${e.ink}"/>`,i=(e,t,n)=>{let r=`M${X(e-n/2)} ${X(t)}`;for(let i=0;i<6;i++){let a=e-n/2+i*n/6;r+=`Q${X(a+n/12)} ${X(t-n*(.16+.08*Math.sin(i*1.7)))} ${X(a+n/6)} ${X(t)}`}return`${r}Q${X(e)} ${X(t+n*.08)} ${X(e-n/2)} ${X(t)}Z`},a=`<path d="M-20 600 C 40 470 90 380 150 300 C 200 236 280 196 380 178 L 386 192 C 300 210 228 252 186 318 C 140 390 104 480 70 600 Z"/>
|
|
119
|
-
<path d="M170 300 C 230 290 300 300 360 330 L 352 340 C 296 314 236 306 176 314 Z"/>
|
|
120
|
-
<path d="M250 214 C 300 170 360 150 420 150 L 420 162 C 364 164 310 182 262 222 Z"/>
|
|
121
|
-
<path d="${i(370,168,170)}${i(440,146,120)}${i(300,236,150)}${i(380,332,150)}${i(110,262,190)}${i(60,380,160)}${i(200,168,120)}"/>`;return bf(`${hf(`sky`,[[0,e.ink],[.24,e.middle],[.5,e.ground],[.56,e.soft]])}${hf(`sea`,[[0,e.tone],[.35,e.middle],[.8,e.ink]])}${vf(`block`,3,.03)}`,`<rect ${df} fill="url(#sky)"/>
|
|
122
|
-
<rect y="330" width="${String(lf)}" height="270" fill="url(#sea)"/>
|
|
123
|
-
<g filter="url(#block)">
|
|
124
|
-
<path d="M1040 334 L1250 210 Q1270 200 1290 210 L1500 334 Z" fill="${e.middle}"/>
|
|
125
|
-
<path d="M1196 242 L1250 210 Q1270 200 1290 210 L1344 242 L1322 238 L1304 252 L1286 236 L1268 254 L1250 238 L1232 252 L1216 238 Z" fill="#FFFDF6"/>
|
|
126
|
-
<path d="M560 336 C 700 324 860 326 1000 334 L 1000 340 L 560 340 Z" fill="${e.ink}" opacity=".75"/>
|
|
127
|
-
${r(760,352,34)}${r(850,348,22)}${r(1560,352,28)}
|
|
128
|
-
${n.draw(3)}
|
|
129
|
-
<g fill="${e.ground}"><rect x="440" y="250" width="560" height="24" rx="12"/><rect x="620" y="284" width="380" height="18" rx="9"/><rect x="1420" y="262" width="440" height="22" rx="11"/><rect x="1180" y="140" width="680" height="20" rx="10"/></g>
|
|
130
|
-
<g fill="#13263F">${a}</g>
|
|
131
|
-
</g>`)}function Df(){let e=of,t=pf(1891),n=(e,t,n)=>{let r=`M${X(e-n)} ${X(t)}C${X(e-n*1.04)} ${X(t-n*.35)} ${X(e-n*1.12)} ${X(t-n*.7)} ${X(e-n*1.08)} ${X(t-n*.86)}C${X(e-n*.92)} ${X(t-n*1.4)} ${X(e-n*.42)} ${X(t-n*2.08)} ${X(e-n*.04)} ${X(t-n*2.16)}`,i=`${r}Q${X(e+n*.04)} ${X(t-n*2.2)} ${X(e+n*.12)} ${X(t-n*2.16)}C${X(e+n*.5)} ${X(t-n*2.06)} ${X(e+n*.96)} ${X(t-n*1.4)} ${X(e+n*1.1)} ${X(t-n*.86)}C${X(e+n*1.14)} ${X(t-n*.7)} ${X(e+n*1.04)} ${X(t-n*.35)} ${X(e+n)} ${X(t)}Z`,a=`shade${ff(e)}`;return`<path d="M${X(e)} ${X(t+n*.02)}L${X(e+n*5)} ${X(t+n*.12)}Q${X(e+n*5.2)} ${X(t+n*.22)} ${X(e+n*4.8)} ${X(t+n*.3)}L${X(e-n*.7)} ${X(t+n*.22)}Z" fill="#6A62A0" opacity=".6" filter="url(#soft)"/>
|
|
132
|
-
<clipPath id="${a}"><path d="M${X(e+n*.2)} ${X(t-n*2.3)}Q${X(e-n*.25)} ${X(t-n)} ${X(e+n*.05)} ${X(t+n*.1)}H${X(e+n*1.3)}V${X(t-n*2.3)}Z"/></clipPath>
|
|
133
|
-
<g filter="url(#dab)">
|
|
134
|
-
<path d="${i}" fill="#B07468"/>
|
|
135
|
-
<path d="${i}" fill="#55508A" opacity=".55" clip-path="url(#${a})"/>
|
|
136
|
-
<path d="${r}" stroke="#F0A860" stroke-width="${X(n*.13)}" fill="none" stroke-linecap="round"/>
|
|
137
|
-
</g>`},r=new xf;for(let n=0;n<1800;n++){let n=t()*lf,i=t()*uf,a=i<150?[`#8E86A4`,`#A08AA0`,e.middle,`#B49AA4`]:i<270?[e.notes[0],`#C98B78`,`#D9A88A`,`#B9A0B0`]:i<318?[`#E7C996`,`#F0D9AE`,e.notes[3],`#DDB792`]:i<352?[`#9C93AE`,e.middle,`#A79AB0`]:[`#C9A877`,`#B9A06E`,`#9DA578`,e.notes[2],`#D7B680`,`#A48FA6`],o=8+t()*14;r.add(mf(a,t()),`M${ff(n)} ${ff(i)}l${ff(o)} ${ff((t()-.5)*3)}`)}let i=`M-20 360`;for(let e=-20;e<=1840;e+=60)i+=`L${ff(e)} ${ff(328-Math.sin(e/300)*10-t()*8)}`;return i+=`L1840 362Z`,bf(`${hf(`sky`,[[0,`#8F87A6`],[.32,e.notes[0]],[.5,`#E9C995`],[.56,`#EED7A8`]])}${hf(`field`,[[0,`#CFAE7A`],[1,`#8F9670`]])}<radialGradient id="sun" cx=".16" cy=".5" r=".32"><stop offset="0" stop-color="#FBEBC4"/><stop offset="1" stop-color="#FBEBC4" stop-opacity="0"/></radialGradient>${vf(`paint`,8,.02)}${vf(`dab`,7,.09)}${yf(`soft`,5)}`,`<rect ${df} fill="url(#sky)"/><rect y="350" width="${String(lf)}" height="250" fill="url(#field)"/>
|
|
138
|
-
<g filter="url(#paint)">
|
|
139
|
-
<rect ${df} fill="url(#sky)"/>
|
|
140
|
-
<rect y="350" width="${String(lf)}" height="250" fill="url(#field)"/>
|
|
141
|
-
<path d="${i}" fill="#9A92AE"/>
|
|
142
|
-
<g opacity=".55">${r.draw(6)}</g>
|
|
143
|
-
<rect ${df} fill="url(#sun)"/>
|
|
144
|
-
</g>
|
|
145
|
-
${n(1040,452,72)}${n(1350,408,40)}`)}function Of(){let e=sf,[,t,n,r]=e.notes,i=pf(1877),a={x:900,y:70},o=``;for(let e=-9;e<=9;e++){let t=a.x+e*110,n=a.y+Math.abs(e)*((300-a.y)/9);o+=`M${ff(t)} ${ff(n)}V${ff(n-140)}`}let s=(t,n)=>{let r=``;for(let e=0;e<8;e++){let i=e*Math.PI/4;r+=`M${X(t)} ${X(432-n)}l${X(Math.cos(i)*n*.86)} ${X(Math.sin(i)*n*.86)}`}return`<circle cx="${X(t)}" cy="${X(432-n)}" r="${X(n)}" fill="none" stroke="${e.ink}" stroke-width="9"/><path d="${r}" stroke="${e.ink}" stroke-width="4"/><circle cx="${X(t)}" cy="${X(432-n)}" r="${X(n*.18)}" fill="${e.ink}"/>`},c=[560,676],l=``,u=``;for(let t=0;t<34;t++){let n=((t+i())/34)**1.3,r=446+n*900+(i()-.5)*60*(1+n),a=246-Math.sqrt(n)*90+n*40+(i()-.5)*40*(1+n),o=34+n*120+i()*30,s=26+n*46+i()*16;u+=`<ellipse cx="${X(r+14)}" cy="${X(a+s*.5)}" rx="${X(o*.9)}" ry="${X(s*.6)}"/>`,l+=`<ellipse cx="${X(r)}" cy="${X(a)}" rx="${X(o)}" ry="${X(s)}" fill="${mf([e.soft,`#FFFFFF`,e.ground],i())}" opacity="${X(.95-n*.5)}"/>`}return bf(`${hf(`lazare-air`,[[0,Sf(e.middle,e.ink,.25)],[.5,Sf(e.middle,e.soft,.55)],[.72,e.soft],[1,e.ground]])}${yf(`lazare-steam`,16)}${yf(`lazare-far`,6)}${vf(`lazare-paint`,6,.015)}`,`<rect ${df} fill="url(#lazare-air)"/>
|
|
146
|
-
<g filter="url(#lazare-far)" opacity=".55"><path d="M520 426V330H600V300H660V318H740V286H800V310H880V276H930V300H1010V322H1090V296H1150V330H1240V426Z" fill="${Sf(e.middle,e.soft,.45)}"/></g>
|
|
147
|
-
<g filter="url(#lazare-paint)">
|
|
148
|
-
<path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300 V-20 H-20 Z" fill="${Sf(e.middle,e.ink,.35)}" opacity=".55"/>
|
|
149
|
-
<path d="${o}" stroke="${e.ink}" stroke-width="3" opacity=".3"/>
|
|
150
|
-
<path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300" stroke="${e.ink}" stroke-width="9" fill="none" opacity=".7"/>
|
|
151
|
-
<path d="M-20 292 H1820" stroke="${e.ink}" stroke-width="4" opacity=".4"/>
|
|
152
|
-
<rect x="-20" y="432" width="1840" height="208" fill="${Sf(e.middle,e.ink,.45)}"/>
|
|
153
|
-
<path d="M-20 434 H1820" stroke="${e.ink}" stroke-width="6"/>
|
|
154
|
-
<path d="M-20 472 H1820" stroke="${Sf(e.middle,e.soft,.4)}" stroke-width="3" opacity=".6"/>
|
|
155
|
-
<path d="M1300 432 V352 H1720 V432 Z" fill="${Sf(e.middle,e.ink,.5)}" opacity=".55"/>
|
|
156
|
-
<path d="M1320 368 H1700" stroke="${e.soft}" stroke-width="10" stroke-dasharray="34 18" opacity=".35"/>
|
|
157
|
-
<path d="M856 404 V318 H1010 V404 Z" fill="${Sf(e.ink,t,.2)}"/>
|
|
158
|
-
<path d="M370 388 H1020 V404 H370 Z" fill="${e.ink}"/>
|
|
159
|
-
<path d="M420 322 H740 V388 H420 Z" fill="${Sf(e.ink,t,.35)}"/>
|
|
160
|
-
<path d="M420 338 H740" stroke="${r}" stroke-width="3" opacity=".7"/>
|
|
161
|
-
<path d="M420 322 Q382 324 382 355 Q382 386 420 388 Z" fill="${e.ink}"/>
|
|
162
|
-
<path d="M430 322 V276 H424 V264 H466 V276 H460 V322 Z" fill="${e.ink}"/>
|
|
163
|
-
<path d="M560 322 Q560 296 584 296 Q608 296 608 322 Z" fill="${r}"/>
|
|
164
|
-
<path d="M732 398 V270 H842 V398 Z" fill="${Sf(e.ink,t,.2)}"/>
|
|
165
|
-
<path d="M720 270 H854 V258 H720 Z" fill="${e.ink}"/>
|
|
166
|
-
<rect x="756" y="290" width="60" height="44" rx="4" fill="${Sf(e.soft,r,.25)}" opacity=".85"/>
|
|
167
|
-
<rect x="362" y="378" width="22" height="26" fill="${n}"/>
|
|
168
|
-
${s(452,30)}${c.map(e=>s(e,46)).join(``)}${s(900,26)}${s(970,26)}
|
|
169
|
-
<path d="M${X(c[0]??0)} 402 H${X(c[1]??0)}" stroke="${r}" stroke-width="8" stroke-linecap="round"/>
|
|
170
|
-
</g>
|
|
171
|
-
<g filter="url(#lazare-steam)"><g fill="${Sf(e.middle,e.ink,.2)}" opacity=".35">${u}</g>${l}</g>`)}function kf(){let e=of,[t,,,n]=e.notes,r=[{base:352,amp:46,f:.0042,phase:.6,fill:Sf(t,e.middle,.45)},{base:388,amp:52,f:.0055,phase:2.1,fill:e.middle},{base:428,amp:48,f:.0071,phase:4,fill:Sf(e.middle,e.ink,.55)},{base:486,amp:40,f:.0093,phase:1.2,fill:e.ink}];return bf(`${hf(`dusk-sky`,[[0,Sf(e.tone,t,.35)],[.36,Sf(t,n,.25)],[.56,n],[.68,Sf(n,e.soft,.6)]])}<radialGradient id="dusk-glow" cx="1140" cy="328" r="440" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".85"/><stop offset=".25" stop-color="${n}" stop-opacity=".45"/><stop offset="1" stop-color="${n}" stop-opacity="0"/></radialGradient>${yf(`dusk-mist`,14)}${vf(`dusk-cut`,4,.03)}`,`<rect ${df} fill="url(#dusk-sky)"/><rect ${df} fill="url(#dusk-glow)"/>
|
|
172
|
-
<circle cx="1140" cy="328" r="66" fill="${e.soft}"/>
|
|
173
|
-
<g filter="url(#dusk-cut)">${r.map((t,n)=>`<path d="${Cf(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/>${n<r.length-1?`<rect y="${String(t.base+4)}" width="${String(lf)}" height="26" fill="${e.soft}" opacity=".16" filter="url(#dusk-mist)"/>`:``}`).join(``)}</g>`)}function Af(){let e=af,t=pf(1833),n=[{base:330,amp:40,f:.0038,phase:1.4,fill:Sf(e.tone,e.middle,.35)},{base:372,amp:46,f:.0052,phase:3.3,fill:Sf(e.tone,e.middle,.8)},{base:418,amp:36,f:.0069,phase:.4,fill:Sf(e.middle,e.ink,.45)}],r=new xf;for(let n=0;n<64;n++){let n=t(),i=468+n*124,a=t()<.7,o=a?640+(t()-.5)*(90+n*220):t()*lf,s=(a?24:40)+t()*(a?70:90);r.add(a?e.soft:Sf(e.tone,e.soft,.5),`M${ff(o-s/2)} ${ff(i)}h${ff(s)}`)}let i=``;for(let e=0;e<7;e++){let n=1060+e*52+(t()-.5)*16,r=214+Math.abs(e-2)*16+(t()-.5)*8,a=15-Math.abs(e-2)*1.2;i+=`M${X(n-a)} ${X(r-a*.3)}Q${X(n-a*.45)} ${X(r-a*.5)} ${X(n)} ${X(r)}Q${X(n+a*.45)} ${X(r-a*.5)} ${X(n+a)} ${X(r-a*.3)}`}return bf(`${hf(`lake-sky`,[[0,e.tone],[.55,Sf(e.tone,e.soft,.7)],[.74,e.soft]])}${hf(`lake-water`,[[0,Sf(e.middle,e.ink,.35)],[1,e.ink]])}<radialGradient id="lake-glow" cx="640" cy="318" r="380" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".95"/><stop offset=".3" stop-color="${Sf(e.soft,e.notes[3],.3)}" stop-opacity=".45"/><stop offset="1" stop-color="${e.soft}" stop-opacity="0"/></radialGradient>${yf(`lake-mist`,16)}${vf(`lake-cut`,4,.03)}`,`<rect ${df} fill="url(#lake-sky)"/><rect ${df} fill="url(#lake-glow)"/>
|
|
174
|
-
<g filter="url(#lake-cut)">${n.map(t=>`<path d="${Cf(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/><rect y="${String(t.base+6)}" width="${String(lf)}" height="24" fill="${e.soft}" opacity=".18" filter="url(#lake-mist)"/>`).join(``)}
|
|
175
|
-
<rect y="452" width="${String(lf)}" height="148" fill="url(#lake-water)"/></g>
|
|
176
|
-
<g opacity=".5">${r.draw(3)}</g>
|
|
177
|
-
<path d="${i}" fill="none" stroke="${e.ink}" stroke-width="3.4" stroke-linecap="round" opacity=".8"/>`)}var jf={dots:wf,scales:Tf,bay:Ef,stacks:Df,steam:Of,dusk:kf,lake:Af},Mf=new Map;function Nf(e){let t=Mf.get(e);return t===void 0&&(t=jf[e](),Mf.set(e,t)),t}function Pf(e){return`cover-${e}.svg`}var Ff={slash_menu:{heading:{title:`Heading 1`,subtext:`Top-level heading`,aliases:[`h`,`heading1`,`h1`],group:`Headings`},heading_2:{title:`Heading 2`,subtext:`Key section heading`,aliases:[`h2`,`heading2`,`subheading`],group:`Headings`},heading_3:{title:`Heading 3`,subtext:`Subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`],group:`Headings`},heading_4:{title:`Heading 4`,subtext:`Minor subsection heading`,aliases:[`h4`,`heading4`,`subheading4`],group:`Subheadings`},heading_5:{title:`Heading 5`,subtext:`Small subsection heading`,aliases:[`h5`,`heading5`,`subheading5`],group:`Subheadings`},heading_6:{title:`Heading 6`,subtext:`Lowest-level heading`,aliases:[`h6`,`heading6`,`subheading6`],group:`Subheadings`},toggle_heading:{title:`Toggle Heading 1`,subtext:`Toggleable top-level heading`,aliases:[`h`,`heading1`,`h1`,`collapsable`],group:`Subheadings`},toggle_heading_2:{title:`Toggle Heading 2`,subtext:`Toggleable key section heading`,aliases:[`h2`,`heading2`,`subheading`,`collapsable`],group:`Subheadings`},toggle_heading_3:{title:`Toggle Heading 3`,subtext:`Toggleable subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`,`collapsable`],group:`Subheadings`},quote:{title:`Quote`,subtext:`Quote or excerpt`,aliases:[`quotation`,`blockquote`,`bq`],group:`Basic blocks`},toggle_list:{title:`Toggle List`,subtext:`List with hideable sub-items`,aliases:[`li`,`list`,`toggleList`,`toggle list`,`collapsable list`],group:`Basic blocks`},numbered_list:{title:`Numbered List`,subtext:`List with ordered items`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`],group:`Basic blocks`},bullet_list:{title:`Bullet List`,subtext:`List with unordered items`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`],group:`Basic blocks`},check_list:{title:`Check List`,subtext:`List with checkboxes`,aliases:[`ul`,`li`,`list`,`checklist`,`check list`,`checked list`,`checkbox`],group:`Basic blocks`},paragraph:{title:`Paragraph`,subtext:`The body of your document`,aliases:[`p`,`paragraph`],group:`Basic blocks`},code_block:{title:`Code Block`,subtext:`Code block with syntax highlighting`,aliases:[`code`,`pre`],group:`Basic blocks`},page_break:{title:`Page Break`,subtext:`Page separator`,aliases:[`page`,`break`,`separator`],group:`Basic blocks`},table:{title:`Table`,subtext:`Table with editable cells`,aliases:[`table`],group:`Advanced`},image:{title:`Image`,subtext:`Resizable image with caption`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`],group:`Media`},video:{title:`Video`,subtext:`Resizable video with caption`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`],group:`Media`},audio:{title:`Audio`,subtext:`Embedded audio with caption`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`],group:`Media`},file:{title:`File`,subtext:`Embedded file`,aliases:[`file`,`upload`,`embed`,`media`,`url`],group:`Media`},emoji:{title:`Emoji`,subtext:`Search for and insert an emoji`,aliases:[`emoji`,`emote`,`emotion`,`face`],group:`Others`},divider:{title:`Divider`,subtext:`Visually divide blocks`,aliases:[`divider`,`hr`,`line`,`horizontal rule`],group:`Basic blocks`}},placeholders:{default:`Enter text or type '/' for commands`,heading:`Heading`,toggleListItem:`Toggle`,bulletListItem:`List`,numberedListItem:`List`,checkListItem:`List`,emptyDocument:void 0,new_comment:`Write a comment...`,edit_comment:`Edit comment...`,comment_reply:`Add comment...`},file_blocks:{add_button_text:{image:`Add image`,video:`Add video`,audio:`Add audio`,file:`Add file`}},toggle_blocks:{add_block_button:`Empty toggle. Click to add a block.`,toggle_button:`Expand or collapse`},code_block:{add_source_button_text:`Add source code`,ok_button_text:`OK`},side_menu:{add_block_label:`Add block`,drag_handle_label:`Open block menu`},drag_handle:{delete_menuitem:`Delete`,colors_menuitem:`Colors`,header_row_menuitem:`Header row`,header_column_menuitem:`Header column`},table_handle:{delete_column_menuitem:`Delete column`,delete_row_menuitem:`Delete row`,add_left_menuitem:`Add column left`,add_right_menuitem:`Add column right`,add_above_menuitem:`Add row above`,add_below_menuitem:`Add row below`,split_cell_menuitem:`Split cell`,merge_cells_menuitem:`Merge cells`,background_color_menuitem:`Background color`},suggestion_menu:{no_items_title:`No items found`},color_picker:{text_title:`Text`,background_title:`Background`,colors:{default:`Auto`,gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`}},formatting_toolbar:{bold:{tooltip:`Bold`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italic`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Underline`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Strike`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Colors`},link:{tooltip:`Create link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Edit caption`,input_placeholder:`Edit caption`},file_replace:{tooltip:{image:`Replace image`,video:`Replace video`,audio:`Replace audio`,file:`Replace file`}},file_rename:{tooltip:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`},input_placeholder:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`}},file_download:{tooltip:{image:`Download image`,video:`Download video`,audio:`Download audio`,file:`Download file`}},file_delete:{tooltip:{image:`Delete image`,video:`Delete video`,audio:`Delete audio`,file:`Delete file`}},file_preview_toggle:{tooltip:`Toggle preview`},nest:{tooltip:`Nest block`,secondary_tooltip:`Tab`},unnest:{tooltip:`Unnest block`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Align text left`},align_center:{tooltip:`Align text center`},align_right:{tooltip:`Align text right`},align_justify:{tooltip:`Justify text`},table_cell_merge:{tooltip:`Merge cells`},comment:{tooltip:`Add comment`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload image`,video:`Upload video`,audio:`Upload audio`,file:`Upload file`},upload_error:`Error: Upload failed`},embed:{title:`Embed`,embed_button:{image:`Embed image`,video:`Embed video`,audio:`Embed audio`,file:`Embed file`},url_placeholder:`Enter URL`}},link_toolbar:{delete:{tooltip:`Remove link`},edit:{text:`Edit link`,tooltip:`Edit`},open:{tooltip:`Open in new tab`},form:{title_placeholder:`Edit title`,url_placeholder:`Edit URL`}},comments:{edited:`edited`,save_button_text:`Save`,cancel_button_text:`Cancel`,deleted_reference_text:`Original content deleted`,discard_pending_comment:`Are you sure you want to discard this comment?`,actions:{add_reaction:`Add reaction`,resolve:`Resolve`,reopen:`Re-open`,edit_comment:`Edit comment`,delete_comment:`Delete comment`,more_actions:`More actions`},reactions:{reacted_by:`Reacted by`},sidebar:{marked_as_resolved:`Marked as resolved`,more_replies:e=>`${e} more replies`}},suggestion_changes:{formatting_change:`Formatting Change`,deleted:`Deleted`,inserted:`Inserted`,inserted_by:e=>`Inserted by: ${e}`,deleted_by:e=>`Deleted by: ${e}`,changed:`Changed`,changed_by:e=>`Changed by: ${e}`,formatting_change_by:(e,t)=>`Formatting change (${e}) by: ${t}`},versioning:{start_of_document:`Start of document`,compare_since_beginning_menuitem:`Compare since beginning`,title:`History`,close:`Close`,show_named_only:`Show named versions only`,show_all:`Show all versions`,comparison_on:`Turn on comparison`,comparison_off:`Turn off comparison`,versions_list:`Versions`,empty:`No versions yet`,empty_named_only:`No named versions`,current_version:`Current version`,before_restore:`Before restore`,comparing_to:`Comparing to`,restored_from:e=>`Restored from ${e}`,more_actions:`More actions`,version_name_input:`Version name`,name_version_menuitem:`Name this version`,rename_menuitem:`Rename`,compare_with_menuitem:`Compare with this version`,restore_menuitem:`Restore`,delete_menuitem:`Delete`,action_failed:`Something went wrong. Please try again.`,history_load_failed:`Failed to load version history`},exporter:{open_file:`Open file`,open_video_file:`Open video`,open_audio_file:`Open audio`},generic:{loading:`Loading...`,load_more:`Load more`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},If={en:Ff,"zh-cn":{slash_menu:{heading:{title:`一级标题`,subtext:`用于顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`],group:`标题`},heading_2:{title:`二级标题`,subtext:`用于关键部分`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`],group:`标题`},heading_3:{title:`三级标题`,subtext:`用于小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`],group:`标题`},heading_4:{title:`四级标题`,subtext:`用于较小的子节标题`,aliases:[`h4`,`heading4`,`subheading4`,`四级标题`],group:`副标题`},heading_5:{title:`五级标题`,subtext:`用于较小的子节标题`,aliases:[`h5`,`heading5`,`subheading5`,`五级标题`],group:`副标题`},heading_6:{title:`六级标题`,subtext:`用于最低层级的标题`,aliases:[`h6`,`heading6`,`subheading6`,`六级标题`],group:`副标题`},toggle_heading:{title:`可折叠一级标题`,subtext:`可折叠的顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`,`折叠`],group:`副标题`},toggle_heading_2:{title:`可折叠二级标题`,subtext:`可折叠的关键部分标题`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`,`折叠`],group:`副标题`},toggle_heading_3:{title:`可折叠三级标题`,subtext:`可折叠的小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`,`折叠`],group:`副标题`},quote:{title:`引用`,subtext:`引用或摘录`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本块`},numbered_list:{title:`有序列表`,subtext:`用于显示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基础`},bullet_list:{title:`无序列表`,subtext:`用于显示无序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`无序列表`],group:`基础`},check_list:{title:`检查清单`,subtext:`用于显示带有复选框的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`检查清单`,`勾选列表`,`复选框`],group:`基础`},toggle_list:{title:`可折叠列表`,subtext:`带有可隐藏子项的列表`,aliases:[`li`,`列表`,`可折叠列表`,`折叠列表`],group:`基础`},paragraph:{title:`段落`,subtext:`用于文档正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基础`},code_block:{title:`代码块`,subtext:`用于显示带有语法高亮的代码块`,aliases:[`code`,`pre`,`代码`,`预格式`],group:`基础`},page_break:{title:`分页符`,subtext:`页面分隔符`,aliases:[`page`,`break`,`separator`,`分页`,`分隔符`],group:`基础`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`高级功能`},image:{title:`图片`,subtext:`插入图片`,aliases:[`图片`,`上传图片`,`上传`,`image`,`img`,`相册`,`媒体`,`url`],group:`媒体`},video:{title:`视频`,subtext:`插入视频`,aliases:[`视频`,`视频上传`,`上传`,`video`,`mp4`,`电影`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},audio:{title:`音频`,subtext:`插入音频`,aliases:[`音频`,`音频上传`,`上传`,`audio`,`mp3`,`声音`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},file:{title:`文件`,subtext:`插入文件`,aliases:[`文件`,`上传`,`file`,`嵌入`,`媒体`,`url`],group:`媒体`},emoji:{title:`表情符号`,subtext:`用于插入表情符号`,aliases:[`表情符号`,`emoji`,`face`,`emote`,`表情`,`表情表达`,`表情`],group:`其他`},divider:{title:`分隔线`,subtext:`分隔线区块`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基础区块`}},placeholders:{default:`输入 '/' 以使用命令`,heading:`标题`,toggleListItem:`切换`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`写评论...`,edit_comment:`编辑评论...`,comment_reply:`添加评论...`},file_blocks:{add_button_text:{image:`添加图片`,video:`添加视频`,audio:`添加音频`,file:`添加文件`}},toggle_blocks:{add_block_button:`空的切换区。点击添加区块。`,toggle_button:`展开或收起`},code_block:{add_source_button_text:`添加源代码`,ok_button_text:`确定`},side_menu:{add_block_label:`添加块`,drag_handle_label:`打开菜单`},drag_handle:{delete_menuitem:`删除`,colors_menuitem:`颜色`,header_row_menuitem:`行标题`,header_column_menuitem:`列标题`},table_handle:{delete_column_menuitem:`删除列`,delete_row_menuitem:`删除行`,add_left_menuitem:`左侧添加列`,add_right_menuitem:`右侧添加列`,add_above_menuitem:`上方添加行`,add_below_menuitem:`下方添加行`,split_cell_menuitem:`拆分单元格`,merge_cells_menuitem:`合并单元格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`无匹配项`},color_picker:{text_title:`文本`,background_title:`背景色`,colors:{default:`自动`,gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`加粗`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下划线`,secondary_tooltip:`Mod+U`},strike:{tooltip:`删除线`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`代码标记`,secondary_tooltip:``},colors:{tooltip:`颜色`},link:{tooltip:`添加链接`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`编辑标题`,input_placeholder:`编辑标题`},file_replace:{tooltip:{image:`替换图片`,video:`替换视频`,audio:`替换音频`,file:`替换文件`}},file_rename:{tooltip:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`},input_placeholder:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`}},file_download:{tooltip:{image:`下载图片`,video:`下载视频`,audio:`下载音频`,file:`下载文件`}},file_delete:{tooltip:{image:`删除图片`,video:`删除视频`,audio:`删除音频`,file:`删除文件`}},file_preview_toggle:{tooltip:`切换预览`},nest:{tooltip:`嵌套`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消嵌套`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左对齐`},align_center:{tooltip:`居中`},align_right:{tooltip:`右对齐`},align_justify:{tooltip:`文本对齐`},table_cell_merge:{tooltip:`合并单元格`},comment:{tooltip:`添加评论`}},file_panel:{upload:{title:`上传`,file_placeholder:{image:`上传图片`,video:`上传视频`,audio:`上传音频`,file:`上传文件`},upload_error:`Error:上传失败`},embed:{title:`嵌入`,embed_button:{image:`嵌入图片`,video:`嵌入视频`,audio:`嵌入音频`,file:`嵌入文件`},url_placeholder:`输入图片地址`}},link_toolbar:{delete:{tooltip:`清除链接`},edit:{text:`编辑链接`,tooltip:`编辑`},open:{tooltip:`新窗口打开`},form:{title_placeholder:`编辑标题`,url_placeholder:`编辑链接地址`}},comments:{edited:`已编辑`,save_button_text:`保存`,cancel_button_text:`取消`,deleted_reference_text:`原始内容已删除`,discard_pending_comment:`确定要放弃此评论吗?`,actions:{add_reaction:`添加反应`,resolve:`解决`,reopen:`重新打开`,edit_comment:`编辑评论`,delete_comment:`删除评论`,more_actions:`更多操作`},reactions:{reacted_by:`已回应`},sidebar:{marked_as_resolved:`标记为已解决`,more_replies:e=>`还有 ${e} 条回复`}},suggestion_changes:{formatting_change:`格式更改`,deleted:`已删除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`删除者:${e}`,changed:`已更改`,changed_by:e=>`更改者:${e}`,formatting_change_by:(e,t)=>`格式更改(${e}),更改者:${t}`},versioning:{start_of_document:`文档开始`,compare_since_beginning_menuitem:`从头开始比较`,title:`历史记录`,close:`关闭`,show_named_only:`仅显示已命名的版本`,show_all:`显示所有版本`,comparison_on:`开启对比`,comparison_off:`关闭对比`,versions_list:`版本`,empty:`暂无版本`,empty_named_only:`暂无命名版本`,current_version:`当前版本`,before_restore:`恢复前`,comparing_to:`对比对象`,restored_from:e=>`恢复自 ${e}`,more_actions:`更多操作`,version_name_input:`版本名称`,name_version_menuitem:`命名此版本`,rename_menuitem:`重命名`,compare_with_menuitem:`与此版本对比`,restore_menuitem:`恢复`,delete_menuitem:`删除`,action_failed:`出错了,请重试。`,history_load_failed:`无法加载版本历史记录`},exporter:{open_file:`打开文件`,open_video_file:`打开视频`,open_audio_file:`打开音频`},generic:{loading:`加载中...`,load_more:`加载更多`,ctrl_shortcut:`Ctrl`,form_submit:`确定`}},"zh-tw":{slash_menu:{heading:{title:`一級標題`,subtext:`用於頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`],group:`標題`},heading_2:{title:`二級標題`,subtext:`用於關鍵部分`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`],group:`標題`},heading_3:{title:`三級標題`,subtext:`用於小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`],group:`標題`},heading_4:{title:`四級標題`,subtext:`用於小節和分組標題`,aliases:[`h4`,`heading4`,`subheading`,`標題`,`四級標題`],group:`副標題`},heading_5:{title:`五級標題`,subtext:`用於小節和分組標題`,aliases:[`h5`,`heading5`,`subheading`,`標題`,`五級標題`],group:`副標題`},heading_6:{title:`六級標題`,subtext:`用於小節和分組標題`,aliases:[`h6`,`heading6`,`subheading`,`標題`,`六級標題`],group:`副標題`},toggle_heading:{title:`可摺疊一級標題`,subtext:`可摺疊的頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`,`摺疊`],group:`副標題`},toggle_heading_2:{title:`可摺疊二級標題`,subtext:`可摺疊的關鍵部分標題`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`,`摺疊`],group:`副標題`},toggle_heading_3:{title:`可摺疊三級標題`,subtext:`可摺疊的小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`,`摺疊`],group:`副標題`},quote:{title:`引用`,subtext:`引用或摘錄`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本區塊`},numbered_list:{title:`有序列表`,subtext:`用於顯示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基礎`},bullet_list:{title:`無序列表`,subtext:`用於顯示無序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`無序列表`],group:`基礎`},check_list:{title:`檢查清單`,subtext:`用於顯示帶有核取方塊的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`檢查清單`,`勾選列表`,`核取方塊`],group:`基礎`},toggle_list:{title:`可摺疊列表`,subtext:`帶有可隱藏子項的列表`,aliases:[`li`,`列表`,`可摺疊列表`,`摺疊列表`],group:`基礎`},paragraph:{title:`段落`,subtext:`用於文件正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基礎`},code_block:{title:`程式碼區塊`,subtext:`用於顯示帶有語法標記的程式碼區塊`,aliases:[`code`,`pre`,`程式碼`,`預格式`],group:`基礎`},page_break:{title:`分頁符`,subtext:`頁面分隔符`,aliases:[`page`,`break`,`separator`,`分頁`,`分隔符`],group:`基礎`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`進階功能`},image:{title:`圖片`,subtext:`插入圖片`,aliases:[`圖片`,`上傳圖片`,`上傳`,`image`,`img`,`相簿`,`媒體`,`url`],group:`媒體`},video:{title:`影片`,subtext:`插入影片`,aliases:[`影片`,`影片上傳`,`上傳`,`video`,`mp4`,`電影`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},audio:{title:`音訊`,subtext:`插入音訊`,aliases:[`音訊`,`音訊上傳`,`上傳`,`audio`,`mp3`,`聲音`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},file:{title:`檔案`,subtext:`插入檔案`,aliases:[`檔案`,`上傳`,`file`,`嵌入`,`媒體`,`url`],group:`媒體`},emoji:{title:`表情符號`,subtext:`用於插入表情符號`,aliases:[`表情符號`,`emoji`,`face`,`emote`,`表情`,`表情表達`,`表情`],group:`其他`},divider:{title:`分隔線`,subtext:`分隔線區塊`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基礎區塊`}},placeholders:{default:`輸入 '/' 以使用指令`,heading:`標題`,toggleListItem:`切換`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`撰寫評論...`,edit_comment:`編輯評論...`,comment_reply:`新增評論...`},file_blocks:{add_button_text:{image:`新增圖片`,video:`新增影片`,audio:`新增音訊`,file:`新增檔案`}},toggle_blocks:{add_block_button:`空的切換區。點擊新增區塊。`,toggle_button:`展開或收合`},code_block:{add_source_button_text:`新增原始碼`,ok_button_text:`確定`},side_menu:{add_block_label:`新增區塊`,drag_handle_label:`開啟選單`},drag_handle:{delete_menuitem:`刪除`,colors_menuitem:`顏色`,header_row_menuitem:`列標題`,header_column_menuitem:`欄標題`},table_handle:{delete_column_menuitem:`刪除欄`,delete_row_menuitem:`刪除列`,add_left_menuitem:`左側新增欄`,add_right_menuitem:`右側新增欄`,add_above_menuitem:`上方新增列`,add_below_menuitem:`下方新增列`,split_cell_menuitem:`分割儲存格`,merge_cells_menuitem:`合併儲存格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`無相符項目`},color_picker:{text_title:`文字`,background_title:`背景色`,colors:{default:`自動`,gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橙色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`粗體`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜體`,secondary_tooltip:`Mod+I`},underline:{tooltip:`底線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`刪除線`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`程式碼標記`,secondary_tooltip:``},colors:{tooltip:`顏色`},link:{tooltip:`新增連結`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`編輯標題`,input_placeholder:`編輯標題`},file_replace:{tooltip:{image:`替換圖片`,video:`替換影片`,audio:`替換音訊`,file:`替換檔案`}},file_rename:{tooltip:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`},input_placeholder:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`}},file_download:{tooltip:{image:`下載圖片`,video:`下載影片`,audio:`下載音訊`,file:`下載檔案`}},file_delete:{tooltip:{image:`刪除圖片`,video:`刪除影片`,audio:`刪除音訊`,file:`刪除檔案`}},file_preview_toggle:{tooltip:`切換預覽`},nest:{tooltip:`巢狀`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消巢狀`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`靠左對齊`},align_center:{tooltip:`置中`},align_right:{tooltip:`靠右對齊`},align_justify:{tooltip:`兩端對齊`},table_cell_merge:{tooltip:`合併儲存格`},comment:{tooltip:`新增評論`}},file_panel:{upload:{title:`上傳`,file_placeholder:{image:`上傳圖片`,video:`上傳影片`,audio:`上傳音訊`,file:`上傳檔案`},upload_error:`錯誤:上傳失敗`},embed:{title:`嵌入`,embed_button:{image:`嵌入圖片`,video:`嵌入影片`,audio:`嵌入音訊`,file:`嵌入檔案`},url_placeholder:`輸入圖片網址`}},link_toolbar:{delete:{tooltip:`清除連結`},edit:{text:`編輯連結`,tooltip:`編輯`},open:{tooltip:`在新視窗開啟`},form:{title_placeholder:`編輯標題`,url_placeholder:`編輯連結網址`}},comments:{edited:`已編輯`,save_button_text:`儲存`,cancel_button_text:`取消`,deleted_reference_text:`原始內容已刪除`,discard_pending_comment:`確定要捨棄此評論嗎?`,actions:{add_reaction:`新增回應`,resolve:`解決`,reopen:`重新開啟`,edit_comment:`編輯評論`,delete_comment:`刪除評論`,more_actions:`更多操作`},reactions:{reacted_by:`已回應`},sidebar:{marked_as_resolved:`標記為已解決`,more_replies:e=>`還有 ${e} 則回覆`}},suggestion_changes:{formatting_change:`格式變更`,deleted:`已刪除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`刪除者:${e}`,changed:`已變更`,changed_by:e=>`變更者:${e}`,formatting_change_by:(e,t)=>`格式變更(${e}),變更者:${t}`},versioning:{start_of_document:`文件開始`,compare_since_beginning_menuitem:`從頭開始比較`,title:`版本紀錄`,close:`關閉`,show_named_only:`僅顯示已命名的版本`,show_all:`顯示所有版本`,comparison_on:`開啟比較`,comparison_off:`關閉比較`,versions_list:`版本`,empty:`尚無版本`,empty_named_only:`尚無命名版本`,current_version:`目前版本`,before_restore:`還原前`,comparing_to:`比較對象`,restored_from:e=>`已從 ${e} 還原`,more_actions:`更多操作`,version_name_input:`版本名稱`,name_version_menuitem:`為此版本命名`,rename_menuitem:`重新命名`,compare_with_menuitem:`與此版本比較`,restore_menuitem:`還原`,delete_menuitem:`刪除`,action_failed:`發生錯誤,請再試一次。`,history_load_failed:`無法載入版本歷史記錄`},exporter:{open_file:`開啟檔案`,open_video_file:`開啟影片`,open_audio_file:`開啟音訊`},generic:{loading:`載入中...`,load_more:`載入更多`,ctrl_shortcut:`Ctrl`,form_submit:`確定`}},ja:{slash_menu:{heading:{title:`見出し1`,subtext:`トップレベルの見出しに使用`,aliases:[`h`,`見出し1`,`h1`,`大見出し`],group:`見出し`},heading_2:{title:`見出し2`,subtext:`重要なセクションに使用`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`],group:`見出し`},heading_3:{title:`見出し3`,subtext:`セクションやグループの見出しに使用`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`],group:`見出し`},heading_4:{title:`見出し4`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h4`,`見出し4`,`subheading4`,`小見出し4`],group:`サブ見出し`},heading_5:{title:`見出し5`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h5`,`見出し5`,`subheading5`,`小見出し5`],group:`サブ見出し`},heading_6:{title:`見出し6`,subtext:`最下位レベルの見出しに使用`,aliases:[`h6`,`見出し6`,`subheading6`,`小見出し6`],group:`サブ見出し`},toggle_heading:{title:`折りたたみ見出し1`,subtext:`内容の表示/非表示が切り替え可能なトップレベルの見出し`,aliases:[`h`,`見出し1`,`h1`,`大見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_2:{title:`折りたたみ見出し2`,subtext:`内容の表示/非表示が切り替え可能な重要なセクションの見出し`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_3:{title:`折りたたみ見出し3`,subtext:`内容の表示/非表示が切り替え可能なセクションやグループの見出し`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},quote:{title:`引用`,subtext:`引用または抜粋`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本ブロック`},numbered_list:{title:`番号付リスト`,subtext:`番号付リストを表示するために使用`,aliases:[`ol`,`li`,`numberedlist`,`numbered list`,`リスト`,`番号付リスト`,`番号 リスト`],group:`基本ブロック`},bullet_list:{title:`箇条書き`,subtext:`箇条書きを表示するために使用`,aliases:[`ul`,`li`,`bulletlist`,`bullet list`,`リスト`,`箇条書きリスト`],group:`基本ブロック`},check_list:{title:`チェックリスト`,subtext:`チェックボックス付きリストを表示するために使用されます`,aliases:[`ul`,`li`,`list`,`checklist`,`checked list`,`リスト`,`チェックリスト`,`チェックされたリスト`],group:`基本ブロック`},toggle_list:{title:`折りたたみリスト`,subtext:`サブ項目を非表示にできるリスト`,aliases:[`li`,`リスト`,`折りたたみリスト`,`トグルリスト`,`折りたたみリスト`],group:`基本ブロック`},paragraph:{title:`標準テキスト`,subtext:`本文に使用`,aliases:[`p`,`paragraph`,`標準テキスト`],group:`基本ブロック`},code_block:{title:`コードブロック`,subtext:`シンタックスハイライト付きのコードブロック`,aliases:[`code`,`pre`,`コード`,`コードブロック`],group:`基本ブロック`},page_break:{title:`改ページ`,subtext:`ページ区切り`,aliases:[`page`,`break`,`separator`,`改ページ`,`区切り`],group:`基本ブロック`},table:{title:`表`,subtext:`表に使用`,aliases:[`table`,`表`,`テーブル`],group:`高度なブロック`},image:{title:`画像`,subtext:`画像を挿入`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`,`画像`],group:`メディア`},video:{title:`ビデオ`,subtext:`ビデオを挿入`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`,`ビデオ`],group:`メディア`},audio:{title:`オーディオ`,subtext:`オーディオを挿入`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`,`オーディオ`],group:`メディア`},file:{title:`ファイル`,subtext:`ファイルを挿入`,aliases:[`file`,`upload`,`embed`,`media`,`url`,`ファイル`],group:`メディア`},emoji:{title:`絵文字`,subtext:`絵文字を挿入するために使用します`,aliases:[`絵文字`,`顔文字`,`感情表現`,`顔`],group:`その他`},divider:{title:`区切り`,subtext:`区切りを表示するために使用`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基本ブロック`}},placeholders:{default:`テキストを入力するか'/' を入力してコマンド選択`,heading:`見出し`,toggleListItem:`トグル`,bulletListItem:`リストを追加`,numberedListItem:`リストを追加`,checkListItem:`リストを追加`,new_comment:`コメントを書く...`,edit_comment:`コメントを編集...`,comment_reply:`コメントを追加...`},file_blocks:{add_button_text:{image:`画像を追加`,video:`ビデオを追加`,audio:`オーディオを追加`,file:`ファイルを追加`}},toggle_blocks:{add_block_button:`空のトグルです。クリックしてブロックを追加。`,toggle_button:`展開または折りたたみ`},code_block:{add_source_button_text:`ソースコードを追加`,ok_button_text:`OK`},side_menu:{add_block_label:`ブロックを追加`,drag_handle_label:`ブロックメニュー`},drag_handle:{delete_menuitem:`削除`,colors_menuitem:`色を変更`,header_row_menuitem:`行の見出し`,header_column_menuitem:`列の見出し`},table_handle:{delete_column_menuitem:`列を削除`,delete_row_menuitem:`行を削除`,add_left_menuitem:`左に列を追加`,add_right_menuitem:`右に列を追加`,add_above_menuitem:`上に行を追加`,add_below_menuitem:`下に行を追加`,split_cell_menuitem:`セルを分割`,merge_cells_menuitem:`セルを結合`,background_color_menuitem:`背景色を変更`},suggestion_menu:{no_items_title:`アイテムが見つかりません`},color_picker:{text_title:`文字色`,background_title:`背景色`,colors:{default:`自動`,gray:`グレー`,brown:`茶色`,red:`赤`,orange:`オレンジ`,yellow:`黄色`,green:`緑`,blue:`青`,purple:`紫`,pink:`ピンク`}},formatting_toolbar:{bold:{tooltip:`太字`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`打ち消し`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`コード`,secondary_tooltip:``},colors:{tooltip:`色`},link:{tooltip:`リンク`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`キャプションを編集`,input_placeholder:`キャプションを編集`},file_replace:{tooltip:{image:`画像を置換`,video:`ビデオを置換`,audio:`オーディオを置換`,file:`ファイルを置換`}},file_rename:{tooltip:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`},input_placeholder:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`}},file_download:{tooltip:{image:`画像をダウンロード`,video:`ビデオをダウンロード`,audio:`オーディオをダウンロード`,file:`ファイルをダウンロード`}},file_delete:{tooltip:{image:`画像を削除`,video:`ビデオを削除`,audio:`オーディオを削除`,file:`ファイルを削除`}},file_preview_toggle:{tooltip:`プレビューの切り替え`},nest:{tooltip:`インデント増`,secondary_tooltip:`Tab`},unnest:{tooltip:`インデント減`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左揃え`},align_center:{tooltip:`中央揃え`},align_right:{tooltip:`右揃え`},align_justify:{tooltip:`両端揃え`},table_cell_merge:{tooltip:`セルを結合`},comment:{tooltip:`コメントを追加`}},file_panel:{upload:{title:`アップロード`,file_placeholder:{image:`画像をアップロード`,video:`ビデオをアップロード`,audio:`オーディオをアップロード`,file:`ファイルをアップロード`},upload_error:`エラー: アップロードが失敗しました`},embed:{title:`埋め込み`,embed_button:{image:`画像を埋め込む`,video:`ビデオを埋め込む`,audio:`オーディオを埋め込む`,file:`ファイルを埋め込む`},url_placeholder:`URLを入力`}},link_toolbar:{delete:{tooltip:`リンクを解除`},edit:{text:`リンクを編集`,tooltip:`編集`},open:{tooltip:`新しいタブでリンクを開く`},form:{title_placeholder:`タイトルを編集`,url_placeholder:`URLを編集`}},comments:{edited:`編集済み`,save_button_text:`保存`,cancel_button_text:`キャンセル`,deleted_reference_text:`元のコンテンツが削除されました`,discard_pending_comment:`このコメントを破棄してもよろしいですか?`,actions:{add_reaction:`リアクションを追加`,resolve:`解決`,reopen:`再開`,edit_comment:`コメントを編集`,delete_comment:`コメントを削除`,more_actions:`その他の操作`},reactions:{reacted_by:`リアクションした人`},sidebar:{marked_as_resolved:`解決済みとしてマーク`,more_replies:e=>`${e} 件の追加返信`}},suggestion_changes:{formatting_change:`書式の変更`,deleted:`削除済み`,inserted:`挿入済み`,inserted_by:e=>`挿入者: ${e}`,deleted_by:e=>`削除者: ${e}`,changed:`変更済み`,changed_by:e=>`変更者: ${e}`,formatting_change_by:(e,t)=>`書式の変更 (${e}) 変更者: ${t}`},versioning:{start_of_document:`ドキュメントの開始`,compare_since_beginning_menuitem:`最初から比較`,title:`履歴`,close:`閉じる`,show_named_only:`名前付きバージョンのみ表示`,show_all:`すべてのバージョンを表示`,comparison_on:`比較を有効にする`,comparison_off:`比較を無効にする`,versions_list:`バージョン`,empty:`バージョンはまだありません`,empty_named_only:`名前付きのバージョンはありません`,current_version:`現在のバージョン`,before_restore:`復元前`,comparing_to:`比較対象`,restored_from:e=>`${e} から復元`,more_actions:`その他の操作`,version_name_input:`バージョン名`,name_version_menuitem:`このバージョンに名前を付ける`,rename_menuitem:`名前を変更`,compare_with_menuitem:`このバージョンと比較`,restore_menuitem:`復元`,delete_menuitem:`削除`,action_failed:`問題が発生しました。もう一度お試しください。`,history_load_failed:`バージョン履歴を読み込めませんでした`},exporter:{open_file:`ファイルを開く`,open_video_file:`動画を開く`,open_audio_file:`音声を開く`},generic:{loading:`読み込み中...`,load_more:`さらに読み込む`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},ko:{slash_menu:{heading:{title:`제목1`,subtext:`섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`],group:`제목`},heading_2:{title:`제목2`,subtext:`섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`],group:`제목`},heading_3:{title:`제목3`,subtext:`섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`],group:`제목`},heading_4:{title:`제목4`,subtext:`하위 소단락 제목`,aliases:[`h4`,`제목4`,`소제목4`],group:`소제목`},heading_5:{title:`제목5`,subtext:`작은 하위 섹션 제목`,aliases:[`h5`,`제목5`,`소제목5`],group:`소제목`},heading_6:{title:`제목6`,subtext:`가장 하위 수준 제목`,aliases:[`h6`,`제목6`,`소제목6`],group:`소제목`},toggle_heading:{title:`접을 수 있는 제목1`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`,`접기`,`토글`],group:`소제목`},toggle_heading_2:{title:`접을 수 있는 제목2`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`,`접기`,`토글`],group:`소제목`},toggle_heading_3:{title:`접을 수 있는 제목3`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`,`접기`,`토글`],group:`소제목`},quote:{title:`인용`,subtext:`인용문 또는 발췌`,aliases:[`quotation`,`blockquote`,`bq`],group:`기본 블록`},numbered_list:{title:`번호 매기기 목록`,subtext:`번호가 매겨진 목록을 추가합니다.`,aliases:[`ol`,`li`,`목록`,`번호 매기기 목록`,`번호 목록`],group:`기본 블록`},bullet_list:{title:`글머리 기호 목록`,subtext:`간단한 글머리 기호를 추가합니다.`,aliases:[`ul`,`li`,`목록`,`글머리 기호 목록`,`글머리 목록`],group:`기본 블록`},check_list:{title:`체크리스트`,subtext:`체크박스가 있는 목록을 표시하는 데 사용`,aliases:[`ul`,`li`,`목록`,`체크리스트`,`체크 리스트`,`체크된 목록`,`체크박스`],group:`기본 블록`},toggle_list:{title:`접을 수 있는 목록`,subtext:`숨길 수 있는 하위 항목이 있는 목록`,aliases:[`li`,`목록`,`접을 수 있는 목록`,`토글 목록`,`접기 목록`],group:`기본 블록`},paragraph:{title:`본문`,subtext:`일반 텍스트`,aliases:[`p`,`paragraph`,`본문`],group:`기본 블록`},code_block:{title:`코드 블록`,subtext:`구문 강조가 있는 코드 블록`,aliases:[`code`,`pre`],group:`기본 블록`},page_break:{title:`페이지 나누기`,subtext:`페이지 구분자`,aliases:[`page`,`break`,`separator`,`페이지`,`구분자`],group:`기본 블록`},table:{title:`표`,subtext:`간단한 표를 추가합니다.`,aliases:[`표`],group:`고급`},image:{title:`이미지`,subtext:`이미지 파일을 업로드합니다.`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`이미지`,`url`],group:`미디어`},video:{title:`비디오`,subtext:`비디오 삽입`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`동영상`,`url`],group:`미디어`},audio:{title:`오디오`,subtext:`오디오 삽입`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`오디오`,`url`],group:`미디어`},file:{title:`파일`,subtext:`파일 삽입`,aliases:[`file`,`upload`,`embed`,`media`,`파일`,`url`],group:`미디어`},emoji:{title:`이모지`,subtext:`이모지 삽입용으로 사용됩니다`,aliases:[`이모지`,`emoji`,`감정 표현`,`emotion expression`,`표정`,`face expression`,`얼굴`,`face`],group:`기타`},divider:{title:`구분선`,subtext:`구분선 블록`,aliases:[`divider`,`hr`,`horizontal rule`],group:`기본 블록`}},placeholders:{default:`텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.`,heading:`제목`,toggleListItem:`토글`,bulletListItem:`목록`,numberedListItem:`목록`,checkListItem:`목록`,new_comment:`댓글 작성...`,edit_comment:`댓글 수정...`,comment_reply:`댓글 추가...`},file_blocks:{add_button_text:{image:`이미지 추가`,video:`비디오 추가`,audio:`오디오 추가`,file:`파일 추가`}},toggle_blocks:{add_block_button:`비어 있는 토글입니다. 클릭하여 블록을 추가하세요.`,toggle_button:`펼치기 또는 접기`},code_block:{add_source_button_text:`소스 코드 추가`,ok_button_text:`확인`},side_menu:{add_block_label:`블록 추가`,drag_handle_label:`블록 메뉴 열기`},drag_handle:{delete_menuitem:`삭제`,colors_menuitem:`색깔`,header_row_menuitem:`행 제목`,header_column_menuitem:`열 제목`},table_handle:{delete_column_menuitem:`열 1개 삭제`,delete_row_menuitem:`행 삭제`,add_left_menuitem:`왼쪽에 열 1개 추가`,add_right_menuitem:`오른쪽에 열 1개 추가`,add_above_menuitem:`위에 행 1개 추가`,add_below_menuitem:`아래에 행 1개 추가`,split_cell_menuitem:`셀 분할`,merge_cells_menuitem:`셀 병합`,background_color_menuitem:`배경색 변경`},suggestion_menu:{no_items_title:`항목을 찾을 수 없음`},color_picker:{text_title:`텍스트`,background_title:`배경`,colors:{default:`자동`,gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`녹색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`}},formatting_toolbar:{bold:{tooltip:`진하게`,secondary_tooltip:`Mod+B`},italic:{tooltip:`기울임`,secondary_tooltip:`Mod+I`},underline:{tooltip:`밑줄`,secondary_tooltip:`Mod+U`},strike:{tooltip:`취소선`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`코드`,secondary_tooltip:``},colors:{tooltip:`색깔`},link:{tooltip:`링크 만들기`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`이미지 캡션 수정`,input_placeholder:`이미지 캡션 수정`},file_replace:{tooltip:{image:`이미지 교체`,video:`비디오 교체`,audio:`오디오 교체`,file:`파일 교체`}},file_rename:{tooltip:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`},input_placeholder:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`}},file_download:{tooltip:{image:`이미지 다운로드`,video:`비디오 다운로드`,audio:`오디오 다운로드`,file:`파일 다운로드`}},file_delete:{tooltip:{image:`이미지 삭제`,video:`비디오 삭제`,audio:`오디오 삭제`,file:`파일 삭제`}},file_preview_toggle:{tooltip:`미리보기 전환`},nest:{tooltip:`중첩 블록`,secondary_tooltip:`Tab`},unnest:{tooltip:`비중첩 블록`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`텍스트 왼쪽 맞춤`},align_center:{tooltip:`텍스트 가운데 맞춤`},align_right:{tooltip:`텍스트 오른쪽 맞춤`},align_justify:{tooltip:`텍스트 양쪽 맞춤`},table_cell_merge:{tooltip:`셀 병합`},comment:{tooltip:`코멘트 추가`}},file_panel:{upload:{title:`업로드`,file_placeholder:{image:`이미지 업로드`,video:`비디오 업로드`,audio:`오디오 업로드`,file:`파일 업로드`},upload_error:`오류: 업로드 실패`},embed:{title:`임베드`,embed_button:{image:`이미지 삽입`,video:`비디오 삽입`,audio:`오디오 삽입`,file:`파일 삽입`},url_placeholder:`URL을 입력하세요.`}},link_toolbar:{delete:{tooltip:`링크 삭제`},edit:{text:`링크 수정`,tooltip:`수정`},open:{tooltip:`새 탭으로 열기`},form:{title_placeholder:`제목 수정`,url_placeholder:`URL 수정`}},comments:{edited:`수정됨`,save_button_text:`저장`,cancel_button_text:`취소`,deleted_reference_text:`원본 콘텐츠 삭제됨`,discard_pending_comment:`이 댓글을 삭제하시겠습니까?`,actions:{add_reaction:`반응 추가`,resolve:`해결`,reopen:`다시 열기`,edit_comment:`댓글 수정`,delete_comment:`댓글 삭제`,more_actions:`더 많은 작업`},reactions:{reacted_by:`반응한 사람`},sidebar:{marked_as_resolved:`해결됨으로 표시됨`,more_replies:e=>`${e}개의 추가 답글`}},suggestion_changes:{formatting_change:`서식 변경`,deleted:`삭제됨`,inserted:`삽입됨`,inserted_by:e=>`삽입한 사람: ${e}`,deleted_by:e=>`삭제한 사람: ${e}`,changed:`변경됨`,changed_by:e=>`변경한 사람: ${e}`,formatting_change_by:(e,t)=>`서식 변경 (${e}) 변경한 사람: ${t}`},versioning:{start_of_document:`문서 시작`,compare_since_beginning_menuitem:`처음부터 비교`,title:`기록`,close:`닫기`,show_named_only:`이름이 지정된 버전만 표시`,show_all:`모든 버전 표시`,comparison_on:`비교 켜기`,comparison_off:`비교 끄기`,versions_list:`버전`,empty:`아직 버전이 없습니다`,empty_named_only:`이름이 지정된 버전이 없습니다`,current_version:`현재 버전`,before_restore:`복원 전`,comparing_to:`비교 대상`,restored_from:e=>`${e}에서 복원됨`,more_actions:`추가 작업`,version_name_input:`버전 이름`,name_version_menuitem:`이 버전의 이름 지정`,rename_menuitem:`이름 바꾸기`,compare_with_menuitem:`이 버전과 비교`,restore_menuitem:`복원`,delete_menuitem:`삭제`,action_failed:`문제가 발생했습니다. 다시 시도해 주세요.`,history_load_failed:`버전 기록을 불러오지 못했습니다`},exporter:{open_file:`파일 열기`,open_video_file:`동영상 열기`,open_audio_file:`오디오 열기`},generic:{loading:`불러오는 중...`,load_more:`더 불러오기`,ctrl_shortcut:`Ctrl`,form_submit:`확인`}},es:{slash_menu:{heading:{title:`Encabezado 1`,subtext:`Encabezado de primer nivel`,aliases:[`h`,`encabezado1`,`h1`],group:`Encabezados`},heading_2:{title:`Encabezado 2`,subtext:`Encabezado de sección principal`,aliases:[`h2`,`encabezado2`,`subencabezado`],group:`Encabezados`},heading_3:{title:`Encabezado 3`,subtext:`Encabezado de subsección y grupo`,aliases:[`h3`,`encabezado3`,`subencabezado`],group:`Encabezados`},heading_4:{title:`Encabezado 4`,subtext:`Encabezado de subsección menor`,aliases:[`h4`,`encabezado4`,`subencabezado4`],group:`Subencabezados`},heading_5:{title:`Encabezado 5`,subtext:`Encabezado de subsección pequeña`,aliases:[`h5`,`encabezado5`,`subencabezado5`],group:`Subencabezados`},heading_6:{title:`Encabezado 6`,subtext:`Encabezado de nivel más bajo`,aliases:[`h6`,`encabezado6`,`subencabezado6`],group:`Subencabezados`},toggle_heading:{title:`Encabezado Plegable 1`,subtext:`Encabezado de primer nivel que se puede plegar`,aliases:[`h`,`encabezado1`,`h1`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_2:{title:`Encabezado Plegable 2`,subtext:`Encabezado de sección principal que se puede plegar`,aliases:[`h2`,`encabezado2`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_3:{title:`Encabezado Plegable 3`,subtext:`Encabezado de subsección y grupo que se puede plegar`,aliases:[`h3`,`encabezado3`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},quote:{title:`Cita`,subtext:`Cita o extracto`,aliases:[`quotation`,`blockquote`,`bq`],group:`Bloques básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Lista con elementos ordenados`,aliases:[`ol`,`li`,`lista`,`lista numerada`],group:`Bloques básicos`},bullet_list:{title:`Lista con Viñetas`,subtext:`Lista con elementos no ordenados`,aliases:[`ul`,`li`,`lista`,`lista con viñetas`],group:`Bloques básicos`},check_list:{title:`Lista de Verificación`,subtext:`Lista con casillas de verificación`,aliases:[`ul`,`li`,`lista`,`lista de verificación`,`lista de chequeo`,`checkbox`],group:`Bloques básicos`},toggle_list:{title:`Lista Plegable`,subtext:`Lista con subelementos ocultables`,aliases:[`li`,`lista`,`lista plegable`,`lista colapsable`],group:`Bloques básicos`},paragraph:{title:`Párrafo`,subtext:`El cuerpo de tu documento`,aliases:[`p`,`párrafo`],group:`Bloques básicos`},code_block:{title:`Bloque de Código`,subtext:`Bloque de código con resaltado de sintaxis`,aliases:[`code`,`pre`],group:`Bloques básicos`},page_break:{title:`Salto de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`salto`,`separador`],group:`Bloques básicos`},table:{title:`Tabla`,subtext:`Tabla con celdas editables`,aliases:[`tabla`],group:`Avanzado`},image:{title:`Imagen`,subtext:`Imagen redimensionable con leyenda`,aliases:[`imagen`,`subir imagen`,`cargar`,`img`,`foto`,`media`,`url`],group:`Medios`},video:{title:`Vídeo`,subtext:`Vídeo redimensionable con leyenda`,aliases:[`video`,`subir vídeo`,`cargar`,`mp4`,`película`,`media`,`url`],group:`Medios`},audio:{title:`Audio`,subtext:`Audio incrustado con leyenda`,aliases:[`audio`,`subir audio`,`cargar`,`mp3`,`sonido`,`media`,`url`],group:`Medios`},file:{title:`Archivo`,subtext:`Archivo incrustado`,aliases:[`archivo`,`cargar`,`incrustar`,`media`,`url`],group:`Medios`},emoji:{title:`Emoji`,subtext:`Busca e inserta un emoji`,aliases:[`emoji`,`emoticono`,`emoción`,`cara`],group:`Otros`},divider:{title:`Divisor`,subtext:`Divisor de bloques`,aliases:[`divisor`,`hr`,`horizontal rule`],group:`Bloques básicos`}},placeholders:{default:`Escribe o teclea '/' para comandos`,heading:`Encabezado`,toggleListItem:`Plegable`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escribe un comentario...`,edit_comment:`Editar comentario...`,comment_reply:`Agregar comentario...`},file_blocks:{add_button_text:{image:`Agregar imagen`,video:`Agregar vídeo`,audio:`Agregar audio`,file:`Agregar archivo`}},toggle_blocks:{add_block_button:`Toggle vacío. Haz clic para añadir un bloque.`,toggle_button:`Expandir o contraer`},code_block:{add_source_button_text:`Agregar código fuente`,ok_button_text:`Aceptar`},side_menu:{add_block_label:`Agregar bloque`,drag_handle_label:`Abrir menú de bloque`},drag_handle:{delete_menuitem:`Eliminar`,colors_menuitem:`Colores`,header_row_menuitem:`Fila de encabezado`,header_column_menuitem:`Columna de encabezado`},table_handle:{delete_column_menuitem:`Eliminar columna`,delete_row_menuitem:`Eliminar fila`,add_left_menuitem:`Agregar columna a la izquierda`,add_right_menuitem:`Agregar columna a la derecha`,add_above_menuitem:`Agregar fila arriba`,add_below_menuitem:`Agregar fila abajo`,split_cell_menuitem:`Dividir celda`,merge_cells_menuitem:`Combinar celdas`,background_color_menuitem:`Color de fondo`},suggestion_menu:{no_items_title:`No se encontraron elementos`},color_picker:{text_title:`Texto`,background_title:`Fondo`,colors:{default:`Automático`,gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrita`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Cursiva`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Subrayado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Tachado`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Colores`},link:{tooltip:`Crear enlace`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar leyenda`,input_placeholder:`Editar leyenda`},file_replace:{tooltip:{image:`Reemplazar imagen`,video:`Reemplazar vídeo`,audio:`Reemplazar audio`,file:`Reemplazar archivo`}},file_rename:{tooltip:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`},input_placeholder:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`}},file_download:{tooltip:{image:`Descargar imagen`,video:`Descargar vídeo`,audio:`Descargar audio`,file:`Descargar archivo`}},file_delete:{tooltip:{image:`Eliminar imagen`,video:`Eliminar vídeo`,audio:`Eliminar audio`,file:`Eliminar archivo`}},file_preview_toggle:{tooltip:`Alternar vista previa`},nest:{tooltip:`Anidar bloque`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desanidar bloque`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinear texto a la izquierda`},align_center:{tooltip:`Alinear texto al centro`},align_right:{tooltip:`Alinear texto a la derecha`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Combinar celdas`},comment:{tooltip:`Añadir comentario`}},file_panel:{upload:{title:`Subir`,file_placeholder:{image:`Subir imagen`,video:`Subir vídeo`,audio:`Subir audio`,file:`Subir archivo`},upload_error:`Error: Fallo en la subida`},embed:{title:`Incrustar`,embed_button:{image:`Incrustar imagen`,video:`Incrustar vídeo`,audio:`Incrustar audio`,file:`Incrustar archivo`},url_placeholder:`Introduce la URL`}},link_toolbar:{delete:{tooltip:`Eliminar enlace`},edit:{text:`Editar enlace`,tooltip:`Editar`},open:{tooltip:`Abrir en nueva pestaña`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Guardar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Contenido original eliminado`,discard_pending_comment:`¿Seguro que quieres descartar este comentario?`,actions:{add_reaction:`Agregar reacción`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentario`,delete_comment:`Eliminar comentario`,more_actions:`Más acciones`},reactions:{reacted_by:`Reaccionado por`},sidebar:{marked_as_resolved:`Marcado como resuelto`,more_replies:e=>`${e} respuestas más`}},suggestion_changes:{formatting_change:`Cambio de formato`,deleted:`Eliminado`,inserted:`Insertado`,inserted_by:e=>`Insertado por: ${e}`,deleted_by:e=>`Eliminado por: ${e}`,changed:`Modificado`,changed_by:e=>`Modificado por: ${e}`,formatting_change_by:(e,t)=>`Cambio de formato (${e}) por: ${t}`},versioning:{start_of_document:`Inicio del documento`,compare_since_beginning_menuitem:`Comparar desde el inicio`,title:`Historial`,close:`Cerrar`,show_named_only:`Mostrar solo versiones con nombre`,show_all:`Mostrar todas las versiones`,comparison_on:`Activar comparación`,comparison_off:`Desactivar comparación`,versions_list:`Versiones`,empty:`Aún no hay versiones`,empty_named_only:`No hay versiones con nombre`,current_version:`Versión actual`,before_restore:`Antes de restaurar`,comparing_to:`Comparando con`,restored_from:e=>`Restaurado desde ${e}`,more_actions:`Más acciones`,version_name_input:`Nombre de la versión`,name_version_menuitem:`Nombrar esta versión`,rename_menuitem:`Cambiar nombre`,compare_with_menuitem:`Comparar con esta versión`,restore_menuitem:`Restaurar`,delete_menuitem:`Eliminar`,action_failed:`Algo salió mal. Inténtalo de nuevo.`,history_load_failed:`No se pudo cargar el historial de versiones`},exporter:{open_file:`Abrir archivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir audio`},generic:{loading:`Cargando...`,load_more:`Cargar más`,ctrl_shortcut:`Ctrl`,form_submit:`Aceptar`}},fr:{slash_menu:{heading:{title:`Titre 1`,subtext:`Utilisé pour un titre de premier niveau`,aliases:[`h`,`titre1`,`h1`],group:`Titres`},heading_2:{title:`Titre 2`,subtext:`Titre de deuxième niveau Utilisé pour les sections clés`,aliases:[`h2`,`titre2`,`sous-titre`],group:`Titres`},heading_3:{title:`Titre 3`,subtext:`Titre de troisième niveau utilisé pour les sous-sections et les titres de groupe`,aliases:[`h3`,`titre3`,`sous-titre`],group:`Titres`},heading_4:{title:`Titre 4`,subtext:`Titre de sous‑section mineure`,aliases:[`h4`,`titre4`,`sous‑titre4`],group:`Sous-titres`},heading_5:{title:`Titre 5`,subtext:`Titre de sous-section mineure`,aliases:[`h5`,`titre5`,`sous-titre5`],group:`Sous-titres`},heading_6:{title:`Titre 6`,subtext:`Titre de niveau le plus bas`,aliases:[`h6`,`titre6`,`sous-titre6`],group:`Sous-titres`},toggle_heading:{title:`Titre Repliable 1`,subtext:`Titre de premier niveau qui peut être replié pour masquer son contenu`,aliases:[`h`,`titre1`,`h1`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_2:{title:`Titre Repliable 2`,subtext:`Titre de section qui peut être replié pour masquer son contenu`,aliases:[`h2`,`titre2`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_3:{title:`Titre Repliable 3`,subtext:`Titre de sous-section qui peut être replié pour masquer son contenu`,aliases:[`h3`,`titre3`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},quote:{title:`Citation`,subtext:`Citation ou extrait`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocs de base`},numbered_list:{title:`Liste Numérotée`,subtext:`Utilisé pour afficher une liste numérotée`,aliases:[`ol`,`li`,`liste`,`listenumérotée`,`liste numérotée`],group:`Blocs de base`},bullet_list:{title:`Liste à puces`,subtext:`Utilisé pour afficher une liste à puce non numérotée`,aliases:[`ul`,`li`,`liste`,`listeàpuces`,`liste à puces`,`bullet points`,`bulletpoints`],group:`Blocs de base`},check_list:{title:`Liste de tâches`,subtext:`Utilisé pour afficher une liste avec des cases à cocher`,aliases:[`ul`,`li`,`liste`,`liste de vérification`,`liste cochée`,`case à cocher`,`checklist`,`checkbox`,`check box`,`to do`,`todo`],group:`Blocs de base`},toggle_list:{title:`Liste repliable`,subtext:`Liste avec des sous-éléments masquables`,aliases:[`li`,`liste`,`liste pliable`,`liste escamotable`,`liste repliable`],group:`Blocs de base`},paragraph:{title:`Paragraphe`,subtext:`Utilisé pour le corps de votre document`,aliases:[`p`,`paragraphe`,`texte`],group:`Blocs de base`},code_block:{title:`Bloc de code`,subtext:`Bloc de code avec coloration syntaxique`,aliases:[`code`,`pre`],group:`Blocs de base`},page_break:{title:`Saut de page`,subtext:`Séparateur de page`,aliases:[`page`,`break`,`separator`,`saut`,`séparateur`],group:`Blocs de base`},table:{title:`Tableau`,subtext:`Utilisé pour les tableaux`,aliases:[`tableau`,`grille`],group:`Avancé`},image:{title:`Image`,subtext:`Insérer une image`,aliases:[`image`,`uploadImage`,`télécharger image`,`téléverser image`,`uploader image`,`img`,`photo`,`média`,`url`],group:`Médias`},video:{title:`Vidéo`,subtext:`Insérer une vidéo`,aliases:[`vidéo`,`télécharger vidéo`,`téléverser vidéo`,`mp4`,`film`,`média`,`url`],group:`Média`},audio:{title:`Audio`,subtext:`Insérer un audio`,aliases:[`audio`,`télécharger audio`,`téléverser audio`,`mp3`,`son`,`média`,`url`],group:`Média`},file:{title:`Fichier`,subtext:`Insérer un fichier`,aliases:[`fichier`,`téléverser fichier`,`intégrer fichier`,`insérer fichier`,`média`,`url`],group:`Média`},emoji:{title:`Emoji`,subtext:`Utilisé pour insérer un emoji`,aliases:[`emoji`,`émoticône`,`émotion`,`visage`,`smiley`],group:`Autres`},divider:{title:`Diviseur`,subtext:`Utilisé pour diviser les blocs`,aliases:[`diviseur`,`hr`,`horizontal rule`],group:`Blocs de base`}},placeholders:{default:`Entrez du texte ou tapez '/' pour faire apparaître les options de mise en page`,heading:`Titre`,toggleListItem:`Basculer`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Écrire un commentaire...`,edit_comment:`Modifier le commentaire...`,comment_reply:`Ajouter un commentaire...`},file_blocks:{add_button_text:{image:`Ajouter une image`,video:`Ajouter une vidéo`,audio:`Ajouter un audio`,file:`Ajouter un fichier`}},toggle_blocks:{add_block_button:`Liste repliable vide. Cliquez pour ajouter un bloc.`,toggle_button:`Déplier ou replier`},code_block:{add_source_button_text:`Ajouter le code source`,ok_button_text:`OK`},side_menu:{add_block_label:`Ajouter un bloc`,drag_handle_label:`Ouvrir le menu du bloc`},drag_handle:{delete_menuitem:`Supprimer`,colors_menuitem:`Couleurs`,header_row_menuitem:`En-tête de ligne`,header_column_menuitem:`En-tête de colonne`},table_handle:{delete_column_menuitem:`Supprimer la colonne`,delete_row_menuitem:`Supprimer la ligne`,add_left_menuitem:`Ajouter une colonne à gauche`,add_right_menuitem:`Ajouter une colonne à droite`,add_above_menuitem:`Ajouter une ligne au-dessus`,add_below_menuitem:`Ajouter une ligne en dessous`,split_cell_menuitem:`Diviser la cellule`,merge_cells_menuitem:`Fusionner les cellules`,background_color_menuitem:`Couleur de fond`},suggestion_menu:{no_items_title:`Aucun élément trouvé`},color_picker:{text_title:`Texte`,background_title:`Fond`,colors:{default:`Auto`,gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`}},formatting_toolbar:{bold:{tooltip:`Gras`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italique`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Souligner`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Barré`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Couleurs`},link:{tooltip:`Créer un lien`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Modifier la légende`,input_placeholder:`Modifier la légende`},file_replace:{tooltip:{image:`Remplacer l'image`,video:`Remplacer la vidéo`,audio:`Remplacer l'audio`,file:`Remplacer le fichier`}},file_rename:{tooltip:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`},input_placeholder:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`}},file_download:{tooltip:{image:`Télécharger l'image`,video:`Télécharger la vidéo`,audio:`Télécharger l'audio`,file:`Télécharger le fichier`}},file_delete:{tooltip:{image:`Supprimer l'image`,video:`Supprimer la vidéo`,audio:`Supprimer l'audio`,file:`Supprimer le fichier`}},file_preview_toggle:{tooltip:`Basculer l'aperçu`},nest:{tooltip:`Augmenter le retrait du bloc`,secondary_tooltip:`Tab`},unnest:{tooltip:`Diminuer le retait du bloc`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Aligner le texte à gauche`},align_center:{tooltip:`Aligner le texte au centre`},align_right:{tooltip:`Aligner le texte à droite`},align_justify:{tooltip:`Justifier le texte`},table_cell_merge:{tooltip:`Fusionner les cellules`},comment:{tooltip:`Ajouter un commentaire`}},file_panel:{upload:{title:`Télécharger`,file_placeholder:{image:`Télécharger une image`,video:`Télécharger une vidéo`,audio:`Télécharger un fichier audio`,file:`Télécharger un fichier`},upload_error:`Erreur : échec du téléchargement`},embed:{title:`Intégrer`,embed_button:{image:`Intégrer une image`,video:`Intégrer une vidéo`,audio:`Intégrer un fichier audio`,file:`Intégrer un fichier`},url_placeholder:`Entrez l'URL`}},link_toolbar:{delete:{tooltip:`Supprimer le lien`},edit:{text:`Modifier le lien`,tooltip:`Modifier`},open:{tooltip:`Ouvrir dans un nouvel onglet`},form:{title_placeholder:`Modifier le titre`,url_placeholder:`Modifier l'URL`}},comments:{edited:`modifié`,save_button_text:`Enregistrer`,cancel_button_text:`Annuler`,deleted_reference_text:`Contenu d'origine supprimé`,discard_pending_comment:`Voulez-vous vraiment abandonner ce commentaire ?`,actions:{add_reaction:`Ajouter une réaction`,resolve:`Résoudre`,reopen:`Rouvrir`,edit_comment:`Modifier le commentaire`,delete_comment:`Supprimer le commentaire`,more_actions:`Plus d'actions`},reactions:{reacted_by:`Réagi par`},sidebar:{marked_as_resolved:`Marqué comme résolu`,more_replies:e=>`${e} réponses de plus`}},suggestion_changes:{formatting_change:`Modification de mise en forme`,deleted:`Supprimé`,inserted:`Inséré`,inserted_by:e=>`Inséré par : ${e}`,deleted_by:e=>`Supprimé par : ${e}`,changed:`Modifié`,changed_by:e=>`Modifié par : ${e}`,formatting_change_by:(e,t)=>`Modification de mise en forme (${e}) par : ${t}`},versioning:{start_of_document:`Début du document`,compare_since_beginning_menuitem:`Comparer depuis le début`,title:`Historique`,close:`Fermer`,show_named_only:`Afficher uniquement les versions nommées`,show_all:`Afficher toutes les versions`,comparison_on:`Activer la comparaison`,comparison_off:`Désactiver la comparaison`,versions_list:`Versions`,empty:`Aucune version pour l'instant`,empty_named_only:`Aucune version nommée`,current_version:`Version actuelle`,before_restore:`Avant la restauration`,comparing_to:`Comparé à`,restored_from:e=>`Restauré depuis ${e}`,more_actions:`Plus d'actions`,version_name_input:`Nom de la version`,name_version_menuitem:`Nommer cette version`,rename_menuitem:`Renommer`,compare_with_menuitem:`Comparer avec cette version`,restore_menuitem:`Restaurer`,delete_menuitem:`Supprimer`,action_failed:`Une erreur s'est produite. Veuillez réessayer.`,history_load_failed:`Impossible de charger l'historique des versions`},exporter:{open_file:`Ouvrir le fichier`,open_video_file:`Ouvrir la vidéo`,open_audio_file:`Ouvrir l'audio`},generic:{loading:`Chargement...`,load_more:`Charger plus`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},de:{slash_menu:{heading:{title:`Überschrift 1`,subtext:`Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`],group:`Überschriften`},heading_2:{title:`Überschrift 2`,subtext:`Wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`],group:`Überschriften`},heading_3:{title:`Überschrift 3`,subtext:`Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`],group:`Überschriften`},heading_4:{title:`Überschrift 4`,subtext:`Überschrift für kleinere Unterabschnitte`,aliases:[`h4`,`überschrift4`,`unterüberschrift4`],group:`Unterüberschriften`},heading_5:{title:`Überschrift 5`,subtext:`Überschrift für tiefere Unterabschnitte`,aliases:[`h5`,`überschrift5`,`unterüberschrift5`],group:`Unterüberschriften`},heading_6:{title:`Überschrift 6`,subtext:`Überschrift auf der untersten Ebene`,aliases:[`h6`,`überschrift6`,`unterüberschrift6`],group:`Unterüberschriften`},toggle_heading:{title:`Aufklappbare Überschrift 1`,subtext:`Aufklappbare Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`,`aufklappbar`,`einklappbar`],group:`Unterüberschrift`},toggle_heading_2:{title:`Aufklappbare Überschrift 2`,subtext:`Aufklappbare wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},toggle_heading_3:{title:`Aufklappbare Überschrift 3`,subtext:`Aufklappbare Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},quote:{title:`Zitat`,subtext:`Zitat oder Auszug`,aliases:[`quotation`,`blockquote`,`bq`],group:`Grundlegende Blöcke`},numbered_list:{title:`Nummerierte Liste`,subtext:`Liste mit nummerierten Elementen`,aliases:[`ol`,`li`,`liste`,`nummerierteliste`,`nummerierte liste`],group:`Grundlegende Blöcke`},bullet_list:{title:`Aufzählungsliste`,subtext:`Liste mit unnummerierten Elementen`,aliases:[`ul`,`li`,`liste`,`aufzählungsliste`,`aufzählung liste`],group:`Grundlegende Blöcke`},check_list:{title:`Checkliste`,subtext:`Liste mit Kontrollkästchen`,aliases:[`ul`,`li`,`liste`,`checkliste`,`check liste`,`geprüfte liste`,`kontrollkästchen`],group:`Grundlegende Blöcke`},toggle_list:{title:`Aufklappbare Liste`,subtext:`Liste mit ausblendbare Unterpunkten`,aliases:[`li`,`liste`,`aufklappbare liste`,`einklappbare liste`,`aufklappbareListe`,`aufklappbare liste`],group:`Grundlegende Blöcke`},paragraph:{title:`Absatz`,subtext:`Der Hauptteil Ihres Dokuments`,aliases:[`p`,`absatz`],group:`Grundlegende Blöcke`},code_block:{title:`Codeblock`,subtext:`Codeblock mit Syntaxhervorhebung`,aliases:[`code`,`pre`],group:`Grundlegende Blöcke`},page_break:{title:`Seitenumbruch`,subtext:`Seitentrenner`,aliases:[`page`,`break`,`separator`,`seitenumbruch`,`trenner`],group:`Grundlegende Blöcke`},table:{title:`Tabelle`,subtext:`Tabelle mit editierbaren Zellen`,aliases:[`tabelle`],group:`Erweitert`},image:{title:`Bild`,subtext:`Größenveränderbares Bild mit Beschriftung`,aliases:[`bild`,`bildhochladen`,`hochladen`,`img`,`bild`,`medien`,`url`],group:`Medien`},video:{title:`Video`,subtext:`Größenveränderbares Video mit Beschriftung`,aliases:[`video`,`videoupload`,`hochladen`,`mp4`,`film`,`medien`,`url`],group:`Medien`},audio:{title:`Audio`,subtext:`Eingebettetes Audio mit Beschriftung`,aliases:[`audio`,`audioupload`,`hochladen`,`mp3`,`ton`,`medien`,`url`],group:`Medien`},file:{title:`Datei`,subtext:`Eingebettete Datei`,aliases:[`datei`,`hochladen`,`einbetten`,`medien`,`url`],group:`Medien`},emoji:{title:`Emoji`,subtext:`Nach Emoji suchen und einfügen`,aliases:[`emoji`,`emote`,`emotion`,`gesicht`],group:`Andere`},divider:{title:`Trennlinie`,subtext:`Trennlinie zwischen Blöcken`,aliases:[`trennlinie`,`hr`,`horizontal rule`],group:`Grundlegende Blöcke`}},placeholders:{default:`Text eingeben oder '/' für Befehle tippen`,heading:`Überschrift`,toggleListItem:`Umschalten`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Einen Kommentar schreiben …`,edit_comment:`Kommentar bearbeiten …`,comment_reply:`Kommentar hinzufügen …`},file_blocks:{add_button_text:{image:`Bild hinzufügen`,video:`Video hinzufügen`,audio:`Audio hinzufügen`,file:`Datei hinzufügen`}},toggle_blocks:{add_block_button:`Leerer aufklappbarer Bereich. Klicken, um einen Block hinzuzufügen.`,toggle_button:`Aufklappen oder zuklappen`},code_block:{add_source_button_text:`Quellcode hinzufügen`,ok_button_text:`OK`},side_menu:{add_block_label:`Block hinzufügen`,drag_handle_label:`Blockmenü öffnen`},drag_handle:{delete_menuitem:`Löschen`,colors_menuitem:`Farben`,header_row_menuitem:`Kopfzeile`,header_column_menuitem:`Kopfspalte`},table_handle:{delete_column_menuitem:`Spalte löschen`,delete_row_menuitem:`Zeile löschen`,add_left_menuitem:`Spalte links hinzufügen`,add_right_menuitem:`Spalte rechts hinzufügen`,add_above_menuitem:`Zeile oberhalb hinzufügen`,add_below_menuitem:`Zeile unterhalb hinzufügen`,split_cell_menuitem:`Zelle teilen`,merge_cells_menuitem:`Zellen zusammenführen`,background_color_menuitem:`Hintergrundfarbe`},suggestion_menu:{no_items_title:`Keine Elemente gefunden`},color_picker:{text_title:`Text`,background_title:`Hintergrund`,colors:{default:`Automatisch`,gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Fett`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Kursiv`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Unterstrichen`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Durchgestrichen`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Farben`},link:{tooltip:`Link erstellen`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Beschriftung bearbeiten`,input_placeholder:`Beschriftung bearbeiten`},file_replace:{tooltip:{image:`Bild ersetzen`,video:`Video ersetzen`,audio:`Audio ersetzen`,file:`Datei ersetzen`}},file_rename:{tooltip:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`},input_placeholder:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`}},file_download:{tooltip:{image:`Bild herunterladen`,video:`Video herunterladen`,audio:`Audio herunterladen`,file:`Datei herunterladen`}},file_delete:{tooltip:{image:`Bild löschen`,video:`Video löschen`,audio:`Audio löschen`,file:`Datei löschen`}},file_preview_toggle:{tooltip:`Vorschau umschalten`},nest:{tooltip:`Block verschachteln`,secondary_tooltip:`Tab`},unnest:{tooltip:`Block entnesten`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Text linksbündig`},align_center:{tooltip:`Text zentrieren`},align_right:{tooltip:`Text rechtsbündig`},align_justify:{tooltip:`Text Blocksatz`},table_cell_merge:{tooltip:`Zellen zusammenführen`},comment:{tooltip:`Kommentar hinzufügen`}},file_panel:{upload:{title:`Hochladen`,file_placeholder:{image:`Bild hochladen`,video:`Video hochladen`,audio:`Audio hochladen`,file:`Datei hochladen`},upload_error:`Fehler: Hochladen fehlgeschlagen`},embed:{title:`Einbetten`,embed_button:{image:`Bild einbetten`,video:`Video einbetten`,audio:`Audio einbetten`,file:`Datei einbetten`},url_placeholder:`URL eingeben`}},link_toolbar:{delete:{tooltip:`Link entfernen`},edit:{text:`Link bearbeiten`,tooltip:`Bearbeiten`},open:{tooltip:`In neuem Tab öffnen`},form:{title_placeholder:`Titel bearbeiten`,url_placeholder:`URL bearbeiten`}},comments:{edited:`bearbeitet`,save_button_text:`Speichern`,cancel_button_text:`Abbrechen`,deleted_reference_text:`Originalinhalt gelöscht`,discard_pending_comment:`Möchten Sie diesen Kommentar wirklich verwerfen?`,actions:{add_reaction:`Reaktion hinzufügen`,resolve:`Lösen`,reopen:`Wieder öffnen`,edit_comment:`Kommentar bearbeiten`,delete_comment:`Kommentar löschen`,more_actions:`Weitere Aktionen`},reactions:{reacted_by:`Reagiert von`},sidebar:{marked_as_resolved:`Als gelöst markiert`,more_replies:e=>`${e} weitere Antworten`}},suggestion_changes:{formatting_change:`Formatierungsänderung`,deleted:`Gelöscht`,inserted:`Eingefügt`,inserted_by:e=>`Eingefügt von: ${e}`,deleted_by:e=>`Gelöscht von: ${e}`,changed:`Geändert`,changed_by:e=>`Geändert von: ${e}`,formatting_change_by:(e,t)=>`Formatierungsänderung (${e}) von: ${t}`},versioning:{start_of_document:`Anfang des Dokuments`,compare_since_beginning_menuitem:`Seit Beginn vergleichen`,title:`Verlauf`,close:`Schließen`,show_named_only:`Nur benannte Versionen anzeigen`,show_all:`Alle Versionen anzeigen`,comparison_on:`Vergleich einschalten`,comparison_off:`Vergleich ausschalten`,versions_list:`Versionen`,empty:`Noch keine Versionen`,empty_named_only:`Keine benannten Versionen`,current_version:`Aktuelle Version`,before_restore:`Vor der Wiederherstellung`,comparing_to:`Verglichen mit`,restored_from:e=>`Wiederhergestellt aus ${e}`,more_actions:`Weitere Aktionen`,version_name_input:`Versionsname`,name_version_menuitem:`Diese Version benennen`,rename_menuitem:`Umbenennen`,compare_with_menuitem:`Mit dieser Version vergleichen`,restore_menuitem:`Wiederherstellen`,delete_menuitem:`Löschen`,action_failed:`Etwas ist schiefgelaufen. Bitte versuche es erneut.`,history_load_failed:`Versionsverlauf konnte nicht geladen werden`},exporter:{open_file:`Datei öffnen`,open_video_file:`Video öffnen`,open_audio_file:`Audio öffnen`},generic:{loading:`Wird geladen...`,load_more:`Mehr laden`,ctrl_shortcut:`Strg`,form_submit:`OK`}},pt:{slash_menu:{heading:{title:`Título`,subtext:`Usado para um título de nível superior`,aliases:[`h`,`titulo1`,`h1`],group:`Títulos`},heading_2:{title:`Título 2`,subtext:`Usado para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`],group:`Títulos`},heading_3:{title:`Título 3`,subtext:`Usado para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`],group:`Títulos`},heading_4:{title:`Título 4`,subtext:`Usado para subseções menores`,aliases:[`h4`,`titulo4`,`subtitulo4`],group:`Subtítulos`},heading_5:{title:`Título 5`,subtext:`Usado para títulos de subseções pequenas`,aliases:[`h5`,`titulo5`,`subtitulo5`],group:`Subtítulos`},heading_6:{title:`Título 6`,subtext:`Usado para títulos de nível mais baixo`,aliases:[`h6`,`titulo6`,`subtitulo6`],group:`Subtítulos`},toggle_heading:{title:`Título Expansível`,subtext:`Título expansível de nível superior`,aliases:[`h`,`titulo1`,`h1`,`expansível`],group:`Subtítulos`},toggle_heading_2:{title:`Título Expansível 2`,subtext:`Título expansível para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`,`expansível`],group:`Subtítulos`},toggle_heading_3:{title:`Título Expansível 3`,subtext:`Título expansível para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`,`expansível`],group:`Subtítulos`},quote:{title:`Citação`,subtext:`Citação ou trecho`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocos básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Usado para exibir uma lista numerada`,aliases:[`ol`,`li`,`lista`,`listanumerada`,`lista numerada`],group:`Blocos básicos`},bullet_list:{title:`Lista com Marcadores`,subtext:`Usado para exibir uma lista não ordenada`,aliases:[`ul`,`li`,`lista`,`listamarcadores`,`lista com marcadores`],group:`Blocos básicos`},check_list:{title:`Lista de verificação`,subtext:`Usado para exibir uma lista com caixas de seleção`,aliases:[`ul`,`li`,`lista`,`lista de verificação`,`lista marcada`,`caixa de seleção`],group:`Blocos básicos`},toggle_list:{title:`Lista expansível`,subtext:`Lista com subitens ocultáveis`,aliases:[`li`,`lista`,`lista expansível`,`lista recolhível`],group:`Blocos básicos`},paragraph:{title:`Parágrafo`,subtext:`Usado para o corpo do seu documento`,aliases:[`p`,`paragrafo`],group:`Blocos básicos`},code_block:{title:`Bloco de Código`,subtext:`Usado para exibir código com destaque de sintaxe`,aliases:[`codigo`,`pre`],group:`Blocos básicos`},page_break:{title:`Quebra de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`quebra`,`separador`],group:`Blocos básicos`},table:{title:`Tabela`,subtext:`Usado para tabelas`,aliases:[`tabela`],group:`Avançado`},image:{title:`Imagem`,subtext:`Inserir uma imagem`,aliases:[`imagem`,`uploadImagem`,`upload`,`img`,`foto`,`media`,`url`],group:`Mídia`},video:{title:`Vídeo`,subtext:`Inserir um vídeo`,aliases:[`vídeo`,`uploadVídeo`,`upload`,`mp4`,`filme`,`mídia`,`url`],group:`Mídia`},audio:{title:`Áudio`,subtext:`Inserir um áudio`,aliases:[`áudio`,`uploadÁudio`,`upload`,`mp3`,`som`,`mídia`,`url`],group:`Mídia`},file:{title:`Arquivo`,subtext:`Inserir um arquivo`,aliases:[`arquivo`,`upload`,`incorporar`,`mídia`,`url`],group:`Mídia`},emoji:{title:`Emoji`,subtext:`Usado para inserir um emoji`,aliases:[`emoji`,`emoticon`,`expressão emocional`,`rosto`],group:`Outros`},divider:{title:`Separador`,subtext:`Separador de blocos`,aliases:[`separador`,`hr`,`horizontal rule`],group:`Blocos básicos`}},placeholders:{default:`Digite texto ou use '/' para comandos`,heading:`Título`,toggleListItem:`Alternar`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escreva um comentário...`,edit_comment:`Editar comentário...`,comment_reply:`Adicionar comentário...`},file_blocks:{add_button_text:{image:`Adicionar imagem`,video:`Adicionar vídeo`,audio:`Adicionar áudio`,file:`Adicionar arquivo`}},toggle_blocks:{add_block_button:`Toggle vazio. Clique para adicionar um bloco.`,toggle_button:`Expandir ou recolher`},code_block:{add_source_button_text:`Adicionar código-fonte`,ok_button_text:`OK`},side_menu:{add_block_label:`Adicionar bloco`,drag_handle_label:`Abrir menu do bloco`},drag_handle:{delete_menuitem:`Excluir`,colors_menuitem:`Cores`,header_row_menuitem:`Cabeçalho de linha`,header_column_menuitem:`Cabeçalho de coluna`},table_handle:{delete_column_menuitem:`Excluir coluna`,delete_row_menuitem:`Excluir linha`,add_left_menuitem:`Adicionar coluna à esquerda`,add_right_menuitem:`Adicionar coluna à direita`,add_above_menuitem:`Adicionar linha acima`,add_below_menuitem:`Adicionar linha abaixo`,split_cell_menuitem:`Dividir célula`,merge_cells_menuitem:`Juntar células`,background_color_menuitem:`Alterar cor de fundo`},suggestion_menu:{no_items_title:`Nenhum item encontrado`},color_picker:{text_title:`Texto`,background_title:`Fundo`,colors:{default:`Automático`,gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrito`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Itálico`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Sublinhado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Riscado`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Cores`},link:{tooltip:`Criar link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar legenda`,input_placeholder:`Editar legenda`},file_replace:{tooltip:{image:`Substituir imagem`,video:`Substituir vídeo`,audio:`Substituir áudio`,file:`Substituir arquivo`}},file_rename:{tooltip:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`},input_placeholder:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`}},file_download:{tooltip:{image:`Baixar imagem`,video:`Baixar vídeo`,audio:`Baixar áudio`,file:`Baixar arquivo`}},file_delete:{tooltip:{image:`Excluir imagem`,video:`Excluir vídeo`,audio:`Excluir áudio`,file:`Excluir arquivo`}},file_preview_toggle:{tooltip:`Alternar visualização`},nest:{tooltip:`Aninhar bloco`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desaninhar bloco`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinhar à esquerda`},align_center:{tooltip:`Alinhar ao centro`},align_right:{tooltip:`Alinhar à direita`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Juntar células`},comment:{tooltip:`Adicionar comentário`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload de imagem`,video:`Upload de vídeo`,audio:`Upload de áudio`,file:`Upload de arquivo`},upload_error:`Erro: Falha no upload`},embed:{title:`Incorporar`,embed_button:{image:`Incorporar imagem`,video:`Incorporar vídeo`,audio:`Incorporar áudio`,file:`Incorporar arquivo`},url_placeholder:`Insira a URL`}},link_toolbar:{delete:{tooltip:`Remover link`},edit:{text:`Editar link`,tooltip:`Editar`},open:{tooltip:`Abrir em nova aba`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Salvar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Conteúdo original excluído`,discard_pending_comment:`Tem certeza de que deseja descartar este comentário?`,actions:{add_reaction:`Adicionar reação`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentário`,delete_comment:`Excluir comentário`,more_actions:`Mais ações`},reactions:{reacted_by:`Reagido por`},sidebar:{marked_as_resolved:`Marcado como resolvido`,more_replies:e=>`${e} respostas a mais`}},suggestion_changes:{formatting_change:`Alteração de formatação`,deleted:`Excluído`,inserted:`Inserido`,inserted_by:e=>`Inserido por: ${e}`,deleted_by:e=>`Excluído por: ${e}`,changed:`Alterado`,changed_by:e=>`Alterado por: ${e}`,formatting_change_by:(e,t)=>`Alteração de formatação (${e}) por: ${t}`},versioning:{start_of_document:`Início do documento`,compare_since_beginning_menuitem:`Comparar desde o início`,title:`Histórico`,close:`Fechar`,show_named_only:`Mostrar apenas versões nomeadas`,show_all:`Mostrar todas as versões`,comparison_on:`Ativar comparação`,comparison_off:`Desativar comparação`,versions_list:`Versões`,empty:`Ainda não há versões`,empty_named_only:`Não há versões nomeadas`,current_version:`Versão atual`,before_restore:`Antes da restauração`,comparing_to:`Comparando com`,restored_from:e=>`Restaurado de ${e}`,more_actions:`Mais ações`,version_name_input:`Nome da versão`,name_version_menuitem:`Nomear esta versão`,rename_menuitem:`Renomear`,compare_with_menuitem:`Comparar com esta versão`,restore_menuitem:`Restaurar`,delete_menuitem:`Excluir`,action_failed:`Algo deu errado. Tente novamente.`,history_load_failed:`Falha ao carregar o histórico de versões`},exporter:{open_file:`Abrir arquivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir áudio`},generic:{loading:`Carregando...`,load_more:`Carregar mais`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}}},Lf=se({en:{loading:`Opening…`,unreadable:`This doc cannot be shown right now: its file is not written as a doc. Here is what it says.`,duplicate:`Duplicate`,remove:`Delete`,colors:`Colors`,tag:`Tag`,noTag:`No tag`,nothing:`No block by that name`,nothingToLink:`Nothing in the project by that name`,turnInto:`Turn into`,aligns:{left:`Left`,center:`Center`,right:`Right`,justify:`Justify`},copyPlace:`Copy its place in the file`,find:`Find something to do…`,text:`text`,background:`background`,placeholder:`Write, or press / for blocks`,heading:`Heading`,colorNames:{gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`},embed:`Drawn by code`,title:`Title`,untitled:`Untitled`,outline:`On this page`,blocks:{paragraph:`Text`,heading1:`Heading 1`,heading2:`Heading 2`,heading3:`Heading 3`,bullet:`Bulleted list`,numbered:`Numbered list`,check:`To-do list`,toggle:`Toggle`,quote:`Quote`,callout:`Callout`,code:`Code`,divider:`Divider`,table:`Table`,image:`Image`,chart:`Chart`,equation:`Equation`,diagram:`Diagram`,columns2:`2 columns`,columns3:`3 columns`,footnote:`Footnote`,pagebreak:`Page break`,pagebreakLandscape:`Page break, landscape after it`,pagebreakPortrait:`Page break, portrait after it`,toc:`Contents`,bibliography:`Bibliography`,card:`Card`,stats:`Figures`},component:`Component`,stats:{label:`Label`,value:`Value`,delta:`Change`,note:`Note`,trend:`Trend: 12, 15, 14`,add:`Add a figure`,remove:`Remove this figure`},card:{title:`Card title`,subtitle:`A line under it`},sample:{category:e=>`Category ${String(e)}`,series:e=>`Series ${String(e)}`},chart:{types:{"column-clustered":`Clustered column`,"column-stacked":`Stacked column`,"column-stacked-100":`100% stacked column`,"bar-clustered":`Clustered bar`,"bar-stacked":`Stacked bar`,"bar-stacked-100":`100% stacked bar`,line:`Line`,"line-markers":`Line with markers`,area:`Area`,"area-stacked":`Stacked area`,"area-stacked-100":`100% stacked area`,pie:`Pie`,doughnut:`Doughnut`,scatter:`Scatter`,"scatter-lines":`Scatter with straight lines and markers`,"scatter-smooth":`Scatter with smooth lines and markers`},type:`Chart type`,title:`Chart title`,legend:`Legend`,legendAt:{none:`None`,bottom:`Bottom`,top:`Top`,left:`Left`,right:`Right`},dataLabels:`Data labels`,smooth:`Smooth lines`,barColors:`Colour of each bar`,addCategory:`Add category`,addSeries:`Add series`,deleteCategory:`Delete category`,deleteSeries:`Delete series`,cell:(e,t)=>`Row ${String(e)}, column ${String(t)}`,fromFile:e=>`The numbers come from ${e}: change them there.`,notHere:e=>`The numbers from ${e} are not here yet.`,cannotDraw:`This chart cannot be drawn`},emptyEquation:`Empty equation`,emptyDiagram:`Empty diagram`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Default`,pageNumbers:`Page numbers`,page:{preset:`Preset`,none:`None`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Memo`,"business-letter":`Business letter`},paper:`Paper`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Landscape`,margins:`Margins`,marginNames:{normal:`Normal`,narrow:`Narrow`,wide:`Wide`},size:`Text size`,pt:e=>`${String(e)} pt`,lineHeight:`Line height`,grid:`The grid`,indent:`Indent first lines`},tocEmpty:`No headings yet`,sourcesEmpty:`Cite a source with [@key] to list it here`,pages:`Pages`,pagesPrinting:`Printing…`,pagesFailed:e=>`The pages could not be printed: ${e}`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,pageBlock:e=>`A block on page ${String(e)}: show it in the text`,cover:{add:`Add cover`,change:`Change cover`,reposition:`Reposition`,remove:`Remove`,drag:`Drag image to reposition`,save:`Save position`,cancel:`Cancel`,upload:`Upload`,none:`No pictures in the project`,gallery:`Gallery`,project:`Project`,names:{dots:`Pointillist`,scales:`Sea scales`,bay:`Evening bay`,stacks:`Wheat stacks`,steam:`Steam train`,dusk:`Mountains at dusk`,lake:`Lake at dawn`}}},"zh-cn":{loading:`正在打开…`,unreadable:`这份文档现在显示不了:文件的写法不对。下面是它的原文。`,duplicate:`复制一份`,remove:`删除`,colors:`颜色`,tag:`标签`,noTag:`不加标签`,nothing:`没有叫这个名字的块`,nothingToLink:`项目里没有叫这个名字的内容`,turnInto:`转换为`,aligns:{left:`左对齐`,center:`居中`,right:`右对齐`,justify:`两端对齐`},copyPlace:`复制它在文件里的位置`,find:`输入要做的事…`,text:`文字`,background:`背景`,placeholder:`输入文字,或按 / 选择块`,heading:`标题`,colorNames:{gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`},embed:`由代码绘制`,title:`标题`,untitled:`未命名`,outline:`本页目录`,blocks:{paragraph:`正文`,heading1:`一级标题`,heading2:`二级标题`,heading3:`三级标题`,bullet:`无序列表`,numbered:`有序列表`,check:`待办清单`,toggle:`折叠`,quote:`引用`,callout:`提示块`,code:`代码`,divider:`分隔线`,table:`表格`,image:`图片`,chart:`图表`,equation:`公式`,diagram:`图示`,columns2:`2 栏`,columns3:`3 栏`,footnote:`脚注`,pagebreak:`分页符`,pagebreakLandscape:`分页符,之后横向`,pagebreakPortrait:`分页符,之后纵向`,toc:`目录`,bibliography:`参考文献`,card:`卡片`,stats:`数字卡`},component:`组件`,stats:{label:`名称`,value:`数值`,delta:`变化`,note:`备注`,trend:`走势:12, 15, 14`,add:`添加一个数字`,remove:`删除这个数字`},card:{title:`卡片标题`,subtitle:`副标题`},sample:{category:e=>`类别 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`簇状柱形图`,"column-stacked":`堆积柱形图`,"column-stacked-100":`百分比堆积柱形图`,"bar-clustered":`簇状条形图`,"bar-stacked":`堆积条形图`,"bar-stacked-100":`百分比堆积条形图`,line:`折线图`,"line-markers":`带数据标记的折线图`,area:`面积图`,"area-stacked":`堆积面积图`,"area-stacked-100":`百分比堆积面积图`,pie:`饼图`,doughnut:`圆环图`,scatter:`散点图`,"scatter-lines":`带直线和数据标记的散点图`,"scatter-smooth":`带平滑线和数据标记的散点图`},type:`图表类型`,title:`图表标题`,legend:`图例`,legendAt:{none:`无`,bottom:`底部`,top:`顶部`,left:`左侧`,right:`右侧`},dataLabels:`数据标签`,smooth:`平滑曲线`,barColors:`每根柱子的颜色`,addCategory:`添加类别`,addSeries:`添加系列`,deleteCategory:`删除类别`,deleteSeries:`删除系列`,cell:(e,t)=>`第 ${String(e)} 行,第 ${String(t)} 列`,fromFile:e=>`数值来自 ${e}:请在那里修改。`,notHere:e=>`${e} 的数值还没到。`,cannotDraw:`这个图表画不出来`},emptyEquation:`空公式`,emptyDiagram:`空图示`,style:`样式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋体`,hei:`黑体`,fangsong:`仿宋`,kai:`楷体`,xiaobiaosong:`小标宋`},accent:`强调色`,defaultColor:`默认`,pageNumbers:`页码`,page:{preset:`预设`,none:`无`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`简报`,memo:`备忘录`,"business-letter":`商务信函`},paper:`纸张`,orientation:`方向`,portrait:`纵向`,landscape:`横向`,margins:`页边距`,marginNames:{normal:`普通`,narrow:`窄`,wide:`宽`},size:`字号`,pt:e=>`${String(e)} 磅`,lineHeight:`行距`,grid:`按网格`,indent:`首行缩进`},tocEmpty:`还没有标题`,sourcesEmpty:`用 [@key] 引用文献后会列在这里`,pages:`分页`,pagesPrinting:`正在排版…`,pagesFailed:e=>`无法排出页面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,pageBlock:e=>`第 ${String(e)} 页上的一块:在正文中显示`,cover:{add:`添加封面`,change:`更换封面`,reposition:`调整位置`,remove:`移除`,drag:`拖动图片以调整位置`,save:`保存位置`,cancel:`取消`,upload:`上传`,none:`项目中没有图片`,gallery:`图库`,project:`项目`,names:{dots:`点彩`,scales:`青海波`,bay:`暮色海湾`,stacks:`麦垛`,steam:`蒸汽火车`,dusk:`暮山`,lake:`晨湖`}}},"zh-tw":{loading:`正在打開…`,unreadable:`目前無法顯示這份文件:它的檔案不是以文件的格式撰寫。以下是檔案的原文。`,duplicate:`複製一份`,remove:`刪除`,colors:`顏色`,tag:`標籤`,noTag:`不加標籤`,nothing:`沒有這個名稱的區塊`,nothingToLink:`專案中沒有這個名稱的內容`,turnInto:`轉換為`,aligns:{left:`靠左對齊`,center:`置中`,right:`靠右對齊`,justify:`左右對齊`},copyPlace:`拷貝它在檔案中的位置`,find:`搜尋要做的事…`,text:`文字`,background:`背景`,placeholder:`輸入文字,或按 / 選擇區塊`,heading:`標題`,colorNames:{gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橘色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉紅色`},embed:`由程式碼繪製`,title:`標題`,untitled:`未命名`,outline:`本頁內容`,blocks:{paragraph:`文字`,heading1:`標題 1`,heading2:`標題 2`,heading3:`標題 3`,bullet:`項目符號清單`,numbered:`編號清單`,check:`待辦清單`,toggle:`摺疊`,quote:`引言`,callout:`標註`,code:`程式碼`,divider:`分隔線`,table:`表格`,image:`圖片`,chart:`圖表`,equation:`方程式`,diagram:`圖示`,columns2:`2 欄`,columns3:`3 欄`,footnote:`註腳`,pagebreak:`分頁符號`,pagebreakLandscape:`分頁符,之後橫向`,pagebreakPortrait:`分頁符,之後縱向`,toc:`目錄`,bibliography:`參考文獻`,card:`卡片`,stats:`數字卡`},component:`元件`,stats:{label:`名稱`,value:`數值`,delta:`變化`,note:`備註`,trend:`走勢:12, 15, 14`,add:`新增一個數字`,remove:`刪除這個數字`},card:{title:`卡片標題`,subtitle:`副標題`},sample:{category:e=>`類別 ${String(e)}`,series:e=>`數列 ${String(e)}`},chart:{types:{"column-clustered":`群組直條圖`,"column-stacked":`堆疊直條圖`,"column-stacked-100":`百分比堆疊直條圖`,"bar-clustered":`群組橫條圖`,"bar-stacked":`堆疊橫條圖`,"bar-stacked-100":`百分比堆疊橫條圖`,line:`折線圖`,"line-markers":`含有資料標記的折線圖`,area:`區域圖`,"area-stacked":`堆疊區域圖`,"area-stacked-100":`百分比堆疊區域圖`,pie:`圓形圖`,doughnut:`環圈圖`,scatter:`散佈圖`,"scatter-lines":`帶有直線和資料標記的散佈圖`,"scatter-smooth":`帶有平滑線和資料標記的散佈圖`},type:`圖表類型`,title:`圖表標題`,legend:`圖例`,legendAt:{none:`無`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`資料標籤`,smooth:`平滑曲線`,barColors:`每根長條的顏色`,addCategory:`新增類別`,addSeries:`新增數列`,deleteCategory:`刪除類別`,deleteSeries:`刪除數列`,cell:(e,t)=>`第 ${String(e)} 列,第 ${String(t)} 欄`,fromFile:e=>`數值來自 ${e}:請在那裡修改。`,notHere:e=>`${e} 的數值還沒到。`,cannotDraw:`這個圖表畫不出來`},emptyEquation:`空方程式`,emptyDiagram:`空圖示`,style:`樣式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋體`,hei:`黑體`,fangsong:`仿宋`,kai:`楷體`,xiaobiaosong:`小標宋`},accent:`強調色`,defaultColor:`預設`,pageNumbers:`頁碼`,page:{preset:`預設`,none:`無`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`簡報`,memo:`備忘錄`,"business-letter":`商務信函`},paper:`紙張`,orientation:`方向`,portrait:`縱向`,landscape:`橫向`,margins:`邊界`,marginNames:{normal:`一般`,narrow:`窄`,wide:`寬`},size:`字級`,pt:e=>`${String(e)} pt`,lineHeight:`行距`,grid:`依格線`,indent:`首行縮排`},tocEmpty:`還沒有標題`,sourcesEmpty:`用 [@key] 引用文獻後會列在這裡`,pages:`分頁`,pagesPrinting:`正在排版…`,pagesFailed:e=>`無法排出頁面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,pageBlock:e=>`第 ${String(e)} 頁上的一塊:在正文中顯示`,cover:{add:`新增封面`,change:`更換封面`,reposition:`調整位置`,remove:`移除`,drag:`拖曳圖片以調整位置`,save:`儲存位置`,cancel:`取消`,upload:`上傳`,none:`專案中沒有圖片`,gallery:`圖庫`,project:`專案`,names:{dots:`點彩`,scales:`青海波`,bay:`暮色海灣`,stacks:`麥垛`,steam:`蒸汽火車`,dusk:`暮山`,lake:`晨湖`}}},ja:{loading:`開いています…`,unreadable:`このドキュメントは現在表示できません:ファイルがドキュメントの形式で書かれていません。ファイルの内容は次のとおりです。`,duplicate:`複製`,remove:`削除`,colors:`カラー`,tag:`タグ`,noTag:`タグなし`,nothing:`その名前のブロックはありません`,nothingToLink:`その名前のものはプロジェクトにありません`,turnInto:`ブロックタイプの変更`,aligns:{left:`左揃え`,center:`中央揃え`,right:`右揃え`,justify:`両端揃え`},copyPlace:`ファイル内の位置をコピー`,find:`操作を検索…`,text:`文字`,background:`背景`,placeholder:`入力するか、/ でブロックを選択`,heading:`見出し`,colorNames:{gray:`グレー`,brown:`ブラウン`,red:`レッド`,orange:`オレンジ`,yellow:`イエロー`,green:`グリーン`,blue:`ブルー`,purple:`パープル`,pink:`ピンク`},embed:`コードで描画`,title:`タイトル`,untitled:`無題`,outline:`このページの内容`,blocks:{paragraph:`テキスト`,heading1:`見出し 1`,heading2:`見出し 2`,heading3:`見出し 3`,bullet:`箇条書きリスト`,numbered:`番号付きリスト`,check:`ToDo リスト`,toggle:`トグル`,quote:`引用`,callout:`コールアウト`,code:`コード`,divider:`区切り線`,table:`表`,image:`画像`,chart:`グラフ`,equation:`数式`,diagram:`ダイアグラム`,columns2:`2列`,columns3:`3列`,footnote:`脚注`,pagebreak:`改ページ`,pagebreakLandscape:`改ページ(以降は横向き)`,pagebreakPortrait:`改ページ(以降は縦向き)`,toc:`目次`,bibliography:`参考文献`,card:`カード`,stats:`数値カード`},component:`コンポーネント`,stats:{label:`ラベル`,value:`値`,delta:`変化`,note:`注記`,trend:`推移:12, 15, 14`,add:`数値を追加`,remove:`この数値を削除`},card:{title:`カードのタイトル`,subtitle:`サブタイトル`},sample:{category:e=>`分類 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`集合縦棒`,"column-stacked":`積み上げ縦棒`,"column-stacked-100":`100% 積み上げ縦棒`,"bar-clustered":`集合横棒`,"bar-stacked":`積み上げ横棒`,"bar-stacked-100":`100% 積み上げ横棒`,line:`折れ線`,"line-markers":`マーカー付き折れ線`,area:`面`,"area-stacked":`積み上げ面`,"area-stacked-100":`100% 積み上げ面`,pie:`円`,doughnut:`ドーナツ`,scatter:`散布図`,"scatter-lines":`散布図 (直線とマーカー)`,"scatter-smooth":`散布図 (平滑線とマーカー)`},type:`グラフの種類`,title:`グラフ タイトル`,legend:`凡例`,legendAt:{none:`なし`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`データ ラベル`,smooth:`滑らかな線`,barColors:`棒ごとの色`,addCategory:`分類を追加`,addSeries:`系列を追加`,deleteCategory:`分類を削除`,deleteSeries:`系列を削除`,cell:(e,t)=>`${String(e)} 行目、${String(t)} 列目`,fromFile:e=>`数値は ${e} から読み込まれます。そちらで変更してください。`,notHere:e=>`${e} の数値はまだ届いていません。`,cannotDraw:`このグラフは描画できません`},emptyEquation:`空の数式`,emptyDiagram:`空のダイアグラム`,style:`スタイル`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋朝体`,hei:`黒体`,fangsong:`仿宋体`,kai:`楷書体`,xiaobiaosong:`小標宋`},accent:`アクセント`,defaultColor:`デフォルト`,pageNumbers:`ページ番号`,page:{preset:`プリセット`,none:`なし`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`ブリーフ`,memo:`社内メモ`,"business-letter":`ビジネスレター`},paper:`用紙`,orientation:`向き`,portrait:`縦`,landscape:`横`,margins:`余白`,marginNames:{normal:`標準`,narrow:`狭い`,wide:`広い`},size:`文字サイズ`,pt:e=>`${String(e)} pt`,lineHeight:`行の高さ`,grid:`グリッド`,indent:`段落の字下げ`},tocEmpty:`まだ見出しがありません`,sourcesEmpty:`[@key] で文献を引用すると、ここに並びます`,pages:`ページ`,pagesPrinting:`印刷中…`,pagesFailed:e=>`ページを印刷できませんでした:${e}`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,pageBlock:e=>`${String(e)} ページのブロック:本文で表示`,cover:{add:`カバーを追加`,change:`カバーを変更`,reposition:`位置を調整`,remove:`削除`,drag:`画像をドラッグして位置を調整`,save:`位置を保存`,cancel:`キャンセル`,upload:`アップロード`,none:`プロジェクトに画像がありません`,gallery:`ギャラリー`,project:`プロジェクト`,names:{dots:`点描`,scales:`青海波`,bay:`夕暮れの入江`,stacks:`積みわら`,steam:`蒸気機関車`,dusk:`夕暮れの山`,lake:`夜明けの湖`}}},ko:{loading:`여는 중…`,unreadable:`지금은 이 문서를 표시할 수 없습니다. 파일이 문서 형식으로 쓰여 있지 않습니다. 파일 내용은 다음과 같습니다.`,duplicate:`복제`,remove:`삭제`,colors:`색상`,tag:`태그`,noTag:`태그 없음`,nothing:`해당 이름의 블록이 없습니다`,nothingToLink:`프로젝트에 해당 이름의 항목이 없습니다`,turnInto:`변환`,aligns:{left:`왼쪽`,center:`가운데`,right:`오른쪽`,justify:`양쪽 맞춤`},copyPlace:`파일 내 위치 복사`,find:`할 작업 찾기…`,text:`텍스트`,background:`배경`,placeholder:`입력하거나 /를 눌러 블록 추가`,heading:`제목`,colorNames:{gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`초록색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`},embed:`코드로 그린 항목`,title:`제목`,untitled:`제목 없음`,outline:`이 페이지의 내용`,blocks:{paragraph:`텍스트`,heading1:`제목 1`,heading2:`제목 2`,heading3:`제목 3`,bullet:`글머리 기호 목록`,numbered:`번호 매기기 목록`,check:`할 일 목록`,toggle:`토글`,quote:`인용`,callout:`콜아웃`,code:`코드`,divider:`구분선`,table:`표`,image:`이미지`,chart:`차트`,equation:`수식`,diagram:`다이어그램`,columns2:`2열`,columns3:`3열`,footnote:`각주`,pagebreak:`페이지 나누기`,pagebreakLandscape:`페이지 나누기, 이후 가로`,pagebreakPortrait:`페이지 나누기, 이후 세로`,toc:`목차`,bibliography:`참고 문헌`,card:`카드`,stats:`수치 카드`},component:`컴포넌트`,stats:{label:`이름`,value:`값`,delta:`변화`,note:`메모`,trend:`추이: 12, 15, 14`,add:`수치 추가`,remove:`이 수치 삭제`},card:{title:`카드 제목`,subtitle:`부제`},sample:{category:e=>`항목 ${String(e)}`,series:e=>`계열 ${String(e)}`},chart:{types:{"column-clustered":`묶은 세로 막대형`,"column-stacked":`누적 세로 막대형`,"column-stacked-100":`100% 기준 누적 세로 막대형`,"bar-clustered":`묶은 가로 막대형`,"bar-stacked":`누적 가로 막대형`,"bar-stacked-100":`100% 기준 누적 가로 막대형`,line:`꺾은선형`,"line-markers":`표식이 있는 꺾은선형`,area:`영역형`,"area-stacked":`누적 영역형`,"area-stacked-100":`100% 기준 누적 영역형`,pie:`원형`,doughnut:`도넛형`,scatter:`분산형`,"scatter-lines":`직선 및 표식이 있는 분산형`,"scatter-smooth":`곡선 및 표식이 있는 분산형`},type:`차트 종류`,title:`차트 제목`,legend:`범례`,legendAt:{none:`없음`,bottom:`아래쪽`,top:`위쪽`,left:`왼쪽`,right:`오른쪽`},dataLabels:`데이터 레이블`,smooth:`부드러운 선`,barColors:`막대별 색`,addCategory:`항목 추가`,addSeries:`계열 추가`,deleteCategory:`항목 삭제`,deleteSeries:`계열 삭제`,cell:(e,t)=>`${String(e)}행, ${String(t)}열`,fromFile:e=>`숫자는 ${e}에서 가져옵니다. 그곳에서 변경하세요.`,notHere:e=>`${e}의 숫자가 아직 오지 않았습니다.`,cannotDraw:`이 차트를 그릴 수 없습니다`},emptyEquation:`빈 수식`,emptyDiagram:`빈 다이어그램`,style:`스타일`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`송체`,hei:`흑체`,fangsong:`방송체`,kai:`해서체`,xiaobiaosong:`소표송`},accent:`강조 색`,defaultColor:`기본값`,pageNumbers:`페이지 번호`,page:{preset:`프리셋`,none:`없음`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`브리프`,memo:`메모`,"business-letter":`비즈니스 서신`},paper:`용지`,orientation:`방향`,portrait:`세로`,landscape:`가로`,margins:`여백`,marginNames:{normal:`보통`,narrow:`좁게`,wide:`넓게`},size:`글자 크기`,pt:e=>`${String(e)} pt`,lineHeight:`줄 높이`,grid:`격자`,indent:`첫 줄 들여쓰기`},tocEmpty:`아직 제목이 없습니다`,sourcesEmpty:`[@key]로 출처를 인용하면 여기에 나열됩니다`,pages:`페이지`,pagesPrinting:`인쇄 중…`,pagesFailed:e=>`페이지를 인쇄하지 못했습니다: ${e}`,pageOf:(e,t)=>`${String(t)}쪽 중 ${String(e)}쪽`,pageBlock:e=>`${String(e)}쪽의 블록: 본문에서 보기`,cover:{add:`커버 추가`,change:`커버 변경`,reposition:`위치 변경`,remove:`제거`,drag:`이미지를 드래그하여 위치 변경`,save:`위치 저장`,cancel:`취소`,upload:`업로드`,none:`프로젝트에 이미지가 없습니다`,gallery:`갤러리`,project:`프로젝트`,names:{dots:`점묘`,scales:`청해파`,bay:`저녁 만`,stacks:`밀짚 더미`,steam:`증기 기관차`,dusk:`해 질 녘 산`,lake:`새벽 호수`}}},es:{loading:`Abriendo…`,unreadable:`Este documento no se puede mostrar ahora: su archivo no está escrito como un documento. Esto es lo que dice.`,duplicate:`Duplicar`,remove:`Eliminar`,colors:`Colores`,tag:`Etiqueta`,noTag:`Sin etiqueta`,nothing:`Ningún bloque con ese nombre`,nothingToLink:`No hay nada en el proyecto con ese nombre`,turnInto:`Convertir en`,aligns:{left:`Izquierda`,center:`Centro`,right:`Derecha`,justify:`Justificar`},copyPlace:`Copiar su posición en el archivo`,find:`Busca qué hacer…`,text:`texto`,background:`fondo`,placeholder:`Escribe o pulsa / para ver los bloques`,heading:`Encabezado`,colorNames:{gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`},embed:`Dibujado con código`,title:`Título`,untitled:`Sin título`,outline:`En esta página`,blocks:{paragraph:`Texto`,heading1:`Encabezado 1`,heading2:`Encabezado 2`,heading3:`Encabezado 3`,bullet:`Lista con viñetas`,numbered:`Lista numerada`,check:`Lista de tareas`,toggle:`Desplegable`,quote:`Cita`,callout:`Destacado`,code:`Código`,divider:`Separador`,table:`Tabla`,image:`Imagen`,chart:`Gráfico`,equation:`Ecuación`,diagram:`Diagrama`,columns2:`2 columnas`,columns3:`3 columnas`,footnote:`Nota al pie`,pagebreak:`Salto de página`,pagebreakLandscape:`Salto de página, luego horizontal`,pagebreakPortrait:`Salto de página, luego vertical`,toc:`Índice`,bibliography:`Bibliografía`,card:`Tarjeta`,stats:`Cifras`},component:`Componente`,stats:{label:`Etiqueta`,value:`Valor`,delta:`Cambio`,note:`Nota`,trend:`Tendencia: 12, 15, 14`,add:`Añadir una cifra`,remove:`Quitar esta cifra`},card:{title:`Título de la tarjeta`,subtitle:`Subtítulo`},sample:{category:e=>`Categoría ${String(e)}`,series:e=>`Serie ${String(e)}`},chart:{types:{"column-clustered":`Columna agrupada`,"column-stacked":`Columna apilada`,"column-stacked-100":`Columna 100% apilada`,"bar-clustered":`Barra agrupada`,"bar-stacked":`Barra apilada`,"bar-stacked-100":`Barra 100% apilada`,line:`Línea`,"line-markers":`Línea con marcadores`,area:`Área`,"area-stacked":`Área apilada`,"area-stacked-100":`Área 100% apilada`,pie:`Circular`,doughnut:`Anillo`,scatter:`Dispersión`,"scatter-lines":`Dispersión con líneas rectas y marcadores`,"scatter-smooth":`Dispersión con líneas suavizadas y marcadores`},type:`Tipo de gráfico`,title:`Título del gráfico`,legend:`Leyenda`,legendAt:{none:`Ninguna`,bottom:`Abajo`,top:`Arriba`,left:`Izquierda`,right:`Derecha`},dataLabels:`Etiquetas de datos`,smooth:`Líneas suavizadas`,barColors:`Color de cada barra`,addCategory:`Agregar categoría`,addSeries:`Agregar serie`,deleteCategory:`Eliminar categoría`,deleteSeries:`Eliminar serie`,cell:(e,t)=>`Fila ${String(e)}, columna ${String(t)}`,fromFile:e=>`Los números vienen de ${e}: cámbialos allí.`,notHere:e=>`Los números de ${e} aún no han llegado.`,cannotDraw:`Este gráfico no se puede dibujar`},emptyEquation:`Ecuación vacía`,emptyDiagram:`Diagrama vacío`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Acento`,defaultColor:`Predeterminado`,pageNumbers:`Números de página`,page:{preset:`Plantilla`,none:`Ninguna`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Memorándum`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientación`,portrait:`Vertical`,landscape:`Horizontal`,margins:`Márgenes`,marginNames:{normal:`Normal`,narrow:`Estrecho`,wide:`Ancho`},size:`Tamaño del texto`,pt:e=>`${String(e)} pt`,lineHeight:`Interlineado`,grid:`La cuadrícula`,indent:`Sangrar primeras líneas`},tocEmpty:`Aún no hay encabezados`,sourcesEmpty:`Cita una fuente con [@key] para listarla aquí`,pages:`Páginas`,pagesPrinting:`Imprimiendo…`,pagesFailed:e=>`No se pudieron imprimir las páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Un bloque en la página ${String(e)}: mostrarlo en el texto`,cover:{add:`Añadir portada`,change:`Cambiar portada`,reposition:`Reposicionar`,remove:`Quitar`,drag:`Arrastra la imagen para reposicionarla`,save:`Guardar posición`,cancel:`Cancelar`,upload:`Subir`,none:`No hay imágenes en el proyecto`,gallery:`Galería`,project:`Proyecto`,names:{dots:`Puntillismo`,scales:`Escamas de mar`,bay:`Bahía al atardecer`,stacks:`Almiares`,steam:`Tren de vapor`,dusk:`Montañas al anochecer`,lake:`Lago al alba`}}},fr:{loading:`Ouverture…`,unreadable:`Ce document ne peut pas être affiché pour l’instant\xA0: son fichier n’est pas écrit comme un document. Voici ce qu’il contient.`,duplicate:`Dupliquer`,remove:`Supprimer`,colors:`Couleurs`,tag:`Étiquette`,noTag:`Sans étiquette`,nothing:`Aucun bloc de ce nom`,nothingToLink:`Rien de ce nom dans le projet`,turnInto:`Transformer en`,aligns:{left:`À gauche`,center:`Centré`,right:`À droite`,justify:`Justifié`},copyPlace:`Copier son emplacement dans le fichier`,find:`Rechercher une action…`,text:`texte`,background:`fond`,placeholder:`Écrivez, ou tapez / pour les blocs`,heading:`Titre`,colorNames:{gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`},embed:`Dessiné par du code`,title:`Titre`,untitled:`Sans titre`,outline:`Sur cette page`,blocks:{paragraph:`Texte`,heading1:`Titre 1`,heading2:`Titre 2`,heading3:`Titre 3`,bullet:`Liste à puces`,numbered:`Liste numérotée`,check:`Liste de tâches`,toggle:`Bloc dépliable`,quote:`Citation`,callout:`Encadré`,code:`Code`,divider:`Séparateur`,table:`Tableau`,image:`Image`,chart:`Graphique`,equation:`Équation`,diagram:`Diagramme`,columns2:`2 colonnes`,columns3:`3 colonnes`,footnote:`Note de bas de page`,pagebreak:`Saut de page`,pagebreakLandscape:`Saut de page, puis paysage`,pagebreakPortrait:`Saut de page, puis portrait`,toc:`Sommaire`,bibliography:`Bibliographie`,card:`Carte`,stats:`Chiffres clés`},component:`Composant`,stats:{label:`Libellé`,value:`Valeur`,delta:`Variation`,note:`Note`,trend:`Tendance : 12, 15, 14`,add:`Ajouter un chiffre`,remove:`Retirer ce chiffre`},card:{title:`Titre de la carte`,subtitle:`Sous-titre`},sample:{category:e=>`Catégorie ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Histogramme groupé`,"column-stacked":`Histogramme empilé`,"column-stacked-100":`Histogramme empilé 100 %`,"bar-clustered":`Barres groupées`,"bar-stacked":`Barres empilées`,"bar-stacked-100":`Barres empilées 100 %`,line:`Courbes`,"line-markers":`Courbes avec marques`,area:`Aires`,"area-stacked":`Aires empilées`,"area-stacked-100":`Aires empilées 100 %`,pie:`Secteurs`,doughnut:`Anneau`,scatter:`Nuage de points`,"scatter-lines":`Nuage de points avec lignes droites et marqueurs`,"scatter-smooth":`Nuage de points avec courbes lissées et marqueurs`},type:`Type de graphique`,title:`Titre du graphique`,legend:`Légende`,legendAt:{none:`Aucune`,bottom:`Bas`,top:`Haut`,left:`Gauche`,right:`Droite`},dataLabels:`Étiquettes de données`,smooth:`Lignes lissées`,barColors:`Couleur de chaque barre`,addCategory:`Ajouter une catégorie`,addSeries:`Ajouter une série`,deleteCategory:`Supprimer la catégorie`,deleteSeries:`Supprimer la série`,cell:(e,t)=>`Ligne ${String(e)}, colonne ${String(t)}`,fromFile:e=>`Les nombres viennent de ${e} : modifiez-les là-bas.`,notHere:e=>`Les nombres de ${e} ne sont pas encore là.`,cannotDraw:`Ce graphique ne peut pas être dessiné`},emptyEquation:`Équation vide`,emptyDiagram:`Diagramme vide`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Par défaut`,pageNumbers:`Numéros de page`,page:{preset:`Modèle`,none:`Aucun`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Note de service`,"business-letter":`Lettre commerciale`},paper:`Papier`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Paysage`,margins:`Marges`,marginNames:{normal:`Normales`,narrow:`Étroites`,wide:`Larges`},size:`Taille du texte`,pt:e=>`${String(e)} pt`,lineHeight:`Interligne`,grid:`La grille`,indent:`Retrait de première ligne`},tocEmpty:`Pas encore de titres`,sourcesEmpty:`Citez une source avec [@key] pour la lister ici`,pages:`Pages`,pagesPrinting:`Impression…`,pagesFailed:e=>`Les pages n’ont pas pu être imprimées : ${e}`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,pageBlock:e=>`Un bloc de la page ${String(e)} : le montrer dans le texte`,cover:{add:`Ajouter une couverture`,change:`Changer de couverture`,reposition:`Repositionner`,remove:`Retirer`,drag:`Faites glisser l’image pour la repositionner`,save:`Enregistrer la position`,cancel:`Annuler`,upload:`Importer`,none:`Aucune image dans le projet`,gallery:`Galerie`,project:`Projet`,names:{dots:`Pointillisme`,scales:`Écailles de mer`,bay:`Baie au soir`,stacks:`Meules de blé`,steam:`Train à vapeur`,dusk:`Montagnes au crépuscule`,lake:`Lac à l'aube`}}},de:{loading:`Wird geöffnet …`,unreadable:`Dieses Dokument kann gerade nicht angezeigt werden: Seine Datei ist nicht als Dokument geschrieben. Hier steht, was sie enthält.`,duplicate:`Duplizieren`,remove:`Löschen`,colors:`Farben`,tag:`Etikett`,noTag:`Kein Etikett`,nothing:`Kein Block mit diesem Namen`,nothingToLink:`Nichts im Projekt mit diesem Namen`,turnInto:`Umwandeln in`,aligns:{left:`Links`,center:`Zentriert`,right:`Rechts`,justify:`Blocksatz`},copyPlace:`Stelle in der Datei kopieren`,find:`Aktion suchen …`,text:`Text`,background:`Hintergrund`,placeholder:`Schreib, oder drück / für Blöcke`,heading:`Überschrift`,colorNames:{gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Pink`},embed:`Per Code gezeichnet`,title:`Titel`,untitled:`Ohne Titel`,outline:`Auf dieser Seite`,blocks:{paragraph:`Text`,heading1:`Überschrift 1`,heading2:`Überschrift 2`,heading3:`Überschrift 3`,bullet:`Aufzählung`,numbered:`Nummerierte Liste`,check:`To-do-Liste`,toggle:`Toggle-Liste`,quote:`Zitat`,callout:`Hinweis`,code:`Code`,divider:`Trennlinie`,table:`Tabelle`,image:`Bild`,chart:`Diagramm`,equation:`Formel`,diagram:`Schaubild`,columns2:`2 Spalten`,columns3:`3 Spalten`,footnote:`Fußnote`,pagebreak:`Seitenumbruch`,pagebreakLandscape:`Seitenumbruch, danach Querformat`,pagebreakPortrait:`Seitenumbruch, danach Hochformat`,toc:`Inhalt`,bibliography:`Literaturverzeichnis`,card:`Karte`,stats:`Kennzahlen`},component:`Komponente`,stats:{label:`Bezeichnung`,value:`Wert`,delta:`Veränderung`,note:`Anmerkung`,trend:`Verlauf: 12, 15, 14`,add:`Kennzahl hinzufügen`,remove:`Diese Kennzahl entfernen`},card:{title:`Kartentitel`,subtitle:`Untertitel`},sample:{category:e=>`Kategorie ${String(e)}`,series:e=>`Datenreihe ${String(e)}`},chart:{types:{"column-clustered":`Gruppierte Säulen`,"column-stacked":`Gestapelte Säulen`,"column-stacked-100":`Gestapelte Säulen (100 %)`,"bar-clustered":`Gruppierte Balken`,"bar-stacked":`Gestapelte Balken`,"bar-stacked-100":`Gestapelte Balken (100 %)`,line:`Linie`,"line-markers":`Linie mit Datenpunkten`,area:`Fläche`,"area-stacked":`Gestapelte Fläche`,"area-stacked-100":`Gestapelte Fläche (100 %)`,pie:`Kreis`,doughnut:`Ring`,scatter:`Punkt (XY)`,"scatter-lines":`Punkte mit geraden Linien und Datenpunkten`,"scatter-smooth":`Punkte mit interpolierten Linien und Datenpunkten`},type:`Diagrammtyp`,title:`Diagrammtitel`,legend:`Legende`,legendAt:{none:`Keine`,bottom:`Unten`,top:`Oben`,left:`Links`,right:`Rechts`},dataLabels:`Datenbeschriftungen`,smooth:`Glatte Linien`,barColors:`Farbe je Balken`,addCategory:`Kategorie hinzufügen`,addSeries:`Datenreihe hinzufügen`,deleteCategory:`Kategorie löschen`,deleteSeries:`Datenreihe löschen`,cell:(e,t)=>`Zeile ${String(e)}, Spalte ${String(t)}`,fromFile:e=>`Die Zahlen stammen aus ${e}: Ändern Sie sie dort.`,notHere:e=>`Die Zahlen aus ${e} sind noch nicht da.`,cannotDraw:`Dieses Diagramm kann nicht gezeichnet werden`},emptyEquation:`Leere Formel`,emptyDiagram:`Leeres Schaubild`,style:`Stil`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Akzent`,defaultColor:`Standard`,pageNumbers:`Seitenzahlen`,page:{preset:`Vorlage`,none:`Keine`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Briefing`,memo:`Memo`,"business-letter":`Geschäftsbrief`},paper:`Papier`,orientation:`Ausrichtung`,portrait:`Hochformat`,landscape:`Querformat`,margins:`Ränder`,marginNames:{normal:`Normal`,narrow:`Schmal`,wide:`Breit`},size:`Schriftgröße`,pt:e=>`${String(e)} pt`,lineHeight:`Zeilenhöhe`,grid:`Das Raster`,indent:`Erste Zeile einrücken`},tocEmpty:`Noch keine Überschriften`,sourcesEmpty:`Eine Quelle mit [@key] zitieren, um sie hier aufzuführen`,pages:`Seiten`,pagesPrinting:`Wird gedruckt …`,pagesFailed:e=>`Die Seiten konnten nicht gedruckt werden: ${e}`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,pageBlock:e=>`Ein Block auf Seite ${String(e)}: im Text zeigen`,cover:{add:`Titelbild hinzufügen`,change:`Titelbild ändern`,reposition:`Neu positionieren`,remove:`Entfernen`,drag:`Bild ziehen, um es neu zu positionieren`,save:`Position speichern`,cancel:`Abbrechen`,upload:`Hochladen`,none:`Keine Bilder im Projekt`,gallery:`Galerie`,project:`Projekt`,names:{dots:`Pointillismus`,scales:`Meeresschuppen`,bay:`Bucht am Abend`,stacks:`Weizenschober`,steam:`Dampflok`,dusk:`Berge in der Dämmerung`,lake:`See im Morgenlicht`}}},pt:{loading:`Abrindo…`,unreadable:`Não é possível mostrar este documento agora: o arquivo não está escrito como documento. Veja o que ele diz.`,duplicate:`Duplicar`,remove:`Excluir`,colors:`Cores`,tag:`Etiqueta`,noTag:`Sem etiqueta`,nothing:`Nenhum bloco com esse nome`,nothingToLink:`Nada no projeto com esse nome`,turnInto:`Transformar em`,aligns:{left:`À esquerda`,center:`Centralizado`,right:`À direita`,justify:`Justificado`},copyPlace:`Copiar a posição no arquivo`,find:`Buscar uma ação…`,text:`texto`,background:`fundo`,placeholder:`Escreva ou pressione / para blocos`,heading:`Título`,colorNames:{gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`},embed:`Desenhado por código`,title:`Título`,untitled:`Sem título`,outline:`Nesta página`,blocks:{paragraph:`Texto`,heading1:`Título 1`,heading2:`Título 2`,heading3:`Título 3`,bullet:`Lista com marcadores`,numbered:`Lista numerada`,check:`Lista de tarefas`,toggle:`Lista de alternância`,quote:`Citação`,callout:`Destaque`,code:`Código`,divider:`Divisor`,table:`Tabela`,image:`Imagem`,chart:`Gráfico`,equation:`Equação`,diagram:`Diagrama`,columns2:`2 colunas`,columns3:`3 colunas`,footnote:`Nota de rodapé`,pagebreak:`Quebra de página`,pagebreakLandscape:`Quebra de página, depois paisagem`,pagebreakPortrait:`Quebra de página, depois retrato`,toc:`Sumário`,bibliography:`Bibliografia`,card:`Cartão`,stats:`Números`},component:`Componente`,stats:{label:`Rótulo`,value:`Valor`,delta:`Variação`,note:`Nota`,trend:`Tendência: 12, 15, 14`,add:`Adicionar um número`,remove:`Remover este número`},card:{title:`Título do cartão`,subtitle:`Subtítulo`},sample:{category:e=>`Categoria ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Colunas Agrupadas`,"column-stacked":`Colunas Empilhadas`,"column-stacked-100":`Colunas 100% Empilhadas`,"bar-clustered":`Barras Agrupadas`,"bar-stacked":`Barras Empilhadas`,"bar-stacked-100":`Barras 100% Empilhadas`,line:`Linhas`,"line-markers":`Linhas com Marcadores`,area:`Área`,"area-stacked":`Área Empilhada`,"area-stacked-100":`Área 100% Empilhada`,pie:`Pizza`,doughnut:`Rosca`,scatter:`Dispersão`,"scatter-lines":`Dispersão com Linhas Retas e Marcadores`,"scatter-smooth":`Dispersão com Linhas Suaves e Marcadores`},type:`Tipo de gráfico`,title:`Título do gráfico`,legend:`Legenda`,legendAt:{none:`Nenhuma`,bottom:`Inferior`,top:`Superior`,left:`Esquerda`,right:`Direita`},dataLabels:`Rótulos de dados`,smooth:`Linhas suavizadas`,barColors:`Cor de cada barra`,addCategory:`Adicionar categoria`,addSeries:`Adicionar série`,deleteCategory:`Excluir categoria`,deleteSeries:`Excluir série`,cell:(e,t)=>`Linha ${String(e)}, coluna ${String(t)}`,fromFile:e=>`Os números vêm de ${e}: altere-os lá.`,notHere:e=>`Os números de ${e} ainda não chegaram.`,cannotDraw:`Não é possível desenhar este gráfico`},emptyEquation:`Equação vazia`,emptyDiagram:`Diagrama vazio`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Destaque`,defaultColor:`Padrão`,pageNumbers:`Números de página`,page:{preset:`Predefinição`,none:`Nenhuma`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Briefing`,memo:`Memorando`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientação`,portrait:`Retrato`,landscape:`Paisagem`,margins:`Margens`,marginNames:{normal:`Normais`,narrow:`Estreitas`,wide:`Largas`},size:`Tamanho do texto`,pt:e=>`${String(e)} pt`,lineHeight:`Altura da linha`,grid:`A grade`,indent:`Recuar a primeira linha`},tocEmpty:`Ainda sem títulos`,sourcesEmpty:`Cite uma fonte com [@key] para listá-la aqui`,pages:`Páginas`,pagesPrinting:`Imprimindo…`,pagesFailed:e=>`Não foi possível imprimir as páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Um bloco na página ${String(e)}: mostrar no texto`,cover:{add:`Adicionar capa`,change:`Alterar capa`,reposition:`Reposicionar`,remove:`Remover`,drag:`Arraste a imagem para reposicioná-la`,save:`Salvar posição`,cancel:`Cancelar`,upload:`Enviar`,none:`Nenhuma imagem no projeto`,gallery:`Galeria`,project:`Projeto`,names:{dots:`Pontilhismo`,scales:`Escamas do mar`,bay:`Baía ao entardecer`,stacks:`Medas de trigo`,steam:`Trem a vapor`,dusk:`Montanhas ao entardecer`,lake:`Lago ao amanhecer`}}}});function Rf(e){return C(If,e)}var zf=e=>e.map(ca),Bf=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Vf(e,t,n){let r=zf(e),i=zf(t),a=new Map(In(r,i)),o=new Map(In(r,zf(n))),s=new Set(a.values()),c=new Set;for(let e=0;e<r.length;e++){let t=a.get(e);t!==void 0&&!o.has(e)&&c.add(t)}let l=new Map([...o].map(([e,t])=>[t,e])),u=new Map,d=-1;n.forEach((e,t)=>{let n=l.get(t);n===void 0?u.set(d,[...u.get(d)??[],e]):d=n});let f=e=>{for(let t=e;t>=0;t--){let e=a.get(t);if(e!==void 0)return e+1}return 0},p=new Map;for(let[e,n]of u){let c=f(e),l=c;for(;l<t.length&&!s.has(l);)l++;if(Bf(i.slice(c,l),zf(n)))continue;let u=e+1<r.length&&!o.has(e+1),d=e>=0&&!a.has(e),m=u||d?l:c;p.set(m,[...p.get(m)??[],...n])}let m=[];for(let e=0;e<=t.length;e++){m.push(...p.get(e)??[]);let n=t[e];n&&!c.has(e)&&m.push(n)}return m}function Hf(e,t){if(!e.some(e=>e.type===`source`))return[...t];let n=new Map(In(zf(ma(e)),zf(t))),r=new Map,i=-1,a=0;for(let o of e){if(o.type!==`source`){i++;let e=n.get(i);e!==void 0&&(a=e+1);continue}let e=i<0?0:(n.get(i)??a-1)+1,s=Math.max(0,Math.min(t.length,e));r.set(s,[...r.get(s)??[],o])}let o=[];for(let e=0;e<=t.length;e++){o.push(...r.get(e)??[]);let n=t[e];n&&o.push(n)}return o}function Uf(e){if(e.coverY!==50)return Zd(e);let t={...e};return delete t.coverY,Zd(t)}var Wf=(e,t)=>Uf(e)===Uf(t);function Gf(e,t){let n={...e};return delete n.pageNumbers,t?n:{...n,pageNumbers:!1}}function Kf(e,t){let n={...e};return delete n.cover,delete n.coverY,t===void 0?n:{...n,cover:t}}function qf(e,t){let n=Math.round(Math.min(100,Math.max(0,t))),r={...e};return delete r.coverY,n===50?r:{...r,coverY:n}}var Jf=e=>e.blocks.length===0&&e.problems.length>0,Yf=class{doc;constructor(e){this.doc=Od(e)}get source(){return this.doc.source}get problems(){return this.doc.problems}get unreadable(){return Jf(this.doc)}lineOf(e){let t=0;for(let n of this.doc.segments){let r=ma(n.blocks).length;if(e<t+r)return this.doc.source.slice(0,n.start).split(`
|
|
178
|
-
`).length;t+=r}}indexAtLine(e){let t=0,n;for(let r of this.doc.segments){if(this.doc.source.slice(0,r.start).split(`
|
|
179
|
-
`).length>e)break;let i=ma(r.blocks).length;i>0&&(n=t),t+=i}return n}get page(){return this.doc.page}shown(){return ma(this.doc.blocks)}textFor(e,t=this.doc.page){let n=Hf(this.doc.blocks,e),r=la(n,this.doc.blocks)?this.doc.source:nf(this.doc,n),i=Wf(t,this.doc.page)?r:Qd({source:r,frontMatter:this.doc.frontMatter},t);return i===this.doc.source?void 0:i}adopt(e){e!==this.doc.source&&(this.doc=Od(e))}incoming(e,t){if(e===this.doc.source)return;let n=this.shown(),r=Od(e);if(this.doc=r,Jf(r))return;let i=Vf(n,t,ma(r.blocks));return la(i,t)?void 0:i}},Xf=t((e=>{var t=c();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,l=r[1];return o(function(){c.value=n,c.getSnapshot=t,u(c)&&l({inst:c})},[e,n,t]),a(function(){return u(c)&&l({inst:c}),e(function(){u(c)&&l({inst:c})})},[e]),s(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Zf=t(((e,t)=>{t.exports=Xf()})),Qf=t((e=>{var t=c(),n=Zf();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,c){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),c!==void 0&&f.hasValue){var t=f.value;if(c(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return c!==void 0&&c(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,c]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),$f=t(((e,t)=>{t.exports=Qf()})),ep=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),tp=$f(),np=e(u(),1),rp=e(ep(),1),ip=(0,W.createContext)(void 0);function ap(e){return(0,W.useContext)(ip)}function op(e){let t=ap(e);if(!t?.editor)throw Error(`useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component`);return t.editor}function sp(e,t=e=>e){return(0,tp.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,cp)}function cp(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=lp(e);return n.length===lp(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}function lp(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var up=typeof window<`u`?W.useLayoutEffect:W.useEffect,dp=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:[`transaction`,`create`,`mount`,`unmount`],mount:[`create`,`mount`,`unmount`],selection:[`selectionUpdate`],change:[`update`]};for(let i of r[t])n.on(i,e);return()=>{for(let i of r[t])n.off(i,e)}}}};function fp(e){let t=ap(),n=e.editor||t?.editor||null,r=e.on||`all`,[i]=(0,W.useState)(()=>new dp(n)),a=(0,tp.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??rp.default);return up(()=>i.watch(n,r),[n,i,r]),(0,W.useDebugValue)(a),a}function pp(e){let t=ap();if(e||=t?.editor,!e)throw Error("'editor' is required in `useEditorDOMElement`, either from BlockNoteContext or as a function argument");return fp({editor:e,selector:e=>e.editor.domElement,equalityFn:(e,t)=>e===t,on:`mount`})}var mp=(0,W.createContext)(void 0);function hp(){return(0,W.useContext)(mp)}var gp=typeof window<`u`?W.useInsertionEffect:W.useEffect,_p=(0,W.createContext)(null);function vp(){let e=(0,W.useContext)(_p),t=pp();return e||(t?.parentElement??null)}function yp(e){return(0,G.jsx)(_p.Provider,{value:null,children:e.children})}function bp(e){let{target:t,children:n}=e,r=op(),i=hp()?.applyThemedRoot,[a]=(0,W.useState)(()=>typeof document>`u`?null:document.createElement(`div`));return gp(()=>{if(a&&t)return t.appendChild(a),()=>a.remove()},[a,t]),gp(()=>{a&&t&&i?.(a)},[a,t,i]),gp(()=>{if(a&&t)return r.registerPortalElement(a),()=>r.unregisterPortalElement(a)},[r,a,t]),t===void 0?n:(0,G.jsx)(_p.Provider,{value:a,children:n})}function xp(e){return(0,G.jsx)(bp,{target:e.target,children:(0,G.jsx)(Sp,{children:e.children})})}function Sp(e){let t=vp();return t?(0,np.createPortal)(e.children,t):null}function Cp(){let[e]=(0,W.useState)(()=>{if(typeof document>`u`)return null;let e=document.createElement(`span`);return e.className=`bn-portal-anchor`,e}),t=(0,W.useCallback)(t=>{t&&e&&e.parentElement!==t&&t.appendChild(e)},[e]);return{anchor:e,holder:(0,G.jsx)(`span`,{ref:t,className:wp,style:{position:`absolute`,width:0,height:0,overflow:`visible`}})}}var wp=`bn-portal-anchor-holder`;function Tp(e){return Array.from(e.childNodes).some(e=>!(e instanceof Element&&e.classList.contains(wp)))}function Ep(e){let{anchor:t,holder:n}=Cp(),r=vp(),i=t??r,a=typeof e.children==`function`?e.children(i):e.children;return(0,G.jsxs)(G.Fragment,{children:[n,(0,G.jsx)(_p.Provider,{value:i,children:a})]})}var Dp=(0,W.createContext)(void 0);function Op(){return(0,W.useContext)(Dp)}function kp(){return ap().editor.dictionary}var Ap={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},jp=W.createContext&&W.createContext(Ap),Mp=[`attr`,`size`,`title`];function Np(e,t){if(e==null)return{};var n,r,i=Pp(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pp(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fp(){return Fp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fp.apply(null,arguments)}function Ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ip(Object(n),!0).forEach(function(t){Rp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ip(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rp(e,t,n){return(t=zp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zp(e){var t=Bp(e,`string`);return typeof t==`symbol`?t:t+``}function Bp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vp(e){return e&&e.map((e,t)=>W.createElement(e.tag,Lp({key:t},e.attr),Vp(e.child)))}function Hp(e){return t=>W.createElement(Up,Fp({attr:Lp({},e.attr)},t),Vp(e.child))}function Up(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=Np(e,Mp),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),W.createElement(`svg`,Fp({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:Lp(Lp({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&W.createElement(`title`,null,i),e.children)};return jp===void 0?t(Ap):W.createElement(jp.Consumer,null,e=>t(e))}function Wp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z`},child:[]}]})(e)}function Gp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z`},child:[]}]})(e)}function Kp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11V13H19V11H5Z`},child:[]}]})(e)}function qp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z`},child:[]}]})(e)}function Jp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z`},child:[]}]})(e)}function Yp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z`},child:[]}]})(e)}function Xp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function Zp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function Qp(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z`},child:[]}]})(e)}function $p(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z`},child:[]}]})(e)}function em(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z`},child:[]}]})(e)}function tm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z`},child:[]}]})(e)}function nm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z`},child:[]}]})(e)}function rm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z`},child:[]}]})(e)}function im(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z`},child:[]}]})(e)}function am(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z`},child:[]}]})(e)}function om(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z`},child:[]}]})(e)}function sm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 6V21H11V6H5V4H19V6H13Z`},child:[]}]})(e)}function cm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z`},child:[]}]})(e)}function lm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z`},child:[]}]})(e)}function um(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z`},child:[]}]})(e)}function dm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z`},child:[]}]})(e)}function fm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z`},child:[]}]})(e)}function pm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function mm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function hm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z`},child:[]}]})(e)}function gm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z`},child:[]}]})(e)}function _m(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z`},child:[]}]})(e)}function vm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z`},child:[]}]})(e)}function ym(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z`},child:[]}]})(e)}function bm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z`},child:[]}]})(e)}function xm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z`},child:[]}]})(e)}function Sm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z`},child:[]}]})(e)}function Cm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function wm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z`},child:[]}]})(e)}function Tm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function Em(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z`},child:[]}]})(e)}function Dm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z`},child:[]}]})(e)}function Om(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z`},child:[]}]})(e)}function km(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z`},child:[]}]})(e)}function Am(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z`},child:[]}]})(e)}function jm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z`},child:[]}]})(e)}function Mm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z`},child:[]}]})(e)}function Nm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z`},child:[]}]})(e)}function Pm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z`},child:[]}]})(e)}function Fm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z`},child:[]}]})(e)}function Im(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z`},child:[]}]})(e)}function Lm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z`},child:[]}]})(e)}function Rm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z`},child:[]}]})(e)}function zm(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z`},child:[]}]})(e)}var Bm=`input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)`,Vm=typeof Element>`u`,Hm=Vm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Um=!Vm&&Element.prototype.getRootNode?function(e){return e==null||e.getRootNode==null?void 0:e.getRootNode()}:function(e){return e?.ownerDocument},Wm=function(e,t){t===void 0&&(t=!0);var n=e==null||e.getAttribute==null?void 0:e.getAttribute(`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Wm(e.parentNode))},Gm=function(e){var t,n=e==null||e.getAttribute==null||(t=e.getAttribute(`contenteditable`))==null?void 0:t.toLowerCase();return n===``||n===`true`||n===`plaintext-only`},Km=function(e,t,n){if(Wm(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Bm));return t&&Hm.call(e,Bm)&&r.unshift(e),r=r.filter(n),r},qm=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Wm(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=qm(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Hm.call(a,Bm)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Wm(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=qm(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Jm=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Ym=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Gm(e))&&!Jm(e)?0:e.tabIndex},Xm=function(e,t){var n=Ym(e);return n<0&&t&&!Jm(e)?0:n},Zm=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Qm=function(e){return e.tagName===`INPUT`},$m=function(e){return Qm(e)&&e.type===`hidden`},eh=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},th=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},nh=function(e){if(!e.name)return!0;var t=e.form||Um(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=th(r,e.form);return!i||i===e},rh=function(e){return Qm(e)&&e.type===`radio`},ih=function(e){return rh(e)&&!nh(e)},ah=function(e){var t=e&&Um(e),n=t?.host,r=!1;if(t&&t!==e){var i,a;for(r=!!((i=n)!=null&&(i=i.ownerDocument)!=null&&i.contains(n)||e!=null&&(a=e.ownerDocument)!=null&&a.contains(e));!r&&n;){var o;t=Um(n),n=t?.host,r=!!((o=n)!=null&&(o=o.ownerDocument)!=null&&o.contains(n))}}return r},oh=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},sh=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=Hm.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Hm.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=Um(e);if(s&&!s.shadowRoot&&r(s)===!0)return oh(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(ah(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return oh(e);return!1},ch=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Hm.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},lh=function(e,t){return!(t.disabled||$m(t)||sh(t,e)||eh(t)||ch(t))},uh=function(e,t){return!(ih(t)||Ym(t)<0||!lh(e,t))},dh=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},fh=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Xm(a,i),s=i?fh(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Zm).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ph=function(e,t){return t||={},fh(t.getShadowRoot?qm([e],t.includeContainer,{filter:uh.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dh}):Km(e,t.includeContainer,uh.bind(null,t)))},mh=function(e,t){return t||={},t.getShadowRoot?qm([e],t.includeContainer,{filter:lh.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Km(e,t.includeContainer,lh.bind(null,t))},hh=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Hm.call(e,Bm)!==!1&&uh(t,e)};function gh(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function _h(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function vh(){return/apple/i.test(navigator.vendor)}function yh(){let e=/android/i;return e.test(gh())||e.test(_h())}function bh(){return _h().includes(`jsdom/`)}var xh=`data-floating-ui-focusable`,Sh=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Ch(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function wh(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Th(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Eh(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Dh(e){return e.matches(`html,body`)}function Oh(e){return e?.ownerDocument||document}function kh(e){return d(e)&&e.matches(Sh)}function Ah(e){return e?e.getAttribute(`role`)===`combobox`&&kh(e):!1}function jh(e){return e?e.hasAttribute(xh)?e:e.querySelector(`[`+xh+`]`)||e:null}function Mh(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Mh(e,t.id,n)])}function Nh(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Ph(e){e.preventDefault(),e.stopPropagation()}function Fh(e){return`nativeEvent`in e}function Ih(e){return e.mozInputSource===0&&e.isTrusted?!0:yh()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Lh(e){return bh()?!1:!yh()&&e.width===0&&e.height===0||yh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Rh(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var zh=typeof document<`u`?W.useLayoutEffect:function(){},Bh={...W};function Vh(e){let t=W.useRef(e);return zh(()=>{t.current=e}),t}var Hh=Bh.useInsertionEffect||(e=>e());function Uh(e){let t=W.useRef(()=>{});return Hh(()=>{t.current=e}),W.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var Wh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Gh(e,t){let n=ph(e,Wh()),r=n.length;if(r===0)return;let i=Ch(Oh(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Kh(e){return Gh(Oh(e).body,1)||e}function qh(e){return Gh(Oh(e).body,-1)||e}function Jh(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!wh(n,r)}function Yh(e){ph(e,Wh()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Xh(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Zh(e){let t=W.useRef(void 0),n=W.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return W.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Qh=`data-floating-ui-focusable`,$h=`active`,eg=`selected`,tg=`ArrowLeft`,ng=`ArrowRight`,rg=`ArrowUp`,ig=`ArrowDown`,ag=[tg,ng],og=[rg,ig];[...ag,...og];var sg={...W},cg=!1,lg=0,ug=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+lg++;function dg(){let[e,t]=W.useState(()=>cg?ug():void 0);return zh(()=>{e??t(ug())},[]),W.useEffect(()=>{cg=!0},[]),e}var fg=sg.useId||dg;function pg(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var mg=W.createContext(null),hg=W.createContext(null),gg=()=>W.useContext(mg)?.id||null,_g=()=>W.useContext(hg);function vg(e){return`data-floating-ui-`+e}function yg(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var bg=vg(`safe-polygon`);function xg(e,t,n){if(n&&!Rh(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Sg(e){return typeof e==`function`?e():e}function Cg(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=_g(),m=gg(),h=Vh(l),g=Vh(c),_=Vh(n),v=Vh(d),y=W.useRef(),b=W.useRef(-1),x=W.useRef(),C=W.useRef(-1),w=W.useRef(!0),T=W.useRef(!1),E=W.useRef(()=>{}),D=W.useRef(!1),O=Uh(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});W.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(yg(b),yg(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),W.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=Oh(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=W.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=xg(g.current,`close`,y.current);i&&!x.current?(yg(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(yg(b),r(!1,e,n))},[g,r]),A=Uh(()=>{E.current(),x.current=void 0}),j=Uh(()=>{if(T.current){let e=Oh(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(bg),T.current=!1}}),M=Uh(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);W.useEffect(()=>{if(!s)return;function e(e){if(yg(b),w.current=!1,u&&!Rh(y.current)||Sg(v.current)>0&&!xg(g.current,`open`))return;let t=xg(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=Oh(o.floating);if(yg(C),D.current=!1,h.current&&i.current.floatingContext){n||yg(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)}}else y.current===`touch`&&wh(o.floating,e.relatedTarget)||k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){yg(b)}function l(e){M()||k(e,!1)}if(S(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),zh(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(S(o.domReference)&&e){var t;let n=Oh(o.floating).body;n.setAttribute(bg,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),zh(()=>{n||(y.current=void 0,D.current=!1,A(),j())},[n,A,j]),W.useEffect(()=>()=>{A(),yg(b),yg(C),j()},[s,o.domReference,A,j]);let N=W.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!_.current&&r(!0,t,`hover`)}u&&!Rh(y.current)||n||Sg(v.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(yg(C),y.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,Sg(v.current))))}}},[u,r,n,_,v]);return W.useMemo(()=>s?{reference:N}:{},[s,N])}var wg=0;function Tg(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(wg);let a=()=>e?.focus({preventScroll:n});i?a():wg=requestAnimationFrame(a)}function Eg(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Dg(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Og(e){return e?.ownerDocument||document}var kg={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ag(e){return e===`inert`?kg.inert:e===`aria-hidden`?kg[`aria-hidden`]:kg.none}var jg=new WeakSet,Mg={},Ng=0,Pg=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function Fg(e){return e?f(e)?e.host:Fg(e.parentNode):null}var Ig=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Fg(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Lg(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Ig(t,e),s=new Set,c=new Set(o),l=[];Mg[i]||(Mg[i]=new WeakMap);let u=Mg[i];o.forEach(d),f(t),s.clear();function d(e){e&&!s.has(e)&&(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){e&&!c.has(e)&&[].forEach.call(e.children,e=>{if(re(e)!==`script`){if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Ag(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&jg.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}}})}return Ng++,()=>{l.forEach(e=>{let t=Ag(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!jg.has(e)&&a&&e.removeAttribute(a),jg.delete(e)),r||e.removeAttribute(i)}),Ng--,Ng||(kg.inert=new WeakMap,kg[`aria-hidden`]=new WeakMap,kg.none=new WeakMap,jg=new WeakSet,Mg={})}}function Rg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Og(e[0]).body;return Lg(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var zg={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Bg=W.forwardRef(function(e,t){let[n,r]=W.useState();zh(()=>{vh()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[vg(`focus-guard`)]:``,style:zg};return(0,G.jsx)(`span`,{...e,...i})}),Vg={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Hg=W.createContext(null),Ug=vg(`portal`);function Wg(e){e===void 0&&(e={});let{id:t,root:n}=e,r=fg(),i=Kg(),[a,o]=W.useState(null),s=W.useRef(null);return zh(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),zh(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(Ug,``),e.appendChild(n),s.current=n,o(n)},[t,r]),zh(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!w(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(Ug,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Gg(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Wg({id:n,root:r}),[o,s]=W.useState(null),c=W.useRef(null),l=W.useRef(null),u=W.useRef(null),d=W.useRef(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return W.useEffect(()=>{if(!a||!i||f)return;function e(e){a&&Jh(e)&&(e.type===`focusin`?Xh:Yh)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),W.useEffect(()=>{a&&(p||Xh(a))},[p,a]),(0,G.jsxs)(Hg.Provider,{value:W.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&(0,G.jsx)(Bg,{"data-type":`outside`,ref:c,onFocus:e=>{if(Jh(e,a)){var t;(t=u.current)==null||t.focus()}else qh(o?o.domReference:null)?.focus()}}),m&&a&&(0,G.jsx)(`span`,{"aria-owns":a.id,style:Vg}),a&&np.createPortal(t,a),m&&a&&(0,G.jsx)(Bg,{"data-type":`outside`,ref:l,onFocus:e=>{if(Jh(e,a)){var t;(t=d.current)==null||t.focus()}else Kh(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Kg=()=>W.useContext(Hg);function qg(e){return W.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Jg=20,Yg=[];function Xg(){Yg=Yg.filter(e=>e.deref()?.isConnected)}function Zg(e){Xg(),e&&re(e)!==`body`&&(Yg.push(new WeakRef(e)),Yg.length>Jg&&(Yg=Yg.slice(-20)))}function Qg(){return Xg(),Yg[Yg.length-1]?.deref()}function $g(e){let t=Wh();return hh(e,t)?e:ph(e,t)[0]||e}function e_(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Wh(),i=mh(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return hh(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var t_=W.forwardRef(function(e,t){return(0,G.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:zg})});function n_(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:g,events:_,dataRef:v,elements:{domReference:y,floating:b}}=t,x=Uh(()=>v.current.floatingContext?.nodeId),S=Uh(m),C=typeof o==`number`&&o<0,w=Ah(y)&&C,T=Pg(),E=!T||a,D=!E||T&&p,O=Vh(i),k=Vh(o),A=Vh(s),j=_g(),M=Kg(),N=W.useRef(null),P=W.useRef(null),F=W.useRef(!1),I=W.useRef(!1),L=W.useRef(-1),R=W.useRef(-1),z=M!=null,B=jh(b),ee=Uh(function(e){return e===void 0&&(e=B),e?ph(e,Wh()):[]}),te=Uh(e=>{let t=ee(e);return O.current.map(e=>y&&e===`reference`?y:B&&e===`floating`?B:t).filter(Boolean).flat()});W.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){wh(B,Ch(Oh(B)))&&ee().length===0&&!w&&Ph(e);let t=te(),n=Th(e);O.current[0]===`reference`&&n===y&&(Ph(e),e.shiftKey?Tg(t[t.length-1]):Tg(t[1])),O.current[1]===`floating`&&n===B&&e.shiftKey&&(Ph(e),Tg(t[0]))}}let t=Oh(B);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,B,l,O,w,ee,te]),W.useEffect(()=>{if(r||!b)return;function e(e){let t=Th(e),n=ee().indexOf(t);n!==-1&&(L.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,ee]),W.useEffect(()=>{if(r||!f)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Th(e);queueMicrotask(()=>{let i=x(),a=!(wh(y,t)||wh(b,t)||wh(t,b)||wh(M?.portalNode,t)||t!=null&&t.hasAttribute(vg(`focus-guard`))||j&&(Mh(j.nodesRef.current,i).find(e=>wh(e.context?.elements.floating,t)||wh(e.context?.elements.domReference,t))||Nh(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,jh(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&B&&e_(B,O),c&&n!==y&&!(r!=null&&r.isConnected)&&Ch(Oh(B))===Oh(B).body){d(B)&&B.focus();let e=L.current,t=ee(),n=t[e]||t[t.length-1]||B;d(n)&&n.focus()}v.current.insideReactTree?v.current.insideReactTree=!1:(w||!l)&&t&&a&&!I.current&&t!==Qg()&&(F.current=!0,g(!1,e,`focus-out`))})}let n=!(j||!M);function i(){yg(R),v.current.insideReactTree=!0,R.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&d(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,B,l,j,M,g,f,c,ee,w,x,O,v]);let ne=W.useRef(null),re=W.useRef(null),ie=qg([ne,M?.beforeInsideRef]),ae=qg([re,M?.afterInsideRef]);W.useEffect(()=>{var e,t;if(r||!b)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+vg(`portal`)+`]`))||[]),i=(t=(j?Nh(j.nodesRef.current,x()):[]).find(e=>Ah(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[b,i,...n,...S(),N.current,P.current,ne.current,re.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,O.current.includes(`reference`)||w?y:null].filter(e=>e!=null),o=l||w?Rg(a,!D,D):Rg(a);return()=>{o()}},[r,y,b,l,O,M,w,E,D,j,x,S]),zh(()=>{if(r||!d(B))return;let e=Ch(Oh(B));queueMicrotask(()=>{let t=te(B),n=k.current,r=(typeof n==`number`?t[n]:n.current)||B,i=wh(B,e);!C&&!i&&h&&Tg(r,{preventScroll:r===B})})},[r,h,B,C,te,k]),zh(()=>{if(r||!B)return;let e=Oh(B);Zg(Ch(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(F.current=!0),t===`outside-press`){if(r)F.current=!1;else if(Ih(n)||Lh(n))F.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}}_.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,zg),z&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof A.current==`boolean`){let e=y||Qg();return e&&e.isConnected?e:n}return A.current.current||n}return()=>{_.off(`openchange`,t);let r=Ch(e),a=wh(b,r)||j&&Mh(j.nodesRef.current,x(),!1).some(e=>wh(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=$g(o);A.current&&!F.current&&d(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,B,A,v,_,j,z,y,x]),W.useEffect(()=>(queueMicrotask(()=>{F.current=!1}),()=>{queueMicrotask(Xg)}),[r]),zh(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,l,h,g,f,y]),zh(()=>{r||B&&e_(B,O)},[r,B,O]);function V(e){return r||!u||!l?null:(0,G.jsx)(t_,{ref:e===`start`?N:P,onClick:e=>g(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let oe=!r&&E&&(!l||!w)&&(z||l);return(0,G.jsxs)(G.Fragment,{children:[oe&&(0,G.jsx)(Bg,{"data-type":`inside`,ref:ie,onFocus:e=>{if(l){let e=te();Tg(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(F.current=!1,Jh(e,M.portalNode))Kh(y)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}}),!w&&V(`start`),n,V(`end`),oe&&(0,G.jsx)(Bg,{"data-type":`inside`,ref:ae,onFocus:e=>{if(l)Tg(te()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(f&&(F.current=!0),Jh(e,M.portalNode))qh(y)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}}})]})}var r_={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},i_={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},a_=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function o_(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=_g(),_=Uh(typeof c==`function`?c:()=>!1),v=typeof c==`function`?_:c,b=W.useRef(!1),{escapeKey:x,outsidePress:C}=a_(m),{escapeKey:w,outsidePress:T}=a_(h),O=W.useRef(!1),k=Uh(e=>{if(!n||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=g?Mh(g.nodesRef.current,t):[];if(!x&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}r(!1,Fh(e)?e.nativeEvent:e,`escape-key`)}),A=Uh(e=>{var t;let n=()=>{var t;k(e),(t=Th(e))==null||t.removeEventListener(`keydown`,n)};(t=Th(e))==null||t.addEventListener(`keydown`,n)}),j=Uh(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=b.current;if(b.current=!1,l===`click`&&n||t||typeof v==`function`&&!v(e))return;let o=Th(e),s=`[`+vg(`inert`)+`]`,c=Oh(i.floating).querySelectorAll(s),u=S(o)?o:null;for(;u&&!ae(u);){let e=D(u);if(ae(e)||!S(e))break;u=e}if(c.length&&S(o)&&!Dh(o)&&!wh(o,i.floating)&&Array.from(c).every(e=>!wh(u,e)))return;if(d(o)&&P){let t=ae(o),n=E(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let f=a.current.floatingContext?.nodeId,p=g&&Mh(g.nodesRef.current,f).some(t=>Eh(e,t.context?.elements.floating));if(Eh(e,i.floating)||Eh(e,i.domReference)||p)return;let m=g?Mh(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r(!1,e,`outside-press`)}),M=Uh(e=>{var t;let n=()=>{var t;j(e),(t=Th(e))==null||t.removeEventListener(l,n)};(t=Th(e))==null||t.addEventListener(l,n)});W.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=C;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),O.current=!0}function u(){e=window.setTimeout(()=>{O.current=!1},y()?5:0)}let d=Oh(i.floating);s&&(d.addEventListener(`keydown`,w?A:k,w),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),v&&d.addEventListener(l,T?M:j,T);let f=[];return p&&(S(i.domReference)&&(f=oe(i.domReference)),S(i.floating)&&(f=f.concat(oe(i.floating))),!S(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(oe(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,w?A:k,w),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),v&&d.removeEventListener(l,T?M:j,T),f.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,v,l,n,r,p,o,x,C,k,w,A,j,T,M]),W.useEffect(()=>{a.current.insideReactTree=!1},[a,v,l]);let N=W.useMemo(()=>({onKeyDown:k,...u&&{[r_[f]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[k,r,u,f]),P=W.useMemo(()=>{function e(e){e.button===0&&(b.current=!0)}return{onKeyDown:k,onMouseDown:e,onMouseUp:e,[i_[l]]:()=>{a.current.insideReactTree=!0}}},[k,l,a]);return W.useMemo(()=>o?{reference:N,floating:P}:{},[o,N,P])}function s_(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=fg(),a=W.useRef({}),[o]=W.useState(()=>pg()),s=gg()!=null,[c,l]=W.useState(r.reference),u=Uh((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=W.useMemo(()=>({setPositionReference:l}),[]),f=W.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return W.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function c_(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=s_({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=W.useState(null),[l,u]=W.useState(null),d=o?.domReference||s,f=W.useRef(null),p=_g();zh(()=>{d&&(f.current=d)},[d]);let m=z({...n,elements:{...o,...l&&{reference:l}}}),h=W.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=W.useCallback(e=>{(S(e)||e===null)&&(f.current=e,c(e)),(S(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!S(e))&&m.refs.setReference(e)},[m.refs]),_=W.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=W.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=W.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return zh(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),W.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function l_(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[$h]:t,[eg]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Qh]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[$h,eg].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function u_(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=W.useCallback(t=>l_(t,e,`reference`),t),a=W.useCallback(t=>l_(t,e,`floating`),n),o=W.useCallback(t=>l_(t,e,`item`),r);return W.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var d_=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function f_(e,t){return typeof e==`function`?e(t):e}function p_(e,t){let[n,r]=W.useState(e);return e&&!n&&r(!0),W.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function m_(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=W.useState(`unmounted`),c=p_(n,a);return!c&&o===`close`&&s(`unmounted`),zh(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{np.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function h_(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=W.useMemo(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=W.useState(()=>({...f_(a,l),...f_(n,l)})),{isMounted:h,status:g}=m_(e,{duration:o}),_=Vh(n),v=Vh(r),y=Vh(i),b=Vh(a);return zh(()=>{let e=f_(_.current,l),t=f_(y.current,l),n=f_(b.current,l),r=f_(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(d_).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(d_).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function g_(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...g_(e,t.id,n)])}function __(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function v_(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function y_(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){yg(i),u()}if(yg(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Dg(e),v=e.type===`mouseleave`,y=Eg(c.floating,_),b=Eg(c.domReference,_),x=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),w=s.split(`-`)[0],T=n>C.right-C.width/2,E=o>C.bottom-C.height/2,D=v_(g,x),O=C.width>x.width,k=C.height>x.height,A=(O?x:C).left,j=(O?x:C).right,M=(k?x:C).top,N=(k?x:C).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&S(e.relatedTarget)&&Eg(c.floating,e.relatedTarget)||f&&g_(f.nodesRef.current,d).length)return;if(w===`top`&&o>=x.bottom-1||w===`bottom`&&o<=x.top+1||w===`left`&&n>=x.right-1||w===`right`&&n<=x.left+1)return p();let P=[];switch(w){case`top`:P=[[A,x.top+1],[A,C.bottom-1],[j,C.bottom-1],[j,x.top+1]];break;case`bottom`:P=[[A,C.top+1],[A,x.bottom-1],[j,x.bottom-1],[j,C.top+1]];break;case`left`:P=[[C.right-1,N],[C.right-1,M],[x.left+1,M],[x.left+1,N]];break;case`right`:P=[[x.right-1,N],[x.right-1,M],[C.left+1,M],[C.left+1,N]]}function F(e){let[n,r]=e;switch(w){case`top`:return[[O?n+t/2:T?n+t*4:n-t*4,r+t+1],[O?n-t/2:T?n+t*4:n-t*4,r+t+1],[C.left,T||O?C.bottom-t:C.top],[C.right,T?O?C.bottom-t:C.top:C.bottom-t]];case`bottom`:return[[O?n+t/2:T?n+t*4:n-t*4,r-t],[O?n-t/2:T?n+t*4:n-t*4,r-t],[C.left,T||O?C.top+t:C.bottom],[C.right,T?O?C.top+t:C.bottom:C.top+t]];case`left`:{let e=[n+t+1,k?r+t/2:E?r+t*4:r-t*4],i=[n+t+1,k?r-t/2:E?r+t*4:r-t*4];return[[E||k?C.right-t:C.left,C.top],[E?k?C.right-t:C.left:C.right-t,C.bottom],e,i]}case`right`:return[[n-t,k?r+t/2:E?r+t*4:r-t*4],[n-t,k?r-t/2:E?r+t*4:r-t*4],[E||k?C.left+t:C.right,C.top],[E?k?C.left+t:C.right:C.left+t,C.bottom]]}}if(!__([m,h],P)){if(a&&!D)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}__([m,h],F([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var b_=`annotation`;function x_(e){return e&&It(e.options.extensions).some(e=>{if(e.type!==`mark`)return!1;let t=Bt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`annotation`)})?b_:``}function S_(e){return e?It(e.options.extensions).filter(e=>{if(e.type!==`mark`)return!1;let t=Bt(e,`group`);return typeof t!=`string`||!t.split(` `).includes(`annotation`)}).map(e=>e.name).join(` `):`_`}var C_=class{listeners=new Set;state;prevState;options;constructor(e,t){this.prevState=e,this.state=e,this.options=t}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});setState(e){this.prevState=this.state,this.state=w_(e)?e(this.prevState):e,D_(this)}_notify(){let e={prevVal:this.prevState,currentVal:this.state};for(let t of this.listeners)t(e)}};function w_(e){return typeof e==`function`}var T_=!1,E_=new Set;function D_(e){E_.add(e);let t=!T_;T_=!0;try{if(e.options?.onUpdate?.(e.state,e.prevState),!t)return;for(;E_.size>0;){let e=Array.from(E_);E_.clear();for(let t of e)t._notify()}}finally{t&&(T_=!1,E_.clear())}}var O_=Symbol(`originalFactory`);function k_(e){if(typeof e==`object`&&`key`in e)return function t(){return e[O_]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let i=e({editor:r.editor,options:n});return i[O_]=t,i}}}function A_(e,t){return new C_(e,t)}crypto.subtle;var j_=crypto.getRandomValues.bind(crypto),M_=()=>j_(new Uint32Array(1))[0],N_=`10000000-1000-4000-8000-100000000000`,P_=typeof crypto<`u`&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>N_.replace(/[018]/g,e=>(e^M_()&15>>e/4).toString(16)),F_,I_;if(typeof WeakMap<`u`){let e=new WeakMap;F_=t=>e.get(t),I_=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;F_=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},I_=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var L_=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return F_(e)||I_(e,R_(e))}};function R_(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=z_(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new L_(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&B_(s,o,e),s}function z_(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function B_(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r==null||c.colwidth&&c.colwidth[n]==r||((s||=V_(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function V_(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function H_(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var U_=new Cr(`selectingCells`);function W_(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function G_(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function K_(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function q_(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=W_(t.$head)||J_(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function J_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Y_(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function X_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Z_(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Q_(e,t,n){let r=e.node(-1),i=L_.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function $_(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function ev(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function tv(e,t,n){let r=H_(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var nv=class e extends kr{constructor(e,t=e){let n=e.node(-1),r=L_.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Fr(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Y_(r)&&Y_(i)&&Z_(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return wr.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=L_.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=$_(e,0,l)),u>0&&(e=$_(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(yr.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new Or(yr.from(o),1,1)}replace(e,t=Or.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?Or.empty:t)}let i=kr.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new Or(yr.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=L_.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=L_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=L_.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=L_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new rv(this.$anchorCell.pos,this.$headCell.pos)}};nv.prototype.visible=!1,kr.jsonID(`cell`,nv);var rv=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Z_(t,n)?new nv(t,n):kr.near(n,1)}};function iv(e){if(!(e.selection instanceof nv))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Pr.node(n,n+e.nodeSize,{class:`selectedCell`}))}),jr.create(e.doc,t)}function av({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function ov({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function sv(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof Mr&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=nv.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=nv.rowSelection(e,e)}else if(!n){let e=L_.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=nv.create(i,t+1,n)}}else r instanceof wr&&av(r)?a=wr.create(i,r.from):r instanceof wr&&ov(r)&&(a=wr.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var cv=new Cr(`fix-tables`);function lv(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?lv(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function uv(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=dv(e,t,r,n))};return t?t.doc!=e.doc&&lv(t.doc,e.doc,0,r):e.doc.descendants(r),n}function dv(e,t,n,r){let i=L_.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,$_(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=H_(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(cv,{fixTables:!0})}function fv(e){let t=e.selection,n=q_(e),r=n.node(-1),i=n.start(-1),a=L_.get(r);return{...t instanceof nv?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function pv(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;tv(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,ev(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?H_(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function mv(e,t){if(!K_(e))return!1;if(t){let n=fv(e);t(pv(e.tr,n,n.left))}return!0}function hv(e,t){if(!K_(e))return!1;if(t){let n=fv(e);t(pv(e.tr,n,n.right))}return!0}function gv(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,$_(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function _v(e,t){if(!K_(e))return!1;if(t){let n=fv(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;gv(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=L_.get(e)}t(r)}return!0}function vv(e,t,n){let r=H_(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function yv(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;vv(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?H_(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,H_(r.type.schema).row.create(null,o)),e}function bv(e,t){if(!K_(e))return!1;if(t){let n=fv(e);t(yv(e.tr,n,n.top))}return!0}function xv(e,t){if(!K_(e))return!1;if(t){let n=fv(e);t(yv(e.tr,n,n.bottom))}return!0}function Sv(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Cv(e,t){if(!K_(e))return!1;if(t){let n=fv(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Sv(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=L_.get(n.table)}t(r)}return!0}function wv(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Tv({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function Ev(e,t){let n=e.selection;if(!(n instanceof nv)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=fv(e),{map:i}=r;if(Tv(i,r))return!1;if(t){let n=e.tr,a={},o=yr.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!a[l]&&u){if(a[l]=!0,s==null)s=l,c=u;else{wv(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...ev(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=wv(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new nv(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Dv(e,t){let n=H_(e.schema);return Ov(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Ov(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof nv){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=G_(r.$from),!i)return!1;a=W_(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=fv(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof nv&&u.setSelection(new nv(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function kv(e){return function(t,n){if(!K_(t))return!1;if(n){let r=H_(t.schema),i=fv(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Av(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function jv(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?kv(e):function(t,n){if(!K_(t))return!1;if(n){let r=H_(t.schema),i=fv(t),a=t.tr,o=Av(`row`,i,r),s=Av(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}jv(`row`,{useDeprecatedLogic:!0}),jv(`column`,{useDeprecatedLogic:!0}),jv(`cell`,{useDeprecatedLogic:!0});function Mv(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Nv(e){return function(t,n){if(!K_(t))return!1;let r=Mv(q_(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(wr.between(e,X_(e))).scrollIntoView())}return!0}}function Pv(e,t){let n=e.selection;if(!(n instanceof nv))return!1;if(t){let r=e.tr,i=H_(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new Or(i,0,0))}),r.docChanged&&t(r)}return!0}function Fv(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Lv(H_(o).row,new Or(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Lv(H_(o).row,new Or(t,n,r)).content:t);else return null;return Iv(o,s)}function Iv(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(yr.empty),n[i]<r){let a=H_(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(yr.from(o))}return{height:t.length,width:r,rows:t}}function Lv(e,t){let n=e.createAndFill();return new Er(n).replace(0,n.content.size,t).doc}function Rv({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked($_(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(yr.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(yr.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function zv(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=H_(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,yr.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Bv(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Vv(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,$_(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill($_(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Hv(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=L_.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=L_.get(a),f=d.mapping.maps.length}zv(d,o,a,n,l,u,f)&&p(),Bv(d,o,a,n,c,l,s,f)&&p(),Bv(d,o,a,n,c,l,u,f)&&p(),Vv(d,o,a,n,s,u,c,f)&&p(),Vv(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new Or(i.rows[e-s],0,0))}p(),d.setSelection(new nv(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Uv=yt({ArrowLeft:Gv(`horiz`,-1),ArrowRight:Gv(`horiz`,1),ArrowUp:Gv(`vert`,-1),ArrowDown:Gv(`vert`,1),"Shift-ArrowLeft":Kv(`horiz`,-1),"Shift-ArrowRight":Kv(`horiz`,1),"Shift-ArrowUp":Kv(`vert`,-1),"Shift-ArrowDown":Kv(`vert`,1),Backspace:Pv,"Mod-Backspace":Pv,Delete:Pv,"Mod-Delete":Pv});function Wv(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Gv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof nv)return Wv(n,r,kr.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Xv(i,e,t);if(o==null)return!1;if(e==`horiz`)return Wv(n,r,kr.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Q_(i,e,t),s;return s=a?kr.near(a,1):t<0?kr.near(n.doc.resolve(i.before(-1)),-1):kr.near(n.doc.resolve(i.after(-1)),1),Wv(n,r,s)}}}function Kv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof nv)o=a;else{let r=Xv(i,e,t);if(r==null)return!1;o=new nv(n.doc.resolve(r))}let s=Q_(o.$headCell,e,t);return s?Wv(n,r,new nv(o.$anchorCell,s)):!1}}function qv(e,t){let n=e.state.doc,r=W_(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new nv(r))),!0):!1}function Jv(e,t,n){if(!K_(e.state))return!1;let r=Fv(n),i=e.state.selection;if(i instanceof nv){r||={width:1,height:1,rows:[yr.from(Lv(H_(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=L_.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Rv(r,o.right-o.left,o.bottom-o.top),Hv(e.state,e.dispatch,a,o,r),!0}if(r){let t=q_(e.state),n=t.start(-1);return Hv(e.state,e.dispatch,n,L_.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Yv(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Zv(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof nv)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=W_(e.state.selection.$anchor))!=null&&Qv(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Qv(e,n),i=U_.getState(e.state)==null;if(!r||!Z_(t,r)){if(i)r=t;else return}let a=new nv(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(U_,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),U_.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(U_,-1))}function o(r){let o=r,s=U_.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Zv(e,o.target)!=n&&(c=Qv(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Xv(e,t,n){if(!(e.state.selection instanceof wr))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Zv(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Qv(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&W_(e.state.doc.resolve(r))||W_(e.state.doc.resolve(i))}var $v=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),ey(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,ey(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function ey(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var ty=new Cr(`tableColumnResizing`);function ny({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=$v,lastColumnResizable:i=!0}={}){let a=new Nr({key:ty,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=H_(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new ry(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=ty.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{iy(t,n,e,i)},mouseleave:e=>{ay(e)},mousedown:(e,r)=>{oy(e,r,t,n)}},decorations:e=>{let t=ty.getState(e);if(t&&t.activeHandle>-1)return hy(e,t.activeHandle)},nodeViews:{}}});return a}var ry=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(ty);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Y_(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function iy(e,t,n,r){if(!e.editable)return;let i=ty.getState(e.state);if(i&&!i.dragging){let a=cy(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ly(e,t,`left`,n):i-t.clientX<=n&&(o=ly(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=L_.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}dy(e,o)}}}function ay(e){if(!e.editable)return;let t=ty.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&dy(e,-1)}function oy(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=ty.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=sy(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(ty,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=ty.getState(e.state);r?.dragging&&(fy(e,r.activeHandle,uy(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ty,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=ty.getState(e.state);if(i&&i.dragging){let a=uy(i.dragging,t,n);py(e,i.activeHandle,a,r)}}return py(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function sy(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function cy(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ly(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=W_(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=L_.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function uy(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function dy(e,t){e.dispatch(e.state.tr.setMeta(ty,{setHandle:t}))}function fy(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=L_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():my(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function py(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=L_.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&ey(a,c.firstChild,c,r,s,n)}function my(e){return Array(e).fill(0)}function hy(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return jr.empty;let a=L_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,ty.getState(e)?.dragging&&n.push(Pr.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Pr.widget(s,c))}}return jr.create(e.doc,n)}function gy({allowTableNodeSelection:e=!1}={}){return new Nr({key:U_,state:{init(){return null},apply(e,t){let n=e.getMeta(U_);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:iv,handleDOMEvents:{mousedown:Yv},createSelectionBetween(e){return U_.getState(e.state)==null?null:e.state.selection},handleTripleClick:qv,handleKeyDown:Uv,handlePaste:Jv},appendTransaction(t,n,r){return sv(r,uv(r,n),e)}})}var _y=`childContainer`,vy=`blockGroupChild`;function yy(e){return e.isInGroup(`childContainer`)&&e.isInGroup(`bnBlock`)}function by(e,t){return e.nodes.blockGroup.createChecked({},t)}function xy(e){return yy(e)&&e.spec.blockConfig?.placeable===`namedOnly`}var Sy={min:30,max:49},Cy=101;function wy(e){if(e===void 0)return 40;let t=Math.round((e-Cy)/10);return Math.min(Sy.max,Math.max(Sy.min,40+t))}function Ty(e){return e!==void 0&&`min`in e?e.min??1:1}function Ey(e,t){if(e.length===0)return vy;let n=[`blockContainer`,...Object.entries(t).filter(([t,{config:n}])=>n.layoutOnly===!0&&n.placeable!==`namedOnly`&&!e.includes(t)).map(([e])=>e)];return n.length===1?n[0]:`(${n.join(` | `)})`}function Dy(e={},t=vy){let{allow:n=`blocks`}=e,r=Ty(e),i;if(n===`blocks`)i=t;else{if(n.length===0)throw Error("Layout block `allow` permits nothing. A layout block must accept at least one block or layout block type; drop `children` entirely for a block that holds none.");i=n.length===1?n[0]:`(${n.join(` | `)})`}return i+(r===0?`*`:r===1?`+`:`{${r},}`)}function Oy(e,t){return t===`start`?e.beforePos+4:e.afterPos-4}function ky(e,t){return!e.hasContent||e.contentKind===`none`?null:e.contentKind===`table`?Oy(e.content,t):t===`start`?e.contentStart:e.contentEnd}function Ay(e,t,n){let r=ky(t,n);if(r!==null)return wr.create(e,r);if(t.hasContent)return Mr.create(e,t.content.beforePos);let{node:i,childrenStart:a,childrenEnd:o}=t.children,s=n===`start`?i.firstChild:i.lastChild;return s?Ay(e,Iy(s,n===`start`?a:o-s.nodeSize),n):Mr.create(e,t.block.beforePos)}function jy(e){return e.marks.some(e=>[`y-attributed-delete`].includes(e.type.name))}var My=new WeakMap;function Ny(e){let t=My.get(e);if(t===void 0){let n=new Map,r=new Map;e.descendants(e=>{let t=e.attrs.id;if(t){let i=r.get(t)??0;jy(e)&&!n.has(e)&&n.set(e,`${t}-${i}`),r.set(t,i+1)}return!0}),t=n,My.set(e,t)}return t}function Py(e,t){let n=e.attrs.id;if(!n)throw Error(`Node ${e.type.name} does not have an ID`);if(jy(e)){let r=Ny(t).get(e);if(r===void 0)throw Error(`Node ${e.type.name} with ID ${n} not found in document`);return r}return n}function Fy(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup(`bnBlock`))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,i=n.node(r);for(;r>0;){if(i.type.isInGroup(`bnBlock`))return{posBeforeNode:n.before(r),node:i};r--,i=n.node(r)}let a=[];e.descendants((e,t)=>{e.type.isInGroup(`bnBlock`)&&a.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let o=e.resolve(a.find(e=>e>=t)||a[a.length-1]);return{posBeforeNode:o.pos,node:o.nodeAfter}}function Iy(e,t){if(!e.type.isInGroup(`bnBlock`))throw Error(`Attempted to get block node at position but found node of different type ${e.type.name}`);let n={node:e,beforePos:t,afterPos:t+e.nodeSize};if(yy(e.type))return{hasContent:!1,block:n,children:{...n,childrenStart:n.beforePos+1,childrenEnd:n.afterPos-1},blockNoteType:e.type.name};if(e.type.name===`blockContainer`){let r=e.firstChild;if(!r||!r.type.isInGroup(`blockContent`))throw Error(`blockContainer must start with a block content node.`);let i={node:r,beforePos:t+1,afterPos:t+1+r.nodeSize},a;if(e.childCount>1){let t=e.child(1);if(e.childCount!==2||t.type.name!==`blockGroup`)throw Error(`blockContainer may only have a blockGroup after its content.`);a={node:t,beforePos:i.afterPos,afterPos:n.afterPos-1,childrenStart:i.afterPos+1,childrenEnd:n.afterPos-2}}let o=i.node.type.spec.blockConfig;if(!o)throw Error(`Block content node "${i.node.type.name}" was not built from a block spec, so it has no content kind. Register it with \`createBlockSpec\`/\`createBlockSpecFromTiptapNode\` instead of joining the \`blockContent\` group directly.`);return{hasContent:!0,block:n,content:i,children:a,contentStart:i.beforePos+1,contentEnd:i.afterPos-1,contentKind:o.content,isContentEmpty:i.node.childCount===0,blockNoteType:i.node.type.name}}throw Error(`Node "${e.type.name}" is not a container or blockContainer.`)}function Ly(e,t){let n=e.resolve(t);if(!n.nodeAfter)throw Error(`Attempted to get block node at position ${t} but a node at this position does not exist`);return Iy(n.nodeAfter,n.pos)}function Ry(e,t){let n=Fy(e.doc,t);return Iy(n.node,n.posBeforeNode)}function zy(e){return Ry(e,e.selection.anchor)}function By(e,t){let n=e.resolve(t),r=n.node();if(r.type.isInGroup(`bnBlock`))return Ly(e,n.before(n.depth));if(r.type.isInGroup(`childContainer`)&&n.depth>1)return Ly(e,n.before(n.depth-1))}function Vy(e,t){let n=e.resolve(t),r=n.index();if(r!==0)return Ly(e,n.posAtIndex(r-1))}function Hy(e,t){let n=e.resolve(t),r=n.index();if(r!==n.node().childCount-1)return Ly(e,n.posAtIndex(r+1))}function Uy(e){for(;e.children&&e.children.node.childCount;){let t=e.children.node.lastChild;e=Iy(t,e.children.childrenEnd-t.nodeSize)}return e}function Wy(e,t,n,r){if(n===`before`||n===`after`){let i=n===`before`?t.block.beforePos:t.block.afterPos,a=e.resolve(i);return a.parent.canReplaceWith(a.index(),a.index(),r)?{pos:i}:null}if(!t.children){let e=r.schema.nodes.blockGroup;return t.hasContent&&e?.contentMatch.matchType(r)?{pos:t.content.afterPos,wrapIn:e}:null}let i=n===`last-child`;for(;t.children;){let e=t.children,n=i?e.node.childCount:0;if(e.node.canReplaceWith(n,n,r))return{pos:i?e.childrenEnd:e.childrenStart};let a=i?e.node.lastChild:e.node.firstChild;if(!a||!yy(a.type))break;t=Iy(a,i?e.childrenEnd-a.nodeSize:e.childrenStart)}return null}function Gy(e){for(;!e.hasContent;){let{node:t,childrenStart:n}=e.children;if(!t.firstChild)return null;e=Iy(t.firstChild,n)}return e}function Ky(e,t,n,r=`before`){for(;;){let i=e.resolve(t),a=i.node();if(a.canReplaceWith(i.index(),i.index(),n))return t;if(i.depth>0&&yy(a.type))t=r===`before`?i.before():i.after();else return}}function qy(e,t){let n=e.resolve(t),r=[];for(let e=n.depth;e>0;e--){let t=n.node(e);if(!yy(t.type))break;t.attrs.id&&r.push({id:t.attrs.id,depth:e})}return r}function Jy(e,t){return t.length===1&&t[0].before===e?t[0]:Mt(e,[...t])}function Yy(e){let{mapping:t,steps:n}=e,r=t.maps;for(let e=0;e<r.length;e++)if(t.getMirror(e)!==void 0)return wt({mapping:t,steps:n});let i=new Zy(r),a=[];return r.forEach((e,t)=>{let r=[];if(e.forEach((e,t)=>r.push({from:e,to:t})),!r.length){let{from:e,to:i}=n[t];if(e===void 0||i===void 0)return;r.push({from:e,to:i})}for(let{from:e,to:n}of r){let r=i.mapForward(e,-1,t),o=i.mapForward(n,1,t);a.push({oldRange:{from:i.mapBackward(r,-1),to:i.mapBackward(o,1)},newRange:{from:r,to:o}})}}),Xy(a)}function Xy(e){let t=new Set,n=e.filter(({oldRange:e,newRange:n})=>{let r=`${e.from},${e.to},${n.from},${n.to}`;return!t.has(r)&&(t.add(r),!0)});if(n.length===1)return n;let r=n.map((e,t)=>t).sort((e,t)=>n[e].newRange.from-n[t].newRange.from),i=new $y(r.map(e=>n[e].newRange.to),`max`);return n.filter((e,t)=>{let a=0,o=r.length-1;for(;a<o;){let t=a+o+1>>1;n[r[t]].newRange.from<=e.newRange.from?a=t:o=t-1}return!i.someBefore(a,t=>t>=e.newRange.to,e=>r[e]!==t)})}var Zy=class{maps;inverted;firstStarts=[];oldEnds=[];newEnds=[];shift=[0];trees;constructor(e){this.maps=e,this.inverted=Array(e.length);for(let t of e){let e=1/0,n=-1/0,r=-1/0,i=0;t.forEach((t,a,o,s)=>{e=Math.min(e,t,o),n=Math.max(n,a),r=Math.max(r,s),i+=s-o-(a-t)}),this.firstStarts.push(e),this.oldEnds.push(n),this.newEnds.push(r),this.shift.push(this.shift[this.shift.length-1]+i)}}mapForward(e,t,n){let r=0,i=n;for(;i<this.maps.length;)if(e<this.firstStarts[i])r=Math.max(r,0)+1,r>Qy?(i=this.getTrees().firstStart.firstFrom(i,t=>t<=e),r=0):i++;else if(e>this.oldEnds[i]){if(r=Math.min(r,0)-1,r<-Qy){let t=e-this.shift[i],n=this.getTrees().forwardShiftFrom.firstFrom(i,e=>e>=t);e+=this.shift[n]-this.shift[i],i=n,r=0}else e+=this.shift[i+1]-this.shift[i],i++}else e=this.maps[i].map(e,t),r=0,i++;return e}mapBackward(e,t){let n=0,r=this.maps.length-1;for(;r>=0;)if(e<this.firstStarts[r])n=Math.max(n,0)+1,n>Qy?(r=this.getTrees().firstStart.lastFrom(r,t=>t<=e),n=0):r--;else if(e>this.newEnds[r]){if(n=Math.min(n,0)-1,n<-Qy){let t=e-this.shift[r+1],i=this.getTrees().backwardShiftFrom.lastFrom(r,e=>e>=t);e-=this.shift[r+1]-this.shift[i+1],r=i,n=0}else e-=this.shift[r+1]-this.shift[r],r--}else this.inverted[r]??=this.maps[r].invert(),e=this.inverted[r].map(e,t),n=0,r--;return e}getTrees(){return this.trees??={firstStart:new $y(this.firstStarts,`min`),forwardShiftFrom:new $y(this.oldEnds.map((e,t)=>e-this.shift[t]),`max`),backwardShiftFrom:new $y(this.newEnds.map((e,t)=>e-this.shift[t+1]),`max`)},this.trees}},Qy=8,$y=class{values;kind;size;tree;constructor(e,t){this.values=e,this.kind=t,this.size=e.length,this.tree=Array(4*Math.max(1,e.length)),e.length&&this.build(1,0,e.length-1)}firstFrom(e,t){let n=this.first(1,0,this.size-1,e,t);return n===-1?this.size:n}lastFrom(e,t){return this.last(1,0,this.size-1,e,t)}someBefore(e,t,n){for(let r=this.lastFrom(e,t);r!==-1;){if(n(r))return!0;r=r===0?-1:this.lastFrom(r-1,t)}return!1}build(e,t,n){if(t===n){this.tree[e]=this.values[t];return}let r=t+n>>1;this.build(2*e,t,r),this.build(2*e+1,r+1,n),this.tree[e]=this.kind===`min`?Math.min(this.tree[2*e],this.tree[2*e+1]):Math.max(this.tree[2*e],this.tree[2*e+1])}first(e,t,n,r,i){if(n<r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.first(2*e,t,a,r,i);return o===-1?this.first(2*e+1,a+1,n,r,i):o}last(e,t,n,r,i){if(t>r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.last(2*e+1,a+1,n,r,i);return o===-1?this.last(2*e,t,a,r,i):o}};function eb(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function tb(e){return eb(e.filter((t,n)=>e.indexOf(t)!==n))}function nb(e){return e.marks.some(e=>e.type.name===`y-attributed-delete`)}var rb=Rt.create({name:`uniqueID`,priority:1e4,addOptions(){return{types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>{let e=globalThis.window??globalThis;if(e.__TEST_OPTIONS){let t=e.__TEST_OPTIONS;return t.mockID===void 0?t.mockID=0:t.mockID++,t.mockID.toString()}return P_()}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>{let t={"data-id":e.id};return this.options.setIdAttribute?{...t,id:e.id}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,n=!1;return[new Nr({key:new Cr(`uniqueID`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged)||t.doc.eq(n.doc))return;let{tr:r}=n,{types:i,generateID:a}=this.options,o=Jy(t.doc,e),{mapping:s}=o;if(Yy(o).forEach(({newRange:e})=>{let o=Dt(n.doc,e,e=>i.includes(e.type.name)),c=tb(o.filter(({node:e})=>!nb(e)).map(({node:e})=>e.attrs.id).filter(e=>e!==null));o.forEach(({node:e,pos:i})=>{if(nb(e))return;let o=r.doc.nodeAt(i)?.attrs.id;if(o===null){let o=t.doc.type.createAndFill().content;if(t.doc.content.findDiffStart(o)===null){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id=`initialBlockId`,JSON.stringify(t.content)===JSON.stringify(o.toJSON())){r.setNodeMarkup(i,void 0,{...e.attrs,id:`initialBlockId`});return}}r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})}else c.includes(o)&&s.invert().mapResult(i).deleted&&r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})})}),r.steps.length)return r.setMeta(`uniqueID`,!0),r},view(n){let r=r=>{let i=n.dom.parentElement;t=i?.contains(r.target)||e?.(r.target)?i:null};return window.addEventListener(`dragstart`,r),{destroy(){window.removeEventListener(`dragstart`,r)}}},props:{handleDOMEvents:{drop:(e,r)=>(n=t!==e.dom.parentElement||r.dataTransfer?.effectAllowed===`copy`,t=null,!1),paste:()=>(n=!0,!1)},transformPasted:e=>{if(!n)return e;let{types:t}=this.options,r=e=>{let n=[];return e.forEach(e=>{if(e.isText){n.push(e);return}if(!t.includes(e.type.name)){n.push(e.copy(r(e.content)));return}let i=e.type.create({...e.attrs,id:null},r(e.content),e.marks);n.push(i)}),yr.from(n)};return n=!1,new Or(r(e.content),e.openStart,e.openEnd)}}})]}});function ib(e){return e.type===`link`}function ab(e){return typeof e!=`string`&&e.type===`link`}function ob(e){return typeof e!=`string`&&e.type===`text`}function sb(e){return lb(e)?{...e}:cb(e)?{type:`tableCell`,content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??`default`,textColor:e.props?.textColor??`default`,textAlignment:e.props?.textAlignment??`left`,colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:`tableCell`,content:[].concat(e),props:{backgroundColor:`default`,textColor:`default`,textAlignment:`left`,colspan:1,rowspan:1}}}function cb(e){return e!=null&&typeof e!=`string`&&!Array.isArray(e)&&e.type===`tableCell`}function lb(e){return cb(e)&&e.props!==void 0&&e.content!==void 0}function ub(e){return lb(e)?e.props.colspan??1:1}function db(e){return lb(e)?e.props.rowspan??1:1}var fb=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function pb(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error(`Object must be empty `+JSON.stringify(e))}var mb=()=>typeof navigator<`u`&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function hb(e,t=`Ctrl`){return mb()?e.replace(`Mod`,`⌘`):e.replace(`Mod`,t)}function gb(...e){return[...new Set(e.filter(e=>e).join(` `).split(` `))].join(` `)}var _b=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),vb,yb=()=>typeof navigator>`u`||typeof window>`u`?!1:(vb===void 0&&(vb=navigator.maxTouchPoints>0&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches),vb);function bb(e,t,n,r){let i=document.createElement(`div`);i.className=gb(`bn-block-content`,n.class),i.setAttribute(`data-content-type`,e);for(let[e,t]of Object.entries(n))e!==`class`&&i.setAttribute(e,t);let a=document.createElement(t);a.className=gb(`bn-inline-content`,r.class);for(let[e,t]of Object.entries(r))e!==`class`&&a.setAttribute(e,t);return i.appendChild(a),{dom:i,contentDOM:a}}var xb=(e,t)=>{let n=bS(e,t.pmSchema);n.type.name===`blockContainer`&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=r(n);if(typeof i!=`object`||!(`dom`in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return i};function Sb(e,t=`<br>`){let n=e.querySelectorAll(`p`);if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let i=n[r];e.innerHTML+=t+i.innerHTML,i.remove()}}}var Cb=`blockLevelSuggestion`;function wb(e){return e&&e.options.extensions.some(e=>{if(e.type!==`mark`)return!1;let t=Bt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`blockLevelSuggestion`)})?Cb:``}function Tb(e){return e.type!==`attributes`||!e.attributeName?!1:e.attributeName.startsWith(`data-darkreader`)?!0:e.attributeName===`style`?(e.target.getAttribute(`style`)??``).includes(`--darkreader`)||(e.oldValue??``).includes(`--darkreader`):!1}function Eb(e){let t=e.ignoreMutation?.bind(e),n=e.contentDOM;e.ignoreMutation=e=>Tb(e)?!0:t?t(e):!n&&e.type!==`selection`}function Db(e){return`data-`+e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function Ob(e){let t=e.split(`/`);return!t.length||t[t.length-1]===``?e:t[t.length-1]}function kb(e){let t=[`mp4`,`webm`,`ogg`,`mov`,`mkv`,`flv`,`avi`,`wmv`,`m4v`];try{let n=new URL(e).pathname.split(`.`).pop()?.toLowerCase()||``;return t.includes(n)}catch{return!1}}function Ab(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(e=>e in t)}function jb(e,t){let n={};for(let r of Ab(e,t)){let i=e[r];i!==void 0&&i!==t[r].default&&(n[Db(r)]=String(i))}return n}function Mb(e,t){for(let[n,r]of Object.entries(t))e.setAttribute(n,r)}function Nb(e,t,n){let r=jb(t,n);for(let i of Ab(t,n)){let t=Db(i);t in r?e.setAttribute(t,r[t]):e.removeAttribute(t)}}function Pb(e){return`doc`in e?e.doc.type.schema:e.type.schema}function Fb(e){return e.cached.blockNoteEditor}function Ib(e){return Fb(e).schema}function Lb(e){return Ib(e).blockSchema}function Rb(e){return Ib(e).inlineContentSchema}function zb(e){return Ib(e).styleSchema}function Bb(e){return Fb(e).blockCache}function Vb(e,t){if(Lb(e)[t.name]?.content===`plain`)return!0;let n=Rb(e)[t.name];return typeof n==`object`&&n.content===`plain`}function Hb(e){let t=``;return e.forEach(e=>{jy(e)||(t+=e.textContent)}),t}function Ub(e,t,n){let r={type:`tableContent`,columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},i=[];e.content.forEach((e,a,o)=>{let s={cells:[]};o===0&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),r.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(i[o]||(i[o]=[]),i[o][r]=e.type.name===`tableHeader`,{type:`tableCell`,content:e.content.content.map(e=>Wb(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&ob(n)&&ob(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+=`
|
|
180
|
-
`+r.text,e.push(...t.slice(1)),e):(e.push(...t),e)},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),r.rows.push(s)});for(let e=0;e<i.length;e++)i[e]?.every(e=>e)&&(r.headerRows=(r.headerRows??0)+1);for(let e=0;e<i[0]?.length;e++)i?.every(t=>t[e])&&(r.headerCols=(r.headerCols??0)+1);return r}function Wb(e,t,n){let r=[],i;return e.content.forEach(e=>{if(e.type.name===`hardBreak`){if(i){if(ob(i))i.text+=`
|
|
181
|
-
`;else if(ib(i))i.content[i.content.length-1].text+=`
|
|
182
|
-
`;else throw Error(`unexpected`)}else i={type:`text`,text:`
|
|
183
|
-
`,styles:{}};return}if(e.type.name!==`link`&&e.type.name!==`text`){if(!t[e.type.name]){console.warn(`unrecognized inline content type`,e.type.name);return}i&&=(r.push(i),void 0),r.push(Gb(e,t,n));return}let a={},o;for(let t of e.marks)if(t.type.name===`link`)o=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if(e.propSchema===`boolean`)a[e.type]=!0;else if(e.propSchema===`string`)a[e.type]=t.attrs.stringValue;else throw new fb(e.propSchema)}i?ob(i)?o?(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):JSON.stringify(i.styles)===JSON.stringify(a)?i.text+=e.textContent:(r.push(i),i={type:`text`,text:e.textContent,styles:a}):ib(i)&&(o?i.href===o.attrs.href?JSON.stringify(i.content[i.content.length-1].styles)===JSON.stringify(a)?i.content[i.content.length-1].text+=e.textContent:i.content.push({type:`text`,text:e.textContent,styles:a}):(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):(r.push(i),i={type:`text`,text:e.textContent,styles:a})):i=o?{type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}:{type:`text`,text:e.textContent,styles:a}}),i&&r.push(i),r}function Gb(e,t,n){if(e.type.name===`text`||e.type.name===`link`)throw Error(`unexpected`);let r={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error(`ic node is of an unrecognized type: `+e.type.name);t in i.propSchema&&(r[t]=n)}let a;return a=i.content===`styled`?Wb(e,t,n):i.content===`plain`?Hb(e):void 0,{type:e.type.name,props:r,content:a}}function Kb(e,t){let n=e.type.schema,r=Lb(n),i=Rb(n),a=zb(n),o=Bb(n);if(!e.type.isInGroup(`bnBlock`))throw Error(`Node should be a block, but is instead: `+e.type.name);let s=o?.get(e);if(s)return s;let c=Iy(e,0),l;try{l=Py(c.block.node,t)}catch{l=rb.options.generateID()}let u=r[c.blockNoteType];if(!u)throw Error(`Block is of an unrecognized type: `+c.blockNoteType);let d={};for(let[t,n]of Object.entries({...e.attrs,...c.hasContent?c.content.node.attrs:{}})){let e=u.propSchema;t in e&&(e[t].default!==void 0||n!==void 0)&&(d[t]=n)}let f=[];c.children?.node.forEach(e=>{f.push(Kb(e,t))});let p;switch(c.contentKind){case`inline`:p=Wb(c.content.node,i,a);break;case`table`:p=Ub(c.content.node,i,a);break;case`plain`:{let e=Hb(c.content.node);p=e.length>0?[{type:`text`,text:e,styles:{}}]:[];break}case`none`:case void 0:p=void 0;break;default:throw new fb(c)}let m={id:l,type:u.type,props:d,content:p,children:f};return o?.set(e,m),m}function qb(e){let t=[];return e.firstChild&&e.firstChild.descendants(n=>(t.push(Kb(n,e)),!1)),t}function Jb(e){function t(n,r,i){if(n.type.name!==`blockGroup`&&!yy(n.type))throw Error(`unexpected`);let a=[],o,s;return n.forEach((c,l,u)=>{let d=u===0,f=u===n.childCount-1,p=yy(c.type);if(!p){if(c.type.name!==`blockContainer`)throw Error(`unexpected`);if(c.childCount===0)return;if(c.childCount>2)throw Error(`unexpected, blockContainer.childCount: `+c.childCount)}let m=!p&&c.firstChild.type.name===`blockGroup`;if(m&&!d)throw Error(`unexpected`);if(m||p&&(d&&r>0||f&&i>0)){let e=t(p?c:c.firstChild,d?Math.max(0,r-1):0,f?Math.max(0,i-1):0);d&&(o=e.blockCutAtStart),f&&(s=e.blockCutAtEnd),a.push(...e.blocks);return}if(p){a.push(Kb(c,e.content.firstChild));return}let h=Kb(c,e.content.firstChild),g=c.childCount>1?c.child(1):void 0,_=[];if(g){let e=t(g,0,f?Math.max(0,i-1):0);_=e.blocks,f&&(s=e.blockCutAtEnd)}f&&!g&&i>1&&(s=h.id),d&&r>1&&(o=h.id),a.push({...h,children:_})}),{blocks:a,blockCutAtStart:o,blockCutAtEnd:s}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw Error(`slice must be a single block, did you forget includeParents=true?`);return t(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function Yb(e,t,n,r,i){e&&(Nb(e,n,r),e.setAttribute(`data-node-type`,t),i&&e.setAttribute(`data-id`,i))}var Xb=`data-frame-slot`;function Zb(e){e.setAttribute(Xb,``)}function Qb(e){if(e.hasAttribute(`data-frame-slot`))return e;for(let t of e.querySelectorAll(`[${Xb}]`))if(t.closest(`[data-node-type]`)===e)return t}function $b(e,t,n){Yb(t.dom,e.type,n.props,e.propSchema,n.id),Zb(t.slot)}function ex(e,t){let n=e.blockImplementations[t.type],r=n.implementation.renderFrame?.call({renderType:`dom`,props:void 0,propSchema:n.config.propSchema},t,e);if(n.config.layoutOnly===!0){if(!r)throw Error(`Layout block "${t.type}" must draw its frame: \`renderFrame\` returned undefined.`);$b(n.config,r,t)}return r}function tx(e){let{props:t,editor:n,blockNode:r}=e;return n.blockImplementations[r(t.node).type.name].implementation.frameView?.(t)??nx(e)}function nx(e){let{props:t,editor:n,blockNode:r,unframed:i}=e,a=n.blockImplementations[r(t.node).type.name].config;function o(e,t){a.layoutOnly===!0&&$b(a,e,t)}function s(e){let i=n.blockImplementations[r(e).type.name],a=i.implementation.renderFrame;if(!a)return;let s=Kb(e,t.view.state.doc),c=a.call({renderType:`nodeView`,props:t,propSchema:i.config.propSchema},s,n);if(c)return o(c,s),c}let c=s(t.node),l,u;if(c)l=c.dom,u=c.slot;else if(i)l=i,u=i;else throw Error(`Block "${r(t.node).type.name}" must draw its frame: \`renderFrame\` returned undefined.`);let d=t.node;return{dom:l,slot:u,get node(){return d},update(e){let n=r(d),i=r(e);if(!c){let t=i.sameMarkup(n)?void 0:s(e);return t?(t.destroy?.(),!1):(d=e,!0)}if(i.type!==n.type)return!1;if(c.update){let n=Kb(e,t.view.state.doc);if(c.update(n)===!1)return!1;o(c,n)}else if(!i.sameMarkup(n))return!1;return d=e,!0},destroy:()=>c?.destroy?.()}}var rx=new Set([`dragenter`,`dragover`,`dragleave`,`drop`,`copy`,`cut`,`paste`]);function ix(e,t){let n=t.target;return n instanceof globalThis.Node&&e.dom.contains(n)&&!e.slot.contains(n)&&!rx.has(t.type)}function ax(e,t){return t.type===`selection`?!1:Tb(t)||t.target===e.slot&&t.type===`attributes`?!0:e.dom.contains(t.target)&&!e.slot.contains(t.target)}function ox(e){return{stopEvent:t=>ix(e,t),ignoreMutation:t=>ax(e,t),selectNode:e.selectNode?.bind(e),deselectNode:e.deselectNode?.bind(e),destroy:e.destroy?.bind(e)}}function sx(e,t){let{isLayoutBlock:n,hardBreakShortcut:r}=t,i={enter:r===`enter`?`line-break`:`split`,shiftEnter:r===`none`?`same-as-enter`:`line-break`,splitKeepsType:!1,splitKeepsChildren:!1,resetsTo:{type:`paragraph`},emptyEnterResets:!1,emptyChildEnter:n?`exit-at-end`:`outdent`,childrenCanOutdent:!n};if(typeof e==`function`)return t=>cx(i,e(t));let a=cx(i,e);return()=>a}function cx(e,t){let n={...e};for(let[e,r]of Object.entries(t??{}))r!==void 0&&Object.assign(n,{[e]:r});return t?.splitKeepsChildren===void 0&&(n.splitKeepsChildren=n.enter===`into-children`),n}function lx(e,t){let n=t.layoutOnly===!0;return{...e,selectable:e?.selectable??!0,code:n?!1:e?.code??!1,defining:n?!0:e?.defining??!0,isolating:n?!1:e?.isolating??!0,draggable:e?.draggable??t.placeable!==`namedOnly`}}function ux(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={default:n.default,keepOnSplit:!0,parseHTML:t=>{let r=t.getAttribute(Db(e));if(r===null)return null;if(n.default===void 0&&n.type===`boolean`||n.default!==void 0&&typeof n.default==`boolean`)return r===`true`||r!==`false`&&null;if(n.default===void 0&&n.type===`number`||n.default!==void 0&&typeof n.default==`number`){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:t=>jb({[e]:t[e]},{[e]:n})}}),t}function dx(e,t){let n=e();if(n===void 0)throw Error(`Cannot find node position`);let r=t.resolve(n).node();if(!r)throw Error(`Cannot find block container`);return Kb(r,t)}function fx(e,t,n){try{return dx(e,n)}catch(e){let r=n.type.schema.nodes.blockContainer?.createAndFill(null,t);if(r)return Kb(r,n);throw e}}var px=11;function mx(e){return e.nodeType===px}function hx(e,t){if(t&&!mx(e))for(let[n,r]of Object.entries(t))n===`class`?e.className=gb(e.className,r):e.setAttribute(n,r)}function gx(e,t,n,r,i=!1,a){let o=document.createElement(`div`);if(a!==void 0)for(let[e,t]of Object.entries(a))e!==`class`&&o.setAttribute(e,t);return o.className=gb(`bn-block-content`,a?.class||``),o.setAttribute(`data-content-type`,t),Mb(o,jb(n,r)),i&&o.setAttribute(`data-file-block`,``),o.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=gb(`bn-inline-content`,e.contentDOM.className)),{...e,dom:o}}function _x(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,meta:lx(void 0,{}),keyboard:sx(void 0,{isLayoutBlock:!1,hardBreakShortcut:void 0}),render:xb,toExternalHTML:xb},extensions:n}}function vx(e,t){e.stopEvent=e=>(e.type===`mousedown`&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function yx(e,t){let n=e.layoutOnly===!0;if(!(e.content===`table`||n&&!t.parseContent))return(r,i)=>{if(t.parseContent){let e=t.parseContent({el:r,schema:i});if(e!==void 0)return e}if(n)return Ir.fromSchema(i).parse(r,{topNode:i.nodes.blockGroup.create(),preserveWhitespace:!0}).content;if(e.content===`none`)return yr.empty;let a=r.cloneNode(!0);Sb(a,e.content===`plain`||t.meta?.code?`
|
|
184
|
-
`:`<br>`);let o=Ir.fromSchema(i).parse(a,{topNode:i.nodes.paragraph.create(),preserveWhitespace:e.content!==`plain`||`full`});if(e.content===`inline`)return o.content;let s=[];return o.content.forEach(e=>{if(e.isText){s.push(e);return}let t=e.type===i.linebreakReplacement?`
|
|
185
|
-
`:e.textContent;t&&s.push(i.text(t,e.marks))}),yr.fromArray(s)}}function bx(e,t){let n=[e.layoutOnly===!0?{tag:`[data-node-type=${e.type}]`,contentElement:e=>Qb(e)??e}:{tag:`[data-content-type=`+e.type+`]`,contentElement:`.bn-inline-content`,preserveWhitespace:e.content===`plain`?`full`:void 0}];return t.parse&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t.parse?.(e);return n!==void 0&&n},preserveWhitespace:!0,getContent:yx(e,t)}),n}function xx(e,t){if(e.layoutOnly!==!0){if(!t.render)throw Error(`Block "${e.type}" must declare \`render\`.`)}else{if(t.render)throw Error(`Layout block "${e.type}" draws its box in \`renderFrame\`, and has no content for \`render\` to draw.`);if(!t.renderFrame)throw Error(`Layout block "${e.type}" must declare \`renderFrame\`.`)}}function Sx(e,t){let n=tx({props:t,editor:t.extension.options.editor,blockNode:e=>e}),r={dom:n.dom,contentDOM:n.slot,update(e,t,r){return e.attrs.id===n.node.attrs.id&&n.update(e,t,r)},...ox(n)};return e.meta.selectable||vx(r,t.editor),r}function Cx(e,t,n){if(e.layoutOnly===!0)return Sx(t,n);let r=fx(n.getPos,n.node,n.view.state.doc),i=t.render.call({blockContentDOMAttributes:n.extension.options.domAttributes?.blockContent||{},props:n,renderType:`nodeView`,propSchema:e.propSchema},r,n.extension.options.editor);return t.meta.selectable||vx(i,n.editor),Eb(i),i}function wx(e){let t=e!==void 0&&`exclude`in e?e.exclude:[];return t===void 0||t.length===0?Dy(e):function(){return Dy(e,Ey(t,this.options.editor.schema.blockSpecs))}}function Tx(e,t,n){let r=e.layoutOnly===!0;return Pt.create({name:e.type,content:r?wx(e.children):e.content===`inline`?`inline*`:e.content===`plain`?`text*`:e.content===`none`?``:e.content,marks(){return r?wb(this.editor):e.content===`plain`?x_(this.editor):void 0},group:r?[`bnBlock`,_y,...e.placeable===`namedOnly`?[]:[vy]].join(` `):`blockContent`,selectable:t.meta.selectable,isolating:t.meta.isolating,code:t.meta.code,defining:t.meta.defining,priority:r?wy(n):n,addAttributes(){return ux(e.propSchema)},parseHTML(){return bx(e,t)},renderHTML({HTMLAttributes:n}){if(r){let t=document.createElement(`div`);t.setAttribute(`data-node-type`,e.type);for(let[e,r]of Object.entries(n))t.setAttribute(e,r);return{dom:t,contentDOM:t}}let i=document.createElement(`div`);return gx({dom:i,contentDOM:e.content===`inline`||e.content===`plain`?i:void 0},e.type,{},e.propSchema,t.meta.fileBlockAccept!==void 0,n)},addNodeView(){return n=>Cx(e,t,n)}})}function Ex(e,t,n,r){let i=e.layoutOnly===!0,a={...t,meta:lx(t.meta,e)},o=a.node??Tx(e,a,r);if(o.name!==e.type)throw Error(`Node name does not match block type. This is a bug in BlockNote.`);xx(e,a);let s=o.extend({extendNodeSchema(t){return t.name===o.name?{blockConfig:e}:{}}}),{experimental_keyboard:c,render:l,toExternalHTML:u,...d}=a;return{config:e,implementation:{...d,keyboard:sx(c,{isLayoutBlock:i,hardBreakShortcut:a.meta.hardBreakShortcut}),node:s,...l&&{render(t,n){let r=s.options.domAttributes?.blockContent||{};return l.call({blockContentDOMAttributes:r,props:void 0,renderType:`dom`,propSchema:e.propSchema},t,n)}},...u&&{toExternalHTML:(t,n,r)=>{let a=s.options.domAttributes?.blockContent||{},o=u.call({blockContentDOMAttributes:a,propSchema:e.propSchema},t,n,r);return o&&i&&!mx(o.dom)&&Nb(o.dom,t.props,e.propSchema),o}}},extensions:n}}function Dx(e){return e}function Ox(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t,o=n?typeof n==`function`?n(r):n:void 0,s=i.layoutOnly===!0;xx(i,a);let c=a.render,l=a.toExternalHTML;return{config:i,implementation:{...a,...l&&{toExternalHTML(e,t,n){let r=l.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(r!==void 0)return s?(hx(r.dom,this.blockContentDOMAttributes),r):gx(r,e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0)}},...c&&{render(e,t){return gx(c.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}}},extensions:o}}}function kx(e,t,n,r){return e.dom.setAttribute(`data-inline-content-type`,t),Mb(e.dom,jb(n,r)),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function Ax(e){return{Backspace:({editor:t})=>{let n=t.state.selection.$from;return t.state.selection.empty&&n.node().type.name===e.type&&n.parentOffset===0}}}function jx(e,t,n){return{config:e,implementation:t,extensions:n}}function Mx(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Nx(e){return e===`boolean`?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute(`data-value`),renderHTML:e=>e.stringValue===void 0?{}:{"data-value":e.stringValue}}}}function Px(e,t,n,r){return e.dom.setAttribute(`data-style-type`,t),r===`string`&&e.dom.setAttribute(`data-value`,n),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function Fx(e,t){return{config:e,implementation:t}}function Ix(e,t){return Fx({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=xr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=xr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function Lx(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Rx(e,t){let n=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,consuming:!1,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&{stringValue:n}}}),n}function zx(e,t){let n=Tt.create({name:e.type,addAttributes(){return Nx(e.propSchema)},parseHTML(){return Rx(e,t.parse)},renderHTML({mark:n}){return Px((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:n})=>Px(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)}});return Fx(e,{...t,mark:n,render:n=>Px(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>Px((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function Bx(e){let t=Hx(e),{roots:n,nonRoots:r}=Ux(t),i=[];for(;n.size;){i.push(n);let r=new Set;for(let i of n){let n=e.get(i);if(n)for(let e of n){let n=t.get(e);if(n===void 0)continue;let i=n-1;t.set(e,i),i===0&&r.add(e)}}n=r}if(r=Ux(t).nonRoots,r.size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(`, `)}`);return i}function Vx(e){return Bx(Wx(e))}function Hx(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,0);for(let e of r){let n=t.get(e)??0;t.set(e,n+1)}}return t}function Ux(e){let t=new Set,n=new Set;for(let[r,i]of e.entries())i===0?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function Wx(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,new Set);for(let e of r)t.has(e)||t.set(e,new Set),t.get(e).add(n)}return t}function Gx(){return new Map}function Kx(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function qx(e){let t=Gx();for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{Kx(t,n.key,e)}):Kx(t,`default`,n.key);let n=Vx(t),r=n.findIndex(e=>e.has(`default`));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function Jx(e){for(let[t,{config:n}]of Object.entries(e)){if(n.layoutOnly===!0&&n.content!==`none`&&Yx(t,'`layoutOnly: true` is only for blocks without content (`content: "none"`). A layout block holds only child blocks, no content of its own.'),n.placeable===`namedOnly`&&n.layoutOnly!==!0&&Yx(t,'`placeable: "namedOnly"` is only for layout blocks (`layoutOnly: true`). Only a layout block can be limited to the blocks that name it in `children.allow`.'),!n.children)continue;let{allow:r=`blocks`,min:i,exclude:a,dissolve:o}=n.children;if(n.layoutOnly!==!0)(r!==`blocks`||i!==void 0||a!==void 0||o!==void 0)&&Yx(t,'restricting child types, a minimum count or `dissolve` requires `layoutOnly: true`. Other blocks can always have any child blocks (`{ allow: "blocks" }`).');else{if(r===`blocks`&&(i!==void 0||o!==void 0)&&Yx(t,`\`children.${i===void 0?`dissolve`:`min`}\` needs an \`allow\` list. A layout block that accepts any blocks always holds at least one child, and dissolves when its last child is removed.`),i!==void 0&&!(Number.isInteger(i)&&i>=0)&&Yx(t,`\`children.min\` must be a whole number that is 0 or more, not ${String(i)}.`),a!==void 0){r!==`blocks`&&Yx(t,"`children.exclude` is only for a layout block that accepts any blocks. An `allow` list already names exactly what the layout block holds.");for(let n of a){Object.prototype.hasOwnProperty.call(e,n)||Yx(t,`\`exclude\` contains "${n}", which is not a configured block type.`);let{config:r}=e[n];r.layoutOnly!==!0&&Yx(t,`\`exclude\` contains "${n}", which is not a layout block. Only layout blocks (\`layoutOnly: true\`) can be excluded.`),r.placeable===`namedOnly`&&Yx(t,`\`exclude\` contains "${n}", which is \`placeable: "namedOnly"\` and never a child of a layout block that accepts any blocks.`)}}if(r!==`blocks`)for(let n of r)Object.prototype.hasOwnProperty.call(e,n)||Yx(t,`\`allow\` contains "${n}", which is not a configured block type.`),e[n].config.layoutOnly!==!0&&Yx(t,`\`allow\` contains "${n}", which is not a layout block. An \`allow\` list can name only layout blocks (\`layoutOnly: true\`); naming other blocks is not supported yet. Use \`allow: "blocks"\` to accept all other blocks.`)}}let t=new Set(Object.values(e).flatMap(({config:e})=>e.children?.allow&&e.children.allow!==`blocks`?e.children.allow:[]));for(let[n,{config:r}]of Object.entries(e))r.placeable===`namedOnly`&&!t.has(n)&&Yx(n,'`placeable: "namedOnly"` limits this block to the blocks that name it in `children.allow`, but no block names it. Name it in the `allow` list of a layout block.')}function Yx(e,t){throw Error(`Invalid config for block "${e}": ${t}`)}function Xx(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Zx=class{opts;BlockNoteEditor=`only for types`;Block=`only for types`;PartialBlock=`only for types`;inlineContentSpecs;styleSpecs;blockSpecs;blockSchema;inlineContentSchema;styleSchema;constructor(e){this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a}init(){let e=qx(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]})));Jx(this.opts.blockSpecs);let t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,Ex(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>typeof n.config==`object`?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:Xx(n),styleSpecs:Xx(r),inlineContentSchema:Mx(n),styleSchema:Lx(r)}}extend(e){this.opts={blockSpecs:{...this.opts.blockSpecs,...e.blockSpecs},inlineContentSpecs:{...this.opts.inlineContentSpecs,...e.inlineContentSpecs},styleSpecs:{...this.opts.styleSpecs,...e.styleSpecs}};let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a,this}};function Qx(e){let{height:t,width:n}=tS(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),i=(e,i)=>{for(let a=e;a<t;a++)for(let e=i;e<n;e++)if(!r[a][e])return{row:a,col:e};throw Error(`Unable to create occupancy grid for table, no more available cells`)};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let a=sb(e.content.rows[t].cells[n]),o=db(a),s=ub(a),{row:c,col:l}=i(t,n);for(let e=c;e<c+o;e++)for(let i=l;i<l+s;i++){if(r[e][i])throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);r[e][i]={row:t,col:n,rowspan:o,colspan:s,cell:a}}}return r}function $x(e){let t=new Set;return e.map(e=>({cells:e.map(e=>!t.has(e.row+`:`+e.col)&&(t.add(e.row+`:`+e.col),e.cell)).filter(e=>e!==!1)}))}function eS(e,t,n=Qx(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let i=n[t][r];if(i&&i.row===e.row&&i.col===e.col)return{row:t,col:r,cell:i.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function tS(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=ub(e)}),n=Math.max(n,t)}),{height:t,width:n}}function nS(e,t,n=Qx(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function rS(e,t){let n=Qx(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let i=Array(n[0].length).fill(!1).map((t,i)=>nS({row:r,col:i},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function iS(e,t){let n=Qx(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let i=Array(n.length).fill(!1).map((t,i)=>nS({row:i,col:r},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function aS(e,t,n,r=Qx(e)){let{col:i}=eS({row:0,col:t},e,r),{col:a}=eS({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(i,1);e.splice(a,0,t)}),$x(r)}function oS(e,t,n,r=Qx(e)){let{row:i}=eS({row:t,col:0},e,r),{row:a}=eS({row:n,col:0},e,r),[o]=r.splice(i,1);return r.splice(a,0,o),$x(r)}function sS(e){return e?cb(e)?sS(e.content):typeof e==`string`?e.length===0:Array.isArray(e)?e.every(e=>typeof e==`string`?e.length===0:ob(e)?e.text.length===0:ab(e)?typeof e.content==`string`?e.content.length===0:e.content.every(e=>e.text.length===0):!1):!1:!0}function cS(e,t,n=Qx(e)){if(t===`columns`){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>sS(e[t].cell)&&e[t].colspan===1);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return $x(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>sS(e.cell)&&e.rowspan===1);e--)r++;let i=Math.min(r,n.length-1);return n.splice(n.length-i,i),$x(n)}function lS(e,t,n,r=Qx(e)){let{width:i,height:a}=tS(e);if(t===`columns`)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:sb(``)});else e.splice(i+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(i).fill(null).map((t,n)=>({row:a+e,col:n,rowspan:1,colspan:1,cell:sb(``)}));r.push(t)}else n<0&&r.splice(a+n,-1*n);return $x(r)}function uS(e,t,n){let r=rS(e,n);if(!r.some(e=>db(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=db(e.cell);i=Math.max(i,e.row+t-1),a=Math.min(a,e.row)}),t<n?n===i:n===a}function dS(e,t,n){let r=iS(e,n);if(!r.some(e=>ub(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=ub(e.cell);i=Math.max(i,e.col+t-1),a=Math.min(a,e.col)}),t<n?n===i:n===a}function fS(e,t,n){let r=eS(e,n),i=eS(t,n);return r.col===i.col}function pS(e,t,n,r){let i=[];for(let[r,a]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if(e.propSchema===`boolean`)a&&i.push(t.mark(r));else if(e.propSchema===`string`)a&&i.push(t.mark(r,{stringValue:a}));else throw new fb(e.propSchema)}let a=r&&t.nodes[r]&&Vb(t,t.nodes[r])?[...t.nodes[r].allowedMarks(i)]:i;return r&&Vb(t,t.nodes[r])?e.text.length>0?[t.text(e.text,a)]:[]:e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>e===`
|
|
186
|
-
`?t.nodes.hardBreak.createChecked():t.text(e,a))}function mS(e,t,n){let r=t.marks.link.create({href:e.href});return hS(e.content,t,n).map(e=>{if(e.type.name===`text`)return e.mark([...e.marks,r]);if(e.type.name===`hardBreak`)return e;throw Error(`unexpected node type`)})}function hS(e,t,n,r){let i=[];if(typeof e==`string`)return i.push(...pS({type:`text`,text:e,styles:{}},t,n,r)),i;for(let a of e)i.push(...pS(a,t,n,r));return i}function gS(e,t,n,r=zb(t)){let i=[];for(let a of e)typeof a==`string`?i.push(...hS(a,t,r,n)):ab(a)?i.push(...mS(a,t,r)):ob(a)?i.push(...hS([a],t,r,n)):i.push(vS(a,t,r));return i}function _S(e,t,n=zb(t)){let r=[],i=Array(e.headerRows??0).fill(!0),a=Array(e.headerCols??0).fill(!0),o=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let c=e.rows[s],l=[],u=i[s];for(let r=0;r<c.cells.length;r++){let i=c.cells[r],d=a[r],f=null,p=eS({row:s,col:r},{type:`table`,content:e}),m=o[p.col]?[o[p.col]]:null;if(i){if(typeof i==`string`)f=t.text(i);else if(cb(i)){i.content&&(f=gS(i.content,t,`tableParagraph`,n));let e=ub(i);e>1&&(m=Array(e).fill(!1).map((e,t)=>o[p.col+t]??void 0))}else f=gS(i,t,`tableParagraph`,n)}let h=t.nodes[d||u?`tableHeader`:`tableCell`].createChecked({...cb(i)?i.props:{},colwidth:m},t.nodes.tableParagraph.createChecked(void 0,f));l.push(h)}let d=t.nodes.tableRow.createChecked({},l);r.push(d)}return r}function vS(e,t,n){let r,i=e.type;if(i===void 0&&(i=`paragraph`),!t.nodes[i])throw Error(`node type ${i} not found in schema`);if(!e.content)r=t.nodes[i].createChecked(e.props);else if(typeof e.content==`string`){let a=gS([e.content],t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(Array.isArray(e.content)){let a=gS(e.content,t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(e.content.type===`tableContent`){let a=_S(e.content,t,n);r=t.nodes[i].createChecked(e.props,a)}else throw new fb(e.content.type);return r}function yS(e){if(e.isText)return e;let t=[];e.forEach(e=>t.push(yS(e)));let n=e.type.isInGroup(`bnBlock`)&&e.attrs.id===null;return e.type.create(n?{...e.attrs,id:rb.options.generateID()}:e.attrs,yr.from(t),e.marks)}function bS(e,t,n=zb(t)){let r=e.id;r===void 0&&(r=rb.options.generateID());let i=[];if(e.children)for(let r of e.children)i.push(bS(r,t,n));if(!e.type||t.nodes[e.type].isInGroup(`blockContent`)){let a=vS(e,t,n),o=i.length>0?by(t,i):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},o?[a,o]:a)}if(yy(t.nodes[e.type])){let n=t.nodes[e.type],a={id:r,...e.props},o=n.createAndFill(a,i);if(!o)throw Error(`Cannot create block "${e.type}": its children don't fit its \`children\` config (it accepts \`${n.spec.content}\`).`);return yS(o)}throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}var xS={gray:{text:`#9b9a97`,background:`#ebeced`},brown:{text:`#64473a`,background:`#e9e5e3`},red:{text:`#e03e3e`,background:`#fbe4e4`},orange:{text:`#d9730d`,background:`#f6e9d9`},yellow:{text:`#dfab01`,background:`#fbf3db`},green:{text:`#4d6461`,background:`#ddedea`},blue:{text:`#0b6e99`,background:`#ddebf1`},purple:{text:`#6940a5`,background:`#eae4f2`},pink:{text:`#ad1a72`,background:`#f4dfeb`}},SS={backgroundColor:{default:`default`},textColor:{default:`default`},textAlignment:{default:`left`,values:[`left`,`center`,`right`,`justify`]}},CS=e=>{let t={};return e.hasAttribute(`data-background-color`)?t.backgroundColor=e.getAttribute(`data-background-color`):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute(`data-text-color`)?t.textColor=e.getAttribute(`data-text-color`):e.style.color&&(t.textColor=e.style.color),t.textAlignment=SS.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},wS=(e,t)=>{e.backgroundColor&&e.backgroundColor!==SS.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in xS?xS[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==SS.textColor.default&&(t.style.color=e.textColor in xS?xS[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==SS.textAlignment.default&&(t.style.textAlign=e.textAlignment)},TS=(e=`backgroundColor`)=>({default:SS.backgroundColor.default,parseHTML:e=>e.hasAttribute(`data-background-color`)?e.getAttribute(`data-background-color`):e.style.backgroundColor?e.style.backgroundColor:SS.backgroundColor.default,renderHTML:t=>t[e]===SS.backgroundColor.default?{}:{"data-background-color":t[e]}}),ES=(e=`textColor`)=>({default:SS.textColor.default,parseHTML:e=>e.hasAttribute(`data-text-color`)?e.getAttribute(`data-text-color`):e.style.color?e.style.color:SS.textColor.default,renderHTML:t=>t[e]===SS.textColor.default?{}:{"data-text-color":t[e]}}),DS=(e,t)=>{let n=e.querySelector(t);if(n)return{targetElement:n,caption:e.querySelector(`figcaption`)?.textContent??void 0}},OS=k_(({editor:e})=>{let t=A_(void 0);function n(){t.setState(void 0)}return{key:`filePanel`,store:t,mount({signal:t}){let r=e.onChange(n,!1),i=e.onSelectionChange(n,!1);t.addEventListener(`abort`,()=>{r(),i()})},closeMenu:n,showMenu(e){t.setState(e)}}}),kS=(e,t,n)=>{let r=document.createElement(`div`);r.className=`bn-add-file-button`;let i=document.createElement(`div`);i.className=`bn-add-file-button-icon`,n?i.appendChild(n):i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,r.appendChild(i);let a=document.createElement(`p`);a.className=`bn-add-file-button-text`,a.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,r.appendChild(a);let o=e=>{e.preventDefault(),e.stopPropagation()},s=()=>{t.isEditable&&t.getExtension(OS)?.showMenu(e.id)};return r.addEventListener(`mousedown`,o,!0),r.addEventListener(`click`,s,!0),{dom:r,destroy:()=>{r.removeEventListener(`mousedown`,o,!0),r.removeEventListener(`click`,s,!0)}}},AS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,jS=e=>{let t=document.createElement(`div`);t.className=`bn-file-name-with-icon`;let n=document.createElement(`div`);n.className=`bn-file-icon`,n.innerHTML=AS,t.appendChild(n);let r=document.createElement(`p`);return r.className=`bn-file-name`,r.textContent=e.props.name,t.appendChild(r),{dom:t}},MS=(e,t,n,r)=>{let i=e.props.url!==``&&!!e.props.caption,a=document.createElement(i?`figure`:`div`);if(a.className=`bn-file-block-content-wrapper`,e.props.url===``){let n=kS(e,t,r);a.appendChild(n.dom);let i=t.onUploadStart(t=>{if(t===e.id){a.removeChild(n.dom);let e=document.createElement(`div`);e.className=`bn-file-loading-preview`,e.textContent=`Loading...`,a.appendChild(e)}});return{dom:a,destroy:()=>{i(),n.destroy()}}}let o={dom:a};if(e.props.showPreview===!1||!n){let t=jS(e);a.appendChild(t.dom),o.destroy=()=>{t.destroy?.()}}else a.appendChild(n.dom);if(e.props.caption){let t=document.createElement(`figcaption`);t.className=`bn-file-caption`,t.textContent=e.props.caption,a.appendChild(t)}return o},NS=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},PS=(e,t)=>{let n=document.createElement(`div`),r=document.createElement(`p`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},FS=e=>({url:e.src||void 0}),IS=Dx(e=>({type:`audio`,propSchema:{backgroundColor:SS.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0}},content:`none`})),LS=(e={})=>e=>{if(e.tagName===`AUDIO`){if(e.closest(`figure`))return;let{backgroundColor:t}=CS(e);return{...FS(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=DS(e,`audio`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=CS(e);return{...FS(n),backgroundColor:i,caption:r}}},RS=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>`;let i=document.createElement(`audio`);return i.className=`bn-audio`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable=`false`,i.draggable=!1,MS(t,n,{dom:i},r.firstElementChild)},zS=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`audio`)};let n;return e.props.showPreview?(n=document.createElement(`audio`),n.src=e.props.url):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?NS(n,e.props.caption):PS(n,e.props.caption):{dom:n}},BS=Ox(IS,e=>({meta:{fileBlockAccept:[`audio/*`]},parse:LS(e),render:RS(e),toExternalHTML:zS(e),runsBefore:[`file`]})),VS=e=>{{if(e.tagName!==`PRE`||e.childElementCount!==1||e.firstElementChild?.tagName!==`CODE`)return;let t=e.firstElementChild;return{language:t.getAttribute(`data-language`)||t.className.split(` `).find(e=>e.startsWith(`language-`))?.replace(`language-`,``)}}},HS=({el:e,schema:t},n)=>{let r=Ir.fromSchema(t),i=e.firstElementChild;return r.parse(i,{preserveWhitespace:`full`,topNode:t.nodes[n].create()}).content},US=e=>{let t=document.createElement(`pre`),n=document.createElement(`code`);return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}};function WS(e,t){let n=t.trim().toLowerCase();return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:t}])=>e.toLowerCase()===n||t?.some(e=>e.toLowerCase()===n))?.[0]}var GS=e=>(t,n)=>k_({key:t,keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:r}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:i}=t.selection;return!i.parent.textContent&&(e.removeBlocks([r]),!0)}),Tab:({editor:t})=>e.indentLineWithTab!==!1&&t.transact(e=>{let{block:r}=t.getTextCursorPosition();return r.type===n&&(e.insertText(` `),!0)}),Enter:({editor:e})=>e.transact(t=>{let{block:r,nextBlock:i}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:a}=t.selection,o=a.parentOffset===a.parent.nodeSize-2,s=a.parent.textContent.endsWith(`
|
|
187
|
-
|
|
188
|
-
`);if(o&&s){if(t.delete(a.pos-2,a.pos),i)return e.setTextCursorPosition(i,`start`),!0;let[n]=e.insertBlocks([{type:`paragraph`}],r,`after`);return e.setTextCursorPosition(n,`start`),!0}return t.insertText(`
|
|
189
|
-
`),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if(t.type!==n)return!1;let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);return e.setTextCursorPosition(r,`start`),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let r=t[1].trim();return{type:n,props:{language:{language:WS(e,r)??(r||e.defaultLanguage||`text`)}.language},content:[]}}}]}),KS=(e,t,n,r)=>{if(!(n in r))throw Error(`Language ${n} is not supported.`);let i=document.createElement(`select`);Object.entries(r).forEach(([e,{name:t}])=>{let n=document.createElement(`option`);n.value=e,n.text=t,i.appendChild(n)}),i.value=n;let a=n=>{t.isEditable&&t.updateBlock(e.id,{props:{language:n.target.value}})};t.isEditable?i.addEventListener(`change`,a):i.disabled=!0;let o=document.createElement(`div`);return o.contentEditable=`false`,o.appendChild(i),{dom:o,destroy:()=>i.removeEventListener(`change`,a)}},qS=(e,t,n)=>{let r=document.createElement(`pre`),i=document.createElement(`code`);r.appendChild(i);let a=document.createDocumentFragment(),o;return n&&Object.keys(n.supportedLanguages).length>1&&(o=KS(e,t,n.selectedLanguage,n.supportedLanguages),a.appendChild(o.dom)),a.appendChild(r),{dom:a,contentDOM:i,destroy:()=>{o?.destroy()}}},JS=`code-block-keyboard-shortcuts`,YS=Ox(Dx(({defaultLanguage:e=`text`})=>({type:`codeBlock`,propSchema:{language:{default:e}},content:`plain`})),e=>({meta:{code:!0,defining:!0,isolating:!1,highlight:e=>e.props.language},parse:e=>VS(e),parseContent:e=>HS(e,`codeBlock`),render:(t,n)=>qS(t,n,e.supportedLanguages&&{selectedLanguage:t.props.language,supportedLanguages:e.supportedLanguages}),toExternalHTML:e=>US(e)}),e=>[GS(e)(JS,`codeBlock`)]),XS=Ox(Dx(()=>({type:`divider`,propSchema:{},content:`none`})),{meta:{isolating:!1},parse(e){if(e.tagName===`HR`)return{}},render(){return{dom:document.createElement(`hr`)}}},[k_({key:`divider-block-shortcuts`,inputRules:[{find:RegExp(`^---$`),replace(){return{type:`divider`,props:{},content:[]}}}]})]),ZS=e=>({url:e.src||void 0}),QS=Ox(Dx(()=>({type:`file`,propSchema:{backgroundColor:SS.backgroundColor,name:{default:``},url:{default:``},caption:{default:``}},content:`none`})),{meta:{fileBlockAccept:[`*/*`]},parse:e=>{if(e.tagName===`EMBED`){if(e.closest(`figure`))return;let{backgroundColor:t}=CS(e);return{...ZS(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=DS(e,`embed`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=CS(e);return{...ZS(n),backgroundColor:i,caption:r}}},render(e,t){return MS(e,t)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`embed`)};let t=document.createElement(`a`);return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?PS(t,e.props.caption):{dom:t}}});function $S(e,t,n){let r=Ir.fromSchema(t),i=e.querySelector(`:scope > summary`),a;if(i){let e=i.cloneNode(!0);Sb(e),a=r.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else a=yr.empty;let o=document.createElement(`div`);o.setAttribute(`data-node-type`,`blockGroup`);let s=!1;for(let t of Array.from(e.childNodes))t.tagName!==`SUMMARY`&&(t.nodeType!==3||t.textContent?.trim())&&(s=!0,o.appendChild(t.cloneNode(!0)));let c=t.nodes[n].create({},a);if(!s)return c.content;let l=r.parse(o,{topNode:t.nodes.blockGroup.create()});return l.content.size>0?c.content.addToEnd(l):c.content}var eC={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?`true`:`false`),get:e=>window.localStorage.getItem(`toggle-${e.id}`)===`true`},tC=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>`;function nC(e){return eC.get(e)}function rC(e,t,n=eC){let r=document.createElement(`div`);r.className=`bn-toggle-wrapper bn-toggle-frame`;let i=document.createElement(`button`);i.className=`bn-toggle-button`,i.type=`button`,i.setAttribute(`aria-label`,t.dictionary.toggle_blocks.toggle_button),i.innerHTML=tC,i.addEventListener(`mousedown`,e=>e.preventDefault());let a=document.createElement(`div`);a.className=`bn-toggle-slot`;let o=document.createElement(`button`);o.className=`bn-toggle-add-block-button`,o.type=`button`,o.textContent=t.dictionary.toggle_blocks.add_block_button,o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>{t.transact(()=>{let n=t.updateBlock(e.id,{children:[{}]});t.setTextCursorPosition(n.children[0],`end`),t.focus()})}),r.append(i,a);let s=e.children.length,c=n.get(e);function l(){i.setAttribute(`aria-expanded`,String(c));let e=c&&s===0&&t.isEditable;e&&!o.isConnected?r.append(o):e||o.remove()}return i.addEventListener(`click`,()=>{c=!c,n.set(e,c),l()}),l(),{dom:r,slot:a,update(e){let t=e.children.length,r=c;return t>s&&(c=!0),c!==r&&n.set(e,c),s=t,l(),!0}}}var iC=[1,2,3,4,5,6];function aC(e,t){return t?{level:e,isToggleable:!1}:{level:e}}var oC=(e,t)=>({editor:n})=>{let r=n.getTextCursorPosition();return n.schema.blockSchema[r.block.type].content===`inline`&&(n.updateBlock(r.block,{type:`heading`,props:aC(e,t)}),!0)},sC=Ox(Dx(({defaultLevel:e=1,levels:t=iC,allowToggleHeadings:n=!0}={})=>({type:`heading`,propSchema:{...SS,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:`inline`})),({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1,dropsIntoChildren:t=>e&&t.props.isToggleable===!0},experimental_keyboard:e?e=>{if(!e.props.isToggleable)return{};let t=nC(e);return{resetsTo:{type:`heading`,props:{isToggleable:!1}},emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}}:void 0,parse(t){if(e&&t.tagName===`DETAILS`){let e=t.querySelector(`:scope > summary`);if(!e)return;let n=e.querySelector(`h1, h2, h3, h4, h5, h6`);return n?{...CS(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}let n;switch(t.tagName){case`H1`:n=1;break;case`H2`:n=2;break;case`H3`:n=3;break;case`H4`:n=4;break;case`H5`:n=5;break;case`H6`:n=6;break;default:return}return{...CS(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if(e.tagName===`DETAILS`)return $S(e,t,`heading`)}}:{},runsBefore:[`toggleListItem`],render(e){let t=document.createElement(`h${e.props.level}`);return{dom:t,contentDOM:t}},renderFrame(t,n){if(!e||!t.props.isToggleable)return;let r=rC(t,n);return{...r,update:e=>!!e.props.isToggleable&&r.update(e)}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(wS(t.props,n),e&&t.props.isToggleable){let e=document.createElement(`details`);e.setAttribute(`open`,``);let t=document.createElement(`summary`);return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=iC,allowToggleHeadings:t=!0}={})=>[k_({key:`heading-shortcuts`,keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,oC(e,t)])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace({match:e}){return{type:`heading`,props:aC(e[1].length,t)}}}))})]),cC=(e,t,n,r,i)=>{let{dom:a,destroy:o}=MS(e,t,n,i),s=a;s.style.position=`relative`,e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.style.width=`fit-content`);let c=document.createElement(`div`);c.className=`bn-resize-handle`,c.style.left=`4px`,c.style.display=`none`,r.appendChild(c);let l=document.createElement(`div`);l.className=`bn-resize-handle`,l.style.right=`4px`,l.style.display=`none`,r.appendChild(l);let u=document.createElement(`div`);u.style.position=`absolute`,u.style.height=`100%`,u.style.width=`100%`;let d,f=e.props.previewWidth,p=n=>{if(!d){t.isEditable||(c.style.display=`none`,l.style.display=`none`);return}let r,i=`touches`in n?n.touches[0].clientX:n.clientX;r=e.props.textAlignment===`center`?d.handleUsed===`left`?d.initialWidth+(d.initialClientX-i)*2:d.initialWidth+(i-d.initialClientX)*2:d.handleUsed===`left`?d.initialWidth+d.initialClientX-i:d.initialWidth+i-d.initialClientX,f=Math.min(Math.max(r,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),s.style.width=`${f}px`},m=n=>{n.target&&s.contains(n.target)&&t.isEditable||(c.style.display=`none`,l.style.display=`none`),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:f}}))},h=()=>{t.isEditable&&(c.style.display=``,l.style.display=``)},g=e=>{e.relatedTarget!==c&&e.relatedTarget!==l&&(d||t.isEditable&&(c.style.display=`none`,l.style.display=`none`))},_=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`left`,initialWidth:s.clientWidth,initialClientX:t}},v=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`right`,initialWidth:s.clientWidth,initialClientX:t}};return window.addEventListener(`mousemove`,p),window.addEventListener(`touchmove`,p),window.addEventListener(`mouseup`,m),window.addEventListener(`touchend`,m),s.addEventListener(`mouseenter`,h),s.addEventListener(`mouseleave`,g),c.addEventListener(`mousedown`,_),c.addEventListener(`touchstart`,_),l.addEventListener(`mousedown`,v),l.addEventListener(`touchstart`,v),{dom:s,destroy:()=>{o?.(),window.removeEventListener(`mousemove`,p),window.removeEventListener(`touchmove`,p),window.removeEventListener(`mouseup`,m),window.removeEventListener(`touchend`,m),s.removeEventListener(`mouseenter`,h),s.removeEventListener(`mouseleave`,g),c.removeEventListener(`mousedown`,_),c.removeEventListener(`touchstart`,_),l.removeEventListener(`mousedown`,v),l.removeEventListener(`touchstart`,v)}}},lC=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),uC=Dx((e={})=>({type:`image`,propSchema:{textAlignment:SS.textAlignment,backgroundColor:SS.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),dC=(e={})=>e=>{if(e.tagName===`IMG`){if(e.closest(`figure`))return;let{backgroundColor:t}=CS(e);return{...lC(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=DS(e,`img`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=CS(e);return{...lC(n),backgroundColor:i,caption:r}}},fC=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`img`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.alt=t.props.name||``,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),cC(t,n,{dom:i},i,r.firstElementChild)},pC=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`img`)};let n;return e.props.showPreview?(n=document.createElement(`img`),n.src=e.props.url,n.alt=e.props.name||``,e.props.previewWidth&&(n.width=e.props.previewWidth)):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?NS(n,e.props.caption):PS(n,e.props.caption):{dom:n}},mC=Ox(uC,e=>({meta:{fileBlockAccept:[`image/*`]},parse:dC(e),render:fC(e),toExternalHTML:pC(e),runsBefore:[`file`]}));function hC(e,t,n){let r=Ir.fromSchema(t),i=e,a=document.createElement(`div`);a.setAttribute(`data-node-type`,`blockGroup`);for(let e of Array.from(i.childNodes))a.appendChild(e.cloneNode(!0));let o=r.parse(a,{topNode:t.nodes.blockGroup.create()});o.firstChild?.firstChild?.type.name===`checkListItem`&&(o=o.copy(o.content.cut(o.firstChild.firstChild.nodeSize+2)));let s=o.firstChild?.firstChild;if(!s?.isTextblock)return yr.from(o);let c=t.nodes[n].create({},s.content),l=o.content.cut(s.nodeSize+2);if(l.size>0){let e=o.copy(l);return c.content.addToEnd(e)}return c.content}var gC=Ox(Dx(()=>({type:`bulletListItem`,propSchema:{...SS},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t===null||t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`||!e.closest(`ul, ol`))return CS(e)},parseContent:({el:e,schema:t})=>hC(e,t,`bulletListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return wS(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[k_({key:`bullet-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`bulletListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if(zy(e.prosemirrorState).blockNoteType!==`heading`)return{type:`bulletListItem`,props:{}}}}]})]),_C=Ox(Dx(()=>({type:`checkListItem`,propSchema:{...SS,checked:{default:!1,type:`boolean`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName===`input`)return e.closest(`[data-content-type]`)||e.closest(`li`)?void 0:e.type===`checkbox`?{checked:e.checked}:void 0;if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)){let t=e.querySelector(`input[type=checkbox]`)||null;return t===null?void 0:{...CS(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>hC(e,t,`checkListItem`),render(e,t){let n=document.createDocumentFragment(),r=document.createElement(`input`);r.type=`checkbox`,r.checked=e.props.checked,e.props.checked&&r.setAttribute(`checked`,``),r.disabled=!t.isEditable,r.addEventListener(`change`,()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let i=document.createElement(`p`),a=document.createElement(`div`);return a.contentEditable=`false`,a.appendChild(r),n.appendChild(a),n.appendChild(i),{dom:n,contentDOM:i}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`input`);n.type=`checkbox`,n.checked=e.props.checked,e.props.checked&&n.setAttribute(`checked`,``);let r=document.createElement(`p`);return wS(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:[`bulletListItem`]},[k_({key:`check-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`checkListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!1}}}},{find:/^\s?\[[Xx]\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!0}}}}]})]);function vC(e,t,n,r){let i=!!e.firstChild.attrs.start,a=Iy(e,t);if(!a.hasContent)throw Error(`impossible`);let o=n.doc.resolve(a.block.beforePos).nodeBefore,s=o?r.get(o):void 0;if(s!==void 0){let t=s+1;return r.set(e,t),{index:t,isFirst:!1,hasStart:i}}let c=[{node:e,pos:t}],l=o,u=a.block.beforePos;for(;l&&r.get(l)===void 0;){let e=Iy(l,u-l.nodeSize);if(e.blockNoteType!==`numberedListItem`)break;c.push({node:l,pos:u-l.nodeSize});let t=n.doc.resolve(e.block.beforePos).nodeBefore;u=e.block.beforePos,l=t}let d,f,p=c[c.length-1],m=Iy(p.node,p.pos);if(!m.hasContent)throw Error(`impossible`);let h=n.doc.resolve(m.block.beforePos).nodeBefore,g=h?r.get(h):void 0;g===void 0?(d=(p.node.firstChild.attrs.start||1)-1,f=!0):(d=g,f=!1);for(let e=c.length-1;e>=0;e--){let t=c[e];f&&e<c.length-1&&(f=!1),d++,r.set(t.node,d)}return{index:d,isFirst:c.length===1?f||g===void 0:!1,hasStart:i}}function yC(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),i=e.changedRange()??{from:0,to:e.doc.nodeSize-2},a=[],o=new Set;e.doc.nodesBetween(i.from,e.doc.nodeSize-2,(t,s,c)=>{if(c&&o.has(c))return!1;if(t.type.name===`blockContainer`&&t.firstChild.type.name===`numberedListItem`){let{index:l,isFirst:u,hasStart:d}=vC(t,s,e,n),f=e.doc.nodeAt(s+1);if(r.find(s+1,s+1+f.nodeSize,e=>e.index===l&&e.isFirst===u&&e.hasStart===d).length===0)a.push(Pr.node(s+1,s+1+f.nodeSize,{"data-index":l.toString()},{index:l,isFirst:u,hasStart:d}));else if(s>=i.to&&c)return o.add(c),!1}});let s=a.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(s).add(e.doc,a)}}var bC=Ox(Dx(()=>({type:`numberedListItem`,propSchema:{...SS,start:{default:void 0,type:`number`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`OL`||t.tagName===`DIV`&&t.parentElement?.tagName===`OL`)){let n=parseInt(t.getAttribute(`start`)||`1`),r=CS(e);return e.previousElementSibling||n===1?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>hC(e,t,`numberedListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return wS(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[k_({key:`numbered-list-item-shortcuts`,inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if(zy(t.prosemirrorState).blockNoteType===`heading`)return;let n=parseInt(e[1]);return{type:`numberedListItem`,props:{start:n===1?void 0:n}}}}],keyboardShortcuts:{"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`numberedListItem`,props:{}}),!0)}},prosemirrorPlugins:[new Nr({key:new Cr(`numbered-list-indexing-decorations`),state:{init(e,t){return yC(t.tr,{decorations:jr.empty})},apply(e,t){return!e.docChanged&&t.decorations?t:yC(e,t)}},props:{decorations(e){return this.getState(e)?.decorations??jr.empty}}})]})]),xC=Ox(Dx(()=>({type:`toggleListItem`,propSchema:{...SS},content:`inline`})),{experimental_keyboard:e=>{let t=nC(e);return{splitKeepsType:!0,emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}},meta:{isolating:!1,dropsIntoChildren:()=>!0},parse(e){if(e.tagName===`DETAILS`)return CS(e);if(e.tagName===`LI`){let t=e.parentElement;if(t&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)&&e.querySelector(`:scope > details`))return CS(e)}},parseContent:({el:e,schema:t})=>{let n=e.tagName===`DETAILS`?e:e.querySelector(`:scope > details`);if(!n)throw Error(`No details found in toggleListItem parseContent`);return $S(n,t,`toggleListItem`)},runsBefore:[`bulletListItem`],render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},renderFrame:rC,toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`details`);n.setAttribute(`open`,``);let r=document.createElement(`summary`),i=document.createElement(`p`);return r.appendChild(i),n.appendChild(r),wS(e.props,t),t.appendChild(n),{dom:t,contentDOM:i,childrenDOM:n}}},[k_({key:`toggle-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`toggleListItem`,props:{}}),!0)}}})]),SC=Ox(Dx(()=>({type:`paragraph`,propSchema:SS,content:`inline`})),{meta:{isolating:!1},parse:e=>{if(e.tagName===`P`&&e.textContent?.trim())return CS(e)},render:()=>{let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`p`);return wS(e.props,t),{dom:t,contentDOM:t}},runsBefore:[`default`,`heading`]},[k_({key:`paragraph-shortcuts`,keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`paragraph`,props:{}}),!0)}}})]),CC=Ox(Dx(()=>({type:`quote`,propSchema:{backgroundColor:SS.backgroundColor,textColor:SS.textColor},content:`inline`})),{meta:{isolating:!1},parse(e){if(e.tagName===`BLOCKQUOTE`){let{backgroundColor:t,textColor:n}=CS(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement(`blockquote`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`blockquote`);return wS(e.props,t),{dom:t,contentDOM:t}}},[k_({key:`quote-block-shortcuts`,keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`quote`,props:{}}),!0)}},inputRules:[{find:RegExp(`^>\\s$`),replace(){return{type:`quote`,props:{}}}},{find:RegExp(`^\\p{Quotation_Mark}\\s$`,`u`),replace(){return{type:`quote`,props:{}}}}]})]),wC=Rt.create({name:`BlockNoteTableExtension`,addProseMirrorPlugins:()=>[ny({cellMinWidth:35,defaultCellMinWidth:120,View:null}),gy()],addKeyboardShortcuts(){return{Enter:()=>K_(this.editor.state)?this.editor.commands.command(({state:e,dispatch:t})=>{let n=q_(e),r=n?Q_(n,`vert`,1):null;return r&&t&&t(e.tr.setSelection(wr.between(r,X_(r))).scrollIntoView()),!0}):!1,Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,r=e.$head.node().type.name===`tableParagraph`;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>K_(e)?(Nv(1)(e,t,n),!0):!1),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>K_(e)?(Nv(-1)(e,t,n),!0):!1)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Ct(Bt(e,`tableRole`,t))}}}),TC={textColor:SS.textColor},EC=Pt.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return wb(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getContent:(e,t)=>jC(e,t)}]},renderHTML({HTMLAttributes:e}){return[`th`,en(this.options.HTMLAttributes,e),0]}}),DC=Pt.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return wb(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getContent:(e,t)=>jC(e,t)}]},renderHTML({HTMLAttributes:e}){return[`td`,en(this.options.HTMLAttributes,e),0]}}),OC=Pt.create({name:`table`,content:`tableRow+`,group:`blockContent`,tableRole:`table`,marks(){return wb(this.editor)},isolating:!0,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let n=bb(this.name,`table`,{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),r=document.createElement(`colgroup`);for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement(`col`);e&&(t.style=`width: ${e}px`),r.appendChild(t)}else r.appendChild(document.createElement(`col`));return n.dom.firstChild?.appendChild(r),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends $v{node;cellMinWidth;blockContentHTMLAttributes;constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement(`div`);r.className=gb(`bn-block-content`,n.class),r.setAttribute(`data-content-type`,`table`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);let i=this.dom,a=document.createElement(`div`);a.className=`tableWrapper-inner`,a.appendChild(i.firstChild),i.appendChild(a),r.appendChild(i);let o=document.createElement(`div`);o.className=`table-widgets-container`,o.style.position=`relative`,i.appendChild(o),this.dom=r}ignoreMutation(e){return!e.target.closest(`.tableWrapper-inner`)||super.ignoreMutation(e)}update(e){return super.update(e)?(Nb(this.dom,e.attrs,TC),!0):!1}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),kC=Pt.create({name:`tableParagraph`,group:`tableContent`,content:`inline*`,parseHTML(){return[{tag:`p`,getAttrs:e=>{if(typeof e==`string`||!e.textContent||!e.closest(`[data-content-type]`))return!1;let t=e.parentElement;return t===null?!1:t.tagName===`TD`||t.tagName===`TH`?{}:!1},node:`tableParagraph`}]},renderHTML({HTMLAttributes:e}){return[`p`,e,0]}}),AC=Pt.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)+`,tableRole:`row`,marks(){return wb(this.editor)},parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,en(this.options.HTMLAttributes,e),0]}});function jC(e,t){let n=Ir.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),yr.fromArray(r)}var MC=()=>_x({node:OC,type:`table`,content:`table`},TC,[k_({key:`table-extensions`,tiptapExtensions:[wC,kC,EC,DC,AC]}),k_({key:`table-keyboard-delete`,keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof nv))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if(`type`in t&&t.content.length>0||!(`type`in t)&&t.length>0)return!1;r++}let i=0;return e.prosemirrorState.selection.forEachCell(()=>{i++}),i<r?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),NC=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.getAttribute(`data-name`)||void 0}),PC=Dx(e=>({type:`video`,propSchema:{textAlignment:SS.textAlignment,backgroundColor:SS.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),FC=e=>e=>{if(e.tagName===`VIDEO`){if(e.closest(`figure`))return;let{backgroundColor:t}=CS(e);return{...NC(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=DS(e,`video`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=CS(e);return{...NC(n),backgroundColor:i,caption:r}}},IC=Ox(PC,e=>({meta:{fileBlockAccept:[`video/*`]},parse:FC(e),render(t,n){let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`video`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.controls=!0,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),cC(t,n,{dom:i},i,r.firstElementChild)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`video`)};let t;return e.props.showPreview?(t=document.createElement(`video`),t.src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):(t=document.createElement(`a`),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?NS(t,e.props.caption):PS(t,e.props.caption):{dom:t}},runsBefore:[`file`]}));function LC(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,i]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof i==`string`){if(e.schema.blockSpecs[t].config.propSchema[r].default!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==i||e.schema.blockSpecs[t].config.propSchema[r].type!==void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==i.default||e.schema.blockSpecs[t].config.propSchema[r].default===void 0&&i.default===void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof i.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[r].values==`object`&&typeof i.values==`object`){for(let n of i.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function RC(e,t,n,r){return LC(t,n,r)&&e.type===n}function zC(e){return e instanceof nv}function BC(e){let t=e.type.spec.tableRole;return t===`cell`||t===`header_cell`}var VC={1:`heading`,2:`heading_2`,3:`heading_3`,4:`heading_4`,5:`heading_5`,6:`heading_6`},HC={1:`toggle_heading`,2:`toggle_heading_2`,3:`toggle_heading_3`};function UC(e){let t=[];if(LC(e,`paragraph`)&&t.push({key:`paragraph`,type:`paragraph`}),LC(e,`heading`,{level:`number`})){let n=e.schema.blockSchema.heading.propSchema.level.values,r=LC(e,`heading`,{level:`number`,isToggleable:`boolean`});for(let e of[1,2,3,4,5,6])n?.includes(e)&&t.push({key:VC[e],type:`heading`,props:r?{level:e,isToggleable:!1}:{level:e}});if(r)for(let e of[1,2,3])n?.includes(e)&&t.push({key:HC[e],type:`heading`,props:{level:e,isToggleable:!0}})}for(let[n,r]of[[`quote`,`quote`],[`toggle_list`,`toggleListItem`],[`bullet_list`,`bulletListItem`],[`numbered_list`,`numberedListItem`],[`check_list`,`checkListItem`]])LC(e,r)&&t.push({key:n,type:r});return t}var WC=k_(({editor:e})=>{let t=A_(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof wr&&e.doc.textBetween(e.selection.from,e.selection.to).length===0)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.content===`text*`&&(t=!0),!t)),!t});return{key:`formattingToolbar`,store:t,mount({dom:r,signal:i}){let a=!1,o=!1,s=e.onChange(()=>{a||o||t.setState(n())}),c=e.onSelectionChange(()=>{a||o||t.setState(n())}),l=e.onFocusChange((r,{focused:i})=>{i?a||o||e.isFocused()&&t.setState(n()):t.setState(!1)},{includeEditorUI:!0});r.addEventListener(`pointerdown`,()=>{a=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`pointerup`,()=>{a=!1,e.isFocused()&&t.setState(n())},{signal:i,capture:!0}),r.addEventListener(`pointercancel`,()=>{a=!0},{signal:i,capture:!0}),e.prosemirrorView.root.addEventListener(`dragstart`,()=>{o=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`dragend`,()=>{o=!1},{signal:i}),i.addEventListener(`abort`,()=>{s(),c(),l()})}}});function GC(e,t,n=`left`){let r=e.getExtension(`yPositionMapping`);if(r)return r.mapPosition(t,n);let i=e.getExtension(`positionMapping`);if(i)return i.mapPosition(t,n);throw Error(`No position mapping extension found`)}var KC=kt(e=>e.type.name===`blockContainer`),qC=class{editor;state;emitUpdate;rootEl;pluginState;constructor(e,t,n){this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error(`Attempting to update uninitialized suggestions menu`);t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,this.rootEl?.addEventListener(`scroll`,this.handleScroll,!0)}handleScroll=e=>{if(this.state?.show){let t=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!t||e.target instanceof Node&&!e.target.contains(t))return;this.state.referencePos=t.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}};update(e,t){let n=JC.getState(t),r=JC.getState(e.state),i=n===void 0&&r!==void 0,a=n!==void 0&&r===void 0;if(!i&&(n===void 0||r===void 0)&&!a)return;if(this.pluginState=a?n:r,a||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let o=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&o&&(this.state={show:!0,referencePos:o.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){this.rootEl?.removeEventListener(`scroll`,this.handleScroll,!0)}closeMenu=()=>{this.editor.transact(e=>e.setMeta(JC,null))};clearQuery=()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()}},JC=new Cr(`SuggestionMenuPlugin`),YC=k_(({editor:e})=>{let t=new Map,n,r=A_(void 0);return{key:`suggestionMenu`,store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n?.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(JC,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new Nr({key:JC,view:t=>(n=new qC(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),n),state:{init(){},apply:(t,r,i,a)=>{if(t.selection.$from.parent.type.spec.code)return r;let o=t.getMeta(JC);if(typeof o==`object`&&o){r&&n?.closeMenu();let t=GC(e,a.selection.from-o.triggerCharacter.length);return{triggerCharacter:o.triggerCharacter,deleteTriggerCharacter:o.deleteTriggerCharacter!==!1,queryStartPos:()=>t()+o.triggerCharacter.length,query:``,decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:o?.ignoreQueryLength}}if(r===void 0)return r;if(a.selection.from!==a.selection.to||o===null||t.getMeta(`focus`)||t.getMeta(`blur`)||t.getMeta(`pointer`)||r.triggerCharacter!==void 0&&a.selection.from<r.queryStartPos()||!a.selection.$from.sameParent(a.doc.resolve(r.queryStartPos())))return;let s={...r};return s.query=a.doc.textBetween(r.queryStartPos(),a.selection.from),s}},props:{handleTextInput(e,n,r,i){let a=e.state.doc,o=[...t.entries()].sort(([e],[t])=>t.length-e.length);for(let[t,r]of o){let o=a.textBetween(Math.max(0,n-(t.length-i.length)),n)+i;if(t===o){if(r.shouldOpen&&!r.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(i)),e.dispatch(e.state.tr.setMeta(JC,{triggerCharacter:o}).scrollIntoView()),!0}}return!1},decorations(e){let t=this.getState(e);if(t===void 0)return null;if(!t.deleteTriggerCharacter){let n=KC(e.selection);if(n)return jr.create(e.doc,[Pr.node(n.pos,n.pos+n.node.nodeSize,{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}return jr.create(e.doc,[Pr.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}}})]}});function XC(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n===`none`;){if(t=e.getTextCursorPosition().nextBlock,t===void 0){let t=e.document[e.document.length-1],n=e.insertBlocks([{type:`paragraph`}],t,`after`)[0];e.setTextCursorPosition(n,`end`);return}n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,`end`)}}function ZC(e,t){let n=e.getTextCursorPosition().block;if(n.content===void 0)throw Error(`Slash Menu open in a block that doesn't contain content.`);let r;return Array.isArray(n.content)&&(n.content.length===1&&ob(n.content[0])&&n.content[0].type===`text`&&n.content[0].text===`/`||n.content.length===0)?(r=e.updateBlock(n,t),e.setTextCursorPosition(r)):(r=e.insertBlocks([t],n,`after`)[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),XC(e),r}function QC(e){let t=[],n=new Map(UC(e).map(e=>[e.key,e]));function r(r,i){let a=n.get(r);a&&t.push({onItemClick:()=>{ZC(e,{type:a.type,props:a.props})},badge:i,key:r,...e.dictionary.slash_menu[r]})}return r(`heading`,hb(`Mod-Alt-1`)),r(`heading_2`,hb(`Mod-Alt-2`)),r(`heading_3`,hb(`Mod-Alt-3`)),r(`quote`),r(`toggle_list`,hb(`Mod-Shift-6`)),r(`numbered_list`,hb(`Mod-Shift-7`)),r(`bullet_list`,hb(`Mod-Shift-8`)),r(`check_list`,hb(`Mod-Shift-9`)),r(`paragraph`,hb(`Mod-Alt-0`)),LC(e,`codeBlock`)&&t.push({onItemClick:()=>{ZC(e,{type:`codeBlock`})},badge:hb(`Mod-Alt-c`),key:`code_block`,...e.dictionary.slash_menu.code_block}),LC(e,`divider`)&&t.push({onItemClick:()=>{ZC(e,{type:`divider`})},key:`divider`,...e.dictionary.slash_menu.divider}),LC(e,`table`)&&t.push({onItemClick:()=>{ZC(e,{type:`table`,content:{type:`tableContent`,rows:[{cells:[``,``,``]},{cells:[``,``,``]}]}})},badge:void 0,key:`table`,...e.dictionary.slash_menu.table}),LC(e,`image`,{url:`string`})&&t.push({onItemClick:()=>{let t=ZC(e,{type:`image`});e.getExtension(OS)?.showMenu(t.id),e.getExtension(WC)?.store.setState(!1)},key:`image`,...e.dictionary.slash_menu.image}),LC(e,`video`,{url:`string`})&&t.push({onItemClick:()=>{let t=ZC(e,{type:`video`});e.getExtension(OS)?.showMenu(t.id),e.getExtension(WC)?.store.setState(!1)},key:`video`,...e.dictionary.slash_menu.video}),LC(e,`audio`,{url:`string`})&&t.push({onItemClick:()=>{let t=ZC(e,{type:`audio`});e.getExtension(OS)?.showMenu(t.id),e.getExtension(WC)?.store.setState(!1)},key:`audio`,...e.dictionary.slash_menu.audio}),LC(e,`file`,{url:`string`})&&t.push({onItemClick:()=>{let t=ZC(e,{type:`file`});e.getExtension(OS)?.showMenu(t.id),e.getExtension(WC)?.store.setState(!1)},key:`file`,...e.dictionary.slash_menu.file}),r(`toggle_heading`),r(`toggle_heading_2`),r(`toggle_heading_3`),r(`heading_4`,hb(`Mod-Alt-4`)),r(`heading_5`,hb(`Mod-Alt-5`)),r(`heading_6`,hb(`Mod-Alt-6`)),t.push({onItemClick:()=>{e.getExtension(YC)?.openSuggestionMenu(`:`,{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:`emoji`,...e.dictionary.slash_menu.emoji}),t}function $C(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length!==0)}var ew={audio:BS(),bulletListItem:gC(),checkListItem:_C(),codeBlock:YS(),divider:XS(),file:QS(),heading:sC(),image:mC(),numberedListItem:bC(),paragraph:SC(),quote:CC(),table:MC(),toggleListItem:xC(),video:IC()},tw=zx({type:`textColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==SS.textColor.default&&(t.style.color=e in xS?xS[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.color)return e.style.color}}),nw=zx({type:`backgroundColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==SS.backgroundColor.default&&(t.style.backgroundColor=e in xS?xS[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.backgroundColor)return e.style.backgroundColor}}),rw={bold:Ix(Lt,`boolean`),italic:Ix(ln,`boolean`),underline:Ix(Qt,`boolean`),strike:Ix(Yt,`boolean`),code:Ix(Ut.extend({excludes(){return S_(this.editor)},addInputRules(){return[Kt({find:/(^|[^`])`([^`]+)`(?!`)$/,type:this.type}),new Et({find:/(^|[^`])`([^`]+)`(?!`) $/,handler:({state:e,range:t,match:n})=>{let{tr:r,schema:i}=e,a=n[1],o=n[2];r.replaceWith(t.from+a.length,t.to,[i.text(o,[this.type.create()]),i.text(` `)])}})]}}),`boolean`),textColor:tw,backgroundColor:nw};Lx(rw);var iw={text:{config:`text`,implementation:{}},link:{config:`link`,implementation:{}}},aw=Mx(iw),ow=class e extends Zx{static create(t){return new e({blockSpecs:t?.blockSpecs??ew,inlineContentSpecs:t?.inlineContentSpecs??iw,styleSpecs:t?.styleSpecs??rw})}},sw=new Cr(`blocknote-show-selection`),cw=k_(({editor:e})=>{let t=A_({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(sw,{}))}});return{key:`showSelection`,store:t,prosemirrorPlugins:[new Nr({key:sw,props:{decorations:e=>{let{doc:n,selection:r}=e;if(t.state.enabledSet.size===0)return jr.empty;let i=Pr.inline(r.from,r.to,{"data-show-selection":`true`});return jr.create(n,[i])}}})],showSelection(e,n){t.setState({enabledSet:e?new Set([...t.state.enabledSet,n]):new Set([...t.state.enabledSet].filter(e=>e!==n))})}}});function lw(e){if(!e)throw Error(`resolveUsers is required to create a user store`);let t=A_(new Map),n=new Set,r={store:t,async loadUsers(e){await i(e.filter(e=>!t.state.has(e)&&!n.has(e)))},async refetchUsers(e){await i(e.filter(e=>!n.has(e)))},getUser(e){return t.state.get(e)},setUser(e){let n=Array.isArray(e)?e:[e];t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}};async function i(i){if(i.length!==0){for(let e of i)n.add(e);try{let n=await e(i,r);n.length>0&&t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}finally{for(let e of i)n.delete(e)}}}return r}function uw(e){return typeof e==`function`?lw(e):e??lw(async()=>[])}var dw=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),fw=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,i],a)=>{if(a<0)return;let o=r.mapResult(a),s=t.doc.nodeAt(o.pos);if(o.deleted||!s?.eq(e))n.remove(a);else if(a!==o.pos){let e=i.map(e=>e.map(r,0,0)).filter(e=>e!=null);n.replace(a,o.pos,s,e)}}),n}};function pw({parser:e,nodeTypes:t=[`code_block`,`codeBlock`],languageExtractor:n=e=>e.attrs.language}){let r=new Cr(`prosemirror-highlight`);return new Nr({key:r,state:{init(r,i){let a=new fw,[o,s]=mw(i.doc,e,t,n,a);return{cache:a,decorations:o,promises:s}},apply:(r,i)=>{let a=i.cache.invalidate(r),o=!!r.getMeta(`prosemirror-highlight-refresh`);if(!r.docChanged&&!o)return{cache:a,decorations:i.decorations?.map(r.mapping,r.doc),promises:i.promises};let[s,c]=mw(r.doc,e,t,n,a);return{cache:a,decorations:s,promises:c}}},view:e=>{let t=new Set,n=()=>{if(t.size>0||e.isDestroyed)return;let n=e.state.tr.setMeta(`prosemirror-highlight-refresh`,!0);e.dispatch(n)},i=()=>{let i=r.getState(e.state);for(let e of i?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(n=>{console.error(`[prosemirror-highlight] Error resolving parser:`,n),t.delete(e)})};return i(),{update:()=>{i()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}function mw(e,t,n,r,i){let a=[],o=[],s=hw(e,n);try{for(let[e,n]of s){let s=r(e),c=i.get(n);if(c){let[e,t]=c;t.length>0&&a.push(t)}else{let r=t({content:e.textContent,language:s||void 0,pos:n,size:e.nodeSize});r&&Array.isArray(r)?(i.set(n,e,r),r.length>0&&a.push(r)):r instanceof Promise?(i.remove(n),o.push(r)):console.error(`[prosemirror-highlight] Invalid parser result:`,r)}}}catch(e){console.error(`[prosemirror-highlight] Error parsing code blocks:`,e)}return[a.length>0?jr.create(e,a.flat()):void 0,o]}function hw(e,t){let n=[];return e.descendants((e,r)=>{if(e.type.inlineContent&&t.includes(e.type.name))return n.push([e,r]),!1}),n}function gw(e,t){return function({content:n,language:r,pos:i,size:a}){let o=[],{tokens:s,fg:c,bg:l,rootStyle:u}=e.codeToTokens(n,{lang:r,...t??{theme:e.getLoadedThemes()[0]}}),d=u||(c&&l?`--prosemirror-highlight:${c};--prosemirror-highlight-bg:${l}`:``);if(d){let e=Pr.node(i,i+a,{style:d});o.push(e)}let f=i+1;for(let e of s){for(let t of e){let e=f+t.content.length,n=Pr.inline(f,e,{style:_w(t.htmlStyle??`color: ${t.color}`),class:`shiki`});o.push(n),f=e}f+=1}return o}}function _w(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var vw=e(dw(),1);function yw(e,t){let n,r;if(t.firstChild.descendants((i,a)=>n?!1:!bw(i)||!i.attrs.id||Py(i,t)!==e||(n=i,r=a+1,!1)),n!==void 0&&r!==void 0)return{node:n,posBeforeNode:r}}function bw(e){return e.type.isInGroup(`bnBlock`)}var xw=`[data-node-type][data-id]:not([data-node-type="blockOuter"])`;function Sw(e,t){if(!t.dom.contains(e))return;let n=e.closest(`.bn-editor`);if(n&&n!==t.dom)return;let r=e.closest(xw);return r&&r!==t.dom&&t.dom.contains(r)?r:void 0}function Cw(e,t,n){let r=e.nodeDOM(t);if(!(r instanceof Element))return;let i=r.matches(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)?r:r.querySelector(xw);return i?.getAttribute(`data-id`)===n?i:void 0}function ww(e,t){let n=Sw(e,t);if(!n)return;let r=n.getAttribute(`data-id`),i=n.getAttribute(`data-node-type`),a=i===`blockContainer`?n.querySelector(`[data-content-type]`)?.getAttribute(`data-content-type`):i,o=n.ownerDocument.defaultView?.HTMLElement;if(!o||!(n instanceof o)||!r||!a)throw Error(`Block root is missing its HTML element, ID, or block type.`);return{node:n,id:r,type:a}}function Tw(e,t,n){let r=ww(e,t);for(;r;){if(n(r.type))return r;let e=r.node.parentElement;r=e?ww(e,t):void 0}}function Ew(e){let t=e.closest(`.bn-editor`),n=[];for(let r of e.querySelectorAll(xw))r.parentElement?.closest(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)===e&&r.closest(`.bn-editor`)===t&&n.push(r);return n}function Dw(e){let t=Array.from(e.classList).filter(e=>!e.startsWith(`bn-`))||[];t.length>0?e.className=t.join(` `):e.removeAttribute(`class`)}function Ow(e,t,n,r){let i;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)i=gS([t],e.pmSchema,r?.blockType);else if(Array.isArray(t))i=gS(t,e.pmSchema,r?.blockType);else if(t.type===`tableContent`)i=_S(t,e.pmSchema);else throw new fb(t.type);let a=(r?.document??document).createDocumentFragment();for(let t of i)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let o=Gb(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=i.toExternalHTML?i.toExternalHTML(o,e):i.render.call({renderType:`dom`,props:void 0},o,()=>{},e);if(s){if(a.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,r);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=xr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}a.appendChild(n)}else{let e=n.serializeFragment(yr.from([t]),r);a.appendChild(e)}return a.childNodes.length===1&&a.firstChild?.nodeType===1&&Dw(a.firstChild),a}function kw(e,t,n,r,i){let a=e.toExternalHTML?.call({},t,n,{nestingLevel:i});if(a)return{output:a};let o=ex(n,t);if(r){if(!o)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return{output:{dom:o.dom,childrenDOM:o.slot}}}if(!e.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);return{output:e.render.call({},t,n),frame:o}}function Aw(e,t,n,r,i,a,o,s){let c=s?.document??document,l=t.pmSchema.nodes.blockContainer,u=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))!(e in u)&&r.default!==void 0&&(u[e]=r.default);let d=l.spec?.toDOM?.(l.create({id:n.id,...u})),f=Array.from(d.dom.attributes),p=t.blockImplementations[n.type].implementation,m={...n,props:u,children:n.children??[]},h=yy(t.pmSchema.nodes[n.type]),{output:g,frame:_}=kw(p,m,t,h,o),v=c.createDocumentFragment(),y;if(mx(g.dom)||(y=g.dom),y?.classList.contains(`bn-block-content`)){let e=[...f,...Array.from(y.attributes)].filter(e=>e.name.startsWith(`data`)&&e.name!==`data-content-type`&&e.name!==`data-file-block`&&e.name!==`data-node-view-wrapper`&&e.name!==`data-node-type`&&e.name!==`data-id`&&e.name!==`data-editable`);for(let t of e)y.firstChild.setAttribute(t.name,t.value);Dw(y.firstChild),o>0&&y.firstChild.setAttribute(`data-nesting-level`,o.toString()),v.append(...Array.from(y.childNodes))}else v.append(g.dom),h&&(y?.removeAttribute(`data-node-type`),y?.removeAttribute(`data-id`),g.childrenDOM?.removeAttribute(`data-frame-slot`)),o>0&&y?.setAttribute(`data-nesting-level`,o.toString());if(g.contentDOM){if(n.content){let e=Ow(t,n.content,r,{...s,blockType:n.type});g.contentDOM.appendChild(e)}let e=t.pmSchema.nodes[n.type];e?.inlineContent&&!e.spec.code&&g.contentDOM.childNodes.length===0&&g.contentDOM.appendChild(c.createTextNode(``))}let b=g.childrenDOM;_&&(_.slot.append(v),v.append(_.dom),b=_.slot);let x;if(i.has(n.type)?x=`OL`:a.has(n.type)&&(x=`UL`),x){if(e.lastChild?.nodeName!==x){let t=c.createElement(x);x===`OL`&&`start`in u&&u.start&&u?.start!==1&&t.setAttribute(`start`,String(u.start)),e.append(t)}e.lastChild.appendChild(v)}else e.append(v);if(n.children&&n.children.length>0){let l=c.createDocumentFragment();if(jw(l,t,n.children,r,i,a,o+1,s),e.lastChild?.nodeName===`UL`||e.lastChild?.nodeName===`OL`)for(;l.firstChild?.nodeName===`UL`||l.firstChild?.nodeName===`OL`;)e.lastChild.lastChild.appendChild(l.firstChild);b?b.append(l):t.pmSchema.nodes[n.type].isInGroup(`blockContent`)||!g.contentDOM?e.append(l):g.contentDOM.append(l)}}var jw=(e,t,n,r,i,a,o=0,s)=>{for(let c of n)Aw(e,t,c,r,i,a,o,s)},Mw=(e,t,n,r,i,a)=>{let o=(a?.document??document).createDocumentFragment();return jw(o,e,t,n,r,i,0,a),o},Nw=(e,t)=>{let n=xr.fromSchema(e);return{exportBlocks:(e,r)=>{let i=Mw(t,e,n,new Set([`numberedListItem`]),new Set([`bulletListItem`,`checkListItem`,`toggleListItem`]),r),a=document.createElement(`div`);return a.append(i),a.innerHTML},exportInlineContent:(e,r)=>{let i=Ow(t,e,n,r),a=document.createElement(`div`);return a.append(i.cloneNode(!0)),a.innerHTML}}};function Pw(e){let{mapping:t,steps:n}=e,r=1/0,i=-1/0;for(let e=0;e<t.maps.length;e++){let a=t.maps[e];e&&(r=a.map(r,1),i=a.map(i,-1));let o=!1;if(a.forEach((e,t,n,a)=>{o=!0,r=Math.min(r,n),i=Math.max(i,a)}),!o){let t=n[e];typeof t.pos==`number`?(r=Math.min(r,t.pos),i=Math.max(i,t.pos+1)):typeof t.from==`number`&&typeof t.to==`number`&&(r=Math.min(r,t.from),i=Math.max(i,t.to))}}return r===1/0?null:{from:r,to:i}}function Fw(e,t){if(t===0)return;let n=e.resolve(t);for(let t=n.depth;t>0;t--){let r=n.node(t);if(bw(r))return Py(r,e)}}function Iw(e){return e.getMeta(`paste`)?{type:`paste`}:e.getMeta(`uiEvent`)===`drop`?{type:`drop`}:e.getMeta(`history$`)?{type:e.getMeta(`history$`).redo?`redo`:`undo`}:e.getMeta(`y-sync$`)?e.getMeta(`y-sync$`).isUndoRedoOperation?{type:`undo-redo`}:{type:`yjs-remote`}:{type:`local`}}function Lw(e,t){let n={},r={},i=Math.max(0,Math.min(t.from,e.content.size)),a=Math.max(i,Math.min(t.to,e.content.size));return e.nodesBetween(i,a,(t,i)=>{if(!bw(t))return!0;let a=Fw(e,i),o=a??`__root__`;r[o]||(r[o]=[]);let s=Kb(t,e),c=Py(t,e);return n[c]={block:s,parentId:a},r[o].push(c),!0}),{byId:n,childrenByParent:r}}function Rw(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),i=t.filter(e=>r.has(e)),a=e.filter(e=>i.includes(e));if(a.length<=1||i.length<=1)return n;let o={};for(let e=0;e<a.length;e++)o[a[e]]=e;let s=i.map(e=>o[e]),c=s.length,l=[],u=[],d=Array(c).fill(-1),f=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n};for(let e=0;e<c;e++){let t=s[e],n=f(l,t);n>0&&(d[e]=u[n-1]),n===l.length?(l.push(t),u.push(e)):(l[n]=t,u[n]=e)}let p=new Set,m=u[u.length-1]??-1;for(;m!==-1;)p.add(m),m=d[m];for(let e=0;e<i.length;e++)p.has(e)||n.add(i[e]);return n}function zw(e,t=[]){let n=Iw(e),r=Jy(e.before,[e,...t]),i=Pw(r);if(!i)return[];let a=r.mapping.invert(),o={from:a.map(i.from,-1),to:a.map(i.to,1)},s=Lw(r.before,o),c=Lw(r.doc,i),l=[],u=new Set;Object.keys(c.byId).filter(e=>!(e in s.byId)).forEach(e=>{l.push({type:`insert`,block:c.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(s.byId).filter(e=>!(e in c.byId)).forEach(e=>{l.push({type:`delete`,block:s.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(c.byId).filter(e=>e in s.byId).forEach(e=>{let t=s.byId[e],r=c.byId[e];t.parentId===r.parentId?(0,vw.default)({...t.block,children:void 0},{...r.block,children:void 0})||(l.push({type:`update`,block:r.block,prevBlock:t.block,source:n}),u.add(e)):(l.push({type:`move`,block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?s.byId[t.parentId]?.block:void 0,currentParent:r.parentId?c.byId[r.parentId]?.block:void 0}),u.add(e))});let d=s.childrenByParent,f=c.childrenByParent,p=new Set([...Object.keys(d),...Object.keys(f)]),m=new Set;return p.forEach(e=>{let t=Rw(d[e],f[e]);t.size!==0&&t.forEach(t=>{let r=s.byId[t],i=c.byId[t];r&&i&&r.parentId===i.parentId&&(u.has(t)||(r.parentId??`__root__`)===e&&(m.has(t)||(m.add(t),l.push({type:`move`,block:i.block,prevBlock:r.block,source:n,prevParent:r.parentId?s.byId[r.parentId]?.block:void 0,currentParent:i.parentId?c.byId[i.parentId]?.block:void 0}),u.add(t))))})}),l}var Bw=k_(()=>{let e=[];return{key:`blockChange`,prosemirrorPlugins:[new Nr({key:new Cr(`blockChange`),filterTransaction:t=>{let n;return e.reduce((e,r)=>e===!1?e:r({getChanges(){return n||(n=zw(t),n)},tr:t})!==!1,!0)}})],subscribe(t){return e.push(t),()=>{e.splice(e.indexOf(t),1)}}}});function Vw(e,t){return!e||!t?!1:!!e.closest(`.${t}`)}function Hw(e,t,n,r,i){let a=e.state.doc.resolve(t.pos);if(a.parent.inlineContent||t.orientation===`inline`)return null;let o=a.nodeBefore,s=a.nodeAfter;if(!o&&!s)return null;let c=t.orientation===`block-vertical-left`||t.orientation===`block-vertical-right`,l=c?t.pos:t.pos-(o?o.nodeSize:0),u=e.nodeDOM(l);if(!u)return null;let d=u.getBoundingClientRect();if(c){let e=n/2*r,i=t.orientation===`block-vertical-left`?d.left:d.right;return{left:i-e,right:i+e,top:d.top,bottom:d.bottom}}let f=o?d.bottom:d.top;o&&s&&(f=(f+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let p=n/2*i;return{left:d.left,right:d.right,top:f-p,bottom:f+p}}function Uw(e,t,n,r){let i=e.coordsAtPos(t.pos),a=n/2*r;return{left:i.left-a,right:i.left+a,top:i.top,bottom:i.bottom}}function Ww(e,t){e.classList.toggle(`prosemirror-dropcursor-inline`,t===`inline`),e.classList.toggle(`prosemirror-dropcursor-block-horizontal`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-left`,t===`block-vertical-left`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-right`,t===`block-vertical-right`),e.classList.toggle(`prosemirror-dropcursor-block`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-vertical`,t===`block-vertical-left`||t===`block-vertical-right`)}function Gw(e){if(!e||e===document.body&&getComputedStyle(e).position===`static`)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}function Kw(e){let t=[];function n(e,r){let i=e.type.spec.blockConfig?.children,a=e.type.name===`blockContainer`&&e.firstChild?.type.name===`blockGroup`,o=yy(e.type)&&(!i||xy(e.type)||e.childCount<Ty(i));a||o||!e.type.isInGroup(`bnBlock`)?e.forEach(e=>n(e,o?r:e)):t.push(Kb(e,r))}return e.forEach(e=>n(e,e)),t}function qw(e,t,n){let r=t.dragging?.slice;if(!r||r.openStart>0)return;let i=Kw(r.content),a=t.posAtCoords(n);if(i.length===0||!a||a.inside<0)return;let o=t.state.doc.resolve(a.inside+1),s=o.depth;for(;s>0&&!o.node(s).type.isInGroup(`bnBlock`);){if(o.node(s).type.name===`blockGroup`)return;s--}if(s===0)return;let c=Iy(o.node(s),o.before(s));if(!c.hasContent||!e.schema.blockSpecs[c.blockNoteType]?.implementation.meta.dropsIntoChildren?.(Kb(c.block.node,t.state.doc)))return;let l=c.block.node.attrs.id,u=e=>e.id===l||e.children.some(u);if(!i.some(u))return{blockInfo:c,draggedBlocks:i,pos:c.children?c.children.childrenStart:c.block.afterPos-1}}var Jw=new Cr(`dropInto`),Yw=k_(({editor:e,options:t})=>{let n=null,r=null,i=-1,a=null,o={width:t.dropCursor?.width??5,color:t.dropCursor?.color??`#ddeeff`,exclude:t.dropCursor?.exclude??`bn-drag-exclude`,hooks:t.dropCursor?.hooks},s=t=>{let n=e.prosemirrorView,r=Jw.getState(n.state);(r?.blockId!==t?.blockId||r?.pos!==t?.pos)&&n.dispatch(n.state.tr.setMeta(Jw,{into:t}))},c=e=>{(e?.pos!==n?.pos||e?.orientation!==n?.orientation)&&(n=e,e==null?(s(void 0),r&&r.parentNode&&r.parentNode.removeChild(r),r=null):l())},l=()=>{if(!n)return;let t=e.prosemirrorView,i=t.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,c=a.height/i.offsetHeight,l=Hw(t,n,o.width,s,c)??Uw(t,n,o.width,s),u=t.dom.offsetParent;r||(r=u.appendChild(document.createElement(`div`)),r.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,o.color&&(r.style.backgroundColor=o.color)),Ww(r,n.orientation);let{parentLeft:d,parentTop:f}=Gw(u);r.style.left=(l.left-d)/s+`px`,r.style.top=(l.top-f)/c+`px`,r.style.width=(l.right-l.left)/s+`px`,r.style.height=(l.bottom-l.top)/c+`px`},u=e=>{clearTimeout(i),i=window.setTimeout(()=>c(null),e)},d=e=>{let t=e;a=t.target instanceof Element?t.target:null},f=t=>{let n=t;if(a&&Vw(a,o.exclude)||n.target instanceof Element&&Vw(n.target,o.exclude))return;let r=e.prosemirrorView;if(!r.editable)return;let i=r.posAtCoords({left:n.clientX,top:n.clientY}),l=i&&i.inside>=0&&r.state.doc.nodeAt(i.inside),d=l&&l.type.spec.disableDropCursor,f=typeof d==`function`?d(r,i,n):d;if(i&&!f){let t=i.pos;if(r.dragging&&r.dragging.slice){let e=Lr(r.state.doc,t,r.dragging.slice);e!=null&&(t=e)}let a=!r.state.doc.resolve(t).parent.inlineContent,l=qw(e,r,{left:n.clientX,top:n.clientY}),d=l?{pos:l.pos,orientation:`block-horizontal`}:{pos:t,orientation:a?`block-horizontal`:`inline`},f=d;if(o.hooks?.computeDropPosition){let t=o.hooks.computeDropPosition({editor:e,event:n,view:r,defaultPosition:d});if(t===null){c(null);return}f=t}if(c(f),l&&f.pos===l.pos&&f.orientation===`block-horizontal`){let{block:e}=l.blockInfo;s({blockId:e.node.attrs.id,draggedBlocks:l.draggedBlocks,pos:e.beforePos})}else s(void 0);u(5e3)}},p=t=>{let n=t;n.relatedTarget instanceof Node&&e.prosemirrorView.dom.contains(n.relatedTarget)||c(null)},m=()=>{u(20)},h=()=>{u(20),a=null};return{key:`dropCursor`,prosemirrorPlugins:[new Nr({key:Jw,state:{init:()=>void 0,apply(e,t){let n=e.getMeta(Jw);if(n)return n.into;if(!t)return;let{pos:r,deletedAfter:i}=e.mapping.mapResult(t.pos,1);return i?void 0:{...t,pos:r}}},props:{decorations(e){let t=Jw.getState(e),n=t&&e.doc.nodeAt(t.pos);return!t||!n?jr.empty:jr.create(e.doc,[Pr.node(t.pos,t.pos+n.nodeSize,{"data-drop-target":`true`})])},handleDrop(t,n,r,i){let a=Jw.getState(t.state);if(s(void 0),!a||!e.getBlock(a.blockId))return!1;let{blockId:o,draggedBlocks:c}=a;return e.transact(()=>{i&&e.removeBlocks(c.filter(t=>e.getBlock(t.id)));let t=e.getBlock(o);if(!t)throw Error(`The drop target was removed with the dragged blocks`);t.children.length>0?e.insertBlocks(c,t.children[0],`before`):e.updateBlock(t,{children:c})}),!0}}})],mount({signal:e,dom:t,root:n}){n.addEventListener(`dragstart`,d,{capture:!0,signal:e}),t.addEventListener(`dragover`,f,{signal:e}),t.addEventListener(`dragleave`,p,{signal:e}),t.addEventListener(`drop`,m,{signal:e}),t.addEventListener(`dragend`,h,{signal:e}),e.addEventListener(`abort`,()=>{clearTimeout(i),c(null)})}}}),Xw=k_(()=>({key:`history`,prosemirrorPlugins:[vt()],undoCommand:gt,redoCommand:_t})),Zw=new Cr(`inline-content-boundary-edit`);function Qw(e,t,n){if(!e.empty)return e.from<=n.from&&e.to>=n.to;let r=n.to-n.from===1;return t===`Backspace`?r&&e.from===n.to:r&&e.from===n.from}var $w=k_(()=>({key:`inlineContentBoundaryEdit`,prosemirrorPlugins:[new Nr({key:Zw,props:{handleKeyDown:(e,t)=>{if(!e.editable)return!1;let n=t.key.length===1&&!t.ctrlKey&&!t.metaKey;if(!n&&t.key!==`Backspace`&&t.key!==`Delete`)return!1;let{selection:r}=e.state,i=r.$from.node();if(!i.type.spec.inline)return!1;let a=r.$from.before(),o=a+1,s=a+1+i.content.size;if(n&&i.content.size===0){let n=e.state.tr.insert(o,e.state.schema.text(t.key));return n.setSelection(wr.create(n.doc,o+t.key.length)),e.dispatch(n),!0}if(i.content.size>0&&Qw(r,t.key,{from:o,to:s})){let t=e.state.tr.delete(o,s);return t.setSelection(wr.create(t.doc,o)),e.dispatch(t),!0}return!1}}})]})),eT=k_(({editor:e})=>{function t(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if(n.nodeName===`A`)return n;n=n.parentElement}return null}function n(t){let n=e.getLinkMarkAtPos(t);if(n)return{range:{from:n.from,to:n.to},mark:{attrs:{href:n.href}},get text(){return n.text},get position(){return Ht(e.prosemirrorView,n.from,n.to).toJSON()}}}function r(){return e.transact(e=>{if(e.selection.empty)return n(e.selection.anchor)})}return{key:`linkToolbar`,getLinkAtSelection:r,getLinkElementAtPos:t,getMarkAtPos(e,t){return n(e)},getLinkAtElement(t){return e.transact(()=>n(e.prosemirrorView.posAtDOM(t,0)+1))},editLink(t,n,r=e.transact(e=>e.selection.anchor)){e.editLink(t,n,r)},deleteLink(t=e.transact(e=>e.selection.anchor)){e.deleteLink(t)}}}),tT=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`],nT=`https`,rT=new Cr(`node-selection-keyboard`),iT=k_(({editor:e})=>({key:`nodeSelectionKeyboard`,prosemirrorPlugins:[new Nr({key:rT,props:{handleKeyDown:(t,n)=>{let{selection:r}=t.state;if(r instanceof Mr){if(n.ctrlKey||n.metaKey)return!1;if(n.key===`ArrowDown`&&!n.shiftKey&&!n.altKey&&!n.isComposing&&!r.node.isInline&&r.eq(kr.atEnd(t.state.doc))){let{block:t}=e.getTextCursorPosition();if(e.schema.blockSchema[t.type].content===`none`)return e.transact(n=>{let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);e.setTextCursorPosition(r,`start`),n.scrollIntoView()}),n.preventDefault(),!0}if(n.key.length===1)return n.preventDefault(),!0;if(n.key===`Enter`&&!n.isComposing&&!n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey){let e=t.state.tr;return t.dispatch(e.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new wr(e.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),aT=new Cr(`blocknote-placeholder`),oT=k_(({editor:e,options:t})=>{let n=t.placeholders,r=`placeholder-selector-${P_()}`;return{key:`placeholder`,prosemirrorPlugins:[new Nr({key:aT,view:t=>{let i=document.createElement(`style`),a=e._tiptapEditor.options.injectNonce;a&&i.setAttribute(`nonce`,a),t.root instanceof window.ShadowRoot?t.root.append(i):t.root.head.appendChild(i);let o=i.sheet,s=(e=``)=>`.${r} .bn-block-content${e}:has(.ProseMirror-trailingBreak:only-child):after`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;o.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}o.insertRule(`${s(`[data-is-only-empty-block]`)} { content: ${JSON.stringify(t)}; }`),o.insertRule(`${s(`[data-is-empty-and-focused]`)} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn(`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,e)}return{destroy:()=>{i.remove()}}},props:{attributes:{class:r},decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let i=[];t.doc.content.size===6&&i.push(Pr.node(2,4,{"data-is-only-empty-block":`true`}));let a=r.$anchor,o=a.parent;if(o.content.size===0){let e=a.before();i.push(Pr.node(e,e+o.nodeSize,{"data-is-empty-and-focused":`true`}))}return jr.create(n,i)}}})]}}),sT=k_(({editor:e})=>{let t=new Tr,n=0;function r(){t=new Tr,n=0}let i=typeof FinalizationRegistry<`u`?new FinalizationRegistry(()=>{n--,n===0&&r()}):null;return e.on(`create`,()=>{e._tiptapEditor.on(`transaction`,({transaction:e})=>{n!==0&&t.appendMapping(e.mapping)}),e._tiptapEditor.on(`destroy`,()=>{r()})}),{key:`positionMapping`,mapPosition:(e,r=`left`)=>{n++;let a=t.maps.length,o=()=>t.slice(a).map(e,r===`left`?-1:1);return i&&i.register(o,void 0),o}}}),cT=new Cr(`previous-blocks`),lT={index:`index`,level:`level`,type:`type`,depth:`depth`,"depth-change":`depth-change`},uT=k_(()=>{let e,t=!1;return{key:`previousBlockType`,prosemirrorPlugins:[new Nr({key:cT,view(n){return t=!0,{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(cT,{clearUpdate:!0}))},0))},destroy:()=>{t=!1,e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,n,r,i){if(n.currentTransactionOldBlockAttrs={},n.updatedBlocks.clear(),!e.docChanged||!t)return n;let a=Pw(e);if(!a)return n;let o=e.mapping.invert(),s={from:o.map(a.from,-1),to:o.map(a.to,1)},c={},l=Dt(r.doc,s,e=>e.attrs.id),u=new Map(l.map(e=>[Py(e.node,r.doc),e])),d=Dt(i.doc,a,e=>e.attrs.id);for(let e of d){let t=Py(e.node,i.doc),a=u.get(t),o=a?.node.firstChild,s=e.node.firstChild;if(a&&o&&s){let l={index:s.attrs.index,level:s.attrs.level,type:s.type.name,depth:i.doc.resolve(e.pos).depth},u={index:o.attrs.index,level:o.attrs.level,type:o.type.name,depth:r.doc.resolve(a.pos).depth};c[t]=u,n.currentTransactionOldBlockAttrs[t]=u,(u.index!==l.index||u.level!==l.level||u.type!==l.type||u.depth!==l.depth)&&(u[`depth-change`]=u.depth-l.depth,n.updatedBlocks.add(t))}}return n.prevTransactionOldBlockAttrs=c,n}},props:{decorations(e){let t=this.getState(e);if(t.updatedBlocks.size===0)return;let n=[];return e.doc.descendants((r,i)=>{if(!r.attrs.id)return;let a=Py(r,e.doc);if(!t.updatedBlocks.has(a))return;let o=t.currentTransactionOldBlockAttrs[a],s={};for(let[e,t]of Object.entries(o))s[`data-prev-`+lT[e]]=t||`none`;n.push(Pr.node(i,i+r.nodeSize,{...s}))}),jr.create(e.doc,n)}}})]}}),dT=new Cr(`bn-read-only`),fT=k_(({editor:e,options:t})=>{let n=A_({isEditable:t?.editable??!0,enabledSet:new Set},{onUpdate(t,n){(t.isEditable&&t.enabledSet.size===0)!==(n.isEditable&&n.enabledSet.size===0)&&(e.headless||e.transact(e=>e.setMeta(`editable`,!0)))}});return{key:`readOnly`,store:n,prosemirrorPlugins:[new Nr({key:dT,props:{editable:()=>n.state.isEditable&&n.state.enabledSet.size===0}})],setEditable(e){n.state.isEditable!==e&&n.setState({...n.state,isEditable:e})},setReadOnly(e,t){n.setState({...n.state,enabledSet:e?new Set([...n.state.enabledSet,t]):new Set([...n.state.enabledSet].filter(e=>e!==t))})}}});function pT(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(!(t.y<i.top||t.y>i.bottom)){if(t.x>=i.left&&t.x<=i.right)return r;n??=r}}return n}function mT(e,t){for(;e.matches(xw);){let n=Ew(e),r=pT(n.map(e=>e.getBoundingClientRect()),t);if(r===void 0)break;e=n[r]}return e}var hT=10;function gT(e,t,n){return Math.min(Math.max(e,t),n)}function _T(e,t){for(let n of e.root.elementsFromPoint(t.x,t.y)){let t=Sw(n,e);if(t)return t}}function vT(e,t){let n=e.dom.firstElementChild?.getBoundingClientRect();if(!n||t.y<n.top||t.y>n.bottom)return;let r=Math.min(hT,n.width/2),i=_T(e,{x:gT(t.x,n.left+r,n.right-r),y:t.y});return i?mT(i,t):void 0}function yT(e,t,n,r,i,a){function o(t){let n=t?Tw(t,e,r):void 0;return n?{kind:`block`,block:n}:{kind:`none`}}if(t&&e.dom.contains(t)){if(t.closest(`.bn-editor`)!==e.dom)return{kind:`none`};let r=Sw(t,e);return o(r?mT(r,n):vT(e,n))}if(t&&i(t))return{kind:`editorUI`};let s=e.dom.getBoundingClientRect();return n.x>=s.left&&n.x<=s.right&&n.y>=s.top&&n.y<=s.bottom?{kind:`none`}:n.y>=s.top&&n.y<=s.bottom&&Math.max(s.left-n.x,n.x-s.right)<=a&&!t?.closest(`.bn-editor`)?o(vT(e,n)):{kind:`none`}}var bT=3;function xT(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function ST(e,t){let n=0;for(let r=0;r<t.length;r++){let i=Math.sign(xT(t[r],t[(r+1)%t.length],e));if(i!==0){if(n===0)n=i;else if(i!==n)return!1}}return!0}function CT(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i,o=a===0?0:gT(((e.x-t.x)*r+(e.y-t.y)*i)/a,0,1);return Math.hypot(e.x-(t.x+o*r),e.y-(t.y+o*i))}function wT(e,t){return Math.hypot(e.x-gT(e.x,t.left,t.right),e.y-gT(e.y,t.top,t.bottom))}function TT(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=[];for(let e of t){for(;n.length>=2&&xT(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}let r=[];for(let e of[...t].reverse()){for(;r.length>=2&&xT(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return n.pop(),r.pop(),n.concat(r)}function ET(e,t,n){if(wT(e,n)>=wT(t,n))return!1;let r=TT([t,{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.right,y:n.bottom},{x:n.left,y:n.bottom}]);return r.length>=3&&ST(e,r)?!0:r.some((t,n)=>CT(e,t,r[(n+1)%r.length])<=bT)}function DT(e){return e.synthetic===!0}function OT(e,t,n){let r={x:t.clientX,y:t.clientY},i=t.target instanceof Element?t.target.closest(`.bn-editor`):null,a=i?[i]:Array.from(e.root.querySelectorAll(`.bn-editor`)).filter(e=>wT(r,e.getBoundingClientRect())<=n),o=t;if(a.length===0)return null;let s=a[0],c=Number.MAX_VALUE;for(let e of a){let t=e.querySelector(`.bn-block-group`).getBoundingClientRect(),n=o.clientX<t.left?t.left-o.clientX:o.clientX>t.right?o.clientX-t.right:0,r=o.clientY<t.top?t.top-o.clientY:o.clientY>t.bottom?o.clientY-t.bottom:0,i=Math.sqrt(n**2+r**2);i<c&&(c=i,s=e)}return{element:s,distance:c}}function kT(e,t,n,r){function i(n){return e.dragging!==null||t()||n.dataTransfer?.types.includes(`blocknote/html`)||n.target instanceof Node&&e.dom.contains(n.target)}function a(){let t=new Event(`dragleave`,{bubbles:!1});t.synthetic=!0,e.dom.dispatchEvent(t)}function o(t){let n=e.dom.firstChild.getBoundingClientRect(),r=Object.assign(new Event(t.type,t),{clientX:Math.min(Math.max(t.clientX,n.left),n.left+n.width),clientY:Math.min(Math.max(t.clientY,n.top),n.top+n.height),dataTransfer:t.dataTransfer,preventDefault:()=>t.preventDefault(),synthetic:!0});e.dom.dispatchEvent(r)}function s(r){if(!i(r))return;let a=!r.dataTransfer?.types.includes(`blocknote/html`)&&!!e.dragging,o=t(),s=a||o,c=OT(e,r,n);if(!c)return;let l=c.element===e.dom,u=l&&c.distance===0;if(l||s)return{isDropPoint:l,isDropWithinEditorBounds:u,isDragOrigin:s}}function c(t){let n=t.dataTransfer?.getData(`blocknote/html`);if(!n||e.dragging)return;let r=new(e.dom.ownerDocument.defaultView??globalThis.window).DOMParser().parseFromString(n,`text/html`).body,{nodes:i}=e.state.schema,a=i[t.dataTransfer.getData(`blocknote/parent`)]??i.blockGroup,o=Ir.fromSchema(e.state.schema).parse(r,{topNode:a.create()});e.dragging={slice:new Or(o.content,0,0),move:!0}}function l(e){if(DT(e)||!i(e))return;let t=s(e);!t||!t.isDropPoint?a():t.isDropWithinEditorBounds||o(e)}function u(t){if(DT(t)||!i(t))return;let n=s(t);if(!n){a();return}let{isDropPoint:r,isDropWithinEditorBounds:c,isDragOrigin:l}=n;if(!c&&r&&o(t),r){if(e.dragging)return;e.dispatch(e.state.tr.setSelection(wr.create(e.state.tr.doc,e.state.tr.selection.anchor)))}else l&&setTimeout(()=>e.dispatch(e.state.tr.deleteSelection()),0)}function d(t){DT(t)||(e.dragging=null)}let f=e.root;f.addEventListener(`dragstart`,c,{signal:r}),f.addEventListener(`dragover`,l,{signal:r}),f.addEventListener(`drop`,u,{signal:r,capture:!0}),f.addEventListener(`dragend`,d,{signal:r,capture:!0})}var AT=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`;function jT(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;r+i<e.length&&e.charCodeAt(r+i)>=48&&e.charCodeAt(r+i)<=57;)i++;if(i>0){t.push(n.join(``));let a=parseInt(e.substring(r,r+i),10);for(;a-->0;)n.pop();r+=i}else n.push(e[r]),r++}return t}var MT=new Set(jT(AT)),NT=new Set([`localhost`]),PT=/[.,;:!?"']+$/,FT=/(?:https?|ftp|ftps):\/\/[^\s]+/g,IT=/mailto:[^\s]+/g,LT=/[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g,RT=/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;function zT(e){let t=e,n=!0;for(;n;){n=!1;let e=t;t=t.replace(PT,``),t!==e&&(n=!0);for(let[e,r]of[[`(`,`)`],[`[`,`]`]])for(;t.endsWith(r);){let i=BT(t,e);if(BT(t,r)>i)t=t.slice(0,-1),n=!0;else break}}return t}function BT(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function VT(e){let t=e.split(`.`);return t[t.length-1].toLowerCase()}function HT(e){let t=VT(e);return MT.has(t)}function UT(e,t,n){return t===`email`?`mailto:`+e:/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)||/^mailto:/i.test(e)?e:n+`://`+e}function WT(e,t){if(!e)return[];let n=t?.defaultProtocol||`http`,r=[];for(let t of e.matchAll(FT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(IT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(LT))r.push({type:`email`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(RT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[],a=-1;for(let e of r)e.start>=a&&(i.push(e),a=e.end);let o=[];for(let e of i){let t=zT(e.value);if(!t)continue;let r=e.start,i=r+t.length;if(e.type===`url`&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)){let e=new URL(`http://`+t).hostname;if(!HT(e))continue}if(e.type===`email`){let e=t.split(`@`)[1];if(!HT(e))continue}let a=UT(t,e.type,n);o.push({type:e.type,value:t,isLink:!0,href:a,start:r,end:i})}return o}function GT(e,t=`http`){if(!e)return[JT(e,0,0)];for(let[n,r]of[[`(`,`)`],[`[`,`]`],[`{`,`}`]])if(e.startsWith(n)&&e.endsWith(r)&&e.length>2){let i=e.slice(1,-1);if(KT(i))return[JT(n,0,1),qT(i,1,1+i.length,t),JT(r,1+i.length,e.length)]}if(e.endsWith(`.`)&&e.length>1){let n=e.slice(0,-1);if(KT(n))return[qT(n,0,n.length,t),JT(`.`,n.length,e.length)]}return KT(e)?[qT(e,0,e.length,t)]:[JT(e,0,e.length)]}function KT(e){if(/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e)||/^mailto:[^\s]+$/.test(e)||NT.has(e.toLowerCase()))return!0;let t=e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);if(t){let e=t[1].toLowerCase();if(MT.has(e))return!0}return!1}function qT(e,t,n,r){let i=e.includes(`@`)&&!e.includes(`://`)&&!e.startsWith(`mailto:`)?`email`:`url`;return{type:i,value:e,isLink:!0,href:UT(e,i,r),start:t,end:n}}function JT(e,t,n){return{type:`text`,value:e,isLink:!1,href:e,start:t,end:n}}function YT(e){if(!/^(https?:\/\/|www\.)/i.test(e))return;let t=WT(e.replace(/&[a-zA-Z0-9]+;$/,``),{defaultProtocol:`http`})[0];if(t&&t.start===0)return{value:t.value,href:t.href}}function XT(e){let t=document.createElement(`div`);return t.innerHTML=e,ZT(t,{indent:``,inListItem:!1}).trim()+`
|
|
190
|
-
`}function ZT(e,t){let n=``,r=Array.from(e.childNodes);for(let e=0;e<r.length;e++){let i=r[e];n+=QT(i,t)}return n}function QT(e,t){if(e.nodeType===3)return e.textContent||``;if(e.nodeType!==1)return``;let n=e;switch(n.tagName.toLowerCase()){case`p`:return $T(n,t);case`h1`:case`h2`:case`h3`:case`h4`:case`h5`:case`h6`:return eE(n,t);case`blockquote`:return tE(n,t);case`pre`:return nE(n,t);case`ul`:return sE(n,t);case`ol`:return cE(n,t);case`table`:return dE(n,t);case`hr`:return t.indent+`***
|
|
191
|
-
|
|
192
|
-
`;case`math`:return iE(n,t);case`img`:return hE(n,t);case`video`:return gE(n,t);case`audio`:return _E(n,t);case`embed`:return vE(n,t);case`figure`:return yE(n,t);case`a`:return CE(n,t);case`details`:return EE(n,t);case`div`:return ZT(n,t);case`br`:return``;default:return ZT(n,t)}}function $T(e,t){let n=kE(DE(e));return t.inListItem?n:t.indent+n+`
|
|
193
|
-
|
|
194
|
-
`}function eE(e,t){let n=parseInt(e.tagName[1],10),r=`#`.repeat(n)+` `,i=DE(e);return t.indent+r+i+`
|
|
195
|
-
|
|
196
|
-
`}function tE(e,t){let n=Array.from(e.children).filter(e=>{let t=e.tagName.toLowerCase();return[`p`,`ul`,`ol`,`pre`,`blockquote`,`table`,`hr`].includes(t)}),r;if(n.length>0){let e=[];for(let t of n)t.tagName.toLowerCase()===`p`?e.push(DE(t)):e.push(QT(t,{indent:``,inListItem:!1}).trim());r=e.join(`
|
|
197
|
-
|
|
198
|
-
`)}else r=DE(e);return r.split(`
|
|
199
|
-
`).map(e=>t.indent+`> `+e).join(`
|
|
200
|
-
`)+`
|
|
201
|
-
|
|
202
|
-
`}function nE(e,t){let n=e.querySelector(`code`);if(!n)return``;let r=n.getAttribute(`data-language`)||oE(n.className)||``,i=aE(n),a=Math.max(0,...(i.match(/`+/g)??[]).map(e=>e.length)),o="`".repeat(Math.max(3,a+1));return i?[o+r,...(i.endsWith(`
|
|
203
|
-
`)?i.slice(0,-1):i).split(`
|
|
204
|
-
`),o].map(e=>e&&t.indent+e).join(`
|
|
205
|
-
`)+`
|
|
206
|
-
|
|
207
|
-
`:t.indent+o+r+`
|
|
208
|
-
`+t.indent+o+`
|
|
209
|
-
|
|
210
|
-
`}function rE(e){return(e.querySelector(`annotation[encoding="application/x-tex"]`)?.textContent??e.textContent??``).trim()}function iE(e,t){return[`$$`,...rE(e).split(`
|
|
211
|
-
`),`$$`].map(e=>e&&t.indent+e).join(`
|
|
212
|
-
`)+`
|
|
213
|
-
|
|
214
|
-
`}function aE(e){let t=``;for(let n of Array.from(e.childNodes))n.nodeType===3?t+=n.textContent||``:n.nodeType===1&&(n.tagName.toLowerCase()===`br`?t+=`
|
|
215
|
-
`:t+=aE(n));return t}function oE(e){let t=e.match(/language-(\S+)/);return t?t[1]:``}function sE(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`);for(let e of r)n+=lE(e,`bullet`,t);return t.inListItem||(n+=`
|
|
216
|
-
`),n}function cE(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`),i=parseInt(e.getAttribute(`start`)||`1`,10);for(let e=0;e<r.length;e++){let a=i+e;n+=lE(r[e],`ordered`,t,a)}return t.inListItem||(n+=`
|
|
217
|
-
`),n}function lE(e,t,n,r){let i=null,a=null;for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();e===`input`&&t.type===`checkbox`&&(i=t),e===`details`&&(a=t)}let o,s;i?(o=`* ${i.checked?`[x]`:`[ ]`} `,s=2):t===`ordered`?(o=`${r}. `,s=o.length):(o=`* `,s=2);let c,l;if(a){let e=a.querySelector(`summary`)?.querySelector(`p`);l=a,c=e?DE(e):``}else l=uE(e,i),c=l?DE(l):``;let u=n.indent+o+c+`
|
|
218
|
-
`,d=n.indent+` `.repeat(s),f={indent:d,inListItem:!0};if(a){let e=a.querySelector(`summary`);for(let t of Array.from(a.children))if(t!==e){if(t.tagName.toLowerCase()===`p`){let e=DE(t);u+=`
|
|
219
|
-
`+d+e+`
|
|
220
|
-
`}else u+=QT(t,f)}}let p=Array.from(e.children);for(let e of p){let t=e.tagName.toLowerCase();if(e!==l&&e!==i&&t!==`input`){if(t===`ul`||t===`ol`)u+=QT(e,f);else if(t===`p`){let t=DE(e);u+=`
|
|
221
|
-
`+d+t+`
|
|
222
|
-
`}else u+=`
|
|
223
|
-
`+QT(e,f)}}return u}function uE(e,t){for(let n of Array.from(e.children)){if(n===t||n.tagName.toLowerCase()===`input`)continue;let e=n.tagName.toLowerCase();if(e===`p`||e===`span`)return n}return null}function dE(e,t){let n=e.querySelector(`colgroup`),r=0;n&&(r=n.querySelectorAll(`col`).length);let i=[],a=!1,o=e.querySelectorAll(`tr`),s=[];o.forEach((e,t)=>{s[t]||(s[t]=[]);let n=e.querySelectorAll(`th, td`),i=0;n.forEach(e=>{for(;s[t][i]!==void 0;)i++;t===0&&e.tagName.toLowerCase()===`th`&&(a=!0);let n=fE(DE(e).trim()),r=parseInt(e.getAttribute(`colspan`)||`1`,10),o=parseInt(e.getAttribute(`rowspan`)||`1`,10);for(let e=0;e<o;e++)for(let a=0;a<r;a++){let r=t+e;s[r]||(s[r]=[]),s[r][i+a]=e===0&&a===0?n:``}i+=r}),s[t]&&(r=Math.max(r,s[t].length))});for(let e of s){let t=[];for(let n=0;n<r;n++)t.push(e&&e[n]!==void 0?e[n]??``:``);i.push(t)}if(i.length===0)return``;let c=[];for(let e=0;e<r;e++){let t=3;for(let n of i){let r=e<n.length?n[e].length:0;t=Math.max(t,r)}c.push(Math.max(t,10))}let l=``;if(a){l+=t.indent+pE(i[0],c,r)+`
|
|
224
|
-
`,l+=t.indent+mE(c,r)+`
|
|
225
|
-
`;for(let e=1;e<i.length;e++)l+=t.indent+pE(i[e],c,r)+`
|
|
226
|
-
`}else{let e=Array(r).fill(``);l+=t.indent+pE(e,c,r)+`
|
|
227
|
-
`,l+=t.indent+mE(c,r)+`
|
|
228
|
-
`;for(let e of i)l+=t.indent+pE(e,c,r)+`
|
|
229
|
-
`}return l+=`
|
|
230
|
-
`,l}function fE(e){return e.replace(/\|/g,`\\|`)}function pE(e,t,n){let r=[];for(let i=0;i<n;i++){let n=i<e.length?e[i]:``;r.push(` `+n.padEnd(t[i])+` `)}return`|`+r.join(`|`)+`|`}function mE(e,t){let n=[];for(let r=0;r<t;r++)n.push(` `+`-`.repeat(e[r])+` `);return`|`+n.join(`|`)+`|`}function hE(e,t){let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;return n?t.indent+`\n\n`:`
|
|
231
|
-
|
|
232
|
-
`}function gE(e,t){let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;return n?t.indent+`\n\n`:`
|
|
233
|
-
|
|
234
|
-
`}function _E(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`<audio src="${xE(n)}" controls></audio>\n\n`:`
|
|
235
|
-
|
|
236
|
-
`}function vE(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`[](${n})\n\n`:`
|
|
237
|
-
|
|
238
|
-
`}function yE(e,t){let n=e.querySelector(`img`),r=e.querySelector(`video`),i=e.querySelector(`audio`),a=e.querySelector(`a`),o=e.querySelector(`figcaption`)?.textContent?.trim()||``;return n?bE(`img`,n.getAttribute(`src`)||``,n.getAttribute(`alt`)||``,o,t):r?bE(`video`,r.getAttribute(`src`)||r.getAttribute(`data-url`)||``,r.getAttribute(`data-name`)||r.getAttribute(`title`)||``,o,t):i?bE(`audio`,i.getAttribute(`src`)||``,``,o,t):a?CE(a,t):``}function bE(e,t,n,r,i){if(!t)return``;if(!r&&e!==`audio`)return i.indent+`\n\n`;let a=n&&n!==r?e===`img`?` alt="${xE(n)}"`:e===`video`?` data-name="${xE(n)}"`:``:``,o=e===`img`?`<img${a} src="${xE(t)}">`:`<${e} src="${xE(t)}"${a} controls></${e}>`,s=r?`<figcaption>${SE(r)}</figcaption>`:``;return i.indent+`<figure>${o}${s}</figure>\n\n`}function xE(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function SE(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function CE(e,t){let n=e.getAttribute(`href`)||``,r=e.textContent?.trim()||``;return n?t.indent+wE(r,n)+`
|
|
239
|
-
|
|
240
|
-
`:t.indent+r+`
|
|
241
|
-
|
|
242
|
-
`}function wE(e,t){if(!e)return t;if(e===t){let e=YT(t);if(!/^(https?:\/\/|www\.)/i.test(t)||e?.href===t&&e.value===t)return t}return`[${e}](${TE(t)})`}function TE(e){return e.replace(/[\\()]/g,`\\$&`)}function EE(e,t){let n=e.querySelector(`summary`);if(!n)return ZT(e,t);let r=n.querySelector(`h1, h2, h3, h4, h5, h6`);if(r){let i=eE(r,t);for(let r of Array.from(e.children))r!==n&&(i+=QT(r,t));return i}return ZT(n,t)}function DE(e){let t=``;for(let n of Array.from(e.childNodes))if(n.nodeType===3)t+=n.textContent||``;else if(n.nodeType===1){let e=n;switch(e.tagName.toLowerCase()){case`strong`:case`b`:{let{content:n,trailing:r}=OE(DE(e));t+=n?`**${n}**${r}`:r;break}case`em`:case`i`:{let{content:n,trailing:r}=OE(DE(e));t+=n?`*${n}*${r}`:r;break}case`s`:case`del`:t+=`~~${DE(e)}~~`;break;case`code`:{let n=e.textContent||``,r=Math.max(0,...(n.match(/`+/g)??[]).map(e=>e.length)),i="`".repeat(r+1),a=n.startsWith("`")||n.endsWith("`");t+=i+(a?` ${n} `:n)+i;break}case`u`:t+=DE(e);break;case`a`:{let n=e.getAttribute(`href`)||``,r=DE(e);t+=wE(r,n);break}case`br`:t+=`\\
|
|
243
|
-
`;break;case`math`:{let n=rE(e).split(`
|
|
244
|
-
`).map(e=>e.trim()).join(` `);t+=`$${n}$`;break}case`span`:t+=DE(e);break;case`img`:{let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;t+=``;break}case`video`:{let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;t+=``;break}case`p`:t+=DE(e);break;case`input`:break;default:t+=DE(e)}}return t}function OE(e){let t=e.match(/^(.*?)(\s*)$/);return t?{content:t[1],trailing:t[2]}:{content:e,trailing:``}}function kE(e){let t=e.replace(/^(\\\n)+/,``);return t=t.replace(/(\\\n)+$/,``),t}function AE(e){return XT(e.split(``).join(``))}function jE(e,t,n,r){return AE(Nw(t,n).exportBlocks(e,r))}var ME=class e extends kr{nodes;constructor(e,t){super(e,t);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(r!==null&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new Or(yr.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),i=n.mapResult(this.to);return i.deleted?kr.near(t.resolve(r.pos)):r.deleted?kr.near(t.resolve(i.pos)):new e(t.resolve(r.pos),t.resolve(i.pos))}toJSON(){return{type:`multiple-node`,anchor:this.anchor,head:this.head}}};kr.jsonID(`multiple-node`,ME);var NE;function PE(e,t){let n,r,i=t.resolve(e.from).node().type.spec.group===`blockContent`,a=t.resolve(e.to).node().type.spec.group===`blockContent`,o=Math.min(e.$anchor.depth,e.$head.depth);if(i&&a){let i=e.$from.start(o-1),a=e.$to.end(o-1);n=t.resolve(i-1).pos,r=t.resolve(a+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}function FE(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!1);r.style.removeProperty(`display`);for(let i=t;i<n;i+=e.state.doc.nodeAt(i).nodeSize){let t=e.nodeDOM(i);if(!t)throw Error(`The dragged block at ${i} has no DOM.`);r.appendChild(t.cloneNode(!0))}IE(e.root),NE=r,NE.querySelectorAll(`iframe, embed, object`).forEach(e=>e.parentElement?.removeChild(e));let i=e.dom.className.split(` `).filter(e=>e!==`ProseMirror`&&e!==`bn-root`&&e!==`bn-editor`).join(` `);NE.className=NE.className+` bn-drag-preview `+i,e.root instanceof ShadowRoot?e.root.appendChild(NE):e.root.body.appendChild(NE)}function IE(e){NE!==void 0&&(e instanceof ShadowRoot?e.removeChild(NE):e.body.removeChild(NE),NE=void 0)}function LE(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=yw(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let a=i.posBeforeNode;if(a!=null){let t=r.state.selection,i=r.state.doc,{from:o,to:s}=PE(t,i),c=o<=a&&a<s,l=t.$anchor.node()!==t.$head.node()||t instanceof ME;c&&l?(r.dispatch(r.state.tr.setSelection(ME.create(i,o,s))),FE(r,o,s)):(r.dispatch(r.state.tr.setSelection(Mr.create(r.state.doc,a))),FE(r,a));let u=r.state.selection.content(),d=n.pmSchema,f=r.serializeForClipboard(u).dom.innerHTML,p=Nw(d,n),m=Kw(u.content),h=p.exportBlocks(m,{}),g=AE(h);e.dataTransfer.clearData(),e.dataTransfer.setData(`blocknote/html`,f),e.dataTransfer.setData(`blocknote/parent`,r.state.selection.$from.parent.type.name),e.dataTransfer.setData(`text/html`,h),e.dataTransfer.setData(`text/plain`,g),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setDragImage(NE,0,0)}}var RE=350;function zE(e){if(!e||!(`nodeType`in e))return null;let t=e;return t.nodeType===Node.ELEMENT_NODE?t:t.parentElement}var BE=new Cr(`SideMenuPlugin`),VE=k_(({editor:e,options:t})=>{let n=A_(void 0),r=t?.sideMenu?.hoverMargin??0,i=!1,a=!1,o,s,c,l;function u(t){return e.schema.blockSpecs[t].implementation.meta.draggable}function d(){l&&=(clearTimeout(l.timer),void 0)}function f(){let e=n.state;e?.show&&n.setState({...e,show:!1})}function p(t){let r=e.getBlock(t.id);r?n.setState({show:!0,referencePos:t.node.getBoundingClientRect(),block:r}):f()}function m(t,s,m){if(i||a)return;if(s&&o?.contains(s)){d(),c=t;return}if(!e.isEditable){d(),f();return}let h=yT(e.prosemirrorView,s,t,u,e.isWithinEditor,r);if(h.kind===`editorUI`)return;let _=n.state,v=_?.show?_.block.id:void 0;if(h.kind===`block`&&h.block.id===v)d(),c=t;else{if(m&&v!==void 0&&o?.isConnected){let e=l?.exit??c??t;if(ET(t,e,o.getBoundingClientRect())){d(),l={exit:e,timer:setTimeout(g,RE)};return}}d(),h.kind===`block`?(c=t,p(h.block)):f()}}function h(){IE(e.prosemirrorView.root),a=!1}function g(){l=void 0,_()}function _(){if(!s)return;let t=e.prosemirrorView,n=o?.isConnected?o.getBoundingClientRect():void 0,r=n!==void 0&&s.x>=n.left&&s.x<=n.right&&s.y>=n.top&&s.y<=n.bottom?{x:n.right+1,y:s.y}:s;m(r,t.root.elementsFromPoint(r.x,r.y).find(n=>t.dom.contains(n)||!e.isWithinEditor(n))??null,!1)}return{key:`sideMenu`,store:n,prosemirrorPlugins:[new Nr({key:BE,appendTransaction:(e,t,n)=>e.some(e=>e.getMeta(`uiEvent`)===`drop`)?n.tr.scrollIntoView():null})],mount({root:r,signal:o}){kT(e.prosemirrorView,()=>a,t?.sideMenu?.dropMargin??250,o),r.addEventListener(`mousemove`,e=>{let{clientX:t,clientY:n,buttons:r}=e;if(i||typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n))return;a&&r===0&&h();let o={x:t,y:n};s=o,m(o,zE(e.target),!0)},{signal:o,capture:!0}),r.addEventListener(`mouseout`,e=>{e.relatedTarget===null&&!i&&!a&&(s=void 0,d(),f())},{signal:o,capture:!0}),r.addEventListener(`keydown`,()=>{n.state?.show&&e.isFocused()&&(d(),f())},{signal:o,capture:!0});let c=e.onChange(()=>{n.state?.show&&(d(),_())});o.addEventListener(`abort`,()=>{c(),d(),f()})},setMenuElement(e){o=e},blockDragStart(t,n){a=!0,LE(t,n,e)},blockDragEnd(){h(),e.blur()},get menuFrozen(){return i},freezeMenu(){i=!0,d();let e=n.state;e&&n.setState({...e,show:!0})},unfreezeMenu(){i=!1,f()},hideMenuIfNotFrozen(){!i&&!a&&(d(),f())}}}),HE=k_(({editor:e})=>{let t=A_({popupOpen:void 0,selected:void 0}),n=t=>!!e.schema.blockSpecs[t.type]?.implementation.meta.hasPreview,r=e=>({editor:r})=>{let{block:i,prevBlock:a,nextBlock:o}=r.getTextCursorPosition();if(!n(i)||t.state.popupOpen===i.id)return!1;let s=e===`prev`?a:o;return s?(r.setTextCursorPosition(s.id,e===`prev`?`end`:`start`),!0):!1};return{key:`sourceBlockWithPreview`,store:t,keyboardShortcuts:{Enter:({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r))return!1;if(t.state.popupOpen===r.id&&e.schema.blockSpecs[r.type].implementation.keyboard(r).enter===`line-break`){let t=e.prosemirrorView;return t.dispatch(t.state.tr.insertText(`
|
|
245
|
-
`)),!0}return e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:t.state.popupOpen===r.id?void 0:r.id})),!0},Escape:({editor:e})=>{let{block:r}=e.getTextCursorPosition();return!n(r)||t.state.popupOpen!==r.id?!1:(e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:void 0})),!0)},"Mod-a":({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r)||t.state.popupOpen!==r.id)return!1;let i=e.prosemirrorView,{$from:a}=i.state.selection;return a.parent.type.name===r.type&&(i.dispatch(i.state.tr.setSelection(wr.create(i.state.doc,a.start(),a.end()))),!0)},ArrowUp:r(`prev`),ArrowLeft:r(`prev`),ArrowDown:r(`next`),ArrowRight:r(`next`)},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{block:r}=e.getTextCursorPosition(),i=n(r)?r.id:void 0,a=t.state.popupOpen&&t.state.popupOpen!==r.id?void 0:t.state.popupOpen;(i!==t.state.selected||a!==t.state.popupOpen)&&t.setState(e=>({...e,selected:i,popupOpen:a}))});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,r=>{if(!e.isEditable)return;let{block:i}=e.getTextCursorPosition();if(n(i)&&t.state.popupOpen!==i.id){if(r.key===`Backspace`||r.key===`Delete`){r.preventDefault(),r.stopImmediatePropagation(),e.removeBlocks([i.id]);return}(r.key.length===1&&!r.ctrlKey&&!r.metaKey||r.key===`Tab`)&&(r.preventDefault(),r.stopImmediatePropagation())}},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState(e=>({...e,popupOpen:void 0})),{capture:!0,signal:i})}}}),UE=k_(({editor:e})=>{let t=A_({selected:void 0}),n=t=>!!e.schema.inlineContentSpecs[t]?.implementation?.meta?.hasPreview,r=e=>({editor:t})=>{let{$from:r}=t.prosemirrorState.selection,i=r.node();if(!n(i.type.name))return!1;let a=t.prosemirrorView,o=kr.near(a.state.doc.resolve(e===`before`?r.before():r.after()),e===`before`?-1:1);return a.dispatch(a.state.tr.setSelection(o)),!0};return{key:`sourceInlineContentWithPreview`,store:t,keyboardShortcuts:{Enter:r(`after`),"Shift-Enter":r(`after`),Escape:r(`after`),ArrowUp:r(`before`),ArrowDown:r(`after`),"Mod-a":({editor:e})=>{let{$from:t}=e.prosemirrorState.selection;if(!n(t.node().type.name))return!1;let r=e.prosemirrorView;return r.dispatch(r.state.tr.setSelection(wr.create(r.state.doc,t.start(),t.end()))),!0}},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{$from:r}=e.prosemirrorState.selection,i=r.node();t.setState({selected:n(i.type.name)?r.before():void 0})});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,t=>{if(t.key!==`ArrowUp`&&t.key!==`ArrowDown`)return;let{$from:i}=e.prosemirrorState.selection;n(i.node().type.name)||(r.classList.add(`bn-suppress-source-popup-caret`),requestAnimationFrame(()=>r.classList.remove(`bn-suppress-source-popup-caret`)))},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState({selected:void 0}),{capture:!0,signal:i})}}}),WE=Symbol.for(`blocknote.shikiParser`),GE=Symbol.for(`blocknote.shikiHighlighterPromise`),KE=[`text`,`none`,`plaintext`,`txt`];function qE(e,t,n){let r=globalThis,i,a,o=new Set;return pw({parser:t=>{if(!e.createHighlighter)return[];if(!i)return r[GE]=r[GE]||e.createHighlighter(),r[GE].then(e=>{i=e});let n=t.language;return!n||KE.includes(n)||o.has(n)?[]:i.getLoadedLanguages().includes(n)?(a||(a=r[WE]||gw(i,JE(i)),r[WE]=a),a(t)):i.loadLanguage(n).catch(()=>{o.add(n)})},languageExtractor:e=>{let t={type:e.type.name,props:e.attrs};return(n.blockSpecs[t.type]||n.inlineContentSpecs[t.type])?.implementation.meta.highlight?.(t)??void 0},nodeTypes:t})}function JE(e){let t=e.getLoadedThemes(),n=t.find(e=>/light/i.test(e)),r=t.find(e=>/dark/i.test(e));if(n&&r)return{themes:{light:n,dark:r},defaultColor:!1}}function YE(e){let t=Object.values(e.blockSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation.meta.highlight).map(e=>e.config.type),n=Object.values(e.inlineContentSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation?.meta?.highlight).map(e=>e.config.type);return[...t,...n]}k_(({editor:e,options:t})=>({key:`syntaxHighlighting`,prosemirrorPlugins:[qE(t,YE(e.schema),e.schema)]}));var XE;async function ZE(){return XE||(XE=(async()=>{let[e,t]=await Promise.all([Hn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),Hn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),XE)}async function QE(e,t){if(!(`text`in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==aw.text)return[];let{emojiData:n,emojiMart:r}=await ZE();return(t.trim()===``?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+` `)}))}var $E;function eD(e){$E||($E=document.createElement(`div`),$E.innerHTML=`_`,$E.style.opacity=`0`,$E.style.height=`1px`,$E.style.width=`1px`,e instanceof Document?e.body.appendChild($E):e.appendChild($E))}function tD(e){$E&&=(e instanceof Document?e.body.removeChild($E):e.removeChild($E),void 0)}function nD(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function rD(e){let t=e;for(;t&&t.nodeName!==`TD`&&t.nodeName!==`TH`&&!t.classList.contains(`tableWrapper`);){if(t.classList.contains(`ProseMirror`))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return t.nodeName===`TD`||t.nodeName===`TH`?{type:`cell`,domNode:t,tbodyNode:t.closest(`tbody`)}:{type:`wrapper`,domNode:t,tbodyNode:t.querySelector(`tbody`)}}function iD(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility=`hidden`}var aD=class{editor;pmView;state;emitUpdate;tableId;tablePos;tableElement;menuFrozen=!1;mouseState=`up`;prevWasEditable=null;constructor(e,t,n){this.editor=e,this.pmView=t,this.emitUpdate=()=>{n(this.state)},t.dom.addEventListener(`mousemove`,this.mouseMoveHandler),t.dom.addEventListener(`mousedown`,this.viewMousedownHandler),window.addEventListener(`mouseup`,this.mouseUpHandler),t.root.addEventListener(`dragover`,this.dragOverHandler),t.root.addEventListener(`drop`,this.dropHandler)}viewMousedownHandler=()=>{this.mouseState=`down`};hideHandles=()=>{this.state?.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate())};mouseUpHandler=e=>{this.mouseState=`up`,this.mouseMoveHandler(e)};mouseMoveHandler=e=>{if(this.menuFrozen||this.mouseState===`selecting`||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let t=rD(e.target);if(t?.type===`cell`&&this.mouseState===`down`&&!this.state?.draggingState){this.mouseState=`selecting`,this.hideHandles();return}if(!t||!this.editor.isEditable){this.hideHandles();return}if(!t.tbodyNode)return;let n=t.tbodyNode.getBoundingClientRect(),r=ww(t.domNode,this.pmView);if(!r){this.hideHandles();return}let{pmNodeInfo:i,doc:a}=this.editor.transact(e=>({pmNodeInfo:yw(r.id,e.doc),doc:e.doc}));if(!i){this.hideHandles();return}let o=Kb(i.node,a);if(!RC(o,this.editor,`table`)){this.hideHandles();return}let s=o;this.tablePos=i.posBeforeNode+1,this.tableElement=r.node,this.tableId=r.id;let c=t.domNode.closest(`.tableWrapper`)?.querySelector(`.table-widgets-container`);if(t?.type===`wrapper`){let t=e.clientY>=n.bottom-1&&e.clientY<n.bottom+20,r=e.clientX>=n.right-1&&e.clientX<n.right+20,i=this.state?.block?.id!==s.id||e.clientX>n.right||e.clientY>n.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:r,referencePosTable:n,block:s,widgetContainer:c,colIndex:i?void 0:this.state?.colIndex,rowIndex:i?void 0:this.state?.rowIndex,referencePosCell:i?void 0:this.state?.referencePosCell}}else{let e=nD(t.domNode),i=nD(t.domNode.parentElement),a=t.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===i&&this.state.colIndex===e)return;this.state={show:!0,showAddOrRemoveColumnsButton:e===s.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:i===s.content.rows.length-1,referencePosTable:n,block:s,draggingState:void 0,referencePosCell:a,colIndex:e,rowIndex:i,widgetContainer:c}}return this.emitUpdate(),!1};dragOverHandler=e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`,iD(`.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline`,this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>e.tagName===`TD`||e.tagName===`TH`);if(n.length===0)return;let r=n[0],i=!1,a=nD(r.parentElement),o=nD(r),s=this.state.draggingState.draggedCellOrientation===`row`?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation===`row`?a:o)!==s;(this.state.rowIndex!==a||this.state.colIndex!==o)&&(this.state.rowIndex=a,this.state.colIndex=o,this.state.referencePosCell=r.getBoundingClientRect(),i=!0);let l=this.state.draggingState.draggedCellOrientation===`row`?t.top:t.left;this.state.draggingState.mousePos!==l&&(this.state.draggingState.mousePos=l,i=!0),i&&this.emitUpdate(),c&&this.editor.transact(e=>e.setMeta(oD,!0))};dropHandler=e=>{if(this.mouseState=`up`,this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw Error(`Attempted to drop table row or column, but no table block was hovered prior.`);e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state;this.state.draggingState=void 0;let i=this.state.block.content.columnWidths;if(t.draggedCellOrientation===`row`){if(!uS(this.state.block,t.originalIndex,r))return!1;let e=oS(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,rows:e}})}else{if(!dS(this.state.block,t.originalIndex,n))return!1;let e=aS(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0};getTablePos(e){if(this.tableId===void 0)return;let t=yw(this.tableId,e);return t&&t.posBeforeNode+1}update(){if(!this.state||!this.state.show)return;let e=this.editor.getBlock(this.state.block.id);if(!e||e.type!==`table`||!this.tableElement?.isConnected){this.state=void 0,this.tableId=void 0,this.tablePos=void 0,this.tableElement=void 0,this.emitUpdate();return}this.state.block=e,this.tablePos=this.getTablePos(this.pmView.state.doc);let{height:t,width:n}=tS(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=n&&(this.state.colIndex=n-1));let r=this.tableElement.querySelector(`tbody`);if(!r)throw Error(`Table block does not contain a 'tbody' HTML element. This should never happen.`);if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){let e=r.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=r.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener(`mousemove`,this.mouseMoveHandler),window.removeEventListener(`mouseup`,this.mouseUpHandler),this.pmView.dom.removeEventListener(`mousedown`,this.viewMousedownHandler),this.pmView.root.removeEventListener(`dragover`,this.dragOverHandler),this.pmView.root.removeEventListener(`drop`,this.dropHandler)}},oD=new Cr(`TableHandlesPlugin`),sD=k_(({editor:e})=>{let t,n=A_(void 0);return{key:`tableHandles`,store:n,prosemirrorPlugins:[new Nr({key:oD,view:r=>(t=new aD(e,r,e=>{n.setState(e?.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),t),props:{decorations:e=>{if(t===void 0||t.state===void 0||t.state.draggingState===void 0)return;let n=t.getTablePos(e.doc);if(n===void 0)return;let r=t.state.draggingState.draggedCellOrientation===`row`?t.state.rowIndex:t.state.colIndex;if(r===void 0)return;let i=[],{block:a,draggingState:o}=t.state,{originalIndex:s,draggedCellOrientation:c}=o;if(r===s||!a||c===`row`&&!uS(a,s,r)||c===`col`&&!dS(a,s,r))return jr.create(e.doc,i);let l=e.doc.resolve(n+1);return t.state.draggingState.draggedCellOrientation===`row`?rS(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Pr.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.left=`0`,e.style.right=`0`,r>s?e.style.bottom=`-2px`:e.style.top=`-3px`,e.style.height=`4px`,e}))}):iS(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Pr.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.top=`0`,e.style.bottom=`0`,r>s?e.style.right=`-2px`:e.style.left=`-3px`,e.style.width=`4px`,e}))}),jr.create(e.doc,i)}}})],colDragStart(n){if(t===void 0||t.state===void 0||t.state.colIndex===void 0)throw Error(`Attempted to drag table column, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`col`,originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(oD,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),!e.headless&&(eD(e.prosemirrorView.root),n.dataTransfer.setDragImage($E,0,0),n.dataTransfer.effectAllowed=`move`)},rowDragStart(n){if(t.state===void 0||t.state.rowIndex===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`row`,originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(oD,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),!e.headless&&(eD(e.prosemirrorView.root),n.dataTransfer.setDragImage($E,0,0),n.dataTransfer.effectAllowed=`copyMove`)},dragEnd(){if(t.state===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(oD,null)),!e.headless&&tD(e.prosemirrorView.root)},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},hideHandlesIfNotFrozen(){t.menuFrozen||t.hideHandles()},getCellsAtRowHandle(e,t){return rS(e,t)},getCellsAtColumnHandle(e,t){return iS(e,t)},setCellSelection(e,n,r=n){if(!t)throw Error(`Table handles view not initialized`);let i=t.getTablePos(e.doc);if(i===void 0)throw Error(`Attempted to select table cells, but the hovered table is no longer in the document.`);let a=e.doc.resolve(i+1),o=e.doc.resolve(a.posAtIndex(n.row)+1),s=e.doc.resolve(o.posAtIndex(n.col)),c=e.doc.resolve(a.posAtIndex(r.row)+1),l=e.doc.resolve(c.posAtIndex(r.col)),u=e.tr;return u.setSelection(new nv(s,l)),e.apply(u)},addRowOrColumn(t,n){e.exec((e,r)=>{let i=this.setCellSelection(e,n.orientation===`row`?{row:t,col:0}:{row:0,col:t});return n.orientation===`row`?n.side===`above`?bv(i,r):xv(i,r):n.side===`left`?mv(i,r):hv(i,r)})},removeRowOrColumn(t,n){return n===`row`?e.exec((e,n)=>Cv(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>_v(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>Ev(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>Dv(t?this.setCellSelection(e,t):e,n))},getCellSelection(){return e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if(zC(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else{let i=t.$from.pos-t.$from.parentOffset-1,a=t.$to.pos-t.$to.parentOffset-1;if(i<0||a<0||(n=e.doc.resolve(i),r=e.doc.resolve(a),!BC(n.parent)||!BC(r.parent)))return}let i=e.doc.resolve(n.pos-n.parentOffset-1),a=e.doc.resolve(r.pos-r.parentOffset-1),o=e.doc.resolve(i.pos-i.parentOffset-1),s=n.index(i.depth),c=i.index(o.depth),l=r.index(a.depth),u=a.index(o.depth),d=[];for(let e=c;e<=u;e++)for(let t=s;t<=l;t++)d.push({row:e,col:t});return{from:{row:c,col:s},to:{row:u,col:l},cells:d}})},getMergeDirection(t){return e.transact(e=>{let n=zC(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return fS(r.from,r.to,t)?`vertical`:`horizontal`})},cropEmptyRowsOrColumns(e,t){return cS(e,t)},addRowsOrColumns(e,t,n){return lS(e,t,n)}}}),cD=new Cr(`trailingNode`);function lD(e){let t=e.lastChild,n=t?.firstChild;return t?.type.name!==`blockContainer`||n?.type.name!==`paragraph`||n.content.size!==0}function uD(e){if(!e.type.schema.nodes.column){let t=e.lastChild;return t&&lD(t)?[e.content.size-1]:[]}let t=[];return e.descendants((e,n,r)=>!e.isTextblock&&((e.type.name===`column`||e.type.name===`blockGroup`&&r?.type.name===`doc`)&&lD(e)&&t.push(n+e.nodeSize-1),!0)),t}var dD=k_(({editor:e})=>{function t(t){return Pr.widget(t,()=>{let t=document.createElement(`div`);return t.className=`bn-trailing-block`,t.contentEditable=`false`,t.addEventListener(`mousedown`,n=>{n.preventDefault();let r=e.prosemirrorView;if(!r)return;let i=r.state.doc.resolve(r.posAtDOM(t,0)).parent.lastChild?.attrs.id;i&&(e.transact(t=>{let[n]=e.insertBlocks([{type:`paragraph`}],i,`after`);e.setTextCursorPosition(n,`start`),t.scrollIntoView()}),r.focus())}),t},{side:1})}function n(e,n,r){let i=n.map(e.mapping,e.doc),a=new Set(r?uD(e.doc):[]),o=new Set,s=[];for(let e of i.find())a.has(e.from)&&!o.has(e.from)?o.add(e.from):s.push(e);let c=[...a].filter(e=>!o.has(e)),l=i;return s.length>0&&(l=l.remove(s)),c.length>0&&(l=l.add(e.doc,c.map(t))),l}return{key:`trailingNode`,prosemirrorPlugins:[new Nr({key:cD,state:{init:(t,r)=>n(r.tr,jr.empty,e.isEditable),apply:(t,r)=>!t.docChanged&&!t.getMeta(cD)?r:n(t,r,e.isEditable)},view(e){let t=e.editable;return{update(e){e.editable!==t&&(t=e.editable,e.dispatch(e.state.tr.setMeta(cD,!0)))}}},props:{decorations:e=>cD.getState(e),handleKeyDown:(t,n)=>{if(n.key!==`ArrowRight`&&n.key!==`ArrowDown`)return!1;let{selection:r}=t.state;if(!r.empty)return!1;let i=kr.atEnd(t.state.doc);if(r.$head.pos!==i.$head.pos)return!1;let a=t.state.doc.lastChild;return!e.isEditable||!a||!lD(a)?!1:(n.preventDefault(),!0)}}})]}}),fD=class{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?pD(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function pD(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var mD=500;function hD({rules:e}){let t=new Nr({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return gD(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&gD(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function gD(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state.tr.insertText(r,t,n),s=o.mapping.map(t),c=o.mapping.map(n),l=null,u=o.doc.resolve(s),d=u.parent.textBetween(Math.max(0,u.parentOffset-mD),u.parentOffset,null,``);for(let t=0;t<i.length;t++){let n=i[t];if(!n.inCodeMark&&u.marks().some(e=>e.type.spec.code))continue;if(u.parent.type.spec.code){if(!n.inCode)continue}else if(n.inCode===`only`)continue;let f=n.match.exec(d);if(!f||f[0].length<r.length)continue;l??=e.state.apply(o);let p=n.handler(l,f,s-f[0].length,c);if(p)return e.dispatch(o),e.dispatch(bt(e.state.tr)),n.undoable&&p.setMeta(a,{transform:p,from:s,to:c,text:r}),e.dispatch(p),!0}return!1}new fD(/--$/,`—`,{inCodeMark:!1}),new fD(/\.\.\.$/,`…`,{inCodeMark:!1}),new fD(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new fD(/"$/,`”`,{inCodeMark:!1}),new fD(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new fD(/'$/,`’`,{inCodeMark:!1});var _D=Rt.create({name:`gapCursor`,addProseMirrorPlugins(){return[Gt()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:Ct(Bt(e,`allowGapCursor`,t))??null}}});function vD(e){return e.matches(`[data-editable]`)?e:e.querySelector(`[data-editable]`)||e}function yD(e,t){return Ir.fromSchema(t).parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}function bD(e,t){let n=[];return e.forEach(e=>{if(e.isText)n.push(e);else{let r=e.type===t.linebreakReplacement?`
|
|
246
|
-
`:e.textContent;r&&n.push(t.text(r,e.marks))}}),yr.fromArray(n)}function xD(e,t,n){let r=e.content===`plain`||n&&e.content===`styled`?t=>(r,i)=>{let a=n?.({el:r,schema:i});if(a!==void 0)return e.content===`plain`?bD(a,i):a;let o=yD(t(r),i);return e.content===`plain`?bD(o,i):o}:void 0,i=[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:e=>vD(e),getContent:r?(e,t)=>r(vD)(e,t):void 0}];return t&&i.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&n},preserveWhitespace:r?!0:void 0,getContent:r?(e,t)=>r(e=>e)(e,t):void 0}),i}function SD(e,t,n,r=`before`){let i=typeof n==`string`?n:n.id,a=Pb(e),o=t.map(e=>{let t=bS(e,a);return t.check(),t}),s=yw(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);if(o.length===0)return[];let c=Wy(e.doc,Ly(e.doc,s.posBeforeNode),r,o[0].type);if(!c)throw Error(`Cannot insert blocks at "${r}" of block "${i}": no valid position for them`);if(c.wrapIn&&!c.wrapIn.validContent(yr.from(o)))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${c.wrapIn.name}" doesn't accept them`);let l=c.wrapIn?yr.from(c.wrapIn.create(null,o)):yr.from(o),u=e.doc.resolve(c.pos);if(!u.parent.canReplace(u.index(),u.index(),l))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${u.parent.type.name}" doesn't accept them`);return e.step(new Dr(c.pos,c.pos,new Or(l,0,0))),o.map(t=>Kb(t,e.doc))}function CD(e){if(e.type.name===`blockContainer`){let t=e.firstChild;return e.childCount===1&&!!t&&t.type.name===`paragraph`&&t.childCount===0}return yy(e.type)?e.childCount===1?CD(e.firstChild):e.childCount===0&&Ty(e.type.spec.blockConfig?.children)>=1:!1}function wD(e,t){let n=e.doc.resolve(t).nodeAfter;if(!n||!yy(n.type))throw Error(`Invalid layoutBlockPos: does not point to a layout block node.`);if(xy(n.type))return;let r=n.type.spec.blockConfig?.children;if(r&&`dissolve`in r&&r.dissolve===!1)return;let i=Ty(n.type.spec.blockConfig?.children),a=[],o=[];if(n.forEach((e,n)=>{if(!CD(e))a.push({node:e,offset:n});else if(yy(e.type)){let r=t+1+n;o.push({from:r,to:r+e.nodeSize})}}),a.length>=i){for(let{from:t,to:n}of o.reverse())e.delete(t,n);return}if(a.length===1){let[{node:r,offset:i}]=a,o=t+1+i,s=xy(r.type)?{from:o+1,to:o+r.nodeSize-1}:{from:o,to:o+r.nodeSize};e.step(new Ar(t,t+n.nodeSize,s.from,s.to,Or.empty,0,!1));return}let s=[];for(let{node:e}of a)xy(e.type)?e.forEach(e=>s.push(e)):s.push(e);e.replaceWith(t,t+n.nodeSize,yr.from(s))}function TD(e,t){[...t].sort((e,t)=>t.depth-e.depth).forEach(({id:t})=>{let n=yw(t,e.doc);n&&yy(n.node.type)&&wD(e,n.posBeforeNode)})}function ED(e,t,n,r={}){let i=Pb(e),a=n.map(e=>{let t=bS(e,i);return t.check(),t}),o=new Set(t.map(e=>typeof e==`string`?e:e.id)),s=[],c=[],l=typeof t[0]==`string`?t[0]:t[0].id,u=e.steps.length,d=t=>e.mapping.slice(u).map(t);if(e.doc.descendants((t,r)=>{if(o.size===0)return!1;if(!t.type.isInGroup(`bnBlock`))return!0;let i=Py(t,e.doc);if(!o.has(i))return!0;s.push(Kb(t,e.doc)),o.delete(i),n.length>0&&i===l&&e.insert(d(r),a);let u=e.doc.resolve(d(r));for(let e of qy(u.doc,u.pos))c.some(t=>t.id===e.id)||c.push(e);let f=u.node();return f.type.name===`blockGroup`&&u.node(u.depth-1).type.name!==`doc`&&f.childCount===1?e.delete(u.before(),u.after()):e.delete(u.pos,u.pos+t.nodeSize),!1}),o.size>0){let e=[...o].join(`
|
|
247
|
-
`);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return r.fixLayoutBlocks!==!1&&TD(e,c),{insertedBlocks:a.map(t=>Kb(t,e.doc)),removedBlocks:s}}var DD=(e,t)=>({tr:n,dispatch:r})=>(r&&OD(n,e,t),!0);function OD(e,t,n,r,i){let a=e.mapping.maps.length,o=Ly(e.doc,t),s=o.hasContent&&o.blockNoteType===`table`?FD(e):null,c=Pb(e);if(r!==void 0&&i!==void 0&&r>i)throw Error(`Invalid replaceFromPos or replaceToPos`);let l=n.type||o.blockNoteType,u=c.nodes[l],d=u.isInGroup(`bnBlock`)?u:c.nodes.blockContainer,f=o.hasContent&&r!==void 0&&r>=o.contentStart&&r<=o.contentEnd?r-o.contentStart:void 0,p=o.hasContent&&i!==void 0&&i>=o.contentStart&&i<=o.contentEnd?i-o.contentStart:void 0;if(o.hasContent!==u.isInGroup(`blockContent`)||!o.hasContent&&!u.validContent(o.block.node.content)){let t=Kb(o.block.node,e.doc),r=Lb(c)[l],i,a=[...t.children];Array.isArray(t.content)&&t.content.length&&(r.content===`inline`||r.content===`plain`?i=t.content:yy(u)&&a.unshift({type:`paragraph`,content:t.content}));let s=bS({id:t.id,...i?{content:i}:{},...a.length>0?{children:a}:{},...n},c);s.check();let d=e.doc.resolve(o.block.beforePos);if(!d.parent.canReplace(d.index(),d.index(),yr.from(s)))throw Error(`Cannot update block to "${l}": a "${d.parent.type.name}" doesn't accept it`);e.replaceWith(o.block.beforePos,o.block.afterPos,s)}else ND(n,e,o),o.hasContent&&kD(n,e,c.nodes[o.blockNoteType],u,o,f,p),jD(e,o.block.beforePos,d,{...n.props}),s&&o.hasContent&&ID(e,e.mapping.slice(a).map(o.content.beforePos),s)}function kD(e,t,n,r,i,a,o){let s=Pb(t),c=`keep`;if(e.content){if(typeof e.content==`string`)c=gS([e.content],s,r.name);else if(Array.isArray(e.content))c=gS(e.content,s,r.name);else if(e.content.type===`tableContent`)c=_S(e.content,s);else throw new fb(e.content.type)}else{let e=i.content.node.content;if(n.spec.content!==``&&r.spec.content!==n.spec.content&&!r.validContent(e)){if(r.inlineContent&&n.inlineContent){let e=i.content.node.textContent;c=e.length>0?[s.text(e)]:[]}else c=[]}}if(c===`keep`)jD(t,i.content.beforePos,r,{...e.props});else if(a!==void 0||o!==void 0){let n=MD(t,i.content.beforePos,r,{...e.props}),s=n+1+(a??0),l=n+1+(o??i.content.node.content.size),u=t.doc.resolve(n).depth,d=t.doc.resolve(s).depth,f=t.doc.resolve(l).depth;t.replace(s,l,new Or(yr.from(c),d-u-1,f-u-1))}else r===n||r.validContent(i.content.node.content)?AD(t,MD(t,i.content.beforePos,r,{...e.props}),yr.from(c)):t.replaceWith(i.content.beforePos,i.content.afterPos,r.createChecked({...i.content.node.attrs,...e.props},c))}function AD(e,t,n){let r=e.doc.nodeAt(t);if(!r)throw RangeError(`No node at given position`);let i=r.content,a=t+1;if(r.isTextblock){let t=i.findDiffStart(n);if(t===null)return;let{a:r,b:o}=i.findDiffEnd(n),s=Math.max(0,t-r,t-o);s>0&&(r+=s,o+=s),e.replace(a+t,a+r,new Or(n.cut(t,o),0,0));return}let o=i.childCount,s=n.childCount,c=0;for(;c<o&&c<s&&i.child(c).eq(n.child(c));)c++;let l=o,u=s;for(;l>c&&u>c&&i.child(l-1).eq(n.child(u-1));)l--,u--;if(c===l&&c===u)return;let d=a;for(let e=0;e<c;e++)d+=i.child(e).nodeSize;let f=d;for(let e=c;e<l;e++)f+=i.child(e).nodeSize;let p=[];for(let e=c;e<u;e++)p.push(n.child(e));e.step(new Dr(d,f,new Or(yr.from(p),0,0)))}function jD(e,t,n,r){let i=e.doc.nodeAt(t);if(!i)throw RangeError(`No node at given position`);let a=n.spec.attrs??{},o={};for(let e of Object.keys(r))e in a&&(o[e]=r[e]);let s={...i.attrs,...o};if(i.type===n)for(let n of Object.keys(s))s[n]!==i.attrs[n]&&e.setNodeAttribute(t,n,s[n]);else e.setNodeMarkup(t,n,s)}function MD(e,t,n,r){let i=e.mapping.maps.length;return jD(e,t,n,r),e.mapping.slice(i).map(t,-1)}function ND(e,t,n){let r=Pb(t);if(e.children!==void 0&&e.children.length>0){let i=e.children.map(e=>{let t=bS(e,r);return t.check(),t});n.children?AD(t,n.children.beforePos,yr.from(i)):n.hasContent&&t.insert(n.content.afterPos,by(r,i))}}function PD(e,t,n,r,i){let a=typeof t==`string`?t:t.id,o=yw(a,e.doc);if(!o)throw Error(`Block with ID ${a} not found`);OD(e,o.posBeforeNode,n,r,i);let s=e.doc.resolve(o.posBeforeNode).nodeAfter;if(!s)throw Error(`Block with ID ${a} not found after update`);return Kb(s,e.doc)}function FD(e){let t=`selection`in e?e.selection:null;if(!(t instanceof wr))return null;let n=e.doc.resolve(t.head),r=-1,i=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&(t===`tableCell`||t===`tableHeader`)&&(r=e),t===`table`){i=e;break}}if(r<0||i<0)return null;let a=n.before(r),o=n.before(i),s=e.doc.nodeAt(o);if(!s||s.type.name!==`table`)return null;let c=L_.get(s),l=a-(o+1),u=c.map.indexOf(l);if(u<0)return null;let d=Math.floor(u/c.width),f=u%c.width,p=a+1+1;return{row:d,col:f,offset:Math.max(0,t.head-p)}}function ID(e,t,n){let r=e.doc.nodeAt(t);if(!r||r.type.name!==`table`)return!1;let i=L_.get(r),a=Math.max(0,Math.min(n.row,i.height-1)),o=Math.max(0,Math.min(n.col,i.width-1)),s=a*i.width+o,c=i.map[s];if(c==null)return!1;let l=t+1+c+1,u=e.doc.nodeAt(l),d=l+1,f=u?u.content.size:0,p=d+Math.max(0,Math.min(n.offset,f));return`selection`in e&&e.setSelection(wr.create(e.doc,p)),!0}var LD=[[`textColor`,`data-text-color`],[`backgroundColor`,`data-background-color`]];function RD(e){return typeof e==`string`&&e!=="default"}function zD(e){return LD.some(([t])=>RD(e[t]))}function BD(e,t){for(let[n,r]of LD){let i=t?.[n];RD(i)?e.setAttribute(r,i):e.removeAttribute(r)}}var VD={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},HD=Pt.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks(){return wb(this.editor)},parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(VD))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t},contentElement:e=>Qb(e)??e},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement(`div`);t.className=`bn-block-outer`,t.setAttribute(`data-node-type`,`blockOuter`);for(let[n,r]of Object.entries(e))n!==`class`&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement(`div`);r.className=gb(`bn-block`,n.class),r.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}},addNodeView(){return(e=>{let{dom:t,contentDOM:n}=this.type.spec.toDOM(e.node),r=this.options.editor,i=tx({props:e,editor:r,blockNode:e=>e.firstChild,unframed:n});i.dom!==n&&n.appendChild(i.dom);let a=e.node.firstChild.attrs;return zD(a)&&BD(n,a),{dom:t,contentDOM:i.slot,update(e,t,r){let a=i.node;return!e.sameMarkup(a)||!i.update(e,t,r)?!1:(e.firstChild.sameMarkup(a.firstChild)||BD(n,e.firstChild.attrs),!0)},...ox(i)}})}});function UD(e,t,n,r,i){let a;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)a=gS([t],e.pmSchema,r);else if(Array.isArray(t))a=gS(t,e.pmSchema,r);else if(t.type===`tableContent`)a=_S(t,e.pmSchema);else throw new fb(t.type);let o=(i?.document??document).createDocumentFragment();for(let t of a)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let a=Gb(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:`dom`,props:void 0},a,()=>{},e);if(s){if(o.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,i);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=xr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}o.appendChild(n)}else{let e=n.serializeFragment(yr.from([t]),i);o.appendChild(e)}return o}function WD(e,t,n,r){let i=e.pmSchema.nodes.blockContainer,a=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in a)&&r.default!==void 0&&(a[n]=r.default);let o=t.children||[],s=e.blockImplementations[t.type].implementation,c={...t,props:a,children:o};if(yy(e.pmSchema.nodes[t.type])){let i=ex(e,c);if(!i)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return o.length>0&&i.slot.append(GD(e,o,n,r)),i.dom}if(!s.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);let l=s.render.call({renderType:`dom`,props:void 0},c,e);if(l.contentDOM&&t.content){let i=UD(e,t.content,n,t.type,r);l.contentDOM.appendChild(i)}let u=i.spec?.toDOM?.(i.create({id:t.id,...a}));u.contentDOM&&BD(u.contentDOM,a);let d=u.contentDOM,f=ex(e,c);return f&&(Zb(f.slot),u.contentDOM?.appendChild(f.dom),d=f.slot),d?.appendChild(l.dom),o.length>0&&d?.appendChild(KD(e,o,n,r)),u.dom}function GD(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=WD(e,a,n,r);i.appendChild(t)}return i}var KD=(e,t,n,r)=>{let i=e.pmSchema.nodes.blockGroup,a=i.spec.toDOM(i.create({})),o=GD(e,t,n,r);return a.contentDOM?.appendChild(o),a.dom},qD=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=e.closest(`.bn-block-outer`)?.previousElementSibling?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),JD=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),YD=e=>(e.querySelectorAll(`.bn-toggle-button[aria-expanded="false"]`).forEach(e=>{e.setAttribute(`aria-expanded`,`true`)}),e),XD=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),ZD=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{let t=document.createElement(`div`);t.className=`tableWrapper`;let n=document.createElement(`div`);n.className=`tableWrapper-inner`,t.appendChild(n),e.parentElement?.appendChild(t),t.appendChild(e)}),e),QD=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),$D=(e,t)=>{let n=xr.fromSchema(e),r=[qD,JD,YD,XD,ZD,QD];return{serializeBlocks:(e,i)=>{let a=KD(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},eO=class{callbacks={};on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}};function tO(e,t){return e.flatMap(e=>xy(t.nodes[e.type])?tO(e.children,t):[e])}function nO(e){return e.transact(e=>{let t=Ry(e,e.selection.anchor),n=Py(t.block.node,e.doc);if(e.selection instanceof nv)return{type:`cell`,anchorBlockId:n,anchorCellOffset:e.selection.$anchorCell.pos-t.block.beforePos,headCellOffset:e.selection.$headCell.pos-t.block.beforePos};if(e.selection instanceof Mr)return{type:`node`,anchorBlockId:n};{let r=Ry(e,e.selection.head);return{type:`text`,anchorBlockId:n,headBlockId:Py(r.block.node,e.doc),anchorOffset:e.selection.anchor-t.block.beforePos,headOffset:e.selection.head-r.block.beforePos}}})}function rO(e,t){let n=yw(t.anchorBlockId,e.doc)?.posBeforeNode;if(n===void 0)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let r;if(t.type===`cell`)r=nv.create(e.doc,n+t.anchorCellOffset,n+t.headCellOffset);else if(t.type===`node`){let t=Ly(e.doc,n);r=Mr.create(e.doc,t.hasContent?t.content.beforePos:n)}else{let i=yw(t.headBlockId,e.doc)?.posBeforeNode;if(i===void 0)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);r=wr.create(e.doc,n+t.anchorOffset,i+t.headOffset)}e.setSelection(r)}function iO(e,t,n,r){e.transact(i=>{ED(i,t,[],{fixLayoutBlocks:!1}),SD(i,tO(t,e.pmSchema),n,r)})}function aO(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=nO(e);iO(e,i,t,n),rO(r,a)})}function oO(e,t){let n=tO([t],e.pmSchema)[0],r=n&&e.pmSchema.nodes[n.type];return r&&yy(r)?r:e.pmSchema.nodes.blockContainer}function sO(e,t,n,r,i){let a=n===`up`?`before`:`after`,o=n===`up`?`after`:`before`;for(;r||i;){let s=r&&r.children.length>0,c=r?s?r.children[n===`up`?r.children.length-1:0]:r:i,l=s?o:a;if(e.transact(e=>{let n=yw(c.id,e.doc);return n!==void 0&&Wy(e.doc,Ly(e.doc,n.posBeforeNode),l,t)!==null}))return{referenceBlock:c,placement:l};i=e.getParentBlock(c),r=l===o?c:n===`up`?e.getPrevBlock(c):e.getNextBlock(c)}}function cO(e,t,n){e.transact(()=>{let r;if(n){let t=e.getBlock(n);if(!t)return;r=[t]}else r=e.getSelection()?.blocks||[e.getTextCursorPosition().block];let i=r[t===`up`?0:r.length-1],a=sO(e,oO(e,r[0]),t,t===`up`?e.getPrevBlock(i):e.getNextBlock(i),e.getParentBlock(i));a&&(n?iO(e,r,a.referenceBlock,a.placement):aO(e,a.referenceBlock,a.placement))})}function lO(e,t){cO(e,`up`,t)}function uO(e,t){cO(e,`down`,t)}function dO(e,t){return e.childCount>0&&e.type.isInGroup(`childContainer`)&&e.type.contentMatch.matchType(t)!==null}function fO(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>dO(e,t));if(!a)return!1;let o=a.startIndex;if(o===0)return!1;let s=a.parent.child(o-1);if(s.type!==t)return!1;let c=s.lastChild&&s.lastChild.type===n?2:1,l=new Or(yr.from(t.create(null,yr.from(n.create()))),c,0),u=a.start,d=a.end;return e.step(new Ar(u-c,d,u,d,l,2-c,!0)).scrollIntoView(),!0}function pO(e){return t=>fO(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup)}function mO(e){return e.transact(pO(e))}function hO(e,t,n,r){let i=r.end,a=r.$to.end(r.depth);if(i<a){let o=r.parent.child(r.endIndex-1),s=o.lastChild&&o.lastChild.type===n;e.step(new Ar(i-(s?2:1),a,i,a,new Or(yr.from(t.create(null,n.create())),s?2:1,0),+!s,!0)),r=new vr(e.doc.resolve(r.$from.pos),e.doc.resolve(a),r.depth)}let o=br(r);if(o==null)return!1;e.lift(r,o);let s=e.doc.resolve(e.mapping.map(i,-1)-1);return Sr(e.doc,s.pos)&&s.nodeBefore.type===s.nodeAfter.type&&e.join(s.pos),e.scrollIntoView(),!0}function gO(e,t,n,r){let{$from:i,$to:a}=e.selection,o=i.blockRange(a,e=>dO(e,t));if(!o)return!1;let s=i.node(o.depth-1);return s.type===t&&!r(s)?!1:s.type===t&&hO(e,t,n,o)}function _O(e){return t=>gO(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup,n=>{let r=Kb(n,t.doc);return e.schema.blockSpecs[r.type].implementation.keyboard(r).childrenCanOutdent})}function vO(e){return e.transact(_O(e))}function yO(e){return e.canExec(t=>pO(e)(t.tr))}function bO(e){return e.canExec(t=>_O(e)(t.tr))}function xO(e,t){let n=yw(typeof t==`string`?t:t.id,e);if(n)return Kb(n.node,e)}function SO(e,t){let n=yw(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode).nodeBefore;if(r)return Kb(r,e)}function CO(e,t){let n=yw(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(r)return Kb(r,e)}function wO(e,t){let n=yw(typeof t==`string`?t:t.id,e);if(!n)return;let r=By(e,n.posBeforeNode);if(r)return Kb(r.block.node,e)}var TO=class{editor;constructor(e){this.editor=e}get document(){return this.editor.transact(e=>qb(e.doc))}getBlock(e){return this.editor.transact(t=>xO(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>SO(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>CO(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>wO(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>SD(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>PD(n,e,t))}removeBlocks(e){return this.editor.transact(t=>ED(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>ED(n,e,t))}canNestBlock(){return yO(this.editor)}nestBlock(){mO(this.editor)}canUnnestBlock(){return bO(this.editor)}unnestBlock(){vO(this.editor)}moveBlocksUp(e){return lO(this.editor,e)}moveBlocksDown(e){return uO(this.editor,e)}},EO=class extends eO{editor;constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`focus`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!0,event:t})}),e._tiptapEditor.on(`blur`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!1,event:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})});let t;this.onMount(()=>{t=this.attachUIFocusTracker()}),this.onUnmount(()=>{t&&t()})})}attachUIFocusTracker(){if(typeof document>`u`)return()=>{};let e=this.editor.isFocused({includeEditorUI:!0}),t,n=t=>{let n=this.editor.isFocused({includeEditorUI:!0});n!==e&&(e=n,this.emit(`onFocusChangeWithinUI`,{editor:this.editor,focused:n,event:t}))},r=e=>n(e),i=e=>{clearTimeout(t),t=setTimeout(()=>n(e))};return document.addEventListener(`focusin`,r,!0),document.addEventListener(`focusout`,i,!0),()=>{clearTimeout(t),document.removeEventListener(`focusin`,r,!0),document.removeEventListener(`focusout`,i,!0)}}onChange(e,t=!0){return this.on(`onChange`,({transaction:n,appendedTransactions:r})=>{(t||!DO(n))&&e(this.editor,{getChanges(){return zw(n,r)}})})}onSelectionChange(e,t=!1){return this.on(`onSelectionChange`,({transaction:n})=>{(t||!DO(n))&&e(this.editor)})}onFocusChange(e,t){return this.on(t?.includeEditorUI?`onFocusChangeWithinUI`:`onFocusChange`,({focused:t,event:n})=>e(this.editor,{focused:t,event:n}))}onMount(e){return this.on(`onMount`,e)}onUnmount(e){return this.on(`onUnmount`,e)}};function DO(e){return!!e.getMeta(`y-sync$`)}function OO(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function kO(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function AO(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=OO(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(kO(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function jO(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}var MO=null;function NO(){return MO||=document.implementation.createHTMLDocument(`title`)}function PO(e){if(typeof e==`string`){let t=NO().createElement(`div`);t.innerHTML=e,e=t}return AO(e),jO(e),e}function FO(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function IO(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function LO(e){FO(e)||IO(e)}function RO(e){let t=[];for(let n of e)if(n.type===`text`){let e=n.text.split(``).join(``);e.length>0&&t.push({...n,text:e})}else Array.isArray(n.content)?t.push({...n,content:RO(n.content)}):t.push(n);return t}function zO(e){for(let t of e)Array.isArray(t.content)&&(t.content=RO(t.content)),t.children.length>0&&zO(t.children)}function BO(e,t){let n=PO(e);LO(n);let r=Ir.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),i=[];for(let e=0;e<r.childCount;e++)i.push(Kb(r.child(e),r));return zO(i),i}function VO(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function HO(e){return e?/\w/.test(e):!1}function UO(e,t,n){let r=t>0?e[t-1]:void 0,i=t+n<e.length?e[t+n]:void 0;return HO(r)&&HO(i)}function WO(e,t){if(e[t]!==`\\`||t+1>=e.length)return null;let n=e[t+1];return n===`
|
|
248
|
-
`?{html:`<br>
|
|
249
|
-
`,end:t+2}:"\\`*_{}[]()#+-.!~|>".includes(n)?{html:VO(n),end:t+2}:null}function GO(e,t){return e[t]==="`"?dk(e,t):null}function KO(e,t){return e[t]!==`!`||e[t+1]!==`[`?null:fk(e,t)}function qO(e,t){return e[t]===`[`?pk(e,t):null}function JO(e,t){let n=e.substring(t);if(e[t]===`<`){let e=n.match(/^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^\s<>]*)>/);if(e){let n=e[1];return{html:`<a href="${VO(n)}">${VO(n)}</a>`,end:t+e[0].length}}let r=n.match(/^<([^\s<>]+)>/),i=r?.[1],a=i?WT(i).find(e=>e.type===`email`&&e.start===0&&e.end===i.length):void 0;return r&&i&&a?{html:`<a href="${VO(a.href)}">${VO(i)}</a>`,end:t+r[0].length}:null}if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return null;let r=n.match(/^(https?:\/\/|www\.)[^\s<>]+/i);if(!r)return null;let i=YT(r[0]);return i?{html:`<a href="${VO(i.href)}">${VO(i.value)}</a>`,end:t+i.value.length}:null}function YO(e,t,n){return e[t]!==`~`||e[t+1]!==`~`?null:_k(e,t,`~~`,`<del>`,`</del>`,n)}function XO(e,t,n){return e[t]===`*`&&e[t+1]===`*`&&e[t+2]===`*`||e[t]===`_`&&e[t+1]===`_`&&e[t+2]===`_`&&!UO(e,t,3)?_k(e,t,e.substring(t,t+3),`<strong><em>`,`</em></strong>`,n):null}function ZO(e,t,n){return e[t]===`*`&&e[t+1]===`*`||e[t]===`_`&&e[t+1]===`_`&&!UO(e,t,2)?_k(e,t,e.substring(t,t+2),`<strong>`,`</strong>`,n):null}function QO(e,t,n){return e[t]===`*`||e[t]===`_`&&!UO(e,t,1)?_k(e,t,e[t],`<em>`,`</em>`,n):null}function $O(e,t){return e[t]===`
|
|
250
|
-
`?{html:`<br>
|
|
251
|
-
`,end:t+1}:null}var ek=/^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/,tk=/^<!--[\s\S]*?-->/,nk=/^<!\[CDATA\[[\s\S]*?\]\]>/,rk=/^<\?[\s\S]*?\?>/,ik=/^<![A-Za-z][\s\S]*?>/;function ak(e,t){if(e[t]!==`<`)return null;let n=e.substring(t);for(let e of[tk,nk,rk,ik,ek]){let r=n.match(e);if(r)return{html:r[0],end:t+r[0].length}}return null}var ok=new Set(`\\\`![~*_
|
|
252
|
-
<`);function sk(e,t){let n=e[t];return ok.has(n)?!0:n===`h`?e.startsWith(`http://`,t)||e.startsWith(`https://`,t):n===`w`&&e.startsWith(`www.`,t)}var ck=[WO,GO,KO,qO,JO,YO,XO,ZO,QO,ak,$O],lk=ck.filter(e=>e!==qO&&e!==JO);function uk(e,t=!0){let n=``,r=0,i=t?ck:lk;for(;r<e.length;){if(e[r]===`
|
|
253
|
-
`&&r>=2&&e[r-1]===` `&&e[r-2]===` `){n=n.replace(/ +$/,``),n+=`<br>
|
|
254
|
-
`,r++;continue}let a=!1;if(sk(e,r))for(let o of i){let i=o(e,r,t);if(i){n+=i.html,r=i.end,a=!0;break}}if(!a){let t=r;for(r++;r<e.length&&!sk(e,r);)r++;n+=VO(e.substring(t,r))}}return n}function dk(e,t){let n=0,r=t;for(;r<e.length&&e[r]==="`";)n++,r++;let i=r;for(;i<e.length;)if(e[i]==="`"){let t=0,a=i;for(;i<e.length&&e[i]==="`";)t++,i++;if(t===n){let t=e.substring(r,a);return t=t.replace(/\n/g,` `),t.length>=2&&t[0]===` `&&t[t.length-1]===` `&&/[^ ]/.test(t)&&(t=t.substring(1,t.length-1)),{html:`<code>${VO(t)}</code>`,end:i}}}else i++;return null}function fk(e,t){let n=mk(e,t+1);if(n===-1)return null;let r=t+2;if(e[n+1]!==`(`)return null;let i=n+2,a=hk(e,i-1);if(a===-1)return null;let o=e.substring(r,n),{url:s,title:c}=gk(e.substring(i,a));if(kb(s)){let e=o||c;return{html:`<video src="${VO(s)}"${e?` data-name="${VO(e)}"`:``} data-url="${VO(s)}" controls></video>`,end:a+1}}let l=c===void 0?``:` title="${VO(c)}"`;return{html:`<img src="${VO(s)}" alt="${VO(o)}"${l}>`,end:a+1}}function pk(e,t){let n=t+1,r=mk(e,t);if(r===-1||e[r+1]!==`(`)return null;let i=r+2,a=hk(e,r+1);if(a===-1)return null;let o=e.substring(n,r),{url:s,title:c}=gk(e.substring(i,a)),l=c===void 0?``:` title="${VO(c)}"`;return{html:`<a href="${VO(s)}"${l}>${uk(o,!1)}</a>`,end:a+1}}function mk(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`[`&&n++,e[r]===`]`&&(n--,n===0))return r;return-1}function hk(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`(`&&n++,e[r]===`)`&&(n--,n===0))return r;return-1}function gk(e){e=e.trim();let t,n;if(e.startsWith(`<`)){let r=e.indexOf(`>`);r===-1?(t=e.substring(1),n=``):(t=e.substring(1,r),n=e.substring(r+1).trim())}else{let r=e.length;for(let t=0;t<e.length;t++)if(e[t]===`\\`&&t+1<e.length)t++;else if(e[t]===` `||e[t]===` `||e[t]===`
|
|
255
|
-
`){r=t;break}t=e.substring(0,r),n=e.substring(r).trim()}let r;if(n.length>0){let e=n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);e&&(r=e[1]??e[2]??e[3])}return{url:t,title:r}}function _k(e,t,n,r,i,a){let o=n.length,s=t+o;if(s>=e.length||e[s]===` `||e[s]===` `)return null;let c=s;for(;c<e.length;)if(e[c]===`\\`&&c+1<e.length)c+=2;else{if(e.substring(c,c+o)===n){if(e[c-1]===` `||e[c-1]===` `||o===1&&(c>0&&e[c-1]===n[0]&&!(c>=2&&e[c-2]===`\\`)||c+o<e.length&&e[c+o]===n[0])){c++;continue}let t=e.substring(s,c);if(t.length===0){c++;continue}return{html:r+uk(t,a)+i,end:c+o}}c++}return null}var vk=new Set(`address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`));function yk(e){if(/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e))return!0;let t=e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);return t?vk.has(t[1].toLowerCase()):!1}function bk(e){let t=e.split(`
|
|
256
|
-
`),n=[],r=0,i=!0;for(;r<t.length;){let e=t[r];if(e.trim()===``){i=!0,r++;continue}let a=e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(a){let e=a[1],o=e[0],s=e.length,c=a[2].trim(),l=[];for(r++;r<t.length;){if(t[r].match(RegExp(`^ {0,3}${o}{${s},}\\s*$`))){r++;break}l.push(t[r]),r++}n.push({type:`codeBlock`,language:c||``,code:l.join(`
|
|
257
|
-
`)}),i=!1;continue}let o=e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);if(o){n.push({type:`heading`,level:o[1].length,content:o[2]}),i=!1,r++;continue}if(/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)){let t=n[n.length-1];if(!i&&e.trim().match(/^-+$/)&&t&&t.type===`paragraph`){let e=t;n[n.length-1]={type:`heading`,level:2,content:e.content},i=!1,r++;continue}n.push({type:`hr`}),i=!1,r++;continue}if(r+1<t.length){let a=t[r+1];if(/^={1,}\s*$/.test(a)&&e.trim().length>0){n.push({type:`heading`,level:1,content:e.trim()}),i=!1,r+=2;continue}}let s=xk(t,r);if(s){n.push(s.token),r=s.nextLine,i=!1;continue}if(/^\s{0,3}>/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r++;for(;r<t.length;){let n=t[r];if(n.trim()===``||/^\s{0,3}>/.test(n)||/^(#{1,6})\s/.test(n)||/^(`{3,}|~{3,})/.test(n)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n)||/^\s*([-*+]|\d+[.)])\s+/.test(n)||/^\s*\|(.+\|)+\s*$/.test(n))break;e.push(n),r++}n.push({type:`blockquote`,content:e.join(`
|
|
258
|
-
`)}),i=!1;continue}let c=e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);if(c){let e=c[1].length,a=c[2],o=c[3],s=c[4],l=c[5],u,d,f;s?(u=`task`,f=s.trim()!==`[ ]`):/^\d+[.)]$/.test(a)?(u=`ordered`,d=parseInt(a,10)):u=`bullet`;let p=e+a.length+o.length+(s?s.length:0),m=e+1,h=e=>{if(e.trim()===``)return!0;let t=e.match(/^\s*/)[0].length;return!!(t>=p||t>=m&&e.match(/^\s*([-*+]|\d+[.)])\s+/))};r++;let g=[];for(;r<t.length;){let e=t[r];if(e.trim()===``){let e=r+1;for(;e<t.length&&t[e].trim()===``;)e++;if(e<t.length&&h(t[e])){g.push(``),r++;continue}break}if(!h(e))break;e.match(/^\s*/)[0].length>=p?g.push(e.substring(p)):g.push(e.substring(m)),r++}let _=g.join(`
|
|
259
|
-
`).replace(/^\n+|\n+$/g,``);n.push({type:`listItem`,listType:u,indent:e,content:l.trim(),start:d,checked:f,childContent:_||void 0}),i=!1;continue}if(yk(e)){let e=[];for(;r<t.length&&t[r].trim()!==``;)e.push(t[r]),r++;n.push({type:`rawHtml`,content:e.join(`
|
|
260
|
-
`)}),i=!1;continue}let l=[e];for(r++;r<t.length;){let e=t[r];if(e.trim()===``||/^(#{1,6})\s/.test(e)||/^(`{3,}|~{3,})/.test(e)||/^\s{0,3}>/.test(e)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)||/^\s*([-*+]|\d+[.)])\s+/.test(e)||/^\s*\|(.+\|)+\s*$/.test(e)||yk(e)||r+1<t.length&&/^[=-]+\s*$/.test(t[r+1])&&e.trim().length>0)break;l.push(e),r++}n.push({type:`paragraph`,content:l.map(e=>e.replace(/^ {1,3}/,``)).join(`
|
|
261
|
-
`).replace(/[ \t]+$/,``)}),i=!1}return n}function xk(e,t){if(t+1>=e.length)return null;let n=e[t],r=e[t+1];if(!r.includes(`|`)||!/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r)||!n.includes(`|`))return null;let i=Sk(n),a=Ck(r),o=[],s=t+2;for(;s<e.length;){let t=e[s];if(!t.includes(`|`))break;o.push(Sk(t)),s++}return{token:{type:`table`,headers:i,rows:o,alignments:a},nextLine:s}}function Sk(e){let t=e.trim(),n=t.startsWith(`|`)?t.substring(1):t,r=n.endsWith(`|`)?n.substring(0,n.length-1):n,i=[],a=``;for(let e=0;e<r.length;e++)r[e]===`\\`&&e+1<r.length&&r[e+1]===`|`?(a+=`|`,e++):r[e]===`|`?(i.push(a.trim()),a=``):a+=r[e];return i.push(a.trim()),i}function Ck(e){return Sk(e).map(e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:r?`right`:n?`left`:null})}function wk(e){let t=``,n=0;for(;n<e.length;){let r=e[n];switch(r.type){case`heading`:{let e=r;t+=`<h${e.level}>${uk(e.content)}</h${e.level}>`,n++;break}case`paragraph`:t+=`<p>${uk(r.content)}</p>`,n++;break;case`codeBlock`:{let e=r,i=e.language?` data-language="${VO(e.language)}"`:``;t+=`<pre><code${i}>${VO(e.code)}</code></pre>`,n++;break}case`blockquote`:{let e=wk(bk(r.content));t+=`<blockquote>${e}</blockquote>`,n++;break}case`hr`:t+=`<hr>`,n++;break;case`listItem`:{let r=Tk(e,n);t+=r.html,n=r.nextIndex;break}case`table`:t+=Dk(r),n++;break;case`rawHtml`:t+=r.content,n++;break;default:n++}}return t}function Tk(e,t){let n=``,r=t,i=null;for(;r<e.length&&e[r].type===`listItem`;){let t=e[r],a=Ek(t.listType);if(i!==null&&i!==a&&(n+=`</${i===`ordered`?`ol`:`ul`}>`,i=null),i===null){if(a===`ordered`){let e=t.start!==void 0&&t.start!==1?` start="${t.start}"`:``;n+=`<ol${e}>`}else n+=`<ul>`;i=a}if(t.listType===`task`){let e=t.checked?` checked`:``;n+=`<li><input type="checkbox" disabled${e}><p>${uk(t.content)}</p>`}else n+=`<li><p>${uk(t.content)}</p>`;if(t.childContent){let e=bk(t.childContent);n+=wk(e)}n+=`</li>`,r++}return i!==null&&(n+=`</${i===`ordered`?`ol`:`ul`}>`),{html:n,nextIndex:r}}function Ek(e){return e===`ordered`?`ordered`:`bullet`}function Dk(e){let t=`<table>`,n=e.headers.every(e=>e.trim()===``),r=e.headers.length;if(!n){t+=`<thead><tr>`;for(let n=0;n<r;n++){let r=e.alignments[n],i=r?` align="${r}"`:``;t+=`<th${i}>${uk(e.headers[n])}</th>`}t+=`</tr></thead>`}if(e.rows.length>0){t+=`<tbody>`;for(let n of e.rows){t+=`<tr>`;for(let i=0;i<r;i++){let r=i<n.length?n[i]:``,a=e.alignments[i],o=a?` align="${a}"`:``;t+=`<td${o}>${uk(r)}</td>`}t+=`</tr>`}t+=`</tbody>`}return t+=`</table>`,t}function Ok(e){return wk(bk(e))}function kk(e){return Ok(e)}function Ak(e,t){return BO(kk(e),t)}var jk=class{editor;constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return Nw(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return $D(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return BO(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return jE(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return Ak(e,this.editor.pmSchema)}pasteHTML(e,t=!1){let n=e;if(!t){let t=this.tryParseHTMLToBlocks(e);n=this.blocksToFullHTML(t)}n&&this.editor.prosemirrorView?.pasteHTML(n)}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=kk(e);return this.pasteHTML(t)}};function Mk(e){let{block:t}=zy(e),n=e.doc.resolve(t.beforePos).nodeBefore,r=e.doc.resolve(t.afterPos).nodeAfter,i=By(e.doc,t.beforePos)?.block.node;return{block:Kb(t.node,e.doc),prevBlock:n===null?void 0:Kb(n,e.doc),nextBlock:r===null?void 0:Kb(r,e.doc),parentBlock:i===void 0?void 0:Kb(i,e.doc)}}function Nk(e,t,n=`start`){let r=typeof t==`string`?t:t.id,i=yw(r,e.doc);if(!i)throw Error(`Block with ID ${r} not found`);e.setSelection(Ay(e.doc,Iy(i.node,i.posBeforeNode),n))}var Pk=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`];function Fk(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function Ik(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function Lk(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function Rk(e,t){if(!t.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let n=`dataTransfer`in e?e.dataTransfer:e.clipboardData;if(n===null)return;let r=null;for(let e of Pk)if(n.types.includes(e)){r=e;break}if(r!==`Files`)return;let i=n.items;if(i){e.preventDefault();for(let n=0;n<i.length;n++){let r=`file`;for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta.fileBlockAccept||[]){let a=t.startsWith(`.`),o=i[n].getAsFile();if(o&&(!a&&o.type&&Ik(i[n].type,t)||a&&Fk(`.`+o.name.split(`.`).pop(),t))){r=e.config.type;break}}let a=i[n].getAsFile();if(a){let n={type:r,props:{name:a.name}},i;if(e.type===`paste`){let e=t.getTextCursorPosition().block;i=Lk(t,e,n)}else if(e.type===`drop`){let r={left:e.clientX,top:e.clientY},a=t.prosemirrorView.posAtCoords(r);if(!a)return;i=t.transact(e=>{let i=Py(Ry(e,a.pos).block.node,e.doc),o=(t.domElement?.querySelector(`[data-id="${i}"]`))?.getBoundingClientRect(),s=t.getBlock(i);if(s)return Lk(t,s,n,o&&(o.top+o.bottom)/2>r.top?`before`:`after`)})}else return;if(!i)return;let o=await t.uploadFile(a,i),s=typeof o==`string`?{props:{url:o}}:{...o};t.updateBlock(i,s)}}}}var zk=e=>Rt.create({name:`dropFile`,addProseMirrorPlugins(){return[new Nr({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of Pk)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null||r===`Files`&&(Rk(n,e),!0)}}}})]}}),Bk=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,Vk=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,Hk=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,Uk=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,Wk=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,Gk=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,Kk=/\n{2} {0,3}-{2,48}\n{2}/,qk=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,Jk=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,Yk=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,Xk=/^\s*\|(.+\|)+\s*$/m,Zk=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,Qk=/^\s*\|(.+\|)+\s*$/m,$k=e=>Bk.test(e)||Vk.test(e)||Hk.test(e)||Uk.test(e)||Wk.test(e)||Gk.test(e)||Kk.test(e)||qk.test(e)||Jk.test(e)||Yk.test(e)||Xk.test(e)||Zk.test(e)||Qk.test(e);function eA(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r||!n.nodes.codeBlock)return!1;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
|
|
262
|
-
`)}</code></pre>`),!0):!1}function tA({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of Pk)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`){if(eA(e,t.prosemirrorView))return!0;i=`text/plain`}if(i===`Files`)return Rk(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if($k(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}var nA=(e,t)=>Rt.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new Nr({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>tA({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}});function rA(e,t,n){let r=!1,i=e.state.selection instanceof nv;if(!i){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,i=[];for(let e=0;e<n.childCount;e++)i.push(n.child(e));r=i.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,r&&(t=n)}let a,o=Nw(e.state.schema,n);if(i){t.firstChild?.type.name===`table`&&(t=t.firstChild.content);let e=Ub(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=`<table>${o.exportInlineContent(e,{})}</table>`}else if(r){let e=Wb(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=o.exportInlineContent(e,{})}else{let e=Kw(t);a=o.exportBlocks(e,{})}return a}function iA(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new Mr(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,i=rA(e,r,t),{$from:a,$to:o}=e.state.selection,s=a.parent.type.name,c=t.schema.blockSpecs[s];return{clipboardHTML:n,externalHTML:i,markdown:a.sameParent(o)&&c?.implementation.meta.code===!0?e.state.doc.textBetween(a.pos,o.pos):AE(i)}}var aA=e=>{if(e.state.selection.empty)return!0;let t=window.getSelection();if(t&&!t.isCollapsed){let e=t.focusNode;for(;e;){if(e instanceof HTMLElement&&e.getAttribute(`contenteditable`)===`false`)return!0;e=e.parentElement}}return!1},oA=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=iA(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},sA=e=>Rt.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new Nr({props:{handleDOMEvents:{copy(t,n){return aA(t)||oA(e,t,n),!0},cut(t,n){return aA(t)||(oA(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection())),!0},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new Mr(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=iA(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),cA=Rt.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:TS()}}]}}),lA=Pt.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,en(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
263
|
-
`}});function uA(e,t){return e.contentKind===`inline`&&t.contentKind===`inline`?t.content.node.content:void 0}function dA(e,t,n,r){if(!n.children)return!1;let i=uA(n,r);if(i===void 0||i.size>0&&!n.content.node.type.validContent(n.content.node.content.append(i)))return!1;if(t){let a=e.tr;n.children.node.childCount===1&&!r.children?a.delete(n.children.beforePos,n.children.afterPos):a.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??yr.empty);let o=n.contentEnd;i.size>0&&a.insert(o,i),a.setSelection(kr.near(a.doc.resolve(o),-1)),t(a.scrollIntoView())}return!0}var fA=e=>({state:t,dispatch:n})=>{let r=Ly(t.doc,e);if(!r.hasContent)return!1;let i=Vy(t.doc,r.block.beforePos);if(!i){let e=By(t.doc,r.block.beforePos);return e?.hasContent?dA(t,n,e,r):!1}let a=Uy(i);if(!a.hasContent||uA(a,r)===void 0)return!1;if(a.isContentEmpty&&a.content.node.sameMarkup(r.content.node)){if(n){let e=t.tr.delete(r.block.beforePos,r.block.afterPos).replaceWith(a.block.beforePos,a.block.afterPos,r.block.node);e.setSelection(wr.create(e.doc,a.contentStart)),n(e.scrollIntoView())}return!0}if(n&&r.children){let e=t.doc.resolve(r.children.childrenStart).blockRange(t.doc.resolve(r.children.childrenEnd));if(!e)throw Error(`Children of a block are expected to form a block range`);t.tr.lift(e,t.doc.resolve(r.block.beforePos).depth)}return n&&n(t.tr.delete(a.contentEnd,r.contentStart)),!0},pA=(e,t,n,r)=>({state:i,dispatch:a})=>!a||mA(i.tr,e,t,n,r),mA=(e,t,n,r,i)=>{let a=Fy(e.doc,t),o=Iy(a.node,a.posBeforeNode);if(!o.hasContent)return!1;let s=Pb(e),c=[{type:o.block.node.type,attrs:r?{...o.block.node.attrs,id:void 0}:{}},{type:n?o.content.node.type:s.nodes.paragraph,attrs:r?{...o.content.node.attrs}:{}}],l=i&&t!==o.contentStart?o.children:void 0;if(l&&e.delete(l.beforePos,l.afterPos),e.split(t,2,c),l){let t=e.doc.nodeAt(o.block.beforePos);if(!t?.firstChild)throw Error(`Split lost its original block`);e.insert(o.block.beforePos+1+t.firstChild.nodeSize,l.node)}return!0};function hA(e,t,n){let r=qy(e.doc,t.beforePos);e.delete(t.beforePos,t.afterPos);let i=e.mapping.map(n);e.insert(i,t.node);let a=e.steps.length;TD(e,r),e.setSelection(wr.near(e.doc.resolve(e.mapping.slice(a).map(i)+1)))}function gA(e,t,n,r=n.block){return e.insertContentAt(n.block.afterPos,n.children?.node.content||yr.empty).deleteRange({from:r.beforePos,to:r.afterPos}).insertContentAt(t.contentEnd,uA(t,n)??null).setTextSelection(t.contentEnd).scrollIntoView().run()}var _A=Rt.create({priority:50,addKeyboardShortcuts(){let e=this.options.editor;function t(t,n){let r=Kb(t,n);return e.schema.blockSpecs[r.type].implementation.keyboard(r)}function n(e){return n=>t(n,e).childrenCanOutdent}let r=()=>this.editor.commands.first(({chain:e,commands:r})=>[()=>r.deleteSelection(),()=>r.undoInputRule(),()=>r.command(({state:e})=>{let n=zy(e);if(!n.hasContent||e.selection.from!==n.contentStart)return!1;let i=t(n.block.node,e.doc).resetsTo,a=n.content.node;return a.type.name===i.type&&Object.entries(i.props??{}).every(([e,t])=>a.attrs[e]===t)?!1:r.command(DD(n.block.beforePos,i))}),()=>r.command(({state:t})=>{let n=zy(t);if(!n.hasContent)return!1;let{block:r}=n,i=Vy(t.doc,n.block.beforePos);if(i&&!i.hasContent)return!1;let a=t.selection.from===n.contentStart,o=t.selection.empty,s=r.beforePos;return a&&o?e().command(fA(s)).scrollIntoView().run():!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=zy(e);if(!r.hasContent||e.selection.from!==r.contentStart)return!1;let i=r.block.node.type,a=Vy(t.doc,r.block.beforePos),o;if(a){if(a.hasContent)return!1}else{let e=t.doc.resolve(r.block.beforePos);if(!yy(e.parent.type))return!1;let n=t.doc.resolve(e.before()),s=n.nodeBefore;yy(n.parent.type)&&s&&yy(s.type)?a=Iy(s,n.pos-s.nodeSize):o=Ky(t.doc,n.pos,i)}return a&&(o=Wy(t.doc,a,`last-child`,i)?.pos),o!==void 0&&(n&&hA(t,r.block,o),!0)}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=zy(e);if(!r.hasContent||!e.selection.empty||r.contentKind!==`inline`||!r.isContentEmpty)return!1;let i=Vy(e.doc,r.block.beforePos),a=i?void 0:By(e.doc,r.block.beforePos),o=i?Uy(i):a;return o?.hasContent?(n&&(a?.children?.node.childCount===1&&!r.children?t.delete(a.children.beforePos,a.children.afterPos):t.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??yr.empty),t.setSelection(o.contentKind===`none`?Mr.create(t.doc,o.content.beforePos):wr.near(t.doc.resolve(o.contentEnd),-1)),t.scrollIntoView()),!0):!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=zy(e);if(!r.hasContent)return!1;let i=e.selection.from===r.contentStart,a=e.selection.empty,o=Vy(e.doc,r.block.beforePos);if(o&&i&&a){let e=Uy(o);if(!e.hasContent)return!1;if(e.contentKind===`none`||e.contentKind===`inline`&&e.isContentEmpty)return n&&(t.delete(r.block.beforePos,r.block.afterPos),t.replaceWith(e.block.beforePos,e.block.afterPos,r.block.node),t.setSelection(wr.near(t.doc.resolve(e.block.beforePos+2))),t.scrollIntoView()),!0}return!1}),()=>r.command(({state:e,tr:t})=>{let r=zy(e);return!r.hasContent||!e.selection.empty||e.selection.from!==r.contentStart?!1:gO(t,t.doc.type.schema.nodes.blockContainer,t.doc.type.schema.nodes.blockGroup,n(t.doc))})]),i=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=zy(t);if(!n.hasContent||!n.children)return!1;let{children:r}=n;if(r.node.childCount===0)return!1;let i=t.selection.from===n.contentEnd,a=t.selection.empty,o=Ly(t.doc,r.childrenStart);return o.hasContent&&i&&a?gA(e(),n,o,r.node.childCount===1?r:o.block):!1}),()=>t.command(({state:t})=>{let n=zy(t);if(!n.hasContent)return!1;let{block:r}=n,i=Hy(t.doc,n.block.beforePos);if(!i||!i.hasContent)return!1;let a=t.selection.from===n.contentEnd,o=t.selection.empty,s=r.afterPos;return a&&o?e().command(fA(s)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=zy(e);if(!r.hasContent||e.selection.from!==r.contentEnd)return!1;let i=t.doc.resolve(r.block.afterPos);for(;!i.nodeAfter&&i.depth>0&&yy(i.parent.type);)i=t.doc.resolve(i.after());let a=i.nodeAfter;if(!a||i.pos===r.block.afterPos&&!yy(a.type))return!1;let o=Gy(Iy(a,i.pos));return o?(n&&hA(t,o.block,r.block.afterPos),!0):!1}),()=>t.command(({state:t})=>{let n=zy(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty;if(r&&i){let r,i=n;for(;i&&(r=Hy(t.doc,i.block.beforePos),!r);)i=By(t.doc,i.block.beforePos);return!r||!r.hasContent?!1:gA(e(),n,r,r.block)}return!1}),()=>t.command(({state:t})=>{let n=zy(t);if(!n.hasContent)return!1;if(n.isContentEmpty&&n.contentKind===`inline`){let r=Hy(t.doc,n.block.beforePos);if(!r||!r.hasContent)return!1;let i=e();return i.command(({tr:e})=>(e.setSelection(Ay(e.doc,r,`start`)),!0)),i.deleteRange({from:n.block.beforePos,to:n.block.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=zy(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty,a=Hy(t.doc,n.block.beforePos);return!a||!a.hasContent?!1:a&&r&&i&&(a.contentKind===`none`||a.contentKind===`inline`&&a.isContentEmpty)?e().deleteRange({from:a.block.beforePos,to:a.block.afterPos}).insertContentAt(n.block.afterPos,a.children?.node.content??null).run():!1})]),a=(e=!1)=>this.editor.commands.first(({commands:r,tr:i})=>[()=>r.command(({state:e})=>{let n=zy(e);if(!n.hasContent||!e.selection.empty||!n.isContentEmpty)return!1;let i=t(n.block.node,e.doc);return i.emptyEnterResets?r.command(DD(n.block.beforePos,i.resetsTo)):!1}),()=>r.command(({state:e,tr:r})=>{let i=zy(e);if(!i.hasContent)return!1;let{block:a}=i,{depth:o}=e.doc.resolve(a.beforePos),s=e.selection.$anchor.parentOffset===0,c=e.selection.anchor===e.selection.head,l=i.isContentEmpty;if(s&&c&&l&&o>1){let i=By(e.doc,a.beforePos);return i&&t(i.block.node,e.doc).emptyChildEnter!==`outdent`?!1:gO(r,r.doc.type.schema.nodes.blockContainer,r.doc.type.schema.nodes.blockGroup,n(r.doc))}return!1}),()=>r.command(({state:n})=>{let r=zy(n),a=this.options.editor.schema.blockSpecs[r.blockNoteType],o=t(r.block.node,n.doc);if(o.enter===`line-break`||e&&o.shiftEnter===`line-break`){if(a?.config?.content===`plain`)return i.insertText(`
|
|
264
|
-
`,i.selection.head),!0;let e=i.storedMarks||i.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return i.insert(i.selection.head,i.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=zy(e);if(!i.hasContent)return!1;let a=e.selection.anchor===e.selection.head,o=i.isContentEmpty;if(!a||!o)return!1;let s=n.doc.resolve(i.block.beforePos);if(n.doc.resolve(i.block.afterPos).nodeAfter!==null)return!1;let c=By(n.doc,i.block.beforePos);if(!c||t(c.block.node,n.doc).emptyChildEnter!==`exit-at-end`||s.index()===0&&c.hasContent)return!1;let l=Ky(n.doc,c.block.afterPos,e.schema.nodes.blockContainer,`after`);return l!==void 0&&(r&&(hA(n,i.block,l),n.scrollIntoView()),!0)}),()=>r.command(({state:e,dispatch:n,tr:r})=>{let i=zy(e);if(!i.hasContent)return!1;let{block:a}=i,o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=i.isContentEmpty;if(o&&s&&c&&t(i.block.node,e.doc).enter!==`into-children`){let t=a.afterPos,o=t+2;if(n){let n=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,i.children?.node].filter(e=>e!==void 0));r.insert(t,n).setSelection(new wr(r.doc.resolve(o))).scrollIntoView(),i.children&&r.delete(i.children.beforePos,i.children.afterPos)}return!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=zy(e);if(!i.hasContent||i.contentKind===`table`||!e.selection.empty||i.isContentEmpty||e.selection.from!==i.contentStart)return!1;if(r){let r=t(i.block.node,e.doc).splitKeepsType?i.content.node.type:e.schema.nodes.paragraph,a=e.schema.nodes.blockContainer.create(void 0,r.create());n.insert(i.block.beforePos,a).scrollIntoView()}return!0}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=zy(e);if(!i.hasContent||t(i.block.node,e.doc).enter!==`into-children`||!e.selection.empty||e.selection.from<i.contentStart||e.selection.from>i.contentEnd)return!1;if(r){let t=i.content.node.cut(e.selection.from-i.contentStart),r=e.schema.nodes.blockContainer.create(void 0,e.schema.nodes.paragraph.create(void 0,t.content));n.delete(e.selection.from,i.contentEnd);let a=Ly(n.doc,i.block.beforePos).children,o=a?a.childrenStart:n.mapping.map(i.content.afterPos);n.insert(o,a?r:e.schema.nodes.blockGroup.create(void 0,r)).setSelection(new wr(n.doc.resolve(o+(a?2:3)))).scrollIntoView()}return!0}),()=>r.command(({state:e,chain:n})=>{let r=zy(e);if(!r.hasContent)return!1;let i=e.selection.$anchor.parentOffset===0;if(!r.isContentEmpty){let a=t(r.block.node,e.doc),o=i||a.splitKeepsType;return n().deleteSelection().command(pA(e.selection.from,o,i,a.splitKeepsChildren)).scrollIntoView().run(),!0}return!1})]),o=this.options;function s(e){let{editor:t,tabBehavior:n}=o;return n!==`prefer-indent`&&(t.getExtension(WC)?.store.state||t.getExtension(OS)?.store.state!==void 0)?!1:e?vO(t):mO(t)}return{Backspace:r,Delete:i,Enter:()=>a(),"Shift-Enter":()=>a(!0),Tab:()=>s(!1),"Shift-Tab":()=>s(!0),"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo(),"Mod-a":()=>{let e=this.editor.view,{doc:t,selection:n,tr:r}=e.state,i=wr.between(kr.atStart(t).$from,kr.atEnd(t).$to);if(this.options.selectAllBehavior===`document`)return e.dispatch(r.setSelection(i)),!0;let a,o=zy(e.state);if(o.hasContent){let e=o.contentStart,n=o.contentEnd,r=wr.between(t.resolve(e),t.resolve(n));!r.empty&&r.from>=e&&r.to<=n&&(a=r)}let s=!a||n.from<a.from||n.to>a.to||n.from===a.from&&n.to===a.to;return a&&!s?r.setSelection(a).scrollIntoView():r.setSelection(i),e.dispatch(r),!0}}}}),vA=Rt.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),yA=Rt.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:ES()}}]}}),bA=`[\0- \xA0 -\u2029 ]`,xA=new RegExp(bA),SA=RegExp(`${bA}$`),CA=new RegExp(bA,`g`);function wA(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function TA(e){return new Nr({key:new Cr(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Yy(Jy(n.doc,t)).forEach(({newRange:t})=>{let n=Dt(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!SA.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(xA).filter(Boolean);if(t.length<=0)return;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return;let c=GT(n,e.defaultProtocol);if(!wA(c))return;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{zt(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function EA(e){return new Nr({key:new Cr(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement&&r.target.getAttribute(`data-inline-content-type`)===`link`)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.tiptapEditor.view.dom;i=t.closest(`a[data-inline-content-type="link"]`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;if(e.onClick){if(!e.editor)throw Error(`BlockNoteEditor not found in Link click handler`);return e.onClick(r,e.editor)??!0}let a=dn(t.state,e.type.name),o=i.href??a.href,s=i.target??a.target;return o?(window.open(o,s),!0):!1}}})}function DA(e){return new Nr({key:new Cr(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i,isValidLink:a}=e,{state:o}=t,{selection:s}=o,{empty:c}=s;if(c)return!1;let l=``;r.content.forEach(e=>{l+=e.textContent});let u=WT(l,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!l||!u||!a(u.value)||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}var OA=`https`,kA=/^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;function AA(e){if(!e)return!0;let t=e.replace(CA,``);return kA.test(t)}function jA(e){let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}var MA=Tt.create({name:`link`,keepOnSplit:!1,exitable:!0,inclusive:!1,addOptions(){return{HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,className:`bn-inline-content-section`,"data-inline-content-type":`link`},editor:void 0,onClick:void 0,isValidLink:AA}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}}}},parseHTML(){let e=this.options.isValidLink;return[{tag:`a[href]`,getAttrs:t=>{let n=t.getAttribute(`href`);return!n||!e(n)?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isValidLink(e.href)?[`a`,en(e,this.options.HTMLAttributes),0]:[`a`,en({...e,href:``},this.options.HTMLAttributes),0]},addPasteRules(){let e=this.options.isValidLink;return[on({find:t=>{let n=[];if(t){let r=WT(t,{defaultProtocol:OA}).filter(t=>t.isLink&&e(t.value));for(let e of r)jA(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})}return n},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[];return e.push(TA({type:this.type,defaultProtocol:OA,validate:this.options.isValidLink,shouldAutoLink:jA})),e.push(EA({type:this.type,tiptapEditor:this.editor,editor:this.options.editor,onClick:this.options.onClick})),e.push(DA({editor:this.editor,defaultProtocol:OA,type:this.type,shouldAutoLink:jA,isValidLink:this.options.isValidLink})),e}}),NA=k_(({editor:e,options:t})=>({key:`link`,tiptapExtensions:[MA.configure({HTMLAttributes:t.HTMLAttributes??{},editor:e,onClick:t.onClick,...t.isValidLink?{isValidLink:t.isValidLink}:{}})]})),PA=Pt.create({name:`blockGroup`,group:_y,content:`blockGroupChild+`,marks(){return wb(this.editor)},parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e!=`string`&&e.getAttribute(`data-node-type`)===`blockGroup`&&null}]},renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement(`div`);n.className=gb(`bn-block-group`,t.class),n.setAttribute(`data-node-type`,`blockGroup`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),FA=Pt.create({name:`doc`,topNode:!0,content:`blockGroup`,marks(){return wb(this.editor)}});function IA(e,t){return[Ft.ClipboardTextSerializer,Ft.Commands,Ft.Editable,Ft.FocusEvents,Ft.Tabindex,_D,rb.configure({types:[`blockContainer`,...Object.values(e.schema.blockSpecs).filter(e=>e.config.layoutOnly===!0).map(e=>e.config.type)],setIdAttribute:t.setIdAttribute,isWithinEditor:e.isWithinEditor}),lA,qt,...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),yA,cA,vA,Rt.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>!e.getExtension(YC)?.shown()&&(e.blur(),!0)})}),FA,HD.configure({editor:e,domAttributes:t.domAttributes}),_A.configure({editor:e,tabBehavior:t.tabBehavior,selectAllBehavior:t.selectAllBehavior??`block-first`}),PA.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[...`node`in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),sA(e),nA(e,t.pasteHandler||(e=>e.defaultPasteHandler())),zk(e)]}function LA(e,t){let n=[Bw(),Yw(t),OS(t),WC(t),NA({HTMLAttributes:t.links?.HTMLAttributes??{},onClick:t.links?.onClick,...t.links?.isValidLink?{isValidLink:t.links.isValidLink}:{}}),eT(t),iT(),oT(t),fT({editable:t._tiptapOptions?.editable}),cw(t),VE(t),HE(),UE(),YC(t),Xw(),$w(),sT(),...t.trailingBlock===!1?[]:[dD()]];return`table`in e.schema.blockSpecs&&n.push(sD(t)),t.animations!==!1&&n.push(uT()),n}var RA=class{editor;options;disabledExtensions=new Set;extensions=[];abortMap=new Map;extensionFactories=new Map;extensionPlugins=new Map;runtimeExtensions=new Set;blockNoteExtensionDependents=new Map;constructor(e,t){this.editor=e,this.options=t,e.onMount(()=>{for(let e of this.extensions)this.mountExtension(e)}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of LA(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}mountExtension(e){if(!e.mount||this.abortMap.has(e))return;let t=new window.AbortController;this.abortMap.set(e,t);let n=e.mount({dom:this.editor.prosemirrorView.dom,root:this.editor.prosemirrorView.root,signal:t.signal});n&&(t.signal.aborted?n():t.signal.addEventListener(`abort`,n,{once:!0}))}registerExtension(e){this.replaceExtension(void 0,e)}addExtension(e,t){let n;if(n=typeof e==`function`?e({editor:this.editor}):e,!n||this.disabledExtensions.has(n.key))return;if(t){let e=this.blockNoteExtensionDependents.get(n.key);e||(e=new Set,this.blockNoteExtensionDependents.set(n.key,e)),e.add(t)}if(this.extensions.some(e=>e.key===n.key))return;let r=n[O_];if(typeof r==`function`&&this.extensionFactories.set(r,n),this.extensions.push(n),n.blockNoteExtensions)for(let e of n.blockNoteExtensions)this.addExtension(e,n.key);return n}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){let t=[...new Set(this.resolveExtensions(e))].filter(e=>this.extensions.includes(e));return t.length&&this.replaceExtension(t,[]),Array.isArray(e)?t:t[0]}replaceExtension(e,t,n){let r=this.resolveExtensions(e);e&&!r.length&&console.warn(`No extensions found to unregister`,e);let i=!1,a=new Set,o=new Set;for(let t of r)this.extensions=this.extensions.filter(e=>e!==t),this.extensionFactories.forEach((e,n)=>{e===t&&this.extensionFactories.delete(n)}),this.abortMap.get(t)?.abort(),this.abortMap.delete(t),this.extensionPlugins.get(t)?.forEach(e=>{a.add(e);let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;typeof n==`string`&&o.add(n)}),this.extensionPlugins.delete(t),this.runtimeExtensions.delete(t),t.tiptapExtensions&&!i&&(i=!0,console.warn(`Extension ${t.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));let s=[].concat(t).filter(Boolean).map(e=>this.addExtension(e)).filter(Boolean),c=[];for(let e of s)this.runtimeExtensions.add(e),e?.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),e?.inputRules?.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{c.push(e)});if((a.size||o.size||c.length||n?.resetPluginStateFor.length)&&this.updatePlugins(e=>[...e.filter(e=>{if(a.has(e))return!1;if(o.size){let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;if(typeof n==`string`&&o.has(n))return!1}return!0}),...c],n?.resetPluginStateFor),!this.editor.headless)for(let e of s)this.mountExtension(e)}updatePlugins(e,t){let n=this.editor.prosemirrorState,r=new Set(t),i=(r.size?n.reconfigure({plugins:n.plugins.filter(e=>!e.spec.key||!r.has(e.spec.key))}):n).reconfigure({plugins:e(n.plugins.slice())});this.editor.prosemirrorView.updateState(i)}getTiptapExtensions(){let e=IA(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),t=qx(this.extensions.map(e=>{let t=this.blockNoteExtensionDependents.get(e.key);return t?.size?{key:e.key,runsBefore:[...e.runsBefore??[],...t]}:e})),n=new Map;for(let r of this.extensions){r.tiptapExtensions&&e.push(...r.tiptapExtensions);let i=t(r.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(r);a.length&&e.push(Rt.create({name:r.key,priority:i,addProseMirrorPlugins:()=>this.runtimeExtensions.has(r)?[]:this.extensionPlugins.get(r)??[]})),o.length&&(n.has(i)||n.set(i,[]),n.get(i).push(...o))}e.push(Rt.create({name:`blocknote-runtime-extensions`,priority:-1/0,addProseMirrorPlugins:()=>this.extensions.filter(e=>this.runtimeExtensions.has(e)).flatMap(e=>this.extensionPlugins.get(e)??[])})),e.push(Rt.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];Array.from(n.keys()).sort((e,t)=>e-t).reverse().forEach(t=>{e.push(...n.get(t))});let t=hD({rules:e});return[t,new Nr({props:{handleKeyDown(e,n){if(n.key!==`Enter`||n.shiftKey||n.ctrlKey||n.metaKey||n.altKey)return!1;let{$cursor:r}=e.state.selection;return r?!!t.props.handleTextInput?.call(t,e,r.pos,r.pos,`
|
|
265
|
-
`,()=>e.state.tr.insertText(`
|
|
266
|
-
`,r.pos,r.pos)):!1}}})]}}));for(let t of this.options._tiptapOptions?.extensions??[])e.push(t);return e}getProsemirrorPluginsFromExtension(e){let t=[...e.prosemirrorPlugins??[]],n=[];if(!e.prosemirrorPlugins?.length&&!Object.keys(e.keyboardShortcuts||{}).length&&!e.inputRules?.length)return{plugins:t,inputRules:n};if(this.extensionPlugins.set(e,t),e.inputRules?.length&&n.push(...e.inputRules.map(e=>new fD(e.find,(t,n,r,i)=>{let a=e.replace({match:n,range:{from:r,to:i},editor:this.editor});if(a){let e=t.tr,n=zy(e);return!n.hasContent||this.editor.schema.blockSchema[n.blockNoteType]?.content!==`inline`?null:(e.deleteRange(r,i),OD(e,n.block.beforePos,a),Nk(e,Py(n.block.node,e.doc),`start`),e)}return null},{undoable:!0}))),Object.keys(e.keyboardShortcuts||{}).length){let n,r=yt(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>{if(!n)throw Error(`Keyboard shortcut called outside handleKeyDown`);return t({editor:this.editor,event:n})}])));t.push(new Nr({props:{handleKeyDown:(e,t)=>{let i=n;n=t;try{return r(e,t)}finally{n=i}}}}))}return{plugins:t,inputRules:n}}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`&&this.extensionFactories.has(e)}};function zA(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function BA(e){if(e.selection.empty||`node`in e.selection)return;let t=e.doc.resolve(Fy(e.doc,e.selection.from).posBeforeNode),n=e.doc.resolve(Fy(e.doc,e.selection.to).posBeforeNode),r=(n,r)=>{let i=t.posAtIndex(n,r),a=e.doc.resolve(i).nodeAfter;if(!a)throw Error(`Error getting selection - node not found at position ${i}`);return Kb(a,e.doc)},i=[],a=t.sharedDepth(n.pos),o=t.index(a),s=n.index(a);if(t.depth>a){i.push(Kb(t.nodeAfter,e.doc));for(let e=t.depth;e>a;e--)if(t.node(e).type.isInGroup(`childContainer`)){let n=t.index(e)+1,a=t.node(e).childCount;for(let t=n;t<a;t++)i.push(r(t,e))}}else i.push(r(o,a));for(let e=o+1;e<=s;e++)i.push(r(e,a));if(i.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:i}}function VA(e,t,n){let r=typeof t==`string`?t:t.id,i=typeof n==`string`?n:n.id;if(r===i)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);let a=yw(r,e.doc);if(!a)throw Error(`Block with ID ${r} not found`);let o=yw(i,e.doc);if(!o)throw Error(`Block with ID ${i} not found`);let s=Iy(a.node,a.posBeforeNode),c=Iy(o.node,o.posBeforeNode),l=ky(s,`start`);if(l===null)throw Error(`Attempting to set selection anchor in block without content (id ${r})`);let u=ky(c,`end`);if(u===null)throw Error(`Attempting to set selection head in block without content (id ${i})`);e.setSelection(wr.create(e.doc,l,u))}function HA(e,t=!1){let n=t?zA(e.doc,e.selection):e.selection,r=n.$from,i=n.$to;for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=e.doc.resolve(i.pos+1);for(;i.parentOffset===0&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;r.parentOffset===0&&r.depth>0;)r=e.doc.resolve(r.pos-1);for(;r.parentOffset>=r.parent.nodeSize-2&&r.depth>0;)r=e.doc.resolve(r.pos+1);let a=Jb(e.doc.slice(r.pos,i.pos,!0));return{_meta:{startPos:r.pos,endPos:i.pos},...a}}var UA=class{editor;constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>BA(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>HA(t,e))}setSelection(e,t){return this.editor.transact(n=>VA(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>Mk(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>Nk(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if(St(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return Ht(this.editor.prosemirrorView,n,r).toJSON()}},WA=class{editor;constructor(e){this.editor=e}activeTransaction=null;can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}isInCan=!1;exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){this.prosemirrorView?.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}if(this.editor.headless){let e=this.editor.getExtension(fT)?.store.state;if(e)return e.isEditable&&e.enabledSet.size===0}return this.editor._tiptapEditor.isEditable===void 0||this.editor._tiptapEditor.isEditable}set isEditable(e){if(this.editor._tiptapEditor)this.editor.getExtension(fT).setEditable(e);else if(!this.editor.headless)throw Error(`no editor, but also not headless?`)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}};function GA(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,s=!0,c=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?c+=e.text:o=!1,s=s?e.isBlock:!1}),i===a&&s){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(c,i,a):e.replaceWith(i,a,n),r.updateSelection&&an(e,e.steps.length-1,-1),!0}var KA=class{editor;constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=gS(e,this.editor.pmSchema);this.editor.transact(e=>{GA(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.empty&&e.storedMarks||e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];n?n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue:e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name)}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new fb(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new fb(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getLinkMarkAtPos(e){return this.editor.transact(t=>{let n=this.editor.pmSchema.marks.link,r=Ot(t.doc.resolve(e),n);if(!r)return;let i=t.doc.nodeAt(r.from)?.marks.find(e=>e.type===n);if(i)return{href:i.attrs.href,from:r.from,to:r.to,text:t.doc.textBetween(r.from,r.to)}})}getSelectedLinkUrl(){return this.editor.transact(e=>(e.doc.nodeAt(e.selection.from)?.marks.find(e=>e.type.name===`link`))?.attrs.href)}createLink(e,t){e!==``&&this.editor.transact(n=>{let{from:r,to:i}=n.selection,a=this.editor.pmSchema.mark(`link`,{href:e});t?n.insertText(t,r,i).addMark(r,r+t.length,a):n.addMark(r,i,a)})}editLink(e,t,n=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(r=>{let{from:i,to:a}=this.getLinkMarkAtPos(n)||{from:r.selection.from,to:r.selection.to},o=this.editor.pmSchema.mark(`link`,{href:e});t!==r.doc.textBetween(i,a)&&r.insertText(t,i,a),r.addMark(i,i+t.length,o)}),this.editor.prosemirrorView.focus()}deleteLink(e=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(t=>{let{from:n,to:r}=this.getLinkMarkAtPos(e)||{from:t.selection.from,to:t.selection.to};t.removeMark(n,r,this.editor.pmSchema.marks.link).setMeta(`preventAutolink`,!0)}),this.editor.prosemirrorView.focus()}};function qA(e){return jt(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function JA(e,t){let n=t.nodes.hardBreak,r=yr.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(JA(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function YA(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),yr.from(n)}function XA(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`){if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}}else n.push(e.child(r));return e=yr.from(n),e}function ZA(e,t){let n=yr.from(e.content);n=XA(n,t.state.schema);let r=QA(n,t,e);if(r)return r;let i=t.state.schema.nodes.tableParagraph;if(i&&qA(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!i.validContent(n))return new Or(JA(n,t.state.schema),0,0)}if(!$A(n,t))return new Or(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=YA(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new Or(n,e.openStart,e.openEnd)}function QA(e,t,n){if(qA(t)||t.dragging)return null;let r=zy(t.state);if(!r.hasContent||r.content.node.type.name===`paragraph`||r.contentKind!==`inline`||!r.isContentEmpty)return null;let i=r.content.node,a=e.firstChild,o=a?.firstChild,s=o?.firstChild;if(a?.type.name!==`blockGroup`||o?.type.name!==`blockContainer`||s?.type.name!==`paragraph`)return null;let c=i.type.create(i.attrs,s.content),l=o.copy(o.content.replaceChild(0,c)),u=a.copy(a.content.replaceChild(0,l));return new Or(e.replaceChild(0,u),n.openStart,n.openEnd)}function $A(e,t){let n=e.childCount===1,r=e.firstChild?.type.spec.content===`inline*`,i=e.firstChild?.type.spec.content===`tableRow+`;if(n){if(r)return!1;if(i){let e=zy(t.state);if(e.hasContent)return e.contentKind!==`table`}}return!0}var ej={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},tj=class e extends eO{options;pmSchema;_tiptapEditor;elementRenderer=null;blockCache=new WeakMap;dictionary;schema;blockImplementations;inlineContentImplementations;styleImplementations;uploadFile;onUploadStartCallbacks=[];onUploadEndCallbacks=[];resolveFileUrl;settings;static create(t){return new e(t??{})}constructor(e){super(),this.options=e,this.dictionary=e.dictionary||Ff,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroundColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||ow.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new EO(this),this._extensionManager=new RA(this,t);let n=this._extensionManager.getTiptapExtensions(),r={...ej,...t._tiptapOptions,editable:!0,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{scrollMargin:{top:72,bottom:72,left:0,right:0},...t._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:gb(`bn-editor`,t.defaultStyles?`bn-default-styles`:``,t.domAttributes?.editor?.class||``)},transformPasted:ZA}};try{let e=t.initialContent||[{type:`paragraph`,id:rb.options.generateID()}];if(!Array.isArray(e)||e.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+JSON.stringify(e));let n=At(r.extensions);n.cached.blockNoteEditor=this;let i=e.map(e=>bS(e,n,this.schema.styleSchema).toJSON()),a=Nt({type:`doc`,content:[{type:`blockGroup`,content:i}]},n,r.parseOptions);a.check(),this._tiptapEditor=new un({...r,content:a.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}this.pmSchema.cached.blockNoteEditor=this,this._tiptapEditor.on(`mount`,()=>{this.headless=!1}),this._tiptapEditor.on(`unmount`,()=>{this.headless=!0}),this._tiptapEditor.on(`destroy`,()=>{this.emit(`destroy`)}),this._blockManager=new TO(this),this._exportManager=new jk(this),this._selectionManager=new UA(this),this._stateManager=new WA(this),this._styleManager=new KA(this),this.emit(`create`)}_blockManager;_eventManager;_exportManager;_extensionManager;_selectionManager;_stateManager;_styleManager;get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}unregisterExtension(e){return this._extensionManager.unregisterExtension(e)}registerExtension=(...e)=>this._extensionManager.registerExtension(...e);replaceExtension=(...e)=>this._extensionManager.replaceExtension(...e);getExtension=(e=>this._extensionManager.getExtension(e));mount=e=>{this._tiptapEditor.mount({mount:e}),this._tiptapEditor.isEditorContentInitialized=!0};unmount=()=>{this._tiptapEditor.isEditorContentInitialized=!1,this._tiptapEditor.unmount()};get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}_portalElements=new Map;registerPortalElement=e=>{this._portalElements.set(e,(this._portalElements.get(e)??0)+1)};unregisterPortalElement=e=>{let t=this._portalElements.get(e);t!==void 0&&(t<=1?this._portalElements.delete(e):this._portalElements.set(e,t-1))};isWithinEditor=e=>{if(this.domElement?.parentElement?.contains(e))return!0;for(let t of this._portalElements.keys())if(t.contains(e))return!0;return!1};isFocused(e){if(this.headless)return!1;let t=this.prosemirrorView?.hasFocus()||!1;if(!e?.includeEditorUI)return t;let n=typeof document<`u`?document.activeElement:null;return t||!!n&&this.isWithinEditor(n)}headless=!0;focus(){this.headless||this.prosemirrorView.focus()}blur(){this.headless||this.domElement?.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(Bw).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}getLinkMarkAtPos(e){return this._styleManager.getLinkMarkAtPos(e)}editLink(e,t,n){this._styleManager.editLink(e,t,n)}deleteLink(e){this._styleManager.deleteLink(e)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(e){return this._blockManager.moveBlocksUp(e)}moveBlocksDown(e){return this._blockManager.moveBlocksDown(e)}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onFocusChange(e,t){return this._eventManager.onFocusChange(e,t)}onMount(e){return this._eventManager.onMount(e)}onUnmount(e){return this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}};function nj(e,t){let n=(t?.editor??op()).getExtension(e);if(!n)throw Error(`Extension not found`,{cause:{plugin:e}});return n}function rj(e,t){let{store:n}=nj(e,t);if(!n)throw Error(`Store not found on plugin`,{cause:{plugin:e}});return sp(n,t?.selector)}function ij(e){let t=new DOMRect,n=`getBoundingClientRect`in e?()=>e.getBoundingClientRect():()=>e.element.getBoundingClientRect();return()=>e.element&&(e.cacheMountedBoundingClientRect??!0)?(e.element.isConnected&&(t=n()),t):n()}function aj(e,t){return e?t?(n,r,i)=>{let a=e(n,r,i),o=t(n,r,i);return()=>{a?.(),o?.()}}:e:t}var oj=e=>{let t=op(),n=vp(),{whileElementsMounted:r,middleware:i,...a}=e.useFloatingOptions??{},{refs:o,floatingStyles:s,context:c,middlewareData:l}=c_({whileElementsMounted:aj(P,e.useFloatingOptions?.whileElementsMounted),middleware:[...i??[],k()],...a}),{isMounted:u,styles:d}=h_(c,e.useTransitionStylesProps),{status:f}=m_(c,e.useTransitionStatusProps),{getFloatingProps:p}=u_([o_(c,e.useDismissProps),Cg(c,{enabled:!1,...e.useHoverProps})]),m=(0,W.useRef)(``),h=(0,W.useRef)(null),g=Zh([h,o.setFloating]);if((0,W.useEffect)(()=>{if(e.reference){let n=`element`in e.reference?e.reference.element:void 0;n!==void 0&&(e.focusManagerProps?.disabled||!t.isWithinEditor(n))&&o.setReference(n);let r=`getClientRects`in e.reference?e.reference.getClientRects:n?()=>n.getClientRects():void 0;o.setPositionReference({getBoundingClientRect:ij(e.reference),...r?{getClientRects:r}:{},contextElement:n})}},[e.reference,o,e.focusManagerProps?.disabled,t]),(0,W.useEffect)(()=>{(f===`initial`||f===`open`)&&h.current&&Tp(h.current)&&(m.current=h.current.innerHTML)},[f,e.reference,e.children]),!u||!n)return!1;let _={...e.elementProps,style:{display:`flex`,...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index, 0) + ${e.elementProps?.style?.zIndex||0})`,...s,...d,...l.hide?.referenceHidden?{visibility:`hidden`}:{}},...p()};return f===`close`?(0,G.jsx)(Gg,{root:n,children:(0,G.jsx)(`div`,{ref:g,..._,dangerouslySetInnerHTML:{__html:m.current}})}):e.focusManagerProps?.disabled?(0,G.jsx)(Gg,{root:n,children:(0,G.jsx)(`div`,{ref:g,..._,children:(0,G.jsx)(Ep,{children:e.children})})}):(0,G.jsx)(Gg,{root:n,children:(0,G.jsx)(n_,{...e.focusManagerProps,context:c,children:(0,G.jsx)(`div`,{ref:g,..._,children:(0,G.jsx)(Ep,{children:e.children})})})})},sj=e=>{let{position:t,children:n,...r}=e,{from:i,to:a}=t||{},o=op(),s=pp(),c=(0,W.useMemo)(()=>{if(i!==void 0&&a!==void 0)return{element:s?.firstElementChild||void 0,getBoundingClientRect:()=>Ht(o.prosemirrorView,i,a??i)}},[o,s,i,a]);return(0,G.jsx)(oj,{reference:c,...r,children:t!==void 0&&n})},cj=(e={},t=[])=>(0,W.useMemo)(()=>{let t=tj.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),lj=e=>{let[t,n]=(0,W.useState)(!1),r=fp({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=Op(),a=(0,W.useCallback)(()=>{n(!0)},[]),o=(0,W.useCallback)(()=>{n(!1)},[]);return(0,W.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:`bn-comment-editor`,editor:e.editor,onFocus:a,onBlur:o,editable:e.editable}),e.actions&&(0,G.jsx)(`div`,{className:`bn-comment-actions-wrapper`,children:e.actions({isFocused:t,isEmpty:r})})]})},{textColor:uj,backgroundColor:dj,...fj}=rw,pj=ow.create({blockSpecs:{paragraph:SC()},styleSpecs:fj});function mj(e){return!e.hasUnsavedContent||!e.confirmBeforeDiscard||(e.confirm??(e=>window.confirm(e)))(e.message)}var hj=k_(({editor:e,options:{submitOnEnter:t=!0,onSubmit:n}})=>{let r=!1;async function i(){if(!(!e.isEditable||e.isEmpty||r)){r=!0;try{await n(e)}finally{r=!1}}}function a({event:t}){let n=e.prosemirrorView;return!n.editable||n.composing||t.isComposing||t.keyCode===229?!1:(t.repeat||i(),!0)}return{key:`commentEditorSubmit`,submit:i,runsBefore:[`default`],keyboardShortcuts:{"Mod-Enter":a,...t?{Enter:a}:{}}}}),gj=Tt.create({name:`comment`,excludes:``,inclusive:!1,keepOnSplit:!0,group:b_,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute(`data-orphan`),renderHTML:e=>e.orphan?{"data-orphan":`true`}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute(`data-bn-thread-id`),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:``}}},renderHTML({HTMLAttributes:e}){return[`span`,en(e,{class:`bn-thread-mark`})]},parseHTML(){return[{tag:`span.bn-thread-mark`}]},extendMarkSchema(e){return e.name===`comment`?{blocknoteIgnore:!0}:{}}}),_j=new Cr(`blocknote-comments`);function vj(e,t){let n=new Map;return e.descendants((e,r)=>{e.marks.forEach(i=>{if(i.type.name===t){let t=i.attrs.threadId;if(!t)return;let a=r,o=a+e.nodeSize,s=n.get(t)??{from:1/0,to:0};n.set(t,{from:Math.min(a,s.from),to:Math.max(o,s.to)})}})}),n}var yj=k_(({editor:e,options:{schema:t,threadStore:n,resolveUsers:r,confirmBeforeDiscard:i=!0,submitOnEnter:a=!0}})=>{if(!r)throw Error(`resolveUsers is required to be defined when using comments`);if(!n)throw Error(`threadStore is required to be defined when using comments`);let o=uw(r),s=gj.name,c=A_({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(t,n){t.selectedThreadId!==n.selectedThreadId&&e.transact(e=>e.setMeta(_j,!0))}}),l=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(i=>{if(i.type.name===s){let a=i.type,o=i.attrs.threadId,s=t.get(o),l=!!(!s||s.resolved||s.deletedAt);if(l!==i.attrs.orphan){let t=Math.max(r,0),s=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,s,i),e.addMark(t,s,a.create({...i.attrs,orphan:l})),l&&c.state.selectedThreadId===o&&c.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:`comments`,store:c,userStore:o,runsBefore:[`link`],tiptapExtensions:[gj],prosemirrorPlugins:[new Nr({key:_j,state:{init(){return{decorations:jr.empty}},apply(e,t){let n=e.getMeta(_j);if(!e.docChanged&&!n)return t;let r=e.docChanged?vj(e.doc,s):c.state.threadPositions;(r.size>0||c.state.threadPositions.size>0)&&c.setState(e=>({...e,threadPositions:r}));let i=[];if(c.state.selectedThreadId){let e=r.get(c.state.selectedThreadId);e&&i.push(Pr.inline(e.from,e.to,{class:`bn-thread-mark-selected`}))}return{decorations:jr.create(e.doc,i)}}},props:{decorations(e){return _j.getState(e)?.decorations??jr.empty},handleClick:(e,t,n)=>{if(n.button!==0)return!1;let r=e.state.doc.nodeAt(t);if(!r)return c.setState(e=>({...e,selectedThreadId:void 0})),!1;let i=r.marks.find(e=>e.type.name===s&&e.attrs.orphan!==!0);if(!i)return c.state.selectedThreadId!==void 0&&c.setState(e=>({...e,selectedThreadId:void 0})),!1;let a=i.attrs.threadId;return a!==c.state.selectedThreadId&&(c.setState(e=>({...e,selectedThreadId:a})),!0)}}})],threadStore:n,mount(){let t=n.subscribe(l);l(n.getThreads());let r=e.onSelectionChange(()=>{c.state.pendingComment&&c.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){if(c.state.selectedThreadId!==t&&(c.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=c.state.threadPositions.get(t);if(!n)return;(e.prosemirrorView?.domAtPos(n.from).node)?.scrollIntoView({behavior:`smooth`,block:`center`})}},startPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),e.domElement?.focus(),e.getExtension(cw)?.showSelection(!0,`comments`)},stopPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),e.getExtension(cw)?.showSelection(!1,`comments`)},async createThread(t){let r=await n.createThread(t);n.addThreadToDocument?await n.addThreadToDocument({threadId:r.id,selection:e.transact(e=>e.selection),editor:e}):e._tiptapEditor.commands.setMark(s,{orphan:!1,threadId:r.id})},commentEditorSchema:t,confirmBeforeDiscard:i,submitOnEnter:a}}),bj=qn(),xj=Object.defineProperty,Sj=(e,t)=>{let n={};for(var r in e)xj(n,r,{get:e[r],enumerable:!0});return t||xj(n,Symbol.toStringTag,{value:`Module`}),n},Cj=e=>{let{blockId:t,children:n,...r}=e,i=op(),a=(0,W.useMemo)(()=>i.transact(e=>{if(!t)return;let n=yw(t,e.doc);if(!n)return;let r=Cw(i.prosemirrorView,n.posBeforeNode,t);return r?{element:r}:void 0}),[i,t]);return(0,G.jsx)(oj,{reference:a,...r,children:t!==void 0&&n})},wj=e=>{let t=Op(),n=kp(),r=op(),i=r.getBlock(e.blockId),[a,o]=(0,W.useState)(``),s=(0,W.useCallback)(e=>{o(e.currentTarget.value)},[]),c=(0,W.useCallback)(()=>{r.getBlock(e.blockId)&&r.updateBlock(e.blockId,{props:{name:Ob(a),url:a}})},[r,e.blockId,a]);return i?(0,G.jsx)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:c,submitButton:(0,G.jsx)(t.FilePanel.Button,{className:`bn-button`,type:`submit`,"data-test":`embed-input-button`,children:n.file_panel.embed.embed_button[i.type]||n.file_panel.embed.embed_button.file}),children:(0,G.jsx)(t.FilePanel.TextInput,{className:`bn-text-input`,placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:s,"data-test":`embed-input`})})}):null},Tj=e=>{let t=Op(),n=kp(),{setLoading:r}=e,i=op(),a=i.getBlock(e.blockId),[o,s]=(0,W.useState)(!1);(0,W.useEffect)(()=>{o&&setTimeout(()=>{s(!1)},3e3)},[o]);let c=(0,W.useCallback)(t=>{if(t===null)return;async function n(t){if(r(!0),i.uploadFile!==void 0)try{let n=await i.uploadFile(t,e.blockId);if(!i.getBlock(e.blockId))return;typeof n==`string`&&(n={props:{name:t.name,url:n}}),i.updateBlock(e.blockId,n)}catch{s(!0)}finally{r(!1)}}n(t)},[e.blockId,i,r]);if(!a)return null;let l=i.schema.blockSpecs[a.type],u=l.implementation.meta.fileBlockAccept?.length?l.implementation.meta.fileBlockAccept.join(`,`):`*/*`;return(0,G.jsxs)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,G.jsx)(t.FilePanel.FileInput,{className:`bn-file-input`,"data-test":`upload-input`,accept:u,placeholder:n.file_panel.upload.file_placeholder[a.type]||n.file_panel.upload.file_placeholder.file,value:null,onChange:c}),o&&(0,G.jsx)(`div`,{className:`bn-error-text`,children:n.file_panel.upload.upload_error})]})},Ej=e=>{let t=Op(),n=kp(),r=op(),[i,a]=(0,W.useState)(!1),o=e.tabs??[...r.uploadFile===void 0?[]:[{name:n.file_panel.upload.title,tabPanel:(0,G.jsx)(Tj,{blockId:e.blockId,setLoading:a})}],{name:n.file_panel.embed.title,tabPanel:(0,G.jsx)(wj,{blockId:e.blockId})}],[s,c]=(0,W.useState)(e.defaultOpenTab||o[0].name);return(0,G.jsx)(t.FilePanel.Root,{className:`bn-panel`,defaultOpenTab:s,openTab:s,setOpenTab:c,tabs:o,loading:i})},Dj=e=>{let t=op(),n=nj(OS),r=rj(OS),i=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{e||n.closeMenu(),i===`escape-key`&&t.focus()},middleware:[A(10),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[r,t,n,e.floatingUIOptions]),a=e.filePanel||Ej;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(Cj,{blockId:r,...i,children:r&&(0,G.jsx)(a,{blockId:r})})})},Oj={bold:Am,italic:vm,underline:om,strike:lm,code:Fm};function kj(e,t){return e in t.schema.styleSchema&&t.schema.styleSchema[e].type===e&&t.schema.styleSchema[e].propSchema===`boolean`}var Aj=e=>{let t=kp(),n=Op(),r=op(),i=fp({editor:r,selector:({editor:t})=>{if(t.isEditable&&kj(e.basicTextStyle,t)&&(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>e.content!==void 0))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,W.useCallback)(e=>{r.focus(),r.toggleStyles({[e]:!0})},[r]);if(i===void 0)return null;let o=Oj[e.basicTextStyle];return(0,G.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:i.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:hb(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,G.jsx)(o,{})})},jj=(0,W.createContext)(`desktop`);function Mj(){return(0,W.useContext)(jj)}var Nj=e=>{let t=e.textColor||`default`,n=e.backgroundColor||`default`,r=e.size||16,i=(0,W.useMemo)(()=>({pointerEvents:`none`,fontSize:(r*.75).toString()+`px`,height:r.toString()+`px`,lineHeight:r.toString()+`px`,textAlign:`center`,width:r.toString()+`px`}),[r]);return(0,G.jsx)(`div`,{className:`bn-color-icon`,"data-background-color":n,"data-text-color":t,style:i,children:`A`})},Pj=[`default`,`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`],Fj=e=>{let t=Op(),n=kp();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(()=>e.text?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),Pj.map(r=>(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.text.setColor(r)},"data-test":`text-color-`+r,icon:(0,G.jsx)(Nj,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},`text-color-`+r))]}):null,{}),(0,G.jsx)(()=>e.background?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),Pj.map(r=>(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.background.setColor(r)},"data-test":`background-color-`+r,icon:(0,G.jsx)(Nj,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},`background-color-`+r))]}):null,{})]})};function Ij(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&t.schema.styleSchema[`${e}Color`].propSchema===`string`}var Lj=()=>{let e=Op(),t=kp(),n=Mj(),r=vp(),i=op(),a=Ij(`text`,i),o=Ij(`background`,i),s=fp({editor:i,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return;let t=Ij(`text`,e),n=Ij(`background`,e);if(t||n)return{textColor:t?e.getActiveStyles().textColor||`default`:void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||`default`:void 0}}}),c=(0,W.useCallback)(e=>{if(!a)throw Error(`Tried to set text color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({textColor:e}):i.addStyles({textColor:e}),i.focus()},[i,a]),l=(0,W.useCallback)(e=>{if(!o)throw Error(`Tried to set background color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({backgroundColor:e}):i.addStyles({backgroundColor:e}),i.focus()},[o,i]);return s===void 0?null:(0,G.jsxs)(e.Generic.Menu.Root,{portalElement:r,preventFocusOnOpen:n===`mobile`,children:[(0,G.jsx)(e.Generic.Menu.Trigger,{children:(0,G.jsx)(e.FormattingToolbar.Button,{className:`bn-button`,"data-test":`colors`,label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,G.jsx)(Nj,{textColor:s.textColor,backgroundColor:s.backgroundColor,size:20})})}),(0,G.jsx)(e.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Fj,{text:s.textColor?{color:s.textColor,setColor:c}:void 0,background:s.backgroundColor?{color:s.backgroundColor,setColor:l}:void 0})})]})};function Rj(){let e=kp();return(0,G.jsx)(`button`,{className:`bn-screen-reader-only-submit`,tabIndex:-1,type:`submit`,children:e.generic.form_submit})}var zj=e=>{for(let t of tT)if(e.startsWith(t))return e;return`${nT}://${e}`},Bj=e=>{let t=Op(),n=kp(),{editLink:r}=nj(eT),{url:i,text:a,showTextField:o}=e,[s,c]=(0,W.useState)(i),[l,u]=(0,W.useState)(a);(0,W.useEffect)(()=>{c(i),u(a)},[a,i]);let d=(0,W.useCallback)(e=>c(e.currentTarget.value),[]),f=(0,W.useCallback)(e=>u(e.currentTarget.value),[]),p=(0,W.useCallback)(()=>{r(zj(s),l,e.range.from),e.setToolbarOpen?.(!1),e.setToolbarPositionFrozen?.(!1)},[r,s,l,e]);return(0,G.jsxs)(t.Generic.Form.Root,{onSubmit:p,submitButton:(0,G.jsx)(Rj,{}),children:[(0,G.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`url`,icon:(0,G.jsx)(gm,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:s,onChange:d}),o!==!1&&(0,G.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`title`,icon:(0,G.jsx)(sm,{}),placeholder:n.link_toolbar.form.title_placeholder,value:l,onChange:f})]})};function Vj(e){return`link`in e.schema.inlineContentSchema&&e.schema.inlineContentSchema.link===`link`}var Hj=()=>{let e=op(),t=pp(),n=Op(),r=kp(),i=vp(),a=nj(WC),{showSelection:o}=nj(cw),[s,c]=(0,W.useState)(!1);(0,W.useEffect)(()=>(o(s,`createLinkButton`),()=>o(!1,`createLinkButton`)),[s,o]);let l=(0,W.useCallback)(t=>{t||e.focus(),c(t)},[e]),u=fp({editor:e,selector:({editor:e})=>{if(e.isEditable&&!e.prosemirrorState.selection.empty&&Vj(e)&&!zC(e.prosemirrorState.selection)&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,W.useEffect)(()=>{c(!1)},[u]),(0,W.useEffect)(()=>{let n=t=>{e.isEditable&&(t.ctrlKey||t.metaKey)&&t.key===`k`&&(c(!0),t.preventDefault())};return t?.addEventListener(`keydown`,n),()=>{t?.removeEventListener(`keydown`,n)}},[e,t]),u===void 0?null:(0,G.jsxs)(n.Generic.Popover.Root,{open:s,onOpenChange:l,portalElement:i,children:[(0,G.jsx)(n.Generic.Popover.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":`createLink`,label:r.formatting_toolbar.link.tooltip,mainTooltip:r.formatting_toolbar.link.tooltip,secondaryTooltip:hb(r.formatting_toolbar.link.secondary_tooltip,r.generic.ctrl_shortcut),icon:(0,G.jsx)(gm,{}),onClick:()=>l(!s)})}),(0,G.jsx)(n.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(Bj,{url:u.url||``,text:u.text,range:u.range,showTextField:!1,setToolbarOpen:e=>a.store.setState(e)})})]})},Uj=()=>{let e=kp(),t=Op(),n=vp(),r=op(),i=fp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`,caption:`string`}))return n}}),[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,W.useCallback)(e=>{i!==void 0&&LC(r,i.type,{caption:`string`})&&r.updateBlock(i.id,{props:{caption:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,G.jsx)(ym,{}),onClick:()=>s(!a)})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,G.jsx)(Rj,{}),children:(0,G.jsx)(t.Generic.Form.TextInput,{name:`file-caption`,icon:(0,G.jsx)(ym,{}),value:i.props.caption,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onChange:c})})})]})},Wj=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&(n.focus(),n.removeBlocks([r.id]))},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,G.jsx)(Zp,{}),onClick:i})},Gj=()=>{let e=kp(),t=Op(),n=vp(),r=op(),i=fp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`,name:`string`}))return n}}),[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,W.useCallback)(e=>{i!==void 0&&LC(r,i.type,{name:`string`})&&r.updateBlock(i.id,{props:{name:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,G.jsx)(Om,{}),onClick:()=>s(!a)})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,G.jsx)(Rj,{}),children:(0,G.jsx)(t.Generic.Form.TextInput,{name:`file-name`,icon:(0,G.jsx)(Om,{}),value:i.props.name,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[i.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onChange:c})})})]})},Kj=()=>{let e=kp(),t=Op(),n=vp(),r=op(),i=fp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`}))return n}});return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{onOpenChange:e=>{e||r.focus()},portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,mainTooltip:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,G.jsx)(nm,{})})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-panel-popover`,variant:`panel-popover`,children:(0,G.jsx)(Ej,{blockId:i.id})})]})},qj=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canNestBlock:e.canNestBlock()}}}),i=(0,W.useCallback)(()=>{r!==void 0&&r.canNestBlock&&(n.focus(),n.nestBlock())},[n,r]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`nestBlock`,onClick:i,isDisabled:!r.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:hb(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,G.jsx)(bm,{})})},Jj=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canUnnestBlock:e.canUnnestBlock()}}}),i=(0,W.useCallback)(()=>{r!==void 0&&r.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,r]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`unnestBlock`,onClick:i,isDisabled:!r.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:hb(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,G.jsx)(xm,{})})},Yj={paragraph:sm,heading:Dm,heading_2:Em,heading_3:Tm,heading_4:wm,heading_5:Cm,heading_6:Sm,toggle_heading:Dm,toggle_heading_2:Em,toggle_heading_3:Tm,quote:um,toggle_list:tm,bullet_list:pm,numbered_list:mm,check_list:hm},Xj=e=>UC(e).map(({key:t,type:n,props:r})=>({name:e.dictionary.slash_menu[t].title,type:n,props:r,icon:Yj[t]})),Zj=e=>{let t=Op(),n=Mj(),r=vp(),i=op(),a=fp({editor:i,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),o=a[0],s=(0,W.useMemo)(()=>(e.items||Xj(i)).filter(e=>LC(i,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[i,e.items]),c=(0,W.useMemo)(()=>s.map(e=>{let t=e.icon,n=e.type===o.type,r=Object.entries(e.props||{}).filter(([e,t])=>t!==o.props[e]).length===0;return{text:e.name,icon:(0,G.jsx)(t,{size:16}),onClick:()=>{i.focus(),i.transact(()=>{for(let t of a)i.updateBlock(t,{type:e.type,props:e.props})})},isSelected:n&&r}}),[i,s,o.props,o.type,a]);return!(0,W.useMemo)(()=>c.find(e=>e.isSelected)!==void 0,[c])||!i.isEditable?null:(0,G.jsx)(t.FormattingToolbar.Select,{className:`bn-select`,items:c,portalElement:r,preventFocusOnOpen:n===`mobile`})},Qj=()=>{let e=kp(),t=Op(),n=op(),r=nj(`comments`),{store:i}=nj(WC),a=fp({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),o=(0,W.useCallback)(()=>{r.startPendingComment(),i.setState(!1)},[r,i]);return a?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,G.jsx)(Lm,{}),onClick:o})},$j=()=>op().getExtension(`comments`)?(0,G.jsx)(Qj,{}):null,eM=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),i=(0,W.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return!n._tiptapEditor.commands.addPendingComment||!n.isEditable||r?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,G.jsx)(Lm,{}),onClick:i})};function tM(e,t){try{let n=new URL(e,t);if(n.protocol!==`javascript:`)return n.href}catch{}return`#`}var nM=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(r.props.url).then(e=>window.open(tM(e,window.location.href))):window.open(tM(r.props.url,window.location.href)))},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,G.jsx)(Yp,{}),onClick:i})},rM=()=>{let e=kp(),t=Op(),n=op(),r=fp({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(RC(n,e,n.type,{url:`string`,showPreview:`boolean`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&LC(n,r.type,{showPreview:`boolean`})&&n.updateBlock(r.id,{props:{showPreview:!r.props.showPreview}})},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:`Toggle preview`,mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,G.jsx)(rm,{}),isSelected:r.props.showPreview,onClick:i})},iM=()=>{let e=kp(),t=Op(),n=op(),r=nj(sD),i=fp({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(n.type===`table`)return{mergeDirection:r.getMergeDirection(n)}}}),a=(0,W.useCallback)(()=>{r?.mergeCells()},[r]);return i===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:i.mergeDirection===`horizontal`?(0,G.jsx)(fm,{}):(0,G.jsx)(dm,{}),onClick:a})},aM=()=>op().getExtension(sD)?(0,G.jsx)(iM,{}):null,oM={left:Mm,center:Pm,right:jm,justify:Nm},sM=e=>{let t=Op(),n=kp(),r=op(),i=fp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];if(RC(n,e,n.type,{textAlignment:SS.textAlignment}))return{textAlignment:n.props.textAlignment,blocks:t};if(t.length===1&&RC(n,e,`table`))return e.getExtension(sD)?.getCellSelection()?{textAlignment:sb(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),a=(0,W.useCallback)(e=>{if(i!==void 0){r.focus();for(let t of i.blocks)if(RC(t,r,t.type,{textAlignment:SS.textAlignment})&&LC(r,t.type,{textAlignment:SS.textAlignment}))r.updateBlock(t,{props:{textAlignment:e}});else if(t.type===`table`){let n=r.getExtension(sD)?.getCellSelection();if(!n)continue;let i=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>sb(e))}));n.cells.forEach(({row:t,col:n})=>{i[t].cells[n].props.textAlignment=e}),r.updateBlock(t,{type:`table`,content:{...t.content,type:`tableContent`,rows:i}}),r.setTextCursorPosition(t)}}},[r,i]);if(i===void 0)return null;let o=oM[e.textAlignment];return(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>a(e.textAlignment),isSelected:i.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,G.jsx)(o,{})})},cM=e=>[(0,G.jsx)(Zj,{items:e},`blockTypeSelect`),(0,G.jsx)(aM,{},`tableCellMergeButton`),(0,G.jsx)(Uj,{},`fileCaptionButton`),(0,G.jsx)(Kj,{},`replaceFileButton`),(0,G.jsx)(Gj,{},`fileRenameButton`),(0,G.jsx)(Wj,{},`fileDeleteButton`),(0,G.jsx)(nM,{},`fileDownloadButton`),(0,G.jsx)(rM,{},`filePreviewButton`),(0,G.jsx)(Aj,{basicTextStyle:`bold`},`boldStyleButton`),(0,G.jsx)(Aj,{basicTextStyle:`italic`},`italicStyleButton`),(0,G.jsx)(Aj,{basicTextStyle:`underline`},`underlineStyleButton`),(0,G.jsx)(Aj,{basicTextStyle:`strike`},`strikeStyleButton`),(0,G.jsx)(sM,{textAlignment:`left`},`textAlignLeftButton`),(0,G.jsx)(sM,{textAlignment:`center`},`textAlignCenterButton`),(0,G.jsx)(sM,{textAlignment:`right`},`textAlignRightButton`),(0,G.jsx)(Lj,{},`colorStyleButton`),(0,G.jsx)(qj,{},`nestBlockButton`),(0,G.jsx)(Jj,{},`unnestBlockButton`),(0,G.jsx)(Hj,{},`createLinkButton`),(0,G.jsx)($j,{},`addCommentButton`),(0,G.jsx)(eM,{},`addTiptapCommentButton`)],lM=e=>{let t=Op();return(0,G.jsx)(t.FormattingToolbar.Root,{className:`bn-toolbar bn-formatting-toolbar`,children:e.children||cM(e.blockTypeSelectItems)})},uM=e=>{switch(e){case`left`:return`top-start`;case`center`:return`top`;case`right`:return`top-end`;default:return`top-start`}},dM=e=>{let t=op(),n=nj(WC,{editor:t}),r=rj(WC,{editor:t}),i=fp({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=fp({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return RC(t,e,t.type,{textAlignment:SS.textAlignment})?uM(t.props.textAlignment):`top-start`}}),o=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,r,i)=>{n.store.setState(e),i===`escape-key`&&t.focus()},placement:a,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[r,a,e.floatingUIOptions,n.store,t]),s=e.formattingToolbar||lM;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(sj,{position:i,...o,children:r&&(0,G.jsx)(s,{})})})};function fM(e,t){let n=ap(),r=t??n?.editor;if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);let i=e?.includeEditorUI??!1,a=(0,W.useRef)(void 0);(a.current===void 0||a.current.editor!==r||a.current.includeEditorUI!==i)&&(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})});let o=(0,W.useCallback)(e=>(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})},e(),r.onFocusChange((t,n)=>{a.current={editor:r,includeEditorUI:i,value:n.focused},e()},{includeEditorUI:i})),[r,i]),s=(0,W.useCallback)(()=>a.current.value,[]);return(0,W.useSyncExternalStore)(o,s,s)}var pM=0,mM=0;function hM(){if(typeof window>`u`)return!1;let e=window.visualViewport,t=e?.scale??1,n=(e?.height??window.innerHeight)*t,r=document.documentElement.clientWidth;return Math.abs(r-mM)>mM*.2&&(mM=r,pM=0),pM=Math.max(pM,n),pM-n>150}var gM=[`--bn-vv-top`,`--bn-vv-left`,`--bn-vv-width`,`--bn-vv-height`,`--bn-vv-scale`],_M=0;function vM(){let[e,t]=(0,W.useState)(hM);return(0,W.useLayoutEffect)(()=>{let e=document.documentElement,n=window.visualViewport,r=()=>document.querySelectorAll(`.bn-scroll-container`),i=()=>{e.style.setProperty(`--bn-vv-top`,`${n?.offsetTop??0}px`),e.style.setProperty(`--bn-vv-left`,`${n?.offsetLeft??0}px`),e.style.setProperty(`--bn-vv-width`,`${n?.width??window.innerWidth}px`),e.style.setProperty(`--bn-vv-height`,`${n?.height??window.innerHeight}px`),e.style.setProperty(`--bn-vv-scale`,`${n?.scale??1}`)},a=(e,t)=>e.toggleAttribute(`data-bn-allow-pull-to-refresh`,!t&&e.scrollTop<=0),o=()=>{let e=hM();t(e),i();for(let t of r())a(t,e)};_M++,o(),n?.addEventListener(`resize`,o),n?.addEventListener(`scroll`,o),window.addEventListener(`resize`,o);let s=e=>{e.target instanceof HTMLElement&&e.target.classList.contains(`bn-scroll-container`)&&a(e.target,hM())};return document.addEventListener(`scroll`,s,{capture:!0,passive:!0}),()=>{if(n?.removeEventListener(`resize`,o),n?.removeEventListener(`scroll`,o),window.removeEventListener(`resize`,o),document.removeEventListener(`scroll`,s,{capture:!0}),_M--,_M===0){for(let t of gM)e.style.removeProperty(t);for(let e of r())e.removeAttribute(`data-bn-allow-pull-to-refresh`);pM=0,mM=0}}},[]),e}var yM=e=>{let t=vM(),n=fM({includeEditorUI:!0});if(!t||!n)return null;let r=e.formattingToolbar||lM;return(0,G.jsx)(xp,{target:document.body,children:(0,G.jsx)(jj.Provider,{value:`mobile`,children:(0,G.jsx)(Ep,{children:(0,G.jsx)(`div`,{className:`bn-mobile-formatting-toolbar`,children:(0,G.jsx)(r,{})})})})})},bM=e=>{let t=vM();return yb()&&t?(0,G.jsx)(yM,{formattingToolbar:e.formattingToolbar}):(0,G.jsx)(dM,{...e})},xM=e=>{let t=Op(),n=kp(),{deleteLink:r}=nj(eT);return(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{r(e.range.from),e.setToolbarOpen?.(!1)},icon:(0,G.jsx)(_m,{})})},SM=e=>{let t=Op(),n=vp(),r=kp();return(0,G.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:r.link_toolbar.edit.tooltip,isSelected:!1,children:r.link_toolbar.edit.text})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(Bj,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},CM=e=>{let t=Op(),n=kp();return(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(tM(e.url,window.location.href),`_blank`)},icon:(0,G.jsx)(Jp,{})})},wM=e=>{let t=Op();return(0,G.jsx)(t.LinkToolbar.Root,{className:`bn-toolbar bn-link-toolbar`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(SM,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,G.jsx)(CM,{url:e.url}),(0,G.jsx)(xM,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})})},TM=e=>{let t=op(),n=fp({editor:t,selector:({editor:e})=>e?.isEditable??!1}),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=pp(),c=nj(eT),[l,u]=(0,W.useState)(void 0);(0,W.useEffect)(()=>{if(!n){u(void 0),i(!1);return}let e=()=>{let e=c.getLinkAtSelection();e?(u({cursorType:`text`,url:e.mark.attrs.href,text:e.text,range:e.range,element:c.getLinkElementAtPos(e.range.from)}),a||i(!0)):(u(void 0),a||i(!1))},r=e=>{if(l!==void 0&&l.cursorType===`text`||!(e.target instanceof HTMLElement))return;let t=c.getLinkAtElement(e.target);t&&u({cursorType:`mouse`,url:t.mark.attrs.href,text:t.text,range:t.range,element:c.getLinkElementAtPos(t.range.from)})},o=t.onChange(e),d=t.onSelectionChange(e);return s?.addEventListener(`mouseover`,r),()=>{o(),d(),s?.removeEventListener(`mouseover`,r)}},[t,s,n,c,l,a]);let d=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,n,r)=>{a||(l===void 0||l.cursorType!==`text`||r!==`hover`)&&(r===`escape-key`&&t.focus(),i(e))},placement:`top-start`,middleware:[A(10),te()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:l!==void 0&&l.cursorType===`mouse`,delay:{open:250,close:250},handleClose:y_(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,l,e.floatingUIOptions,r,a]),f=(0,W.useMemo)(()=>l?.element?{element:l.element}:void 0,[l?.element]);if(!n)return null;let p=e.linkToolbar||wM;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(oj,{reference:f,...d,children:l&&(0,G.jsx)(p,{url:l.url,text:l.text,range:l.range,setToolbarOpen:i,setToolbarPositionFrozen:o})})})};function EM(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z`},child:[]},{tag:`path`,attr:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z`},child:[]}]})(e)}var DM=()=>{let e=Op(),t=kp(),n=op(),r=nj(YC),i=rj(VE,{editor:n,selector:e=>e?.block}),a=(0,W.useCallback)(()=>{if(i===void 0)return;let e=i.content;if(e!==void 0&&Array.isArray(e)&&e.length===0)n.setTextCursorPosition(i),r.openSuggestionMenu(`/`);else{let e=n.insertBlocks([{type:`paragraph`}],i,`after`)[0];n.setTextCursorPosition(e),r.openSuggestionMenu(`/`)}},[i,n,r]);return i===void 0?null:(0,G.jsx)(e.SideMenu.Button,{className:`bn-button`,label:t.side_menu.add_block_label,icon:(0,G.jsx)(EM,{size:24,onClick:a,"data-test":`dragHandleAdd`})})};function OM(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m7 10 5 5 5-5z`},child:[]}]})(e)}function kM(e){return Hp({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`},child:[]}]})(e)}var AM=e=>{let t=Op(),n=vp(),r=op(),i=rj(VE,{editor:r,selector:e=>e?.block});return i===void 0||!RC(i,r,i.type,{textColor:`string`})&&!RC(i,r,i.type,{backgroundColor:`string`})?null:(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Fj,{iconSize:18,text:RC(i,r,i.type,{textColor:`string`})&&LC(r,i.type,{textColor:`string`})?{color:i.props.textColor,setColor:e=>r.updateBlock(i,{type:i.type,props:{textColor:e}})}:void 0,background:RC(i,r,i.type,{backgroundColor:`string`})&&LC(r,i.type,{backgroundColor:`string`})?{color:i.props.backgroundColor,setColor:e=>r.updateBlock(i,{props:{backgroundColor:e}})}:void 0})})]})},jM=e=>{let t=Op(),n=op(),r=rj(VE,{editor:n,selector:e=>e?.block});return r===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{let e=n.getSelection()?.blocks,t=e&&e.some(e=>e.id===r.id)?e:[r];n.removeBlocks(t)},children:e.children})},MM=e=>{let t=Op(),n=op(),r=rj(VE,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerRows;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerRows:i?void 0:1}})},children:e.children})},NM=e=>{let t=Op(),n=op(),r=rj(VE,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerCols;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerCols:i?void 0:1}})},children:e.children})},PM=e=>{let t=Op(),n=kp();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-drag-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(jM,{children:n.drag_handle.delete_menuitem}),(0,G.jsx)(AM,{children:n.drag_handle.colors_menuitem}),(0,G.jsx)(MM,{children:n.drag_handle.header_row_menuitem}),(0,G.jsx)(NM,{children:n.drag_handle.header_column_menuitem})]})})},FM=e=>{let t=Op(),n=vp(),r=kp(),i=nj(VE),a=rj(VE,{selector:e=>e?.block});if(a===void 0)return null;let o=e.dragHandleMenu||PM;return(0,G.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?i.freezeMenu():i.unfreezeMenu()},position:`left`,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{children:(0,G.jsx)(t.SideMenu.Button,{label:r.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>i.blockDragStart(e,a),onDragEnd:i.blockDragEnd,className:`bn-button`,icon:(0,G.jsx)(kM,{size:24,"data-test":`dragHandle`})})}),(0,G.jsx)(o,{children:e.children})]})},IM=e=>{let t=Op();return(0,G.jsx)(t.SideMenu.Root,{className:`bn-side-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(DM,{}),(0,G.jsx)(FM,{dragHandleMenu:e.dragHandleMenu})]})})};function LM(e,t){if(t.type===`heading`)switch(t.props.level){case 1:return 39;case 2:return 27;case 3:return 18.5;default:return 0}return e.schema.blockSpecs[t.type]?.implementation.meta?.fileBlockAccept&&!t.props.url?12:t.type===`file`?4:t.type===`audio`||t.type===`table`?15:0}var RM=e=>{let t=op(),{show:n,block:r}=rj(VE,{selector:e=>e===void 0?void 0:{show:e.show,block:e.block}})||{},i=(0,W.useCallback)((e,n,r)=>{let i=t.getExtension(VE);i?.setMenuElement(n);let a=!1,o=P(e,n,()=>{a?i?.hideMenuIfNotFrozen():a=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1});return()=>{o(),i?.setMenuElement(void 0)}},[t]),a=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,placement:`left-start`,middleware:[A({crossAxis:r?LM(t,r):0})],whileElementsMounted:i,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,n,r,t,i]),o=e.sideMenu||IM;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(Cj,{blockId:n?r?.id:void 0,...a,children:r?.id&&(0,G.jsx)(o,{})})})},zM=({format:e,dictionary:t})=>{let n=t.suggestion_changes.formatting_change;if(e.length===0)return n;let r=t.formatting_toolbar,i=[];for(let t of e){if(t===`link`)return n;let e=r[t],a=e&&typeof e==`object`&&`tooltip`in e?e.tooltip:void 0;if(typeof a!=`string`)return n;i.push(a)}return i.join(`, `)},BM=e=>{let t=Op(),n=kp(),r=(0,W.useMemo)(()=>{let t=n.suggestion_changes,r=e.formatChangeLabel??zM,i=e.users.join(`, `);if(e.modificationType===`insert`)return i?t.inserted_by(i):t.inserted;if(e.modificationType===`delete`)return i?t.deleted_by(i):t.deleted;if(e.modificationType===`change`)return i?t.changed_by(i):t.changed;if(e.modificationType===`attrs`)return i?`${t.formatting_change}: ${i}`:t.formatting_change;let a=e.format?r({format:e.format,dictionary:n}):``;return!a||a===t.formatting_change?i?`${t.formatting_change}: ${i}`:t.formatting_change:i?t.formatting_change_by(a,i):`${t.formatting_change} (${a})`},[n,e]);return(0,G.jsx)(t.AttributionTooltip.Root,{className:`bn-suggestion-tooltip`,markClassName:e.className,backgroundColor:e.className?void 0:e.color,children:r})};function VM(e){let t=e.firstElementChild??e,n=t.getBoundingClientRect();return n.width||n.height?t:t.firstElementChild??t}function HM(e,t){let{anchor:n,reference:r,...i}=e;return{...i,formatChangeLabel:t}}var UM=e=>{let t=rj(`attribution`,{selector:e=>e}),n=(0,W.useMemo)(()=>t?{element:t.reference??VM(t.anchor)}:void 0,[t]),r=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!t,placement:`top-start`,middleware:[R(),A(4),te(),j({padding:4})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:1e4,pointerEvents:`none`},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,t]),i=e.attributionTooltip||BM,a=t?HM(t,e.formatChangeLabel):void 0;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(oj,{reference:n,...r,children:a&&(0,G.jsx)(i,{...a})})})},WM=10,GM=10,KM=600,qM=300,JM={name:`placeBelowUnlessCramped`,async fn(e){let{rects:t,placement:n,platform:r}=e,i={...t.floating,height:qM},a=await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y+t.reference.height+WM},{padding:GM}),o=`bottom-start`;return a.bottom>0&&(await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y-WM-qM},{padding:GM})).top<a.bottom&&(o=`top-start`),o===n?{}:{reset:{placement:o}}}};function YM(e){let t=e.getBoundingClientRect().width;t>=(parseFloat(e.style.minWidth)||0)+1&&(e.style.minWidth=`${Math.ceil(t)}px`)}var XM=[JM,A(WM),j(),ee({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,Math.min(t,KM))}px`,YM(e.floating)},padding:GM})];async function ZM(e,t){return(await QE(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function QM(e){let t=Op(),n=kp(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o,columns:s}=e,c=i===`loading-initial`||i===`loading`?(0,G.jsx)(t.GridSuggestionMenu.Loader,{className:`bn-grid-suggestion-menu-loader`,columns:s}):null,l=(0,W.useMemo)(()=>{let e=[];for(let n=0;n<r.length;n++){let i=r[n];e.push((0,G.jsx)(t.GridSuggestionMenu.Item,{className:`bn-grid-suggestion-menu-item`,item:i,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===a,onClick:()=>o?.(i)},i.id))}return e},[t,r,o,a]);return(0,G.jsxs)(t.GridSuggestionMenu.Root,{id:`bn-grid-suggestion-menu`,columns:s,className:`bn-grid-suggestion-menu`,children:[c,l,l.length===0&&e.loadingState===`loaded`&&(0,G.jsx)(t.GridSuggestionMenu.EmptyItem,{className:`bn-grid-suggestion-menu-empty-item`,columns:s,children:n.suggestion_menu.no_items_title})]})}function $M(e){return e===void 0?void 0:`bn-suggestion-menu-item-`+e}function eN(e,t,n,r=3){let i=(0,W.useRef)(0);(0,W.useEffect)(()=>{t!==void 0&&(e.length>0?i.current=t.length:t.length-i.current>r&&n())},[n,r,e.length,t])}function tN(e,t){let[n,r]=(0,W.useState)([]),[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(void 0),s=(0,W.useRef)(void 0);return(0,W.useEffect)(()=>{let n=e;o.current=e,a(!0),t(e).then(e=>{o.current===n&&(r(e),a(!1),s.current=n)})},[e,t]),{items:n||[],usedQuery:s.current,loadingState:s.current===void 0?`loading-initial`:i?`loading`:`loaded`}}function nN(e,t,n,r,i){let a=pp(e),[o,s]=(0,W.useState)(0);return(0,W.useEffect)(()=>{let e=e=>(e.key===`ArrowLeft`&&(e.preventDefault(),n.length&&s((o-1+n.length)%n.length)),e.key===`ArrowRight`&&(e.preventDefault(),n.length&&s((o+1+n.length)%n.length)),e.key===`ArrowUp`?(e.preventDefault(),n.length&&s((o-r+n.length)%n.length),!0):e.key===`ArrowDown`?(e.preventDefault(),n.length&&s((o+r)%n.length),!0):e.key===`Enter`&&!e.isComposing&&(e.stopPropagation(),e.preventDefault(),n.length&&i?.(n[o]),!0));return a?.addEventListener(`keydown`,e,!0),()=>{a?.removeEventListener(`keydown`,e,!0)}},[a,n,o,i,r,r!==void 0&&r>1]),(0,W.useEffect)(()=>{s(0)},[t]),{selectedIndex:n.length===0?void 0:o}}function rN(e){let t=ap().setContentEditableProps,n=op(),{getItems:r,gridSuggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c,columns:l}=e,u=(0,W.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:d,usedQuery:f,loadingState:p}=tN(a,r);eN(d,f,s);let{selectedIndex:m}=nN(n,a,d,l,u);return(0,W.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,W.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":$M(m)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,G.jsx)(i,{items:d,onItemClick:u,loadingState:p,selectedIndex:m,columns:l})}function iN(e){let t=op(),n=pp(),{triggerCharacter:r,gridSuggestionMenuComponent:i,columns:a,shouldOpen:o,minQueryLength:s,onItemClick:c,getItems:l}=e,u=(0,W.useMemo)(()=>c||(e=>{e.onItemClick(t)}),[t,c]),d=(0,W.useMemo)(()=>l||(async e=>await ZM(t,e)),[t,l]),f=nj(YC);(0,W.useEffect)(()=>{f.addSuggestionMenu({triggerCharacter:r,shouldOpen:o})},[f,r,o]);let p=rj(YC),m=rj(YC,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),h=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:p?.show&&p?.triggerCharacter===r,onOpenChange:e=>{e||f.closeMenu()},placement:`bottom-start`,middleware:XM,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,p?.show,p?.triggerCharacter,f,r]);return!p||!p.ignoreQueryLength&&s&&(p.query.startsWith(` `)||p.query.length<s)?null:(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(oj,{reference:m,...h,children:r&&(0,G.jsx)(rN,{query:p.query,closeMenu:f.closeMenu,clearQuery:f.clearQuery,getItems:d,columns:a,gridSuggestionMenuComponent:i||QM,onItemClick:u})})})}function aN(e){let t=Op(),n=kp(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o}=e,s=i===`loading-initial`||i===`loading`?(0,G.jsx)(t.SuggestionMenu.Loader,{className:`bn-suggestion-menu-loader`}):null,c=(0,W.useMemo)(()=>{let e,n=[];for(let i=0;i<r.length;i++){let s=r[i];s.group!==e&&(e=s.group,n.push((0,G.jsx)(t.SuggestionMenu.Label,{className:`bn-suggestion-menu-label`,children:e},e))),n.push((0,G.jsx)(t.SuggestionMenu.Item,{className:gb(`bn-suggestion-menu-item`,s.size===`small`?`bn-suggestion-menu-item-small`:``),item:s,id:`bn-suggestion-menu-item-${i}`,isSelected:i===a,onClick:()=>o?.(s)},s.title))}return n},[t,r,o,a]);return(0,G.jsxs)(t.SuggestionMenu.Root,{id:`bn-suggestion-menu`,className:`bn-suggestion-menu`,children:[c,c.length===0&&(e.loadingState===`loading`||e.loadingState===`loaded`)&&(0,G.jsx)(t.SuggestionMenu.EmptyItem,{className:`bn-suggestion-menu-item`,children:n.suggestion_menu.no_items_title}),s]})}function oN(e,t){let[n,r]=(0,W.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:i=>{if(i.key===`ArrowUp`)return i.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if(i.key===`ArrowDown`)return i.preventDefault(),e.length&&r((n+1)%e.length),!0;if(i.key===`PageUp`)return i.preventDefault(),e.length&&r(0),!0;if(i.key===`PageDown`)return i.preventDefault(),e.length&&r(e.length-1),!0;let a=sN(i)?i.nativeEvent.isComposing:i.isComposing;return i.key===`Enter`&&!a&&(i.preventDefault(),i.stopPropagation(),e.length&&t?.(e[n]),!0)}}}function sN(e){return e.nativeEvent!==void 0}function cN(e,t,n,r,i){let a=pp(),{selectedIndex:o,setSelectedIndex:s,handler:c}=oN(n,r);return(0,W.useEffect)(()=>{let e=i||a;return e?.addEventListener(`keydown`,c,!0),()=>{e?.removeEventListener(`keydown`,c,!0)}},[a,n,o,r,i,c]),(0,W.useEffect)(()=>{s(0)},[t,s]),{selectedIndex:n.length===0?void 0:o}}function lN(e){let t=ap().setContentEditableProps,n=op(),{getItems:r,suggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c}=e,l=(0,W.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:u,usedQuery:d,loadingState:f}=tN(a,r);eN(u,d,s);let{selectedIndex:p}=cN(n,a,u,l);return(0,W.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,W.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":$M(p)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,p]),(0,G.jsx)(i,{items:u,onItemClick:l,loadingState:f,selectedIndex:p})}var uN={heading:Dm,heading_2:Em,heading_3:Tm,heading_4:wm,heading_5:Cm,heading_6:Sm,toggle_heading:Dm,toggle_heading_2:Em,toggle_heading_3:Tm,quote:um,toggle_list:tm,numbered_list:mm,bullet_list:pm,check_list:hm,paragraph:sm,table:cm,image:im,video:am,audio:em,file:Im,emoji:Gp,code_block:km,divider:Kp};function dN(e){return QC(e).map(e=>{let t=uN[e.key];return{...e,icon:(0,G.jsx)(t,{size:18})}})}function fN(e){let t=op(),n=pp(),{triggerCharacter:r,suggestionMenuComponent:i,shouldOpen:a,minQueryLength:o,onItemClick:s,getItems:c}=e,l=(0,W.useMemo)(()=>s||(e=>{e.onItemClick(t)}),[t,s]),u=(0,W.useMemo)(()=>c||(async e=>$C(dN(t),e)),[t,c]),d=nj(YC);(0,W.useEffect)(()=>{d.addSuggestionMenu({triggerCharacter:r,shouldOpen:a})},[d,r,a]);let f=rj(YC),p=rj(YC,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),m=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:f?.show&&f?.triggerCharacter===r,onOpenChange:e=>{e||d.closeMenu()},placement:`bottom-start`,middleware:XM,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,f?.show,f?.triggerCharacter,d,r]);return!f||!f.ignoreQueryLength&&o&&(f.query.startsWith(` `)||f.query.length<o)?null:(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(oj,{reference:p,...m,children:r&&(0,G.jsx)(lN,{query:f.query,closeMenu:d.closeMenu,clearQuery:d.clearQuery,getItems:u,suggestionMenuComponent:i||aN,onItemClick:l})})})}var pN=(e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)},mN=e=>{let t=Op(),n=op(),r=nj(sD),i=rj(sD,{selector:e=>e?.block}),a=(0,W.useRef)(!1),[o,s]=(0,W.useState)(),c=(0,W.useCallback)(t=>{r.freezeHandles(),e.hideOtherElements(!0),i&&(s({originalContent:i.content,originalCroppedContent:{rows:r.cropEmptyRowsOrColumns(i,e.orientation===`addOrRemoveColumns`?`columns`:`rows`)},startPos:e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY}),a.current=!1,t.preventDefault())},[i,e,r]),l=(0,W.useCallback)(()=>{i&&!a.current&&n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns(i,`columns`,1):r.addRowsOrColumns(i,`rows`,1)}})},[i,n,e.orientation,r]);return(0,W.useEffect)(()=>{let t=t=>{if(!i)return;if(!o)throw Error(`editingState is undefined`);a.current=!0;let s=(e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY)-o.startPos,c=e.orientation===`addOrRemoveColumns`?o.originalCroppedContent.rows[0]?.cells.length??0:o.originalCroppedContent.rows.length,l=e.orientation===`addOrRemoveColumns`?o.originalContent.rows[0]?.cells.length??0:o.originalContent.rows.length,u=e.orientation===`addOrRemoveColumns`?i.content.rows[0].cells.length:i.content.rows.length,d=l+pN(s/(e.orientation===`addOrRemoveColumns`?120:31),.3);d>=c&&d>0&&d!==u&&(n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`columns`,d-c):r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`rows`,d-c)}}),i.content&&n.setTextCursorPosition(i))};return o&&window.addEventListener(`mousemove`,t),()=>{window.removeEventListener(`mousemove`,t)}},[i,o,n,e.orientation,r]),(0,W.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),r.unfreezeHandles(),s(void 0)};return o&&window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mouseup`,t)}},[o,e,r]),n.isEditable?(0,G.jsx)(t.TableHandle.ExtendButton,{className:gb(`bn-extend-button`,e.orientation===`addOrRemoveColumns`?`bn-extend-button-add-remove-columns`:`bn-extend-button-add-remove-rows`,o===null?``:`bn-extend-button-editing`),onClick:l,onMouseDown:c,children:e.children||(0,G.jsx)($p,{size:18,"data-test":`extendButton`})}):null},hN=e=>{let t=Op(),n=vp(),r=kp(),i=op(),{block:a,colIndex:o,rowIndex:s}=rj(sD,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),c=(e,t)=>{if(a===void 0||o===void 0||s===void 0)return;let n=a.content.rows.map(e=>({...e,cells:e.cells.map(e=>sb(e))}));t===`text`?n[s].cells[o].props.textColor=e:n[s].cells[o].props.backgroundColor=e,i.updateBlock(a,{type:`table`,content:{...a.content,rows:n}}),i.setTextCursorPosition(a)};if(a===void 0||o===void 0||s===void 0)return null;let l=a.content.rows[s]?.cells?.[o];return!l||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1?null:(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Fj,{iconSize:18,text:i.settings.tables.cellTextColor?{color:lb(l)?l.props.textColor:`default`,setColor:e=>c(e,`text`)}:void 0,background:i.settings.tables.cellBackgroundColor?{color:lb(l)?l.props.backgroundColor:`default`,setColor:e=>c(e,`background`)}:void 0})})]})},gN=()=>{let e=Op(),t=kp(),n=op(),r=nj(sD),{block:i,colIndex:a,rowIndex:o}=rj(sD,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(i===void 0||a===void 0||o===void 0)return null;let s=i.content.rows[o]?.cells?.[a];return!s||!lb(s)||db(s)===1&&ub(s)===1||!n.settings.tables.splitCells?null:(0,G.jsx)(e.Generic.Menu.Item,{onClick:()=>{r.splitCell({row:o,col:a})},children:t.table_handle.split_cell_menuitem})},_N=e=>{let t=Op();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-table-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(gN,{}),(0,G.jsx)(hN,{})]})})},vN=e=>{let t=Op(),n=vp(),r=op(),i=nj(sD),a=e.tableCellMenu||_N;return!r.settings.tables.splitCells&&!r.settings.tables.cellBackgroundColor&&!r.settings.tables.cellTextColor?null:(0,G.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(i.freezeHandles(),e.hideOtherElements(!0)):(i.unfreezeHandles(),e.hideOtherElements(!1),r.focus())},position:`right`,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{children:(0,G.jsx)(t.Generic.Menu.Button,{className:`bn-table-cell-handle`,children:e.children||(0,G.jsx)(OM,{size:12,"data-test":`tableCellHandle`})})}),(0,G.jsx)(a,{})]})},yN=e=>{let t=Op(),n=kp(),r=nj(sD),i=rj(sD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{r.addRowOrColumn(i,e.orientation===`row`?{orientation:`row`,side:e.side}:{orientation:`column`,side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},bN=e=>{let t=Op(),n=kp(),r=nj(sD),i=rj(sD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>r.removeRowOrColumn(i,e.orientation),children:e.orientation===`row`?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},xN=e=>{let t=Op(),n=vp(),r=kp(),i=op(),a=nj(sD),{block:o,index:s}=rj(sD,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})}),c=(0,W.useMemo)(()=>a===void 0||o===void 0||s===void 0?[]:e.orientation===`row`?a.getCellsAtRowHandle(o,s):a.getCellsAtColumnHandle(o,s),[o,s,e.orientation,a]),l=(e,t)=>{if(o===void 0)return;let n=o.content.rows.map(e=>({...e,cells:e.cells.map(e=>sb(e))}));c.forEach(({row:r,col:i})=>{t===`text`?n[r].cells[i].props.textColor=e:n[r].cells[i].props.backgroundColor=e}),i.updateBlock(o,{type:`table`,content:{...o.content,rows:n}}),i.setTextCursorPosition(o)};if(!c||!c[0]||!a||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1)return null;let u=sb(c[0].cell);return(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Fj,{iconSize:18,text:i.settings.tables.cellTextColor?{color:c.every(({cell:e})=>lb(e)&&e.props.textColor===u.props.textColor)?u.props.textColor:`default`,setColor:e=>{l(e,`text`)}}:void 0,background:i.settings.tables.cellBackgroundColor?{color:c.every(({cell:e})=>lb(e)&&e.props.backgroundColor===u.props.backgroundColor)?u.props.backgroundColor:`default`,setColor:e=>l(e,`background`)}:void 0})})]})},SN=e=>{let t=Op(),n=kp(),r=op(),i=nj(sD),{block:a,index:o}=rj(sD,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})});if(i===void 0||a===void 0||o!==0||e.orientation!==`row`||!r.settings.tables.headers)return null;let s=!!a.content.headerRows;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerRows:s?void 0:1}})},children:n.drag_handle.header_row_menuitem})},CN=e=>{let t=Op(),n=kp(),r=op(),i=nj(sD),a=rj(sD,{selector:e=>e?.block}),o=rj(sD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});if(!i||o!==0||!a||e.orientation!==`column`||!r.settings.tables.headers)return null;let s=!!a.content.headerCols;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerCols:s?void 0:1}})},children:n.drag_handle.header_column_menuitem})},wN=e=>{let t=Op();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-table-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bN,{orientation:e.orientation}),(0,G.jsx)(yN,{orientation:e.orientation,side:e.orientation===`row`?`above`:`left`}),(0,G.jsx)(yN,{orientation:e.orientation,side:e.orientation===`row`?`below`:`right`}),(0,G.jsx)(SN,{orientation:e.orientation}),(0,G.jsx)(CN,{orientation:e.orientation}),(0,G.jsx)(xN,{orientation:e.orientation})]})})},TN=e=>{let t=op(),n=Op(),r=vp(),[i,a]=(0,W.useState)(!1),o=e.tableHandleMenu||wN,s=nj(sD),c=rj(sD),l=(0,W.useMemo)(()=>!s||!c||!c.block||c.block.type!==`table`?!1:e.orientation===`column`?s.getCellsAtColumnHandle(c.block,c.colIndex).every(({cell:e})=>ub(e)===1):s.getCellsAtRowHandle(c.block,c.rowIndex).every(({cell:e})=>db(e)===1),[e.orientation,c,s]);return c?(0,G.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(s.freezeHandles(),e.hideOtherElements(!0)):(s.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:`right`,portalElement:r,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.TableHandle.Root,{className:gb(`bn-table-handle`,i?`bn-table-handle-dragging`:``,l?``:`bn-table-handle-not-draggable`),draggable:l,onDragStart:t=>{a(!0),e.hideOtherElements(!0),e.orientation===`column`?s.colDragStart(t):s.rowDragStart(t)},onDragEnd:()=>{s.dragEnd(),e.hideOtherElements(!1),a(!1)},style:e.orientation===`column`?{transform:`rotate(0.25turn)`}:void 0,children:e.children||(0,G.jsx)(kM,{size:24,"data-test":`tableHandle`})})}),(0,G.jsx)(o,{orientation:e.orientation})]}):null},EN=e=>{let t=op(),[n,r]=(0,W.useState)(),i=rj(sD),a=(0,W.useMemo)(()=>{let e={};if(i===void 0)return{};let n=yw(i.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,a=t.prosemirrorView.domAtPos(r+1).node;if(!(a instanceof Element))return{};if(e.tableReference={element:a},i.rowIndex===void 0||i.colIndex===void 0)return e;let o=t.prosemirrorState.doc.resolve(r+1).posAtIndex(i.rowIndex),s=t.prosemirrorState.doc.resolve(o+1).posAtIndex(i.colIndex),c=t.prosemirrorView.domAtPos(s+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,i.draggingState&&i.draggingState.draggedCellOrientation===`row`?i.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(i.draggingState&&i.draggingState.draggedCellOrientation===`col`?i.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,i]),o=(0,W.useCallback)((e,n,r)=>{let i=!1;return P(e,n,()=>{i?t.getExtension(sD)?.hideHandlesIfNotFrozen():i=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1})},[t]),s=(0,W.useMemo)(()=>i===void 0?void 0:{rowTableHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`),placement:`left`,middleware:[A(-10)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`),placement:`top`,middleware:[A(-12)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`),placement:`top-end`,middleware:[A({mainAxis:-15,crossAxis:-1})],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`),placement:`bottom`,whileElementsMounted:o,middleware:[ee({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`),placement:`right`,whileElementsMounted:o,middleware:[ee({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,i,o]);if(!i)return null;let c=e.tableHandle||TN,l=e.extendButton||mN,u=e.tableCellHandle||vN;return(0,G.jsxs)(bp,{target:e.portalElement,children:[(0,G.jsx)(oj,{reference:a?.rowReference,...s?.rowTableHandle,children:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`)&&(0,G.jsx)(c,{orientation:`row`,hideOtherElements:e=>r(e?`rowTableHandle`:void 0)})}),(0,G.jsx)(oj,{reference:a?.columnReference,...s?.columnTableHandle,children:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`)&&(0,G.jsx)(c,{orientation:`column`,hideOtherElements:e=>r(e?`columnTableHandle`:void 0)})}),(0,G.jsx)(oj,{reference:a?.cellReference,...s?.tableCellHandle,children:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`)&&(0,G.jsx)(u,{hideOtherElements:e=>r(e?`tableCellHandle`:void 0)})}),(0,G.jsx)(oj,{reference:a?.tableReference,...s?.extendRowsButton,children:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`)&&(0,G.jsx)(l,{orientation:`addOrRemoveRows`,hideOtherElements:e=>r(e?`extendRowsButton`:void 0)})}),(0,G.jsx)(oj,{reference:a?.tableReference,...s?.extendColumnsButton,children:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`)&&(0,G.jsx)(l,{orientation:`addOrRemoveColumns`,hideOtherElements:e=>r(e?`extendColumnsButton`:void 0)})})]})};function DN(e){if(e!==void 0){if(typeof e==`string`){if(typeof document>`u`)return;let t=document.querySelector(e);if(!t){console.warn(`[BlockNote] portalElements selector "${e}" did not match any element`);return}return t}return e}}var ON=(0,W.lazy)(()=>Promise.resolve().then(()=>dP)),kN=(0,W.lazy)(()=>Promise.resolve().then(()=>gP));function AN(e){let t=op();if(!t)throw Error(`BlockNoteDefaultUI must be used within a BlockNoteContext.Provider`);let n=e.portalElements,r=DN(n?.formattingToolbar),i=DN(n?.linkToolbar),a=DN(n?.slashMenu),o=DN(n?.emojiPicker),s=DN(n?.sideMenu),c=DN(n?.filePanel),l=DN(n?.tableHandles),u=DN(n?.comments),d=DN(n?.attributionTooltip);return(0,G.jsxs)(G.Fragment,{children:[t.getExtension(WC)&&e.formattingToolbar!==!1&&(0,G.jsx)(bM,{portalElement:r}),t.getExtension(eT)&&e.linkToolbar!==!1&&(0,G.jsx)(TM,{portalElement:i}),t.getExtension(YC)&&e.slashMenu!==!1&&(0,G.jsx)(fN,{triggerCharacter:`/`,shouldOpen:e=>!e.selection.$from.parent.type.isInGroup(`tableContent`),portalElement:a}),t.getExtension(YC)&&e.emojiPicker!==!1&&(0,G.jsx)(iN,{triggerCharacter:`:`,columns:10,minQueryLength:2,portalElement:o}),t.getExtension(VE)&&e.sideMenu!==!1&&(0,G.jsx)(RM,{portalElement:s}),t.getExtension(OS)&&e.filePanel!==!1&&(0,G.jsx)(Dj,{portalElement:c}),t.getExtension(sD)&&e.tableHandles!==!1&&(0,G.jsx)(EN,{portalElement:l}),t.getExtension(yj)&&e.comments!==!1&&(0,G.jsxs)(W.Suspense,{children:[(0,G.jsx)(ON,{portalElement:u}),(0,G.jsx)(kN,{portalElement:u})]}),t.getExtension(`attribution`)&&e.attributionTooltip!==!1&&(0,G.jsx)(UM,{portalElement:d})]})}var jN=!1;function MN(){typeof process>`u`&&(jN||typeof document>`u`||(jN=!0,(document.querySelector(`meta[name="viewport"]`)?.getAttribute(`content`)??``).replace(/\s/g,``).includes(`interactive-widget=resizes-content`)||console.warn(`[BlockNote] This page's viewport meta tag is missing "interactive-widget=resizes-content" in its content attribute. Add it to ensure proper mobile functionality, e.g. <meta name="viewport" content="width=device-width, initial-scale=1, interactive-widget=resizes-content">. See https://www.blocknotejs.org/docs/getting-started#mobile-compatibility for more information`)))}function NN(e,t){let n=ap(),r=t??n?.editor,i=(0,W.useRef)(e);up(()=>{i.current=e}),(0,W.useEffect)(()=>{if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return r.onChange((...e)=>i.current(...e))},[r])}function PN(e,t,n){let r=ap(),i=t??r?.editor,a=(0,W.useRef)(e);up(()=>{a.current=e}),(0,W.useEffect)(()=>{if(!i)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return i.onSelectionChange(e=>a.current(e),n)},[i,n])}var FN=()=>{let e=(0,W.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: dark)`),[]),t=(0,W.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: light)`),[]),n=e?.matches,r=t?.matches,[i,a]=(0,W.useState)(n?`dark`:r?`light`:`no-preference`);return(0,W.useEffect)(()=>{a(n?`dark`:r?`light`:`no-preference`)},[n,r]),(0,W.useEffect)(()=>{if(typeof e?.addEventListener==`function`){let n=({matches:e})=>e&&a(`dark`),r=({matches:e})=>e&&a(`light`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,r),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,r)}}{let n=()=>a(e.matches?`dark`:t.matches?`light`:`no-preference`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,n),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,n)}}},[e,t]),window.matchMedia,i};function IN(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:(0,np.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var LN=({contentComponent:e})=>{let t=(0,W.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,G.jsx)(G.Fragment,{children:Object.values(t)})},RN=(0,W.forwardRef)((e,t)=>{let[n,r]=(0,W.useState)();return(0,W.useImperativeHandle)(t,()=>(e,t)=>{(0,np.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,G.jsx)(G.Fragment,{children:n&&(0,np.createPortal)(n.node,n.container)})}),zN=()=>{};function BN(e,t){let{editor:n,className:r,theme:i,children:a,editable:o,onSelectionChange:s,onChange:c,formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g,portalElements:_,applyThemedRoot:v,autoFocus:y,renderEditor:b=!0,...x}=e,S=(0,W.useMemo)(()=>DN(_?.default),[_?.default]),[C,w]=(0,W.useState)(),T=ap(),E=FN(),D=T?.colorSchemePreference||E,O=i||(D===`dark`?`dark`:`light`),k=Op(),A=(0,W.useMemo)(()=>({formattingToolbar:k?l:!1,linkToolbar:k?u:!1,sideMenu:k?p:!1,slashMenu:k?d:!1,filePanel:k?m:!1,tableHandles:k?h:!1,emojiPicker:k?f:!1,comments:k?g:!1,portalElements:_}),[g,k,f,m,l,u,p,d,h,_]);NN(c||zN,n),PN(s||zN,n);let j=(0,W.useCallback)(e=>{n.elementRenderer=e},[n]),M=(0,W.useCallback)(e=>{e.className=gb(`bn-root`,O,r||``),e.setAttribute(`data-color-scheme`,O),v?.(e)},[O,r,v]),N=(0,W.useMemo)(()=>({...T,editor:n,setContentEditableProps:w,colorSchemePreference:O}),[T,n,O]),P=(0,W.useMemo)(()=>({editorProps:{autoFocus:y,contentEditableProps:C,editable:o},defaultUIProps:A,applyThemedRoot:M}),[y,C,o,A,M]);return(0,G.jsx)(ip.Provider,{value:N,children:(0,G.jsxs)(mp.Provider,{value:P,children:[(0,G.jsx)(RN,{ref:j}),(0,G.jsx)(VN,{className:r,renderEditor:b,editorColorScheme:O,defaultPortalElement:S,ref:t,...x,children:a})]})})}var VN=W.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,defaultPortalElement:r,children:i,...a},o)=>(0,G.jsx)(`div`,{className:gb(`bn-root`,`bn-container`,n,e),"data-color-scheme":n,...a,ref:o,children:(0,G.jsx)(yp,{children:(0,G.jsx)(bp,{target:r,children:t?(0,G.jsx)(UN,{children:i}):i})})})),HN=W.forwardRef(BN),UN=e=>{let t=hp(),n=op(),r=(0,W.useMemo)(()=>IN(),[]);(0,W.useEffect)(()=>{MN()},[]);let i=(0,W.useCallback)(e=>{n.isEditable=t.editorProps.editable!==!1,n._tiptapEditor.contentComponent=r,e?n.mount(e):n.unmount()},[t.editorProps.editable,n,r]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(LN,{contentComponent:r}),(0,G.jsx)(WN,{...t.editorProps,...e,mount:i}),(0,G.jsx)(AN,{...t.defaultUIProps}),e.children]})},WN=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,G.jsx)(`div`,{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"data-bn-autofocus":t,ref:n,...r})};function GN(e,t){let n,r=document.createElement(`div`),i;if(t?.elementRenderer)t.elementRenderer(e(e=>n=e||void 0),r);else{if(!t?.headless)throw Error(`elementRenderer not available, expected headless editor`);i=(0,bj.createRoot)(r),(0,np.flushSync)(()=>{i.render(e(e=>n=e||void 0))})}if(!r.childElementCount)return i?.unmount(),{dom:document.createElement(`span`)};n?.setAttribute(`data-tmp-find`,`true`);let a=r.cloneNode(!0),o=a.firstElementChild,s=a.querySelector(`[data-tmp-find]`);return s?.removeAttribute(`data-tmp-find`),i?.unmount(),{dom:o,contentDOM:s||void 0}}function KN(e,t){let n=(0,W.useRef)(t),r=e.view.state.doc;if(e.node.type.isInGroup(`bnBlock`))return Kb(e.node,r);try{n.current=dx(e.getPos,r)}catch{}return n.current}var qN={display:`contents`},JN=`data-bn-children-ref`;function YN(e){let t=e.querySelector(`[${JN}]`);return e.hasAttribute(JN)&&(t=e),t?.removeAttribute(JN),t??void 0}function XN(e,t){function n(){let n=e.querySelector(`[data-id]`);return n?.getAttribute(`data-id`)===t()?n:e}e.getBoundingClientRect=()=>Element.prototype.getBoundingClientRect.call(n()),e.getClientRects=()=>Element.prototype.getClientRects.call(n())}function ZN(e){return(0,G.jsx)($t,{onDragOver:e=>e.preventDefault(),...Object.fromEntries(Object.entries(e.domAttributes||{}).filter(([e])=>e!==`class`)),className:gb(`bn-block-content`,e.domAttributes?.class||``),"data-content-type":e.blockType,...jb(e.blockProps,e.propSchema),"data-file-block":e.isFileBlock===!0||void 0,children:e.children})}function QN(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t;xx(i,a);let{render:o,renderFrame:s,toExternalHTML:c,...l}=a,u=n?typeof n==`function`?n(r):n:void 0,d=i.layoutOnly===!0;function f(e){let{BlockContent:t,block:n,editor:r}=e;return GN(a=>{let o=(0,G.jsx)(t,{block:n,editor:r,childrenRef:e.childrenRef,contentRef:e=>{a(e),e&&!d&&(e.className=gb(`bn-inline-content`,e.className))},context:e.context});return d?o:(0,G.jsx)(ZN,{blockType:n.type,blockProps:n.props,propSchema:i.propSchema,domAttributes:e.domAttributes,isFileBlock:e.isFileBlock,children:o})},r)}let p=s;function m(e,t,n){Zb(e);let r=e.closest(`[data-node-view-wrapper]`)?.firstElementChild;if(!(r instanceof HTMLElement))throw Error(`Layout block content must be inside its node view wrapper.`);Yb(r,i.type,t.props,i.propSchema,t.id),r.toggleAttribute(`data-selected`,n)}function h(e){let t=Kb(e.node,e.view.state.doc);if(t.type!==i.type)throw Error(`Frame for "${i.type}" received block "${t.type}".`);let n=Wt().nodeViewContentRef,r=(0,W.useRef)(null),a=(0,W.useRef)(null);if(!n||!p)throw Error(`Frame node view requires a frame and content mount.`);let o=(0,W.useRef)({block:t,selected:e.selected});(0,W.useLayoutEffect)(()=>{o.current={block:t,selected:e.selected},d&&a.current&&m(a.current,t,e.selected)});let s=(0,W.useCallback)(e=>{a.current=e,e&&(e.dataset.nodeViewContent=``),n(e??(d?null:r.current)),d&&e&&m(e,o.current.block,o.current.selected)},[n]),c=(0,W.useCallback)(e=>{r.current=e,!a.current&&!d&&n(e)},[n]);return(0,G.jsx)($t,{ref:c,style:qN,children:(0,G.jsx)(p,{block:t,editor:e.extension.options.editor,slotRef:s})})}return{config:i,implementation:{...l,...c&&{toExternalHTML(e,t,n){let r=f({BlockContent:c,block:e,editor:t,domAttributes:this.blockContentDOMAttributes,isFileBlock:a.meta?.fileBlockAccept!==void 0,context:n,childrenRef:e=>e?.setAttribute(JN,``)});return{...r,childrenDOM:YN(r.dom)}}},...o&&{render(e,t){if(this.renderType===`nodeView`){let n=e,r=o,s=this.blockContentDOMAttributes;function c(e){let o=KN(e,n),c=Wt().nodeViewContentRef;if(!c)throw Error(`nodeViewContentRef is not set`);let l=c;function u(e){l(e),e&&(e.dataset.nodeViewContent=``,e.className=gb(`bn-inline-content`,e.className))}return(0,G.jsx)(ZN,{blockType:o.type,blockProps:o.props,propSchema:i.propSchema,isFileBlock:!!a.meta?.fileBlockAccept,domAttributes:s,children:(0,G.jsx)(r,{block:o,editor:t,contentRef:u})})}return tn(c,{className:`bn-react-node-view-renderer`})(this.props)}return f({BlockContent:o,block:e,editor:t,domAttributes:this.blockContentDOMAttributes})}},...p?{renderFrame(e,t){let{dom:n,contentDOM:r}=GN(n=>(0,G.jsx)(p,{block:e,editor:t,slotRef:n}),t);return r?{dom:n,slot:r}:void 0},frameView:e=>{let t=tn(h,{className:`bn-react-node-view-renderer bn-frame-node-view`})(e);if(!(t instanceof Vt))throw Error(`React frames need an editor that renders React node views.`);let n=t.dom,r=t.contentDOM;if(!r)throw Error(`React frame node view has no content DOM.`);return d&&(r.style.display=`contents`,XN(n,()=>t.node.attrs.id)),{dom:n,slot:r,get node(){return t.node},update(e,n,r){return!d&&e.firstChild?.type!==t.node.firstChild?.type?!1:t.update(e,n,r)},selectNode:()=>t.selectNode(),deselectNode:()=>t.deselectNode(),destroy:()=>t.destroy()}}}:{}},extensions:u}}}var $N;async function eP(){return $N||($N=(async()=>{let[e,t]=await Promise.all([Hn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),Hn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),$N)}function tP(e){let t=(0,W.useRef)(null),n=(0,W.useRef)(null);return n.current&&n.current.update(e),(0,W.useEffect)(()=>((async()=>{let{emojiMart:r}=await eP();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),W.createElement(`div`,{ref:t})}var nP=e=>{let[t,n]=(0,W.useState)(!1),r=Op(),i=ap(),a=vp();return(0,G.jsxs)(r.Generic.Popover.Root,{open:t,portalElement:a,children:[(0,G.jsx)(r.Generic.Popover.Trigger,{children:(0,G.jsx)(`div`,{onClick:r=>{r.preventDefault(),r.stopPropagation(),n(!t),e.onOpenChange?.(!t)},style:{display:`flex`,justifyContent:`center`,alignItems:`center`},children:e.children})}),(0,G.jsx)(r.Generic.Popover.Content,{className:`bn-emoji-picker-popover`,variant:`panel-popover`,children:(0,G.jsx)(tP,{perLine:7,onClickOutside:()=>{n(!1),e.onOpenChange?.(!1)},onEmojiSelect:t=>{e.onEmojiSelect(t),n(!1),e.onOpenChange?.(!1)},theme:i?.colorSchemePreference})})]})};function rP(e){let{userStore:t}=nj(yj),n=e.join(`,`);return(0,W.useEffect)(()=>{t.loadUsers(e)},[t,n]),sp(t.store,t=>{let n=new Map;for(let r of e){let e=t.get(r);e&&n.set(r,e)}return n})}function iP(e){return rP([e]).get(e)}var aP=e=>{let t=Op(),n=kp(),r=nj(yj),i=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!i)throw Error(`Trying to render reaction badge for non-existing reaction`);let[a,o]=(0,W.useState)([]),s=rP(a);return(0,G.jsx)(t.Generic.Badge.Root,{className:gb(`bn-badge`,`bn-comment-reaction`),text:i.userIds.length.toString(),icon:i.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,i.emoji),onClick:()=>e.onReactionSelect(i.emoji),onMouseEnter:()=>o(i.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(s.values()).map(e=>e.username).join(`
|
|
267
|
-
`)}`},i.emoji)},oP=(0,W.memo)(({isEmpty:e,comment:t,isEditing:n,threadStore:r,onReactionSelect:i,onEditSubmit:a,onEditCancel:o,onEmojiPickerOpenChange:s,Components:c,dict:l})=>{let u=r.auth.canAddReaction(t);return(0,G.jsxs)(G.Fragment,{children:[t.reactions.length>0&&!n&&(0,G.jsxs)(c.Generic.Badge.Group,{className:gb(`bn-badge-group`,`bn-comment-reactions`),children:[t.reactions.map(e=>(0,G.jsx)(aP,{comment:t,emoji:e.emoji,onReactionSelect:i},e.emoji)),u&&(0,G.jsx)(nP,{onEmojiSelect:e=>i(e.native),onOpenChange:s,children:(0,G.jsx)(c.Generic.Badge.Root,{className:gb(`bn-badge`,`bn-comment-add-reaction`),text:`+`,icon:(0,G.jsx)(Wp,{size:16}),mainTooltip:l.comments.actions.add_reaction})})]}),n&&(0,G.jsxs)(c.Generic.Toolbar.Root,{variant:`action-toolbar`,className:gb(`bn-action-toolbar`,`bn-comment-actions`),children:[(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:l.comments.save_button_text,variant:`compact`,onClick:a,isDisabled:e,children:l.comments.save_button_text}),(0,G.jsx)(c.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:l.comments.cancel_button_text,variant:`compact`,onClick:o,children:l.comments.cancel_button_text})]})]})}),sP=({comment:e,thread:t,showResolveButton:n})=>{let r=nj(yj),i=kp(),[a,o]=(0,W.useState)(!1),s=cj({initialContent:e.body,trailingBlock:!1,dictionary:{...i,placeholders:{emptyDocument:i.placeholders.edit_comment}},schema:r.commentEditorSchema||pj,extensions:[hj({submitOnEnter:r.submitOnEnter,onSubmit:async n=>{await r.threadStore.updateComment({commentId:e.id,comment:{body:n.document},threadId:t.id}),o(!1)}})]}),c=Op(),l=vp(),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),m=r.threadStore,h=(0,W.useCallback)(()=>{o(!0)},[]),g=(0,W.useCallback)(()=>{s.replaceBlocks(s.document,e.body),o(!1)},[s,e.body]),_=s.getExtension(hj).submit,v=(0,W.useCallback)(async()=>{await m.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,m]),y=(0,W.useCallback)(async n=>{m.auth.canAddReaction(e,n)?await m.addReaction({threadId:t.id,commentId:e.id,emoji:n}):m.auth.canDeleteReaction(e,n)&&await m.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[m,e,t.id]),b=(0,W.useCallback)(async()=>{await m.resolveThread({threadId:t.id})},[t.id,m]),x=(0,W.useCallback)(async()=>{await m.unresolveThread({threadId:t.id})},[t.id,m]),S=iP(e.userId);if(!e.body)return null;let C,w=m.auth.canAddReaction(e),T=m.auth.canDeleteComment(e),E=m.auth.canUpdateComment(e),D=n&&(t.resolved?m.auth.canUnresolveThread(t):m.auth.canResolveThread(t));a||(C=(0,G.jsxs)(c.Generic.Toolbar.Root,{className:gb(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:[w&&(0,G.jsx)(nP,{onEmojiSelect:e=>y(e.native),onOpenChange:d,children:(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.add_reaction,variant:`compact`,children:(0,G.jsx)(Wp,{size:16})},`add-reaction`)}),D&&(t.resolved?(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.reopen,variant:`compact`,onClick:x,children:(0,G.jsx)(zm,{size:16})},`reopen`):(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.resolve,variant:`compact`,onClick:b,children:(0,G.jsx)(Qp,{size:16})},`resolve`)),(T||E)&&(0,G.jsxs)(c.Generic.Menu.Root,{position:`bottom-start`,onOpenChange:p,portalElement:l,children:[(0,G.jsx)(c.Generic.Menu.Trigger,{children:(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.more_actions,variant:`compact`,children:(0,G.jsx)(qp,{size:16})},`more-actions`)}),(0,G.jsxs)(c.Generic.Menu.Dropdown,{className:`bn-menu-dropdown`,children:[E&&(0,G.jsx)(c.Generic.Menu.Item,{icon:(0,G.jsx)(Rm,{}),onClick:h,children:i.comments.actions.edit_comment},`edit-comment`),T&&(0,G.jsx)(c.Generic.Menu.Item,{icon:(0,G.jsx)(Xp,{}),onClick:v,children:i.comments.actions.delete_comment},`delete-comment`)]})]})]}));let O=e.createdAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(!e.body)throw Error(`soft deletes are not yet supported`);return(0,G.jsx)(c.Comments.Comment,{authorInfo:S??`loading`,timeString:O,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:f||`hover`,actions:C,className:`bn-thread-comment`,emojiPickerOpen:u,children:(0,G.jsx)(lj,{autoFocus:a,editor:s,editable:a,actions:e.reactions.length>0||a?({isFocused:t,isEmpty:n})=>(0,G.jsx)(oP,{isFocused:t,isEmpty:n,comment:e,isEditing:a,threadStore:m,onReactionSelect:y,onEditSubmit:_,onEditCancel:g,onEmojiPickerOpenChange:d,Components:c,dict:i}):void 0})})},cP=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=Op(),r=kp(),i=rP(e.resolvedBy?[e.resolvedBy]:[]),a=e.comments.map((t,n)=>(0,G.jsx)(sP,{thread:e,comment:t,showResolveButton:n===0},t.id+JSON.stringify(t.body||`{}`)));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!i.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;a.splice(t,0,(0,G.jsx)(n.Comments.Comment,{className:`bn-thread-comment`,authorInfo:e.resolvedBy&&i.get(e.resolvedBy)||`loading`,timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),edited:!1,showActions:!1,children:(0,G.jsx)(`div`,{className:`bn-resolved-text`,children:r.comments.sidebar.marked_as_resolved})},`resolved-comment`))}return t&&a.length>t&&a.splice(1,a.length-2,(0,G.jsx)(n.Comments.ExpandSectionsPrompt,{className:`bn-thread-expand-prompt`,children:r.comments.sidebar.more_replies(e.comments.length-2)},`expand-prompt`)),a},lP=(0,W.memo)(({isEmpty:e,onSave:t,Components:n,dict:r})=>(0,G.jsx)(n.Generic.Toolbar.Root,{className:gb(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:(0,G.jsx)(n.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})}));function uP(e){let t=e.newCommentEditor,n=Op(),r=kp(),i=t.getExtension(hj);if(!i)throw Error(`FloatingComposer's newCommentEditor must include CommentEditorSubmitExtension.`);let a=i.submit;return(0,G.jsx)(n.Comments.Card,{className:`bn-thread`,children:(0,G.jsx)(lj,{autoFocus:!0,editable:!0,editor:t,actions:({isFocused:e,isEmpty:t})=>(0,G.jsx)(lP,{isFocused:e,isEmpty:t,onSave:a,Components:n,dict:r})})})}var dP=Sj({default:()=>fP});function fP(e){let t=op(),n=kp(),r=nj(yj),i=rj(yj,{editor:t,selector:e=>e.pendingComment}),a=cj({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.new_comment}},schema:r.commentEditorSchema||pj,extensions:[hj({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{await r.createThread({initialComment:{body:e.document}}),r.stopPendingComment(),t.transact(e=>{e.setSelection(wr.create(e.doc,e.selection.to))}),t.focus()}})]},[i]),o=fp({editor:t,selector:({editor:e})=>i?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),s=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:e=>{if(!e){if(!mj({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;r.stopPendingComment(),t.focus()}},placement:`bottom`,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,i,e.floatingUIOptions]),c=e.floatingComposer||uP;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(sj,{position:o,...s,children:(0,G.jsx)(c,{newCommentEditor:a})})})}var pP=(0,W.memo)(({isEmpty:e,onNewCommentSave:t,Components:n,dict:r})=>e?null:(0,G.jsx)(n.Generic.Toolbar.Root,{variant:`action-toolbar`,className:gb(`bn-action-toolbar`,`bn-comment-actions`),children:(0,G.jsx)(n.Generic.Toolbar.Button,{mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})})),mP=({thread:e,selected:t,orphaned:n,referenceText:r,maxCommentsBeforeCollapse:i,onFocus:a,onBlur:o,tabIndex:s,newCommentEditor:c})=>{let l=Op(),u=kp(),d=nj(yj),f=(0,W.useRef)(e.id);f.current=e.id;let p=cj({trailingBlock:!1,dictionary:{...u,placeholders:{emptyDocument:u.placeholders.comment_reply}},schema:d.commentEditorSchema||pj,extensions:[hj({submitOnEnter:d.submitOnEnter,onSubmit:async e=>{await d.threadStore.addComment({comment:{body:e.document},threadId:f.current}),e.removeBlocks(e.document)}})]}),m=c??p,h=m.getExtension(hj);if(!h)throw Error(`Thread's newCommentEditor must include CommentEditorSubmitExtension.`);let g=h.submit;return(0,G.jsxs)(l.Comments.Card,{className:gb(`bn-thread`,n&&`bn-thread-orphaned`),headerText:r,onFocus:a,onBlur:o,selected:t,tabIndex:s,children:[(0,G.jsx)(l.Comments.CardSection,{className:`bn-thread-comments`,children:(0,G.jsx)(cP,{thread:e,maxCommentsBeforeCollapse:t?void 0:i||5})}),t&&(0,G.jsx)(l.Comments.CardSection,{className:`bn-thread-composer`,children:(0,G.jsx)(lj,{autoFocus:!1,editable:!0,editor:m,actions:({isFocused:e,isEmpty:t})=>(0,G.jsx)(pP,{isFocused:e,isEmpty:t,onNewCommentSave:g,Components:l,dict:u})})})]})};function hP(){let e=nj(yj).threadStore,t=(0,W.useRef)(void 0);t.current||=e.getThreads();let n=(0,W.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]);return(0,W.useSyncExternalStore)(n,()=>t.current)}var gP=Sj({default:()=>_P});function _P(e){let t=op(),n=kp(),r=nj(yj),i=rj(yj,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),a=cj({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.comment_reply}},schema:r.commentEditorSchema||pj,extensions:[hj({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{i&&(await r.threadStore.addComment({comment:{body:e.document},threadId:i.id}),e.removeBlocks(e.document))}})]},[i?.id]),o=hP(),s=(0,W.useMemo)(()=>i?o.get(i.id):void 0,[i,o]),c=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:(e,i,o)=>{if(!e){if(!mj({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;o===`escape-key`&&t.focus(),r.selectThread(void 0)}},placement:`bottom`,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,e.floatingUIOptions,i]),l=e.floatingThread||mP;return(0,G.jsx)(bp,{target:e.portalElement,children:(0,G.jsx)(sj,{position:i?.position,...c,children:s&&(0,G.jsx)(l,{thread:s,selected:!0,newCommentEditor:a})})})}W.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:r,orphaned:i})=>{let a=nj(yj),o=(0,W.useCallback)(t=>{t.target.closest(`.bn-action-toolbar`)||a.selectThread(e.id)},[a,e.id]),s=(0,W.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(`.bn-action-toolbar`))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(`.bn-thread`):null;t&&n&&n.contains(t)||a.selectThread(void 0)},[a]);return(0,G.jsx)(mP,{thread:e,selected:e.id===t,orphaned:i,referenceText:r,maxCommentsBeforeCollapse:n,onFocus:o,onBlur:s,tabIndex:0})});function vP(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>{e&&t.current?.focus({preventScroll:!0})},[e]),t}function yP(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement&&e.currentTarget.contains(e.relatedTarget)}function bP({onBlur:e,onFocus:t}={}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)(!1),a=(0,W.useRef)(!1),o=e=>{i(e),a.current=e},s=(0,W.useCallback)(e=>{a.current||(o(!0),t?.(e))},[t]),c=(0,W.useCallback)(t=>{a.current&&!yP(t)&&(o(!1),e?.(t))},[e]);return(0,W.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`focusin`,s),e.addEventListener(`focusout`,c),()=>{e?.removeEventListener(`focusin`,s),e?.removeEventListener(`focusout`,c)}},[s,c]),{ref:n,focused:r}}function xP(e){return(0,G.jsx)($t,{as:`span`,className:`bn-inline-content-section`,"data-inline-content-type":e.inlineContentType,...jb(e.inlineContentProps,e.propSchema),children:e.children})}function SP(e,t,n){let r=Pt.create({name:e.type,inline:!0,group:`inline`,selectable:e.content!==`none`,atom:e.content===`none`,draggable:t.meta?.draggable,code:t.meta?.code,content:e.content===`styled`?`inline*`:e.content===`plain`?`text*`:``,marks(){return e.content===`plain`?x_(this.editor):void 0},addAttributes(){return ux(e.propSchema)},addKeyboardShortcuts(){return Ax(e)},parseHTML(){return xD(e,t.parse,t.parseContent)},renderHTML({node:n}){let r=this.options.editor,i=Gb(n,r.schema.inlineContentSchema,r.schema.styleSchema),a=t.toExternalHTML||t.render;return kx(GN(e=>(0,G.jsx)(a,{contentRef:t=>{e(t),t&&(t.dataset.editable=``)},inlineContent:i,updateInlineContent:()=>{},editor:r,node:n,getPos:()=>void 0}),r),e.type,n.attrs,e.propSchema)},addNodeView(){let n=this.options.editor;return r=>tn(r=>{let i=Wt().nodeViewContentRef;if(!i)throw Error(`nodeViewContentRef is not set`);let a=t.render;return(0,G.jsx)(xP,{inlineContentProps:r.node.attrs,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(a,{contentRef:e=>{i(e),e&&(e.dataset.editable=``)},editor:n,node:r.node,getPos:r.getPos,inlineContent:Gb(r.node,n.schema.inlineContentSchema,n.schema.styleSchema),updateInlineContent:e=>{let t=gS([e],n.pmSchema),i=r.getPos();i!==void 0&&n.transact(e=>e.replaceWith(i,i+r.node.nodeSize,t))}})})},{className:`bn-ic-react-node-view-renderer`,as:`span`})(r)}});return jx(e,{...t,node:r,render(n,r,i){let a=t.render,o=gS([n],i.pmSchema)[0];return GN(t=>(0,G.jsx)(xP,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(a,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:i,inlineContent:n,updateInlineContent:r,node:o,getPos:()=>void 0})}),i)},toExternalHTML(n,r){let i=t.toExternalHTML||t.render,a=gS([n],r.pmSchema)[0];return GN(t=>(0,G.jsx)(xP,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(i,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:r,inlineContent:n,updateInlineContent:()=>{},node:a,getPos:()=>void 0})}),r)}},n)}function CP(e,t){let n=Tt.create({name:e.type,addAttributes(){return Nx(e.propSchema)},parseHTML(){return Rx(e)},renderHTML({mark:n}){let r=t.render;return Px(GN(t=>(0,G.jsx)(r,{editor:this.options.editor,value:e.propSchema===`boolean`?void 0:n.attrs.stringValue,contentRef:e=>{t(e),e&&(e.dataset.editable=``)}}),this.options.editor),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){let n=this.options.editor;return r=>{let i=Xt(r=>{let i=(0,W.useContext)(rn).markViewContentRef;if(!i)throw Error(`markViewContentRef is not set`);let a=t.render;return(0,G.jsx)(a,{editor:n,contentRef:e=>{i(e),e&&(e.dataset.markViewContent=``)},value:e.propSchema===`boolean`?void 0:r.mark.attrs.stringValue})})(r);return i.didMountContentDomElement=!0,i}}});return Fx(e,{...t,mark:n,render(n,r){let i=t.render;return Px(GN(e=>(0,G.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)},toExternalHTML(n,r){let i=t.render;return Px(GN(e=>(0,G.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)}})}function wP(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top<r.top,a=n.bottom>r.bottom;return i&&a?`both`:i?`top`:a?`bottom`:`none`}function TP(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function EP(e){return(0,W.useMemo)(()=>TP(e),e)}function DP(e){yb()?e.preventDefault():_b()&&e.currentTarget.focus()}var OP={};function kP(e,t){let n=W.useRef(OP);return n.current===OP&&(n.current=e(t)),n}function AP(e,t,n,r){let i=kP(MP).current;return NP(i,e,t,n,r)&&FP(i,[e,t,n,r]),i.callback}function jP(e){let t=kP(MP).current;return PP(t,e)&&FP(t,e),t.callback}function MP(){return{callback:null,cleanup:null,refs:[]}}function NP(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function PP(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function FP(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var IP=19;function LP(e){return IP>=e}function RP(e){if(!W.isValidElement(e))return null;let t=e,n=t.props;return(LP(19)?n?.ref:t.ref)??null}function zP(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function BP(){}var VP=Object.freeze([]),HP=Object.freeze({});function UP(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function WP(e,t){return typeof e==`function`?e(t):e}function GP(e,t){return typeof e==`function`?e(t):e}var KP={};function qP(e,t,n,r,i){if(!n&&!r&&!i&&!e)return YP(t);let a=YP(e);return t&&(a=XP(a,t)),n&&(a=XP(a,n)),r&&(a=XP(a,r)),i&&(a=XP(a,i)),a}function JP(e){if(e.length===0)return KP;if(e.length===1)return YP(e[0]);let t=YP(e[0]);for(let n=1;n<e.length;n+=1)t=XP(t,e[n]);return t}function YP(e){return eF(e)?{...e(KP)}:ZP(e)}function XP(e,t){return eF(t)?t(e):QP(e,t)}function ZP(e){let t={...e};for(let e in t){let n=t[e];$P(e,n)&&(t[e]=nF(n))}return t}function QP(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=zP(e.style,r);break;case`className`:e[n]=iF(e.className,r);break;default:e[n]=$P(n,r)?tF(e[n],r):r}}return e}function $P(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function eF(e){return typeof e==`function`}function tF(e,t){return t?e?(...n)=>{let r=n[0];if(aF(r)){let i=r;rF(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:nF(t):e}function nF(e){return e&&((...t)=>{let n=t[0];return aF(n)&&rF(n),e(...t)})}function rF(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function iF(e,t){return t?e?t+` `+e:t:e}function aF(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function oF(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=uF(r));let i=sF(t,n,r);if(n.enabled===!1)return null;let a=n.state??HP;return dF(e,r,i,a)}function sF(e,t,n){let{className:r,style:i}=e,{state:a=HP,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?WP(r,a):void 0,d=l?GP(i,a):void 0,f=l?UP(a,c):HP,p=l&&s?cF(s):void 0,m=l?zP(f,p)??{}:HP;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?jP([m.ref,RP(n),...o]):AP(m.ref,RP(n),o):AP(null,null)),l?(u!==void 0&&(m.className=iF(m.className,u)),d!==void 0&&(m.style=zP(m.style,d)),m):HP}function cF(e){return Array.isArray(e)?JP(e):qP(void 0,e)}var lF=Symbol.for(`react.lazy`);function uF(e){if(e?.$$typeof!==lF)return e;let t=W.Children.toArray(e)[0];return W.isValidElement(t)?t:e}function dF(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=qP(n,t.props);return e.ref=n.ref,W.cloneElement(t,e)}return fF(e,n)}function fF(e,t){return e===`button`?(0,W.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,W.createElement)(`img`,{alt:``,...t,key:t.key}):W.createElement(e,t)}function pF(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var mF=pF(`https://base-ui.com/production-error`,`Base UI`),hF=W.createContext(void 0);function gF(){let e=W.useContext(hF);if(e===void 0)throw Error(mF(13));return e}var _F={imageLoadingStatus:()=>null},vF=W.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=W.useState(`idle`),c={imageLoadingStatus:o},l=W.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=oF(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:_F});return(0,G.jsx)(hF.Provider,{value:l,children:u})}),yF={...W},bF=yF.useInsertionEffect,xF=bF&&bF!==yF.useLayoutEffect?bF:e=>e();function Z(e){let t=kP(SF).current;return t.next=e,xF(t.effect),t.trampoline}function SF(){let e={next:void 0,callback:CF,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function CF(){}var Q=typeof document<`u`?W.useLayoutEffect:()=>{};function wF(e){W.useEffect(e,VP)}var TF=null;globalThis.requestAnimationFrame;var EF=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},DF=class e{static create(){return new e}static request(e){return EF.request(e)}static cancel(e){return EF.cancel(e)}currentId=TF;request(e){this.cancel(),this.currentId=EF.request(()=>{this.currentId=TF,e()})}cancel=()=>{this.currentId!==TF&&(EF.cancel(this.currentId),this.currentId=TF)};disposeEffect=()=>this.cancel};function OF(){let e=kP(DF.create).current;return wF(e.disposeEffect),e}function kF(e){return e==null?e:`current`in e?e.current:e}function AF(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var jF=`data-starting-style`,MF=`data-ending-style`,NF=null;function PF(e){if(!NF){let e=[];NF=e,queueMicrotask(()=>{NF=null,np.flushSync(()=>{for(let t of e)t()})})}NF.push(e)}function FF(e,t=!1,n=!1){let r=OF();return Z((i,a=null)=>{r.cancel();let o=kF(e);if(o==null)return;let s=o,c=()=>{n?PF(()=>{a?.aborted||i()}):np.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(AF(s).map(e=>e.finished.then(BP))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(AF(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=jF;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function IF(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Z(a),s=FF(r,n,i);W.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var LF={[jF]:``},RF={[MF]:``},zF={transitionStatus(e){return e===`starting`?LF:e===`ending`?RF:null}};function BF(e,t=!1,n=!1,r=!1){let[i,a]=W.useState(e&&t?`idle`:void 0),[o,s]=W.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Q(()=>{if(!e&&o&&i!==`ending`&&n){let e=DF.request(()=>{a(`ending`)});return()=>{DF.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t||i===void 0)return;let n=DF.request(()=>{a(void 0)});return()=>{DF.cancel(n)}},[t,e,i]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=DF.request(()=>{a(`idle`)});return()=>{DF.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function VF(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=W.useState(`idle`),s=o[1];return Q(()=>{if(!a)return BP;if(!e&&!i)return s(`error`),BP;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var HF={..._F,...zF},UF=W.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=gF(),[f,p]=VF(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=BF(m),v=W.useRef(null),y=W.useRef(!0);Q(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=Z(e=>{i?.(e),d(e)});Q(()=>{f!==`idle`&&x(f)},[f,x]),Q(()=>()=>d(`idle`),[d]),IF({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=oF(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:HF,enabled:C});return C?T:null}),WF=0,GF=class e{static create(){return new e}currentId=WF;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=WF,t()},e)}isStarted(){return this.currentId!==WF}clear=()=>{this.currentId!==WF&&(clearTimeout(this.currentId),this.currentId=WF)};disposeEffect=()=>this.clear};function KF(){let e=kP(GF.create).current;return wF(e.disposeEffect),e}var qF=W.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=gF(),[c,l]=W.useState(i===0),u=KF();return W.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),oF(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:_F,enabled:s!==`loaded`&&(i===0||c)})}),JF=`-`,YF=e=>{let t=$F(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(JF);return n[0]===``&&n.length!==1&&n.shift(),XF(n,t)||QF(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},XF=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?XF(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(JF);return t.validators.find(({validator:e})=>e(a))?.classGroupId},ZF=/^\[(.+)\]$/,QF=e=>{if(ZF.test(e)){let t=ZF.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},$F=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rI(Object.entries(e.classGroups),n).forEach(([e,n])=>{eI(n,r,e,t)}),r},eI=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:tI(t,e);r.classGroupId=n}else if(typeof e==`function`){if(nI(e)){eI(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n})}else Object.entries(e).forEach(([e,i])=>{eI(i,tI(t,e),n,r)})})},tI=(e,t)=>{let n=e;return t.split(JF).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},nI=e=>e.isThemeGetter,rI=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,iI=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},aI=`!`,oI=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(aI);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},sI=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},cI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...YF(e)}),lI=/\s+/,uI=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(lI),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f||(p=r(u),!p)){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=sI(c).join(`:`),h=l?m+aI:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function dI(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=fI(t))&&(r&&(r+=` `),r+=n);return r}var fI=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=fI(e[r]))&&(n&&(n+=` `),n+=t);return n};function pI(e,...t){let n,r,i,a=o;function o(o){return n=cI(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=uI(e,n);return i(e,a),a}return function(){return a(dI.apply(null,arguments))}}var mI=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},hI=/^\[(?:([a-z-]+):)?(.+)\]$/i,gI=/^\d+\/\d+$/,_I=new Set([`px`,`full`,`screen`]),vI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,CI=e=>TI(e)||_I.has(e)||gI.test(e),wI=e=>RI(e,`length`,zI),TI=e=>!!e&&!Number.isNaN(Number(e)),EI=e=>RI(e,`number`,TI),DI=e=>!!e&&Number.isInteger(Number(e)),OI=e=>e.endsWith(`%`)&&TI(e.slice(0,-1)),kI=e=>hI.test(e),AI=e=>vI.test(e),jI=new Set([`length`,`size`,`percentage`]),MI=e=>RI(e,jI,BI),NI=e=>RI(e,`position`,BI),PI=new Set([`image`,`url`]),FI=e=>RI(e,PI,HI),II=e=>RI(e,``,VI),LI=()=>!0,RI=(e,t,n)=>{let r=hI.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},zI=e=>yI.test(e)&&!bI.test(e),BI=()=>!1,VI=e=>xI.test(e),HI=e=>SI.test(e),UI=pI(()=>{let e=mI(`colors`),t=mI(`spacing`),n=mI(`blur`),r=mI(`brightness`),i=mI(`borderColor`),a=mI(`borderRadius`),o=mI(`borderSpacing`),s=mI(`borderWidth`),c=mI(`contrast`),l=mI(`grayscale`),u=mI(`hueRotate`),d=mI(`invert`),f=mI(`gap`),p=mI(`gradientColorStops`),m=mI(`gradientColorStopPositions`),h=mI(`inset`),g=mI(`margin`),_=mI(`opacity`),v=mI(`padding`),y=mI(`saturate`),b=mI(`scale`),x=mI(`sepia`),S=mI(`skew`),C=mI(`space`),w=mI(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,kI,t],O=()=>[kI,t],k=()=>[``,CI,wI],A=()=>[`auto`,TI,kI],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,kI],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[TI,kI];return{cacheSize:500,separator:`:`,theme:{colors:[LI],spacing:[CI,wI],blur:[`none`,``,AI,kI],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,AI,kI],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[OI,wI],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,kI]}],container:[`container`],columns:[{columns:[AI]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),kI]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,DI,kI]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,kI]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,DI,kI]}],"grid-cols":[{"grid-cols":[LI]}],"col-start-end":[{col:[`auto`,{span:[`full`,DI,kI]},kI]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[LI]}],"row-start-end":[{row:[`auto`,{span:[DI,kI]},kI]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,kI]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,kI]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,kI,t]}],"min-w":[{"min-w":[kI,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[kI,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[AI]},AI]}],h:[{h:[kI,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[kI,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[kI,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[kI,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,AI,wI]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,EI]}],"font-family":[{font:[LI]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,kI]}],"line-clamp":[{"line-clamp":[`none`,TI,EI]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,CI,kI]}],"list-image":[{"list-image":[`none`,kI]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,kI]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,CI,wI]}],"underline-offset":[{"underline-offset":[`auto`,CI,kI]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,kI]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,kI]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),NI]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,MI]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},FI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[CI,kI]}],"outline-w":[{outline:[CI,wI]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[CI,wI]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,AI,II]}],"shadow-color":[{shadow:[LI]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,AI,kI]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,kI]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,kI]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,kI]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[DI,kI]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,kI]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,kI]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,kI]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[CI,wI,EI]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function WI(e){return oF(e.defaultTagName??`div`,e,e)}var GI=W.createContext(void 0);function KI(e=!1){let t=W.useContext(GI);if(t===void 0&&!e)throw Error(mF(16));return t}function qI(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function JI(e){return e?.ownerDocument||document}function YI(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(V(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function XI(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=W.useRef(null),s=KI(!0),c=a??s!==void 0,{props:l}=qI({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=W.useCallback(()=>{let e=o.current;ZI(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return qP({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(rF(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=ZI(r),s=!i&&QI(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),YI(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),YI(r,e)))},onKeyUp(e){t||(rF(e),a?.(e),e.target===e.currentTarget&&i&&c&&ZI(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),YI(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Z(e=>{o.current=e,u()})}}function ZI(e){return d(e)&&e.tagName===`BUTTON`}function QI(e){return d(e)&&e.tagName===`A`&&!!e.href}var $I=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=XI({disabled:i,focusableWhenDisabled:a,native:o});return oF(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),eL=W.createContext(void 0);function tL(e){let t=W.useContext(eL);if(t===void 0&&!e)throw Error(mF(33));return t}var nL=W.createContext(void 0);function rL(e){let t=W.useContext(nL);if(t===void 0&&!e)throw Error(mF(36));return t}var iL=`data-open`,aL=`data-closed`,oL=`data-anchor-hidden`,sL=`data-popup-open`,cL=`data-pressed`,lL={[sL]:``},uL={[sL]:``,[cL]:``},dL={[iL]:``},fL={[aL]:``},pL={[oL]:``},mL={open(e){return e?lL:null}},hL={open(e){return e?uL:null}},gL={open(e){return e?dL:fL},anchorHidden(e){return e?pL:null}},_L={...gL,...zF},vL=W.createContext(void 0);function yL(e=!0){let t=W.useContext(vL);if(t===void 0&&!e)throw Error(mF(25));return t}var bL=`none`,xL=`trigger-press`,SL=`trigger-hover`,CL=`trigger-focus`,wL=`outside-press`,TL=`item-press`,EL=`focus-out`,DL=`escape-key`,OL=`list-navigation`,kL=`keyboard`,AL=`pointer`,jL=`cancel-open`,ML=`sibling-open`,NL=`disabled`,PL=`missing`,FL=`initial`,IL=`imperative-action`,LL=`window-resize`;function RL({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(()=>t);return[i&&e!==void 0?e:a,W.useCallback(e=>{i||o(e)},[])]}var zL=W.createContext(null);function BL(e=`root`){let t=W.useContext(zL),n=W.useContext(nL);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var VL={visible:!0,ref:null};function HL(){return VL}function UL(e,t,n=`root`){let r=BL(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??HL)({label:e.label,children:e.children,render:e.render}),a=AP(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var WL=W.createContext(void 0);function GL(){let e=W.useContext(WL);if(e===void 0)throw Error(mF(30));return e}function KL(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qL,platform:JL,maxTouchPoints:YL}=KL(),XL=qL.toLowerCase(),ZL=JL.toLowerCase(),QL=/^i(os$|p)/.test(ZL)||ZL===`macintel`&&YL>1,$L=`android`,eR=ZL===$L||XL.includes($L),tR=!QL&&ZL.startsWith(`mac`);ZL.startsWith(`win`),!eR&&/^(linux|chrome os)/.test(ZL);var nR=tR||QL,rR=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!rR&&XL.includes(`firefox`),!rR&&XL.includes(`chrom`);var iR=nR,aR=/jsdom|happydom/.test(XL);function oR(e){e.preventDefault()}function sR(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=rL(),u=yL(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return W.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?oR:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:TL})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!tR&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&YI(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var cR={type:`regular-item`};function lR(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=W.useRef(null),{getButtonProps:d,buttonRef:f}=XI({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=sR({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=W.useCallback(e=>qP(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=AP(u,f);return W.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var uR=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function dR(){return W.useContext(uR)}function fR(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=dR(),u=W.useRef(-1),[d,f]=W.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=W.useRef(null),h=W.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function pR(){let[,e]=W.useState({});return W.useCallback(()=>{e({})},[])}var mR=0;function hR(e,t=`mui`){let n=W.useRef(void 0),r=pR(),i=e??n.current;return W.useEffect(()=>{n.current??(mR+=1,n.current=`${t}-${mR}`,e??r())},[e,t,r]),i}var gR=yF.useId;function _R(e,t){if(gR!==void 0){let n=gR();return e??(t?`${t}-${n}`:n)}return hR(e,t)}function vR(e){return _R(e,`base-ui`)}var yR=`data-checked`,bR=`data-unchecked`,xR={checked(e){return e?{[yR]:``}:{[bR]:``}},...zF};function SR(e,t,n,r){let i=!1,a=!1,o=r??HP;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function CR(e,t,n){let r=n??HP;return{reason:e,event:t??new Event(`base-ui`),...r}}var wR=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=rL(),m=fR({guess:!0,label:a}),h=vR(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:S}=lR({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:cR}),C=W.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=SR(TL,e.nativeEvent,void 0,{preventUnmountOnClose:BP});u?.(!l,t)}let T=oF(`div`,e,{state:C,stateAttributesMapping:xR,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[S,t,m.ref]});return(0,G.jsx)(WL.Provider,{value:C,children:T})}),TR=W.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=RL({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=UL(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,G.jsx)(wR,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),ER=W.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=GL(),c=W.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=BF(s.checked);return IF({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),oF(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:xR,props:{"aria-hidden":!0,...o},enabled:a||u})}),DR=W.createContext(void 0);function OR(){let e=W.useContext(DR);if(e===void 0)throw Error(mF(31));return e}var kR=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=W.useState(void 0),c=oF(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,G.jsx)(DR.Provider,{value:s,children:c})}),AR=W.forwardRef(function(e,t){let n=BL()?.Group??kR;return(0,G.jsx)(n,{...e,ref:t})}),jR=W.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=vR(a),c=OR();return Q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),oF(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),MR=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=rL(),f=fR({guess:!0,label:a}),p=vR(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=lR({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:cR});return oF(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),NR=W.forwardRef(function(e,t){let n=UL(e,t);return n.visible?(0,G.jsx)(MR,{...e,ref:n.ref}):null});function PR(e){e.preventDefault(),e.stopPropagation()}function FR(e){return`nativeEvent`in e}function IR(e){return e.pointerType===``&&e.isTrusted?!0:eR&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function LR(e){return aR?!1:!eR&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(eR||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function RR(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function zR(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function BR(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function VR(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function HR(e,t){let n=e;for(;n;){if(S(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(f(n)?n.host:null)}return null}function UR(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var WR=`data-base-ui-focusable`,GR=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,KR=`ArrowLeft`,qR=`ArrowRight`,JR=`ArrowUp`,YR=`ArrowDown`,XR=`data-trigger-disabled`;function ZR(e,t){if(!S(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(XR);for(let[,e]of t.entries())if(VR(e,n))return!e.hasAttribute(XR);return!1}function QR(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function $R(e){return e.matches(`html,body`)}function ez(e){return d(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function tz(e){return HR(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${GR}`)!=null}function nz(e){return e?e.getAttribute(`role`)===`combobox`&&ez(e):!1}function rz(e){if(!e||aR)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function iz(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function az(e,t){return t!=null&&!RR(t)?0:typeof e==`function`?e():e}function oz(e,t,n){let r=az(e,n);return typeof r==`number`?r:r?.[t]}function sz(e){return typeof e==`function`?e():e}function cz(e,t){return t||e===`click`||e===`mousedown`}function lz(e){return e?.includes(`mouse`)&&e!==`mousedown`}var uz=W.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new GF,currentIdRef:{current:null},currentContextRef:{current:null}});function dz(e,t){e.current=t.current}function fz(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=W.useRef(n),a=W.useRef(n),o=W.useRef(null),s=W.useRef(null),c=KF();return Q(()=>{a.current=n,o.current?i.current={open:oz(i.current,`open`),close:oz(n,`close`)}:i.current=n},[n,o,i,a]),(0,G.jsx)(uz.Provider,{value:W.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function pz(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=W.useContext(uz),[d,f]=W.useState(!1),p=W.useRef(n);return Q(()=>{p.current=n},[n]),Q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:oz(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,SR(bL))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,dz(a,s),u.clear()}},[c,i,a,r,s,u]),W.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function mz(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function hz(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function gz(e){let t=kP(_z,e).current;return t.next=e,Q(t.effect),t}function _z(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var vz={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},yz={...vz,position:`fixed`,margin:0,top:0,left:0},bz={...vz,position:`absolute`},xz=W.forwardRef(function(e,t){let[n,r]=W.useState();Q(()=>{iR&&rR&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:yz,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Sz(e,t){return t<0||t>=e.length}function Cz(e,t){return Ez(e.current,{disabledIndices:t})}function wz(e,t){return Ez(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tz(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Ez(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Sz(e,u)?-1:u,wrapped:d}}function Ez(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Dz(e,a,r));return a}function Dz(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!kz(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Oz(e){return e.visibility===`hidden`||e.visibility===`collapse`}function kz(e,t=e?E(e):null){return!e||!e.isConnected||!t||Oz(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Az=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function jz(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function Mz(e){for(let t of Array.from(e.children))if(re(t)===`summary`)return t;return null}function Nz(e,t){let n=Mz(t);return!!n&&(e===n||VR(n,e))}function Pz(e){let t=e?re(e):``;return e!=null&&e.matches(Az)&&(t!==`summary`||e.parentElement!=null&&re(e.parentElement)===`details`&&Mz(e.parentElement)===e)&&(t!==`details`||Mz(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Fz(e){if(!Pz(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=jz(t)){let n=t!==e,r=re(t)===`slot`;if(t.hasAttribute(`inert`)||n&&re(t)===`details`&&!t.open&&!Nz(e,t)||t.hasAttribute(`hidden`)||!r&&!Iz(t,n))return!1}return!0}function Iz(e,t){let n=E(e);return t?n.display!==`none`:kz(e,n)}function Lz(e){let t=e.tabIndex;if(t<0){let t=re(e);if(t===`details`||t===`audio`||t===`video`||d(e)&&e.isContentEditable)return 0}return t}function Rz(e){if(re(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function zz(e,t){let n=Rz(e);if(!n)return!0;let r=t.find(e=>{let t=Rz(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Rz(e);return t?.name===n.name&&t.form===n.form})===n}function Bz(e){if(d(e)&&re(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return d(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Vz(e,t){Bz(e).forEach(e=>{Pz(e)&&t.push(e),Vz(e,t)})}function Hz(e,t,n){Bz(e).forEach(e=>{d(e)&&e.matches(t)&&n.push(e),Hz(e,t,n)})}function Uz(e){return Fz(e)&&Lz(e)>=0}function Wz(e){let t=[];return Vz(e,t),t.filter(Fz)}function Gz(e){let t=Wz(e);return t.filter(e=>Lz(e)>=0&&zz(e,t))}function Kz(e,t){let n=Gz(e),r=n.length;if(r===0)return;let i=BR(JI(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function qz(e){return Kz(JI(e).body,1)||e}function Jz(e){return Kz(JI(e).body,-1)||e}function Yz(e,t,n){if(!e)return null;let r=[];Vz(JI(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Fz);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!VR(n,o)&&Uz(o)&&zz(o,a))return o}return r[i]}function Xz(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!VR(n,r)}function Zz(e){Gz(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Qz(e){let t=[];Hz(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function $z(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...$z(e,t.id,n)])}function eB(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function tB(e){return`data-base-ui-${e}`}var nB=0;function rB(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(nB);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),BP;let o=requestAnimationFrame(a);return nB=o,()=>{nB===o&&(cancelAnimationFrame(o),nB=0)}}var iB=`data-base-ui-inert`,aB=new WeakMap,oB=new WeakSet,sB=new WeakMap,cB=0;function lB(e){return e?f(e)?e.host:lB(e.parentNode):null}var uB=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=lB(t);return e.contains(n)?n:null}).filter(e=>e!=null),dB=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},fB=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{re(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function pB(e,t,n,{mark:r=!0}){let i=uB(t,e),a=r?fB(t,dB(i),new Set(i)):[],o=[],s=[];if(n){let e=uB(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);fB(t,dB(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(aB.get(e)||0)+1;aB.set(e,r),o.push(e),r===1&&n&&oB.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(sB.get(e)||0)+1;sB.set(e,t),s.push(e),t===1&&e.setAttribute(iB,``)}),cB+=1,()=>{o.forEach(e=>{let t=(aB.get(e)||0)-1;aB.set(e,t),t||(oB.has(e)||e.removeAttribute(`aria-hidden`),oB.delete(e))}),r&&s.forEach(e=>{let t=(sB.get(e)||0)-1;sB.set(e,t),t||e.removeAttribute(iB)}),--cB,cB||(aB=new WeakMap,oB=new WeakSet,sB=new WeakMap)}}function mB(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=JI(e[0]).body;return pB(e,i,n,{mark:r})}var hB={style:{transition:`none`}},gB=`data-base-ui-click-trigger`,_B={fallbackAxisSide:`none`},vB={fallbackAxisSide:`end`},yB={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},bB=W.createContext(null),xB=()=>W.useContext(bB),SB=tB(`portal`);function CB(e={}){let{ref:t,container:n,componentProps:r=HP,elementProps:i}=e,a=_R(),o=xB()?.portalNode,[s,c]=W.useState(null),[l,u]=W.useState(null),d=Z(e=>{e!==null&&u(e)}),f=W.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(w(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=oF(`div`,r,{ref:[t,d],props:[{id:a,[SB]:``},i]}),m=s&&p?np.createPortal(p,s):null;return{node:l,nodeId:W.isValidElement(p)?p.props.id:void 0,subtree:m}}var wB=W.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=CB({container:o,ref:t,componentProps:e,elementProps:c}),f=W.useRef(null),p=W.useRef(null),m=W.useRef(null),h=W.useRef(null),[g,_]=W.useState(null),v=W.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;W.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Xz(e)&&(e.type===`focusin`?v.current&&=(Qz(l),!1):(Zz(l),v.current=!0))}return hz(mz(l,`focusin`,e,!0),mz(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(Qz(l),v.current=!1)},[b,l]);let S=W.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,G.jsxs)(W.Fragment,{children:[d,(0,G.jsxs)(bB.Provider,{value:S,children:[x&&l&&(0,G.jsx)(xz,{"data-type":`outside`,ref:f,onFocus:e=>{Xz(e,l)?m.current?.focus():Jz(g?g.domReference:null)?.focus()}}),x&&l&&(0,G.jsx)(`span`,{role:s,"aria-owns":u,style:yB}),l&&np.createPortal(a,l),x&&l&&(0,G.jsx)(xz,{"data-type":`outside`,ref:p,onFocus:e=>{Xz(e,l)?h.current?.focus():(qz(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,SR(`focus-out`,e.nativeEvent)))}})]})]})});function TB(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var EB=class{nodesRef={current:[]};events=TB();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},DB=W.createContext(null),OB=W.createContext(null),kB=()=>W.useContext(DB)?.id||null,AB=e=>{let t=W.useContext(OB);return e??t};function jB(e){let t=_R(),n=AB(e),r=kB();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function MB(e){let{children:t,id:n}=e,r=kB();return(0,G.jsx)(DB.Provider,{value:W.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function NB(e){let{children:t,externalTree:n}=e,r=kP(()=>n??new EB).current;return(0,G.jsx)(OB.Provider,{value:r,children:t})}function PB(e,t){let n=V(UR(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(IR(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var FB=20,IB=[];function LB(){IB=IB.filter(e=>e.deref()?.isConnected)}function RB(e){LB(),e&&re(e)!==`body`&&(IB.push(new WeakRef(e)),IB.length>FB&&(IB=IB.slice(-20)))}function zB(){return LB(),IB[IB.length-1]?.deref()}function BB(e){return e?Uz(e)?e:Gz(e)[0]||e:null}function VB(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Wz(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Uz(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function HB(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=Z(()=>x.current.floatingContext?.nodeId),C=i===!1,w=nz(v)&&C,T=gz(i),E=gz(a),D=gz(o),O=gz(u),k=gz(_),A=AB(h),j=xB(),M=W.useRef(!1),N=W.useRef(!1),P=W.useRef(!1),F=W.useRef(null),I=W.useRef(``),L=W.useRef(``),R=W.useRef(null),z=W.useRef(null),B=AP(R,m,j?.beforeInsideRef),ee=AP(z,j?.afterInsideRef),te=KF(),ne=KF(),ie=OF(),ae=j!=null,V=iz(y),oe=Z((e=V)=>e?Gz(e):[]),se=Z(()=>g?.().filter(e=>e!=null)??[]);W.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&VR(V,BR(JI(V)))&&oe().length===0&&!w&&PR(e)}return mz(JI(V),`keydown`,e)},[r,V,c,w,oe]),W.useEffect(()=>{if(r||!_)return;let e=JI(V);function t(){P.current=!1}function n(e){let t=UR(e),n=se(),r=VR(y,t)||VR(v,t)||VR(j?.portalNode,t)||n.some(e=>e===t||VR(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,HR(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,ne.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return hz(mz(e,`pointerdown`,n,!0),mz(e,`pointerup`,t,!0),mz(e,`pointercancel`,t,!0),mz(e,`keydown`,i,!0),t)},[r,y,v,V,_,j,ne,se]),W.useEffect(()=>{if(r||!l)return;let e=JI(V);function n(){N.current=!0,ne.start(0,()=>{N.current=!1})}function i(e){let t=UR(e);Uz(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=UR(n);c&&r==null&&a!=null&&VR(y,a)&&RB(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=se(),m=r?.hasAttribute(tB(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,kF(p),kF(f)].includes(r),h=!(VR(v,r)||VR(y,r)||VR(r,y)||VR(j?.portalNode,r)||u.some(e=>e===r||VR(e,r))||l.hasMatchingElement(e=>VR(e,r))||m||A&&($z(A.nodesRef.current,o).find(e=>VR(e.context?.elements.floating,r)||VR(e.context?.elements.domReference,r))||eB(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,iz(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&V&&VB(V),s&&i!==v&&!kz(a)&&BR(e)===e.body){if(d(V)&&(V.focus(),s===`popup`)){ie.request(()=>{V.focus()});return}let e=oe(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;d(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&h&&!N.current&&(w||r!==zB())&&(M.current=!0,t.setOpen(!1,SR(EL,n)))})}function o(){P.current||(x.current.insideReactTree=!0,te.start(0,()=>{x.current.insideReactTree=!1}))}let u=d(v)?v:null;if(y||u)return hz(u&&mz(u,`focusout`,a),u&&mz(u,`pointerdown`,n),y&&mz(y,`focusin`,i),y&&mz(y,`focusout`,a),y&&j&&mz(y,`focusout`,o,!0))},[r,v,y,V,c,A,j,t,l,s,oe,w,S,x,te,ne,ie,f,p,se]),W.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${tB(`portal`)}]`)||[]),t=(A?eB(A.nodesRef.current,S()):[]).find(e=>nz(e.context?.elements.domReference||null))?.context?.elements.domReference,n=mB([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...se(),t,kF(p),kF(f),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=mB([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,f,p,se]),Q(()=>{if(!_||r||!d(V))return;I.current=``,L.current=``;let e=JI(V),t=BR(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||VR(V,t))return;let i=null,a=()=>(i??=oe(V),i[0]||V),o;o=r===!0||r===null?a():kF(r),o||=a();let s=VR(V,BR(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&IR(c);rB(o,{sync:l,preventScroll:o===V,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=BR(e);return!(t!==o&&VR(V,t))}})})},[r,_,V,oe,T,O,k,x]);let ce=W.useRef(null);Q(()=>{if(r||!V){ce.current=null;return}ce.current&&=(ce.current.cancelled=!0,null);let e=JI(V),t=BR(e),n=O.current==null;RB(t);function i(e){if(e.open||(I.current=PB(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(tB(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(IR(e.nativeEvent)||LR(e.nativeEvent))M.current=!1;else{let e=!1;JI(V).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&re(t)!==`body`?t:null,s=n?o||a:a||o;return s||=zB()||null,typeof i==`boolean`?s:kF(i)||s||null}return()=>{b.off(`openchange`,i);let t=BR(e),n=se(),r=VR(y,t)||n.some(e=>e===t||VR(e,t))||A&&$z(A.nodesRef.current,S(),!1).some(e=>VR(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};ce.current=l,queueMicrotask(()=>{ce.current===l&&(ce.current=null);let n=BB(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&d(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,V,E,D,O,b,A,v,S,se]),Q(()=>{if(!rR||_||!y)return;let e=BR(JI(y));d(e)&&ez(e)&&VR(y,e)&&e.blur()},[_,y]),Q(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),Q(()=>{if(!r&&V)return VB(V),()=>{queueMicrotask(LB)}},[r,V]);let le=!r&&(!c||!w)&&(ae||c);return(0,G.jsxs)(W.Fragment,{children:[le&&(0,G.jsx)(xz,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=oe();rB(e[e.length-1])}else j?.portalNode&&(M.current=!1,Xz(e,j.portalNode)?qz(v)?.focus():kF(p??j.beforeOutsideRef)?.focus())}}),n,le&&(0,G.jsx)(xz,{"data-type":`inside`,ref:ee,onFocus:e=>{c?rB(oe()[0]):j?.portalNode&&(l&&(M.current=!0),Xz(e,j.portalNode)?Jz(v)?.focus():kF(f??j.afterOutsideRef)?.focus())}})]})}function UB(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=xL}=t,l=e.context.dataRef,u=W.useRef(void 0),d=OF(),f=KF(),p=W.useMemo(()=>{function t(t,n,r,i){let a=SR(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=RR(e.pointerType,!0)&&LR(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||RR(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=UR(s),p=ez(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:RR(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return W.useMemo(()=>n?{reference:p}:HP,[n,p])}function WB(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function GB(e){return e!=null&&e.clientX!=null}function KB(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=W.useRef(!1),l=W.useRef(null),[u,d]=W.useState(),[f,p]=W.useState([]),m=Z(t=>{e.set(`positionReference`,t)}),h=Z((t,n,i)=>{c.current||(!s.current.openEvent||GB(s.current.openEvent))&&e.set(`positionReference`,WB(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Z(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=RR(u)?a:i;W.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=V(a);function r(t){let n=UR(t);VR(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||GB(s.current.openEvent)?l.current=mz(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),W.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),W.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),W.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=W.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return W.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function qB(){return!1}function JB(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function YB(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=qB,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:p,events:m}=e.context,h=AB(c),g=Z(typeof i==`function`?i:()=>!1),_=typeof i==`function`?g:i,v=_!==!1,y=Z(()=>a),{escapeKey:b,outsidePress:x}=JB(s),C=W.useRef(!1),w=W.useRef(!1),T=W.useRef(!1),O=W.useRef(!1),k=W.useRef(!1),A=W.useRef(``),j=W.useRef(null),M=KF(),N=KF(),P=KF(),F=Z(()=>{N.clear(),p.current.insideReactTree=!1}),I=Z(e=>{let t=p.current.floatingContext?.nodeId;return(h?$z(h.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),L=Z(t=>QR(t,e.select(`floatingElement`))||QR(t,e.select(`domReferenceElement`))),R=Z(t=>{o()&&e.setOpen(!1,SR(xL,t.nativeEvent))}),z=Z(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=FR(t)?t.nativeEvent:t;if(k.current||i.isComposing||!b&&I(`__escapeKeyBubbles`))return;let a=SR(DL,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!b&&!a.isPropagationAllowed&&t.stopPropagation()}),B=Z(()=>{p.current.insideReactTree=!0,N.start(0,F)}),ee=Z(t=>{if(!l||!n||t.button!==0)return;let r=UR(t.nativeEvent);VR(e.select(`floatingElement`),r)&&(C.current||(C.current=!0,w.current=!1))}),te=Z(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});W.useEffect(()=>{function e(e){e.open||(O.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),W.useEffect(()=>F,[F]),W.useEffect(()=>{if(!l||!n)return l||(O.current=!1,k.current=!1,A.current=``,j.current=null),F;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=x;let t=new GF,i=JI(u);function a(){P.clear(),k.current=!0}function o(){k.current=!0,P.start(rR?5:0,()=>{k.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function c(){C.current=!1,w.current=!1}function m(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function g(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function N(e){let t=p.current.floatingContext?.nodeId,n=h&&$z(h.nodesRef.current,t).some(t=>QR(e,t.context?.elements.floating));return L(e)||n}function R(n){if(g(n)){n.type!==`click`&&!L(n)&&(t.clear(),T.current=!1),F();return}if(p.current.insideReactTree){F();return}let r=UR(n),i=`[${tB(`inert`)}]`,a=S(r)?r.getRootNode():null,o=Array.from((f(a)?a:JI(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>VR(e,r))))return;let c=S(r)?r:null;for(;c&&!ae(c);){let e=D(c);if(ae(e)||!S(e))break;c=e}if(!(o.length&&S(r)&&!$R(r)&&!VR(r,e.select(`floatingElement`))&&o.every(e=>!VR(c,e)))){if(d(r)&&!(`touches`in n)){let e=ae(r),t=E(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!N(n)){if(m()===`intentional`){if(n.detail!==0&&!IR(n)&&!O.current)return;if(T.current){t.clear(),T.current=!1;return}}typeof _==`function`&&!_(n)||I(`__outsidePressBubbles`)||(e.setOpen(!1,SR(wL,n)),F())}}}function B(t){m()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!L(t)&&R(t)}function ee(t){if(m()!==`sloppy`||!e.select(`open`)||!n||L(t))return;let r=t.touches[0];r&&(j.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function te(e,t){let n=UR(e);if(!n)return;let r=mz(n,e.type,()=>{t(e),r()})}function ne(e){A.current=`touch`,te(e,ee)}function re(e){M.clear(),e.type===`pointerdown`&&(e.button===0&&(O.current=!0),A.current=e.pointerType),(e.type!==`mousedown`||!j.current||j.current.dismissOnMouseDown)&&te(e,e=>{e.type===`pointerdown`?B(e):R(e)})}function ie(e){if(e.type===`pointercancel`&&(O.current=!1),!C.current)return;let n=w.current;c(),m()===`intentional`&&(e.type===`pointercancel`?n&&s():N(e)||(n?s():(typeof _!=`function`||_(e))&&(t.clear(),T.current=!0,F())))}function V(e){if(m()!==`sloppy`||!j.current||L(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-j.current.startX),r=Math.abs(t.clientY-j.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(j.current.dismissOnTouchEnd=!0),i>10&&(R(e),M.clear(),j.current=null)}function oe(e){te(e,V)}function se(e){m()===`sloppy`&&j.current&&!L(e)&&(j.current.dismissOnTouchEnd&&R(e),M.clear(),j.current=null)}function ce(e){te(e,se)}let le=hz(r&&hz(mz(i,`keydown`,z),mz(i,`compositionstart`,a),mz(i,`compositionend`,o)),v&&hz(mz(i,`click`,re,!0),mz(i,`pointerdown`,re,!0),mz(i,`pointerup`,ie,!0),mz(i,`pointercancel`,ie,!0),mz(i,`mousedown`,re,!0),mz(i,`mouseup`,ie,!0),mz(i,`touchstart`,ne,{capture:!0,passive:!0}),mz(i,`touchmove`,oe,{capture:!0,passive:!0}),mz(i,`touchend`,ce,{capture:!0,passive:!0})));return()=>{le(),t.clear(),c(),T.current=!1}},[p,u,r,v,_,l,n,b,x,z,F,y,I,L,h,e,M,P]);let ne=W.useMemo(()=>({onKeyDown:z,onPointerDown:R,onClick:R}),[z,R]),re=W.useMemo(()=>({onKeyDown:z,onPointerDown:te,onMouseDown:te,onClickCapture:B,onMouseDownCapture(e){B(),ee(e)},onPointerDownCapture(e){B(),ee(e)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[z,B,ee,te]);return W.useMemo(()=>n?{reference:ne,floating:re,trigger:ne}:{},[n,ne,re])}function XB(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};S(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function ZB(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Z(i),{mounted:c,setMounted:l,transitionStatus:u}=BF(t,!1,!1,o),d=!t&&r;Q(()=>{t&&s(!1)},[t,s]);let f=W.useRef(c),p=W.useRef(!1),m=pR(),h=()=>{f.current=!1,l(!1),a()};Q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Z(()=>{f.current&&(t?(p.current=!0,m()):h())});return IF({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var QB={tabIndex:-1,[WR]:``};function $B(e){return t=>t!==`touch`||e.current}function eV(e,t=!1){let n=_R(),r=kB()!=null,i=kP(()=>e(n,r)).current;return XB({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function tV({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function nV(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function rV(e,t){let n=W.useRef(null);return Z(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),nV(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),nV(t))})}function iV(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function aV(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oV(e,t,n,r={}){let i=n.reason,a=i===SL,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=aV(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=iV(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?np.flushSync(l):l()}function sV(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=rV(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Z(e=>{a(e),e&&o(e)});return Q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function cV(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=W.useRef(null),i=e.useState(`open`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=SR(bL);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function lV(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ZB({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return kP(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function uV(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:HP,inactiveTriggerProps:HP,popupProps:HP})},[e])}function dV(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var fV=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},pV=[],mV=void 0;function hV(){return mV}function gV(e){pV.push(e)}function _V(e){let t=(t,n)=>{let r=kP(yV).current,i;try{mV=r;for(let e of pV)e.before(r);i=e(t,n);for(let e of pV)e.after(r);r.didInitialize=!0}finally{mV=void 0}return i};return t.displayName=e.displayName||e.name,t}function vV(e){return W.forwardRef(_V(e))}function yV(){return{didInitialize:!1}}var bV=sn(),xV=Zt(),SV=LP(19)?TV:EV;function CV(e,t,n,r,i){return SV(e,t,n,r,i)}function wV(e,t,n,r,i){let a=W.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,bV.useSyncExternalStore)(e.subscribe,a,a)}gV({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,bV.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function TV(e,t,n,r,i){let a=hV();if(!a)return wV(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function EV(e,t,n,r,i){return(0,xV.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var DV=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return CV(this,e,t,n,r)}},OV=class extends DV{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){W.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){W.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return W.useDebugValue(e),CV(this,this.selectors[e],t,n,r)}useContextCallback(e,t){W.useDebugValue(e);let n=Z(t??BP);this.context[e]=n}useStateSetter(e){let t=W.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},kV={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},AV=class extends OV{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:TB(),nested:n,triggerElements:i},kV),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&zR(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function jV(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new AV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:HP,inactiveTriggerProps:HP,popupProps:HP}}var MV=e=>e.triggerIdProp??e.activeTriggerId,NV=e=>e.openProp??e.open,PV=e=>(e.popupElement?.id??e.floatingId)||void 0;function FV(e,t){return t!==void 0&&NV(e)&&MV(e)===t}function IV(e,t){return FV(e,t)?!0:t!==void 0&&NV(e)&&MV(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var LV={open:NV,mounted:e=>e.mounted,transitionStatus:e=>NV(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:MV,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:PV,isTriggerActive:(e,t)=>t!==void 0&&MV(e)===t,isOpenedByTrigger:(e,t)=>FV(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&MV(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>IV(e,t)?PV(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function RV(e){let t=W.useCallback(t=>e===void 0?BP:e.subscribeStore(t),[e]),n=W.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,bV.useSyncExternalStore)(t,n,()=>e?.serverStore)}function zV(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=_R(),a=kB()!=null,o=kP(()=>new AV({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new fV,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=S(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var BV=tR&&rR;function VV(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=W.useRef(!1),s=W.useRef(null),c=W.useRef(!0),l=KF();W.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=V(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&d(t)&&t===BR(JI(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return hz(mz(r,`blur`,i),BV&&mz(r,`keydown`,a,!0),BV&&mz(r,`pointerdown`,l,!0))},[e,n]),W.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);S(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=W.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=UR(n.nativeEvent);if(S(a)){if(BV&&!n.relatedTarget){if(!c.current&&!ez(a))return}else if(!rz(a))return}let u=ZR(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,SR(CL,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,SR(CL,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=S(r)&&r.hasAttribute(tB(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=BR(JI(t));!r&&n===t||VR(a.current.floatingContext?.refs.floating.current,n)||VR(t,n)||o||ZR(r??n,e.context.triggerElements)||e.setOpen(!1,SR(CL,i))})}}},[a,r,e,l]);return W.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var HV=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new GF;restTimeout=new GF;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},UV=new WeakMap;function WV(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&UV.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),UV.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function GV(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=UV.get(n);a&&a!==e&&WV(a),WV(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,UV.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function KV(e){let t=e.context.dataRef.current,n=kP(()=>t.hoverInteractionState??HV.create()).current;return t.hoverInteractionState||=n,wF(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function qV(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=AB(),u=kB(),d=KV(e),f=KF(),p=Z(()=>cz(c.current.openEvent?.type,d.interactedInside)),m=Z(()=>lz(c.current.openEvent?.type)),h=Z(()=>{WV(d)});Q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),W.useEffect(()=>h,[h]),Q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&S(s)&&o){let e=s,t=o,n=JI(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??HR(e,`[data-rootownerid]`)??n.body;return GV(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),W.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&$z(l.nodesRef.current,u).length>0)}function a(t){let n=oz(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,SR(SL,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=UR(e);tz(t)?d.interactedInside=HR(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(ZR(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&S(o)&&$z(l.nodesRef.current,r,!1).some(e=>VR(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,SR(SL,n)),l.events.emit(`floating.closed`,n)})}let y=o;return hz(y&&mz(y,`mouseenter`,g),y&&mz(y,`mouseleave`,_),y&&mz(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var JV={current:null};function YV(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=JV,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=AB(l),v=KV(e),y=W.useRef(!1),b=gz(i),x=gz(r),C=gz(o),w=gz(n),T=gz(p),E=gz(f),D=Z(()=>cz(h.current.openEvent?.type,v.interactedInside)),O=Z(()=>T.current?.()!==!1),k=Z((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!VR(t,n);if(!S(r))return!1;let a=r;return i.hasMatchingElement(e=>VR(e,a))&&(!t||!VR(t,a))}),A=Z(()=>{v.handler&&=(JI(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=Z(()=>{WV(v)});return u&&(v.handleCloseOptions=i?.__options),W.useEffect(()=>A,[A]),W.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===SL,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),W.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=oz(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,SR(SL,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,SR(SL,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!S(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!RR(v.pointerType))return;let n=sz(C.current),r=oz(x.current,`open`,v.pointerType),i=UR(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(S(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(VR(t,i)){c=t;break}}S(o)&&S(s)&&!e.context.triggerElements.hasElement(o)&&VR(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&S(c)&&S(s)&&VR(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,SR(SL,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,SR(SL,t,c))}):g&&O()&&e.setOpen(!0,SR(SL,t,c)))}function o(n){if(D()){j();return}A();let r=JI(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!ZR(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&VR(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){VR(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?mz(r,`mouseout`,l):void 0;return s?hz(mz(r,`mousemove`,i,{once:!0}),mz(r,`mouseenter`,i),mz(r,`mouseleave`,o),f):hz(mz(r,`mouseenter`,i),mz(r,`mouseleave`,o),f)},[A,j,h,x,e,n,b,v,u,k,D,a,s,C,c,_,w,d,E,O,m]),W.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!RR(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;GV(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=sz(C.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,SR(SL,n,r))}v.pointerType===`touch`?np.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function XV(e){return rR&&e.movementX===0&&e.movementY===0}function ZV(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function QV(e,t){return ZV(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function $V(e,t,n){return ZV(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function eH(e,t,n){return ZV(t,n?e===KR:e===qR,e===YR)}function tH(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:ZV(t,n?e===qR:e===KR,e===JR)}function nH(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=iz(D),j=nz(O),M=gz(A),N=kB(),P=AB(S),F=W.useRef(p),I=W.useRef(o??-1),L=W.useRef(null),R=W.useRef(!0),z=Z(e=>{i(I.current===-1?null:I.current,e)}),B=W.useRef(!!D),ee=W.useRef(E),te=W.useRef(!1),ne=W.useRef(!1),re=W.useRef(null),ie=gz(g),ae=gz(E),V=gz(o),oe=gz(x),se=OF(),ce=OF(),le=Z(()=>{se.cancel();function e(e){f||(re.current=rB(e,{sync:te.current,preventScroll:!0}))}let t=n.current[I.current],r=ne.current;t&&e(t),(te.current?e=>e():e=>se.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),he&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{k.current.orientation=_},[k,_]),Q(()=>{E||(L.current=null),E&&p===`auto`||(F.current=p)},[E,p]),Q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(ne.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),Q(()=>{if(a){if(!E)te.current=!1;else if(D){if(r==null){if(te.current=!1,V.current!=null)return;if(B.current&&(I.current=-1,le()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||$V(L.current,v,u)||l?Cz(n):wz(n),L.current=null,z())};t()}}else Sz(n.current,r)||(I.current=r,le(),ne.current=!1)}}},[a,E,D,r,V,l,n,v,u,z,le,ce]),Q(()=>{if(!a||D||!P||f||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=BR(JI(O??t??null)),r=e.some(e=>e.context&&VR(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,f]),Q(()=>{ee.current=E,B.current=!!D});let ue=r!=null,de=Z(e=>{if(!ae.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),fe=Z(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),pe=Z(()=>Cz(n,ie.current)),me=Z(t=>{if(R.current=!1,te.current=!0,t.which===229||!ae.current&&t.currentTarget===M.current)return;if(l&&tH(t.key,_,u,T)){QV(t.key,fe())||PR(t),e.setOpen(!1,SR(OL,t.nativeEvent));let n=C?.current??O;d(n)&&n.focus();return}r!=null&&r!==I.current&&!Sz(n.current,r)&&(I.current=r);let i=I.current,a=Cz(n,g),o=wz(n,g);if(j||(t.key===`Home`&&(PR(t),I.current=a,z(t)),t.key===`End`&&(PR(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,c,u,g,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(QV(t.key,_)){PR(t);let e=BR(t.currentTarget.ownerDocument);if(E&&!f&&VR(t.currentTarget,e)&&!n.current.some(t=>t!=null&&VR(t,e))){I.current=$V(t.key,_,u)?a:o,z(t),r===I.current&&le();return}let{index:l,wrapped:d}=Tz(n.current,i,{decrement:!$V(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});d&&(te.current=!1),I.current=l,z(t)}}),he=W.useMemo(()=>({onFocus(e){te.current=!0,de(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){XV(e)||(te.current=!0,ne.current=!1,m&&de(e))},onPointerLeave(e){if(!ae.current||!R.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&oe.current&&(re.current?.(),re.current=null,I.current=-1,z(e),!f)){let e=M.current,t=BR(JI(e));e&&VR(e,t)&&e.focus({preventScroll:!0})}}}),[de,ae,M,m,n,z,oe,f]),ge=W.useMemo(()=>f&&E&&ue&&{"aria-activedescendant":`${b}-${r}`},[f,E,ue,b,r]),_e=W.useMemo(()=>({...j?{}:ge,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=UR(t.nativeEvent);if(n&&!VR(M.current,n))return;PR(t);let r=SR(EL,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&d(i)&&i.focus()}else me(t)},onPointerMove(e){XV(e)||(R.current=!0)}}),[ge,me,M,j,e,E,f,O,C]),ve=W.useMemo(()=>{function t(t){e.setOpen(!0,SR(OL,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&IR(e.nativeEvent)&&(F.current=!f)}function r(e){F.current=p,p===`auto`&&LR(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=eH(n.key,fe(),u),o=QV(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!l||ez(n.currentTarget)))return me(n);if(r||h||!i){if(s){let e=QV(n.key,fe());L.current=l&&e?null:n.key}l?a&&(PR(n),r?(I.current=pe(),z(n),f&&M.current?.focus()):t(n)):o&&(V.current!=null&&(I.current=V.current),PR(n),!r&&h?t(n):me(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[me,p,pe,l,z,e,h,_,v,fe,u,V,f,M]),ye=W.useMemo(()=>({...ge,...ve}),[ge,ve]);return W.useMemo(()=>a?{reference:ye,floating:_e,item:he,trigger:ve}:{},[a,ye,_e,ve,he])}function rH(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Z(s),f=e.useState(`open`),p=KF(),m=W.useRef(``),h=W.useRef(u??i??-1),g=W.useRef(null),_=Z(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!kz(n)||n?.matches(`:disabled`)?!1:o==null||!Dz(VP,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(PR(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(PR(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=Z(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);VR(r,n)||VR(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=W.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return W.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var iH=.1,aH=iH*iH,oH=.5;function sH(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function cH(e,t,n,r,i,a,o,s,c,l){let u=!1;return sH(e,t,n,r,i,a)&&(u=!u),sH(e,t,i,a,o,s)&&(u=!u),sH(e,t,o,s,c,l)&&(u=!u),sH(e,t,c,l,n,r)&&(u=!u),u}function lH(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function uH(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function dH(e={}){let{blockPointerEvents:t=!1}=e,n=new GF,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*aH;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=UR(r),g=r.type===`mouseleave`,_=VR(u,h),v=VR(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&S(r.relatedTarget)&&VR(u,r.relatedTarget))return;function y(){return!!(s&&$z(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>x.width,D=C.height>x.height,O=(E?x:C).left,k=(E?x:C).right,A=(D?x:C).top,j=(D?x:C).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let M=!1;switch(c){case`top`:M=uH(d,f,O,x.top+1,k,C.bottom-1);break;case`bottom`:M=uH(d,f,O,C.top+1,k,x.bottom-1);break;case`left`:M=uH(d,f,C.right-1,j,x.left+1,A);break;case`right`:M=uH(d,f,x.right-1,j,C.left+1,A)}if(M)return;if(l&&!lH(d,f,x)||!g&&p(d,f)){b();return}let N=!1;switch(c){case`top`:{let n=E?oH/2:oH*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+oH+1,o=w||E?C.bottom-oH:C.top,s=w?E?C.bottom-oH:C.top:C.bottom-oH;N=cH(d,f,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?oH/2:oH*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-oH,o=w||E?C.top+oH:C.bottom,s=w?E?C.top+oH:C.bottom:C.top+oH;N=cH(d,f,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?oH/2:oH*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+oH+1,o=T||D?C.right-oH:C.left,s=T?D?C.right-oH:C.left:C.right-oH;N=cH(d,f,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?oH/2:oH*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-oH,o=T||D?C.left+oH:C.right,s=T?D?C.left+oH:C.right:C.left+oH;N=cH(d,f,a,r,a,i,o,C.top,s,C.bottom);break}}N?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var fH=W.createContext(void 0);function pH(e){let t=W.useContext(fH);if(t===void 0&&!e)throw Error(mF(69));return t}var mH=`ArrowUp`,hH=`ArrowDown`,gH=`ArrowLeft`,_H=`ArrowRight`,vH=new Set([mH,hH,gH,_H,`Home`,`End`]),yH=[`Shift`,`Control`,`Alt`,`Meta`];function bH(e){return d(e)&&e.tagName===`INPUT`}function xH(e){return!!(bH(e)&&e.selectionStart!=null||d(e)&&e.tagName===`TEXTAREA`)}function SH(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=CH(e,t,`left`),a=wH(e),o=wH(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=CH(e,t,`top`),r=wH(e),i=wH(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function CH(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function wH(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function TH(e){return e===`starting`?hB:HP}var EH=W.createContext(void 0);function DH(){return W.useContext(EH)}function OH(e,t){let n=uF(e.render);if(W.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function kH(e,t,n){let r=OH(e,t),i=r===t?void 0:r;return[r,W.useCallback(e=>n?.(e?i:void 0),[i,n])]}function AH(e,t,n){let r=uF(e.render),i=W.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var jH=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=rL(),m=DH(),{side:h,align:g}=tL(),_=pH(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=kH(e,u,d),L=AH(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),IF({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),W.useEffect(()=>{function e(e){l.setOpen(!1,SR(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),qV(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let ee=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(W.useContext(zL)?.useParentHandoff??NH)(l,w,v,f),re=oF(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},ref:[t,l.context.popupRef,ee,I],stateAttributesMapping:_L,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&vH.has(e.key)&&e.stopPropagation()},onFocus:ne},TH(y),c,{"data-rootownerid":E}]}),ie=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ie=!0);let ae=R?.getReturnElement??te;return(0,G.jsx)(HB,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??ae??ie,explicitReturnFocus:a===void 0&&ae?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),MH={parentVirtualFocusRef:void 0,handleFocus:void 0};function NH(){return MH}var PH=W.forwardRef(function(e,t){let n=BL()?.Popup??jH;return(0,G.jsx)(n,{...e,ref:t})}),FH=W.createContext(void 0);function IH(){let e=W.useContext(FH);if(e===void 0)throw Error(mF(32));return e}var LH=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=rL();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,G.jsx)(FH.Provider,{value:n,children:(0,G.jsx)(wB,{ref:t,...r,portalOwnerRole:o})})});function RH(e){return LP(19)?e:e?`true`:void 0}function zH(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=W.useState(null),d=W.useRef(null),f=AB(n),p=W.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=z({...e,elements:{...p,...l&&{reference:l}}}),h=W.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=W.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=W.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=W.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Q(()=>{o&&(d.current=o)},[o]),Q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),W.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var BH=W.createContext(void 0);function VH(){return W.useContext(BH)?.direction??`ltr`}var HH=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:u,padding:d=0}=l(e,t)||{};if(u==null)return{};let f=x(d),p={x:n,y:r},m=_(i),h=v(m),g=await o.getDimensions(u),y=m===`y`,b=y?`top`:`left`,S=y?`bottom`:`right`,C=y?`clientHeight`:`clientWidth`,w=a.reference[h]+a.reference[m]-p[m]-a.floating[h],T=p[m]-a.reference[m],E=s.floating[C]||a.floating[h],D=w/2-T/2,O=E/2-g[h]/2-1,k=Math.min(f[b],O),A=Math.min(f[S],O),j=k,M=E-g[h]-A,N=E/2-g[h]/2+D,P=L(j,N,M),F=!c.arrow&&I(i)!=null&&N!==P&&a.reference[h]/2-(N<j?k:A)-g[h]/2<0,R=F?N<j?N-j:N-M:0;return{[m]:p[m]+R,data:{[m]:P,centerOffset:N-P-R,...F&&{alignmentOffset:R}},reset:F}}}),UH=(e,t)=>{let{name:n,fn:r}=HH(e);return{name:n,fn:r,options:[e,t]}},WH={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},GH={sideX:`left`,sideY:`top`},KH=`--available-width`,qH=`--available-height`,JH=`--anchor-width`,YH=`--anchor-height`,XH=`--transform-origin`,ZH=KH,QH=qH;function $H(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function eU(e,t,n){let{rects:r,placement:i}=e;return{side:$H(t,m(i),n),align:I(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tU(e){return nU(e,zH)}function nU(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,T=y.side||`flip`,E=y.align||`flip`,D=y.fallbackAxisSide||`end`,O=b?.crossAxis??!1,k=b?.rootBoundary,M=typeof n==`function`?n:void 0,N=Z(M),F=M?N:n,L=gz(n),R=gz(v),z=VH()===`rtl`,[B,re]=W.useState(null);!v&&B!==null&&re(null);let ie=C===`placement`,ae=B?m(B):null,oe=B&&ie?I(B)||`center`:null,se=ae||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":z?`left`:`right`,"inline-start":z?`right`:`left`}[i],ce=oe||o,le=ce===`center`?se:`${se}-${ce}`,ue=l;typeof ue==`number`?ue={top:ue,right:ue,bottom:ue,left:ue}:ue&&={top:ue.top||0,right:ue.right||0,bottom:ue.bottom||0,left:ue.left||0};let de=+(i===`bottom`),fe=+(i===`top`),pe=+(i===`right`),me=+(i===`left`),he={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:ue},ge=W.useRef(null),_e=gz(a),ve=gz(s),ye=typeof a==`function`?0:a,be=typeof s==`function`?0:s,xe=[];p&&xe.push(p),xe.push(A(e=>{let t=eU(e,i,z),n=typeof _e.current==`function`?_e.current(t):_e.current,r=typeof ve.current==`function`?ve.current(t):ve.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ye,be,z,i]));let Se=E===`none`&&T!==`shift`,Ce=!Se&&(u||O||T===`shift`),we=T===`none`?null:te({...he,padding:{top:ue.top+1+de,right:ue.right+1+me,bottom:ue.bottom+1+fe,left:ue.left+1+pe},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),Te=Se?null:j({...he,rootBoundary:k,mainAxis:E!==`none`,crossAxis:Ce,limiter:u||O?void 0:ne(e=>{if(!ge.current)return{};let{width:t,height:n}=ge.current.getBoundingClientRect(),r=h(m(e.placement)),i=r===`y`?t:n,a=r===`y`?ue.left+ue.right:ue.top+ue.bottom;return{offset:i/2+a/2}})},[he,u,O,k,ue,E]);T===`shift`||E===`shift`||ce===`center`?xe.push(Te,we):xe.push(we,Te),xe.push(ee({...he,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!R.current)return;let i=e.style;i.setProperty(ZH,`${t}px`),i.setProperty(QH,`${n}px`);let a=V(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(JH,`${u}px`),i.setProperty(YH,`${d}px`)}}),UH(e=>({element:ge.current||JI(e.elements.floating).createElement(`div`),padding:ge.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=m(r),u=I(r),d=h(l)===`y`,f=ge.current,p=typeof a==`function`?a(eU(e,i,z)):a,g;g=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let _=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return Ce&&d&&Math.abs(n.shift?.y||0)>p&&(_=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(XH,d?`${g} ${_}`:`${_} ${g}`),{}}},WH,S),Q(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let H=W.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:Ee,elements:De,x:Oe,y:ke,middlewareData:Ae,update:je,placement:Me,context:Ne,isPositioned:Pe,floatingStyles:Fe}=t({rootContext:_,open:g?v:void 0,placement:le,middleware:xe,strategy:r,whileElementsMounted:g?void 0:(...e)=>P(...e,H),nodeId:x,externalTree:w}),{sideX:Ie,sideY:Le}=Ae.adaptiveOrigin||GH,Re=Pe?r:`fixed`,ze=W.useMemo(()=>{let e;return e=Pe?S?{position:Re,[Ie]:Oe,[Le]:ke}:{...Fe,position:Re}:{position:Re,top:0,left:0},e[ZH]=`100vw`,e[QH]=`100vh`,Pe||(e.opacity=0),e},[S,Re,Ie,Oe,Le,ke,Fe,Pe]),Be=W.useRef(null);Q(()=>{if(!v)return;let e=L.current,t=typeof e==`function`?e():e,n=(rU(t)?t.current:t)||null;n!==Be.current&&(Ee.setPositionReference(n),Be.current=n)},[v,Ee,F,L]),W.useEffect(()=>{if(!v)return;let e=L.current;typeof e!=`function`&&rU(e)&&e.current!==Be.current&&(Ee.setPositionReference(e.current),Be.current=e.current)},[v,Ee,F,L]),W.useEffect(()=>{if(g&&v&&De.reference&&De.floating)return P(De.reference,De.floating,je,H)},[g,v,De,je,H]);let Ve=m(Me),He=$H(i,Ve,z),Ue=I(Me)||`center`,We=!!Ae.hide?.referenceHidden;Q(()=>{C&&v&&Pe&&(Ve!==se||ie&&Ue!==ce)&&re(Me)},[C,ie,v,Pe,Me,Ve,Ue,se,ce]);let Ge=W.useMemo(()=>({position:`absolute`,top:Ae.arrow?.y,left:Ae.arrow?.x}),[Ae.arrow]),Ke=Ae.arrow?.centerOffset!==0;return W.useMemo(()=>({positionerStyles:ze,arrowStyles:Ge,arrowRef:ge,arrowUncentered:Ke,side:He,align:Ue,physicalSide:Ve,anchorHidden:We,refs:Ee,context:Ne,isPositioned:Pe,update:je}),[ze,Ge,ge,Ke,He,Ue,Ve,We,Ee,Ne,Pe,je])}function rU(e){return e!=null&&`current`in e}function iU(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Z(i),[,o]=W.useState(0),s=kP(oU).current,c=kP(aU).current,l=W.useRef(0),u=W.useRef(!0),d=W.useRef(null),f=W.useRef(null),p=Z(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=Z((e,t)=>{c.set(e,t),p()}),h=Z(e=>{c.delete(e),p()}),g=Z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!lU(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&uU(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=cU(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Z(()=>{let[e,t]=sU(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Z(e=>(s.add(e),()=>{s.delete(e)})),b=W.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,G.jsx)(uR.Provider,{value:b,children:t})}function aU(){return new Map}function oU(){return new Set}function sU(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>uU(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function cU(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function lU(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function uU(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var dU=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function fU(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=W.useRef(null),o=W.useRef(null),s=FF(r);Q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function pU(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),oF(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},TH(r),i],stateAttributesMapping:gL})}var mU={},hU={},gU=``;function _U(e,t){return p(e)?e:t}function vU(e,t,n){return/hidden|clip/.test(e.getComputedStyle(_U(t,n)).overflowY)}function yU(e){if(typeof document>`u`)return!1;let t=JI(e);return V(t).innerWidth-t.documentElement.clientWidth>0}function bU(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=JI(e),n=t.documentElement,r=t.body,i=_U(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function xU(e){let t=JI(e),n=t.documentElement,r=t.body,i=_U(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function SU(e){let t=JI(e),n=t.documentElement,r=t.body,i=V(n),a=0,o=0,s=!1,c=DF.create();if(rR&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,mU={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},gU=n.style.scrollBehavior,hU={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=_U(n,r);s=bU(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,mU),Object.assign(r.style,hU),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=gU)}function d(){u(),c.request(l)}l();let f=mz(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var CU=new class{lockCount=0;restore=null;timeoutLock=GF.create();timeoutUnlock=GF.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=JI(e),n=t.documentElement,r=t.body,i=V(n);if(vU(i,n,r)){let t=new i.MutationObserver(()=>{vU(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=QL||!yU(e);this.restore=a?xU(e):SU(e)}};function wU(e=!0,t=null){Q(()=>{if(e)return CU.acquire(t)},[e,t])}var TU=20;function EU(e,t,n,r){let[i,a]=W.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=JI(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-TU)},[e,t,n]),wU(e&&(!t||i),r)}var DU=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=_B,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=rL(),x=IH(),S=yL(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,B=c,ee=l,te=s,ne=h;C.type===`context-menu`&&(z=n??C.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,B=e.sideOffset??-5));let re=o,ie=te;C.type===`menu`?(re??=`inline-end`,ie??=`start`,ne=e.collisionAvoidance??vB):C.type===`menubar`&&(re??=C.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=C.type===`context-menu`,V=tU({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:re,sideOffset:B,align:ie,alignOffset:ee,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ne,shift:ae?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});W.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,SR(ML)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),W.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,SR(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let oe=KF();W.useEffect(()=>{D||oe.clear()},[D,oe]),W.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{v.setOpen(!1,SR(ML))}):v.setOpen(!1,SR(ML))}else oe.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,oe]),W.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),fU({store:v,domReference:R,positionerElement:M,open:D});let se={open:D,side:V.side,align:V.align,anchorHidden:V.anchorHidden,nested:C.type===`menu`,instant:N},ce=C.type===`menubar`&&C.context.modal;EU(D&&(ce||O&&F!==`trigger-hover`),k===`touch`,M,A);let le=pU(e,se,{styles:V.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),ue=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),de=null;return C.type===`menubar`?de=C.context.contentElement:C.type===void 0&&(de=A),(0,G.jsxs)(eL.Provider,{value:V,children:[ue&&(0,G.jsx)(dU,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:RH(!D),cutout:de}),(0,G.jsx)(MB,{id:I,children:(0,G.jsx)(iU,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:le})})]})}),OU=W.createContext(null);function kU(e){let t=W.useContext(OU);if(t===null&&!e)throw Error(mF(5));return t}function AU(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function jU(e,t){let n=W.useRef(e),r=Z(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function MU(e,t){let{onClick:n,onPointerDown:r}=AU(Z((n,r)=>{(typeof e==`function`?e():e)||t(r||(QL?`touch`:``))}));return W.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function NU(e){let[t,n]=W.useState(null),r=MU(e,n);return jU(e,t=>{t&&!e&&n(null)}),W.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function PU(e){return e==null?bL:e.type.startsWith(`key`)?kL:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?AL:bL}var FU={...LV,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=LV.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>rR&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!LV.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},IU=class extends OV{constructor(e,t,n=!1){let r=new fV,i=RU(r,t,n,e);super(i,LU(r),FU),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function LU(e){return{positionerRef:W.createRef(),popupRef:W.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function RU(e,t,n=!1,r){return{...jV(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:HP,inputProps:HP,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new EB,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:HP,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var zU=W.createContext(null);function BU(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function VU(e,t){return e===`list-navigation`||BU(e,t)}var HU=_V(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=yL(!0),C=rL(!0),w=kU(!0),T=C?.store,E=C?.virtualFocus??!1,D=W.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=vR(),k=vR(),[A,j]=W.useState(void 0),M=(A??k)||void 0,N=kB(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=kP(()=>F?P?.state.instantType:void 0).current,L=kP(()=>{let e=new IU({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),z=jB(R),B=L.useState(`open`),ee=L.useState(`activeTriggerElement`),te=L.useState(`positionerElement`),ne=L.useState(`hoverEnabled`),re=L.useState(`disabled`),ie=L.useState(`lastOpenChangeReason`),ae=L.useState(`parent`),V=L.useState(`activeIndex`),oe=L.useState(`keyboardOpen`),se=L.useState(`payload`),ce=L.useState(`floatingParentNodeId`),le=W.useRef(null),ue=W.useRef(ae.type!==`context-menu`),de=KF(),fe=W.useRef(!0),pe=KF(),me=ce!=null,{openMethod:he,triggerProps:ge}=NU(B);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ae.type===void 0?c:void 0,openMethod:he,rootId:O}),cV(L);let{forceUnmount:_e,transitionStatus:ve}=lV(B,L,()=>{L.set(`allowMouseEnter`,!1)},F),ye=FF(L.context.popupRef);W.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!B){e();return}if(ve!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return ye(e,t.signal),()=>{t.abort()}},[I,B,ve,ye,L]),Q(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:z,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:z,floatingParentNodeId:N})},[S,C,z,N,ee,L]),W.useEffect(()=>{B||(le.current=null),ae.type===`context-menu`&&(B?de.start(500,()=>{ue.current=!0}):(de.clear(),ue.current=!1))},[de,B,ae.type]),Q(()=>{!B&&!ne&&L.set(`hoverEnabled`,!0)},[B,ne,L]);let be=Z((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||B===e&&t.trigger===ee&&ie===n)return;let i=aV(t);if(!e&&t.trigger==null&&(t.trigger=ee??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!fe.current)return;e&&n===`trigger-focus`?(fe.current=!1,pe.start(300,()=>{fe.current=!0})):(fe.current=!0,pe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=iV(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&VU(n,a),s.instantType=ae.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:BU(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),xe=XB({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:be}),Se=xe.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>be(e,t);return Se.on(`setOpen`,e),()=>{Se?.off(`setOpen`,e)}},[Se,be]),Q(()=>L.subscribeToParentMenu(),[L]);let Ce=W.useCallback(()=>{L.setOpen(!1,SR(IL))},[L]);W.useImperativeHandle(d,()=>({unmount:_e,close:Ce}),[_e,Ce]);let we;ae.type===`context-menu`&&(we=ae.context),W.useImperativeHandle(we?.positionerRef,()=>te,[te]),W.useImperativeHandle(we?.actionsRef,()=>({setOpen:be}),[be]);let Te=YB(xe,{enabled:!re,bubbles:{escapeKey:f&&ae.type===`menu`},outsidePress(){return ae.type!==`context-menu`||le.current?.type===`contextmenu`||ue.current},externalTree:me?R:void 0}),H=VH(),Ee=nH(xe,{enabled:!re,listRef:L.context.itemDomElements,activeIndex:V,virtual:v,nested:ae.type===`menubar`||!v&&ae.type!==void 0,parentOrientation:ae.type===`menubar`?ae.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?oe:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:H===`rtl`,disabledIndices:VP,onNavigate(e,t){L.setActiveIndex(e,PU(t),t?.nativeEvent)},openOnArrowKeyDown:ae.type!==`context-menu`&&!(v&&_),externalTree:!v&&me?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),De=W.useCallback(e=>{L.context.typingRef.current=e},[L]),Oe=rH(xe,{enabled:!re&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:V,resetMs:500,onMatch:(e,t)=>{B&&e!==V&&L.setActiveIndex(e,kL,t.nativeEvent)},onTyping:De}),ke=Z(a),Ae=W.useRef(-1),je=Z(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&L.context.reportedItem===t)return;Ae.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=bL,L.context.highlightEvent=void 0,a&&ke(t,CR(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});Q(()=>{je()},[V,je]);let Me=W.useMemo(()=>{if(!v)return Ee.reference;if(!Ee.trigger)return HP;let{onFocus:e,...t}=Ee.trigger;return t},[v,Ee.reference,Ee.trigger]);L.useSyncedValue(`inputProps`,v?Ee.reference??HP:HP);let Ne=W.useMemo(()=>{let e=qP(Oe.reference,Me,Te.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=B,e},[L,Oe.reference,Me,Te.reference,ge,B]),Pe=W.useMemo(()=>{let e=qP(Ee.trigger,Te.trigger,ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,Te.trigger,ge]);kP(()=>(L.update({inactiveTriggerProps:Pe}),null)),uV(L,{floatingRootContext:xe,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:W.useMemo(()=>qP(QB,{onMouseMove(){L.set(`allowMouseEnter`,!0),ae.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,Te.floating),[ae.type,L,Oe.floating,Ee.floating,Te.floating]),itemProps:Ee.item??HP});let Fe=W.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:je}),[L,D,u,l,b,k,v,E,je]),Ie=typeof t==`function`?t({payload:se}):t,Le=(0,G.jsxs)(nL.Provider,{value:Fe,children:[p&&(0,G.jsx)(tV,{handle:p,store:L}),Ie]});return(ae.type===void 0||ae.type===`context-menu`)&&(Le=(0,G.jsx)(NB,{externalTree:R,children:Le})),Le});function UU(e){let t=W.useContext(zU);if(t===null)return(0,G.jsx)(HU,{...e});let n=t.Root;return(0,G.jsx)(zU.Provider,{value:null,children:(0,G.jsx)(n,{...t.options,...e})})}var WU={};function GU(e){rL();let t=W.useContext(zU);if(t!==null){let n=t.SubmenuRoot;return(0,G.jsx)(zU.Provider,{value:null,children:(0,G.jsx)(n,{...t.options,...e})})}return(0,G.jsx)(EH.Provider,{value:WU,children:(0,G.jsx)(HU,{...e,isSubmenu:!0})})}var KU=5;function qU(e,t){let n=JU(t);return e.clientX>=n.left-KU&&e.clientX<=n.right+KU&&e.clientY>=n.top-KU&&e.clientY<=n.bottom+KU}function JU(e){let t=e.getBoundingClientRect(),n=V(e);if(aR)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function YU(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=KI(),{ref:i,index:a}=fR(e),o=n===a,s=W.useRef(null),c=AP(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function XU(e){let{render:t,className:n,style:r,state:i=HP,props:a=VP,refs:o=VP,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=YU({metadata:s});return oF(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function ZU(e){if(d(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ae(e))return ZU(D(e))}function QU(e,t){function n(n,r,i){let a=n.currentTarget;np.flushSync(()=>{e.setOpen(!1,SR(EL,n.nativeEvent,a))}),Yz(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Xz(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function $U(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=W.useRef(!1);return W.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,JI(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:HP,[t,n,r])}var eW=vV(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=rL(!0),h=RV(d)??m?.store;if(!h)throw Error(mF(85));let g=vR(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=W.useRef(null),S=nW(),C=KI(!0),w=AB(),T=W.useMemo(()=>w??new EB,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=sV(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:jB(T),floatingParentNodeId:kB(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=XI({disabled:A,native:o});W.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=W.useRef(null),P=KF(),F=Z(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;VR(N.current,t)||VR(h.select(`positionerElement`),t)||t===N.current||t!=null&&ZU(t)===h.select(`rootId`)||qU(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:jL})});W.useEffect(()=>{let e=JI(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=YV(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:dH({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=tW(y,h.select(`lastOpenChangeReason`)),z=UB(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=VV(v,{enabled:!A&&I}),ee=$U({open:y,enabled:O,mouseDownAction:`open`}),te=W.useMemo(()=>qP(B.reference,z.reference),[B.reference,z.reference]),ne=h.useState(`triggerProps`,D),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=QU(h,x),V={disabled:A,open:y},oe=[N,t,M,E,x],se=[te,L??HP,ne,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),JI(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},re,O?{role:`menuitem`}:{},ee,p,j],ce=oF(`button`,e,{enabled:!O,stateAttributesMapping:hL,state:V,ref:oe,props:se});return O?(0,G.jsx)(XU,{tag:`button`,render:n,className:r,style:i,state:V,refs:oe,props:se,stateAttributesMapping:hL}):y?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(xz,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ie},`${g}-pre-focus-guard`),(0,G.jsx)(W.Fragment,{children:ce},g),(0,G.jsx)(xz,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,G.jsx)(W.Fragment,{children:ce},g)});function tW(e,t){let n=KF(),[r,i]=W.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function nW(){let e=kU(!0);return W.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function rW(e){let[t,n]=W.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var iW=W.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return oF(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function aW(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var oW={"aria-expanded":void 0},sW=W.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=rL(!0);if(p?.parent.type!==`menu`)throw Error(mF(37));let m=tL(),h=DH(),{store:g,parentVirtualFocus:_}=p,v=p.parent.store,y=fR({guess:!0,label:a}),b=vR(o),x=g.useState(`open`),S=W.useRef(!1),C=g.useState(`positionerElement`),w=g.useState(`floatingRootContext`),T=g.useState(`floatingTreeRoot`),E=g.useState(`triggerPopupId`,b),D=rV(b,g),O=Z(e=>{D(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:u})}),k=W.useRef(null),A=W.useCallback(e=>{k.current=e,g.set(`activeTriggerElement`,e)},[g]);Q(()=>(O(k.current),()=>O(null)),[O,b,g]),Q(()=>{if(!x||!C)return;function e(e){UR(e)===g.context.beforeContentFocusGuardRef.current&&(S.current=e.relatedTarget===k.current)}return C.addEventListener(`focusout`,e,!0),()=>{S.current=!1,C.removeEventListener(`focusout`,e,!0)}},[x,C,g]),g.useSyncedValue(`closeDelay`,u);let j=g.useState(`disabled`),M=v.useState(`disabled`),N=d||j||M,P=v.useState(`itemProps`),F=v.useState(`isActive`,y.index),I=W.useMemo(()=>({type:`submenu-trigger`,setActive(e){v.select(`highlightItemOnHover`)&&v.setActiveIndex(y.index,AL,e)}}),[v,y.index]),{getItemProps:L,itemRef:R}=lR({closeOnClick:!1,disabled:N,highlighted:F,id:b,store:g,typingRef:v.context.typingRef,nativeButton:s,itemMetadata:I,nodeId:m?.context.nodeId}),z=YV(w,{enabled:g.useState(`hoverEnabled`)&&c&&!N,handleClose:dH({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>v.select(`allowMouseEnter`):void 0,triggerElementRef:k,externalTree:T,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),B=UB(w,{enabled:!N,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??HP,ee=g.useState(`triggerProps`,!0);delete ee.id;let te={disabled:N,highlighted:F,open:x},ne=g.useState(`openMethod`),re=g.useState(`lastOpenChangeReason`)===`list-navigation`||ne===`keyboard`,ie=x&&re&&iR;return oF(`div`,e,{state:te,stateAttributesMapping:mL,props:[B,z,ee,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,P,ie?oW:void 0,{"aria-controls":E,tabIndex:_||!(x||F)?-1:0,onFocus(e){g.select(`open`)&&S.current&&(S.current=!1,g.setOpen(!1,SR(EL,e.nativeEvent)))},onBlur(){F&&v.setActiveIndex(null,bL)}},f,L],ref:[t,y.ref,R,O,A]})}),cW=W.forwardRef(function(e,t){let n=UL(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?qP(n.props,e):e;return(0,G.jsx)(sW,{...r,ref:n.ref})});function lW(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function uW(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function dW(e){return uW(e?.[0])}function fW(e){return dW(e)?e.flatMap(e=>e.items):e}function pW(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(dW(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function mW(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return lW(e)}function hW(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?lW(e.value):lW(e)}function gW(e,t,n){function r(){return mW(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=fW(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function _W(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(W.Fragment,{children:gW(r,t,n)},i)),e),[])}var vW=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),yW=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),bW=e=>{let t=yW(e);return t.charAt(0).toUpperCase()+t.slice(1)},xW=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),SW=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},CW={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},wW=(0,W.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,W.createElement)(`svg`,{ref:c,...CW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xW(`lucide`,i),...!a&&!SW(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])),TW=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(wW,{ref:i,iconNode:t,className:xW(`lucide-${vW(bW(e))}`,`lucide-${e}`,n),...r}));return n.displayName=bW(e),n},EW=TW(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),DW=TW(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),OW=TW(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),kW=TW(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),AW=`data-valid`,jW=`data-invalid`,MW={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},NW={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},PW={valid(e){return e===null?null:e?{[AW]:``}:{[jW]:``}}},FW={invalid:void 0,name:void 0,validityData:{state:MW,errors:[],error:``,value:``,initialValue:null},setValidityData:BP,disabled:void 0,setTouched:BP,setDirty:BP,setFilled:BP,setFocused:BP,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:NW,registerFieldControl:BP,validation:{getValidationProps:(e,t=HP)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:BP,getInputControl:()=>null,commit:async()=>{},change:BP}},IW=W.createContext(FW);function LW(e=!0){let t=W.useContext(IW);if(t.setValidityData===BP&&!e)throw Error(mF(28));return t}var RW=W.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:BP,validationMode:`onSubmit`,submitCountRef:{current:0}});function zW(){return W.useContext(RW)}var BW=W.createContext({controlId:void 0,registerControlId:BP,resetControlId:BP,labelId:void 0,setLabelId:BP,messageIds:[],setMessageIds:BP,getDescriptionProps:e=>e});function VW(){return W.useContext(BW)}function HW(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=VW(),o=vR(),s=kP(()=>Symbol()),c=W.useRef(!1),l=W.useRef(!1),u=Z(()=>{c.current&&i!==BP&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===BP){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}function UW(e,t,n){let{setFocused:r,focusOwnerRef:i}=LW(),a=Z(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function WW(e,t,n,r,i=!0,a){let{registerFieldControl:o}=LW(),s=kP(()=>Symbol());Q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var GW=W.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=LW(),{clearErrors:S,elementRef:C,submitCountRef:w}=zW(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=VW(),k=HW({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=Z(()=>x.inputRef.current?.value);WW(x.inputRef,k,j,M,!T,a),Q(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),jU(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=W.useRef(null),P=UW(T,N),F=KF();return oF(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=SR(bL,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:PW})}),KW=W.forwardRef(function(e,t){return(0,G.jsx)(GW,{ref:t,...e})}),qW=W.createContext(void 0);function JW(e){let t=W.useContext(qW);if(t===void 0&&!e)throw Error(mF(47));return t}var YW={...LV,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!LV.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&LV.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>LV.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},XW=class extends OV{constructor(e,t,n){let r=new fV;super(ZW(e,r,t,n),QW(r),YW)}setOpen=(e,t)=>{let n=t.reason===SL,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=aV(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=iV(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),np.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function ZW(e,t,n,r=!1){let i={...jV(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function QW(e){return{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new GF,stickIfOpen:!0,triggerElements:e}}var $W=_V(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=tG(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),dV(u,d),cV(u);let{forceUnmount:m}=lV(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),W.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,SR(IL))}),[m,u]);let h=d||f||s!=null;return(0,G.jsxs)(qW.Provider,{value:u,children:[s&&(0,G.jsx)(tV,{handle:s,store:u}),h&&(0,G.jsx)(nG,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function eG(e){return JW(!0)?(0,G.jsx)($W,{props:e}):(0,G.jsx)(NB,{children:(0,G.jsx)($W,{props:e})})}function tG(e,t){let n=eV((e,n)=>new XW(t,e,n));return W.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function nG({store:e,modal:t}){let n=YB(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return uV(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var rG=vV(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=JW(!0),h=RV(s)??m;if(!h)throw Error(mF(74));let g=vR(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=W.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=sV(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=YV(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:dH(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=UB(v,{stickIfOpen:Z(()=>h.context.stickIfOpen)}),k=MU(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=XI({disabled:a,native:o}),N={open(e){return w?hL.open(e):mL.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:F}=QU(h,x),I=oF(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[gB]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),L=(0,G.jsx)(W.Fragment,{children:I},g);return E?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(xz,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),L,(0,G.jsx)(xz,{ref:h.context.triggerFocusTargetRef,onFocus:F})]}):L}),iG=W.createContext(void 0);function aG(){let e=W.useContext(iG);if(e===void 0)throw Error(mF(45));return e}var oG=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return JW().useState(`mounted`)||n?(0,G.jsx)(iG.Provider,{value:n,children:(0,G.jsx)(wB,{ref:t,...r})}):null}),sG=W.createContext(void 0);function cG(){let e=W.useContext(sG);if(!e)throw Error(mF(46));return e}var lG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=vB,..._}=e,v=JW(),y=aG(),b=jB(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=tU({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});fU({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;EU(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=pU(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,G.jsxs)(sG.Provider,{value:j,children:[S&&M&&(0,G.jsx)(dU,{inert:RH(!C),cutout:T}),(0,G.jsx)(MB,{id:b,children:P})]})}),uG=W.createContext(void 0);function dG(){let[e,t]=W.useState(0),n=Z(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:W.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var fG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=JW(),l=cG(),u=pH(!0)!=null,{context:f,hasClosePart:p}=dG(),m=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);IF({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),qV(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?$B(c.context.popupRef):a,j=x!==!1&&p;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=oF(`div`,e,{state:{open:m,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...QB,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&vH.has(e.key)&&e.stopPropagation()}},TH(_),s],stateAttributesMapping:_L});return(0,G.jsx)(HB,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:d(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(uG.Provider,{value:f,children:N})})});function pG(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}var mG=W.createContext(void 0),hG=W.createContext(void 0);function gG(){let e=W.useContext(mG);if(e===void 0)throw Error(mF(60));return e}function _G(){let e=W.useContext(hG);if(e===void 0)throw Error(mF(61));return e}function vG(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var yG=(e,t)=>Object.is(e,t);function bG(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function xG(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!vG(e,t,(e,t)=>bG(e,t,n)):e!==t}function SG(e,t,n){return e?e.some(e=>e!==void 0&&bG(t,e,n)):!1}function CG(e,t,n){return e?e.findIndex(e=>e!==void 0&&bG(e,t,n)):-1}function wG(e,t){if(t!==yG)return n=>SG(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function TG(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(wG(t,n)):CG(e,t,n);return i===-1?null:i}function EG(e,t,n,r,i,a){return SG(r,t,i)?a!=null&&e>a&&SG(r,n[a],i)?a:e:e===a?TG(n,r,i,!0):a}function DG(e,t,n){return e.filter(e=>!bG(t,e,n))}var OG={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:hW(t,r)!==``},hasNullItemLabel:(e,t)=>t?pW(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>bG(t,e,n)):bG(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function kG(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function AG(e,t){return Math.max(0,e-t)}function jG(e,t){if(t<=0)return 0;let n=kG(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function MG(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=yG,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=zW(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=LW(),F=HW({id:t}),I=M||d,L=j??c,[R,z]=RL({controlled:n,default:y?r??VP:r,name:`Select`,state:`value`}),[B,ee]=RL({controlled:a,default:o,name:`Select`,state:`open`}),te=W.useRef([]),ne=W.useRef([]),re=W.useRef(null),ie=W.useRef(null),ae=W.useRef(0),V=W.useRef(null),oe=W.useRef([]),se=W.useRef(!1),ce=W.useRef(null),le=W.useRef(null),ue=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=W.useRef(!1),fe=W.useRef(R),{openMethod:pe,triggerProps:me}=NU(B),he=kP(()=>new OV({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:B,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:HP,triggerProps:HP,itemRoot:{props:HP,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:BP,setOpen:BP,handleScrollArrowVisibility:BP,onOpenChangeComplete:BP,listRef:te,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:V,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,alignItemWithTriggerActiveRef:de,initialValueRef:fe},OG)).current,[ge,_e]=W.useState(!1),{mounted:ve,transitionStatus:ye,forceUnmount:be}=ZB({open:B,ref:re,preventUnmountOnClose:ge,setPreventUnmountOnClose:_e,onUnmount(){he.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),xe=he.useState(`activeIndex`),Se=he.useState(`selectedIndex`),Ce=he.useState(`triggerElement`),we=he.useState(`positionerElement`),Te=rW(pe),H=pe??Te,Ee=W.useMemo(()=>y?``:hW(R,x),[y,R,x]),De=W.useMemo(()=>y&&Array.isArray(R)?R.map(e=>hW(e,x)):hW(R,x),[y,R,x]);WW(gz(Ce),F,R,Z(()=>De),!I,c);let Oe=y?Array.isArray(R)&&R.length>0:R!=null&&Ee!==``;Q(()=>{A(Oe)},[Oe,A]),Q(function(){let e=TG(oe.current,R,S,y);e===null&&(le.current=null),!B&&he.set(`selectedIndex`,e)},[y,B,R,S,he]),jU(R,()=>{T(L),E(xG(R,k.initialValue,S)),N.change(R)});let ke=Z((e,t)=>{let n=t,r=aV(n);s?.(e,n),!t.isCanceled&&(e||_e(r()),ee(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});W.useImperativeHandle(h,()=>({unmount:be,close:()=>{he.state.open&&ke(!1,SR(IL))}}),[be,ke,he]);let Ae=Z((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),je=Z(e=>{let t=AG(e.scrollHeight,e.clientHeight),n=jG(e.scrollTop,t),r=n>0,i=n<t;he.set(`scrollUpArrowVisible`,r),he.set(`scrollDownArrowVisible`,i)}),Me=zV({open:B,onOpenChange:ke,elements:{reference:Ce,floating:we}}),Ne=UB(Me,{enabled:!I,event:`mousedown`}),Pe=YB(Me),Fe=nH(Me,{enabled:!I,listRef:te,activeIndex:xe,selectedIndex:Se,disabledIndices:VP,onNavigate(e){(e!==null||B)&&he.set(`activeIndex`,e)},focusItemOnHover:C}),Ie=rH(Me,{enabled:!I&&(B||!f&&!y),listRef:ne,activeIndex:xe,selectedIndex:Se,disabledIndices:e=>aW(te.current[e]),onMatch(e){B?he.set(`activeIndex`,e):Ae(oe.current[e],SR(bL))},onTyping(e){se.current=e}}),Le=W.useMemo(()=>qP(Ie.reference,Fe.reference,Pe.reference,Ne.reference,me),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,me]),Re=W.useMemo(()=>qP(QB,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??HP,Be=W.useMemo(()=>({props:ze,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[ze,y,I,f,S]);he.useContextCallback(`setValue`,Ae),he.useContextCallback(`setOpen`,ke),he.useContextCallback(`handleScrollArrowVisibility`,je),he.useContextCallback(`onOpenChangeComplete`,_),pG(()=>{he.update({popupProps:Re,triggerProps:Le,itemRoot:Be})}),he.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:B,mounted:ve,transitionStatus:ye,popupProps:Re,triggerProps:Le,itemRoot:Be,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:H});let Ve=AP(g,N.inputRef),He=y?void 0:L,Ue=W.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=hW(e,x);return(0,G.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,G.jsxs)(mG.Provider,{value:he,children:[(0,G.jsx)(hG.Provider,{value:Me,children:w}),(0,G.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){he.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=SR(bL,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>hW(t,x).toLowerCase()===e||mW(t,b).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=oe.current[r];i!=null&&Ae(i,n)}he.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&He==null?`${F}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:Ee,disabled:I,required:p&&!(y&&Oe),readOnly:f,ref:Ve,style:L?bz:yz,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function NG(e,t){return e??t}var PG=`data-popup-side`,FG=400,IG={...hL,...PW,popupSide:e=>e?{[PG]:e}:null,value:()=>null},LG=W.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=LW(),{labelId:m}=VW(),h=gG(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=NG(m,O);HW({id:i});let N=gz(w),P=W.useRef(null),F=UW(y,P),{getButtonProps:I,buttonRef:L}=XI({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),z=KF(),B=KF(),ee=KF();W.useEffect(()=>{if(b)return ee.start(FG,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[b,h,B,ee]);let te=qP(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??iz(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,SR(bL,e.nativeEvent)),z.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){VR(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=JI(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;VR(P.current,t)||VR(N.current,t)||qU(e,P.current)||h.context.setOpen(!1,SR(jL,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),ne=d.getValidationProps(y,te);ne.role=`combobox`;let re={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return oF(`button`,e,{ref:[t,P,L,R],state:re,stateAttributesMapping:IG,props:ne})}),RG={value:()=>null},zG=W.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=gG(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?_W(l,u,d):gW(l,u,d)),oF(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:RG})}),BG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return oF(`span`,e,{state:{open:gG().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:mL})}),VG=W.forwardRef(function(e,t){let n=gG(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,G.jsx)(wB,{ref:t,...e}):null}),HG=W.createContext(void 0);function UG(){let e=W.useContext(HG);if(!e)throw Error(mF(59));return e}function WG(e,t){e&&Object.assign(e.style,t)}var GG={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},KG={position:`fixed`},qG=W.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=_B,style:_,...v}=e,y=gG(),b=_G(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=W.useRef(null),j=W.useRef(null),[M,N]=W.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),W.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),EU((P||C)&&x,T===`touch`,E,D);let F=tU({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?KG:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Q(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=pU(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=W.useRef(0),ee=Z(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=SR(bL);if(t!==0&&!y.state.multiple&&w!==null&&CG(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&CG(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>CG(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};WG(E,e),WG(y.context.popupRef.current,e)}}),te=W.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,G.jsx)(iU,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,G.jsxs)(HG.Provider,{value:te,children:[S&&C&&(0,G.jsx)(dU,{inert:RH(!x),cutout:D}),z]})})}),JG=`base-ui-disable-scrollbar`,YG={className:JG,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:JG,precedence:`base-ui:low`,children:`.${JG}{scrollbar-width:none}.${JG}::-webkit-scrollbar{display:none}`})}},XG=W.createContext(void 0),ZG={disableStyleElements:!1};function QG(){return W.useContext(XG)??ZG}var $G=`--transform-origin`,eK={...gL,...zF},tK=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=gG(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=_G(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=UG(),_=pH(!0)!=null,v=VH(),{nonce:y,disableStyleElements:b}=QG(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=W.useRef(!1),j=W.useRef(!1),M=W.useRef({}),N=OF(),P=Z(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=iK(O),i=aK(O.getBoundingClientRect().height,`y`,r),a=JI(O),o=V(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=nK(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=rK(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=kG(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=kG(g,0,rK(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});W.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),IF({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Q(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Q(()=>{S||m||(j.current=!1,A.current=!1,WG(O,M.current))},[S,m,O]),Q(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty($G),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=cK(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=V(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=JI(D),c=iK(D),l=oK(D.getBoundingClientRect(),c),d=oK(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=nK(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=oK(n.getBoundingClientRect(),c);T=oK(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${kG(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=rK(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&rR;if(B||ee){WG(O,M.current),g(!1);return}let te=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=rK(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=kG(n>0?(r-t)/n*100:50,0,100);e.style.setProperty($G,`50% ${i}%`)}(te===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),W.useEffect(()=>{if(!m||!O||!S)return;let e=V(O);function t(e){s.context.setOpen(!1,SR(LL,e))}return mz(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&vH.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:GG},className:!k&&m?YG.className:void 0},L=oF(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:eK,props:[T,I,TH(E),o]});return(0,G.jsxs)(W.Fragment,{children:[!b&&YG.getElement(y),(0,G.jsx)(HB,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function nK(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function rK(e){return AG(e.scrollHeight,e.clientHeight)}function iK(e){return M.getScale(e)}function aK(e,t,n){return e/n[t]}function oK(e,t){return g({x:aK(e.x,`x`,t),y:aK(e.y,`y`,t),width:aK(e.width,`x`,t),height:aK(e.height,`y`,t)})}var sK=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function cK(e){let{style:t}=e,n={};for(let[e,r]of sK)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of sK){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var lK=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=gG(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=UG(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:GG},className:u&&d!==`touch`?YG.className:void 0};return oF(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),uK=W.createContext(void 0);function dK(){let e=W.useContext(uK);if(!e)throw Error(mF(57));return e}var fK=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=W.useRef(null),d=fR({guess:!0,label:o,textRef:u}),f=gG(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=W.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=EG(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&bG(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=W.useRef(`mouse`),E=W.useRef(!1),{getButtonProps:D,buttonRef:O}=XI({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?DG(n,a,_):[...n,a];f.context.setValue(r,SR(TL,e))}else f.context.setValue(a,SR(TL,e)),f.context.setOpen(!1,SR(TL,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&IR(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=oF(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=W.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,G.jsx)(uK.Provider,{value:P,children:N})})),pK=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=W.useRef(null),{transitionStatus:l,setMounted:u}=BF(o),d=oF(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:zF});return IF({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),mK=W.forwardRef(function(e,t){let{selected:n}=dK();return e.keepMounted||n?(0,G.jsx)(pK,{...e,selected:n,ref:t}):null}),hK=W.memo(W.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=dK(),a=gG(),{render:o,className:s,style:c,...l}=e;return oF(`div`,e,{ref:[W.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),gK=W.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=gG(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=UG(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=KF(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=BF(g);Q(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),IF({open:g,ref:v,onComplete(){g||x(!1)}});let S=oF(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=AG(e.scrollHeight,e.clientHeight),r=jG(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=_K(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:zF});return y||o?S:null});function _K(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?jG(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?jG(l.offsetTop+l.offsetHeight-r+i,a):a}var vK=W.forwardRef(function(e,t){return(0,G.jsx)(gK,{...e,ref:t,direction:`down`})}),yK=W.forwardRef(function(e,t){return(0,G.jsx)(gK,{...e,ref:t,direction:`up`})}),bK=W.createContext(void 0);function xK(){let e=W.useContext(bK);if(e===void 0)throw Error(mF(64));return e}var SK=`data-activation-direction`,CK={tabActivationDirection:e=>({[SK]:e})},wK=W.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=W.useRef([]),[f,p]=W.useState(()=>new Map),[m,h]=RL({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=W.useState(()=>new Map),y=W.useRef(void 0),b=W.useCallback(e=>TK(_,e),[_]),[x,S]=W.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=EK(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Q(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=Z((e,t)=>{t.activationDirection=EK(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=Z((e,t)=>{i?.(e,SR(t,void 0,void 0,{activationDirection:`none`}))}),j=Z((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=W.useCallback(e=>f.get(e),[f]),N=W.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=W.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=W.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=W.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=W.useRef(!u),R=W.useRef(r),z=W.useRef(u),B=W.useRef(!1);Q(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,PL);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(z.current=!1),z.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=PL;r?i=FL:t&&(i=NL),e(n,i)}else r&&F!=null&&(A(m,FL),L.current=!1)},[I,g,A,F,h,_,m]);let ee=oF(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:CK});return(0,G.jsx)(bK.Provider,{value:P,children:(0,G.jsx)(iU,{elementsRef:d,children:ee})})});function TK(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function EK(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=TK(r,e),c=TK(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var DK=`data-composite-item-active`,OK=W.createContext(void 0);function kK(){let e=W.useContext(OK);if(e===void 0)throw Error(mF(65));return e}var AK=W.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=xK(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=kK(),{highlightedIndex:v,onHighlightedIndexChange:y}=KI(),b=vR(o),{compositeProps:x,compositeRef:S,index:C}=YU({metadata:W.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=W.useRef(!1),E=W.useRef(null),D=Z(e=>{E.current?.(),E.current=e?g(e):null});Q(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=BR(JI(e));if(t&&VR(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=XI({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=W.useRef(!1),M=W.useRef(!1);function N(e){f(a,SR(bL,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=JI(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return oF(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[DK]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:CK})}),jK=`data-index`,MK={...CK,...zF},NK=W.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=xK(),p=vR(),{ref:m,index:h}=fR(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=BF(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=W.useRef(null),w=oF(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:RH(!g),[jK]:h},s],stateAttributesMapping:MK});return IF({open:g,ref:C,onComplete(){g||y(!1)}}),Q(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function PK(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=VP}=e,[p,m]=W.useState(0),h=r!=null,g=W.useRef(null),_=AP(g,c),v=W.useRef([]),y=W.useRef(!1),b=W.useRef(null),x=o??p,S=Z((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];SH(g.current,t,a,n)}}),C=Z(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||Dz(e,x,d)?S(FK(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(Dz(t,x,d)){let e=Ez(t,{disabledIndices:d});Sz(t,e)||S(e)}SH(g.current,r,a,n)});Q(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(Dz(e,x,d)){let t=Ez(e,{disabledIndices:d});Sz(e,t)||S(t)}},[d,o,x,v,S]);let w=Z((e,t,n)=>i?i(e,t,n,v):n),T=Z(e=>{let o=e.key===`Home`||e.key===`End`;if(!vH.has(e.key)||!l&&o||IK(e,f)||!g.current)return;let s=a===`rtl`,c=s?gH:_H,p=s?_H:gH,m=n===`vertical`?hH:c,_=n===`vertical`?mH:p,y=UR(e.nativeEvent);if(y!=null&&xH(y)&&!aW(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=Cz(v,d),T=wz(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=Ez(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!Sz(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=UR(e.nativeEvent);t&&n!=null&&xH(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function FK(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Dz(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function IK(e,t){for(let n of yH)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function LK(e){let{render:t,className:n,style:r,refs:i=VP,props:a=VP,state:o=HP,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=PK({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:VH(),disabledIndices:v,modifierKeys:y}),k=oF(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=W.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,G.jsx)(GI.Provider,{value:A,children:(0,G.jsx)(iU,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var RK=W.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=xK(),[d,f]=W.useState(0),[p,m]=W.useState(null),h=W.useRef(new Set),g=W.useRef(new Set),_=W.useRef(null);Q(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=Z(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=Z(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=W.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,G.jsx)(OK.Provider,{value:S,children:(0,G.jsx)(LK,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:CK,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:VP})})}),zK=W.createContext(void 0);function BK(){return W.useContext(zK)}var VK=W.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=vR(u||void 0),h=BK(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=RL({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=XI({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=SR(bL,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],T=oF(`button`,e,{enabled:!h,state:S,ref:C,props:w}),E=W.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,G.jsx)(XU,{tag:`button`,render:c,className:n,style:f,metadata:E,state:S,refs:C,props:w}):T}),HK=W.createContext(void 0);function UK(e){let t=W.useContext(HK);if(t===void 0&&!e)throw Error(mF(72));return t}var WK={...LV,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},GK=class extends OV{constructor(e,t,n){let r=new fV;super(KK(e,r,t,n),qK(r),WK)}setOpen=(e,t)=>{oV(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,SR(xL,e))}};function KK(e,t,n,r=!1){return{...jV(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function qK(e){return{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var JK=_V(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=eV((e,t)=>new GK({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),cV(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=lV(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=W.useRef(null);Q(()=>{m&&t&&p.setOpen(!1,SR(NL))},[m,t,p]),Q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),W.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,SR(IL))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,G.jsxs)(HK.Provider,{value:p,children:[l&&(0,G.jsx)(tV,{handle:l,store:p}),T&&(0,G.jsx)(YK,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function YK({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=YB(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=KB(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=W.useMemo(()=>qP(a.reference,i.reference),[a.reference,i.reference]);return uV(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??HP}),null}var XK=W.createContext(void 0);function ZK(){return W.useContext(XK)}var QK=`data-base-ui-tooltip-trigger`;function $K(e){let t=UR(e);return S(t)?t:null}var eq=vV(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=UK(!0),m=RV(a)??p;if(!m)throw Error(mF(82));let h=vR(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=W.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=sV(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=ZK(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=pz(v,{open:_}),O=KV(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=gz(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=W.useRef(!1),F=KF(),I=W.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=HR(e,`[${QK}]`);return n!==null&&n!==t&&VR(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=YV(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?dH():null,restMs:L,delay(){return u==null&&D?{close:oz(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),ee=VV(v,{enabled:!A}).reference,te=e=>{let t=P.current,n=$K(e),r=z(n),i=y.current,a=i&&n&&VR(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,SR(SL,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&RR(I.current)){let t=()=>{P.current||j.current||m.select(`open`)||m.setOpen(!0,SR(SL,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},ne=m.useState(`appliedTriggerProps`,S||M!==`none`);return oF(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){R($K(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[XR]:A?``:void 0,[QK]:A?void 0:``},f],stateAttributesMapping:mL})}),tq=W.createContext(void 0);function nq(){let e=W.useContext(tq);if(e===void 0)throw Error(mF(70));return e}var rq=W.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=CB({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(W.Fragment,{children:[l,c&&np.createPortal(n,c)]})}),iq=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return UK().useState(`mounted`)||n?(0,G.jsx)(tq.Provider,{value:n,children:(0,G.jsx)(rq,{ref:t,...r})}):null}),aq=W.createContext(void 0);function oq(){let e=W.useContext(aq);if(e===void 0)throw Error(mF(71));return e}var sq=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=vB,style:g,..._}=e,v=UK(),y=nq(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=tU({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=pU(e,W.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,G.jsx)(aq.Provider,{value:D,children:O})}),cq=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=UK(),{side:s,align:c}=oq(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);IF({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),qV(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return oF(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[QB,f,TH(d),a],stateAttributesMapping:_L})}),lq=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=UK(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=oq();return oF(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:gL})}),uq=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=W.useMemo(()=>({open:t,close:n}),[t,n]);return(0,G.jsx)(XK.Provider,{value:t,children:(0,G.jsx)(fz,{delay:i,timeoutMs:r,children:e.children})})},dq=e=>{let{children:t,onSubmit:n,submitButton:r,...i}=e;return pb(i),(0,G.jsxs)(`form`,{className:`bn-form`,onSubmit:e=>{e.preventDefault(),n?.()},children:[t,r===`none`?null:r]})};function $(...e){return UI(F(e))}function fq({className:e,size:t=`default`,...n}){return(0,G.jsx)(vF,{"data-slot":`avatar`,"data-size":t,className:$(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function pq({className:e,...t}){return(0,G.jsx)(UF,{"data-slot":`avatar-image`,className:$(`aspect-square size-full rounded-full object-cover`,e),...t})}function mq({className:e,...t}){return(0,G.jsx)(qF,{"data-slot":`avatar-fallback`,className:$(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var hq=B(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function gq({className:e,variant:t=`default`,render:n,...r}){return WI({defaultTagName:`span`,props:qP({className:$(hq({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var _q=B(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function vq({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)($I,{"data-slot":`button`,className:$(_q({variant:t,size:n,className:e})),...r})}function yq({className:e,size:t=`default`,...n}){return(0,G.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:$(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function bq({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-content`,className:$(`px-(--card-spacing)`,e),...t})}function xq({...e}){return(0,G.jsx)(UU,{"data-slot":`dropdown-menu`,...e})}function Sq({...e}){return(0,G.jsx)(eW,{"data-slot":`dropdown-menu-trigger`,...e})}function Cq({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return(0,G.jsx)(LH,{container:a,children:(0,G.jsx)(DU,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,G.jsx)(PH,{"data-slot":`dropdown-menu-content`,className:$(`z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function wq({...e}){return(0,G.jsx)(AR,{"data-slot":`dropdown-menu-group`,...e})}function Tq({className:e,inset:t,...n}){return(0,G.jsx)(jR,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:$(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function Eq({className:e,inset:t,variant:n=`default`,...r}){return(0,G.jsx)(NR,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:$(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Dq({...e}){return(0,G.jsx)(GU,{"data-slot":`dropdown-menu-sub`,...e})}function Oq({className:e,inset:t,children:n,...r}){return(0,G.jsxs)(cW,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:$(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(OW,{className:`ml-auto`})]})}function kq({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,G.jsx)(Cq,{"data-slot":`dropdown-menu-sub-content`,className:$(`w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function Aq({className:e,children:t,checked:n,inset:r,...i}){return(0,G.jsxs)(TR,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:$(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,G.jsx)(ER,{children:(0,G.jsx)(EW,{})})}),t]})}function jq({className:e,...t}){return(0,G.jsx)(iW,{"data-slot":`dropdown-menu-separator`,className:$(`-mx-1 my-1 h-px bg-border`,e),...t})}function Mq({className:e,type:t,...n}){return(0,G.jsx)(KW,{type:t,"data-slot":`input`,className:$(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function Nq({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:$(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Pq({...e}){return(0,G.jsx)(eG,{"data-slot":`popover`,...e})}function Fq({...e}){return(0,G.jsx)(rG,{"data-slot":`popover-trigger`,...e})}function Iq({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,...o}){return(0,G.jsx)(oG,{container:a,children:(0,G.jsx)(lG,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,G.jsx)(fG,{"data-slot":`popover-content`,className:$(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var Lq=MG;function Rq({className:e,...t}){return(0,G.jsx)(zG,{"data-slot":`select-value`,className:$(`flex flex-1 text-left`,e),...t})}function zq({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(LG,{"data-slot":`select-trigger`,"data-size":t,className:$(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(BG,{render:(0,G.jsx)(DW,{className:`text-muted-foreground pointer-events-none size-4`})})]})}function Bq({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,container:s,...c}){return(0,G.jsx)(VG,{container:s,children:(0,G.jsx)(qG,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,G.jsxs)(tK,{"data-slot":`select-content`,"data-align-trigger":o,className:$(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,G.jsx)(Hq,{}),(0,G.jsx)(lK,{children:t}),(0,G.jsx)(Uq,{})]})})})}function Vq({className:e,children:t,...n}){return(0,G.jsxs)(fK,{"data-slot":`select-item`,className:$(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,G.jsx)(hK,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,G.jsx)(mK,{render:(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,G.jsx)(EW,{className:`pointer-events-none`})})]})}function Hq({className:e,...t}){return(0,G.jsx)(yK,{"data-slot":`select-scroll-up-button`,className:$(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(kW,{})})}function Uq({className:e,...t}){return(0,G.jsx)(vK,{"data-slot":`select-scroll-down-button`,className:$(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(DW,{})})}function Wq({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-md bg-muted`,e),...t})}function Gq({className:e,orientation:t=`horizontal`,...n}){return(0,G.jsx)(wK,{"data-slot":`tabs`,"data-orientation":t,className:$(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Kq=B(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function qq({className:e,variant:t=`default`,...n}){return(0,G.jsx)(RK,{"data-slot":`tabs-list`,"data-variant":t,className:$(Kq({variant:t}),e),...n})}function Jq({className:e,...t}){return(0,G.jsx)(AK,{"data-slot":`tabs-trigger`,className:$(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Yq({className:e,...t}){return(0,G.jsx)(NK,{"data-slot":`tabs-content`,className:$(`flex-1 text-sm outline-none`,e),...t})}var Xq=B(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-muted`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function Zq({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(VK,{"data-slot":`toggle`,className:$(Xq({variant:t,size:n,className:e})),...r})}function Qq({delay:e=0,...t}){return(0,G.jsx)(uq,{"data-slot":`tooltip-provider`,delay:e,...t})}function $q({...e}){return(0,G.jsx)(JK,{"data-slot":`tooltip`,...e})}function eJ({...e}){return(0,G.jsx)(eq,{"data-slot":`tooltip-trigger`,...e})}function tJ({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,container:o,...s}){return(0,G.jsx)(iq,{container:o,children:(0,G.jsx)(sq,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,G.jsxs)(cq,{"data-slot":`tooltip-content`,className:$(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[a,(0,G.jsx)(lq,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var nJ={Avatar:{Avatar:fq,AvatarFallback:mq,AvatarImage:pq},Badge:{Badge:gq},Button:{Button:vq},Card:{Card:yq,CardContent:bq},DropdownMenu:{DropdownMenu:xq,DropdownMenuCheckboxItem:Aq,DropdownMenuContent:Cq,DropdownMenuGroup:wq,DropdownMenuItem:Eq,DropdownMenuLabel:Tq,DropdownMenuSeparator:jq,DropdownMenuSub:Dq,DropdownMenuSubContent:kq,DropdownMenuSubTrigger:Oq,DropdownMenuTrigger:Sq},Input:{Input:Mq},Label:{Label:Nq},Popover:{Popover:Pq,PopoverContent:Iq,PopoverTrigger:Fq},Select:{Select:Lq,SelectContent:Bq,SelectItem:Vq,SelectTrigger:zq,SelectValue:Rq},Skeleton:{Skeleton:Wq},Tabs:{Tabs:Gq,TabsContent:Yq,TabsList:qq,TabsTrigger:Jq},Toggle:{Toggle:Zq},Tooltip:{Tooltip:$q,TooltipContent:tJ,TooltipProvider:Qq,TooltipTrigger:eJ}},rJ=(0,W.createContext)(void 0);function iJ(){return(0,W.useContext)(rJ)}var aJ=(0,W.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:c,placeholder:l,disabled:u,onKeyDown:d,onChange:f,autoComplete:p,"aria-activedescendant":m,rightSection:h,...g}=e;pb(g);let _=EP([vP(c),t]),v=iJ();return(0,G.jsxs)(`div`,{className:$(n,`border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,`text-foreground items-center gap-2`),children:[o,(0,G.jsxs)(`div`,{className:`flex-1`,children:[i&&(0,G.jsx)(v.Label.Label,{htmlFor:i,children:i}),(0,G.jsx)(v.Input.Input,{className:$(n,`h-auto border-none p-0`),id:i,name:r,placeholder:l,disabled:u,value:s,onKeyDown:d,onChange:f,ref:_,"aria-activedescendant":m})]}),h]})});function oJ(e){return e?{onFocusCapture(e){let t=e.relatedTarget;t instanceof HTMLElement&&!e.currentTarget.contains(t)&&t.focus({preventScroll:!0})}}:{}}var sJ=(0,W.createContext)({portalElement:null,preventFocusOnOpen:!1}),cJ=e=>{let{children:t,onOpenChange:n,position:r,portalElement:i,preventFocusOnOpen:a,sub:o,...s}=e;pb(s);let c=iJ(),l={portalElement:i,preventFocusOnOpen:a??!1};return o?(0,G.jsx)(c.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:(0,G.jsx)(sJ.Provider,{value:l,children:t})}):(0,G.jsx)(c.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:n,children:(0,G.jsx)(sJ.Provider,{value:l,children:t})})},lJ=e=>{let{children:t,sub:n,...r}=e;pb(r);let i=iJ();return n?(0,G.jsx)(i.DropdownMenu.DropdownMenuSubTrigger,{children:t}):(0,G.jsx)(i.DropdownMenu.DropdownMenuTrigger,{render:t})},uJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;pb(a);let o=iJ(),{portalElement:s,preventFocusOnOpen:c}=(0,W.useContext)(sJ);return i?(0,G.jsx)(o.DropdownMenu.DropdownMenuSubContent,{className:n,container:s,ref:t,children:r}):(0,G.jsx)(o.DropdownMenu.DropdownMenuContent,{className:n,container:s,ref:t,...oJ(c),children:r})}),dJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,disabled:o,subTrigger:s,onClick:c,...l}=e;pb(l);let u=iJ();return s?(0,G.jsxs)(G.Fragment,{children:[i,r]}):a===void 0?(0,G.jsxs)(u.DropdownMenu.DropdownMenuItem,{className:n,ref:t,onClick:c,disabled:o,onMouseDown:DP,...l,children:[i,r,s&&(0,G.jsx)(OW,{className:`ml-auto h-4 w-4`})]}):(0,G.jsxs)(u.DropdownMenu.DropdownMenuCheckboxItem,{className:$(n,`gap-1`,a?``:`px-2`),ref:t,checked:a,onClick:c,disabled:o,onMouseDown:DP,...l,children:[i,r]})}),fJ=(0,W.forwardRef)((e,t)=>{let{className:n,...r}=e;pb(r);let i=iJ();return(0,G.jsx)(i.DropdownMenu.DropdownMenuSeparator,{className:n,ref:t})}),pJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;pb(i);let a=iJ();return(0,G.jsx)(a.DropdownMenu.DropdownMenuGroup,{children:(0,G.jsx)(a.DropdownMenu.DropdownMenuLabel,{className:n,ref:t,children:r})})}),mJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;pb(u,!1);let d=iJ();return(0,G.jsxs)(d.Button.Button,{variant:`ghost`,className:$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),hJ=(0,W.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...c}=e;pb(c);let l=iJ();return(0,G.jsxs)(l.Tabs.Tabs,{className:$(n,`bg-popover max-w-screen rounded-lg p-2`),ref:t,value:a,defaultValue:i,onValueChange:o,children:[(0,G.jsx)(l.Tabs.TabsList,{children:r.map(e=>(0,G.jsx)(l.Tabs.TabsTrigger,{value:e.name,children:e.name},e.name))}),r.map(e=>(0,G.jsx)(l.Tabs.TabsContent,{value:e.name,children:(0,G.jsx)(l.Card.Card,{children:(0,G.jsx)(l.Card.CardContent,{className:`p-4`,children:e.tabPanel})})},e.name))]})}),gJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return pb(i),(0,G.jsx)(`div`,{className:$(n,`flex flex-col items-start justify-center gap-2`),ref:t,children:r})}),_J=(0,W.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;pb(s);let c=iJ();return(0,G.jsx)(c.Input.Input,{"data-test":`embed-input`,className:$(n,`w-80 max-w-full`),ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),vJ=(0,W.createContext)(null),yJ=e=>{let{children:t,open:n,onOpenChange:r,position:i,portalElement:a,...o}=e;pb(o);let s=iJ();return(0,G.jsx)(s.Popover.Popover,{open:n,onOpenChange:r,children:(0,G.jsx)(vJ.Provider,{value:a,children:t})})},bJ=(0,W.forwardRef)((e,t)=>{let{children:n,...r}=e;pb(r);let i=iJ();return(0,G.jsx)(i.Popover.PopoverTrigger,{ref:t,render:n})}),xJ=(0,W.forwardRef)((e,t)=>{let{className:n,variant:r,children:i,...a}=e;pb(a);let o=iJ(),s=(0,W.useContext)(vJ);return(0,G.jsx)(o.Popover.PopoverContent,{sideOffset:8,container:s,initialFocus:!1,className:$(n,`flex flex-col gap-2`,r===`panel-popover`?`w-fit max-w-none border-none p-0 shadow-none`:``),ref:t,children:i})}),SJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return pb(i,!1),(0,G.jsx)(`div`,{className:n,ref:t,...i,children:r})}),CJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;pb(u,!1);let d=iJ();return(0,G.jsxs)(d.Button.Button,{variant:`ghost`,className:$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),wJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return pb(o),(0,G.jsx)(`div`,{className:$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,`grid`,n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),TJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return pb(a),(0,G.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),EJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return pb(a),(0,G.jsx)(`div`,{id:i,role:`listbox`,className:$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,n),ref:t,children:r})}),DJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return pb(i),(0,G.jsx)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,n),ref:t,children:(0,G.jsx)(`div`,{children:r})})}),OJ=(0,W.forwardRef)((e,t)=>{let n=iJ(),{className:r,item:i,isSelected:a,onClick:o,id:s,...c}=e;pb(c);let l=(0,W.useRef)(null);return(0,W.useEffect)(()=>{l.current&&a&&wP(l.current,l.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&l.current.scrollIntoView({block:`nearest`})},[a]),(0,G.jsxs)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,e.item.size===`small`?`gap-3 py-1`:``,r),"data-highlighted":!0,ref:TP([t,l]),id:s,onMouseDown:e=>e.preventDefault(),onClick:o,role:`option`,"aria-selected":a||void 0,children:[i.icon&&(0,G.jsx)(`div`,{className:$(`p-3`,e.item.size===`small`?`p-0`:``,r),"data-position":`left`,children:i.icon}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:$(`text-base`,e.item.size===`small`?`text-sm`:``,r),children:i.title}),(0,G.jsx)(`div`,{className:$(`text-xs`,e.item.size===`small`?`hidden`:``,r),children:i.subtext})]}),i.badge&&(0,G.jsx)(`div`,{"data-position":`right`,className:`text-xs`,children:(0,G.jsx)(n.Badge.Badge,{variant:`secondary`,children:i.badge})})]})}),kJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return pb(i),(0,G.jsx)(`div`,{className:$(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),ref:t,children:r})}),AJ=(0,W.forwardRef)((e,t)=>{let{className:n,...r}=e;return pb(r),(0,G.jsx)(`div`,{className:$(n,`animate-spin`),ref:t,children:(0,G.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1em`,viewBox:`0 -960 960 960`,width:`1em`,fill:`#e8eaed`,children:(0,G.jsx)(`path`,{d:`M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z`})})})}),jJ=(0,W.forwardRef)((e,t)=>{let{className:n,markClassName:r,backgroundColor:i,children:a,...o}=e;return pb(o),(0,G.jsx)(`span`,{className:$(n,r),style:r?void 0:{backgroundColor:i},ref:t,children:a})}),MJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,onMouseDown:i,onClick:a,...o}=e;pb(o,!1);let s=iJ();return(0,G.jsx)(s.Button.Button,{variant:`ghost`,className:$(n,`h-full w-full p-0 text-gray-400`,n?.includes(`extend-button-add-remove-columns`)?`ml-1`:`mt-1`,n?.includes(`extend-button-editing`)?`bg-accent text-accent-foreground`:``),ref:t,onClick:a,onMouseDown:i,...o,children:r})}),NJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:c,...l}=e;pb(l,!1);let u=iJ();return(0,G.jsx)(u.Button.Button,{variant:`ghost`,className:$(n,`h-fit w-fit p-0 text-gray-400`),ref:t,"aria-label":c,draggable:i,onDragStart:a,onDragEnd:o,style:s,...l,children:r})}),PJ=(0,W.forwardRef)((e,t)=>{let{className:n,"aria-label":r,children:i,onMouseEnter:a,onMouseLeave:o,trapFocus:s,variant:c,...l}=e;pb(l);let u=iJ();return(0,G.jsx)(u.Tooltip.TooltipProvider,{delay:0,children:(0,G.jsx)(`div`,{className:$(n,`bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md`,c===`action-toolbar`?`w-fit`:``),role:`toolbar`,"aria-label":r,ref:t,onMouseEnter:a,onMouseLeave:o,children:i})})}),FJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:c,onClick:l,label:u,variant:d,onMouseDown:f,...p}=e;pb(p,!1);let m=iJ(),h=vp(),g=e=>{DP(e),f?.(e)},_=s===void 0?(0,G.jsxs)(m.Button.Button,{className:$(n,d===`compact`?`h-6 min-w-6 p-0`:``),variant:`ghost`,size:d===`compact`?`sm`:`default`,disabled:c,onClick:l,ref:t,"aria-label":u,...p,onMouseDown:g,children:[o,r]}):(0,G.jsxs)(m.Toggle.Toggle,{className:$(n,`aria-expanded:bg-accent aria-expanded:text-accent-foreground`,d===`compact`?`h-6 min-w-6 p-0`:``),size:d===`compact`?`sm`:`default`,"aria-label":u,onClick:l,pressed:s,disabled:c,ref:t,...p,onMouseDown:g,children:[o,r]});return(0,G.jsxs)(m.Tooltip.Tooltip,{children:[(0,G.jsx)(m.Tooltip.TooltipTrigger,{render:_}),(0,G.jsxs)(m.Tooltip.TooltipContent,{container:h,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,G.jsx)(`span`,{children:i}),a&&(0,G.jsx)(`span`,{children:a})]})]})}),IJ=(0,W.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,portalElement:a,preventFocusOnOpen:o,...s}=e;pb(s);let c=iJ(),l=e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.icon,e.text]}),u=r.filter(e=>e.isSelected)[0];return u?(0,G.jsxs)(c.Select.Select,{value:u.text,onValueChange:e=>r.find(t=>t.text===e).onClick?.(),disabled:i,children:[(0,G.jsx)(c.Select.SelectTrigger,{className:`border-none`,onMouseDown:DP,children:(0,G.jsx)(c.Select.SelectValue,{})}),(0,G.jsx)(c.Select.SelectContent,{className:n,container:a,alignItemWithTrigger:!1,ref:t,...oJ(o??!1),children:r.map(e=>(0,G.jsx)(c.Select.SelectItem,{disabled:e.isDisabled,value:e.text,onMouseDown:DP,children:(0,G.jsx)(l,{...e})},e.text))})]}):null}),LJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,selected:i,headerText:a,onFocus:o,onBlur:s,tabIndex:c,...l}=e;pb(l);let u=iJ();return(0,G.jsxs)(u.Card.Card,{className:$(n,`w-[300px]`,i?`bg-accent text-accent-foreground`:``),onFocus:o,onBlur:s,tabIndex:c,ref:t,children:[a&&(0,G.jsx)(`div`,{className:`px-4 pt-4 text-sm italic`,children:a}),r]})}),RJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return pb(i),(0,G.jsx)(`div`,{className:$(n,`p-4`,n?.includes(`thread-comments`)?`flex flex-col gap-6 border-b`:``),ref:t,children:r})}),zJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;pb(i,!1);let a=iJ();return(0,G.jsx)(a.Button.Button,{className:$(n,`text-foreground w-fit bg-transparent p-0 hover:bg-transparent`),ref:t,children:r})}),BJ=(0,W.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=kp();pb(a,!1);let s=iJ();return n===`loading`?(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,G.jsx)(s.Skeleton.Skeleton,{className:`size-7 animate-pulse rounded-full bg-neutral-400`}),(0,G.jsx)(s.Skeleton.Skeleton,{className:`h-3 w-32 animate-pulse rounded-full bg-neutral-400`})]}):(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,G.jsxs)(s.Avatar.Avatar,{children:[(0,G.jsx)(s.Avatar.AvatarImage,{src:n.avatarUrl,alt:n.username,className:`h-7 rounded-full`}),(0,G.jsx)(s.Avatar.AvatarFallback,{children:n.username[0]})]}),(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-bold`,children:n.username}),(0,G.jsxs)(`span`,{className:`text-xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),VJ=(0,W.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,actions:o,edited:s,emojiPickerOpen:c,children:l,...u}=e;pb(u);let[d,f]=(0,W.useState)(!1),{focused:p,ref:m}=bP(),h=o&&(r===!0||r===void 0||r===`hover`&&d||p||c);return(0,G.jsxs)(`div`,{ref:t,className:$(n,`relative flex flex-col gap-2`),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[h?(0,G.jsx)(`div`,{className:`absolute top-0 right-0 z-10`,ref:m,children:o}):null,(0,G.jsx)(BJ,{...e}),l]})}),HJ=(0,W.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:i,autoFocus:a,editor:o,editable:s,...c}=e;pb(c);let l=ap();return(0,G.jsx)(tY,{autoFocus:a,className:$(n,``),theme:l?.colorSchemePreference,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,ref:t,onFocus:r,onBlur:i,children:(0,G.jsx)(bM,{formattingToolbar:UJ})})}),UJ=()=>{let e=cM([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`);return(0,G.jsx)(lM,{blockTypeSelectItems:[],children:e})},WJ=(0,W.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:c,onMouseEnter:l,...u}=e;pb(u,!1);let d=iJ(),f=vp(),p=(0,G.jsxs)(d.Button.Button,{variant:a?`secondary`:`outline`,className:$(n,`flex h-7 items-center gap-1 rounded-full px-2.5`),onClick:c,onMouseEnter:l,ref:t,children:[(0,G.jsx)(`span`,{children:i}),(0,G.jsx)(`span`,{children:r})]});return o?(0,G.jsxs)(d.Tooltip.Tooltip,{children:[(0,G.jsx)(d.Tooltip.TooltipTrigger,{render:p}),(0,G.jsxs)(d.Tooltip.TooltipContent,{container:f,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,G.jsx)(`span`,{children:o}),s&&(0,G.jsx)(`span`,{children:s})]})]}):p}),GJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;pb(i);let a=iJ();return(0,G.jsx)(a.Tooltip.TooltipProvider,{delay:0,children:(0,G.jsx)(`div`,{className:$(n,`flex w-full flex-row flex-wrap gap-1`),ref:t,children:r})})}),KJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,"aria-label":i,...a}=e;return pb(a,!1),(0,G.jsx)(`div`,{className:$(n,`flex min-h-0 flex-1 flex-col overflow-hidden px-4`),ref:t,role:`region`,"aria-label":i,children:r})});function qJ(e){let{className:t,title:n,actions:r,closeAction:i,...a}=e;return pb(a,!1),(0,G.jsxs)(`div`,{className:$(t,`flex shrink-0 items-center justify-between pt-4 pb-2`),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`h2`,{className:`text-card-foreground m-0 text-lg font-bold`,children:n}),r]}),i]})}function JJ(e){let t=iJ();return e.mode===`display`?(0,G.jsx)(`span`,{className:`bn-snapshot-name`,children:e.value}):(0,G.jsx)(`span`,{className:`bn-snapshot-name-sizer`,"data-value":e.value===``?e.placeholder:e.value,children:(0,G.jsx)(t.Input.Input,{ref:e.inputRef,className:`bn-snapshot-name h-auto shadow-none focus-visible:ring-0`,type:`text`,value:e.value,placeholder:e.placeholder,"aria-label":e[`aria-label`],onChange:e.onChange,onClick:e.onClick,onKeyDown:e.onKeyDown,onBlur:e.onBlur})})}var YJ=(0,W.forwardRef)((e,t)=>{let{className:n,id:r,"aria-label":i,state:a,tabIndex:o,"aria-busy":s,onClick:c,onKeyDown:l,onFocus:u,actions:d,name:f,date:p,restoredFrom:m,secondaryLabel:h,comparingLabel:g,comparingIcon:_,...v}=e;pb(v,!1);let y=iJ();return(0,G.jsxs)(y.Card.Card,{className:$(n,`group relative mb-1 flex w-full cursor-pointer flex-col gap-1.5 overflow-visible rounded-lg border border-transparent px-3.5 py-3 text-card-foreground shadow-none transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`,(a===`selected`||a===`comparison-source`)&&`selected bg-primary text-primary-foreground hover:bg-primary focus-visible:-outline-offset-4 focus-visible:outline-primary-foreground`,a===`comparison-baseline`&&`comparing bg-primary/10`,(a===`comparison-source`||a===`comparison-baseline`)&&`border-primary ring-1 ring-primary`),id:r,role:`listitem`,"aria-label":i,"aria-current":a===`selected`||a===`comparison-source`?`true`:void 0,"aria-busy":s,tabIndex:o,onClick:c,onKeyDown:l,onFocus:u,ref:t,children:[g&&(0,G.jsxs)(`div`,{className:`bn-snapshot-comparing-to text-primary dark:text-primary flex items-center gap-1 text-[13px] font-semibold`,children:[_,(0,G.jsx)(`span`,{children:g})]}),(0,G.jsxs)(`div`,{className:`bn-snapshot-body flex flex-col gap-0.5 text-[13px]`,children:[(0,G.jsx)(`div`,{className:`bn-snapshot-title-row flex min-h-5 min-w-0 items-center gap-1.5 pr-5`,children:f}),p&&(0,G.jsx)(`div`,{className:`bn-snapshot-date leading-[1.3]`,children:p}),m&&(0,G.jsx)(`div`,{className:`bn-snapshot-original-date text-muted-foreground leading-[1.3]`,children:m}),h&&(0,G.jsx)(`div`,{className:`bn-snapshot-secondary-label text-muted-foreground leading-[1.3]`,children:h})]}),d&&(0,G.jsx)(`div`,{className:`bn-snapshot-menu absolute top-2 right-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 group-focus-visible:opacity-100`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:d})]})}),XJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,type:i,onClick:a,label:o,...s}=e;pb(s);let c=iJ();return(0,G.jsx)(c.Button.Button,{type:i,className:n,"aria-label":o,ref:t,onClick:a,children:r})}),ZJ=(0,W.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;pb(s);let c=iJ();return(0,G.jsx)(c.Input.Input,{type:`file`,className:n,ref:t,accept:r,value:i?i.name:void 0,onChange:async e=>o?.(e.target.files[0]),placeholder:a})}),QJ=(0,W.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;pb(s);let c=(0,W.useRef)(null);return(0,W.useEffect)(()=>{c.current&&r&&wP(c.current,c.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,G.jsx)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm p-2 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,`text-base!`,n),ref:TP([t,c]),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),$J=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return pb(a),(0,G.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),eY={FormattingToolbar:{Root:PJ,Button:FJ,Select:IJ},FilePanel:{Root:hJ,Button:XJ,FileInput:ZJ,TabPanel:gJ,TextInput:_J},LinkToolbar:{Root:PJ,Button:FJ,Select:IJ},SideMenu:{Root:SJ,Button:CJ},SuggestionMenu:{Root:EJ,Item:OJ,EmptyItem:DJ,Label:kJ,Loader:AJ},GridSuggestionMenu:{Root:wJ,Item:QJ,EmptyItem:TJ,Loader:$J},TableHandle:{Root:NJ,ExtendButton:MJ},Comments:{Comment:VJ,Editor:HJ,Card:LJ,CardSection:RJ,ExpandSectionsPrompt:zJ},Versioning:{Sidebar:KJ,Header:qJ,Name:JJ,Snapshot:YJ,Loader:AJ},AttributionTooltip:{Root:jJ},Generic:{Badge:{Root:WJ,Group:GJ},Toolbar:{Root:PJ,Button:FJ,Select:IJ},Form:{Root:dq,TextInput:aJ},Menu:{Root:cJ,Trigger:lJ,Dropdown:uJ,Divider:fJ,Label:pJ,Item:dJ,Button:mJ},Popover:{Root:yJ,Trigger:bJ,Content:xJ}}},tY=e=>{let{className:t,shadCNComponents:n,...r}=e,i=(0,W.useMemo)(()=>({...nJ,...n}),[n]);return(0,G.jsx)(rJ.Provider,{value:i,children:(0,G.jsx)(Dp.Provider,{value:eY,children:(0,G.jsx)(HN,{className:gb(`bn-shadcn`,t||``),...r})})})},nY={"doc/data":de(_e({item:ce}),_e({data:fe(ye(),ve()),sources:le(ue({id:ye()})).optional()}),`The numbers a doc's charts read from the project's files (a sheet's table, a CSV, a data file of rows): what its editor draws them with.`),"doc/pages":de(_e({item:ce,width:he().min(100).max(2400).optional()}),_e({pages:le(_e({n:he().positive(),width:ge().positive(),height:ge().positive(),landscape:me(),image:pe})),blocks:le(_e({n:he().nonnegative(),places:le(_e({page:he().positive(),top:ge(),bottom:ge(),left:ge(),right:ge()}))}))}),"A doc's pages as render prints them, each a picture, and where each of its blocks lies on them: what its page view shows, measured as `allyhub inspect pages` measures them.")},rY=be(nY);function iY(e){let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=e=>typeof e==`string`&&e!==``?e:void 0;return t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,r=n(t.delta),i=n(t.note),a=Array.isArray(t.trend)?t.trend.filter(e=>typeof e==`number`):[];return[{label:typeof t.label==`string`?t.label:``,value:typeof t.value==`string`?t.value:``,...r===void 0?{}:{delta:r},...i===void 0?{}:{note:i},...t.downIsGood===!0?{downIsGood:!0}:{},...a.length<2?{}:{trend:a}}]})}function aY(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}function oY(e){if(typeof e==`string`)try{let t=JSON.parse(e);return typeof t.of!=`string`||t.of===``?void 0:{type:`component`,of:t.of,...typeof t.width==`number`?{width:t.width}:{},...typeof t.height==`number`?{height:t.height}:{},...typeof t.at==`number`?{at:t.at}:{},...typeof t.alt==`string`?{alt:t.alt}:{},...typeof t.caption==`string`?{caption:t.caption}:{},...t.align===`center`||t.align===`right`?{align:t.align}:{},props:Object.fromEntries(Object.entries(t.props??{}).filter(e=>typeof e[1]==`string`))}}catch{return}}function sY(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}var cY=[...Se,`none`];function lY(e){if(typeof e!=`string`)return;let t;try{t=JSON.parse(e)}catch{return}let n=t.kind;if(typeof n!=`string`||!xe.includes(n))return;let r=e=>typeof t[e]==`string`?{[e]:t[e]}:{},i=e=>typeof t[e]==`number`&&Number.isFinite(t[e])?{[e]:t[e]}:{},a=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:void 0,o=Array.isArray(t.table)?t.table.map(a):void 0,s=a(t.series),c=a(t.colors),l=a(t.labels)?.filter(e=>na.includes(e)),u=t.legend;return{type:`chart`,kind:n,...r(`title`),...o?.every(e=>e!==void 0)?{table:o}:{},...r(`data`),...r(`categories`),...s===void 0?{}:{series:s},...typeof u==`string`&&cY.includes(u)?{legend:u}:{},...l===void 0?{}:{labels:l},...r(`format`),...i(`min`),...i(`max`),...c===void 0?{}:{colors:c},...t.smooth===!0?{smooth:!0}:{},...i(`width`),...i(`height`),...r(`alt`),...r(`id`)}}var uY={[Ga.math]:`math`,[Ga.mermaid]:`diagram`},dY=`default`,fY=`💡`,pY={paragraph:`paragraph`,heading:`heading`,bullet:`bulletListItem`,numbered:`numberedListItem`,check:`checkListItem`,toggle:`toggleListItem`,quote:`quote`};function mY(e){let t=Object.keys(e).sort();return t.length===0?``:JSON.stringify(Object.fromEntries(t.map(t=>[t,e[t]])))}var hY=[`bold`,`italic`,`underline`,`strike`,`code`];function gY(e){if(typeof e!=`string`||e===``)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let n=t,r=n.color,i=n.background;return{...Object.fromEntries(hY.filter(e=>n[e]===!0).map(e=>[e,!0])),...typeof r==`string`?{color:r}:{},...typeof i==`string`?{background:i}:{}}}function _Y(e){let t=[];for(let n of e){if(n.cite!==void 0){t.push({type:`citation`,props:{cite:n.cite,styles:mY(n.styles)}});continue}if(n.text===``&&n.href?.startsWith(`#`)===!0){t.push({type:`reference`,props:{target:n.href.slice(1),styles:mY(n.styles)}});continue}if(n.note!==void 0){t.push({type:`footnote`,props:{label:n.note,styles:mY(n.styles),href:n.href??``}});continue}let e=n.styles,r={type:`text`,text:n.text,styles:{...e.bold?{bold:!0}:{},...e.italic?{italic:!0}:{},...e.underline?{underline:!0}:{},...e.strike?{strike:!0}:{},...e.code?{code:!0}:{},...e.color===void 0?{}:{textColor:e.color},...e.background===void 0?{}:{backgroundColor:e.background},...e.tag===void 0?{}:{tag:e.tag}}};if(n.href===void 0){t.push(r);continue}let i=t.at(-1);i?.type===`link`&&i.href===n.href?i.content.push(r):t.push({type:`link`,href:n.href,content:[r]})}return t}var vY=e=>({textAlignment:e?.align??`left`,textColor:e?.color??dY,backgroundColor:e?.background??dY});function yY(e){let t={...e};delete t.children;let n=JSON.stringify(t),r=2166136261;for(let e=0;e<n.length;e++)r=Math.imul(r^n.charCodeAt(e),16777619)>>>0;return r.toString(36)}var bY=new Map,xY=e=>e.type===`image`&&e.id!==void 0?{id:e.id}:e.type===`table`&&(e.id!==void 0||e.caption!==void 0)?{...e.id===void 0?{}:{id:e.id},...e.caption===void 0?{}:{caption:e.caption}}:void 0;function SY(e){let t=new Map,n=(e,r)=>e.map((e,i)=>{let a=r[i];if(!a)return e;let o=yY(a),s=t.get(o)??0;t.set(o,s+1);let c=`d${o}${s===0?``:`-${String(s)}`}`,l=xY(a);if(l&&bY.set(c,l),a.type===`columns`)return{...e,id:c,children:(e.children??[]).map((e,t)=>({...e,id:`${c}-c${String(t)}`,children:n(e.children??[],a.columns[t]?.blocks??[])}))};let u=`children`in a?a.children??[]:[];return{...e,id:c,...e.children?{children:n(e.children,u)}:{}}});return n(CY(e),e)}function CY(e){return e.map(e=>{switch(e.type){case`paragraph`:case`bullet`:case`toggle`:case`quote`:case`heading`:case`numbered`:case`check`:return{type:pY[e.type]??`paragraph`,props:{...vY(e.look),...e.type===`heading`?{level:e.level,isToggleable:e.toggle===!0}:{},...e.type===`numbered`&&e.start!==void 0?{start:e.start}:{},...e.type===`check`?{checked:e.checked}:{}},content:_Y(e.content),children:CY(e.children??[])};case`card`:return{type:`card`,props:{subtitle:e.subtitle??``},content:e.title===void 0?[]:[{type:`text`,text:e.title,styles:{}}],children:CY(e.children??[])};case`stats`:return{type:`stats`,props:{data:JSON.stringify(e.stats)}};case`callout`:return{type:`callout`,props:{icon:e.icon??``,textColor:e.look?.color??dY,backgroundColor:e.look?.background??dY},content:_Y(e.content),children:CY(e.children??[])};case`code`:{let t=e.language===void 0?void 0:uY[e.language];return t===void 0?{type:`codeBlock`,props:{language:e.language??`text`},content:[{type:`text`,text:e.code,styles:{}}]}:{type:t,props:{code:e.code}}}case`image`:return{type:`image`,props:{url:e.src,name:e.alt??``,caption:e.caption??``,textAlignment:e.align??`left`,...e.width===void 0?{}:{previewWidth:e.width}}};case`table`:{let t=Ya(e);return{type:`table`,content:{type:`tableContent`,headerRows:e.head===`none`||e.head===`column`?0:1,headerCols:+(e.head===`column`||e.head===`both`),columnWidths:Array.from({length:Math.max(0,...e.rows.map(e=>e.length))},(t,n)=>e.widths?.[n]??void 0),rows:e.rows.map(e=>({cells:e.map((e,n)=>t.size===0?_Y(e):{type:`tableCell`,props:t.has(n)?{textAlignment:`right`}:{},content:_Y(e)})}))}}}case`divider`:return{type:`divider`};case`pagebreak`:return{type:`pagebreak`,props:{orientation:e.orientation??``}};case`toc`:return{type:`toc`,props:{levels:e.levels??3,title:e.title??``,untitled:e.title===``}};case`bibliography`:return{type:`bibliography`};case`note`:return{type:`note`,props:{label:e.label},content:_Y(e.content),children:CY(e.children??[])};case`component`:return{type:`component`,props:{data:aY(e)}};case`chart`:return{type:`chart`,props:{data:sY(e)}};case`columns`:return{type:`columns`,children:e.columns.map(e=>({type:`column`,props:{width:e.width??1},children:CY(e.blocks)}))};case`embed`:case`source`:return{type:`embed`,props:{source:e.source}}}})}function wY(e){if(typeof e!=`number`||!Number.isFinite(e)||e<=0)return;let t=Math.round(e*100)/100;return t===1||t<=0?void 0:t}var TY=(e,t)=>JSON.stringify(e,Object.keys(e).sort())===JSON.stringify(t,Object.keys(t).sort());function EY(e){if(typeof e==`string`)return e===``?[]:[{text:e,styles:{}}];if(!Array.isArray(e))return[];let t=[],n=(e,n,r)=>{if(e===``)return;let i=t.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&TY(i.styles,n)?i.text+=e:t.push({text:e,styles:n,...r===void 0?{}:{href:r}})},r=(e,t)=>{if(e.text===``)return;let r=e.styles,i=typeof r.textColor==`string`?r.textColor:dY,a=typeof r.backgroundColor==`string`?r.backgroundColor:dY,o={...r.bold===!0?{bold:!0}:{},...r.italic===!0?{italic:!0}:{},...r.underline===!0?{underline:!0}:{},...r.strike===!0?{strike:!0}:{},...r.code===!0?{code:!0}:{},...i===dY?{}:{color:i},...a===dY?{}:{background:a},...typeof r.tag==`string`&&r.tag!==``?{tag:r.tag}:{}};n(e.text,o,t)};for(let n of e)if(n.type===`text`)r(n);else if(n.type===`link`)for(let e of n.content)r(e,n.href);else if(n.type===`citation`){let{cite:e,styles:r}=n.props;e!==``&&t.push({text:`[${e}]`,styles:gY(r),cite:e})}else if(n.type===`reference`){let{target:e,styles:r}=n.props;e!==``&&t.push({text:``,styles:gY(r),href:`#${e}`})}else{let{label:e,styles:r,href:i}=n.props;if(e===``)continue;t.push({text:e,styles:gY(r),note:e,...typeof i==`string`&&i!==``?{href:i}:{}})}return aa(t)}function DY(e){let t=e?.textAlignment,n=e?.textColor,r=e?.backgroundColor,i={...t===`center`||t===`right`||t===`justify`?{align:t}:{},...typeof n==`string`&&n!==dY?{color:n}:{},...typeof r==`string`&&r!==dY?{background:r}:{}};return Object.keys(i).length>0?{look:i}:{}}var OY=e=>{let t=AY(e.children??[]);return t.length>0?{children:t}:{}},kY=e=>e===2||e===3||e===4||e===5||e===6?e:1;function AY(e){let t=[];for(let n of e){let e=n.props??{};switch(n.type){case`paragraph`:t.push({type:`paragraph`,...DY(e),content:EY(n.content),...OY(n)});break;case`heading`:t.push({type:`heading`,level:kY(e.level),...e.isToggleable===!0?{toggle:!0}:{},...DY(e),content:EY(n.content),...OY(n)});break;case`bulletListItem`:t.push({type:`bullet`,...DY(e),content:EY(n.content),...OY(n)});break;case`numberedListItem`:{let r=e.start;t.push({type:`numbered`,...typeof r==`number`?{start:r}:{},...DY(e),content:EY(n.content),...OY(n)});break}case`checkListItem`:t.push({type:`check`,checked:e.checked===!0,...DY(e),content:EY(n.content),...OY(n)});break;case`toggleListItem`:t.push({type:`toggle`,...DY(e),content:EY(n.content),...OY(n)});break;case`quote`:t.push({type:`quote`,...DY(e),content:EY(n.content),...OY(n)});break;case`card`:{let r=EY(n.content).map(e=>e.text).join(``),i=e.subtitle;t.push({type:`card`,...r===``?{}:{title:r},...typeof i==`string`&&i!==``?{subtitle:i}:{},...OY(n)});break}case`stats`:{let n=e.data,r=iY(typeof n==`string`?n:``);r.length>0&&t.push({type:`stats`,stats:r});break}case`callout`:{let r=e.icon,i=DY(e);t.push({type:`callout`,...typeof r==`string`&&r!==``?{icon:r}:{},...i.look?.color!==void 0||i.look?.background!==void 0?{look:{...i.look.color===void 0?{}:{color:i.look.color},...i.look.background===void 0?{}:{background:i.look.background}}}:{},content:EY(n.content),...OY(n)});break}case`codeBlock`:{let r=e.language;t.push({type:`code`,...typeof r==`string`&&r!==``&&r!==`text`?{language:r}:{},code:EY(n.content).map(e=>e.text).join(``)});break}case`image`:{let r=e.url,i=e.name,a=e.caption;if(typeof r!=`string`||r===``)break;let o=e.previewWidth,s=e.textAlignment;t.push({type:`image`,src:r,...typeof i==`string`&&i!==``?{alt:i}:{},...typeof a==`string`&&a!==``?{caption:a}:{},...typeof o==`number`&&o>0?{width:Math.round(o)}:{},...s===`center`||s===`right`?{align:s}:{},...n.id===void 0?{}:bY.get(n.id)});break}case`table`:{let e=n.content;if(e===void 0||typeof e==`string`||Array.isArray(e))break;let r=(e.headerRows??0)>0,i=(e.headerCols??0)>0,a=(e.columnWidths??[]).map(e=>typeof e==`number`&&e>0?Math.round(e):null);t.push({type:`table`,rows:e.rows.map(e=>e.cells.map(e=>EY(Array.isArray(e)?e:e.content))),...r&&i?{head:`both`}:i?{head:`column`}:r?{}:{head:`none`},...a.some(e=>e!==null)?{widths:a}:{},...n.id===void 0?{}:bY.get(n.id)});break}case`divider`:t.push({type:`divider`});break;case`pagebreak`:{let n=e.orientation;t.push({type:`pagebreak`,...n===`landscape`||n===`portrait`?{orientation:n}:{}});break}case`bibliography`:t.push({type:`bibliography`});break;case`toc`:{let n=e.levels,r=e.title;t.push({type:`toc`,...typeof n==`number`&&n!==3?{levels:n}:{},...e.untitled===!0?{title:``}:typeof r==`string`&&r!==``?{title:r}:{}});break}case`note`:{let r=e.label;t.push({type:`note`,label:typeof r==`string`?r:``,content:EY(n.content),...OY(n)});break}case`embed`:{let n=e.source;typeof n==`string`&&n!==``&&t.push({type:`embed`,source:n});break}case`component`:{let n=oY(e.data);n&&t.push(n);break}case`chart`:{let n=lY(e.data);n&&t.push(n);break}case`math`:case`diagram`:{let r=e.code;t.push({type:`code`,language:n.type===`math`?Ga.math:Ga.mermaid,code:typeof r==`string`?r:``});break}case`columns`:{let e=(n.children??[]).filter(e=>e.type===`column`).map(e=>{let t=wY(e.props?.width);return{...t===void 0?{}:{width:t},blocks:AY(e.children??[]).flatMap(e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):[e])}});e.length<2?t.push(...e.flatMap(e=>e.blocks)):t.push({type:`columns`,columns:e});break}}}return t.map((e,n)=>{if(e.type!==`numbered`||e.start!==1||t[n-1]?.type===`numbered`)return e;let r={...e};return delete r.start,r})}var jY=40,MY=5;function NY(e,t,n=0){if(t===``)return;let r=t.slice(0,jY),i=e.indexOf(r);for(let t=0;t<n&&i>=0;t++)i=e.indexOf(r,i+r.length);return i<0?void 0:e.slice(0,i).split(`
|
|
268
|
-
`).length}function PY(e){let t=document.createRange();t.selectNodeContents(e);let n=[...t.getClientRects()];return n.length>0?n:[e.getBoundingClientRect()]}function FY(e,t,n,r,i){let a=[];for(let o of IY(e,n,r,i))if((o.blank?[o.block.getBoundingClientRect()]:PY(o.block)).some(e=>b(t,e))&&(a.push(o.element),a.length===MY))break;return a}function IY(e,t,n,r){let i=new Map;return[...e.querySelectorAll(`.bn-block-content`)].map(e=>{let a=e.textContent.trim(),o=a===``?r?.(e):void 0,s=o?.written??a,c=i.get(s)??0;i.set(s,c+1);let l=NY(n,s,c);return{block:e,blank:o!==void 0,element:{name:o?.name??`the block`,source:{path:t,...l===void 0?{}:{line:l}},...a===``?{}:{text:a}}}})}var LY=.5;function RY(e){let t=[];for(let n of e){if(n.width<=0||n.height<=0)continue;let e=t.find(e=>Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y)>Math.min(e.height,n.height)*LY);if(!e){t.push({x:n.x,y:n.y,width:n.width,height:n.height});continue}let r=Math.max(e.x+e.width,n.x+n.width),i=Math.max(e.y+e.height,n.y+n.height);e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=r-e.x,e.height=i-e.y}return t.map(e=>[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}])}var zY=3;function BY(e,t){let n=(t?[]:PY(e)).filter(e=>e.width>0&&e.height>0),r=n.length>0?n:[e.getBoundingClientRect()],i=Math.min(...r.map(e=>e.left))-zY,a=Math.min(...r.map(e=>e.top))-zY,o=Math.max(...r.map(e=>e.right))+zY,s=Math.max(...r.map(e=>e.bottom))+zY;return o>i&&s>a?[[{x:i,y:a},{x:o,y:a},{x:o,y:s},{x:i,y:s}]]:[]}function VY(e,t,n,r,i){let a=e=>t.x>=e.left&&t.x<=e.right&&t.y>=e.top&&t.y<=e.bottom,o=IY(e,n,r,i),s=o.findLast(e=>(e.blank?[e.block.getBoundingClientRect()]:PY(e.block)).some(a))??o.findLast(e=>a(e.block.getBoundingClientRect()));if(!s)return;let c=BY(s.block,s.blank);return c.length>0?{element:s.element,outline:c}:void 0}var HY=120;function UY(e,t,n,r,i){if(!t||t.collapsed)return[];let a=[];for(let o of IY(e,n,r,i)){if(!t.intersectsNode(o.block))continue;let e=t.cloneRange();o.block.contains(t.startContainer)||e.setStart(o.block,0),o.block.contains(t.endContainer)||e.setEnd(o.block,o.block.childNodes.length);let n=e.toString().trim(),r=n===(o.element.text??``);if(n===``&&!o.blank)continue;let i=o.blank?BY(o.block,!0):RY(e.getClientRects());i.length!==0&&a.push({element:r||o.blank?o.element:{...o.element,name:`the words ${JSON.stringify(n.slice(0,HY))} of the block`},outline:i})}return a}function WY(e){let{children:t,...n}=e;return delete n.id,{...n,...t?{children:t.map(WY)}:{}}}var GY=e=>Array.isArray(e.content)?e.content.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):e.type===`footnote`?e.props.label:e.type===`citation`?`[${e.props.cite}]`:``).join(``):``;function KY(e){let t=e.getSelection()?.blocks??[];return t.length>0?t:[e.getTextCursorPosition().block]}var qY=`.doc-scroll, .doc-body, .doc-column, .doc-title-row, .bn-container`,JY=`.doc-slash-menu, .bn-suggestion-menu, .bn-grid-suggestion-menu`;function YY(e,t){let n=document.createRange();n.selectNodeContents(e);let r=Array.from(n.getClientRects()),i=r[0];if(!i)return!0;let a=window.getSelection(),o=a&&a.rangeCount>0?a.getRangeAt(0).getClientRects()[0]:void 0;return o?o.top-i.top<i.height*.6:t||r.every(e=>Math.abs(e.top-i.top)<4)}function XY(e,t,n={}){let{onActions:r,onTitle:i}=n;(0,W.useEffect)(()=>{let n=t.current;if(!n)return;let a=e._tiptapEditor.view,o=a.dom,s=()=>{let t=window.getSelection();if(!t?.focusNode||!t.anchorNode||a.composing)return;let n=e=>o.contains(e)&&(e instanceof Element?e:e.parentElement)?.closest(`.bn-inline-content`)!=null;if(!n(t.focusNode)||!n(t.anchorNode))return;let r=a.state.selection;if(r.toJSON().type===`text`)try{let n=a.posAtDOM(t.anchorNode,t.anchorOffset),i=a.posAtDOM(t.focusNode,t.focusOffset);if(n===r.anchor&&i===r.head)return;e._tiptapEditor.commands.setTextSelection({from:Math.min(n,i),to:Math.max(n,i)})}catch{}},c=(t,n)=>{try{if(t!==n)return e.setSelection(t,n),!0;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(t)}"] .bn-inline-content`);return r?(e._tiptapEditor.commands.setTextSelection({from:a.posAtDOM(r,0),to:a.posAtDOM(r,r.childNodes.length)}),!0):!1}catch{return!1}},l=t=>{if(t.isComposing)return;s();let n=t.metaKey||t.ctrlKey;if(i&&!n&&!t.shiftKey&&!t.altKey&&(t.key===`ArrowUp`||t.key===`Backspace`)&&!document.querySelector(JY)){let n=e.getTextCursorPosition().block,r=e.document[0],s=a.state.selection,c=r?.id!==void 0&&n.id===r.id?o.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-inline-content`):null;if(r?.id!==void 0&&c&&s.anchor===s.head&&s.toJSON().type===`text`){let o=s.head===a.posAtDOM(c,0);if(t.key===`ArrowUp`&&YY(c,o)){t.preventDefault(),t.stopPropagation(),i();return}if(t.key===`Backspace`&&o&&n.type===`paragraph`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();let a=GY(n);e.document.length>1?e.removeBlocks([r.id]):a!==``&&e.updateBlock(r.id,{type:`paragraph`,content:[]}),i(a);return}}}if(t.key===` `&&!n&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type===`paragraph`&&n.id!==void 0&&GY(n)===`"`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation(),e.updateBlock(n.id,{type:`quote`,content:[]});return}if(n.type===`paragraph`&&n.id!==void 0&&GY(n)===`>`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();try{window.localStorage.setItem(`toggle-${n.id}`,`true`)}catch{}e.updateBlock(n.id,{type:`toggleListItem`,content:[]})}}else if(t.key===`Enter`&&!n&&!t.shiftKey&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type!==`callout`||n.id===void 0||GY(n)===``)return;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"] .bn-inline-content`),i=a.state.selection;if(!r||i.anchor!==i.head||i.head!==a.posAtDOM(r,r.childNodes.length))return;t.preventDefault(),t.stopPropagation();let s=n.children?.[0];s?.id===void 0?e.updateBlock(n.id,{type:n.type,children:[{type:`paragraph`}]}):e.insertBlocks([{type:`paragraph`}],s.id,`before`);let c=e.getBlock(n.id)?.children?.[0];c?.id!==void 0&&e.setTextCursorPosition(c.id,`start`)}else if(t.key===`Escape`&&!n&&!document.querySelector(JY)){let n=e.getTextCursorPosition().block;(e.getSelection()?.blocks??[]).length===0&&n.id!==void 0&&c(n.id,n.id)&&t.preventDefault()}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`d`){let n=KY(e),r=n.at(-1);if(r?.id===void 0)return;t.preventDefault(),t.stopPropagation(),e.insertBlocks(n.map(WY),r.id,`after`)}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`/`){let n=e.getTextCursorPosition().block;if(n.id===void 0||!r)return;t.preventDefault(),t.stopPropagation(),r(n.id)}},u=()=>Array.from(o.querySelectorAll(`:scope > .bn-block-group > .bn-block-outer`)).map(e=>({id:e.getAttribute(`data-id`)??``,box:e.getBoundingClientRect()})),d=(t,n)=>{let r=u(),a=r.at(-1);if(!a){e.focus();return}if(i&&r[0]&&n<r[0].box.top){i();return}let o=r.find(e=>n>=e.box.top&&n<=e.box.bottom),s=o??(n<(r[0]?.box.top??0)?r[0]:a);if(s){try{e.setTextCursorPosition(s.id,o&&t<s.box.left?`start`:`end`)}catch{}e.focus()}},f,p=e=>{if(!f)return;let t=e.clientX-f.x,n=e.clientY-f.y;if(!f.box&&Math.hypot(t,n)<6)return;f.box||(f.box=document.createElement(`div`),f.box.className=`doc-marquee`,document.body.append(f.box));let r=Math.min(f.y,e.clientY),i=Math.max(f.y,e.clientY);Object.assign(f.box.style,{left:`${String(Math.min(f.x,e.clientX))}px`,top:`${String(r)}px`,width:`${String(Math.abs(t))}px`,height:`${String(Math.abs(n))}px`});let a=u().filter(e=>e.box.bottom>=r&&e.box.top<=i),o=a[0],s=a.at(-1);o&&s&&c(o.id,s.id)},m=t=>{let n=f;f=void 0,window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),n?.box?(n.box.remove(),e.focus()):n&&d(t.clientX,t.clientY)},h=e=>{if(e.button!==0)return;let t=e.target;t&&!o.contains(t)&&t.matches(qY)&&(e.preventDefault(),f={x:e.clientX,y:e.clientY,box:void 0},window.addEventListener(`mousemove`,p),window.addEventListener(`mouseup`,m))};return o.addEventListener(`keydown`,l,!0),n.addEventListener(`mousedown`,h),()=>{o.removeEventListener(`keydown`,l,!0),n.removeEventListener(`mousedown`,h),window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),f?.box?.remove()}},[e,r,i,t])}var ZY=/^([a-z][a-z0-9+.-]*:|\/\/|#)/i;function QY(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.slice(i).map(()=>`..`),o=[...a,...r.slice(i)].join(`/`);return a.length===0?`./${o}`:o}var $Y=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`))),eX=e=>e.slice(e.lastIndexOf(`/`)+1);function tX(e,t){if(ZY.test(t))return;let n=t.split(/[?#]/)[0]??``,r;try{r=decodeURIComponent(n)}catch{return}let i=[];for(let t of`${e}/${r}`.split(`/`))if(t!==``&&t!==`.`){if(t!==`..`)i.push(t);else if(i.pop()===void 0)return}return i.length===0?void 0:i.join(`/`)}function nX(e,t){let n=$Y(e);return t.filter(t=>t.entry!==e).map(e=>({title:e.title??eX(On(e.entry)),href:QY(n,e.entry),kind:e.kind,place:e.dir}))}var rX=(e,t)=>tX($Y(e),t);async function iX(e){let t=await fetch(e);if(!t.ok)return;let n=await t.blob(),r=new FileReader,i=await new Promise((t,i)=>{r.onload=()=>{t(typeof r.result==`string`?r.result:``)},r.onerror=()=>{i(Error(`The picture at ${e} could not be read.`))},r.readAsDataURL(n)}),a=i.indexOf(`,`),o=/^data:([^;,]+)/u.exec(i)?.[1];return o===void 0||a<0?void 0:{mime:o,data:i.slice(a+1)}}var aX=(0,W.createContext)(void 0);function oX({data:e,onData:t}){let n=(0,W.useContext)(aX),r=a(),i=oY(e),o=i?ga(i):void 0,c=Ne(n?.item,void 0,o!==void 0),l=ke(n?.item,void 0,c===void 0&&o?[o]:[]),u=(0,W.useRef)(null),d=(0,W.useRef)(void 0),[f,p]=(0,W.useState)(),[m,h]=(0,W.useState)(),[g,_]=(0,W.useState)(!1),v=JSON.stringify(o);(0,W.useEffect)(()=>{let e=u.current;if(!e||!c||!o)return;if(d.current?.url===c.url){d.current.mounted.draw(o);return}let t=d.current?.mounted,n=je(e,c,o,{onDrawn:e=>{t?.remove(),h(void 0),e&&p(e)},onError:e=>{t?.remove(),h(e)}});d.current={url:c.url,mounted:n,...t?{old:t}:{}}},[c,v]);let y=()=>{let e=u.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0};if(s({element:()=>c&&o?u.current:void 0,pictures:async()=>{let e=y();if(!e||!o||n===void 0)return[];let t=(await En(r,`components/stills`,{item:n.item,components:[{...o}]}).catch(()=>void 0))?.stills[0]?.url,i=t===void 0?void 0:await iX(t).catch(()=>void 0);return i?[{rect:e,...i}]:[]},locate:()=>{if(!i||n===void 0)return Promise.resolve({elements:[]});let e=i.of.split(`#`)[0]??i.of,t=tX($Y(n.path),e)??e;return Promise.resolve({elements:[{name:`the component ${ha(i)}`,source:{path:t},...i.alt===void 0?{}:{text:i.alt}}]})}}),(0,W.useEffect)(()=>()=>{d.current?.old?.remove(),d.current?.mounted.remove(),d.current=void 0},[]),!i||!o)return(0,G.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,G.jsx)($r,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:n?.words?.embed})]});let b=c===void 0?l.get(JSON.stringify(o)):void 0,x=(0,G.jsxs)(`div`,{ref:u,className:`doc-component-frame`,style:{width:`min(100%, ${String(o.width)}px)`,aspectRatio:`${String(o.width)} / ${String(o.height)}`},children:[b!==void 0&&(0,G.jsx)(`img`,{src:b,alt:i.alt??``,className:`doc-component-still`}),m!==void 0&&(0,G.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,G.jsx)($r,{size:16,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:ha(i)}),(0,G.jsx)(`span`,{className:`doc-component-error-text`,children:m})]})]}),S=!n?.readOnly&&f!==void 0&&Object.keys(f.props).length>0;return(0,G.jsxs)(`figure`,{contentEditable:!1,"data-doc-component":``,className:`doc-component`,style:i.align===void 0?void 0:{textAlign:i.align},children:[(0,G.jsxs)(Xe,{open:S&&g,onOpenChange:_,children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":ha(i),disabled:!S,children:x})}),S&&(0,G.jsx)(qe,{align:`start`,className:`w-72`,children:(0,G.jsx)(Fe,{types:f.props,values:i.props,locale:n?.locale??`en`,onChange:(e,n)=>{let r=Object.fromEntries(Object.entries(i.props).flatMap(([t,r])=>t===e?n===void 0?[]:[[t,n]]:[[t,r]]));n!==void 0&&!(e in r)&&(r[e]=n),t(aY({...i,props:r}))}})})]}),i.caption!==void 0&&(0,G.jsx)(`figcaption`,{children:i.caption})]})}var sX=QN({type:`component`,propSchema:{data:{default:``}},content:`none`},{render:e=>(0,G.jsx)(oX,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}),cX=`--doc-col-gap`,lX=`--doc-col-share`,uX=80,dX=e=>Math.round(e*100)/100,fX=e=>wY(e?.props?.width)??1;function pX({editor:e,id:t}){let n=nj(VE),r=(0,W.useRef)(null);return(0,W.useEffect)(()=>{let e=e=>{e.target===r.current&&(e.stopPropagation(),n.hideMenuIfNotFrozen())};return window.addEventListener(`mousemove`,e,!0),()=>{window.removeEventListener(`mousemove`,e,!0)}},[n]),(0,G.jsx)(`div`,{ref:r,contentEditable:!1,className:`doc-col-sizer`,onPointerDown:n=>{if(n.button!==0)return;let r=e.getParentBlock(t)?.children??[],i=r.findIndex(e=>e.id===t),a=r[i-1],o=n.currentTarget.parentElement,s=o?.closest(`.doc-cols`)?.querySelector(`[data-doc-col="${CSS.escape(a?.id??``)}"]`);if(!a?.id||!o||!s)return;n.preventDefault();let c=n.currentTarget;c.setPointerCapture(n.pointerId);let l=s.getBoundingClientRect().width,u=o.getBoundingClientRect().width,d=fX(a)+fX(r[i]),f=n.clientX,p=[fX(a),fX(r[i])],m=e=>{let t=Math.min(Math.max(l+e.clientX-f,uX),l+u-uX),n=dX(d*t/(l+u));p=[n,dX(d-n)],s.style.setProperty(lX,String(p[0])),o.style.setProperty(lX,String(p[1]))},h=()=>{c.removeEventListener(`pointermove`,m),c.removeEventListener(`pointerup`,h),c.removeEventListener(`pointercancel`,h),c.removeAttribute(`data-dragging`),s.style.setProperty(lX,String(fX(a))),o.style.setProperty(lX,String(fX(r[i])));let[n,l]=p;(n!==fX(a)||l!==fX(r[i]))&&e.transact(()=>{e.updateBlock(a.id??``,{type:`column`,props:{width:n}}),e.updateBlock(t,{type:`column`,props:{width:l}})})};c.setAttribute(`data-dragging`,``),c.addEventListener(`pointermove`,m),c.addEventListener(`pointerup`,h),c.addEventListener(`pointercancel`,h)},"aria-hidden":!0})}var mX=QN({type:`columns`,propSchema:{},content:`none`,layoutOnly:!0,children:{allow:[`column`],min:2}},{renderFrame:e=>(0,G.jsx)(`div`,{className:`doc-cols`,style:{[cX]:`32px`},ref:e.slotRef})});function hX({editor:e,id:t,width:n,slotRef:r}){let i=(0,W.useContext)(aX)?.readOnly??!1,a=fp({editor:e,selector:()=>e.getParentBlock(t)?.children?.[0]?.id===t});return(0,G.jsxs)(`div`,{className:`doc-col`,"data-doc-col":t,style:{[lX]:String(n)},children:[!a&&!i&&e.isEditable&&(0,G.jsx)(pX,{editor:e,id:t}),(0,G.jsx)(`div`,{className:`doc-col-blocks`,ref:r})]})}var gX=QN({type:`column`,propSchema:{width:{default:1}},content:`none`,layoutOnly:!0,placeable:`namedOnly`,children:{exclude:[`columns`]}},{renderFrame:e=>(0,G.jsx)(hX,{editor:e.editor,id:e.block.id,width:e.block.props.width,slotRef:e.slotRef})});function _X(e,t){for(let n=e.getParentBlock(t);n;n=n.id===void 0?void 0:e.getParentBlock(n.id))if(n.type===`column`)return!0;return!1}function vX(e,t){let n=e;return fp({editor:e,selector:()=>{let e=n.getParentBlock(t);for(;e?.id!==void 0&&e.type!==`column`;)e=n.getParentBlock(e.id);if(e?.type!==`column`||e.id===void 0)return;let r=n.getParentBlock(e.id),i=(r?.children??[]).map(e=>({width:fX(e),blocks:[]}));return Ra({columns:i})[i.length===0?0:(r?.children??[]).findIndex(t=>t.id===e.id)]}})}var yX=(0,W.createContext)({page:{},base:``,data:void 0,wantData:()=>void 0,dark:!1}),bX=e=>no(e).text,xX=[`bottom`,`top`,`left`,`right`,`none`];function SX(e){return{type:`chart`,kind:`column-clustered`,table:[[``,e.series(1),e.series(2)],[e.category(1),`4`,`3`],[e.category(2),`6`,`5`],[e.category(3),`5`,`7`]]}}var CX=e=>Math.max(0,...e.map(e=>e.length)),wX=(e,t,n,r)=>e.map((e,i)=>i===t?Array.from({length:Math.max(e.length,n+1)},(t,i)=>i===n?r:e[i]??``):[...e]),TX=(e,t)=>[...e.map(e=>[...e]),[t.category(e.length),...Array.from({length:CX(e)-1},()=>``)]],EX=(e,t)=>{let n=CX(e);return e.map((e,r)=>[...Array.from({length:n},(t,n)=>e[n]??``),r===0?t.series(n):``])},DX=(e,t)=>e.length<=2||t<1?e.map(e=>[...e]):e.filter((e,n)=>n!==t).map(e=>[...e]),OX=(e,t)=>CX(e)<=2||t<1?e.map(e=>[...e]):e.map(e=>e.filter((e,n)=>n!==t));function kX(e){let[t,n]=(0,W.useState)(e.text),r=()=>{t!==e.text&&e.onCommit(t)},i=(t,n)=>{t.preventDefault(),r(),t.currentTarget.closest(`table`)?.querySelector(`[data-row="${String(e.row+n)}"][data-col="${String(e.col)}"]`)?.focus()};return(0,G.jsx)(`input`,{value:t,"aria-label":e.label,"data-row":e.row,"data-col":e.col,spellCheck:!1,className:N(`text-dense h-7 w-full min-w-14 bg-transparent px-1.5 outline-none`,`focus:bg-sheet focus:outline-pencil focus:outline-1 focus:-outline-offset-1`,e.row>0&&e.col>0&&`text-right tabular-nums`,(e.row===0||e.col===0)&&`font-medium`),onChange:e=>{n(e.target.value)},onFocus:t=>{t.target.select(),e.onFocus()},onBlur:r,onKeyDown:r=>{r.key===`Escape`&&t!==e.text?(r.preventDefault(),r.stopPropagation(),n(e.text)):r.key===`Enter`?i(r,r.shiftKey?-1:1):r.key===`ArrowDown`?i(r,1):r.key===`ArrowUp`&&i(r,-1)}})}function AX({table:e,w:t,sample:n,remove:r,onTable:i}){let[a,o]=(0,W.useState)(),s=CX(e);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`div`,{className:`border-rule max-h-56 overflow-auto rounded-md border`,children:(0,G.jsx)(`table`,{className:`w-full border-collapse`,children:(0,G.jsx)(`tbody`,{children:e.map((n,r)=>(0,G.jsx)(`tr`,{className:N(`border-rule border-b last:border-b-0`,r===0&&`bg-paper`),children:Array.from({length:s},(a,s)=>{let c=n[s]??``;return(0,G.jsx)(`td`,{className:`border-rule border-l p-0 first:border-l-0`,children:(0,G.jsx)(kX,{row:r,col:s,text:c,label:t.cell(r+1,s+1),onCommit:t=>{i(wX(e,r,s,t))},onFocus:()=>{o({row:r,col:s})}},c)},s)})},r))})})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsx)(Wn,{icon:!0,"aria-label":t.addCategory,title:t.addCategory,onClick:()=>{i(TX(e,n))},children:(0,G.jsx)(Oe,{})}),(0,G.jsx)(Wn,{icon:!0,"aria-label":t.addSeries,title:t.addSeries,onClick:()=>{i(EX(e,n))},children:(0,G.jsx)(De,{})}),(0,G.jsxs)(Bn,{children:[(0,G.jsx)(Sn,{asChild:!0,children:(0,G.jsx)(Wn,{icon:!0,"aria-label":r,title:r,children:(0,G.jsx)(hn,{})})}),(0,G.jsxs)(Mn,{align:`start`,className:`text-sm`,children:[(0,G.jsx)(Tn,{disabled:e.length<=2,onSelect:()=>{i(DX(e,a&&a.row>0?a.row:e.length-1)),o(void 0)},children:t.deleteCategory}),(0,G.jsx)(Tn,{disabled:s<=2,onSelect:()=>{i(OX(e,a&&a.col>0?a.col:s-1)),o(void 0)},children:t.deleteSeries})]})]})]})]})}function jX({block:e,legend:t,problems:n,words:r,onChange:i}){let a=r.chart,o=e.labels?.includes(`value`)===!0,[s,...c]=e.table??[],l=s?.length===2&&/^(column|bar)-/u.test(e.kind)?c.map(e=>e[0]??``):[],u=t=>{let n=e.colors?.[t];return n!==void 0&&qX.includes(n)?n:`default`},[d,f]=(0,W.useState)(e.title??``),p=t=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(Pn,{value:e.kind,onValueChange:t=>{i({...e,kind:t})},children:[(0,G.jsx)(kn,{size:`sm`,className:`w-full`,"aria-label":a.type,children:(0,G.jsx)(Fn,{})}),(0,G.jsx)(Dn,{children:xe.map(e=>(0,G.jsx)(Rn,{value:e,children:a.types[e]},e))})]}),(0,G.jsx)(jn,{value:d,placeholder:a.title,"aria-label":a.title,className:`h-8 text-sm`,onChange:t=>{f(t.target.value),i(t.target.value===``?p(`title`):{...e,title:t.target.value})}}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:a.legend}),(0,G.jsxs)(Pn,{value:t,onValueChange:t=>{i({...e,legend:t})},children:[(0,G.jsx)(kn,{size:`sm`,"aria-label":a.legend,children:(0,G.jsx)(Fn,{})}),(0,G.jsx)(Dn,{children:xX.map(e=>(0,G.jsx)(Rn,{value:e,children:a.legendAt[e]},e))})]}),(0,G.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:a.dataLabels}),(0,G.jsx)(_n,{size:`sm`,checked:o,onCheckedChange:t=>{let n=(e.labels??[]).filter(e=>e!==`value`),r=t?[`value`,...n]:n;i(r.length===0?p(`labels`):{...e,labels:[...r]})}})]})]}),Ta.has(e.kind)&&(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:a.smooth}),(0,G.jsx)(_n,{size:`sm`,checked:e.smooth===!0,onCheckedChange:t=>{i(t?{...e,smooth:!0}:p(`smooth`))}})]}),l.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:a.barColors}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:l.map((t,n)=>(0,G.jsxs)(Pn,{value:u(n),onValueChange:t=>{let r=l.map((e,r)=>r===n?t:u(r));i(r.every(e=>e==="default")?p(`colors`):{...e,colors:r})},children:[(0,G.jsxs)(kn,{size:`sm`,"aria-label":t,children:[(0,G.jsx)(`span`,{className:`truncate`,children:t}),(0,G.jsx)(Fn,{})]}),(0,G.jsxs)(Dn,{children:[(0,G.jsx)(Rn,{value:`default`,children:r.defaultColor}),qX.map(e=>(0,G.jsx)(Rn,{value:e,children:r.colorNames[e]},e))]})]},n))})]}),e.table===void 0?(0,G.jsx)(`p`,{className:`text-lead text-xs`,children:a.fromFile(e.data??``)}):(0,G.jsx)(AX,{table:e.table,w:a,sample:r.sample,remove:r.remove,onTable:t=>{i({...e,table:t})}}),n.length>0&&(0,G.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-24 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:n.join(`
|
|
269
|
-
`)})]})}function MX({data:e,room:t,onData:n}){let r=(0,W.useContext)(aX),i=(0,W.useContext)(yX),[a,o]=(0,W.useState)(!1),s=(0,W.useMemo)(()=>lY(e),[e]),c=s?.data!==void 0,{wantData:l}=i;(0,W.useEffect)(()=>{c&&l()},[c,l]);let u=c&&i.data===void 0,d=(0,W.useMemo)(()=>({page:i.page,base:i.base,data:e=>i.data?.[e],font:bX(i.page),dark:i.dark,...t===void 0?{}:{room:t}}),[i.page,i.base,i.data,i.dark,t]),f=(0,W.useMemo)(()=>s===void 0||u?void 0:Pa(s,d),[s,u,d]),p=r?.words;if(!s||!p)return(0,G.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,G.jsx)(Ue,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:p?.embed})]});let m=Da(s,t),h=!r.readOnly,g=s.legend??(a?ja(s,d).chart?.legend??`none`:`none`);return(0,G.jsx)(`figure`,{contentEditable:!1,"data-doc-chart":``,className:`doc-component`,children:(0,G.jsxs)(Xe,{open:h&&a,onOpenChange:o,children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":s.alt??s.title??p.blocks.chart,disabled:!h,children:(0,G.jsx)(`div`,{className:`doc-component-frame doc-chart-frame`,style:{width:`min(100%, ${String(m.width)}px)`,aspectRatio:`${String(m.width)} / ${String(m.height)}`},children:u?(0,G.jsx)(`div`,{className:`doc-chart-waiting`,children:p.chart.notHere(s.data??``)}):f?.svg===void 0?(0,G.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,G.jsx)(Ue,{size:16,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:p.chart.cannotDraw}),(0,G.jsx)(`span`,{className:`doc-component-error-text`,children:f?.problems.join(`
|
|
270
|
-
`)})]}):(0,G.jsx)(`div`,{className:`doc-chart-svg`,dangerouslySetInnerHTML:{__html:f.svg}})})})}),h&&(0,G.jsx)(qe,{align:`start`,className:`w-[min(26rem,calc(100vw-2rem))]`,children:(0,G.jsx)(jX,{block:s,legend:g,problems:f?.svg===void 0?[]:f.problems,words:p,onChange:e=>{n(sY(e))}})})]})})}var NX=QN({type:`chart`,propSchema:{data:{default:``}},content:`none`},{render:function(e){return(0,G.jsx)(MX,{data:e.block.props.data,room:vX(e.editor,e.block.id),onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}}),PX=e=>e.map(e=>e.note===void 0?e.text:``).join(``);function FX(e){let t=new Map;for(let n of da(e)){if(n.type!==`note`)continue;let e=[...da(n.children??[])].flatMap(e=>`content`in e?[PX(e.content)]:[]),r=n.label.toLowerCase();t.has(r)||t.set(r,[PX(n.content),...e].filter(e=>e!==``).join(` `))}return{numbers:fa(e),words:t}}var IX=(e,t)=>JSON.stringify([[...e.numbers],[...e.words]])===JSON.stringify([[...t.numbers],[...t.words]]);function LX(e){let t=0,n=e=>{/^\d+$/.test(e)&&(t=Math.max(t,Number(e)))};for(let t of da(e)){t.type===`note`&&n(t.label);let e=`content`in t?[t.content]:t.type===`table`?t.rows.flat():[];for(let t of e.flat())t.note!==void 0&&n(t.note)}return String(t+1)}function*RX(e){for(let t of e)yield t,yield*RX(t.children??[])}function zX(e,t){let n=t.toLowerCase();for(let t of RX(e)){let e=t.props?.label;if(t.type===`note`&&typeof e==`string`&&e.toLowerCase()===n)return t}}function BX(e,t){let n=fa(AY(e)),r=t.map(e=>({label:e,n:n.get(e.toLowerCase())??0})).sort((e,t)=>t.n-e.n);for(let{label:t}of r){let n=zX(e,t)?.id;if(n!==void 0)return{id:n,placement:`after`}}let i=[...RX(e)].find(e=>e.type===`note`)?.id;if(i!==void 0)return{id:i,placement:`before`};let a=e.at(-1)?.id;return a===void 0?void 0:{id:a,placement:`after`}}function VX(e){let{doc:t,selection:n}=e._tiptapEditor.state,r=[];return t.nodesBetween(0,n.from,(e,t)=>{if(e.type.name===`note`)return!1;let i=e.attrs.label;return e.type.name===`footnote`&&t<n.from&&typeof i==`string`&&r.push(i),!0}),r}function HX(e){let t=LX(AY(e.document)),n=BX(e.document,VX(e));e.transact(()=>{e.insertInlineContent([{type:`footnote`,props:{label:t}}],{updateSelection:!0}),n!==void 0&&e.insertBlocks([{type:`note`,props:{label:t}}],n.id,n.placement)});let r=zX(e.document,t);r?.id!==void 0&&(e.setTextCursorPosition(r.id,`end`),e.focus())}var UX={bold:`bold`,italic:`italic`,underline:`underline`,strike:`strike`,code:`code`,textColor:`color`,backgroundColor:`background`};function WX(e){let t=[];return e.forEach((n,r)=>{n.steps.forEach((i,a)=>{let o=i.toJSON();if(o.stepType!==`addMark`&&o.stepType!==`removeMark`||o.from===void 0||o.to===void 0||o.mark?.type===void 0)return;let s=n.mapping.slice(a+1);for(let t of e.slice(r+1))s.appendMapping(t.mapping);t.push({from:s.map(o.from,1),to:s.map(o.to,-1),add:o.stepType===`addMark`,type:o.mark.type,attrs:o.mark.attrs??{}})})}),t}function GX(e,t){let n=typeof e.href==`string`?e.href:``,r=gY(e.styles);if(t.type===`link`){let e=t.add?t.attrs.href:``;return{styles:mY(r),href:typeof e==`string`?e:``}}let i=UX[t.type];if(i===void 0)return;let a=Object.fromEntries(Object.entries(r).filter(([e])=>e!==i)),o=a;if(t.add&&(i===`color`||i===`background`)){let e=t.attrs.stringValue;if(typeof e!=`string`)return;e!=="default"&&(o={...a,[i]:e})}else t.add&&(o={...a,[i]:!0});return{styles:mY(o),href:n}}var KX=k_(({editor:e})=>({key:`docFootnotes`,keyboardShortcuts:{"Mod-Alt-f":()=>(HX(e),!0)},prosemirrorPlugins:[new Nr({appendTransaction(e,t,n){let r=WX(e);if(r.length===0)return null;let i=n.tr;for(let e of r)e.from>=e.to||i.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.type.name!==`footnote`)return!0;let r=GX(t.attrs,e);return r&&(r.styles!==t.attrs.styles||r.href!==t.attrs.href)&&i.setNodeMarkup(n,void 0,{...t.attrs,...r}),!1});return i.docChanged?i:null}})]}))(),qX=[`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`];function JX(e){return{type:`columns`,children:Array.from({length:e},()=>({type:`column`,children:[{type:`paragraph`}]}))}}var YX=[{key:`paragraph`,icon:Ae,aliases:[`text`,`p`,`正文`,`文字`,`段落`],block:{type:`paragraph`}},{key:`heading1`,hint:`#`,icon:Hr,aliases:[`h1`,`title`,`标题`,`一级`],block:{type:`heading`,props:{level:1}}},{key:`heading2`,hint:`##`,icon:Ur,aliases:[`h2`,`标题`,`二级`],block:{type:`heading`,props:{level:2}}},{key:`heading3`,hint:`###`,icon:Wr,aliases:[`h3`,`标题`,`三级`],block:{type:`heading`,props:{level:3}}},{key:`bullet`,hint:`-`,icon:mt,aliases:[`ul`,`list`,`bullet`,`列表`,`无序`],block:{type:`bulletListItem`}},{key:`numbered`,hint:`1.`,icon:ht,aliases:[`ol`,`list`,`number`,`列表`,`有序`,`编号`],block:{type:`numberedListItem`}},{key:`check`,hint:`[]`,icon:Jr,aliases:[`todo`,`task`,`checkbox`,`待办`,`任务`,`清单`],block:{type:`checkListItem`}},{key:`toggle`,hint:`>`,icon:qr,aliases:[`fold`,`collapse`,`折叠`,`展开`],block:{type:`toggleListItem`}},{key:`quote`,hint:`"`,icon:nn,aliases:[`blockquote`,`引用`],block:{type:`quote`}},{key:`callout`,icon:Kr,aliases:[`note`,`tip`,`warning`,`提示`,`注意`,`标注`],block:{type:`callout`}},{key:`card`,icon:Qr,aliases:[`box`,`panel`,`卡片`,`面板`],block:{type:`card`,children:[{type:`paragraph`}]}},{key:`stats`,icon:Vr,aliases:[`kpi`,`metric`,`figures`,`numbers`,`scorecard`,`数字`,`指标`],block:{type:`stats`,props:{data:JSON.stringify([{label:``,value:``},{label:``,value:``},{label:``,value:``}])}}},{key:`code`,hint:"```",icon:$e,aliases:[`pre`,`代码`],block:{type:`codeBlock`}},{key:`divider`,hint:`---`,icon:xt,aliases:[`hr`,`line`,`rule`,`分隔`,`横线`],block:{type:`divider`}},{key:`table`,icon:mn,aliases:[`grid`,`表格`],block:{type:`table`,content:{type:`tableContent`,rows:[{cells:[[],[],[]]},{cells:[[],[],[]]}]}}},{key:`image`,icon:Gn,aliases:[`picture`,`photo`,`img`,`图片`,`照片`],block:{type:`image`}},{key:`chart`,icon:Ue,aliases:[`graph`,`plot`,`bar`,`line`,`pie`,`图表`,`柱状图`],make:e=>({type:`chart`,props:{data:sY(SX(e.sample))}})},{key:`equation`,hint:`$$`,icon:pn,aliases:[`math`,`tex`,`latex`,`formula`,`公式`,`数学`],block:{type:`math`,props:{code:String.raw`e^{i\pi} + 1 = 0`}}},{key:`diagram`,icon:ti,aliases:[`mermaid`,`flowchart`,`graph`,`图示`,`流程图`],block:{type:`diagram`,props:{code:`graph LR
|
|
271
|
-
A --> B
|
|
272
|
-
B --> C`}}},{key:`pagebreak`,icon:at,aliases:[`page`,`break`,`new page`,`分页`,`分页符`],block:{type:`pagebreak`}},{key:`pagebreakLandscape`,icon:tt,aliases:[`landscape`,`wide`,`orientation`,`section`,`横向`,`横排`],block:{type:`pagebreak`,props:{orientation:`landscape`}}},{key:`pagebreakPortrait`,icon:nt,aliases:[`portrait`,`orientation`,`section`,`纵向`,`竖排`],block:{type:`pagebreak`,props:{orientation:`portrait`}}},{key:`toc`,icon:Yr,aliases:[`contents`,`table of contents`,`toc`,`outline`,`目录`],block:{type:`toc`}},{key:`bibliography`,icon:Gr,aliases:[`references`,`sources`,`citations`,`参考文献`,`文献`],block:{type:`bibliography`}},{key:`footnote`,icon:Pe,aliases:[`note`,`source`,`cite`,`reference`,`脚注`,`注释`],run:`footnote`},{key:`columns2`,icon:Ie,aliases:[`columns`,`side`,`layout`,`分栏`,`两栏`,`列`],block:JX(2)},{key:`columns3`,icon:it,aliases:[`columns`,`side`,`layout`,`分栏`,`三栏`,`列`],block:JX(3)}],XX=[`paragraph`,`heading1`,`heading2`,`heading3`,`bullet`,`numbered`,`check`,`toggle`,`quote`,`callout`];function ZX(e){let t=YX.find(t=>t.key===e);return t&&XX.includes(e)?t.block:void 0}function QX(e,t,n=[]){let r=t.trim().toLowerCase(),i=e=>e.title.toLowerCase().includes(r)||e.key.includes(r)||e.aliases.some(e=>e.toLowerCase().includes(r)),a=[...YX.map(({make:t,...n})=>({...n,title:e.blocks[n.key],...t?{block:t(e)}:{}})),...n.map(t=>({key:`component:${t.of}`,title:t.title,icon:$r,aliases:[`component`,`组件`,e.component,t.name],block:{type:`component`,props:{data:aY({type:`component`,of:t.of,props:{}})}}}))];if(r===``)return a;let o=XX.flatMap(t=>{let n=YX.find(e=>e.key===t);return n?.block?[{key:`turn:${t}`,title:`${e.turnInto} ${e.blocks[t]}`,icon:n.icon,aliases:[`turn`,`转换`,`变成`,e.turnInto],update:n.block}]:[]}),s=qX.flatMap(t=>[{key:`color:text:${t}`,title:`${e.colorNames[t]} ${e.text}`,icon:lt,aliases:[t,`color`,`颜色`,e.colorNames[t]],update:{type:``,props:{textColor:t}}},{key:`color:background:${t}`,title:`${e.colorNames[t]} ${e.background}`,icon:lt,aliases:[t,`background`,`背景`,e.colorNames[t]],update:{type:``,props:{backgroundColor:t}}}]),c=[...o,...s].filter(e=>e.aliases.some(e=>e.toLowerCase().startsWith(r))||e.title.toLowerCase().startsWith(r));return[...a.filter(i),...c]}function $X(){let e=op();return t=>{if(t.run===`footnote`){HX(e);return}if(t.block){ZC(e,t.block);return}if(!t.update)return;let n=e.getTextCursorPosition().block,{type:r,...i}=t.update;e.updateBlock(n,{...r===``?{}:{type:r},...i})}}var eZ={doc:Zr,video:Un,slides:wn,sheet:Ee,scenery:Vn,model:zn,website:Ln},tZ=8;function nZ(e,t){let n=t.trim().toLowerCase();return e.filter(e=>n===``||e.title.toLowerCase().includes(n)||e.place.toLowerCase().includes(n)).slice(0,tZ).map(e=>({key:`link:${e.href}`,title:e.title,hint:e.place,icon:(e.kind!==void 0&&Object.hasOwn(eZ,e.kind)?eZ[e.kind]:void 0)??Zr,aliases:[]}))}function rZ({items:e,selectedIndex:t,onItemClick:n,empty:r,testId:i=`doc-slash-menu`}){let a=(0,W.useRef)(null),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(t);c!==t&&(l(t),s(void 0));let u=o??t,d=(0,W.useRef)(n);return(0,W.useEffect)(()=>{d.current=n}),(0,W.useEffect)(()=>{if(o===void 0)return;let t=e[o],n=e=>{e.key===`Enter`&&t&&(e.preventDefault(),e.stopImmediatePropagation(),d.current?.(t))};return window.addEventListener(`keydown`,n,!0),()=>{window.removeEventListener(`keydown`,n,!0)}},[o,e]),(0,W.useEffect)(()=>{a.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t]),(0,G.jsx)(`div`,{ref:a,role:`listbox`,"data-testid":i,className:`doc-menu doc-slash-menu`,children:e.length===0?(0,G.jsx)(`p`,{className:`doc-menu-empty`,children:r}):e.map((e,t)=>{let r=e.icon;return(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===u,"data-item":e.key,className:`doc-menu-item`,onMouseMove:()=>{o!==t&&s(t)},onMouseDown:e=>{e.preventDefault()},onClick:()=>{n?.(e)},children:[(0,G.jsx)(r,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,G.jsx)(`span`,{className:`doc-menu-title`,children:e.title}),e.hint!==void 0&&(0,G.jsx)(`span`,{className:`doc-menu-hint`,"aria-hidden":!0,children:e.hint})]},e.key)})})}var iZ=[{value:`left`,icon:He},{value:`center`,icon:Re},{value:`right`,icon:We},{value:`justify`,icon:Me}];function aZ({names:e}){let t=op(),n=Op(),r=vp(),i=fp({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block,n=t.props?.textAlignment;return typeof n==`string`?`${n}:${t.content===void 0?`placed`:`text`}`:void 0}});if(!n||i===void 0)return null;let[a,o]=i.split(`:`),s=iZ.filter(({value:e})=>o===`text`||e!==`justify`),c=s.find(e=>e.value===a)?.icon??He,l=e[a??`left`];return(0,G.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`doc-align-button`,label:l,mainTooltip:l,children:(0,G.jsx)(c,{size:15,"aria-hidden":!0})})}),(0,G.jsx)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-align-menu`,children:s.map(({value:r,icon:i})=>(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,G.jsx)(i,{size:15,"aria-hidden":!0}),checked:a===r,onClick:()=>{let e=t.getSelection()?.blocks??[t.getTextCursorPosition().block];for(let n of e)t.updateBlock(n,{props:{textAlignment:r}})},children:e[r]},r))})]})}function oZ({strings:e}){let t=op(),n=Op(),r=vp(),i=fp({editor:t,selector:({editor:e})=>{let t=e.getActiveStyles();return typeof t.tag==`string`?t.tag:``}});return n?(0,G.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`doc-tag-button`,label:e.tag,mainTooltip:e.tag,isSelected:i!==``,children:(0,G.jsx)(rt,{size:15,"aria-hidden":!0})})}),(0,G.jsxs)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-tag-menu`,children:[(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,checked:i===``,onClick:()=>{t.removeStyles({tag:i})},children:e.noTag}),qX.map(r=>(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,G.jsx)(`span`,{className:`doc-tag doc-tag-swatch`,"data-tag":r}),checked:i===r,onClick:()=>{t.addStyles({tag:r})},children:e.colorNames[r]},r))]})]}):null}function sZ(){let e=Op(),t=Je(),n=(0,W.useRef)(null);return(0,W.useEffect)(()=>{n.current?.closest(`.bn-formatting-toolbar`)?.setAttribute(`data-note-chrome`,``)}),!e||!t?null:(0,G.jsx)(e.FormattingToolbar.Button,{className:`doc-mark-up-button`,label:t.label,mainTooltip:t.hint,onClick:()=>{let e=n.current?.getBoundingClientRect();t.begin(e?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0,!0)},children:(0,G.jsxs)(`span`,{ref:n,"data-testid":`mark-up-selected`,className:`text-ink flex items-center gap-1 px-0.5 text-xs font-medium whitespace-nowrap`,children:[(0,G.jsx)(Ke,{"aria-hidden":!0,className:`size-3.5`}),t.label]})})}function cZ({aligns:e,tags:t}){return(0,G.jsxs)(lM,{children:[(0,G.jsx)(Zj,{},`type`),(0,G.jsx)(Aj,{basicTextStyle:`bold`},`bold`),(0,G.jsx)(Aj,{basicTextStyle:`italic`},`italic`),(0,G.jsx)(Aj,{basicTextStyle:`underline`},`underline`),(0,G.jsx)(Aj,{basicTextStyle:`strike`},`strike`),(0,G.jsx)(Aj,{basicTextStyle:`code`},`code`),(0,G.jsx)(Lj,{},`color`),(0,G.jsx)(oZ,{strings:t},`tag`),(0,G.jsx)(Hj,{},`link`),(0,G.jsx)(aZ,{names:e},`align`),(0,G.jsx)(sZ,{},`mark-up`)]})}function lZ({strings:e,onActions:t}){let n=op(),r=Op(),i=rj(VE,{selector:e=>e?.block});return!r||!i?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&t(i.id)},children:[(0,G.jsx)(fn,{size:15,"aria-hidden":!0}),e.turnInto,`…`]}),(0,G.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&n.insertBlocks([WY(i)],i.id,`after`)},children:[(0,G.jsx)(st,{size:15,"aria-hidden":!0}),e.duplicate]})]})}function uZ({label:e}){let t=op(),n=Op(),r=rj(VE,{selector:e=>e?.block});return!n||!r?null:(0,G.jsxs)(n.Generic.Menu.Item,{className:`bn-menu-item doc-menu-danger`,onClick:()=>{let e=t.getSelection()?.blocks;t.removeBlocks(e?.some(e=>e.id===r.id)?e:[r])},children:[(0,G.jsx)(hn,{size:15,"aria-hidden":!0}),e]})}function dZ({strings:e,onActions:t,...n}){return(0,G.jsx)(IM,{...n,dragHandleMenu:()=>(0,G.jsxs)(PM,{children:[(0,G.jsx)(lZ,{strings:e,onActions:t}),(0,G.jsxs)(AM,{children:[(0,G.jsx)(lt,{size:15,"aria-hidden":!0}),e.colors]}),(0,G.jsx)(uZ,{label:e.remove})]})})}function fZ({actions:e,placeholder:t,empty:n,at:r,onClose:i}){let[a,o]=(0,W.useState)(``),[s,c]=(0,W.useState)(0),l=(0,W.useRef)(null),u=a.trim().toLowerCase(),d=e.filter(e=>u===``||e.title.toLowerCase().includes(u)||(e.group??``).toLowerCase().includes(u)||e.key.includes(u)),f=Math.min(s,Math.max(0,d.length-1));return(0,W.useEffect)(()=>{l.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[f,a]),(0,G.jsxs)(`div`,{className:`doc-actions`,style:{left:r.x,top:r.y},"data-testid":`doc-actions`,onMouseDown:e=>{e.stopPropagation()},children:[(0,G.jsx)(`input`,{autoFocus:!0,value:a,placeholder:t,"aria-label":t,className:`doc-actions-find`,onChange:e=>{o(e.target.value),c(0)},onBlur:i,onKeyDown:e=>{if(e.key===`Escape`&&i(),e.key===`ArrowDown`&&(e.preventDefault(),c(Math.min(f+1,d.length-1))),e.key===`ArrowUp`&&(e.preventDefault(),c(Math.max(f-1,0))),e.key===`Enter`){e.preventDefault();let t=d[f];i(),t?.run()}}}),(0,G.jsx)(`div`,{ref:l,role:`listbox`,className:`doc-menu doc-actions-list`,children:d.length===0?(0,G.jsx)(`p`,{className:`doc-menu-empty`,children:n}):d.map((e,t)=>{let n=e.icon,r=e.group!==void 0&&d[t-1]?.group!==e.group;return(0,G.jsxs)(`div`,{children:[r?(0,G.jsx)(`p`,{className:`doc-menu-group`,children:e.group}):null,(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===f,"data-item":e.key,className:`doc-menu-item`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{i(),e.run()},children:[(0,G.jsx)(n,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,G.jsx)(`span`,{className:`doc-menu-title`,children:e.title})]})]},e.key)})})]})}function pZ(e){return YX.find(t=>t.key===e)?.icon??Ae}function mZ(e,t,n){for(let r of e){if(r.id===t)return{block:r,parent:n};let e=mZ(r.children??[],t,r);if(e)return e}}var hZ=(e,t)=>e.id===t||(e.children??[]).some(e=>hZ(e,t)),gZ=e=>({type:`column`,props:{width:1},children:e});function _Z(e,t){return e.flatMap(e=>{if(t.has(e))return[];if(!e.children)return[e];let n=_Z(e.children,t);if(e.type!==`columns`)return[{...e,children:n}];let r=n.filter(e=>(e.children??[]).length>0);return r.length<2?r.flatMap(e=>e.children??[]):[{...e,children:r}]})}function vZ(e,t){let n=mZ(e,t);if(n)return n.block.type===`column`?`column`:n.parent===void 0?`block`:void 0}function yZ(e,t,n){let r=t.map(t=>mZ(e,t)?.block);if(r.length===0||r.some(e=>e===void 0))return;let i=r;if(i.some(e=>e.type===`columns`||e.type===`column`)||i.some(e=>hZ(e,n.id)))return;let a=mZ(e,n.id);if(!a)return;let o=i.map(e=>({...e})),s=new Set(i),c=(e,t)=>e.flatMap(e=>e===a.block?t(e):e.children&&hZ(e,n.id)?[{...e,children:c(e.children,t)}]:[e]),l;if(a.block.type===`column`){if((a.block.children??[]).filter(e=>!s.has(e)).length===0)return;let t=gZ(o);l=c(e,e=>n.side===`left`?[t,e]:[e,t])}else{if(a.parent!==void 0)return;let t=gZ(o);l=c(e,e=>[{type:`columns`,children:n.side===`left`?[t,gZ([e])]:[gZ([e]),t]}])}return _Z(l,s)}var bZ={share:.2,most:96,least:24};function xZ(e){let t=e.dragging?.slice;if(!t||t.openStart>0)return[];let n=[];return t.content.forEach(e=>{let t=e.attrs.id;typeof t==`string`&&n.push(t)}),n}function SZ(e,t,n,r){let i=t.firstElementChild?.getBoundingClientRect();if(!i)return;let a=Math.min(Math.max(n,i.left+4),i.right-4),o;for(let e of t.ownerDocument.elementsFromPoint(a,r)){if(!t.contains(e))continue;let n=e.closest(`[data-id]`)?.getAttribute(`data-id`);if(n){o=n;break}}for(let n=o===void 0?void 0:e.getBlock(o);n;){if(n.id===void 0)return;let r=e.getParentBlock(n.id),i=n.type===`column`?n:r===void 0||r.type===`column`?r??n:void 0;if(i?.id!==void 0){let e=t.querySelector(i.type===`column`?`[data-doc-col="${CSS.escape(i.id)}"]`:`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);return e?{id:i.id,box:e.getBoundingClientRect()}:void 0}n=r}}function CZ(){let e;return{dropCursor:{color:`var(--allyhub-pencil)`,width:3,hooks:{computeDropPosition:({editor:t,event:n,view:r,defaultPosition:i})=>{e=void 0;let a=t,o=xZ(r);if(o.length===0||!a.isEditable)return i;let s=SZ(a,r.dom,n.clientX,n.clientY);if(!s)return i;let c=Math.min(bZ.most,Math.max(bZ.least,s.box.width*bZ.share)),l=n.clientX<s.box.left+c?`left`:n.clientX>s.box.right-c?`right`:void 0;if(l===void 0||!vZ(a.document,s.id))return i;let u={id:s.id,side:l};if(!yZ(a.document,o,u))return i;let d=yw(s.id,r.state.doc);return d?(e=u,{pos:d.posBeforeNode,orientation:l===`left`?`block-vertical-left`:`block-vertical-right`}):i}}},extension:k_(({editor:t})=>({key:`docColumnDrop`,prosemirrorPlugins:[new Nr({appendTransaction(e,t,n){if(!e.some(e=>e.getMeta(`uiEvent`)===`drop`))return null;let r=new Map;t.doc.descendants(e=>(e.type.name===`column`&&r.set(e.attrs.id,CD(e)),!e.isTextblock));let i=[];if(n.doc.descendants((e,t)=>{if(e.type.name!==`columns`)return!e.isTextblock;let n=[];return e.forEach(e=>n.push(e)),n.some(e=>CD(e)&&r.get(e.attrs.id)!==!0)&&i.push(t),!1}),i.length===0)return null;let a=n.tr;for(let e of i.reverse())wD(a,e);return a},props:{handleDrop(n,r,i){let a=e;if(e=void 0,!a)return!1;let o=t,s=xZ({dragging:{slice:i}}),c=yZ(o.document,s,a);if(!c)return!1;let l=o.document,u=Nn(l,c,e=>JSON.stringify(e));return o.transact(()=>{for(let e of u){let t=l.slice(e.at,e.at+e.remove).flatMap(e=>e.id===void 0?[]:[e.id]);if(t.length>0)o.replaceBlocks(t,e.insert);else if(e.insert.length>0){let t=l[e.at]?.id,n=l.at(-1)?.id;t===void 0?n!==void 0&&o.insertBlocks(e.insert,n,`after`):o.insertBlocks(e.insert,t,`before`)}}}),!0}}})]}))()}}var wZ=/\.(png|jpe?g|gif|webp|avif|svg)$/iu;function TZ(e){let t=a(),[n,r]=(0,W.useState)();return(0,W.useEffect)(()=>{if(e===void 0)return;let n=!0;return t[`files/url`]({path:e}).then(t=>{n&&r({path:e,url:t.url})},()=>void 0),()=>{n=!1}},[t,e]),n!==void 0&&n.path===e?n.url:void 0}var EZ=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`)));async function DZ(e,t){let{files:n}=await e[`files/list`]({dir:``}),r=e=>EZ(e)===t;return n.map(e=>e.path).filter(e=>wZ.test(e)).sort((e,t)=>Number(r(t))-Number(r(e))||e.localeCompare(t))}async function OZ(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}async function kZ(e,t,n){return QY(t,(await e[`files/upload`]({dir:t,name:n.name,data:await OZ(n)})).path)}function AZ(e){let t=e=>e.slice(e.lastIndexOf(`/`)+1),n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);return new Map(e.map(e=>[e,(n.get(t(e))??0)>1?e:t(e)]))}function jZ({path:e,label:t,chosen:n,onChoose:r}){let i=TZ(e);return(0,G.jsx)(Kn,{aspect:`wide`,title:(0,G.jsx)(`span`,{className:`block truncate text-xs font-normal`,children:t}),"aria-label":e,"aria-pressed":n,className:`aria-pressed:bg-here`,"data-testid":`doc-cover-picture`,"data-path":e,picture:i===void 0?void 0:(0,G.jsx)(`img`,{src:i,alt:``,loading:`lazy`,draggable:!1}),onClick:r})}function MZ(e){return cf.map(t=>({key:t,label:e.cover.names[t],src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Nf(t))}`,file:Pf(t),bytes:()=>Promise.resolve(new Blob([Nf(t)],{type:`image/svg+xml`}))}))}function NZ({cover:e,chosen:t,disabled:n,onChoose:r}){return(0,G.jsx)(`div`,{title:e.label,className:`contents`,children:(0,G.jsx)(Kn,{"aria-label":e.label,"aria-pressed":t,disabled:n,className:`aspect-[3/1] p-1 aria-pressed:bg-here`,"data-testid":`doc-cover-gallery-picture`,"data-name":e.key,picture:(0,G.jsx)(`img`,{src:e.src,alt:``,loading:`lazy`,draggable:!1}),onClick:r})})}function PZ({dir:e,current:t,words:n,onPick:r}){let i=a(),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(),[u,d]=(0,W.useState)(!1),f=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!0;return DZ(i,e).then(e=>{t&&s(e)},()=>{t&&s([])}),()=>{t=!1}},[i,e]);let p=t=>e===``?t:`${e}/${t}`,m=o?.some(t=>EZ(t)===e)??!1,h=c??(m?`project`:`gallery`),g=async t=>{d(!0);try{r(await kZ(i,e,t))}catch{}finally{d(!1)}},_=t=>{let n=p(t.file);o?.includes(n)?r(QY(e,n)):(d(!0),t.bytes().then(e=>g(new File([e],t.file,{type:e.type})),()=>{d(!1)}))},v=AZ(o??[]);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`doc-cover-picker`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`div`,{role:`tablist`,className:`flex flex-1 gap-1`,children:[`gallery`,`project`].map(e=>(0,G.jsx)(Wn,{role:`tab`,"aria-selected":h===e,"data-testid":`doc-cover-tab-${e}`,onClick:()=>{l(e)},children:n.cover[e]},e))}),(0,G.jsxs)(Wn,{disabled:u,onClick:()=>f.current?.click(),"data-testid":`doc-cover-upload`,children:[(0,G.jsx)(ei,{}),n.cover.upload]}),(0,G.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&g(t)}})]}),h===`gallery`?(0,G.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-2 gap-1 overflow-y-auto`,"data-testid":`doc-cover-gallery`,children:MZ(n).map(e=>(0,G.jsx)(NZ,{cover:e,chosen:t===p(e.file),disabled:u,onChoose:()=>{_(e)}},e.key))}):o===void 0?(0,G.jsx)(`div`,{role:`tabpanel`,className:`h-24`}):o.length===0?(0,G.jsx)(`p`,{role:`tabpanel`,className:`px-1 pb-2 text-sm text-lead`,children:n.cover.none}):(0,G.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-3 gap-1 overflow-y-auto`,children:o.map(n=>(0,G.jsx)(jZ,{path:n,label:v.get(n)??n,chosen:n===t,onChoose:()=>{r(QY(e,n))}},n))})]})}var FZ=`opacity-0 focus-visible:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity`;function IZ({place:e,look:t,dir:n,words:r,editable:i,onLook:a}){let[o,s]=(0,W.useState)(!1),c=(0,W.useCallback)(e=>{s(!1),e!==t.cover&&a(Kf(t,e))},[t,a]),l=t.cover,u=l===void 0||ZY.test(l)?void 0:tX(n,l),d=TZ(u),f=l===void 0?void 0:ZY.test(l)?l:u===void 0?null:d,[p,m]=(0,W.useState)(),[h,g]=(0,W.useState)(),_=h!==void 0&&h.of===l?h.y:void 0,v=(0,W.useCallback)(e=>{g(e===void 0||l===void 0?void 0:{of:l,y:e})},[l]),y=(0,W.useRef)(null),b=(0,W.useRef)(null),x=(0,W.useRef)(void 0),S=_??t.coverY??50,C=(0,W.useCallback)(()=>{x.current=void 0,v(void 0)},[v]),w=(0,W.useCallback)(()=>{if(_!==void 0){let e=qf(t,_);(e.coverY??50)!==(t.coverY??50)&&a(e)}C()},[C,t,_,a]);(0,W.useEffect)(()=>{if(_===void 0)return;let e=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),C())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[C,_]);let T=()=>{let e=y.current?.getBoundingClientRect(),t=b.current;if(!e||!t||t.naturalWidth===0)return 0;let n=t.naturalHeight*e.width/t.naturalWidth-e.height;return n>.5?100/n:0},E=e=>{_!==void 0&&e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),x.current={y:e.clientY,from:_,pointer:e.pointerId})},D=e=>{let t=x.current;if(t?.pointer!==e.pointerId)return;let n=t.from-(e.clientY-t.y)*T();v(Math.min(100,Math.max(0,n)))},O=e=>{x.current?.pointer===e.pointerId&&(x.current=void 0)},k=e=>{if(_===void 0)return;let t=e.shiftKey?10:1;if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault();let n=_+(e.key===`ArrowUp`?t:-t);v(Math.min(100,Math.max(0,n)))}else e.key===`Enter`&&(e.preventDefault(),w())};if(e===`title`)return l===void 0&&i?(0,G.jsx)(`div`,{className:`doc-cover-add`,children:(0,G.jsxs)(Xe,{open:o,onOpenChange:s,children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsxs)(Wn,{className:`${FZ} group-hover/title:opacity-100`,"data-testid":`doc-cover-add`,children:[(0,G.jsx)(Gn,{}),r.cover.add]})}),(0,G.jsx)(qe,{align:`start`,className:`w-[26rem] p-2`,children:(0,G.jsx)(PZ,{dir:n,current:void 0,words:r,onPick:c})})]})}):null;if(l===void 0)return null;let A=f===null||f!==void 0&&p===f;return(0,G.jsxs)(`div`,{ref:y,className:`doc-cover group/cover`,"data-testid":`doc-cover`,"data-missing":A?``:void 0,"data-moving":_===void 0?void 0:``,..._===void 0?{}:{role:`slider`,tabIndex:0,"aria-label":r.cover.drag,"aria-orientation":`vertical`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(S)},onPointerDown:E,onPointerMove:D,onPointerUp:O,onPointerCancel:O,onKeyDown:k,children:[A?(0,G.jsx)(`span`,{className:`doc-cover-path`,children:l}):f!==void 0&&(0,G.jsx)(`img`,{ref:b,src:f,alt:``,draggable:!1,style:{objectPosition:`50% ${String(S)}%`},onError:()=>{m(f)}}),_!==void 0&&(0,G.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-md bg-media/60 px-3 py-1.5 text-xs text-on-media`,children:r.cover.drag}),i&&(0,G.jsx)(`div`,{className:`absolute right-2 bottom-2 flex gap-0.5 rounded-lg border border-rule bg-sheet/95 p-0.5 shadow-float ${_===void 0?`opacity-0 group-hover/cover:opacity-100 group-focus-within/cover:opacity-100 has-[[aria-expanded=true]]:opacity-100 motion-safe:transition-opacity`:``}`,onPointerDown:e=>{e.stopPropagation()},children:_===void 0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Xe,{open:o,onOpenChange:s,children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsxs)(Wn,{"data-testid":`doc-cover-change`,children:[(0,G.jsx)(Gn,{}),r.cover.change]})}),(0,G.jsx)(qe,{align:`end`,className:`w-[26rem] p-2`,children:(0,G.jsx)(PZ,{dir:n,current:u,words:r,onPick:c})})]}),!A&&(0,G.jsxs)(Wn,{"data-testid":`doc-cover-reposition`,onClick:()=>{v(t.coverY??50),requestAnimationFrame(()=>y.current?.focus())},children:[(0,G.jsx)(Xr,{}),r.cover.reposition]}),(0,G.jsxs)(Wn,{"data-testid":`doc-cover-remove`,onClick:()=>{a(Kf(t,void 0))},children:[(0,G.jsx)(hn,{}),r.cover.remove]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Wn,{"data-testid":`doc-cover-save`,onClick:w,children:r.cover.save}),(0,G.jsx)(Wn,{"data-testid":`doc-cover-cancel`,onClick:C,children:r.cover.cancel})]})})]})}var LZ=new Cr(`docAgent`),RZ=k_(()=>({key:`docAgent`,prosemirrorPlugins:[new Nr({key:LZ,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(LZ);return n===void 0?t:n}},props:{decorations(e){let t=LZ.getState(e);if(!t)return null;let n;return e.doc.descendants((e,r)=>n?!1:e.type.name!==`blockContainer`||e.attrs.id!==t.id||(n=Pr.node(r,r+e.nodeSize,{class:`doc-agent`,"data-agent":t.label,"data-testid":`doc-agent`}),!1)),n?jr.create(e.doc,[n]):null}}})]}))();function zZ(e,t){let n=e._tiptapEditor.view;n.dispatch(n.state.tr.setMeta(LZ,t))}var BZ=(0,W.createContext)({numbers:new Map,words:new Map});function VZ(e){let[t,n]=(0,W.useState)(()=>FX(AY(e.document)));return(0,W.useEffect)(()=>e.onChange(()=>{let t=FX(AY(e.document));n(e=>IX(e,t)?e:t)}),[e]),t}var HZ=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;function UZ(e,t){let n=zX(e.document,t);if(n?.id!==void 0){try{e.setTextCursorPosition(n.id,`end`),e.focus()}catch{}document.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"]`)?.scrollIntoView({block:`center`,behavior:HZ()?`auto`:`smooth`})}}function WZ({label:e,editor:t}){let n=(0,W.useContext)(BZ),r=e.toLowerCase(),i=n.words.get(r),a=n.numbers.get(r),o=i===void 0||a===void 0?`[${e}]`:String(a),s=(0,G.jsx)(`button`,{type:`button`,className:`doc-fn-mark`,"data-doc-footnote":e,onMouseDown:e=>{e.preventDefault()},onClick:()=>{UZ(t,e)},children:o});return(0,G.jsx)(`sup`,{className:`doc-fn`,contentEditable:!1,children:i===void 0||i===``?s:(0,G.jsxs)(bn,{children:[(0,G.jsx)(yn,{asChild:!0,children:s}),(0,G.jsx)(vn,{side:`top`,className:`doc-fn-words max-w-72 text-left`,"data-testid":`doc-footnote-words`,children:i})]})})}var GZ=SP({type:`footnote`,propSchema:{label:{default:``},styles:{default:``},href:{default:``}},content:`none`},{render:e=>(0,G.jsx)(WZ,{label:e.inlineContent.props.label,editor:e.editor})});function KZ({label:e}){let t=(0,W.useContext)(BZ).numbers.get(e.toLowerCase());return(0,G.jsx)(`span`,{contentEditable:!1,className:`doc-note-number`,"data-unmarked":t===void 0?``:void 0,children:t===void 0?`–`:`${String(t)}.`})}var qZ=QN({type:`note`,propSchema:{label:{default:``}},content:`inline`},{render:e=>(0,G.jsxs)(`div`,{className:`doc-note`,"data-doc-note":e.block.props.label,children:[(0,G.jsx)(KZ,{label:e.block.props.label}),(0,G.jsx)(`div`,{className:`doc-note-text`,ref:e.contentRef})]})});function JZ({orientation:e}){let t=(0,W.useContext)(aX)?.words;return(0,G.jsx)(`div`,{contentEditable:!1,className:`doc-pagebreak`,"data-doc-pagebreak":e,children:(0,G.jsx)(`span`,{children:e===`landscape`?t?.blocks.pagebreakLandscape:e===`portrait`?t?.blocks.pagebreakPortrait:t?.blocks.pagebreak})})}var YZ=QN({type:`pagebreak`,propSchema:{orientation:{default:``}},content:`none`},{render:e=>(0,G.jsx)(JZ,{orientation:e.block.props.orientation})}),XZ=e=>e===`sans`||e===`serif`||e===`mono`||e===`times`?`Ag`:`文`,ZZ=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`],QZ=[`letter`,`legal`,`a4`,`a5`,`b5`],$Z={a3:`A3`,a4:`A4`,a5:`A5`,b5:`B5`,letter:`Letter`,legal:`Legal`},eQ={normal:25.4,narrow:12.7,wide:[25.4,50.8]},tQ=[10.5,11,12,14,16],nQ=[1.15,1.5,2],rQ=e=>Object.entries(Ni).find(([,t])=>t===e)?.[0],iQ=e=>{if(e===void 0)return``;for(let[t,n]of Object.entries(eQ))if(JSON.stringify(n)===JSON.stringify(e))return t};function aQ({label:e,value:t,options:n,onValue:r,testId:i}){return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{className:`text-lead shrink-0`,children:e}),(0,G.jsxs)(Pn,{value:t??`*`,onValueChange:r,children:[(0,G.jsx)(kn,{size:`sm`,className:`w-40`,"aria-label":e,"data-testid":i,children:(0,G.jsx)(Fn,{})}),(0,G.jsxs)(Dn,{children:[t===void 0&&(0,G.jsx)(Rn,{value:`*`,disabled:!0,children:`…`}),n.map(([e,t])=>(0,G.jsx)(Rn,{value:e===``?`-`:e,children:t},e===``?`-`:e))]})]})]})}function oQ({look:e,words:t,chinese:n,onLook:r}){let i=e.preset===void 0?{}:Ri(e.preset),a=e.font??i.font??`sans`,o=(t,n)=>{let i=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r(n===void 0?i:{...i,[t]:n})},s=e=>e===``?`-`:e,c=e=>e===`-`?``:e,l=e.size===void 0?``:typeof e.size==`number`?String(e.size):String(Ni[e.size]),u=e=>{let r=rQ(e);return n&&r!==void 0?r:t.page.pt(e)},d=t.page,f=e=>{let n=iQ(e);return n===``?t.defaultColor:n===void 0?`${(typeof e==`number`?[e]:[...e??[]]).join(` / `)} mm`:d.marginNames[n]};return(0,G.jsxs)(Xe,{children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsxs)(Wn,{"data-testid":`doc-style`,children:[(0,G.jsx)(zr,{}),t.style]})}),(0,G.jsxs)(qe,{align:`start`,className:`flex max-h-[min(80vh,640px)] w-80 flex-col gap-3 overflow-y-auto p-3`,children:[(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":t.style,className:`grid grid-cols-4 gap-1.5`,children:ZZ.map(e=>(0,G.jsxs)(Ge,{variant:`box`,checked:a===e,onClick:()=>{o(`font`,e===(i.font??`sans`)?void 0:e)},children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`text-xl leading-tight`,style:{fontFamily:no({font:e}).text},children:XZ(e)}),(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:t.fonts[e]})]},e))}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:t.accent}),(0,G.jsxs)(`div`,{role:`radiogroup`,"aria-label":t.accent,className:`flex flex-wrap gap-1.5`,children:[(0,G.jsx)(gn,{color:`var(--allyhub-ink)`,label:t.defaultColor,checked:e.accent===void 0,onClick:()=>{o(`accent`,void 0)}}),qX.map(n=>(0,G.jsx)(gn,{color:Sa(n)??n,label:t.colorNames[n],checked:e.accent===n,onClick:()=>{o(`accent`,n)}},n))]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[(0,G.jsx)(aQ,{label:d.preset,testId:`doc-preset`,value:s(e.preset??``),options:[[``,d.none],...Fi.map(e=>[e,d.presets[e]])],onValue:e=>{let t=c(e);o(`preset`,Fi.includes(t)?t:void 0)}}),(0,G.jsx)(aQ,{label:d.paper,testId:`doc-paper`,value:s(e.paper===void 0?``:typeof e.paper==`string`&&QZ.includes(e.paper)?e.paper:void 0),options:[[``,$Z[typeof i.paper==`string`?i.paper:Vi.paper]],...QZ.filter(e=>e!==Vi.paper).map(e=>[e,$Z[e]])],onValue:e=>{let t=c(e);o(`paper`,QZ.includes(t)?t:void 0)}}),(0,G.jsx)(aQ,{label:d.orientation,testId:`doc-orientation`,value:s(e.orientation===`landscape`?`landscape`:``),options:[[``,d.portrait],[`landscape`,d.landscape]],onValue:e=>{o(`orientation`,c(e)===`landscape`?`landscape`:void 0)}}),(0,G.jsx)(aQ,{label:d.margins,testId:`doc-margins`,value:s(iQ(e.margins)),options:[[``,f(i.margins)],[`normal`,d.marginNames.normal],[`narrow`,d.marginNames.narrow],[`wide`,d.marginNames.wide]],onValue:e=>{let t=c(e);o(`margins`,t in eQ?eQ[t]:void 0)}}),(0,G.jsx)(aQ,{label:d.size,testId:`doc-size`,value:s(l===``||tQ.includes(Number(l))?l===`11`?``:l:void 0),options:[[``,u(i.size===void 0?11:Bi(i.size))],...tQ.filter(e=>e!==11).map(e=>[String(e),u(e)])],onValue:e=>{let t=c(e),r=Number(t),i=rQ(r);o(`size`,t===``?void 0:n&&i!==void 0?i:r)}}),(0,G.jsx)(aQ,{label:d.lineHeight,testId:`doc-line-height`,value:s(e.lineHeight===void 0||e.lineHeight===(i.lineHeight??Vi.lineHeight)?``:nQ.includes(e.lineHeight)?String(e.lineHeight):void 0),options:[[``,typeof i.lineHeight==`number`?String(i.lineHeight):i.grid===void 0?String(Vi.lineHeight):d.grid],...nQ.filter(e=>e!==(typeof i.lineHeight==`number`?i.lineHeight:Vi.lineHeight)).map(e=>[String(e),String(e)])],onValue:e=>{let t=c(e);o(`lineHeight`,t===``?void 0:Number(t))}})]}),(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:d.indent}),(0,G.jsx)(_n,{size:`sm`,"data-testid":`doc-indent`,checked:(e.textIndent??i.textIndent??0)>0,onCheckedChange:e=>{let t=(i.textIndent??0)>0;o(`textIndent`,e===t?void 0:e?2:0)}})]}),(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:t.pageNumbers}),(0,G.jsx)(_n,{size:`sm`,"data-testid":`doc-page-numbers`,checked:e.pageNumbers!==!1,onCheckedChange:t=>{r(Gf(e,t))}})]})]})]})}function sQ({className:e,...t}){return(0,G.jsx)(An,{role:`status`,"aria-label":`Loading`,className:N(`size-4 animate-spin`,e),...t})}var cQ=600;function lQ({item:e,stamp:t,words:n,onGo:r}){let i=a(),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(!0),[u,d]=(0,W.useState)();(0,W.useEffect)(()=>{let t=!0,n=setTimeout(()=>{l(!0),rY(i,`doc/pages`,{item:e}).then(e=>{t&&(s(e),d(void 0),l(!1))},e=>{t&&(d(e instanceof Error?e.message:String(e)),l(!1))})},cQ);return()=>{t=!1,clearTimeout(n)}},[i,e,t]);let f=o?.pages.length??0;return(0,G.jsxs)(`aside`,{className:`doc-pages`,"data-testid":`doc-pages`,"data-printing":c?``:void 0,"aria-label":n.pages,children:[c&&(0,G.jsxs)(`div`,{className:`doc-pages-state`,role:`status`,children:[(0,G.jsx)(sQ,{}),n.pagesPrinting]}),u!==void 0&&(0,G.jsx)(`div`,{className:`doc-pages-state`,role:`alert`,children:n.pagesFailed(u)}),o?.pages.map(e=>(0,G.jsxs)(`figure`,{className:`doc-pages-page`,"data-landscape":e.landscape?``:void 0,style:{aspectRatio:`${String(e.width)} / ${String(e.height)}`},children:[(0,G.jsx)(`img`,{src:`data:${e.image.mime};base64,${e.image.data}`,alt:n.pageOf(e.n,f),draggable:!1}),o.blocks.flatMap(t=>t.places.filter(t=>t.page===e.n).map((i,a)=>(0,G.jsx)(`button`,{type:`button`,className:`doc-page-block`,"aria-label":n.pageBlock(e.n),style:{left:`${String(i.left/e.width*100)}%`,top:`${String(i.top/e.height*100)}%`,width:`${String((i.right-i.left)/e.width*100)}%`,height:`${String((i.bottom-i.top)/e.height*100)}%`},onClick:()=>{r(t.n)}},`${String(t.n)}-${String(a)}`))),(0,G.jsx)(`figcaption`,{children:n.pageOf(e.n,f)})]},e.n))]})}var uQ=(0,W.createContext)(new Map);function dQ(e,t){let n=new Map;for(let[t,r]of io(e))t.type===`heading`&&n.set(r,t.content.map(e=>e.text).join(``));let r=Ua(e,t);for(let t of da(e)){let e=Va(t),i=r.get(t);e!==void 0&&i!==void 0&&n.set(e,i.label)}return n}var fQ=(e,t)=>e.size===t.size&&[...e].every(([e,n])=>t.get(e)===n);function pQ(e,t){let[n,r]=(0,W.useState)(()=>dQ(AY(e.document),t));return(0,W.useEffect)(()=>e.onChange(()=>{let n=dQ(AY(e.document),t);r(e=>fQ(e,n)?e:n)}),[e,t]),n}function mQ({target:e}){let t=(0,W.useContext)(uQ).get(decodeURIComponent(e));return(0,G.jsx)(`span`,{className:`doc-ref`,contentEditable:!1,"data-doc-ref":e,"data-unknown":t===void 0?``:void 0,children:t??`#${e}`})}var hQ=SP({type:`reference`,propSchema:{target:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,G.jsx)(mQ,{target:e.inlineContent.props.target})}),gQ={items:[],style:`apa`,list:[],numbers:new Map},_Q=(0,W.createContext)(gQ),vQ=(e,t,n)=>{let r=ki(e,t,n);return{items:t,style:n,list:r,numbers:new Map(r.map(e=>[e.item.id,e.n]))}},yQ=(e,t)=>e.items===t.items&&e.style===t.style&&e.list.map(e=>e.text).join(`
|
|
273
|
-
`)===t.list.map(e=>e.text).join(`
|
|
274
|
-
`);function bQ(e,t,n){let[r,i]=(0,W.useState)(()=>vQ(AY(e.document),t,n));return(0,W.useEffect)(()=>{let r=()=>{let r=vQ(AY(e.document),t,n);i(e=>yQ(e,r)?e:r)},a=e.onChange(r);return queueMicrotask(r),a},[e,t,n]),r}function xQ({cite:e}){let t=(0,W.useContext)(_Q);return(0,G.jsx)(`span`,{className:`doc-cite`,contentEditable:!1,"data-doc-cite":e,children:t.items.length===0?`[${e}]`:Ai(e,t.items,t.numbers,t.style)})}var SQ=SP({type:`citation`,propSchema:{cite:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,G.jsx)(xQ,{cite:e.inlineContent.props.cite})});function CQ(){let e=(0,W.useContext)(_Q),t=(0,W.useContext)(aX)?.words;return(0,G.jsxs)(`section`,{contentEditable:!1,className:`doc-sources`,"data-doc-sources":e.style,children:[(0,G.jsx)(`span`,{className:`doc-toc-name`,children:t?.blocks.bibliography}),e.list.length===0?(0,G.jsx)(`span`,{className:`doc-toc-empty`,children:t?.sourcesEmpty}):(0,G.jsx)(`ol`,{children:e.list.map(e=>(0,G.jsx)(`li`,{children:e.pieces.map((e,t)=>e.italic?(0,G.jsx)(`i`,{children:e.text},t):e.text)},e.item.id))})]})}var wQ=QN({type:`bibliography`,propSchema:{},content:`none`},{render:()=>(0,G.jsx)(CQ,{})});function TQ(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):``).join(``):``}function EQ(e){let t=[];for(let n of e){if(n.type===`columns`||n.type===`column`){t.push(...EQ(n.children??[]));continue}let e=n.props?.level;if(n.type!==`heading`||typeof e!=`number`||e>3||n.id===void 0)continue;let r=TQ(n.content).trim();r!==``&&t.push({id:n.id,level:e,text:r})}return t}function DQ({entries:e,label:t,scroller:n,onGo:r}){let[i,a]=(0,W.useState)();return(0,W.useEffect)(()=>{let t=n.current;if(!t)return;let r=()=>{let n=t.getBoundingClientRect().top+96,r;for(let i of e){let e=t.querySelector(`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);if(e){if(e.getBoundingClientRect().top<=n)r=i.id;else break}}a(r??e[0]?.id)};return r(),t.addEventListener(`scroll`,r,{passive:!0}),()=>{t.removeEventListener(`scroll`,r)}},[e,n]),e.length<3?null:(0,G.jsxs)(`nav`,{"aria-label":t,className:`doc-outline`,"data-testid":`doc-outline`,children:[(0,G.jsx)(`p`,{className:`doc-outline-label`,children:t}),e.map(e=>(0,G.jsx)(`button`,{type:`button`,"data-level":e.level,"aria-current":i===e.id?`location`:void 0,className:`doc-outline-item`,onClick:()=>{r(e.id)},children:e.text},e.id))]})}var OQ,kQ=Promise.resolve(),AQ=0,jQ=()=>OQ??=Hn(()=>import(`./mermaid.core-CmfBU89G.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url);function MQ(e,t){let n=kQ.then(async()=>{let n=await jQ(),r=ui({font:t.font,accent:t.accent});n.initialize({...r,...t.dark?{theme:`dark`,themeVariables:{fontFamily:t.font,fontSize:`14px`}}:{},suppressErrorRendering:!0}),AQ+=1;let{svg:i}=await n.render(`doc-diagram-${String(AQ)}`,e);return NQ(i)});return kQ=n.catch(()=>void 0),n}function NQ(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(t.nodeName!==`svg`)return e;for(let e of t.querySelectorAll(`.today`))e.remove();let n=(t.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/u).map(Number),[,,r,i]=n;return n.length===4&&r!==void 0&&i!==void 0&&r>0&&i>0&&(t.setAttribute(`width`,String(r)),t.setAttribute(`height`,String(i)),t.style.removeProperty(`max-width`)),new XMLSerializer().serializeToString(t)}function PQ(e){let t=(0,W.useMemo)(()=>e.trim()===``?void 0:Wa(e),[e]),[n,r]=(0,W.useState)();return t!==void 0&&t.error===void 0&&t.html!==n&&r(t.html),t===void 0?{}:t.error===void 0?{html:t.html}:{html:n??t.html,error:t.error}}var FQ=150;function IQ(e,t,n,r){let[i,a]=(0,W.useState)({});return(0,W.useEffect)(()=>{if(e.trim()===``)return;let i=!0,o=setTimeout(()=>{MQ(e,{font:t,dark:n,accent:r}).then(e=>{i&&a({html:e})},e=>{i&&a(t=>({...t.html===void 0?{}:{html:t.html},error:e instanceof Error?e.message:String(e)}))})},FQ);return()=>{i=!1,clearTimeout(o)}},[e,t,n,r]),e.trim()===``?{}:i}function LQ({kind:e,code:t,drawn:n,empty:r}){return t.trim()===``?(0,G.jsx)(`span`,{className:`doc-drawn-empty`,children:r}):n.html===void 0?(0,G.jsx)(`pre`,{className:`doc-drawn-code`,children:t}):(0,G.jsx)(`div`,{className:e===`equation`?`doc-math`:`doc-diagram`,dangerouslySetInnerHTML:{__html:n.html}})}function RQ({kind:e,code:t,onCode:n}){let r=(0,W.useContext)(aX),i=(0,W.useContext)(yX),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(t);!a&&s!==t&&c(t);let l=PQ(e===`equation`?s:``),u=IQ(e===`diagram`?s:``,bX(i.page),i.dark,ro(i.page)),d=e===`equation`?l:u,f=r?.words,p=e===`equation`?f?.blocks.equation:f?.blocks.diagram,m=(e===`equation`?f?.emptyEquation:f?.emptyDiagram)??``,h=r?.readOnly!==!0;return(0,G.jsx)(`figure`,{contentEditable:!1,"data-doc-drawn":e,className:`doc-drawn`,children:(0,G.jsxs)(Xe,{open:h&&a,onOpenChange:o,children:[(0,G.jsx)(Qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-drawn-button`,"aria-label":p,disabled:!h,children:(0,G.jsx)(LQ,{kind:e,code:s,drawn:d,empty:m})})}),h&&(0,G.jsxs)(qe,{align:`center`,className:`flex w-[min(36rem,calc(100vw-2rem))] flex-col gap-2 p-2`,children:[(0,G.jsx)(Rr,{value:s,"aria-label":p,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`max-h-[50vh] min-h-20 resize-none font-mono text-xs [font-variant-ligatures:none] md:text-xs`,onChange:e=>{c(e.target.value),n(e.target.value)}}),d.error!==void 0&&(0,G.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-32 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:d.error})]})]})})}var zQ=QN({type:`math`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,G.jsx)(RQ,{kind:`equation`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})}),BQ=QN({type:`diagram`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,G.jsx)(RQ,{kind:`diagram`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})});function VQ({trend:e,placeholder:t,onTrend:n}){let[r,i]=(0,W.useState)(e?.join(`, `)??``),a=()=>{let e=r.split(/[,\s]+/u).filter(e=>e!==``).map(Number).filter(e=>Number.isFinite(e));n(e.length<2?void 0:e)};return(0,G.jsx)(`input`,{className:`doc-stat-trend-field`,value:r,placeholder:t,"aria-label":t,onChange:e=>{i(e.target.value)},onBlur:a,onKeyDown:e=>{e.key===`Enter`&&a()}})}function HQ({data:e,onData:t}){let n=(0,W.useContext)(aX),r=n?.words?.stats,i=n?.readOnly!==!0,a=iY(e),o=(e,n)=>{let r=a.flatMap((t,r)=>r===e?n===void 0?[]:[n]:[t]);t(JSON.stringify(r))},s=(e,t,n,a,s)=>i?(0,G.jsx)(`input`,{className:a,style:s,size:n===`delta`?Math.max(3,Array.from(t.delta??r?.delta??``).length):void 0,value:t[n]??``,placeholder:r?.[n],"aria-label":r?.[n],onChange:r=>{let i=r.target.value,a={...t};n===`label`||n===`value`||i!==``?a[n]=i:n===`delta`?delete a.delta:delete a.note,o(e,a)}}):(0,G.jsx)(`span`,{className:a,style:s,children:t[n]});return(0,G.jsxs)(`div`,{className:`doc-stats`,contentEditable:!1,style:{gridTemplateColumns:`repeat(${String(Math.max(1,a.length))}, minmax(0, 1fr))`},children:[a.map((e,t)=>(0,G.jsxs)(`div`,{className:`doc-stat`,children:[s(t,e,`label`,`doc-stat-label`),s(t,e,`value`,`doc-stat-value`),(0,G.jsxs)(`div`,{className:`doc-stat-foot`,children:[s(t,e,`delta`,`doc-stat-delta`,{color:ai[ta(e)]}),s(t,e,`note`,`doc-stat-note`)]}),e.trend!==void 0&&(0,G.jsx)(`div`,{className:`doc-stat-trend`,dangerouslySetInnerHTML:{__html:ao(e.trend,ai[ta(e)])}}),i&&(0,G.jsx)(VQ,{trend:e.trend,placeholder:r?.trend,onTrend:n=>{let r={...e};n===void 0?delete r.trend:r.trend=n,o(t,r)}}),i&&a.length>1&&(0,G.jsx)(Wn,{icon:!0,className:`doc-stat-remove`,"aria-label":r?.remove,title:r?.remove,onClick:()=>{o(t,void 0)},children:(0,G.jsx)(hn,{})})]},t)),i&&(0,G.jsx)(Wn,{icon:!0,className:`doc-stats-add`,"aria-label":r?.add,title:r?.add,onClick:()=>{t(JSON.stringify([...a,{label:``,value:``}]))},children:(0,G.jsx)(Cn,{})})]})}var UQ=QN({type:`stats`,propSchema:{data:{default:`[]`}},content:`none`},{render:e=>(0,G.jsx)(HQ,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})});function WQ({subtitle:e,contentRef:t,onSubtitle:n}){let r=(0,W.useContext)(aX),i=r?.words?.card,a=r?.readOnly!==!0;return(0,G.jsxs)(`div`,{className:`doc-card-head`,children:[(0,G.jsx)(`div`,{className:`doc-card-title`,ref:t}),a?(0,G.jsx)(`input`,{className:`doc-card-subtitle`,contentEditable:!1,value:e,placeholder:i?.subtitle,"aria-label":i?.subtitle,onChange:e=>{n(e.target.value)}}):e!==``&&(0,G.jsx)(`p`,{className:`doc-card-subtitle`,children:e})]})}var GQ=QN({type:`card`,propSchema:{subtitle:{default:``}},content:`inline`},{render:e=>(0,G.jsx)(WQ,{subtitle:e.block.props.subtitle,contentRef:e.contentRef,onSubtitle:t=>{e.editor.updateBlock(e.block,{props:{subtitle:t}})}})}),KQ=CP({type:`tag`,propSchema:`string`},{render:e=>(0,G.jsx)(`span`,{className:`doc-tag`,"data-tag":e.value,ref:e.contentRef})});function qQ(e,t){let n=[],r=e=>{for(let i of e){let e=i.props?.level;if(i.type===`heading`&&typeof e==`number`&&e<=t&&i.id!==void 0){let t=(Array.isArray(i.content)?i.content:[]).map(e=>`text`in e&&typeof e.text==`string`?e.text:``).join(``);t.trim()!==``&&n.push({id:i.id,level:e,words:t})}r(i.children??[])}};return r(e),n}function JQ({editor:e,levels:t,title:n}){let r=(0,W.useContext)(aX)?.words,[i,a]=(0,W.useState)(()=>qQ(e.document,t));(0,W.useEffect)(()=>e.onChange(()=>{a(qQ(e.document,t))}),[e,t]);let o=Math.min(...i.map(e=>e.level));return(0,G.jsxs)(`nav`,{contentEditable:!1,className:`doc-toc`,"data-doc-toc":``,children:[(0,G.jsx)(`span`,{className:`doc-toc-name`,children:n===``?r?.blocks.toc:n}),i.length===0?(0,G.jsx)(`span`,{className:`doc-toc-empty`,children:r?.tocEmpty}):(0,G.jsx)(`ol`,{children:i.map(e=>(0,G.jsx)(`li`,{style:{paddingLeft:`${String((e.level-o)*1.25)}em`},children:(0,G.jsx)(Jn,{size:`dense`,onClick:()=>{document.querySelector(`[data-id="${CSS.escape(e.id)}"]`)?.scrollIntoView({behavior:`smooth`,block:`start`})},children:e.words})},e.id))})]})}var YQ=QN({type:`toc`,propSchema:{levels:{default:3},title:{default:``},untitled:{default:!1}},content:`none`},{render:e=>(0,G.jsx)(JQ,{editor:e.editor,levels:e.block.props.levels,title:e.block.props.title})}),XQ=(0,W.createContext)(void 0);function ZQ(e){let t=(/^<\s*([A-Za-z][\w.]*)/.exec(e.trim())?.[1]??``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function QQ({source:e}){let t=(0,W.useContext)(XQ);return(0,G.jsxs)(`div`,{contentEditable:!1,"data-doc-embed":``,className:`doc-embed`,children:[(0,G.jsx)($r,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-name`,children:ZQ(e)}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:t?.embed})]})}var $Q=QN({type:`embed`,propSchema:{source:{default:``}},content:`none`},{render:e=>(0,G.jsx)(QQ,{source:e.block.props.source})}),e$=[fY,`ℹ️`,`⚠️`,`❗`,`✅`,`📌`],t$=QN({type:`callout`,propSchema:{icon:{default:fY},textColor:{default:`default`},backgroundColor:{default:`default`}},content:`inline`},{render:e=>(0,G.jsxs)(`div`,{className:`doc-callout`,"data-doc-callout":``,children:[e.block.props.icon===``?null:(0,G.jsx)(`button`,{type:`button`,contentEditable:!1,className:`doc-callout-icon`,"aria-label":e.block.props.icon,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=e$.indexOf(e.block.props.icon);e.editor.updateBlock(e.block,{props:{icon:e$[(t+1)%e$.length]??`💡`}})},children:e.block.props.icon}),(0,G.jsx)(`div`,{className:`doc-callout-text`,ref:e.contentRef})]})}),n$=new Set([`audio`,`video`,`file`]),r$=Object.fromEntries(Object.entries(ew).filter(([e])=>!n$.has(e))),i$=ow.create({blockSpecs:{...r$,embed:$Q(),callout:t$(),card:GQ(),stats:UQ(),component:sX(),chart:NX(),math:zQ(),diagram:BQ(),columns:mX(),column:gX(),note:qZ(),pagebreak:YZ(),toc:YQ(),bibliography:wQ()},inlineContentSpecs:{...iw,footnote:GZ,reference:hQ,citation:SQ},styleSpecs:{...rw,tag:KQ}});function a$(e,t){let n=t.blocks,r=e.slash_menu,i=(e,t)=>({[e]:{...r[e],title:t}});return{...e,slash_menu:{...r,...i(`paragraph`,n.paragraph),...i(`heading`,n.heading1),...i(`heading_2`,n.heading2),...i(`heading_3`,n.heading3),...i(`bullet_list`,n.bullet),...i(`numbered_list`,n.numbered),...i(`check_list`,n.check),...i(`toggle_list`,n.toggle),...i(`quote`,n.quote),...i(`code_block`,n.code),...i(`table`,n.table),...i(`image`,n.image),...i(`divider`,n.divider)},placeholders:{...e.placeholders,default:t.placeholder,heading:t.heading,note:t.blocks.footnote}}}function o$(e){let t=e[0];return e.length===1&&t?.type===`paragraph`&&t.content.every(e=>e.text===``)&&t.look===void 0&&(t.children?.length??0)===0}var s$=e=>`doc-toggles:${e}`;function c$(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`boolean`))}var l$=e=>e.type===`toggleListItem`||e.type===`heading`&&e.props?.isToggleable===!0;function*u$(e){for(let t of e)yield t,yield*u$(t.children??[])}function d$(e,t){for(let n of u$(e)){if(!l$(n)||n.id===void 0)continue;let e=t[n.id.slice(1).replace(/-\d+$/,``)];if(e!==void 0)try{window.localStorage.setItem(`toggle-${n.id}`,String(e))}catch{return}}}function f$(e,t){let n={};for(let r of u$(e)){if(!l$(r)||r.id===void 0)continue;let e=AY([r])[0];e&&(n[yY(e)]=t?.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-toggle-button`)?.getAttribute(`aria-expanded`)===`true`)}return n}var p$=30,m$=8,h$=160,g$=3e4,_$=fN;function v$({words:e,components:t}){let n=$X(),r=op(),i=(0,W.useCallback)(t=>(0,G.jsx)(rZ,{...t,empty:e.nothing}),[e.nothing]);return(0,G.jsx)(_$,{triggerCharacter:`/`,getItems:async n=>{let i=QX(e,n,await t()),a=r.getTextCursorPosition().block.id;return _X(r,a)?i.filter(e=>e.block?.type!==`columns`):i},suggestionMenuComponent:i,onItemClick:e=>{n(e)}})}function y$({links:e,empty:t}){let n=op(),r=(0,W.useCallback)(e=>(0,G.jsx)(rZ,{...e,empty:t,testId:`doc-mention-menu`}),[t]),i=(0,W.useRef)([]);return(0,G.jsx)(_$,{triggerCharacter:`@`,shouldOpen:e=>{let t=e.selection.$from,n=t.parent.textBetween(0,t.parentOffset).replace(/@$/,``);return!/[A-Za-z0-9._-]$/.test(n)},getItems:async t=>(i.current=await e(),nZ(i.current,t)),suggestionMenuComponent:r,onItemClick:e=>{let t=i.current.find(t=>`link:${t.href}`===e.key);t&&n.insertInlineContent([{type:`link`,href:t.href,content:t.title},` `])}})}function b$(e){let t=e instanceof Element?e:e?.contextElement;if(!t)return 0;let n=t.getBoundingClientRect().top,r=t.querySelector(`.bn-inline-content`);if(r){let e=document.createRange();e.selectNodeContents(r);let t=e.getClientRects()[0]??r.getBoundingClientRect();return t.top+t.height/2-n-p$/2}let i=(t.querySelector(`.bn-block-content`)??t).getBoundingClientRect();return i.top-n+Math.max(0,Math.min(i.height,54)/2-p$/2)}function x$({path:e,file:t,toggles:o,words:s,context:c,autoFocus:l,className:u,onUnreadable:d}){let f=a(),p=$Y(e),[m]=(0,W.useState)(()=>new Yf(t.text)),[h]=(0,W.useState)(()=>Za(m.shown())),g=Rf(c.locale),[_]=(0,W.useState)(CZ),v=cj({schema:i$,dropCursor:_.dropCursor,extensions:[_.extension,KX,RZ],sideMenu:{hoverMargin:h$},dictionary:a$(g,s),tables:{headers:!0},...h.body.length>0?{initialContent:(()=>{let e=SY(h.body);return d$(e,o),e})()}:{},uploadFile:e=>kZ(f,p,e),resolveFileUrl:async e=>{let t=tX(p,e);return t===void 0?e:(await f[`files/url`]({path:t})).url}},[m]),y=v,b=VZ(v),x=(0,W.useRef)(null),S=e=>x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)??void 0,C=(e,t)=>{let n=document.elementFromPoint(e,t)?.closest(`.bn-block-outer[data-id]`),r=[...x.current?.querySelectorAll(`.bn-block-outer[data-id]`)??[]],i=n?r.indexOf(n):-1;for(let e=i;e>=0;e--){let t=(r[e]?.querySelector(`[data-content-type="heading"]`))?.textContent.trim()??``;if(t!==``)return`under the heading ${JSON.stringify(t)}`}},w=e=>{let t=e.closest(`.bn-block-outer[data-id]`)?.getAttribute(`data-id`),n=t?v.getBlock(t):void 0;if(n?.type===`image`&&n.props.url!==``)return{name:`the picture ${n.props.url}`,written:n.props.url};if(n?.type===`component`){let e=oY(n.props.data);if(e)return{name:`the component ${ha(e)} (${e.of})`,written:e.of}}};i({hold:()=>Promise.resolve({key:`${e}@${String(t.text.length)}`,what:`The doc ${e}`,source:{path:e}}),locate:n=>{let r=T(n)[0],i=r?C(r.x,r.y):void 0;return Promise.resolve({elements:FY(document,n,e,t.text,w),...i===void 0?{}:{where:i}})},pick:n=>{let r=VY(document,n,e,t.text,w),i=C(n.x,n.y);return Promise.resolve(r&&{...r,...i===void 0?{}:{where:i}})},selected:()=>{let n=document.getSelection(),r=n&&n.rangeCount>0&&!n.isCollapsed?n.getRangeAt(0):void 0,i=r!==void 0&&x.current?.contains(r.commonAncestorContainer)===!0,a=r?.getClientRects()[0],o=a?C(a.x+1,a.y+1):void 0;return Promise.resolve(UY(document,i?r:void 0,e,t.text,w).map(e=>({...e,...o===void 0?{}:{where:o}})))}});let[E,D]=(0,W.useState)(t.state);(0,W.useEffect)(()=>t.onState(D),[t]);let[k,j]=(0,W.useState)(()=>m.page),M=(0,W.useRef)(void 0),N=pQ(v,k),P=(0,W.useCallback)(()=>{let e=M.current;e&&Wf(e,m.page)&&(M.current=void 0)},[m]),F=(0,W.useCallback)(e=>{M.current=e,j(e),t.edited()},[t]),[I,L]=(0,W.useState)(!1),R=(0,W.useCallback)(()=>{L(!0)},[]),[z,B]=(0,W.useState)(0);r(`project/changed`,e=>{B(e.revision)});let[ee,te]=(0,W.useState)(),[ne,re]=(0,W.useState)([]),ae=k.bibliography!==void 0;(0,W.useEffect)(()=>{if(!I&&!ae)return;let t=!0;return rY(f,`doc/data`,{item:e}).then(e=>{t&&(te(e.data),re(fi(e.sources??[])))},()=>void 0),()=>{t=!1}},[f,e,I,ae,z]);let V=bQ(v,ne,k.citationStyle??`apa`),{font:oe,accent:se}=k,ce=(0,W.useMemo)(()=>({...oe===void 0?{}:{font:oe},...se===void 0?{}:{accent:se}}),[oe,se]),le=(0,W.useMemo)(()=>({page:ce,base:p,data:ee,wantData:R,dark:c.theme===`dark`}),[ce,p,ee,R,c.theme]),[ue,de]=(0,W.useState)(()=>EQ(y.document)),[fe,pe]=(0,W.useState)(()=>({block:h.title,value:Qa(h.title)})),me=(0,W.useRef)(fe),he=(0,W.useRef)(null),ge=(0,W.useCallback)((e,t)=>{me.current={block:e,value:t},pe(me.current)},[]),_e=(0,W.useCallback)(()=>{let e=AY(y.document),t=o$(e)&&!o$(Za(m.shown()).body);return eo(me.current.block,t?[]:e)},[y,m]),ve=(0,W.useCallback)(e=>e<0?void 0:m.lineOf(e+ +!!Za(m.shown()).title),[m]),ye=(0,W.useCallback)(()=>y.document.map(e=>({id:e.id??``,model:AY([e])[0]})),[y]),[be,xe]=(0,W.useState)(),Se=(0,W.useCallback)((e,t=!1)=>{let n,{title:r,body:i}=Za(e),a=Qa(r),o=me.current.value;ge(r,o.replace(/\s+/g,` `).trim()===a?o:a);let s=ye().filter(e=>e.model!==void 0),c=o$(s.map(e=>e.model)),l=Nn(c?[]:s.map(e=>e.model),i,ca);y.transact(e=>{e.setMeta(`addToHistory`,!1);for(let e of l){let t=s.slice(e.at,e.at+e.remove).map(e=>e.id),r=CY(e.insert);if(c){let e=s[0];e&&r.length>0&&y.replaceBlocks([e.id],r)}else if(t.length>0){let i=y.replaceBlocks(t,r).insertedBlocks;n??=i[0]?.id??s[e.at+e.remove]?.id}else if(r.length>0){let t=s[e.at],i=s.at(-1)??ye().at(-1);t?n??=y.insertBlocks(r,t.id,`before`)[0]?.id:i&&(n??=y.insertBlocks(r,i.id,`after`)[0]?.id)}}}),t&&n!==void 0&&xe({id:n,at:Date.now()})},[y,ge,ye]),Ce=(0,W.useCallback)((e,t)=>{let n=m.incoming(e,_e());m.unreadable?d(e):(n&&Se(n,t?.kind===`agent`),P(),M.current===void 0&&j(e=>Wf(e,m.page)?e:m.page))},[_e,m,d,P,Se]),{agent:we,following:Te}=n(),H=Ze(),Ee=(()=>{if(we?.doing===void 0)return;let e=be&&be.at>=we.at-g$,n=we.source?.path===t.path;if(e&&n)return be.id;let r=n?we.source?.from:void 0,i=r===void 0?void 0:m.indexAtLine(r);if(i!==void 0){let e=+!!Za(m.shown()).title,t=ye()[Math.max(0,i-e)]?.id;if(t!==void 0&&t!==``)return t}return e?be.id:void 0})(),De=we?H(we):``;(0,W.useEffect)(()=>{zZ(v,Ee===void 0?null:{id:Ee,label:De})},[v,Ee,De]),(0,W.useEffect)(()=>{Te&&Ee!==void 0&&S(Ee)?.scrollIntoView({block:`center`})},[Te,Ee]);let Oe=(0,W.useRef)({held:_e,take:Ce,settleLook:P});(0,W.useLayoutEffect)(()=>{Oe.current={held:_e,take:Ce,settleLook:P}},[_e,Ce,P]),(0,W.useLayoutEffect)(()=>(t.attach({save:e=>(m.adopt(e),Oe.current.settleLook(),m.unreadable?void 0:m.textFor(Oe.current.held(),M.current)),take:(e,t,n)=>{m.adopt(t),Oe.current.take(e,n)}}),()=>{if(t.state!==`unsaved`||m.unreadable)return;let e;try{e=Oe.current.held()}catch{return}let n=M.current;t.attach({save:t=>(m.adopt(t),m.unreadable?void 0:m.textFor(e,n)),take:()=>void 0}),t.flush()}),[t,m]);let ke=(0,W.useRef)(JSON.stringify(o)),Ae=(0,W.useCallback)(()=>{let t=f$(y.document,x.current),n=JSON.stringify(t);n!==ke.current&&(ke.current=n,f[`storage/set`]({key:s$(e),value:Object.keys(t).length===0?null:t}).catch(()=>void 0))},[y,f,e]),je=(0,W.useCallback)(()=>{de(EQ(y.document)),Ae(),t.edited()},[t,y,Ae]),Me=(0,W.useCallback)(e=>{let t=e.replace(/\n/g,` `);ge($a(me.current.block,t),t),je()},[je,ge]);(0,W.useLayoutEffect)(()=>{let e=he.current;if(!e)return;let t=()=>{e.style.height=`0`,e.style.height=`${String(e.scrollHeight)}px`};t();let n=new ResizeObserver(t);return e.parentElement&&n.observe(e.parentElement),()=>{n.disconnect()}},[fe.value]);let Ne=(0,W.useCallback)(e=>{let t=y.document[0];if(t?.id===void 0)return;let n=t.id;e===void 0||e===``&&o$(AY([t]))||(y.insertBlocks([{type:`paragraph`,content:e===``?[]:[{type:`text`,text:e,styles:{}}]}],t.id,`before`),n=y.document[0]?.id??t.id);try{v.setTextCursorPosition(n,`start`)}catch{}v.focus()},[v,y]),Pe=(0,W.useCallback)(e=>{let t=he.current;if(!t)return;let n=me.current.value.length;e!==void 0&&e!==``&&Me(me.current.value+e),t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(n,n)})},[Me]),[Fe]=(0,W.useState)(l);(0,W.useEffect)(()=>{if(!Fe)return;let e=requestAnimationFrame(()=>{me.current.value.trim()===``?Pe():Ne()});return()=>{cancelAnimationFrame(e)}},[Fe,Ne,Pe]);let Ie=(0,W.useCallback)(e=>{if(e.nativeEvent.isComposing)return;let t=e.currentTarget;if(e.key===`Enter`){e.preventDefault();let n=t.value.slice(t.selectionEnd);n!==``&&Me(t.value.slice(0,t.selectionStart)),Ne(n);return}let n=parseFloat(getComputedStyle(t).lineHeight)||0,r=t.selectionEnd===t.value.length||t.scrollHeight<n*1.5;(e.key===`ArrowDown`&&r||e.key===`Tab`&&!e.shiftKey)&&(e.preventDefault(),Ne())},[Me,Ne]),Le=(0,W.useRef)([]),Re=(0,W.useCallback)(async()=>{try{Le.current=(await En(f,`project/items`,{})).items}catch{}return Le.current},[f]);(0,W.useEffect)(()=>{Re()},[Re]);let ze=(0,W.useCallback)(async()=>nX(e,await Re()),[Re,e]),Be=(0,W.useRef)([]),Ve=(0,W.useCallback)(async()=>{try{let e=O(c.locale);Be.current=(await En(f,`components/list`,{item:p})).components.map(t=>({of:t.of,name:t.name,title:typeof t.label==`string`?t.label:t.label?.[e]??t.label?.en??t.name}))}catch{}return Be.current},[f,p,c.locale]);(0,W.useEffect)(()=>{let t=x.current;if(!t)return;let n=e=>{if(e.button!==0)return;let t=e.target?.closest(`.bn-editor a[href]`)?.getAttribute(`href`);return t!=null&&t!==``&&!ZY.test(t)?t:void 0},r=e=>{n(e)!==void 0&&(e.preventDefault(),e.stopPropagation())},i=t=>{let r=n(t);if(r===void 0)return;t.preventDefault(),t.stopPropagation();let i=rX(e,r);i!==void 0&&f[`items/open`]({target:{type:`file`,path:i}}).catch(()=>void 0)};return t.addEventListener(`mousedown`,r,!0),t.addEventListener(`mouseup`,r,!0),t.addEventListener(`click`,i,!0),()=>{t.removeEventListener(`mousedown`,r,!0),t.removeEventListener(`mouseup`,r,!0),t.removeEventListener(`click`,i,!0)}},[f,e]),(0,W.useEffect)(()=>{let e=x.current;if(!e)return;let t=e=>{e.target?.closest(`.bn-toggle-button`)&&Ae()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}},[Ae]);let He=(0,W.useCallback)(()=>(0,G.jsx)(cZ,{aligns:s.aligns,tags:s}),[s]),[Ue,We]=(0,W.useState)(),Ge=(0,W.useCallback)(e=>{let t=x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`),n=x.current?.closest(`.doc-sheet`);if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();We({id:e,at:{x:Math.max(8,r.left-i.left),y:Math.min(r.top-i.top+28,i.height-320)}})},[]);XY(v,x,(0,W.useMemo)(()=>({onActions:Ge,onTitle:Pe}),[Ge,Pe]));let Ke=(0,W.useMemo)(()=>{let t=Ue?.id;if(t===void 0)return[];let n=()=>{let e=y.getSelection()?.blocks??[],n=y.document.find(e=>e.id===t);return e.some(e=>e.id===t)?e:n?[n]:[]};return[...XX.flatMap(e=>{let t=ZX(e);return t?[{key:`turn:${e}`,title:s.blocks[e],icon:pZ(e),group:s.turnInto,run:()=>{for(let e of n())e.id!==void 0&&y.updateBlock(e.id,t)}}]:[]}),{key:`duplicate`,title:s.duplicate,icon:st,run:()=>{let e=n(),t=e.at(-1);t?.id!==void 0&&y.insertBlocks(e.map(WY),t.id,`after`)}},{key:`place`,title:s.copyPlace,icon:dt,run:()=>{let n=ve(y.document.findIndex(e=>e.id===t));navigator.clipboard.writeText(n===void 0?e:`${e}:${String(n)}`).catch(()=>void 0)}},{key:`delete`,title:s.remove,icon:hn,run:()=>{y.removeBlocks(n().flatMap(e=>e.id===void 0?[]:[e.id]))}}]},[Ue,y,ve,e,s]),qe=(0,W.useCallback)(e=>(0,G.jsx)(dZ,{...e,strings:s,onActions:Ge}),[Ge,s]),Je=(0,W.useMemo)(()=>({useFloatingOptions:{middleware:[A(({elements:e})=>({mainAxis:m$,crossAxis:b$(e.reference)}))]}}),[]),Xe=(0,W.useCallback)(e=>{x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})},[]),[Qe,$e]=(0,W.useState)(!1),et=(0,W.useCallback)(e=>{let t=Od(m.source).blocks,n=[...da(t)][e];if(n===void 0)return;let r=t.find(e=>e===n||[...da([e])].includes(n)),{title:i,body:a}=Za(ma(t));if(r===void 0)return;if(r===i){x.current?.scrollTo({top:0,behavior:`smooth`}),he.current?.focus();return}let o=v.document[a.indexOf(r)]?.id;o!==void 0&&Xe(o)},[m,v,Xe]),tt=fe.block?.type===`heading`?fe.block.look?.align:void 0,nt=c.mode!==`edit`,rt=!nt,it=no(k),at=ro(k),ot={"--doc-text":it.text,"--doc-heading":it.heading,"--doc-mono":it.mono,...at===void 0?{}:{"--doc-accent":at}};return(0,G.jsx)(yX.Provider,{value:le,children:(0,G.jsx)(BZ.Provider,{value:b,children:(0,G.jsx)(uQ.Provider,{value:N,children:(0,G.jsx)(_Q.Provider,{value:V,children:(0,G.jsx)(xn,{children:(0,G.jsx)(`div`,{className:u,"data-testid":`doc-editor`,"data-state":E,"data-read-only":nt?``:void 0,lang:ie[O(c.locale)],children:(0,G.jsxs)(`div`,{className:`doc-sheet`,style:ot,"data-font":k.font??`sans`,"data-accent":at===void 0?void 0:``,children:[(0,G.jsx)(Ye,{saved:{state:E},start:nt?void 0:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(oQ,{look:k,words:s,chinese:O(c.locale).startsWith(`zh`),onLook:F}),(0,G.jsxs)(Wn,{"data-testid":`doc-pages-button`,"aria-pressed":Qe,"data-state":Qe?`on`:`off`,onClick:()=>{$e(e=>!e)},children:[(0,G.jsx)(Br,{}),s.pages]})]})}),Ue!==void 0&&(0,G.jsx)(fZ,{actions:Ke,placeholder:s.find,empty:s.nothing,at:Ue.at,onClose:()=>{We(void 0)}}),(0,G.jsxs)(`div`,{className:`doc-split`,children:[(0,G.jsxs)(`div`,{className:`doc-scroll`,ref:x,children:[(0,G.jsx)(IZ,{place:`top`,look:k,dir:p,words:s,editable:rt,onLook:F}),(0,G.jsxs)(`div`,{className:`doc-body`,children:[(0,G.jsxs)(`div`,{className:`doc-column`,children:[(0,G.jsxs)(`div`,{className:`doc-title-row group/title`,children:[(0,G.jsx)(IZ,{place:`title`,look:k,dir:p,words:s,editable:rt,onLook:F}),(0,G.jsx)(`textarea`,{ref:he,className:`doc-title`,"data-testid":`doc-title-field`,rows:1,value:fe.value,placeholder:s.untitled,"aria-label":s.title,readOnly:nt,style:tt?{textAlign:tt}:void 0,onChange:e=>{Me(e.target.value)},onKeyDown:Ie})]}),(0,G.jsxs)(tY,{editor:v,editable:!nt,theme:c.theme,formattingToolbar:!1,slashMenu:!1,sideMenu:!1,onChange:je,children:[(0,G.jsx)(bM,{formattingToolbar:He}),(0,G.jsx)(v$,{words:s,components:Ve}),(0,G.jsx)(y$,{links:ze,empty:s.nothingToLink}),(0,G.jsx)(RM,{sideMenu:qe,floatingUIOptions:Je})]})]}),(0,G.jsx)(DQ,{entries:ue,label:s.outline,scroller:x,onGo:Xe})]})]}),Qe&&rt&&(0,G.jsx)(lQ,{item:e,stamp:`${String(z)}:${E}`,words:s,onGo:et})]})]})})})})})})})}function S$(e){let t=a(),n=o(),r=e.path??n?.item.entry,i=Lf.of(n?.locale),[s,c]=(0,W.useState)(),[l,u]=(0,W.useState)(),[d,f]=(0,W.useState)(),[p,m]=(0,W.useState)(0);(0,W.useEffect)(()=>{if(r===void 0)return;let e=!0,n;return Promise.all([Ce.open(t,r),(e=>t[`storage/get`]({key:e}).then(e=>e.value,()=>null))(s$(r))]).then(([t,i])=>{n=t,e?(c({path:r,file:t,toggles:c$(i)}),f(Jf(Od(t.text))?t.text:void 0),u(void 0)):t.close()},t=>{e&&u(t instanceof Error?t.message:``)}),()=>{e=!1,n?.close()}},[t,r]);let h=s?.file;(0,W.useEffect)(()=>{h&&d!==void 0&&h.attach({save:()=>void 0,take:e=>{Jf(Od(e))?f(e):(f(void 0),m(e=>e+1))}})},[h,d]);let g=`doc-page${e.bare===!0?` doc-bare`:``} ${e.className??``}`,_=ie[O(n?.locale)];return l===void 0?!s||!n||s.path!==r?(0,G.jsx)(`div`,{className:g,lang:_,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsx)(`p`,{className:`doc-message`,children:i.loading})})}):d===void 0?(0,G.jsx)(XQ.Provider,{value:i,children:(0,G.jsx)(aX.Provider,{value:{item:On(r),path:r,locale:O(n.locale),readOnly:n.mode!==`edit`,words:i},children:(0,G.jsx)(x$,{path:r,file:s.file,toggles:s.toggles,words:i,context:n,autoFocus:e.autoFocus??!1,className:g,onUnreadable:f},`${r}:${String(p)}`)})}):(0,G.jsx)(C$,{className:g,text:d,words:i,lang:_}):(0,G.jsx)(`div`,{className:g,lang:_,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsx)(`p`,{role:`alert`,className:`doc-message doc-message-problem`,children:l})})})}function C$({className:e,text:t,words:n,lang:r}){let i=Od(t).problems[0]?.message;return(0,G.jsx)(`div`,{className:e,lang:r,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsxs)(`div`,{className:`doc-scroll doc-unreadable`,"data-testid":`doc-unreadable`,children:[(0,G.jsx)(`p`,{className:`doc-message`,children:n.unreadable}),(0,G.jsx)(`p`,{className:`doc-message doc-message-problem`,children:i}),(0,G.jsx)(`pre`,{children:t})]})})})}export{S$ as DocEditor,S$ as default,Yf as DocModel,Lf as WORDS,Rf as blockNoteDictionary,FY as blocksAt,nX as docLinks,AY as fromEditor,NY as lineOf,rX as linkTarget,Vf as merge3,tX as projectPath,QY as relativePath,Hf as restoreSource,CY as toEditor};
|