@fewangsit/wangsvue-fats 1.0.0-alpha.42 → 1.0.0-alpha.43
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/ButtonCopy-C6DSmsOR.es.js +4 -0
- package/ButtonCopy-CeBlNyVx.system.js +1 -0
- package/ButtonSync-BLyCwwnU.system.js +1 -0
- package/ButtonSync-DtUhn-Q-.es.js +4 -0
- package/ButtonToggle-B9Fa75pf.es.js +4 -0
- package/ButtonToggle-CSxzlLR2.system.js +1 -0
- package/ButtonViewLog-B1oa4oFN.es.js +4 -0
- package/ButtonViewLog-_J6r7Oz8.system.js +1 -0
- package/Card-B19WgA6Y.es.js +4 -0
- package/Card-umUgd-nP.system.js +1 -0
- package/InputEmail-BZ5Y0wSk.system.js +1 -0
- package/InputEmail-DR_E1DsL.es.js +4 -0
- package/InputURL-DL6a94kM.system.js +1 -0
- package/InputURL-PVF5EUUY.es.js +4 -0
- package/Loading-Cq7rP88c.system.js +1 -0
- package/Loading-DUHTVct4.es.js +4 -0
- package/UserWithIcon-Ddn_GlNu.system.js +1 -0
- package/UserWithIcon-hWXf-A2U.es.js +4 -0
- package/async-components/index-C8nb7p3T.es.js +70 -0
- package/async-components/index-DvjqHrYE.system.js +1 -0
- package/components/animation/Animation-CCEnvZ_Z.es.js +48 -0
- package/components/animation/Animation-CJb4YIwm.system.js +1 -0
- package/components/approverinfo/ApproverInfo-Bruotw1h.es.js +127 -0
- package/components/approverinfo/ApproverInfo-CoWywuLZ.system.js +1 -0
- package/components/assetinfo/AssetInfo-B8KAsqvC.system.js +1 -0
- package/components/assetinfo/AssetInfo-DNsWx4Xv.es.js +201 -0
- package/components/badge/Badge-DXAyz4Z8.es.js +99 -0
- package/components/badge/Badge-wSExdsOP.system.js +1 -0
- package/components/badgegroup/BadgeGroup-CAYL_5-g.system.js +1 -0
- package/components/badgegroup/{BadgeGroup-Bj0EjoML.es.js → BadgeGroup-Dl2cL80L.es.js} +8 -8
- package/components/basetree/BaseTree-CmBp0uwr.system.js +1 -0
- package/components/basetree/{BaseTree-DLSA5FMh.es.js → BaseTree-RsvvntBp.es.js} +4 -4
- package/components/{treenode/TreeNode-KJOUvlTH.es.js → basetree/TreeNode-CUL5_2Rj.es.js} +5 -5
- package/components/basetree/TreeNode-D-YgXird.system.js +1 -0
- package/components/breadcrumb/Breadcrumb-BmuuCYJx.system.js +1 -0
- package/components/breadcrumb/{Breadcrumb-BWSmLPqn.es.js → Breadcrumb-oqdG9WGT.es.js} +5 -5
- package/components/button/{Button-D-MSv_AS.es.js → Button-CgkhMnxo.es.js} +20 -16
- package/components/button/Button-D892iaxz.system.js +1 -0
- package/components/buttonbulkaction/ButtonBulkAction-CAamlaLP.system.js +1 -0
- package/components/buttonbulkaction/{ButtonBulkAction-B4RcdWmb.es.js → ButtonBulkAction-Tdf3aVtp.es.js} +55 -51
- package/components/buttoncopy/{ButtonCopy-BZgQAFOM.es.js → ButtonCopy-CUFHlIO-.es.js} +4 -4
- package/components/buttoncopy/ButtonCopy-CZPTLNHh.system.js +1 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +6 -4
- package/components/buttondownload/ButtonDownload-BWGTiJnP.es.js +61 -0
- package/components/buttondownload/ButtonDownload-CUR6u0AT.system.js +1 -0
- package/components/buttonfilter/ButtonFilter-B1F4poKd.system.js +1 -0
- package/components/buttonfilter/{ButtonFilter-BIE-jM2i.es.js → ButtonFilter-B49leY-q.es.js} +3 -3
- package/components/buttonradio/{ButtonRadio-5VUY8o5h.es.js → ButtonRadio-D6xKhPLg.es.js} +2 -2
- package/components/buttonradio/ButtonRadio-NBcy0Epa.system.js +1 -0
- package/components/buttonscan/ButtonScan-BZzpqBe8.system.js +1 -0
- package/components/buttonscan/ButtonScan-mVHAdACL.es.js +387 -0
- package/components/buttonscan/workers/scanner.worker-8_0GG6W3.system.js +1 -0
- package/components/buttonscan/workers/scanner.worker-D3a72Zyk.es.js +25 -0
- package/components/buttonsearch/ButtonSearch-3hnarf3D.system.js +1 -0
- package/components/buttonsearch/{ButtonSearch-Clbafqts.es.js → ButtonSearch-BjcXUDQZ.es.js} +16 -16
- package/components/buttonselecttree/{ButtonSelectTree-B-_Iw5sB.es.js → ButtonSelectTree-D0lT3Exu.es.js} +33 -33
- package/components/buttonselecttree/ButtonSelectTree-DKmPV8FD.system.js +1 -0
- package/components/buttonselectuser/ButtonSelectUser-B7GbLfS-.system.js +1 -0
- package/components/buttonselectuser/{ButtonSelectUser-Ar7Y8tVR.es.js → ButtonSelectUser-OAZRY9OR.es.js} +23 -23
- package/components/buttonsync/{ButtonSync-Bc1GZXT6.es.js → ButtonSync-Brk16H8C.es.js} +2 -2
- package/components/buttonsync/{ButtonSync-ClllEdAy.system.js → ButtonSync-D5lXmtHs.system.js} +1 -1
- package/components/buttontoggle/{ButtonToggle-DIy3M8Pz.es.js → ButtonToggle-1R5y5DCx.es.js} +3 -3
- package/components/buttontoggle/ButtonToggle-DLsiXxjK.system.js +1 -0
- package/components/buttonviewlog/{ButtonViewLog-h9uVv5A5.es.js → ButtonViewLog-CGsSkrzf.es.js} +1 -1
- package/components/buttonviewlog/{ButtonViewLog-Ct8QwEey.system.js → ButtonViewLog-leLO6F_N.system.js} +1 -1
- package/components/{basecalendar/BaseCalendar-47ahYXrt.es.js → calendar/BaseCalendar-5EI1UTbl.es.js} +19 -19
- package/components/calendar/BaseCalendar-C02-gmOQ.system.js +1 -0
- package/components/calendar/{Calendar-Df6CnW-l.es.js → Calendar-B2z-lfi9.es.js} +5 -5
- package/components/calendar/Calendar-CWw4R5mN.system.js +1 -0
- package/components/card/{Card-CwnxKNdM.es.js → Card-BccG14LV.es.js} +1 -1
- package/components/card/{Card-BUKU2FcT.system.js → Card-BjI-Xi0S.system.js} +1 -1
- package/components/checkbox/{Checkbox-DdsR222S.es.js → Checkbox-DBU7Ji2C.es.js} +3 -3
- package/components/checkbox/Checkbox-FZg_wq3C.system.js +1 -0
- package/components/codesnippet/{CodeSnippet-Bpps-Iyc.es.js → CodeSnippet--pMQi4aO.es.js} +7 -7
- package/components/codesnippet/CodeSnippet-BVwAQPSv.system.js +2 -0
- package/components/customcolumn/ColumnList-fdR5JfHj.es.js +159 -0
- package/components/customcolumn/ColumnList-yaNVEQFA.system.js +1 -0
- package/components/customcolumn/CustomColumn-CfvCLH4v.es.js +139 -0
- package/components/customcolumn/CustomColumn-D3u59-Rd.system.js +1 -0
- package/components/customcolumn/helpers/setVisibilityColumn.helper-B1vEZDtD.system.js +1 -0
- package/components/customcolumn/helpers/setVisibilityColumn.helper-CQ4P_C_9.es.js +16 -0
- package/components/datatable/DataTable-BH7Fk88O.es.js +992 -0
- package/components/datatable/DataTable-Cko2S6sM.system.js +1 -0
- package/components/{multirow/MultiRow-ClSMxrEx.es.js → datatable/MultiRow-B2vMSb7W.es.js} +9 -9
- package/components/datatable/MultiRow-Sef5icam.system.js +1 -0
- package/components/datatable/store/dataTable.store-B4p-hj3w.es.js +37 -0
- package/components/datatable/store/dataTable.store-C9376aEJ.system.js +1 -0
- package/components/dialog/{Dialog-Dy93f91f.es.js → Dialog-BCcbXSya.es.js} +5 -5
- package/components/dialog/Dialog-Dv7Jzg4E.system.js +1 -0
- package/components/dialogconfirm/DialogConfirm-BU-LRZCo.system.js +1 -0
- package/components/dialogconfirm/{DialogConfirm-BOFb7rJD.es.js → DialogConfirm-ByIWXisz.es.js} +24 -24
- package/components/dialogform/DialogForm-DGl_NOEr.system.js +1 -0
- package/components/dialogform/{DialogForm-C15nC1wH.es.js → DialogForm-tAbix3iC.es.js} +52 -53
- package/components/dialogselecttree/{DialogSelectTree-BA8xEqco.es.js → DialogSelectTree-BrVtt3iG.es.js} +13 -13
- package/components/dialogselecttree/DialogSelectTree-CT7dKC5N.system.js +1 -0
- package/components/dialogselectuser/DialogSelectUser-Bu7z7lUq.es.js +121 -0
- package/components/dialogselectuser/DialogSelectUser-DXL_NMJj.system.js +1 -0
- package/components/dialogselectuser/DialogSelectUserFilter-BNbIynoa.system.js +1 -0
- package/components/{dialogselectuserfilter/DialogSelectUserFilter-Dz5OxAU-.es.js → dialogselectuser/DialogSelectUserFilter-BgBrQCz1.es.js} +14 -10
- package/components/dialogselectuser/options/columns-BKDHtwAp.es.js +71 -0
- package/components/dialogselectuser/options/columns-DLmJdDTR.system.js +1 -0
- package/components/dropdown/Dropdown-BNzT2uLU.system.js +1 -0
- package/components/dropdown/{Dropdown-D4S52rW5.es.js → Dropdown-Dk4urj-W.es.js} +50 -44
- package/components/{codesnippetadapter/CodeSnippetAdapter-jgXoPKzr.es.js → editor/CodeSnippetAdapter-C0f7wytw.es.js} +4 -4
- package/components/editor/CodeSnippetAdapter-f-VHwbwS.system.js +1 -0
- package/components/editor/{Editor-DQ7Xdy30.es.js → Editor-RB5MqBs1.es.js} +292 -441
- package/components/editor/Editor-upU4Z9FH.system.js +1 -0
- package/components/{editorbutton/EditorButton-DmVrr4Bk.system.js → editor/EditorButton-CC6U1a_u.system.js} +1 -1
- package/components/{editorbutton/EditorButton-DDgS2vga.es.js → editor/EditorButton-Cfew79JD.es.js} +1 -1
- package/components/editor/MentionList-BjWKefLh.system.js +1 -0
- package/components/{mentionlist/MentionList--7AymnhE.es.js → editor/MentionList-CdX0_-TK.es.js} +4 -4
- package/components/{mentionsection/MentionSection-C_c4qbpq.es.js → editor/MentionSection-5I-FSwew.es.js} +1 -1
- package/components/{mentionsection/MentionSection-C1gWOzH2.system.js → editor/MentionSection-CiuaeX4J.system.js} +1 -1
- package/components/editor/codeSnippetExtension-C-ADHg2S.es.js +40 -0
- package/components/editor/codeSnippetExtension-C3uj0fCk.system.js +1 -0
- package/components/editor/mentionSectionExtension-DJ6wkX1L.system.js +1 -0
- package/components/editor/mentionSectionExtension-rbWufuMT.es.js +46 -0
- package/components/editor/suggestion-BcYK0KeI.system.js +1 -0
- package/components/editor/suggestion-mkkpQFP-.es.js +41 -0
- package/components/fieldwrapper/FieldWrapper-Dc-stQRH.system.js +1 -0
- package/components/fieldwrapper/{FieldWrapper-C6HJ2HnC.es.js → FieldWrapper-DmOogUM5.es.js} +12 -11
- package/components/fileupload/{FileUpload-B6PAucnD.es.js → FileUpload-0EHKlInu.es.js} +11 -11
- package/components/fileupload/FileUpload-dXrsIAeC.system.js +1 -0
- package/components/filtercontainer/FilterContainer-Cd8TpncM.es.js +234 -0
- package/components/filtercontainer/FilterContainer-kkw3n3tu.system.js +1 -0
- package/components/filtercontainer/helpers/applyFilter.helper-Ci22FrPF.system.js +1 -0
- package/components/filtercontainer/helpers/applyFilter.helper-DpVdjYBr.es.js +56 -0
- package/components/form/Form-By85t_oI.system.js +1 -0
- package/components/form/{Form-eSj-nb1y.es.js → Form-DhWBpdkq.es.js} +42 -42
- package/components/hardwaresync/{HardwareSync-DUsVwHx1.es.js → HardwareSync-BckCfIeF.es.js} +21 -19
- package/components/hardwaresync/HardwareSync-DcgVc0cL.system.js +1 -0
- package/components/hardwaresync/store/device.store-DEKXH36R.system.js +1 -0
- package/components/hardwaresync/store/device.store-DpVE6Nhl.es.js +20 -0
- package/components/icon/{Icon-mDqG7urn.es.js → Icon-C4kXVcEX.es.js} +4 -4
- package/components/icon/Icon-D1a666FC.system.js +1 -0
- package/components/image/{Image-BZ31CL-y.es.js → Image-Bf5EaBWP.es.js} +21 -20
- package/components/image/Image-Cxi0E9gK.system.js +1 -0
- package/components/imagecompressor/BackgroundImageCropper-DhrTpgNX.system.js +1 -0
- package/components/imagecompressor/BackgroundImageCropper-hiHqCcIy.es.js +52 -0
- package/components/imagecompressor/ImageCompressor-C_vnTwmo.system.js +1 -0
- package/components/imagecompressor/{ImageCompressor-DaW0ak9c.es.js → ImageCompressor-DPo-1Yo8.es.js} +207 -199
- package/components/{imageinputinfo/ImageInputInfo-oTtVBxzO.es.js → imagecompressor/ImageInputInfo-4Ac8cBDM.es.js} +2 -2
- package/components/imagecompressor/ImageInputInfo-U3hLlbwo.system.js +1 -0
- package/components/index-BMti6lK3.es.js +64 -0
- package/components/index-DBzSxIov.system.js +1 -0
- package/components/index.d.ts +162 -60
- package/components/inlinemessage/{InlineMessage-CBZT3jWS.es.js → InlineMessage-BPJD82sq.es.js} +12 -12
- package/components/inlinemessage/InlineMessage-DTyTe5_W.system.js +1 -0
- package/components/inputbadge/InputBadge-BUm6Kn-F.system.js +1 -0
- package/components/inputbadge/{InputBadge-CsdT7M7-.es.js → InputBadge-BngtjqHQ.es.js} +13 -13
- package/components/inputcurrency/{InputCurrency-B96npK8W.es.js → InputCurrency-CE4WrJ9k.es.js} +16 -13
- package/components/inputcurrency/InputCurrency-DaJuUujH.system.js +1 -0
- package/components/inputemail/InputEmail-8E04RVeq.system.js +1 -0
- package/components/inputemail/{InputEmail-BMzumenA.es.js → InputEmail-BFeY1l9Z.es.js} +1 -1
- package/components/inputgroup/{InputGroup-G9TEI4vX.system.js → InputGroup-CTHxHL8n.system.js} +1 -1
- package/components/inputgroup/{InputGroup-eNDRlJ5R.es.js → InputGroup-CUxNAtDZ.es.js} +1 -1
- package/components/inputnumber/InputNumber-BJ8Qm27k.system.js +1 -0
- package/components/inputnumber/{InputNumber-Bzk_YzWM.es.js → InputNumber-CQd01PQ5.es.js} +7 -7
- package/components/inputpassword/InputPassword-D3jaUFfR.system.js +1 -0
- package/components/inputpassword/{InputPassword-BMHMWLgU.es.js → InputPassword-DGWsHAB4.es.js} +10 -10
- package/components/inputphonenumber/InputPhoneNumber-3To4Ktp9.system.js +1 -0
- package/components/inputphonenumber/InputPhoneNumber-DVAOWAj6.es.js +162 -0
- package/components/inputphonenumber/helpers/getUserLocation.helper-B0lZav7S.es.js +15 -0
- package/components/inputphonenumber/helpers/getUserLocation.helper-CSC5I9tB.system.js +1 -0
- package/components/inputphonenumber/helpers/timeZoneCityToCountry.json-CUP9NUYE.es.js +423 -0
- package/components/inputphonenumber/helpers/timeZoneCityToCountry.json-DgzOgH_M.system.js +1 -0
- package/components/inputrangenumber/{InputRangeNumber-B1aAoKVj.es.js → InputRangeNumber-Cfea6oM_.es.js} +5 -5
- package/components/inputrangenumber/InputRangeNumber-iLScQOa6.system.js +1 -0
- package/components/inputsearch/{InputSearch-cPq3vqhy.es.js → InputSearch-CHJP-N57.es.js} +3 -3
- package/components/inputsearch/InputSearch-DkB4O0Dc.system.js +1 -0
- package/components/inputtext/{InputText-_xEnXysf.es.js → InputText-BEDxrRqK.es.js} +14 -13
- package/components/inputtext/InputText-BOgH8xpA.system.js +1 -0
- package/components/inputurl/{InputURL-aqx1PVKL.es.js → InputURL-CNrOkrAC.es.js} +1 -1
- package/components/inputurl/InputURL-D4QWV9G7.system.js +1 -0
- package/components/litedropdown/{LiteDropdown-DcSzP11l.es.js → LiteDropdown-BbDUnfnd.es.js} +11 -11
- package/components/litedropdown/LiteDropdown-DTXwb5JR.system.js +1 -0
- package/components/loading/{Loading-D8M801C9.es.js → Loading-DIfTUHr7.es.js} +6 -6
- package/components/loading/Loading-Vb4HctBJ.system.js +1 -0
- package/components/menu/{Menu-BmTMFwBD.es.js → Menu-BtzGGhbp.es.js} +14 -14
- package/components/menu/Menu-CPm5vua_.system.js +1 -0
- package/components/menuitem/MenuItem-8yxkFTug.system.js +1 -0
- package/components/menuitem/{MenuItem-LoZMc0T9.es.js → MenuItem-uLVAqgBS.es.js} +1 -1
- package/components/multiselect/{MultiSelect-DGhS1EyX.es.js → MultiSelect-BoPpQ31j.es.js} +15 -15
- package/components/multiselect/MultiSelect-D5NEDtGe.system.js +1 -0
- package/components/overlaypanel/OverlayPanel-BKCivqTs.system.js +1 -0
- package/components/overlaypanel/{OverlayPanel-DXNek7Yb.es.js → OverlayPanel-bQbjuUgG.es.js} +10 -10
- package/components/tabmenu/TabMenu-BBk8EW-C.system.js +1 -0
- package/components/tabmenu/{TabMenu-iMeZa8gy.es.js → TabMenu-ByKBaVsd.es.js} +13 -13
- package/components/tagtype/{TagType-CX7BVRrE.es.js → TagType-CAXomDiD.es.js} +4 -4
- package/components/tagtype/TagType-i4RK2JbL.system.js +1 -0
- package/components/textarea/{Textarea-ClnQ2qmf.es.js → Textarea-CnAlgPq5.es.js} +5 -5
- package/components/textarea/Textarea-qirKOw5z.system.js +1 -0
- package/components/timeline/Timeline-CF2qJo4E.es.js +120 -0
- package/components/timeline/Timeline-DKfKWZFI.system.js +1 -0
- package/components/{timelinecontentbytype/TimelineContentByType-ehFLzTA1.es.js → timeline/TimelineContentByType-_cKGDWAW.es.js} +48 -51
- package/components/timeline/TimelineContentByType-uxM3NSqd.system.js +1 -0
- package/components/toast/Toast-C3D50rGo.system.js +1 -0
- package/components/toast/{Toast-DnALWJkx.es.js → Toast-DRUJCz4I.es.js} +4 -4
- package/components/toggleswitch/{ToggleSwitch-wRjnHRIw.es.js → ToggleSwitch-De-_8nQl.es.js} +2 -2
- package/components/toggleswitch/ToggleSwitch-DuyahX09.system.js +1 -0
- package/components/transactionroles/{TransactionRoles-B_67h5wb.es.js → TransactionRoles-WrcXMwBu.es.js} +2 -2
- package/components/transactionroles/TransactionRoles-iVQyWseb.system.js +1 -0
- package/components/tree/Tree-93NvdElH.es.js +267 -0
- package/components/tree/Tree-BTTVTAEH.system.js +1 -0
- package/components/tree/helpers/filterNodeKeys.helper-CmamKUTa.system.js +1 -0
- package/components/tree/helpers/filterNodeKeys.helper-z7SxLuvZ.es.js +10 -0
- package/components/treesearchinput/TreeSearchInput-BG2TfunA.system.js +1 -0
- package/components/treesearchinput/{TreeSearchInput-B1PmhE7k.es.js → TreeSearchInput-CNfoc3f6.es.js} +5 -5
- package/components/username/UserName-A1N6Q7bS.system.js +1 -0
- package/components/username/{UserName-CWs83BX6.es.js → UserName-D5C0qdbu.es.js} +45 -43
- package/components/userwithicon/{UserWithIcon-Dn3aNKdq.es.js → UserWithIcon-CHHDfQG0.es.js} +3 -3
- package/components/userwithicon/UserWithIcon-DnY6loZc.system.js +1 -0
- package/config/config.esm-BZepf1kR.system.js +1 -0
- package/config/config.esm-Drl0fECZ.es.js +212 -0
- package/config/defaultProps-B3syHUKt.system.js +1 -0
- package/config/defaultProps-BC_lvAG9.es.js +136 -0
- package/config/locale-DK6d2rJ3.system.js +1 -0
- package/config/locale-pQnRpNZ6.es.js +85 -0
- package/event-bus/index-CykcrsqY.system.js +1 -0
- package/event-bus/index-PQwO5T6B.es.js +6 -0
- package/event-bus/mitt-BjeF6e5j.es.js +53 -0
- package/event-bus/mitt-X_X8W9w9.system.js +1 -0
- package/package.json +1 -1
- package/{components/animation/Animation-COWVilAA.es.js → plugins/WangsVue-Dl5OiLXF.es.js} +36 -132
- package/plugins/WangsVue-Dugc3GRS.system.js +1 -0
- package/plugins/i18n-BVujDShu.system.js +1 -0
- package/plugins/i18n-CIoi8go0.es.js +89 -0
- package/stats.html +1 -1
- package/style.css +1 -1
- package/utils/addAttachment.util-CPzZEHNG.system.js +1 -0
- package/utils/addAttachment.util-D9sYCBjS.es.js +10 -0
- package/utils/computeAutoPlacement-Ac2MkS5B.es.js +33 -0
- package/utils/computeAutoPlacement-DCaci6j-.system.js +1 -0
- package/utils/computeOffsets-Cx9i84Mn.system.js +1 -0
- package/utils/computeOffsets-DXWJPq7f.es.js +56 -0
- package/utils/date.util-DbjB32co.es.js +198 -0
- package/utils/date.util-rX9kq_yC.system.js +1 -0
- package/utils/detectOverflow-BrAC_sJF.system.js +1 -0
- package/utils/detectOverflow-CETbaen7.es.js +88 -0
- package/utils/exportToExcel.util-Bf-PpzHW.system.js +1 -0
- package/utils/exportToExcel.util-jz7aU08m.es.js +32 -0
- package/utils/genPlaceholder.util-0UuDQpbx.es.js +37 -0
- package/utils/genPlaceholder.util-CxMG7LbT.system.js +1 -0
- package/utils/mergePropsWithDefaults.util-BKcJzgvs.es.js +9 -0
- package/utils/mergePropsWithDefaults.util-CXowvEKY.system.js +1 -0
- package/utils/object.util-6veM2gu5.es.js +51 -0
- package/utils/object.util-uApor4uP.system.js +1 -0
- package/utils/orderModifiers-qXBm1wkD.system.js +1 -0
- package/utils/orderModifiers-rOag5Cyh.es.js +31 -0
- package/utils/role.util-BdUNoOqf.es.js +67 -0
- package/utils/role.util-Co8OMWnc.system.js +1 -0
- package/utils/textFormatter.util-BjenkyWf.system.js +1 -0
- package/utils/textFormatter.util-CYul3RpH.es.js +21 -0
- package/utils/toast.util-C7p3h9XQ.es.js +52 -0
- package/utils/toast.util-DPtauJUV.system.js +1 -0
- package/utils/utils.esm-iwnsFuDg.system.js +23 -0
- package/utils/utils.esm-s_-kLKXf.es.js +1080 -0
- package/utils/xlsx.util-FKEpiU2t.system.js +1 -0
- package/utils/xlsx.util-LU1upHR3.es.js +8 -0
- package/vendor/@popperjs/core-DFLwc7xU.system.js +1 -0
- package/vendor/@popperjs/core-DJHUrK4e.es.js +748 -0
- package/vendor/@tiptap/{core-bnIgGWIt.system.js → core-D4rHEGhs.system.js} +3 -3
- package/vendor/@tiptap/{core-BLz8iRA3.es.js → core-DSbPv8xh.es.js} +6 -6
- package/vendor/@tiptap/{extension-bold-BnsTNqIJ.es.js → extension-bold-CvAjR8FR.es.js} +1 -1
- package/vendor/@tiptap/{extension-bold-C_KVm_D0.system.js → extension-bold-DI_Zfdzb.system.js} +1 -1
- package/vendor/@tiptap/{extension-bubble-menu-D421L1EU.system.js → extension-bubble-menu-0_0wc2P7.system.js} +1 -1
- package/vendor/@tiptap/{extension-bubble-menu-D9Vgq7yO.es.js → extension-bubble-menu-DY29ulfu.es.js} +3 -3
- package/vendor/@tiptap/{extension-bullet-list-GNj3sKw9.es.js → extension-bullet-list-BrkIcd-z.es.js} +1 -1
- package/vendor/@tiptap/{extension-bullet-list-kXXFF-_p.system.js → extension-bullet-list-CgIgW9RG.system.js} +1 -1
- package/vendor/@tiptap/{extension-code-CfQ7g1i2.es.js → extension-code-BtAtPCQQ.es.js} +1 -1
- package/vendor/@tiptap/{extension-code-Q8P1EHjz.system.js → extension-code-SOANT0O3.system.js} +1 -1
- package/vendor/@tiptap/{extension-floating-menu-CSQuJzDM.es.js → extension-floating-menu-BTwcx1u8.es.js} +3 -3
- package/vendor/@tiptap/{extension-floating-menu-8rFSweor.system.js → extension-floating-menu-Dtu9tcTW.system.js} +1 -1
- package/vendor/@tiptap/{extension-heading-ZTlCgdtc.es.js → extension-heading-B6PMnqvS.es.js} +1 -1
- package/vendor/@tiptap/{extension-heading-BE64-Rg_.system.js → extension-heading-BpK6SnFO.system.js} +1 -1
- package/vendor/@tiptap/{extension-history-GLkLmX-Y.system.js → extension-history-CTFK6g3n.system.js} +1 -1
- package/vendor/@tiptap/{extension-history-eJIThEn-.es.js → extension-history-DdPDTH0G.es.js} +2 -2
- package/vendor/@tiptap/{extension-image-rKrdkZpJ.system.js → extension-image-BNa6azmK.system.js} +1 -1
- package/vendor/@tiptap/{extension-image-B8NPUVFM.es.js → extension-image-DCo2JDZp.es.js} +1 -1
- package/vendor/@tiptap/{extension-italic-C_CyJubw.es.js → extension-italic-D09oL4ps.es.js} +1 -1
- package/vendor/@tiptap/{extension-italic-Dg0Nosoc.system.js → extension-italic-w93Lmtg_.system.js} +1 -1
- package/vendor/@tiptap/{extension-link-D4PFdLvA.es.js → extension-link-CV6Fodq9.es.js} +3 -3
- package/vendor/@tiptap/{extension-link-Cd8bTMBz.system.js → extension-link-FrdAKaJ2.system.js} +1 -1
- package/vendor/@tiptap/{extension-list-item-Mnhfw2gP.system.js → extension-list-item-BRio_hHs.system.js} +1 -1
- package/vendor/@tiptap/{extension-list-item-7pIJ7t09.es.js → extension-list-item-D8wSpPxS.es.js} +1 -1
- package/vendor/@tiptap/{extension-mention-Dkg-tbrz.es.js → extension-mention-cFXQdAs7.es.js} +3 -3
- package/vendor/@tiptap/{extension-mention-DVF3rX_z.system.js → extension-mention-y62_tYRn.system.js} +1 -1
- package/vendor/@tiptap/{extension-ordered-list-DLI4xDN8.es.js → extension-ordered-list-BZU-Ty3o.es.js} +1 -1
- package/vendor/@tiptap/{extension-ordered-list-Hl0QU8Zt.system.js → extension-ordered-list-CH9LyYR1.system.js} +1 -1
- package/vendor/@tiptap/{extension-placeholder-V0iTxU19.es.js → extension-placeholder-CsBxoitZ.es.js} +3 -3
- package/vendor/@tiptap/{extension-placeholder-BeLl2T-f.system.js → extension-placeholder-Dqw7HNAJ.system.js} +1 -1
- package/vendor/@tiptap/{extension-underline-DsGbvz80.es.js → extension-underline-DklFOEoR.es.js} +1 -1
- package/vendor/@tiptap/{extension-underline-BdcAQ4JH.system.js → extension-underline-SGsaBlAL.system.js} +1 -1
- package/vendor/@tiptap/{suggestion-BpZSO8Lm.system.js → suggestion-B3Grok9m.system.js} +1 -1
- package/vendor/@tiptap/{suggestion-C4sBhJAD.es.js → suggestion-Dg-vhPtN.es.js} +5 -5
- package/vendor/@tiptap/{vue-3-DceiR7pK.es.js → vue-3-BOfcUn5G.es.js} +19 -19
- package/vendor/@tiptap/{vue-3-BH1pZykd.system.js → vue-3-ZMNXXvBd.system.js} +1 -1
- package/vendor/{highlight.js-BAruEf1H.system.js → highlight.js-ClnJXT0q.system.js} +1 -1
- package/vendor/{highlight.js-DHowhWoU.es.js → highlight.js-Czlvg6fB.es.js} +1 -1
- package/vendor/{lodash-DbIT-6qv.es.js → lodash-B6nNLFd3.es.js} +1 -1
- package/vendor/{lodash-DbvKLWSv.system.js → lodash-BuO1dYnQ.system.js} +1 -1
- package/vendor/{primevue-u6FsQONA.system.js → primevue-C5Z_k4WB.system.js} +29 -51
- package/vendor/{primevue-CadmDhWp.es.js → primevue-DkBtKf1Y.es.js} +2599 -3878
- package/vendor/{prosemirror-commands-DLmzIpoS.es.js → prosemirror-commands-CUjo-x4s.es.js} +1 -1
- package/vendor/{prosemirror-commands-DgY3QRzI.system.js → prosemirror-commands-Dn6KNBP0.system.js} +2 -2
- package/vendor/{prosemirror-history-BMpJFORS.es.js → prosemirror-history-BPOe4I2H.es.js} +1 -1
- package/vendor/{prosemirror-history-BrK-FTBv.system.js → prosemirror-history-BTrzvpc-.system.js} +1 -1
- package/vendor/{prosemirror-keymap-DF8LLxca.es.js → prosemirror-keymap-BvIUhswp.es.js} +1 -1
- package/vendor/{prosemirror-keymap-COb3Dq2o.system.js → prosemirror-keymap-WRY9zVpK.system.js} +1 -1
- package/vendor/{prosemirror-schema-list-BPpAP8wR.system.js → prosemirror-schema-list-Dv9KV10j.system.js} +1 -1
- package/vendor/{prosemirror-state-CwkYUmNs.es.js → prosemirror-state-BW6XGB3U.es.js} +6 -6
- package/vendor/{prosemirror-state-DzPLD-6l.system.js → prosemirror-state-COJ-aZZ4.system.js} +1 -1
- package/vendor/{prosemirror-transform-VaXuT0NM.system.js → prosemirror-transform-BXNgAhmF.system.js} +2 -2
- package/vendor/{prosemirror-view-ta7l3rKk.es.js → prosemirror-view-C9ZQp8VZ.es.js} +1 -1
- package/vendor/{prosemirror-view-JTdpiWMD.system.js → prosemirror-view-DOxSTbB-.system.js} +1 -1
- package/vendor/{simplebar-core-71xT5g0m.system.js → simplebar-core-CtWK1-xd.system.js} +1 -1
- package/vendor/{simplebar-core-Db65-Ath.es.js → simplebar-core-ofTx4QqK.es.js} +1 -1
- package/vendor/{simplebar-vue-BFEeFUIv.system.js → simplebar-vue-BHVrvuf1.system.js} +1 -1
- package/vendor/{simplebar-vue-DAxqu0eM.es.js → simplebar-vue-dpCx-K7E.es.js} +1 -1
- package/vendor/{tippy.js-CuKTz0UR.system.js → tippy.js-6wuFov1j.system.js} +1 -1
- package/vendor/{tippy.js-DNnwm2RY.es.js → tippy.js-i1ic-msv.es.js} +23 -23
- package/wangsvue-fats.js +141 -527
- package/wangsvue-fats.system.js +1 -1
- package/components/animation/Animation-6756VN9N.system.js +0 -1
- package/components/approverinfo/ApproverInfo-BdqBpNjY.system.js +0 -1
- package/components/approverinfo/ApproverInfo-C3_ibV8c.es.js +0 -321
- package/components/assetinfo/AssetInfo-BBgKToRP.system.js +0 -1
- package/components/assetinfo/AssetInfo-CmwgOU74.es.js +0 -298
- package/components/backgroundimagecropper/BackgroundImageCropper-DFHtaSyE.system.js +0 -1
- package/components/backgroundimagecropper/BackgroundImageCropper-HKzUEXq-.es.js +0 -57
- package/components/badge/Badge-CndPv5v9.system.js +0 -1
- package/components/badge/Badge-DA-XiE1C.es.js +0 -115
- package/components/badgegroup/BadgeGroup-Y-HhiHk8.system.js +0 -1
- package/components/basecalendar/BaseCalendar-Ce46jOkg.system.js +0 -1
- package/components/basetree/BaseTree-DDu1qI7t.system.js +0 -1
- package/components/breadcrumb/Breadcrumb-B5bAijry.system.js +0 -1
- package/components/button/Button-Okx1_kOu.system.js +0 -1
- package/components/buttonbulkaction/ButtonBulkAction-DLmvicRL.system.js +0 -1
- package/components/buttoncopy/ButtonCopy-CKi1bBpz.system.js +0 -1
- package/components/buttondownload/ButtonDownload-Bw9T3mbW.es.js +0 -92
- package/components/buttondownload/ButtonDownload-CpA0ryUT.system.js +0 -1
- package/components/buttonfilter/ButtonFilter-C4WRvUrj.system.js +0 -1
- package/components/buttonradio/ButtonRadio-B2wWrgB5.system.js +0 -1
- package/components/buttonscan/ButtonScan-BCScT2cx.es.js +0 -421
- package/components/buttonscan/ButtonScan-TbyhlW5M.system.js +0 -1
- package/components/buttonsearch/ButtonSearch-e57pD5r3.system.js +0 -1
- package/components/buttonselecttree/ButtonSelectTree-Cbq1oeVK.system.js +0 -1
- package/components/buttonselectuser/ButtonSelectUser-Cfe6m75Z.system.js +0 -1
- package/components/buttontoggle/ButtonToggle-VNp0lbcW.system.js +0 -1
- package/components/calendar/Calendar-7yBKZsvj.system.js +0 -1
- package/components/checkbox/Checkbox-CCtItmVW.system.js +0 -1
- package/components/codesnippet/CodeSnippet-DvTtZ28b.system.js +0 -2
- package/components/codesnippetadapter/CodeSnippetAdapter-BtSqWBl1.system.js +0 -1
- package/components/columnlist/ColumnList-Bh3LZlOa.system.js +0 -1
- package/components/columnlist/ColumnList-Bp7soiys.es.js +0 -204
- package/components/customcolumn/CustomColumn-CVhAbTGn.system.js +0 -1
- package/components/customcolumn/CustomColumn-Dblxjw_0.es.js +0 -138
- package/components/datatable/DataTable--mHUKNUr.system.js +0 -1
- package/components/datatable/DataTable-J1j-OKsW.es.js +0 -983
- package/components/dialog/Dialog-WEl66uTI.system.js +0 -1
- package/components/dialogconfirm/DialogConfirm-o7_v7F31.system.js +0 -1
- package/components/dialogform/DialogForm-CdpY1_-F.system.js +0 -1
- package/components/dialogselecttree/DialogSelectTree-DKxWI9Re.system.js +0 -1
- package/components/dialogselectuser/DialogSelectUser-BZTSktHZ.system.js +0 -1
- package/components/dialogselectuser/DialogSelectUser-Bu5TDAPt.es.js +0 -186
- package/components/dialogselectuserfilter/DialogSelectUserFilter-DEl4zFaX.system.js +0 -1
- package/components/dropdown/Dropdown-DuvNYyq0.system.js +0 -1
- package/components/editor/Editor-IfYw2Tps.system.js +0 -1
- package/components/fieldwrapper/FieldWrapper-DFjw9hA8.system.js +0 -1
- package/components/fileupload/FileUpload-iVAJXujV.system.js +0 -1
- package/components/filtercontainer/FilterContainer-CuMaq5Sv.es.js +0 -284
- package/components/filtercontainer/FilterContainer-DUeVLHgZ.system.js +0 -1
- package/components/form/Form-D-e0VI8V.system.js +0 -1
- package/components/hardwaresync/HardwareSync--HomfQuH.system.js +0 -1
- package/components/icon/Icon-DUylRmY4.system.js +0 -1
- package/components/image/Image-DX6uB7Ns.system.js +0 -1
- package/components/imagecompressor/ImageCompressor-BLeJDvN3.system.js +0 -1
- package/components/imageinputinfo/ImageInputInfo-C5F14hbF.system.js +0 -1
- package/components/inlinemessage/InlineMessage-19w6FOcP.system.js +0 -1
- package/components/inputbadge/InputBadge-dgANMV70.system.js +0 -1
- package/components/inputcurrency/InputCurrency-ChqGX5L8.system.js +0 -1
- package/components/inputemail/InputEmail-CYILS9bp.system.js +0 -1
- package/components/inputnumber/InputNumber-CRyg8Xw_.system.js +0 -1
- package/components/inputpassword/InputPassword-BjB6FsoL.system.js +0 -1
- package/components/inputphonenumber/InputPhoneNumber-CVM2oK5q.es.js +0 -591
- package/components/inputphonenumber/InputPhoneNumber-DIbd3upL.system.js +0 -1
- package/components/inputrangenumber/InputRangeNumber-C28xgFBY.system.js +0 -1
- package/components/inputsearch/InputSearch--KHwTBTm.system.js +0 -1
- package/components/inputtext/InputText-93zDNfC3.system.js +0 -1
- package/components/inputurl/InputURL-kWIiKGEG.system.js +0 -1
- package/components/litedropdown/LiteDropdown-3KsCx4wX.system.js +0 -1
- package/components/loading/Loading-Diwog8dc.system.js +0 -1
- package/components/mentionlist/MentionList-600dsWhX.system.js +0 -1
- package/components/menu/Menu-OR25pAK3.system.js +0 -1
- package/components/menuitem/MenuItem-imQ-hYTP.system.js +0 -1
- package/components/multirow/MultiRow-DKu6uIsI.system.js +0 -1
- package/components/multiselect/MultiSelect-DKFYq47E.system.js +0 -1
- package/components/overlaypanel/OverlayPanel-C_WCcNPw.system.js +0 -1
- package/components/tabmenu/TabMenu-CAQqu-ff.system.js +0 -1
- package/components/tagtype/TagType-IMYg8AJf.system.js +0 -1
- package/components/textarea/Textarea-DlkzVURV.system.js +0 -1
- package/components/timeline/Timeline-BMRdV_mH.es.js +0 -120
- package/components/timeline/Timeline-D7SYc3QX.system.js +0 -1
- package/components/timelinecontentbytype/TimelineContentByType-BmWsZID0.system.js +0 -1
- package/components/toast/Toast-Pc_DOZ5-.system.js +0 -1
- package/components/toggleswitch/ToggleSwitch-WHdD3oYL.system.js +0 -1
- package/components/transactionroles/TransactionRoles-DSXBVwPM.system.js +0 -1
- package/components/tree/Tree-BoVGYw5N.system.js +0 -1
- package/components/tree/Tree-DnaIZZ8S.es.js +0 -268
- package/components/treenode/TreeNode-D5aepDIU.system.js +0 -1
- package/components/treesearchinput/TreeSearchInput-C-hXPV61.system.js +0 -1
- package/components/username/UserName-CCyPAYG6.system.js +0 -1
- package/components/userwithicon/UserWithIcon-CFjQcbAS.system.js +0 -1
- package/vendor/@popperjs/core-BDAJHTVh.es.js +0 -905
- package/vendor/@popperjs/core-DpNOCyB0.system.js +0 -1
- /package/assets/{lottiejs → lottie}/loading-page-B9ooQcfF.system.js +0 -0
- /package/assets/{lottiejs → lottie}/loading-page-CQ0mKER2.es.js +0 -0
- /package/assets/{lottiejs → lottie}/loading-plane-CgfbWppy.system.js +0 -0
- /package/assets/{lottiejs → lottie}/loading-plane-CoXtqoc9.es.js +0 -0
- /package/assets/{lottiejs → lottie}/loading-table-B4T3FYiI.system.js +0 -0
- /package/assets/{lottiejs → lottie}/loading-table-BnpbX8Ew.es.js +0 -0
- /package/assets/{lottiejs → lottie}/no-data-CMWnya_k.system.js +0 -0
- /package/assets/{lottiejs → lottie}/no-data-DOy8kIGF.es.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as J, a as h, l as T, c as A, j as v, r as B, R as U, b as O } from "./prosemirror-transform-DvAmofec.es.js";
|
|
2
2
|
import { b as y, F as S } from "./prosemirror-model-D2n-Dx_L.es.js";
|
|
3
|
-
import { T as I, N as d, S as V, A as P } from "./prosemirror-state-
|
|
3
|
+
import { T as I, N as d, S as V, A as P } from "./prosemirror-state-BW6XGB3U.es.js";
|
|
4
4
|
const M = (t, e) => t.selection.empty ? !1 : (e && e(t.tr.deleteSelection().scrollIntoView()), !0);
|
|
5
5
|
function N(t, e) {
|
|
6
6
|
let { $cursor: r } = t.selection;
|
package/vendor/{prosemirror-commands-DgY3QRzI.system.js → prosemirror-commands-Dn6KNBP0.system.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./prosemirror-transform-
|
|
2
|
-
`).scrollIntoView()),!0)});function P(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const ue=d("o",(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let l=r.node(-1),o=r.indexAfter(-1),i=P(l.contentMatchAt(o));if(!i||!l.canReplaceWith(o,o,i))return!1;if(e){let f=r.after(),c=t.tr.replaceWith(f,f,i.createAndFill());c.setSelection(B.near(c.doc.resolve(f),1)),e(c.scrollIntoView())}return!0}),X=d("q",(t,e)=>{let r=t.selection,{$from:n,$to:l}=r;if(r instanceof
|
|
1
|
+
System.register(["./prosemirror-transform-BXNgAhmF.system.js","./prosemirror-model-DTWK5xnv.system.js","./prosemirror-state-COJ-aZZ4.system.js"],function(d,le){"use strict";var E,x,I,V,z,j,W,R,S,h,C,b,B,v;return{setters:[a=>{E=a.f,x=a.a,I=a.l,V=a.c,z=a.j,j=a.r,W=a.R,R=a.b},a=>{S=a.b,h=a.F},a=>{C=a.T,b=a.N,B=a.S,v=a.A}],execute:function(){d({s:re,w:te});const a=d("p",(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0));function D(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const G=d("m",(t,e,r)=>{let n=D(t,r);if(!n)return!1;let l=F(n);if(!l){let i=n.blockRange(),f=i&&I(i);return f==null?!1:(e&&e(t.tr.lift(i,f).scrollIntoView()),!0)}let o=l.nodeBefore;if(J(t,l,e,-1))return!0;if(n.parent.content.size==0&&(T(o,"end")||b.isSelectable(o)))for(let i=n.depth;;i--){let f=j(t.doc,n.before(i),n.after(i),S.empty);if(f&&f.slice.size<f.to-f.from){if(e){let c=t.tr.step(f);c.setSelection(T(o,"end")?B.findFrom(c.doc.resolve(c.mapping.map(l.pos,-1)),-1):b.create(c.doc,l.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(i==1||n.node(i-1).childCount>1)break}return o.isAtom&&l.depth==n.depth-1?(e&&e(t.tr.delete(l.pos-o.nodeSize,l.pos).scrollIntoView()),!0):!1}),oe=d("h",(t,e,r)=>{let n=D(t,r);if(!n)return!1;let l=F(n);return l?$(t,l,e):!1}),ie=d("g",(t,e,r)=>{let n=q(t,r);if(!n)return!1;let l=O(n);return l?$(t,l,e):!1});function $(t,e,r){let n=e.nodeBefore,l=n,o=e.pos-1;for(;!l.isTextblock;o--){if(l.type.spec.isolating)return!1;let s=l.lastChild;if(!s)return!1;l=s}let i=e.nodeAfter,f=i,c=e.pos+1;for(;!f.isTextblock;c++){if(f.type.spec.isolating)return!1;let s=f.firstChild;if(!s)return!1;f=s}let g=j(t.doc,o,c,S.empty);if(!g||g.from!=o||g instanceof W&&g.slice.size>=c-o)return!1;if(r){let s=t.tr.step(g);s.setSelection(C.create(s.doc,o)),r(s.scrollIntoView())}return!0}function T(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const H=d("e",(t,e,r)=>{let{$head:n,empty:l}=t.selection,o=n;if(!l)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=F(n)}let i=o&&o.nodeBefore;return!i||!b.isSelectable(i)?!1:(e&&e(t.tr.setSelection(b.create(t.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)});function F(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function q(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const K=d("i",(t,e,r)=>{let n=q(t,r);if(!n)return!1;let l=O(n);if(!l)return!1;let o=l.nodeAfter;if(J(t,l,e,1))return!0;if(n.parent.content.size==0&&(T(o,"start")||b.isSelectable(o))){let i=j(t.doc,n.before(),n.after(),S.empty);if(i&&i.slice.size<i.to-i.from){if(e){let f=t.tr.step(i);f.setSelection(T(o,"start")?B.findFrom(f.doc.resolve(f.mapping.map(l.pos)),1):b.create(f.doc,f.mapping.map(l.pos))),e(f.scrollIntoView())}return!0}}return o.isAtom&&l.depth==n.depth-1?(e&&e(t.tr.delete(l.pos,l.pos+o.nodeSize).scrollIntoView()),!0):!1}),L=d("d",(t,e,r)=>{let{$head:n,empty:l}=t.selection,o=n;if(!l)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=O(n)}let i=o&&o.nodeAfter;return!i||!b.isSelectable(i)?!1:(e&&e(t.tr.setSelection(b.create(t.doc,o.pos)).scrollIntoView()),!0)});function O(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const fe=d("j",(t,e)=>{let r=t.selection,n=r instanceof b,l;if(n){if(r.node.isTextblock||!V(t.doc,r.from))return!1;l=r.from}else if(l=z(t.doc,r.from,-1),l==null)return!1;if(e){let o=t.tr.join(l);n&&o.setSelection(b.create(o.doc,l-t.doc.resolve(l).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0}),ce=d("k",(t,e)=>{let r=t.selection,n;if(r instanceof b){if(r.node.isTextblock||!V(t.doc,r.to))return!1;n=r.to}else if(n=z(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}),se=d("f",(t,e)=>{let{$from:r,$to:n}=t.selection,l=r.blockRange(n),o=l&&I(l);return o==null?!1:(e&&e(t.tr.lift(l,o).scrollIntoView()),!0)}),Q=d("n",(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
|
|
2
|
+
`).scrollIntoView()),!0)});function P(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const ue=d("o",(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let l=r.node(-1),o=r.indexAfter(-1),i=P(l.contentMatchAt(o));if(!i||!l.canReplaceWith(o,o,i))return!1;if(e){let f=r.after(),c=t.tr.replaceWith(f,f,i.createAndFill());c.setSelection(B.near(c.doc.resolve(f),1)),e(c.scrollIntoView())}return!0}),X=d("q",(t,e)=>{let r=t.selection,{$from:n,$to:l}=r;if(r instanceof v||n.parent.inlineContent||l.parent.inlineContent)return!1;let o=P(l.parent.contentMatchAt(l.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let i=(!n.parentOffset&&l.index()<l.parent.childCount?n:l).pos,f=t.tr.insert(i,o.createAndFill());f.setSelection(C.create(f.doc,i+1)),e(f.scrollIntoView())}return!0}),Y=d("l",(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if(x(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=r.blockRange(),l=n&&I(n);return l==null?!1:(e&&e(t.tr.lift(n,l).scrollIntoView()),!0)});function Z(t){return(e,r)=>{let{$from:n,$to:l}=e.selection;if(e.selection instanceof b&&e.selection.node.isBlock)return!n.parentOffset||!x(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,f,c=!1,g=!1;for(let u=n.depth;;u--)if(n.node(u).isBlock){c=n.end(u)==n.pos+(n.depth-u),g=n.start(u)==n.pos-(n.depth-u),f=P(n.node(u-1).contentMatchAt(n.indexAfter(u-1))),o.unshift(c&&f?{type:f}:null),i=u;break}else{if(u==1)return!1;o.unshift(null)}let s=e.tr;(e.selection instanceof C||e.selection instanceof v)&&s.deleteSelection();let m=s.mapping.map(n.pos),A=x(s.doc,m,o.length,o);if(A||(o[0]=f?{type:f}:null,A=x(s.doc,m,o.length,o)),s.split(m,o.length,o),!c&&g&&n.node(i).type!=f){let u=s.mapping.map(n.before(i)),p=s.doc.resolve(u);f&&n.node(i-1).canReplaceWith(p.index(),p.index()+1,f)&&s.setNodeMarkup(s.mapping.map(n.before(i)),f)}return r&&r(s.scrollIntoView()),!0}}const _=Z(),ae=d("c",(t,e)=>{let{$from:r,to:n}=t.selection,l,o=r.sharedDepth(n);return o==0?!1:(l=r.before(o),e&&e(t.tr.setSelection(b.create(t.doc,l))),!0)});function ee(t,e,r){let n=e.nodeBefore,l=e.nodeAfter,o=e.index();return!n||!l||!n.type.compatibleContent(l.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(l.isTextblock||V(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function J(t,e,r,n){let l=e.nodeBefore,o=e.nodeAfter,i,f,c=l.type.spec.isolating||o.type.spec.isolating;if(!c&&ee(t,e,r))return!0;let g=!c&&e.parent.canReplace(e.index(),e.index()+1);if(g&&(i=(f=l.contentMatchAt(l.childCount)).findWrapping(o.type))&&f.matchType(i[0]||o.type).validEnd){if(r){let u=e.pos+o.nodeSize,p=h.empty;for(let y=i.length-1;y>=0;y--)p=h.from(i[y].create(null,p));p=h.from(l.copy(p));let k=t.tr.step(new R(e.pos-1,u,e.pos,u,new S(p,1,0),i.length,!0)),w=k.doc.resolve(u+2*i.length);w.nodeAfter&&w.nodeAfter.type==l.type&&V(k.doc,w.pos)&&k.join(w.pos),r(k.scrollIntoView())}return!0}let s=o.type.spec.isolating||n>0&&c?null:B.findFrom(e,1),m=s&&s.$from.blockRange(s.$to),A=m&&I(m);if(A!=null&&A>=e.depth)return r&&r(t.tr.lift(m,A).scrollIntoView()),!0;if(g&&T(o,"start",!0)&&T(l,"end")){let u=l,p=[];for(;p.push(u),!u.isTextblock;)u=u.lastChild;let k=o,w=1;for(;!k.isTextblock;k=k.firstChild)w++;if(u.canReplace(u.childCount,u.childCount,k.content)){if(r){let y=h.empty;for(let N=p.length-1;N>=0;N--)y=h.from(p[N].copy(y));let ne=t.tr.step(new R(e.pos-p.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new S(y,p.length,0),0,!0));r(ne.scrollIntoView())}return!0}}return!1}function U(t){return function(e,r){let n=e.selection,l=t<0?n.$from:n.$to,o=l.depth;for(;l.node(o).isInline;){if(!o)return!1;o--}return l.node(o).isTextblock?(r&&r(e.tr.setSelection(C.create(e.doc,t<0?l.start(o):l.end(o)))),!0):!1}}const de=d("a",U(-1)),pe=d("b",U(1));function te(t,e=null){return function(r,n){let{$from:l,$to:o}=r.selection,i=l.blockRange(o),f=i&&E(i,t,e);return f?(n&&n(r.tr.wrap(i,f).scrollIntoView()),!0):!1}}function re(t,e=null){return function(r,n){let l=!1;for(let o=0;o<r.selection.ranges.length&&!l;o++){let{$from:{pos:i},$to:{pos:f}}=r.selection.ranges[o];r.doc.nodesBetween(i,f,(c,g)=>{if(l)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)l=!0;else{let s=r.doc.resolve(g),m=s.index();l=s.parent.canReplaceWith(m,m+1,t)}})}if(!l)return!1;if(n){let o=r.tr;for(let i=0;i<r.selection.ranges.length;i++){let{$from:{pos:f},$to:{pos:c}}=r.selection.ranges[i];o.setBlockType(f,c,t,e)}n(o.scrollIntoView())}return!0}}function M(...t){return function(e,r,n){for(let l=0;l<t.length;l++)if(t[l](e,r,n))return!0;return!1}}M(a,G,H),M(a,K,L),M(Q,X,Y,_),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin"}}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as b } from "./rope-sequence-sEGCUMi8.es.js";
|
|
2
2
|
import { M as k } from "./prosemirror-transform-DvAmofec.es.js";
|
|
3
|
-
import { P as H, a as O } from "./prosemirror-state-
|
|
3
|
+
import { P as H, a as O } from "./prosemirror-state-BW6XGB3U.es.js";
|
|
4
4
|
const D = 500;
|
|
5
5
|
class c {
|
|
6
6
|
constructor(t, e) {
|
package/vendor/{prosemirror-history-BrK-FTBv.system.js → prosemirror-history-BTrzvpc-.system.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./rope-sequence-4t46C6az.system.js","./prosemirror-transform-
|
|
1
|
+
System.register(["./rope-sequence-4t46C6az.system.js","./prosemirror-transform-BXNgAhmF.system.js","./prosemirror-state-COJ-aZZ4.system.js"],function(T,z){"use strict";var E,O,R,I;return{setters:[h=>{E=h.R},h=>{O=h.M},h=>{R=h.P,I=h.a}],execute:function(){T("h",q);const h=500;class c{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let s,p;e&&(s=this.remapping(i,this.items.length),p=s.maps.length);let l=t.tr,r,u,m=[],f=[];return this.items.forEach((a,o)=>{if(!a.step){s||(s=this.remapping(i,o+1),p=s.maps.length),p--,f.push(a);return}if(s){f.push(new g(a.map));let d=a.step.map(s.slice(p)),M;d&&l.maybeStep(d).doc&&(M=l.mapping.maps[l.mapping.maps.length-1],m.push(new g(M,void 0,void 0,m.length+f.length))),p--,M&&s.appendMap(M,p)}else l.maybeStep(a.step);if(a.selection)return r=s?a.selection.map(s.slice(p)):a.selection,u=new c(this.items.slice(0,i).append(f.reverse().concat(m)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:l,selection:r}}addTransform(t,e,i,s){let p=[],l=this.eventCount,r=this.items,u=!s&&r.length?r.get(r.length-1):null;for(let f=0;f<t.steps.length;f++){let a=t.steps[f].invert(t.docs[f]),o=new g(t.mapping.maps[f],a,e),d;(d=u&&u.merge(o))&&(o=d,f?p.pop():r=r.slice(0,r.length-1)),p.push(o),e&&(l++,e=void 0),s||(u=o)}let m=l-i.depth;return m>j&&(r=D(r,m),l-=m),new c(r.append(p),l)}remapping(t,e){let i=new O;return this.items.forEach((s,p)=>{let l=s.mirrorOffset!=null&&p-s.mirrorOffset>=t?i.maps.length-s.mirrorOffset:void 0;i.appendMap(s.map,l)},t,e),i}addMaps(t){return this.eventCount==0?this:new c(this.items.append(t.map(e=>new g(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let i=[],s=Math.max(0,this.items.length-e),p=t.mapping,l=t.steps.length,r=this.eventCount;this.items.forEach(o=>{o.selection&&r--},s);let u=e;this.items.forEach(o=>{let d=p.getMirror(--u);if(d==null)return;l=Math.min(l,d);let M=p.maps[d];if(o.step){let V=t.steps[d].invert(t.docs[d]),H=o.selection&&o.selection.map(p.slice(u+1,d));H&&r++,i.push(new g(M,V,H))}else i.push(new g(M))},s);let m=[];for(let o=e;o<l;o++)m.push(new g(p.maps[o]));let f=this.items.slice(0,s).append(m).append(i),a=new c(f,r);return a.emptyItemCount()>h&&(a=a.compress(this.items.length-i.length)),a}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),i=e.maps.length,s=[],p=0;return this.items.forEach((l,r)=>{if(r>=t)s.push(l),l.selection&&p++;else if(l.step){let u=l.step.map(e.slice(i)),m=u&&u.getMap();if(i--,m&&e.appendMap(m,i),u){let f=l.selection&&l.selection.map(e.slice(i));f&&p++;let a=new g(m.invert(),u,f),o,d=s.length-1;(o=s.length&&s[d].merge(a))?s[d]=o:s.push(a)}}else l.map&&i--},this.items.length,0),new c(E.from(s.reverse()),p)}}c.empty=new c(E.empty,0);function D(n,t){let e;return n.forEach((i,s)=>{if(i.selection&&t--==0)return e=s,!1}),n.slice(e)}class g{constructor(t,e,i,s){this.map=t,this.step=e,this.selection=i,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new g(e.getMap().invert(),e,this.selection)}}}class v{constructor(t,e,i,s,p){this.done=t,this.undone=e,this.prevRanges=i,this.prevTime=s,this.prevComposition=p}}const j=20;function F(n,t,e,i){let s=e.getMeta(w),p;if(s)return s.historyState;e.getMeta(K)&&(n=new v(n.done,n.undone,null,0,-1));let l=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(l&&l.getMeta(w))return l.getMeta(w).redo?new v(n.done.addTransform(e,void 0,i,C(t)),n.undone,S(e.mapping.maps),n.prevTime,n.prevComposition):new v(n.done,n.undone.addTransform(e,void 0,i,C(t)),null,n.prevTime,n.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let r=e.getMeta("composition"),u=n.prevTime==0||!l&&n.prevComposition!=r&&(n.prevTime<(e.time||0)-i.newGroupDelay||!G(e,n.prevRanges)),m=l?P(n.prevRanges,e.mapping):S(e.mapping.maps);return new v(n.done.addTransform(e,u?t.selection.getBookmark():void 0,i,C(t)),c.empty,m,e.time,r??n.prevComposition)}else return(p=e.getMeta("rebased"))?new v(n.done.rebased(e,p),n.undone.rebased(e,p),P(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new v(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),P(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function G(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((i,s)=>{for(let p=0;p<t.length;p+=2)i<=t[p+1]&&s>=t[p]&&(e=!0)}),e}function S(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((i,s,p,l)=>t.push(p,l));return t}function P(n,t){if(!n)return null;let e=[];for(let i=0;i<n.length;i+=2){let s=t.map(n[i],1),p=t.map(n[i+1],-1);s<=p&&e.push(s,p)}return e}function x(n,t,e){let i=C(t),s=w.get(t).spec.config,p=(e?n.undone:n.done).popEvent(t,i);if(!p)return null;let l=p.selection.resolve(p.transform.doc),r=(e?n.done:n.undone).addTransform(p.transform,t.selection.getBookmark(),s,i),u=new v(e?r:p.remaining,e?p.remaining:r,null,0,-1);return p.transform.setSelection(l).setMeta(w,{redo:e,historyState:u})}let b=!1,y=null;function C(n){let t=n.plugins;if(y!=t){b=!1,y=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){b=!0;break}}return b}const w=new I("history"),K=new I("closeHistory");function q(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new R({key:w,state:{init(){return new v(c.empty,c.empty,null,0,-1)},apply(t,e,i){return F(e,i,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let i=e.inputType,s=i=="historyUndo"?A:i=="historyRedo"?U:null;return s?(e.preventDefault(),s(t.state,t.dispatch)):!1}}}})}function k(n,t){return(e,i)=>{let s=w.getState(e);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(i){let p=x(s,e,n);p&&i(t?p.scrollIntoView():p)}return!0}}const A=T("u",k(!1,!0)),U=T("r",k(!0,!0))}}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as n, b as c } from "./w3c-keyname-CLxH8j-f.es.js";
|
|
2
|
-
import { P as d } from "./prosemirror-state-
|
|
2
|
+
import { P as d } from "./prosemirror-state-BW6XGB3U.es.js";
|
|
3
3
|
const h = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
4
4
|
function m(e) {
|
|
5
5
|
let r = e.split(/-(?!$)/), t = r[r.length - 1];
|
package/vendor/{prosemirror-keymap-COb3Dq2o.system.js → prosemirror-keymap-WRY9zVpK.system.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./w3c-keyname-BSD-PgAi.system.js","./prosemirror-state-
|
|
1
|
+
System.register(["./w3c-keyname-BSD-PgAi.system.js","./prosemirror-state-COJ-aZZ4.system.js"],function(h,k){"use strict";var c,y,d;return{setters:[l=>{c=l.k,y=l.b},l=>{d=l.P}],execute:function(){h("k",K);const l=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function m(e){let r=e.split(/-(?!$)/),t=r[r.length-1];t=="Space"&&(t=" ");let i,f,o,a;for(let s=0;s<r.length-1;s++){let n=r[s];if(/^(cmd|meta|m)$/i.test(n))a=!0;else if(/^a(lt)?$/i.test(n))i=!0;else if(/^(c|ctrl|control)$/i.test(n))f=!0;else if(/^s(hift)?$/i.test(n))o=!0;else if(/^mod$/i.test(n))l?a=!0:f=!0;else throw new Error("Unrecognized modifier name: "+n)}return i&&(t="Alt-"+t),f&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function p(e){let r=Object.create(null);for(let t in e)r[m(t)]=e[t];return r}function u(e,r,t=!0){return r.altKey&&(e="Alt-"+e),r.ctrlKey&&(e="Ctrl-"+e),r.metaKey&&(e="Meta-"+e),t&&r.shiftKey&&(e="Shift-"+e),e}function K(e){return new d({props:{handleKeyDown:g(e)}})}function g(e){let r=p(e);return function(t,i){let f=c(i),o,a=r[u(f,i)];if(a&&a(t.state,t.dispatch,t))return!0;if(f.length==1&&f!=" "){if(i.shiftKey){let s=r[u(f,i,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((i.shiftKey||i.altKey||i.metaKey||f.charCodeAt(0)>127)&&(o=y[i.keyCode])&&o!=f){let s=r[u(o,i)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./prosemirror-transform-
|
|
1
|
+
System.register(["./prosemirror-transform-BXNgAhmF.system.js","./prosemirror-model-DTWK5xnv.system.js"],function(R,j){"use strict";var I,w,C,S,L,u,y,$;return{setters:[c=>{I=c.b,w=c.f,C=c.l,S=c.c,L=c.a},c=>{u=c.F,y=c.b,$=c.c}],execute:function(){R({l:z,s:V,w:c});function c(o,t=null){return function(e,l){let{$from:r,$to:n}=e.selection,i=r.blockRange(n);if(!i)return!1;let f=l?e.tr:null;return b(f,i,o,t)?(l&&l(f.scrollIntoView()),!0):!1}}function b(o,t,e,l=null){let r=!1,n=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let s=i.resolve(t.start-2);n=new $(s,s,t.depth),t.endIndex<t.parent.childCount&&(t=new $(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let f=w(n,e,l,t);return f?(o&&v(o,t,f,r,e),!0):!1}function v(o,t,e,l,r){let n=u.empty;for(let d=e.length-1;d>=0;d--)n=u.from(e[d].type.create(e[d].attrs,n));o.step(new I(t.start-(l?2:0),t.end,t.start,t.end,new y(n,0,0),e.length,!0));let i=0;for(let d=0;d<e.length;d++)e[d].type==r&&(i=d+1);let f=e.length-i,s=t.start+e.length-(l?2:0),p=t.parent;for(let d=t.startIndex,a=t.endIndex,m=!0;d<a;d++,m=!1)!m&&L(o.doc,s,f)&&(o.split(s,f),s+=2*f),s+=p.child(d).nodeSize;return o}function z(o){return function(t,e){let{$from:l,$to:r}=t.selection,n=l.blockRange(r,i=>i.childCount>0&&i.firstChild.type==o);return n?e?l.node(n.depth-1).type==o?k(t,e,o,n):O(t,e,n):!0:!1}}function k(o,t,e,l){let r=o.tr,n=l.end,i=l.$to.end(l.depth);n<i&&(r.step(new I(n-1,i,n,i,new y(u.from(e.create(null,l.parent.copy())),1,0),1,!0)),l=new $(r.doc.resolve(l.$from.pos),r.doc.resolve(i),l.depth));const f=C(l);if(f==null)return!1;r.lift(l,f);let s=r.mapping.map(n,-1)-1;return S(r.doc,s)&&r.join(s),t(r.scrollIntoView()),!0}function O(o,t,e){let l=o.tr,r=e.parent;for(let h=e.end,x=e.endIndex-1,A=e.startIndex;x>A;x--)h-=r.child(x).nodeSize,l.delete(h-1,h+1);let n=l.doc.resolve(e.start),i=n.nodeAfter;if(l.mapping.map(e.end)!=e.start+n.nodeAfter.nodeSize)return!1;let f=e.startIndex==0,s=e.endIndex==r.childCount,p=n.node(-1),d=n.index(-1);if(!p.canReplace(d+(f?0:1),d+1,i.content.append(s?u.empty:u.from(r))))return!1;let a=n.pos,m=a+i.nodeSize;return l.step(new I(a-(f?1:0),m+(s?1:0),a+1,m-1,new y((f?u.empty:u.from(r.copy(u.empty))).append(s?u.empty:u.from(r.copy(u.empty))),f?0:1,s?0:1),f?0:1)),t(l.scrollIntoView()),!0}function V(o){return function(t,e){let{$from:l,$to:r}=t.selection,n=l.blockRange(r,p=>p.childCount>0&&p.firstChild.type==o);if(!n)return!1;let i=n.startIndex;if(i==0)return!1;let f=n.parent,s=f.child(i-1);if(s.type!=o)return!1;if(e){let p=s.lastChild&&s.lastChild.type==f.type,d=u.from(p?o.create():null),a=new y(u.from(o.create(null,u.from(f.type.create(null,d)))),p?3:1,0),m=n.start,h=n.end;e(t.tr.step(new I(m-(p?3:1),h,m,h,a,1,!0)).scrollIntoView())}return!0}}}}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { N as x, b as m, F as B, M as J } from "./prosemirror-model-D2n-Dx_L.es.js";
|
|
2
|
+
import { T as P, R as K, b as $ } from "./prosemirror-transform-DvAmofec.es.js";
|
|
3
3
|
const M = /* @__PURE__ */ Object.create(null);
|
|
4
4
|
class l {
|
|
5
5
|
/**
|
|
@@ -275,7 +275,7 @@ class p extends l {
|
|
|
275
275
|
return r ? l.near(s) : new p(s);
|
|
276
276
|
}
|
|
277
277
|
content() {
|
|
278
|
-
return new m(
|
|
278
|
+
return new m(B.from(this.node), 0, 0);
|
|
279
279
|
}
|
|
280
280
|
eq(e) {
|
|
281
281
|
return e instanceof p && e.anchor == this.anchor;
|
|
@@ -388,7 +388,7 @@ function I(i, e, t) {
|
|
|
388
388
|
if (r < e)
|
|
389
389
|
return;
|
|
390
390
|
let n = i.steps[r];
|
|
391
|
-
if (!(n instanceof
|
|
391
|
+
if (!(n instanceof K || n instanceof $))
|
|
392
392
|
return;
|
|
393
393
|
let s = i.mapping.maps[r], o;
|
|
394
394
|
s.forEach((a, c, u, h) => {
|
|
@@ -396,7 +396,7 @@ function I(i, e, t) {
|
|
|
396
396
|
}), i.setSelection(l.near(i.doc.resolve(o), t));
|
|
397
397
|
}
|
|
398
398
|
const b = 1, E = 2, F = 4;
|
|
399
|
-
class W extends
|
|
399
|
+
class W extends P {
|
|
400
400
|
/**
|
|
401
401
|
@internal
|
|
402
402
|
*/
|
|
@@ -744,7 +744,7 @@ class w {
|
|
|
744
744
|
let n = new O(e.schema, e.plugins), s = new w(n);
|
|
745
745
|
return n.fields.forEach((o) => {
|
|
746
746
|
if (o.name == "doc")
|
|
747
|
-
s.doc =
|
|
747
|
+
s.doc = x.fromJSON(e.schema, t.doc);
|
|
748
748
|
else if (o.name == "selection")
|
|
749
749
|
s.selection = l.fromJSON(s.doc, t.selection);
|
|
750
750
|
else if (o.name == "storedMarks")
|
package/vendor/{prosemirror-state-DzPLD-6l.system.js → prosemirror-state-COJ-aZZ4.system.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./prosemirror-model-DTWK5xnv.system.js","./prosemirror-transform-VaXuT0NM.system.js"],function(S,H){"use strict";var g,T,I,v,b,E,F;return{setters:[u=>{g=u.b,T=u.F,I=u.N,v=u.M},u=>{b=u.R,E=u.b,F=u.T}],execute:function(){const u=Object.create(null);class l{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new W(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=g.empty){let r=t.content.lastChild,n=null;for(let a=0;a<t.openEnd;a++)n=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:c,$to:d}=o[a],h=e.mapping.slice(s);e.replaceRange(h.map(c.pos),h.map(d.pos),a?g.empty:t),a==0&&C(e,s,(r?r.isInline:n&&n.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,n=this.ranges;for(let s=0;s<n.length;s++){let{$from:o,$to:a}=n[s],c=e.mapping.slice(r),d=c.map(o.pos),h=c.map(a.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,t),C(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let n=e.parent.inlineContent?new f(e):y(e.node(0),e.parent,e.pos,e.index(),t,r);if(n)return n;for(let s=e.depth-1;s>=0;s--){let o=t<0?y(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):y(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new m(e.node(0))}static atStart(e){return y(e,e,0,0,1)||new m(e)}static atEnd(e){return y(e,e,e.content.size,e.childCount,-1)||new m(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=u[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in u)throw new RangeError("Duplicate use of selection JSON ID "+e);return u[e]=t,t.prototype.jsonID=e,t}getBookmark(){return f.between(this.$anchor,this.$head).getBookmark()}}S("S",l),l.prototype.visible=!0;class W{constructor(e,t){this.$from=e,this.$to=t}}let D=!1;function A(i){!D&&!i.parent.inlineContent&&(D=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+i.parent.type.name+")"))}class f extends l{constructor(e,t=e){A(e),A(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return l.near(r);let n=e.resolve(t.map(this.anchor));return new f(n.parent.inlineContent?n:r,r)}replace(e,t=g.empty){if(super.replace(e,t),t==g.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof f&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new M(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new f(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let n=e.resolve(t);return new this(n,r==t?n:e.resolve(r))}static between(e,t,r){let n=e.pos-t.pos;if((!r||n)&&(r=n>=0?1:-1),!t.parent.inlineContent){let s=l.findFrom(t,r,!0)||l.findFrom(t,-r,!0);if(s)t=s.$head;else return l.near(t,r)}return e.parent.inlineContent||(n==0?e=t:(e=(l.findFrom(e,-r,!0)||l.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=n<0&&(e=t))),new f(e,t)}}S("T",f),l.jsonID("text",f);class M{constructor(e,t){this.anchor=e,this.head=t}map(e){return new M(e.map(this.anchor),e.map(this.head))}resolve(e){return f.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends l{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:n}=t.mapResult(this.anchor),s=e.resolve(n);return r?l.near(s):new p(s)}content(){return new g(T.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new O(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}S("N",p),p.prototype.visible=!1,l.jsonID("node",p);class O{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new M(r,r):new O(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&p.isSelectable(r)?new p(t):l.near(t)}}class m extends l{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=g.empty){if(t==g.empty){e.delete(0,e.doc.content.size);let r=l.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new m(e)}map(e){return new m(e)}eq(e){return e instanceof m}getBookmark(){return x}}S("A",m),l.jsonID("all",m);const x={map(){return this},resolve(i){return new m(i)}};function y(i,e,t,r,n,s=!1){if(e.inlineContent)return f.create(i,t);for(let o=r-(n>0?0:1);n>0?o<e.childCount:o>=0;o+=n){let a=e.child(o);if(a.isAtom){if(!s&&p.isSelectable(a))return p.create(i,t-(n<0?a.nodeSize:0))}else{let c=y(i,a,t+n,n<0?a.childCount:0,n,s);if(c)return c}t+=a.nodeSize*n}return null}function C(i,e,t){let r=i.steps.length-1;if(r<e)return;let n=i.steps[r];if(!(n instanceof b||n instanceof E))return;let s=i.mapping.maps[r],o;s.forEach((a,c,d,h)=>{o==null&&(o=h)}),i.setSelection(l.near(i.doc.resolve(o),t))}const B=1,P=2,K=4;class L extends F{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|B)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&B)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=P,this}ensureMarks(e){return v.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&P)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||v.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let n=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,n.text(e,s)),this.selection.empty||this.setSelection(l.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=K,this}get scrolledIntoView(){return(this.updated&K)>0}}function $(i,e){return!e||!i?i:i.bind(e)}class k{constructor(e,t,r){this.name=e,this.init=$(t.init,r),this.apply=$(t.apply,r)}}const U=[new k("doc",{init(i){return i.doc||i.schema.topNodeType.createAndFill()},apply(i){return i.doc}}),new k("selection",{init(i,e){return i.selection||l.atStart(e.doc)},apply(i){return i.selection}}),new k("storedMarks",{init(i){return i.storedMarks||null},apply(i,e,t,r){return r.selection.$cursor?i.storedMarks:null}}),new k("scrollToSelection",{init(){return 0},apply(i,e){return i.scrolledIntoView?e+1:e}})];class N{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=U.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new k(r.key,r.spec.state,r))})}}class w{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let n=this.config.plugins[r];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),n=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let c=n?n[o].n:0,d=n?n[o].state:this,h=c<t.length&&a.spec.appendTransaction.call(a,c?t.slice(c):t,d,r);if(h&&r.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",e),!n){n=[];for(let R=0;R<this.config.plugins.length;R++)n.push(R<o?{state:r,n:t.length}:{state:this,n:0})}t.push(h),r=r.applyInner(h),s=!0}n&&(n[o]={state:r,n:t.length})}}if(!s)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new w(this.config),r=this.config.fields;for(let n=0;n<r.length;n++){let s=r[n];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new L(this)}static create(e){let t=new N(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new w(t);for(let n=0;n<t.fields.length;n++)r[t.fields[n].name]=t.fields[n].init(e,r);return r}reconfigure(e){let t=new N(this.schema,e.plugins),r=t.fields,n=new w(t);for(let s=0;s<r.length;s++){let o=r[s].name;n[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,n)}return n}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let n=e[r],s=n.spec.state;s&&s.toJSON&&(t[r]=s.toJSON.call(n,this[n.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let n=new N(e.schema,e.plugins),s=new w(n);return n.fields.forEach(o=>{if(o.name=="doc")s.doc=I.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=l.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=d.fromJSON.call(c,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}S("E",w);function q(i,e,t){for(let r in i){let n=i[r];n instanceof Function?n=n.bind(e):r=="handleDOMEvents"&&(n=q(n,e,{})),t[r]=n}return t}class V{constructor(e){this.spec=e,this.props={},e.props&&q(e.props,this,this.props),this.key=e.key?e.key.key:z("plugin")}getState(e){return e[this.key]}}S("P",V);const J=Object.create(null);function z(i){return i in J?i+"$"+ ++J[i]:(J[i]=0,i+"$")}class G{constructor(e="key"){this.key=z(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}S("a",G)}}});
|
|
1
|
+
System.register(["./prosemirror-model-DTWK5xnv.system.js","./prosemirror-transform-BXNgAhmF.system.js"],function(S,H){"use strict";var T,g,I,v,b,E,F;return{setters:[u=>{T=u.N,g=u.b,I=u.F,v=u.M},u=>{b=u.T,E=u.R,F=u.b}],execute:function(){const u=Object.create(null);class l{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new W(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=g.empty){let r=t.content.lastChild,n=null;for(let a=0;a<t.openEnd;a++)n=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:c,$to:d}=o[a],h=e.mapping.slice(s);e.replaceRange(h.map(c.pos),h.map(d.pos),a?g.empty:t),a==0&&C(e,s,(r?r.isInline:n&&n.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,n=this.ranges;for(let s=0;s<n.length;s++){let{$from:o,$to:a}=n[s],c=e.mapping.slice(r),d=c.map(o.pos),h=c.map(a.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,t),C(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let n=e.parent.inlineContent?new f(e):y(e.node(0),e.parent,e.pos,e.index(),t,r);if(n)return n;for(let s=e.depth-1;s>=0;s--){let o=t<0?y(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):y(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new m(e.node(0))}static atStart(e){return y(e,e,0,0,1)||new m(e)}static atEnd(e){return y(e,e,e.content.size,e.childCount,-1)||new m(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=u[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in u)throw new RangeError("Duplicate use of selection JSON ID "+e);return u[e]=t,t.prototype.jsonID=e,t}getBookmark(){return f.between(this.$anchor,this.$head).getBookmark()}}S("S",l),l.prototype.visible=!0;class W{constructor(e,t){this.$from=e,this.$to=t}}let D=!1;function A(i){!D&&!i.parent.inlineContent&&(D=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+i.parent.type.name+")"))}class f extends l{constructor(e,t=e){A(e),A(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return l.near(r);let n=e.resolve(t.map(this.anchor));return new f(n.parent.inlineContent?n:r,r)}replace(e,t=g.empty){if(super.replace(e,t),t==g.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof f&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new M(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new f(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let n=e.resolve(t);return new this(n,r==t?n:e.resolve(r))}static between(e,t,r){let n=e.pos-t.pos;if((!r||n)&&(r=n>=0?1:-1),!t.parent.inlineContent){let s=l.findFrom(t,r,!0)||l.findFrom(t,-r,!0);if(s)t=s.$head;else return l.near(t,r)}return e.parent.inlineContent||(n==0?e=t:(e=(l.findFrom(e,-r,!0)||l.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=n<0&&(e=t))),new f(e,t)}}S("T",f),l.jsonID("text",f);class M{constructor(e,t){this.anchor=e,this.head=t}map(e){return new M(e.map(this.anchor),e.map(this.head))}resolve(e){return f.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends l{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:n}=t.mapResult(this.anchor),s=e.resolve(n);return r?l.near(s):new p(s)}content(){return new g(I.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new O(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}S("N",p),p.prototype.visible=!1,l.jsonID("node",p);class O{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new M(r,r):new O(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&p.isSelectable(r)?new p(t):l.near(t)}}class m extends l{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=g.empty){if(t==g.empty){e.delete(0,e.doc.content.size);let r=l.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new m(e)}map(e){return new m(e)}eq(e){return e instanceof m}getBookmark(){return x}}S("A",m),l.jsonID("all",m);const x={map(){return this},resolve(i){return new m(i)}};function y(i,e,t,r,n,s=!1){if(e.inlineContent)return f.create(i,t);for(let o=r-(n>0?0:1);n>0?o<e.childCount:o>=0;o+=n){let a=e.child(o);if(a.isAtom){if(!s&&p.isSelectable(a))return p.create(i,t-(n<0?a.nodeSize:0))}else{let c=y(i,a,t+n,n<0?a.childCount:0,n,s);if(c)return c}t+=a.nodeSize*n}return null}function C(i,e,t){let r=i.steps.length-1;if(r<e)return;let n=i.steps[r];if(!(n instanceof E||n instanceof F))return;let s=i.mapping.maps[r],o;s.forEach((a,c,d,h)=>{o==null&&(o=h)}),i.setSelection(l.near(i.doc.resolve(o),t))}const B=1,P=2,z=4;class L extends b{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|B)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&B)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=P,this}ensureMarks(e){return v.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&P)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||v.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let n=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,n.text(e,s)),this.selection.empty||this.setSelection(l.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=z,this}get scrolledIntoView(){return(this.updated&z)>0}}function K(i,e){return!e||!i?i:i.bind(e)}class k{constructor(e,t,r){this.name=e,this.init=K(t.init,r),this.apply=K(t.apply,r)}}const U=[new k("doc",{init(i){return i.doc||i.schema.topNodeType.createAndFill()},apply(i){return i.doc}}),new k("selection",{init(i,e){return i.selection||l.atStart(e.doc)},apply(i){return i.selection}}),new k("storedMarks",{init(i){return i.storedMarks||null},apply(i,e,t,r){return r.selection.$cursor?i.storedMarks:null}}),new k("scrollToSelection",{init(){return 0},apply(i,e){return i.scrolledIntoView?e+1:e}})];class N{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=U.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new k(r.key,r.spec.state,r))})}}class w{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let n=this.config.plugins[r];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),n=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let c=n?n[o].n:0,d=n?n[o].state:this,h=c<t.length&&a.spec.appendTransaction.call(a,c?t.slice(c):t,d,r);if(h&&r.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",e),!n){n=[];for(let R=0;R<this.config.plugins.length;R++)n.push(R<o?{state:r,n:t.length}:{state:this,n:0})}t.push(h),r=r.applyInner(h),s=!0}n&&(n[o]={state:r,n:t.length})}}if(!s)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new w(this.config),r=this.config.fields;for(let n=0;n<r.length;n++){let s=r[n];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new L(this)}static create(e){let t=new N(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new w(t);for(let n=0;n<t.fields.length;n++)r[t.fields[n].name]=t.fields[n].init(e,r);return r}reconfigure(e){let t=new N(this.schema,e.plugins),r=t.fields,n=new w(t);for(let s=0;s<r.length;s++){let o=r[s].name;n[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,n)}return n}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let n=e[r],s=n.spec.state;s&&s.toJSON&&(t[r]=s.toJSON.call(n,this[n.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let n=new N(e.schema,e.plugins),s=new w(n);return n.fields.forEach(o=>{if(o.name=="doc")s.doc=T.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=l.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=d.fromJSON.call(c,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}S("E",w);function $(i,e,t){for(let r in i){let n=i[r];n instanceof Function?n=n.bind(e):r=="handleDOMEvents"&&(n=$(n,e,{})),t[r]=n}return t}class V{constructor(e){this.spec=e,this.props={},e.props&&$(e.props,this,this.props),this.key=e.key?e.key.key:q("plugin")}getState(e){return e[this.key]}}S("P",V);const J=Object.create(null);function q(i){return i in J?i+"$"+ ++J[i]:(J[i]=0,i+"$")}class G{constructor(e="key"){this.key=q(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}S("a",G)}}});
|
package/vendor/{prosemirror-transform-VaXuT0NM.system.js → prosemirror-transform-BXNgAhmF.system.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./prosemirror-model-DTWK5xnv.system.js"],function(F,Le){"use strict";var w,g,K,Q,U;return{setters:[C=>{w=C.b,g=C.F,K=C.M,Q=C.d,U=C.R}],execute:function(){F({a:be,c:Ce,d:Ee,f:we,j:Re,l:ue,r:ne});const C=65535,V=Math.pow(2,16);function he(s,e){return s+e*V}function X(s){return s&C}function pe(s){return(s-(s&C))/V}const Y=1,Z=2,W=4,_=8;class D{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&_)>0}get deletedBefore(){return(this.delInfo&(Y|W))>0}get deletedAfter(){return(this.delInfo&(Z|W))>0}get deletedAcross(){return(this.delInfo&W)>0}}class S{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&S.empty)return S.empty}recover(e){let t=0,r=X(e);if(!this.inverted)for(let n=0;n<r;n++)t+=this.ranges[n*3+2]-this.ranges[n*3+1];return this.ranges[r*3]+t+pe(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let n=0,i=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?n:0);if(a>e)break;let h=this.ranges[o+i],p=this.ranges[o+l],c=a+h;if(e<=c){let f=h?e==a?-1:e==c?1:t:t,d=a+n+(f<0?0:p);if(r)return d;let u=e==(t<0?a:c)?null:he(o/3,e-a),m=e==a?Z:e==c?Y:W;return(t<0?e!=a:e!=c)&&(m|=_),new D(d,m,u)}n+=p-h}return r?e+n:new D(e+n,0,null)}touches(e,t){let r=0,n=X(t),i=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?r:0);if(a>e)break;let h=this.ranges[o+i],p=a+h;if(e<=p&&o==n*3)return!0;r+=this.ranges[o+l]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let n=0,i=0;n<this.ranges.length;n+=3){let l=this.ranges[n],o=l-(this.inverted?i:0),a=l+(this.inverted?0:i),h=this.ranges[n+t],p=this.ranges[n+r];e(o,o+h,a,a+p),i+=p-h}}invert(){return new S(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?S.empty:new S(e<0?[0,-e,0]:[0,0,e])}}S.empty=new S([]);class z{constructor(e,t,r=0,n=e?e.length:0){this.mirror=t,this.from=r,this.to=n,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new z(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let n=e.getMirror(t);this.appendMap(e._maps[t],n!=null&&n<t?r+n:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let n=e.getMirror(t);this.appendMap(e._maps[t].invert(),n!=null&&n>t?r-n-1:void 0)}}invert(){let e=new z;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let n=0;for(let i=this.from;i<this.to;i++){let l=this._maps[i],o=l.mapResult(e,t);if(o.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(o.recover);continue}}n|=o.delInfo,e=o.pos}return r?e:new D(e,n,null)}}F("M",z);const L=Object.create(null);class k{getMap(){return S.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=L[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in L)throw new RangeError("Duplicate use of step JSON ID "+e);return L[e]=t,t.prototype.jsonID=e,t}}class y{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new y(e,null)}static fail(e){return new y(null,e)}static fromReplace(e,t,r,n){try{return y.ok(e.replace(t,r,n))}catch(i){if(i instanceof U)return y.fail(i.message);throw i}}}function q(s,e,t){let r=[];for(let n=0;n<s.childCount;n++){let i=s.child(n);i.content.size&&(i=i.copy(q(i.content,e,i))),i.isInline&&(i=e(i,t,n)),r.push(i)}return g.fromArray(r)}class N extends k{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),n=r.node(r.sharedDepth(this.to)),i=new w(q(t.content,(l,o)=>!l.isAtom||!o.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),n),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,i)}invert(){return new M(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new N(t.pos,r.pos,this.mark)}merge(e){return e instanceof N&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new N(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new N(t.from,t.to,e.markFromJSON(t.mark))}}k.jsonID("addMark",N);class M extends k{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(q(t.content,n=>n.mark(this.mark.removeFromSet(n.marks)),e),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,r)}invert(){return new N(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new M(t.pos,r.pos,this.mark)}merge(e){return e instanceof M&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new M(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new M(t.from,t.to,e.markFromJSON(t.mark))}}k.jsonID("removeMark",M);class R extends k{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(r))return new R(this.pos,t.marks[n]);return new R(this.pos,this.mark)}}return new I(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new R(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new R(t.pos,e.markFromJSON(t.mark))}}k.jsonID("addNodeMark",R);class I extends k{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new R(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new I(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new I(t.pos,e.markFromJSON(t.mark))}}k.jsonID("removeNodeMark",I);class v extends k{constructor(e,t,r,n=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=n}apply(e){return this.structure&&P(e,this.from,this.to)?y.fail("Structure replace would overwrite content"):y.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new S([this.from,this.to-this.from,this.slice.size])}invert(e){return new v(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new v(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof v)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?w.empty:new w(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new v(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?w.empty:new w(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new v(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new v(t.from,t.to,w.fromJSON(e,t.slice),!!t.structure)}}F("R",v),k.jsonID("replace",v);class b extends k{constructor(e,t,r,n,i,l,o=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=n,this.slice=i,this.insert=l,this.structure=o}apply(e){if(this.structure&&(P(e,this.from,this.gapFrom)||P(e,this.gapTo,this.to)))return y.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return y.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?y.fromReplace(e,this.from,this.to,r):y.fail("Content does not fit in gap")}getMap(){return new S([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new b(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),n=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||n<t.pos||i>r.pos?null:new b(t.pos,r.pos,n,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new b(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}F("b",b),k.jsonID("replaceAround",b);function P(s,e,t){let r=s.resolve(e),n=t-e,i=r.depth;for(;n>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,n--;if(n>0){let l=r.node(i).maybeChild(r.indexAfter(i));for(;n>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,n--}}return!1}function fe(s,e,t,r){let n=[],i=[],l,o;s.doc.nodesBetween(e,t,(a,h,p)=>{if(!a.isInline)return;let c=a.marks;if(!r.isInSet(c)&&p.type.allowsMarkType(r.type)){let f=Math.max(h,e),d=Math.min(h+a.nodeSize,t),u=r.addToSet(c);for(let m=0;m<c.length;m++)c[m].isInSet(u)||(l&&l.to==f&&l.mark.eq(c[m])?l.to=d:n.push(l=new M(f,d,c[m])));o&&o.to==f?o.to=d:i.push(o=new N(f,d,r))}}),n.forEach(a=>s.step(a)),i.forEach(a=>s.step(a))}function ce(s,e,t,r){let n=[],i=0;s.doc.nodesBetween(e,t,(l,o)=>{if(!l.isInline)return;i++;let a=null;if(r instanceof Q){let h=l.marks,p;for(;p=r.isInSet(h);)(a||(a=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(l.marks)&&(a=[r]):a=l.marks;if(a&&a.length){let h=Math.min(o+l.nodeSize,t);for(let p=0;p<a.length;p++){let c=a[p],f;for(let d=0;d<n.length;d++){let u=n[d];u.step==i-1&&c.eq(n[d].style)&&(f=u)}f?(f.to=h,f.step=i):n.push({style:c,from:Math.max(o,e),to:h,step:i})}}}),n.forEach(l=>s.step(new M(l.from,l.to,l.style)))}function $(s,e,t,r=t.contentMatch,n=!0){let i=s.doc.nodeAt(e),l=[],o=e+1;for(let a=0;a<i.childCount;a++){let h=i.child(a),p=o+h.nodeSize,c=r.matchType(h.type);if(!c)l.push(new v(o,p,w.empty));else{r=c;for(let f=0;f<h.marks.length;f++)t.allowsMarkType(h.marks[f].type)||s.step(new M(o,p,h.marks[f]));if(n&&h.isText&&t.whitespace!="pre"){let f,d=/\r?\n|\r/g,u;for(;f=d.exec(h.text);)u||(u=new w(g.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),l.push(new v(o+f.index,o+f.index+f[0].length,u))}}o=p}if(!r.validEnd){let a=r.fillBefore(g.empty,!0);s.replace(o,o,new w(a,0,0))}for(let a=l.length-1;a>=0;a--)s.step(l[a])}function de(s,e,t){return(e==0||s.canReplace(e,s.childCount))&&(t==s.childCount||s.canReplace(0,t))}function ue(s){let t=s.parent.content.cutByIndex(s.startIndex,s.endIndex);for(let r=s.depth;;--r){let n=s.$from.node(r),i=s.$from.index(r),l=s.$to.indexAfter(r);if(r<s.depth&&n.canReplace(i,l,t))return r;if(r==0||n.type.spec.isolating||!de(n,i,l))break}return null}function me(s,e,t){let{$from:r,$to:n,depth:i}=e,l=r.before(i+1),o=n.after(i+1),a=l,h=o,p=g.empty,c=0;for(let u=i,m=!1;u>t;u--)m||r.index(u)>0?(m=!0,p=g.from(r.node(u).copy(p)),c++):a--;let f=g.empty,d=0;for(let u=i,m=!1;u>t;u--)m||n.after(u+1)<n.end(u)?(m=!0,f=g.from(n.node(u).copy(f)),d++):h++;s.step(new b(a,h,l,o,new w(p.append(f),c,d),p.size-c,!0))}function we(s,e,t=null,r=s){let n=ge(s,e),i=n&&ye(r,e);return i?n.map(j).concat({type:e,attrs:t}).concat(i.map(j)):null}function j(s){return{type:s,attrs:null}}function ge(s,e){let{parent:t,startIndex:r,endIndex:n}=s,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let l=i.length?i[0]:e;return t.canReplaceWith(r,n,l)?i:null}function ye(s,e){let{parent:t,startIndex:r,endIndex:n}=s,i=t.child(r),l=e.contentMatch.findWrapping(i.type);if(!l)return null;let a=(l.length?l[l.length-1]:e).contentMatch;for(let h=r;a&&h<n;h++)a=a.matchType(t.child(h).type);return!a||!a.validEnd?null:l}function ke(s,e,t){let r=g.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let o=t[l].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=g.from(t[l].type.create(t[l].attrs,r))}let n=e.start,i=e.end;s.step(new b(n,i,n,i,new w(r,0,0),t.length,!0))}function ve(s,e,t,r,n){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=s.steps.length;s.doc.nodesBetween(e,t,(l,o)=>{let a=typeof n=="function"?n(l):n;if(l.isTextblock&&!l.hasMarkup(r,a)&&Se(s.doc,s.mapping.slice(i).map(o),r)){let h=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",u=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!u?h=!1:!d&&u&&(h=!0)}h===!1&&te(s,l,o,i),$(s,s.mapping.slice(i).map(o,1),r,void 0,h===null);let p=s.mapping.slice(i),c=p.map(o,1),f=p.map(o+l.nodeSize,1);return s.step(new b(c,f,c+1,f-1,new w(g.from(r.create(a,null,l.marks)),0,0),1,!0)),h===!0&&ee(s,l,o,i),!1}})}function ee(s,e,t,r){e.forEach((n,i)=>{if(n.isText){let l,o=/\r?\n|\r/g;for(;l=o.exec(n.text);){let a=s.mapping.slice(r).map(t+1+i+l.index);s.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function te(s,e,t,r){e.forEach((n,i)=>{if(n.type==n.type.schema.linebreakReplacement){let l=s.mapping.slice(r).map(t+1+i);s.replaceWith(l,l+1,e.type.schema.text(`
|
|
2
|
-
`))}})}function Se(s,e,t){let r=s.resolve(e),n=r.index();return r.parent.canReplaceWith(n,n+1,t)}function xe(s,e,t,r,n){let i=s.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let l=t.create(r,null,n||i.marks);if(i.isLeaf)return s.replaceWith(e,e+i.nodeSize,l);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);s.step(new b(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new w(g.from(l),0,0),1,!0))}function be(s,e,t=1,r){let n=s.resolve(e),i=n.depth-t,l=r&&r[r.length-1]||n.parent;if(i<0||n.parent.type.spec.isolating||!n.parent.canReplace(n.index(),n.parent.childCount)||!l.type.validContent(n.parent.content.cutByIndex(n.index(),n.parent.childCount)))return!1;for(let h=n.depth-1,p=t-2;h>i;h--,p--){let c=n.node(h),f=n.index(h);if(c.type.spec.isolating)return!1;let d=c.content.cutByIndex(f,c.childCount),u=r&&r[p+1];u&&(d=d.replaceChild(0,u.type.create(u.attrs)));let m=r&&r[p]||c;if(!c.canReplace(f+1,c.childCount)||!m.type.validContent(d))return!1}let o=n.indexAfter(i),a=r&&r[0];return n.node(i).canReplaceWith(o,o,a?a.type:n.node(i+1).type)}function Me(s,e,t=1,r){let n=s.doc.resolve(e),i=g.empty,l=g.empty;for(let o=n.depth,a=n.depth-t,h=t-1;o>a;o--,h--){i=g.from(n.node(o).copy(i));let p=r&&r[h];l=g.from(p?p.type.create(p.attrs,l):n.node(o).copy(l))}s.step(new v(e,e,new w(i.append(l),t,t),!0))}function Ce(s,e){let t=s.resolve(e),r=t.index();return re(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Ne(s,e){e.content.size||s.type.compatibleContent(e.type);let t=s.contentMatchAt(s.childCount),{linebreakReplacement:r}=s.type.schema;for(let n=0;n<e.childCount;n++){let i=e.child(n),l=i.type==r?s.type.schema.nodes.text:i.type;if(t=t.matchType(l),!t||!s.type.allowsMarks(i.marks))return!1}return t.validEnd}function re(s,e){return!!(s&&e&&!s.isLeaf&&Ne(s,e))}function Re(s,e,t=-1){let r=s.resolve(e);for(let n=r.depth;;n--){let i,l,o=r.index(n);if(n==r.depth?(i=r.nodeBefore,l=r.nodeAfter):t>0?(i=r.node(n+1),o++,l=r.node(n).maybeChild(o)):(i=r.node(n).maybeChild(o-1),l=r.node(n+1)),i&&!i.isTextblock&&re(i,l)&&r.node(n).canReplace(o,o+1))return e;if(n==0)break;e=t<0?r.before(n):r.after(n)}}function Ie(s,e,t){let r=null,{linebreakReplacement:n}=s.doc.type.schema,i=s.doc.resolve(e-t),l=i.node().type;if(n&&l.inlineContent){let p=l.whitespace=="pre",c=!!l.contentMatch.matchType(n);p&&!c?r=!1:!p&&c&&(r=!0)}let o=s.steps.length;if(r===!1){let p=s.doc.resolve(e+t);te(s,p.node(),p.before(),o)}l.inlineContent&&$(s,e+t-1,l,i.node().contentMatchAt(i.index()),r==null);let a=s.mapping.slice(o),h=a.map(e-t);if(s.step(new v(h,a.map(e+t,-1),w.empty,!0)),r===!0){let p=s.doc.resolve(h);ee(s,p.node(),p.before(),s.steps.length)}return s}function Te(s,e,t){let r=s.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let n=r.depth-1;n>=0;n--){let i=r.index(n);if(r.node(n).canReplaceWith(i,i,t))return r.before(n+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let n=r.depth-1;n>=0;n--){let i=r.indexAfter(n);if(r.node(n).canReplaceWith(i,i,t))return r.after(n+1);if(i<r.node(n).childCount)return null}return null}function Ee(s,e,t){let r=s.resolve(e);if(!t.content.size)return e;let n=t.content;for(let i=0;i<t.openStart;i++)n=n.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.size?2:1);i++)for(let l=r.depth;l>=0;l--){let o=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,a=r.index(l)+(o>0?1:0),h=r.node(l),p=!1;if(i==1)p=h.canReplace(a,a,n);else{let c=h.contentMatchAt(a).findWrapping(n.firstChild.type);p=c&&h.canReplaceWith(a,a,c[0])}if(p)return o==0?r.pos:o<0?r.before(l+1):r.after(l+1)}return null}function ne(s,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let n=s.resolve(e),i=s.resolve(t);return ie(n,i,r)?new v(e,t,r):new Oe(n,i,r).fit()}function ie(s,e,t){return!t.openStart&&!t.openEnd&&s.start()==e.start()&&s.parent.canReplace(s.index(),e.index(),t.content)}class Oe{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=g.empty;for(let n=0;n<=e.depth;n++){let i=e.node(n);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(n))})}for(let n=e.depth;n>0;n--)this.placed=g.from(e.node(n).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,n=this.close(e<0?this.$to:r.doc.resolve(e));if(!n)return null;let i=this.placed,l=r.depth,o=n.depth;for(;l&&o&&i.childCount==1;)i=i.firstChild.content,l--,o--;let a=new w(i,l,o);return e>-1?new b(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new v(r.pos,n.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,n=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(n=0),i.type.spec.isolating&&n<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let n,i=null;r?(i=G(this.unplaced.content,r-1).firstChild,n=i.content):n=this.unplaced.content;let l=n.firstChild;for(let o=this.depth;o>=0;o--){let{type:a,match:h}=this.frontier[o],p,c=null;if(t==1&&(l?h.matchType(l.type)||(c=h.fillBefore(g.from(l),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:o,parent:i,inject:c};if(t==2&&l&&(p=h.findWrapping(l.type)))return{sliceDepth:r,frontierDepth:o,parent:i,wrap:p};if(i&&h.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=G(e,t);return!n.childCount||n.firstChild.isLeaf?!1:(this.unplaced=new w(e,t+1,Math.max(r,n.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=G(e,t);if(n.childCount<=1&&t>0){let i=e.size-t<=t+n.size;this.unplaced=new w(J(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new w(J(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:n,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let l=this.unplaced,o=r?r.content:l.content,a=l.openStart-e,h=0,p=[],{match:c,type:f}=this.frontier[t];if(n){for(let m=0;m<n.childCount;m++)p.push(n.child(m));c=c.matchFragment(n)}let d=o.size+e-(l.content.size-l.openEnd);for(;h<o.childCount;){let m=o.child(h),x=c.matchType(m.type);if(!x)break;h++,(h>1||a==0||m.content.size)&&(c=x,p.push(se(m.mark(f.allowedMarks(m.marks)),h==1?a:0,h==o.childCount?d:-1)))}let u=h==o.childCount;u||(d=-1),this.placed=A(this.placed,t,g.from(p)),this.frontier[t].match=c,u&&d<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,x=o;m<d;m++){let T=x.lastChild;this.frontier.push({type:T.type,match:T.contentMatchAt(T.childCount)}),x=T.content}this.unplaced=u?e==0?w.empty:new w(J(l.content,e-1,1),e-1,d<0?l.openEnd:e-1):new w(J(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!H(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,n=this.$to.after(r);for(;r>1&&n==this.$to.end(--r);)++n;return n}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:n}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),l=H(e,t,n,r,i);if(l){for(let o=t-1;o>=0;o--){let{match:a,type:h}=this.frontier[o],p=H(e,o,h,a,!0);if(!p||p.childCount)continue e}return{depth:t,fit:l,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=A(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let n=e.node(r),i=n.type.contentMatch.fillBefore(n.content,!0,e.index(r));this.openFrontierNode(n.type,n.attrs,i)}return e}openFrontierNode(e,t=null,r){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=A(this.placed,this.depth,g.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(g.empty,!0);t.childCount&&(this.placed=A(this.placed,this.frontier.length,t))}}function J(s,e,t){return e==0?s.cutByIndex(t,s.childCount):s.replaceChild(0,s.firstChild.copy(J(s.firstChild.content,e-1,t)))}function A(s,e,t){return e==0?s.append(t):s.replaceChild(s.childCount-1,s.lastChild.copy(A(s.lastChild.content,e-1,t)))}function G(s,e){for(let t=0;t<e;t++)s=s.firstChild.content;return s}function se(s,e,t){if(e<=0)return s;let r=s.content;return e>1&&(r=r.replaceChild(0,se(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=s.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(s.type.contentMatch.matchFragment(r).fillBefore(g.empty,!0)))),s.copy(r)}function H(s,e,t,r,n){let i=s.node(e),l=n?s.indexAfter(e):s.index(e);if(l==i.childCount&&!t.compatibleContent(i.type))return null;let o=r.fillBefore(i.content,!0,l);return o&&!Fe(t,i.content,l)?o:null}function Fe(s,e,t){for(let r=t;r<e.childCount;r++)if(!s.allowsMarks(e.child(r).marks))return!0;return!1}function ze(s){return s.spec.defining||s.spec.definingForContent}function Je(s,e,t,r){if(!r.size)return s.deleteRange(e,t);let n=s.doc.resolve(e),i=s.doc.resolve(t);if(ie(n,i,r))return s.step(new v(e,t,r));let l=oe(n,s.doc.resolve(t));l[l.length-1]==0&&l.pop();let o=-(n.depth+1);l.unshift(o);for(let f=n.depth,d=n.pos-1;f>0;f--,d--){let u=n.node(f).type.spec;if(u.defining||u.definingAsContext||u.isolating)break;l.indexOf(f)>-1?o=f:n.before(f)==d&&l.splice(1,0,-f)}let a=l.indexOf(o),h=[],p=r.openStart;for(let f=r.content,d=0;;d++){let u=f.firstChild;if(h.push(u),d==r.openStart)break;f=u.content}for(let f=p-1;f>=0;f--){let d=h[f],u=ze(d.type);if(u&&!d.sameMarkup(n.node(Math.abs(o)-1)))p=f;else if(u||!d.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let d=(f+p+1)%(r.openStart+1),u=h[d];if(u)for(let m=0;m<l.length;m++){let x=l[(m+a)%l.length],T=!0;x<0&&(T=!1,x=-x);let De=n.node(x-1),ae=n.index(x-1);if(De.canReplaceWith(ae,ae,u.type,u.marks))return s.replace(n.before(x),T?i.after(x):t,new w(le(r.content,0,r.openStart,d),d,r.openEnd))}}let c=s.steps.length;for(let f=l.length-1;f>=0&&(s.replace(e,t,r),!(s.steps.length>c));f--){let d=l[f];d<0||(e=n.before(d),t=i.after(d))}}function le(s,e,t,r,n){if(e<t){let i=s.firstChild;s=s.replaceChild(0,i.copy(le(i.content,e+1,t,r,i)))}if(e>r){let i=n.contentMatchAt(0),l=i.fillBefore(s).append(s);s=l.append(i.matchFragment(l).fillBefore(g.empty,!0))}return s}function Ae(s,e,t,r){if(!r.isInline&&e==t&&s.doc.resolve(e).parent.content.size){let n=Te(s.doc,e,r.type);n!=null&&(e=t=n)}s.replaceRange(e,t,new w(g.from(r),0,0))}function Be(s,e,t){let r=s.doc.resolve(e),n=s.doc.resolve(t),i=oe(r,n);for(let l=0;l<i.length;l++){let o=i[l],a=l==i.length-1;if(a&&o==0||r.node(o).type.contentMatch.validEnd)return s.delete(r.start(o),n.end(o));if(o>0&&(a||r.node(o-1).canReplace(r.index(o-1),n.indexAfter(o-1))))return s.delete(r.before(o),n.after(o))}for(let l=1;l<=r.depth&&l<=n.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&n.end(l)-t!=n.depth-l&&r.start(l-1)==n.start(l-1)&&r.node(l-1).canReplace(r.index(l-1),n.index(l-1)))return s.delete(r.before(l),t);s.delete(e,t)}function oe(s,e){let t=[],r=Math.min(s.depth,e.depth);for(let n=r;n>=0;n--){let i=s.start(n);if(i<s.pos-(s.depth-n)||e.end(n)>e.pos+(e.depth-n)||s.node(n).type.spec.isolating||e.node(n).type.spec.isolating)break;(i==e.start(n)||n==s.depth&&n==e.depth&&s.parent.inlineContent&&e.parent.inlineContent&&n&&e.start(n-1)==i-1)&&t.push(n)}return t}class E extends k{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let n=t.type.create(r,null,t.marks);return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(n),0,t.isLeaf?0:1))}getMap(){return S.empty}invert(e){return new E(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new E(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new E(t.pos,t.attr,t.value)}}k.jsonID("attr",E);class B extends k{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return y.ok(r)}getMap(){return S.empty}invert(e){return new B(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new B(t.attr,t.value)}}k.jsonID("docAttr",B);let O=class extends Error{};O=function s(e){let t=Error.call(this,e);return t.__proto__=s.prototype,t},O.prototype=Object.create(Error.prototype),O.prototype.constructor=O,O.prototype.name="TransformError";class We{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new z}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new O(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=w.empty){let n=ne(this.doc,e,t,r);return n&&this.step(n),this}replaceWith(e,t,r){return this.replace(e,t,new w(g.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Je(this,e,t,r),this}replaceRangeWith(e,t,r){return Ae(this,e,t,r),this}deleteRange(e,t){return Be(this,e,t),this}lift(e,t){return me(this,e,t),this}join(e,t=1){return Ie(this,e,t),this}wrap(e,t){return ke(this,e,t),this}setBlockType(e,t=e,r,n=null){return ve(this,e,t,r,n),this}setNodeMarkup(e,t,r=null,n){return xe(this,e,t,r,n),this}setNodeAttribute(e,t,r){return this.step(new E(e,t,r)),this}setDocAttribute(e,t){return this.step(new B(e,t)),this}addNodeMark(e,t){return this.step(new R(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof K)t.isInSet(r.marks)&&this.step(new I(e,t));else{let n=r.marks,i,l=[];for(;i=t.isInSet(n);)l.push(new I(e,i)),n=i.removeFromSet(n);for(let o=l.length-1;o>=0;o--)this.step(l[o])}return this}split(e,t=1,r){return Me(this,e,t,r),this}addMark(e,t,r){return fe(this,e,t,r),this}removeMark(e,t,r){return ce(this,e,t,r),this}clearIncompatible(e,t,r){return $(this,e,t,r),this}}F("T",We)}}});
|
|
1
|
+
System.register(["./prosemirror-model-DTWK5xnv.system.js"],function(F,Le){"use strict";var w,g,K,Q,U;return{setters:[C=>{w=C.b,g=C.F,K=C.M,Q=C.d,U=C.R}],execute:function(){F({a:be,c:Ce,d:Ee,f:we,j:Ie,l:ue,r:ne});const C=65535,V=Math.pow(2,16);function he(s,e){return s+e*V}function X(s){return s&C}function pe(s){return(s-(s&C))/V}const Y=1,Z=2,W=4,_=8;class D{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&_)>0}get deletedBefore(){return(this.delInfo&(Y|W))>0}get deletedAfter(){return(this.delInfo&(Z|W))>0}get deletedAcross(){return(this.delInfo&W)>0}}class S{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&S.empty)return S.empty}recover(e){let t=0,r=X(e);if(!this.inverted)for(let n=0;n<r;n++)t+=this.ranges[n*3+2]-this.ranges[n*3+1];return this.ranges[r*3]+t+pe(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let n=0,i=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?n:0);if(a>e)break;let h=this.ranges[o+i],p=this.ranges[o+l],c=a+h;if(e<=c){let f=h?e==a?-1:e==c?1:t:t,d=a+n+(f<0?0:p);if(r)return d;let u=e==(t<0?a:c)?null:he(o/3,e-a),m=e==a?Z:e==c?Y:W;return(t<0?e!=a:e!=c)&&(m|=_),new D(d,m,u)}n+=p-h}return r?e+n:new D(e+n,0,null)}touches(e,t){let r=0,n=X(t),i=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?r:0);if(a>e)break;let h=this.ranges[o+i],p=a+h;if(e<=p&&o==n*3)return!0;r+=this.ranges[o+l]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let n=0,i=0;n<this.ranges.length;n+=3){let l=this.ranges[n],o=l-(this.inverted?i:0),a=l+(this.inverted?0:i),h=this.ranges[n+t],p=this.ranges[n+r];e(o,o+h,a,a+p),i+=p-h}}invert(){return new S(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?S.empty:new S(e<0?[0,-e,0]:[0,0,e])}}S.empty=new S([]);class z{constructor(e,t,r=0,n=e?e.length:0){this.mirror=t,this.from=r,this.to=n,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new z(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let n=e.getMirror(t);this.appendMap(e._maps[t],n!=null&&n<t?r+n:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let n=e.getMirror(t);this.appendMap(e._maps[t].invert(),n!=null&&n>t?r-n-1:void 0)}}invert(){let e=new z;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let n=0;for(let i=this.from;i<this.to;i++){let l=this._maps[i],o=l.mapResult(e,t);if(o.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(o.recover);continue}}n|=o.delInfo,e=o.pos}return r?e:new D(e,n,null)}}F("M",z);const L=Object.create(null);class k{getMap(){return S.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=L[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in L)throw new RangeError("Duplicate use of step JSON ID "+e);return L[e]=t,t.prototype.jsonID=e,t}}class y{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new y(e,null)}static fail(e){return new y(null,e)}static fromReplace(e,t,r,n){try{return y.ok(e.replace(t,r,n))}catch(i){if(i instanceof U)return y.fail(i.message);throw i}}}function q(s,e,t){let r=[];for(let n=0;n<s.childCount;n++){let i=s.child(n);i.content.size&&(i=i.copy(q(i.content,e,i))),i.isInline&&(i=e(i,t,n)),r.push(i)}return g.fromArray(r)}class N extends k{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),n=r.node(r.sharedDepth(this.to)),i=new w(q(t.content,(l,o)=>!l.isAtom||!o.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),n),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,i)}invert(){return new M(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new N(t.pos,r.pos,this.mark)}merge(e){return e instanceof N&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new N(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new N(t.from,t.to,e.markFromJSON(t.mark))}}k.jsonID("addMark",N);class M extends k{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(q(t.content,n=>n.mark(this.mark.removeFromSet(n.marks)),e),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,r)}invert(){return new N(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new M(t.pos,r.pos,this.mark)}merge(e){return e instanceof M&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new M(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new M(t.from,t.to,e.markFromJSON(t.mark))}}k.jsonID("removeMark",M);class I extends k{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(r))return new I(this.pos,t.marks[n]);return new I(this.pos,this.mark)}}return new R(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new I(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new I(t.pos,e.markFromJSON(t.mark))}}k.jsonID("addNodeMark",I);class R extends k{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new I(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new R(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new R(t.pos,e.markFromJSON(t.mark))}}k.jsonID("removeNodeMark",R);class v extends k{constructor(e,t,r,n=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=n}apply(e){return this.structure&&P(e,this.from,this.to)?y.fail("Structure replace would overwrite content"):y.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new S([this.from,this.to-this.from,this.slice.size])}invert(e){return new v(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new v(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof v)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?w.empty:new w(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new v(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?w.empty:new w(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new v(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new v(t.from,t.to,w.fromJSON(e,t.slice),!!t.structure)}}F("R",v),k.jsonID("replace",v);class b extends k{constructor(e,t,r,n,i,l,o=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=n,this.slice=i,this.insert=l,this.structure=o}apply(e){if(this.structure&&(P(e,this.from,this.gapFrom)||P(e,this.gapTo,this.to)))return y.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return y.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?y.fromReplace(e,this.from,this.to,r):y.fail("Content does not fit in gap")}getMap(){return new S([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new b(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),n=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||n<t.pos||i>r.pos?null:new b(t.pos,r.pos,n,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new b(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}F("b",b),k.jsonID("replaceAround",b);function P(s,e,t){let r=s.resolve(e),n=t-e,i=r.depth;for(;n>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,n--;if(n>0){let l=r.node(i).maybeChild(r.indexAfter(i));for(;n>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,n--}}return!1}function fe(s,e,t,r){let n=[],i=[],l,o;s.doc.nodesBetween(e,t,(a,h,p)=>{if(!a.isInline)return;let c=a.marks;if(!r.isInSet(c)&&p.type.allowsMarkType(r.type)){let f=Math.max(h,e),d=Math.min(h+a.nodeSize,t),u=r.addToSet(c);for(let m=0;m<c.length;m++)c[m].isInSet(u)||(l&&l.to==f&&l.mark.eq(c[m])?l.to=d:n.push(l=new M(f,d,c[m])));o&&o.to==f?o.to=d:i.push(o=new N(f,d,r))}}),n.forEach(a=>s.step(a)),i.forEach(a=>s.step(a))}function ce(s,e,t,r){let n=[],i=0;s.doc.nodesBetween(e,t,(l,o)=>{if(!l.isInline)return;i++;let a=null;if(r instanceof Q){let h=l.marks,p;for(;p=r.isInSet(h);)(a||(a=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(l.marks)&&(a=[r]):a=l.marks;if(a&&a.length){let h=Math.min(o+l.nodeSize,t);for(let p=0;p<a.length;p++){let c=a[p],f;for(let d=0;d<n.length;d++){let u=n[d];u.step==i-1&&c.eq(n[d].style)&&(f=u)}f?(f.to=h,f.step=i):n.push({style:c,from:Math.max(o,e),to:h,step:i})}}}),n.forEach(l=>s.step(new M(l.from,l.to,l.style)))}function $(s,e,t,r=t.contentMatch,n=!0){let i=s.doc.nodeAt(e),l=[],o=e+1;for(let a=0;a<i.childCount;a++){let h=i.child(a),p=o+h.nodeSize,c=r.matchType(h.type);if(!c)l.push(new v(o,p,w.empty));else{r=c;for(let f=0;f<h.marks.length;f++)t.allowsMarkType(h.marks[f].type)||s.step(new M(o,p,h.marks[f]));if(n&&h.isText&&t.whitespace!="pre"){let f,d=/\r?\n|\r/g,u;for(;f=d.exec(h.text);)u||(u=new w(g.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),l.push(new v(o+f.index,o+f.index+f[0].length,u))}}o=p}if(!r.validEnd){let a=r.fillBefore(g.empty,!0);s.replace(o,o,new w(a,0,0))}for(let a=l.length-1;a>=0;a--)s.step(l[a])}function de(s,e,t){return(e==0||s.canReplace(e,s.childCount))&&(t==s.childCount||s.canReplace(0,t))}function ue(s){let t=s.parent.content.cutByIndex(s.startIndex,s.endIndex);for(let r=s.depth;;--r){let n=s.$from.node(r),i=s.$from.index(r),l=s.$to.indexAfter(r);if(r<s.depth&&n.canReplace(i,l,t))return r;if(r==0||n.type.spec.isolating||!de(n,i,l))break}return null}function me(s,e,t){let{$from:r,$to:n,depth:i}=e,l=r.before(i+1),o=n.after(i+1),a=l,h=o,p=g.empty,c=0;for(let u=i,m=!1;u>t;u--)m||r.index(u)>0?(m=!0,p=g.from(r.node(u).copy(p)),c++):a--;let f=g.empty,d=0;for(let u=i,m=!1;u>t;u--)m||n.after(u+1)<n.end(u)?(m=!0,f=g.from(n.node(u).copy(f)),d++):h++;s.step(new b(a,h,l,o,new w(p.append(f),c,d),p.size-c,!0))}function we(s,e,t=null,r=s){let n=ge(s,e),i=n&&ye(r,e);return i?n.map(j).concat({type:e,attrs:t}).concat(i.map(j)):null}function j(s){return{type:s,attrs:null}}function ge(s,e){let{parent:t,startIndex:r,endIndex:n}=s,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let l=i.length?i[0]:e;return t.canReplaceWith(r,n,l)?i:null}function ye(s,e){let{parent:t,startIndex:r,endIndex:n}=s,i=t.child(r),l=e.contentMatch.findWrapping(i.type);if(!l)return null;let a=(l.length?l[l.length-1]:e).contentMatch;for(let h=r;a&&h<n;h++)a=a.matchType(t.child(h).type);return!a||!a.validEnd?null:l}function ke(s,e,t){let r=g.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let o=t[l].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=g.from(t[l].type.create(t[l].attrs,r))}let n=e.start,i=e.end;s.step(new b(n,i,n,i,new w(r,0,0),t.length,!0))}function ve(s,e,t,r,n){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=s.steps.length;s.doc.nodesBetween(e,t,(l,o)=>{let a=typeof n=="function"?n(l):n;if(l.isTextblock&&!l.hasMarkup(r,a)&&Se(s.doc,s.mapping.slice(i).map(o),r)){let h=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",u=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!u?h=!1:!d&&u&&(h=!0)}h===!1&&te(s,l,o,i),$(s,s.mapping.slice(i).map(o,1),r,void 0,h===null);let p=s.mapping.slice(i),c=p.map(o,1),f=p.map(o+l.nodeSize,1);return s.step(new b(c,f,c+1,f-1,new w(g.from(r.create(a,null,l.marks)),0,0),1,!0)),h===!0&&ee(s,l,o,i),!1}})}function ee(s,e,t,r){e.forEach((n,i)=>{if(n.isText){let l,o=/\r?\n|\r/g;for(;l=o.exec(n.text);){let a=s.mapping.slice(r).map(t+1+i+l.index);s.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function te(s,e,t,r){e.forEach((n,i)=>{if(n.type==n.type.schema.linebreakReplacement){let l=s.mapping.slice(r).map(t+1+i);s.replaceWith(l,l+1,e.type.schema.text(`
|
|
2
|
+
`))}})}function Se(s,e,t){let r=s.resolve(e),n=r.index();return r.parent.canReplaceWith(n,n+1,t)}function xe(s,e,t,r,n){let i=s.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let l=t.create(r,null,n||i.marks);if(i.isLeaf)return s.replaceWith(e,e+i.nodeSize,l);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);s.step(new b(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new w(g.from(l),0,0),1,!0))}function be(s,e,t=1,r){let n=s.resolve(e),i=n.depth-t,l=r&&r[r.length-1]||n.parent;if(i<0||n.parent.type.spec.isolating||!n.parent.canReplace(n.index(),n.parent.childCount)||!l.type.validContent(n.parent.content.cutByIndex(n.index(),n.parent.childCount)))return!1;for(let h=n.depth-1,p=t-2;h>i;h--,p--){let c=n.node(h),f=n.index(h);if(c.type.spec.isolating)return!1;let d=c.content.cutByIndex(f,c.childCount),u=r&&r[p+1];u&&(d=d.replaceChild(0,u.type.create(u.attrs)));let m=r&&r[p]||c;if(!c.canReplace(f+1,c.childCount)||!m.type.validContent(d))return!1}let o=n.indexAfter(i),a=r&&r[0];return n.node(i).canReplaceWith(o,o,a?a.type:n.node(i+1).type)}function Me(s,e,t=1,r){let n=s.doc.resolve(e),i=g.empty,l=g.empty;for(let o=n.depth,a=n.depth-t,h=t-1;o>a;o--,h--){i=g.from(n.node(o).copy(i));let p=r&&r[h];l=g.from(p?p.type.create(p.attrs,l):n.node(o).copy(l))}s.step(new v(e,e,new w(i.append(l),t,t),!0))}function Ce(s,e){let t=s.resolve(e),r=t.index();return re(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Ne(s,e){e.content.size||s.type.compatibleContent(e.type);let t=s.contentMatchAt(s.childCount),{linebreakReplacement:r}=s.type.schema;for(let n=0;n<e.childCount;n++){let i=e.child(n),l=i.type==r?s.type.schema.nodes.text:i.type;if(t=t.matchType(l),!t||!s.type.allowsMarks(i.marks))return!1}return t.validEnd}function re(s,e){return!!(s&&e&&!s.isLeaf&&Ne(s,e))}function Ie(s,e,t=-1){let r=s.resolve(e);for(let n=r.depth;;n--){let i,l,o=r.index(n);if(n==r.depth?(i=r.nodeBefore,l=r.nodeAfter):t>0?(i=r.node(n+1),o++,l=r.node(n).maybeChild(o)):(i=r.node(n).maybeChild(o-1),l=r.node(n+1)),i&&!i.isTextblock&&re(i,l)&&r.node(n).canReplace(o,o+1))return e;if(n==0)break;e=t<0?r.before(n):r.after(n)}}function Re(s,e,t){let r=null,{linebreakReplacement:n}=s.doc.type.schema,i=s.doc.resolve(e-t),l=i.node().type;if(n&&l.inlineContent){let p=l.whitespace=="pre",c=!!l.contentMatch.matchType(n);p&&!c?r=!1:!p&&c&&(r=!0)}let o=s.steps.length;if(r===!1){let p=s.doc.resolve(e+t);te(s,p.node(),p.before(),o)}l.inlineContent&&$(s,e+t-1,l,i.node().contentMatchAt(i.index()),r==null);let a=s.mapping.slice(o),h=a.map(e-t);if(s.step(new v(h,a.map(e+t,-1),w.empty,!0)),r===!0){let p=s.doc.resolve(h);ee(s,p.node(),p.before(),s.steps.length)}return s}function Te(s,e,t){let r=s.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let n=r.depth-1;n>=0;n--){let i=r.index(n);if(r.node(n).canReplaceWith(i,i,t))return r.before(n+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let n=r.depth-1;n>=0;n--){let i=r.indexAfter(n);if(r.node(n).canReplaceWith(i,i,t))return r.after(n+1);if(i<r.node(n).childCount)return null}return null}function Ee(s,e,t){let r=s.resolve(e);if(!t.content.size)return e;let n=t.content;for(let i=0;i<t.openStart;i++)n=n.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.size?2:1);i++)for(let l=r.depth;l>=0;l--){let o=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,a=r.index(l)+(o>0?1:0),h=r.node(l),p=!1;if(i==1)p=h.canReplace(a,a,n);else{let c=h.contentMatchAt(a).findWrapping(n.firstChild.type);p=c&&h.canReplaceWith(a,a,c[0])}if(p)return o==0?r.pos:o<0?r.before(l+1):r.after(l+1)}return null}function ne(s,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let n=s.resolve(e),i=s.resolve(t);return ie(n,i,r)?new v(e,t,r):new Oe(n,i,r).fit()}function ie(s,e,t){return!t.openStart&&!t.openEnd&&s.start()==e.start()&&s.parent.canReplace(s.index(),e.index(),t.content)}class Oe{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=g.empty;for(let n=0;n<=e.depth;n++){let i=e.node(n);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(n))})}for(let n=e.depth;n>0;n--)this.placed=g.from(e.node(n).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,n=this.close(e<0?this.$to:r.doc.resolve(e));if(!n)return null;let i=this.placed,l=r.depth,o=n.depth;for(;l&&o&&i.childCount==1;)i=i.firstChild.content,l--,o--;let a=new w(i,l,o);return e>-1?new b(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new v(r.pos,n.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,n=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(n=0),i.type.spec.isolating&&n<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let n,i=null;r?(i=G(this.unplaced.content,r-1).firstChild,n=i.content):n=this.unplaced.content;let l=n.firstChild;for(let o=this.depth;o>=0;o--){let{type:a,match:h}=this.frontier[o],p,c=null;if(t==1&&(l?h.matchType(l.type)||(c=h.fillBefore(g.from(l),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:o,parent:i,inject:c};if(t==2&&l&&(p=h.findWrapping(l.type)))return{sliceDepth:r,frontierDepth:o,parent:i,wrap:p};if(i&&h.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=G(e,t);return!n.childCount||n.firstChild.isLeaf?!1:(this.unplaced=new w(e,t+1,Math.max(r,n.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=G(e,t);if(n.childCount<=1&&t>0){let i=e.size-t<=t+n.size;this.unplaced=new w(J(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new w(J(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:n,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let l=this.unplaced,o=r?r.content:l.content,a=l.openStart-e,h=0,p=[],{match:c,type:f}=this.frontier[t];if(n){for(let m=0;m<n.childCount;m++)p.push(n.child(m));c=c.matchFragment(n)}let d=o.size+e-(l.content.size-l.openEnd);for(;h<o.childCount;){let m=o.child(h),x=c.matchType(m.type);if(!x)break;h++,(h>1||a==0||m.content.size)&&(c=x,p.push(se(m.mark(f.allowedMarks(m.marks)),h==1?a:0,h==o.childCount?d:-1)))}let u=h==o.childCount;u||(d=-1),this.placed=A(this.placed,t,g.from(p)),this.frontier[t].match=c,u&&d<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,x=o;m<d;m++){let T=x.lastChild;this.frontier.push({type:T.type,match:T.contentMatchAt(T.childCount)}),x=T.content}this.unplaced=u?e==0?w.empty:new w(J(l.content,e-1,1),e-1,d<0?l.openEnd:e-1):new w(J(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!H(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,n=this.$to.after(r);for(;r>1&&n==this.$to.end(--r);)++n;return n}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:n}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),l=H(e,t,n,r,i);if(l){for(let o=t-1;o>=0;o--){let{match:a,type:h}=this.frontier[o],p=H(e,o,h,a,!0);if(!p||p.childCount)continue e}return{depth:t,fit:l,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=A(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let n=e.node(r),i=n.type.contentMatch.fillBefore(n.content,!0,e.index(r));this.openFrontierNode(n.type,n.attrs,i)}return e}openFrontierNode(e,t=null,r){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=A(this.placed,this.depth,g.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(g.empty,!0);t.childCount&&(this.placed=A(this.placed,this.frontier.length,t))}}function J(s,e,t){return e==0?s.cutByIndex(t,s.childCount):s.replaceChild(0,s.firstChild.copy(J(s.firstChild.content,e-1,t)))}function A(s,e,t){return e==0?s.append(t):s.replaceChild(s.childCount-1,s.lastChild.copy(A(s.lastChild.content,e-1,t)))}function G(s,e){for(let t=0;t<e;t++)s=s.firstChild.content;return s}function se(s,e,t){if(e<=0)return s;let r=s.content;return e>1&&(r=r.replaceChild(0,se(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=s.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(s.type.contentMatch.matchFragment(r).fillBefore(g.empty,!0)))),s.copy(r)}function H(s,e,t,r,n){let i=s.node(e),l=n?s.indexAfter(e):s.index(e);if(l==i.childCount&&!t.compatibleContent(i.type))return null;let o=r.fillBefore(i.content,!0,l);return o&&!Fe(t,i.content,l)?o:null}function Fe(s,e,t){for(let r=t;r<e.childCount;r++)if(!s.allowsMarks(e.child(r).marks))return!0;return!1}function ze(s){return s.spec.defining||s.spec.definingForContent}function Je(s,e,t,r){if(!r.size)return s.deleteRange(e,t);let n=s.doc.resolve(e),i=s.doc.resolve(t);if(ie(n,i,r))return s.step(new v(e,t,r));let l=oe(n,s.doc.resolve(t));l[l.length-1]==0&&l.pop();let o=-(n.depth+1);l.unshift(o);for(let f=n.depth,d=n.pos-1;f>0;f--,d--){let u=n.node(f).type.spec;if(u.defining||u.definingAsContext||u.isolating)break;l.indexOf(f)>-1?o=f:n.before(f)==d&&l.splice(1,0,-f)}let a=l.indexOf(o),h=[],p=r.openStart;for(let f=r.content,d=0;;d++){let u=f.firstChild;if(h.push(u),d==r.openStart)break;f=u.content}for(let f=p-1;f>=0;f--){let d=h[f],u=ze(d.type);if(u&&!d.sameMarkup(n.node(Math.abs(o)-1)))p=f;else if(u||!d.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let d=(f+p+1)%(r.openStart+1),u=h[d];if(u)for(let m=0;m<l.length;m++){let x=l[(m+a)%l.length],T=!0;x<0&&(T=!1,x=-x);let De=n.node(x-1),ae=n.index(x-1);if(De.canReplaceWith(ae,ae,u.type,u.marks))return s.replace(n.before(x),T?i.after(x):t,new w(le(r.content,0,r.openStart,d),d,r.openEnd))}}let c=s.steps.length;for(let f=l.length-1;f>=0&&(s.replace(e,t,r),!(s.steps.length>c));f--){let d=l[f];d<0||(e=n.before(d),t=i.after(d))}}function le(s,e,t,r,n){if(e<t){let i=s.firstChild;s=s.replaceChild(0,i.copy(le(i.content,e+1,t,r,i)))}if(e>r){let i=n.contentMatchAt(0),l=i.fillBefore(s).append(s);s=l.append(i.matchFragment(l).fillBefore(g.empty,!0))}return s}function Ae(s,e,t,r){if(!r.isInline&&e==t&&s.doc.resolve(e).parent.content.size){let n=Te(s.doc,e,r.type);n!=null&&(e=t=n)}s.replaceRange(e,t,new w(g.from(r),0,0))}function Be(s,e,t){let r=s.doc.resolve(e),n=s.doc.resolve(t),i=oe(r,n);for(let l=0;l<i.length;l++){let o=i[l],a=l==i.length-1;if(a&&o==0||r.node(o).type.contentMatch.validEnd)return s.delete(r.start(o),n.end(o));if(o>0&&(a||r.node(o-1).canReplace(r.index(o-1),n.indexAfter(o-1))))return s.delete(r.before(o),n.after(o))}for(let l=1;l<=r.depth&&l<=n.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&n.end(l)-t!=n.depth-l&&r.start(l-1)==n.start(l-1)&&r.node(l-1).canReplace(r.index(l-1),n.index(l-1)))return s.delete(r.before(l),t);s.delete(e,t)}function oe(s,e){let t=[],r=Math.min(s.depth,e.depth);for(let n=r;n>=0;n--){let i=s.start(n);if(i<s.pos-(s.depth-n)||e.end(n)>e.pos+(e.depth-n)||s.node(n).type.spec.isolating||e.node(n).type.spec.isolating)break;(i==e.start(n)||n==s.depth&&n==e.depth&&s.parent.inlineContent&&e.parent.inlineContent&&n&&e.start(n-1)==i-1)&&t.push(n)}return t}class E extends k{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return y.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let n=t.type.create(r,null,t.marks);return y.fromReplace(e,this.pos,this.pos+1,new w(g.from(n),0,t.isLeaf?0:1))}getMap(){return S.empty}invert(e){return new E(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new E(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new E(t.pos,t.attr,t.value)}}k.jsonID("attr",E);class B extends k{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return y.ok(r)}getMap(){return S.empty}invert(e){return new B(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new B(t.attr,t.value)}}k.jsonID("docAttr",B);let O=class extends Error{};O=function s(e){let t=Error.call(this,e);return t.__proto__=s.prototype,t},O.prototype=Object.create(Error.prototype),O.prototype.constructor=O,O.prototype.name="TransformError";class We{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new z}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new O(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=w.empty){let n=ne(this.doc,e,t,r);return n&&this.step(n),this}replaceWith(e,t,r){return this.replace(e,t,new w(g.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Je(this,e,t,r),this}replaceRangeWith(e,t,r){return Ae(this,e,t,r),this}deleteRange(e,t){return Be(this,e,t),this}lift(e,t){return me(this,e,t),this}join(e,t=1){return Re(this,e,t),this}wrap(e,t){return ke(this,e,t),this}setBlockType(e,t=e,r,n=null){return ve(this,e,t,r,n),this}setNodeMarkup(e,t,r=null,n){return xe(this,e,t,r,n),this}setNodeAttribute(e,t,r){return this.step(new E(e,t,r)),this}setDocAttribute(e,t){return this.step(new B(e,t)),this}addNodeMark(e,t){return this.step(new I(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof K)t.isInSet(r.marks)&&this.step(new R(e,t));else{let n=r.marks,i,l=[];for(;i=t.isInSet(n);)l.push(new R(e,i)),n=i.removeFromSet(n);for(let o=l.length-1;o>=0;o--)this.step(l[o])}return this}split(e,t=1,r){return Me(this,e,t,r),this}addMark(e,t,r){return fe(this,e,t,r),this}removeMark(e,t,r){return ce(this,e,t,r),this}clearIncompatible(e,t,r){return $(this,e,t,r),this}}F("T",We)}}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as D, S as he, T as M, A as Cn } from "./prosemirror-state-
|
|
1
|
+
import { N as D, S as he, T as M, A as Cn } from "./prosemirror-state-BW6XGB3U.es.js";
|
|
2
2
|
import { b as J, D as Re, F as W, a as Kt, M as On } from "./prosemirror-model-D2n-Dx_L.es.js";
|
|
3
3
|
import { d as Mn } from "./prosemirror-transform-DvAmofec.es.js";
|
|
4
4
|
const S = function(t) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./prosemirror-state-DzPLD-6l.system.js","./prosemirror-model-DTWK5xnv.system.js","./prosemirror-transform-VaXuT0NM.system.js"],function(ze,ai){"use strict";var N,ee,C,ct,q,me,z,Le,dt,ft;return{setters:[D=>{N=D.N,ee=D.S,C=D.T,ct=D.A},D=>{q=D.b,me=D.D,z=D.F,Le=D.a,dt=D.M},D=>{ft=D.d}],execute:function(){const D=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ce=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let $e=null;const K=function(t,e,n){let o=$e||($e=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},xn=function(){$e=null},te=function(t,e,n,o){return n&&(ht(t,e,n,o,-1)||ht(t,e,n,o,1))},kn=/^(img|br|input|textarea|hr)$/i;function ht(t,e,n,o,i){for(;;){if(t==n&&e==o)return!0;if(e==(i<0?0:V(t))){let s=t.parentNode;if(!s||s.nodeType!=1||ge(t)||kn.test(t.nodeName)||t.contentEditable=="false")return!1;e=D(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?V(t):0}else return!1}}function V(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Tn(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=V(t)}else if(t.parentNode&&!ge(t))e=D(t),t=t.parentNode;else return null}}function An(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ge(t))e=D(t)+1,t=t.parentNode;else return null}}function En(t,e,n){for(let o=e==0,i=e==V(t);o||i;){if(t==n)return!0;let s=D(t);if(t=t.parentNode,!t)return!1;o=o&&s==0,i=i&&s==V(t)}}function ge(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ke=function(t){return t.focusNode&&te(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ne(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Pn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Vn(t,e,n){if(t.caretPositionFromPoint)try{let o=t.caretPositionFromPoint(e,n);if(o)return{node:o.offsetNode,offset:Math.min(V(o.offsetNode),o.offset)}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(e,n);if(o)return{node:o.startContainer,offset:Math.min(V(o.startContainer),o.startOffset)}}}const L=typeof navigator<"u"?navigator:null,ut=typeof document<"u"?document:null,j=L&&L.userAgent||"",qe=/Edge\/(\d+)/.exec(j),pt=/MSIE \d/.exec(j),Ke=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(j),A=!!(pt||Ke||qe),U=pt?document.documentMode:Ke?+Ke[1]:qe?+qe[1]:0,F=!A&&/gecko\/(\d+)/i.test(j);F&&+(/Firefox\/(\d+)/.exec(j)||[0,0])[1];const He=!A&&/Chrome\/(\d+)/.exec(j),O=!!He,mt=He?+He[1]:0,x=!A&&!!L&&/Apple Computer/.test(L.vendor),de=x&&(/Mobile\/\w+/.test(j)||!!L&&L.maxTouchPoints>2),R=de||(L?/Mac/.test(L.platform):!1),Rn=L?/Win/.test(L.platform):!1,H=/Android \d/.test(j),ye=!!ut&&"webkitFontSmoothing"in ut.documentElement.style,Bn=ye?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function In(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function W(t,e){return typeof t=="number"?t:t[e]}function Fn(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function gt(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let r=n||t.dom;r;){if(r.nodeType!=1){r=ce(r);continue}let l=r,a=l==s.body,c=a?In(s):Fn(l),d=0,f=0;if(e.top<c.top+W(o,"top")?f=-(c.top-e.top+W(i,"top")):e.bottom>c.bottom-W(o,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+W(i,"top")-c.top:e.bottom-c.bottom+W(i,"bottom")),e.left<c.left+W(o,"left")?d=-(c.left-e.left+W(i,"left")):e.right>c.right-W(o,"right")&&(d=e.right-c.right+W(i,"right")),d||f)if(a)s.defaultView.scrollBy(d,f);else{let p=l.scrollLeft,h=l.scrollTop;f&&(l.scrollTop+=f),d&&(l.scrollLeft+=d);let g=l.scrollLeft-p,m=l.scrollTop-h;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let u=a?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(u))break;r=u=="absolute"?r.offsetParent:ce(r)}}function zn(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),o,i;for(let s=(e.left+e.right)/2,r=n+1;r<Math.min(innerHeight,e.bottom);r+=5){let l=t.root.elementFromPoint(s,r);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){o=l,i=a.top;break}}return{refDOM:o,refTop:i,stack:yt(t.dom)}}function yt(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=ce(o));return e}function Ln({refDOM:t,refTop:e,stack:n}){let o=t?t.getBoundingClientRect().top:0;bt(n,o==0?0:o-e)}function bt(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:i,left:s}=t[n];o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}let fe=null;function $n(t){if(t.setActive)return t.setActive();if(fe)return t.focus(fe);let e=yt(t);t.focus(fe==null?{get preventScroll(){return fe={preventScroll:!0},!0}}:void 0),fe||(fe=!1,bt(e,0))}function Dt(t,e){let n,o=2e8,i,s=0,r=e.top,l=e.top,a,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let u;if(d.nodeType==1)u=d.getClientRects();else if(d.nodeType==3)u=K(d).getClientRects();else continue;for(let p=0;p<u.length;p++){let h=u[p];if(h.top<=r&&h.bottom>=l){r=Math.max(h.bottom,r),l=Math.min(h.top,l);let g=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(g<o){n=d,o=g,i=g&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,d.nodeType==1&&g&&(s=f+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=d,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=f+1)}}return!n&&a&&(n=a,i=c,o=0),n&&n.nodeType==3?qn(n,i):!n||o&&n.nodeType==1?{node:t,offset:s}:Dt(n,i)}function qn(t,e){let n=t.nodeValue.length,o=document.createRange();for(let i=0;i<n;i++){o.setEnd(t,i+1),o.setStart(t,i);let s=Y(o,1);if(s.top!=s.bottom&&We(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function We(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Kn(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Hn(t,e,n){let{node:o,offset:i}=Dt(e,n),s=-1;if(o.nodeType==1&&!o.firstChild){let r=o.getBoundingClientRect();s=r.left!=r.right&&n.left>(r.left+r.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}function Wn(t,e,n,o){let i=-1;for(let s=e,r=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!r&&a.left>o.left||a.top>o.top?i=l.posBefore:(!r&&a.right<o.left||a.bottom<o.top)&&(i=l.posAfter),r=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?o.top<(a.top+a.bottom)/2:o.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Nt(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let r=t.childNodes[s];if(r.nodeType==1){let l=r.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(We(e,c))return Nt(r,e,c)}}if((s=(s+1)%o)==i)break}return t}function _n(t,e){let n=t.dom.ownerDocument,o,i=0,s=Vn(n,e.left,e.top);s&&({node:o,offset:i}=s);let r=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!r||!t.dom.contains(r.nodeType!=1?r.parentNode:r)){let c=t.dom.getBoundingClientRect();if(!We(e,c)||(r=Nt(t.dom,e,c),!r))return null}if(x)for(let c=r;o&&c;c=ce(c))c.draggable&&(o=void 0);if(r=Kn(r,e),o){if(F&&o.nodeType==1&&(i=Math.min(i,o.childNodes.length),i<o.childNodes.length)){let d=o.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;ye&&i&&o.nodeType==1&&(c=o.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,o==t.dom&&i==o.childNodes.length-1&&o.lastChild.nodeType==1&&e.top>o.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||o.nodeType!=1||o.childNodes[i-1].nodeName!="BR")&&(l=Wn(t,o,i,e))}l==null&&(l=Hn(t,r,e));let a=t.docView.nearestDesc(r,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function St(t){return t.top<t.bottom||t.left<t.right}function Y(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(St(o))return o}return Array.prototype.find.call(n,St)||t.getBoundingClientRect()}const jn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ct(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),r=ye||F;if(o.nodeType==3)if(r&&(jn.test(o.nodeValue)||(n<0?!i:i==o.nodeValue.length))){let a=Y(K(o,i,i),n);if(F&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=Y(K(o,i-1,i-1),-1);if(c.top==a.top){let d=Y(K(o,i,i+1),-1);if(d.top!=a.top)return be(d,d.left<c.left)}}return a}else{let a=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==o.nodeValue.length?(a--,d=1):n<0?a--:c++,be(Y(K(o,a,c),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==V(o))){let a=o.childNodes[i-1];if(a.nodeType==1)return _e(a.getBoundingClientRect(),!1)}if(s==null&&i<V(o)){let a=o.childNodes[i];if(a.nodeType==1)return _e(a.getBoundingClientRect(),!0)}return _e(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==V(o))){let a=o.childNodes[i-1],c=a.nodeType==3?K(a,V(a)-(r?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return be(Y(c,1),!1)}if(s==null&&i<V(o)){let a=o.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?K(a,0,r?0:1):a.nodeType==1?a:null:null;if(c)return be(Y(c,-1),!0)}return be(Y(o.nodeType==3?K(o):o,-n),n>=0)}function be(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function _e(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ot(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}function Un(t,e,n){let o=e.selection,i=n=="up"?o.$from:o.$to;return Ot(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let r=Ct(t,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=K(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let d=a[c];if(d.bottom>d.top+1&&(n=="up"?r.top-d.top>(d.bottom-r.top)*2:d.bottom-r.bottom>(r.bottom-d.top)*2))return!1}}return!0})}const Yn=/[\u0590-\u08ac]/;function Gn(t,e,n){let{$head:o}=e.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,s=!i,r=i==o.parent.content.size,l=t.domSelection();return l?!Yn.test(o.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:r:Ot(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),u=l.caretBidiLevel;l.modify("move",n,"character");let p=o.depth?t.docView.domAfterPos(o.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==g;try{l.collapse(d,f),a&&(a!=d||c!=f)&&l.extend&&l.extend(a,c)}catch{}return u!=null&&(l.caretBidiLevel=u),m}):o.pos==o.start()||o.pos==o.end()}let Mt=null,xt=null,kt=!1;function Xn(t,e,n){return Mt==e&&xt==n?kt:(Mt=e,xt=n,kt=n=="up"||n=="down"?Un(t,e,n):Gn(t,e,n))}const B=0,Tt=1,oe=2,$=3;class De{constructor(e,n,o,i){this.parent=e,this.children=n,this.dom=o,this.contentDOM=i,this.dirty=B,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let i=this.children[n];if(i==e)return o;o+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(o<0){let s,r;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((r=s.pmViewDesc)&&r.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(r)+r.size:this.posAtStart}else{let s,r;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((r=s.pmViewDesc)&&r.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(r):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>D(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),r;if(s&&(!n||s.node))if(o&&(r=s.nodeDOM)&&!(r.nodeType==1?r.contains(e.nodeType==1?e:e.parentNode):r==e))o=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let i=this.children[n],s=o+i.size;if(o==e&&s!=o){for(;!i.border&&i.children.length;)for(let r=0;r<i.children.length;r++){let l=i.children[r];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-o-i.border);o=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,i=0;for(let s=0;o<this.children.length;o++){let r=this.children[o],l=s+r.size;if(l>e||r instanceof Pt){i=e-s;break}s=l}if(i)return this.children[o].domFromPos(i-this.children[o].border,n);for(let s;o&&!(s=this.children[o-1]).size&&s instanceof At&&s.side>=0;o--);if(n<=0){let s,r=!0;for(;s=o?this.children[o-1]:null,!(!s||s.dom.parentNode==this.contentDOM);o--,r=!1);return s&&n&&r&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?D(s.dom)+1:0}}else{let s,r=!0;for(;s=o<this.children.length?this.children[o]:null,!(!s||s.dom.parentNode==this.contentDOM);o++,r=!1);return s&&r&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?D(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let r=o,l=0;;l++){let a=this.children[l],c=r+a.size;if(i==-1&&e<=c){let d=r+a.border;if(e>=d&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,d);e=r;for(let f=l;f>0;f--){let u=this.children[f-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){i=D(u.dom)+1;break}e-=u.size}i==-1&&(i=0)}if(i>-1&&(c>n||l==this.children.length-1)){n=c;for(let d=l+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=D(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}r=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,i=!1){let s=Math.min(e,n),r=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let g=this.children[p],m=h+g.size;if(s>h&&r<m)return g.setSelection(e-h-g.border,n-h-g.border,o,i);h=m}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=o.root.getSelection(),d=o.domSelectionRange(),f=!1;if((F||x)&&e==n){let{node:p,offset:h}=l;if(p.nodeType==3){if(f=!!(h&&p.nodeValue[h-1]==`
|
|
1
|
+
System.register(["./prosemirror-state-COJ-aZZ4.system.js","./prosemirror-model-DTWK5xnv.system.js","./prosemirror-transform-BXNgAhmF.system.js"],function(ze,ai){"use strict";var N,ee,C,ct,q,me,z,Le,dt,ft;return{setters:[D=>{N=D.N,ee=D.S,C=D.T,ct=D.A},D=>{q=D.b,me=D.D,z=D.F,Le=D.a,dt=D.M},D=>{ft=D.d}],execute:function(){const D=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ce=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let $e=null;const K=function(t,e,n){let o=$e||($e=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},xn=function(){$e=null},te=function(t,e,n,o){return n&&(ht(t,e,n,o,-1)||ht(t,e,n,o,1))},kn=/^(img|br|input|textarea|hr)$/i;function ht(t,e,n,o,i){for(;;){if(t==n&&e==o)return!0;if(e==(i<0?0:V(t))){let s=t.parentNode;if(!s||s.nodeType!=1||ge(t)||kn.test(t.nodeName)||t.contentEditable=="false")return!1;e=D(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?V(t):0}else return!1}}function V(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Tn(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=V(t)}else if(t.parentNode&&!ge(t))e=D(t),t=t.parentNode;else return null}}function An(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ge(t))e=D(t)+1,t=t.parentNode;else return null}}function En(t,e,n){for(let o=e==0,i=e==V(t);o||i;){if(t==n)return!0;let s=D(t);if(t=t.parentNode,!t)return!1;o=o&&s==0,i=i&&s==V(t)}}function ge(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ke=function(t){return t.focusNode&&te(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ne(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Pn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Vn(t,e,n){if(t.caretPositionFromPoint)try{let o=t.caretPositionFromPoint(e,n);if(o)return{node:o.offsetNode,offset:Math.min(V(o.offsetNode),o.offset)}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(e,n);if(o)return{node:o.startContainer,offset:Math.min(V(o.startContainer),o.startOffset)}}}const L=typeof navigator<"u"?navigator:null,ut=typeof document<"u"?document:null,j=L&&L.userAgent||"",qe=/Edge\/(\d+)/.exec(j),pt=/MSIE \d/.exec(j),Ke=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(j),A=!!(pt||Ke||qe),U=pt?document.documentMode:Ke?+Ke[1]:qe?+qe[1]:0,F=!A&&/gecko\/(\d+)/i.test(j);F&&+(/Firefox\/(\d+)/.exec(j)||[0,0])[1];const He=!A&&/Chrome\/(\d+)/.exec(j),O=!!He,mt=He?+He[1]:0,x=!A&&!!L&&/Apple Computer/.test(L.vendor),de=x&&(/Mobile\/\w+/.test(j)||!!L&&L.maxTouchPoints>2),R=de||(L?/Mac/.test(L.platform):!1),Rn=L?/Win/.test(L.platform):!1,H=/Android \d/.test(j),ye=!!ut&&"webkitFontSmoothing"in ut.documentElement.style,Bn=ye?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function In(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function W(t,e){return typeof t=="number"?t:t[e]}function Fn(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function gt(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let r=n||t.dom;r;){if(r.nodeType!=1){r=ce(r);continue}let l=r,a=l==s.body,c=a?In(s):Fn(l),d=0,f=0;if(e.top<c.top+W(o,"top")?f=-(c.top-e.top+W(i,"top")):e.bottom>c.bottom-W(o,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+W(i,"top")-c.top:e.bottom-c.bottom+W(i,"bottom")),e.left<c.left+W(o,"left")?d=-(c.left-e.left+W(i,"left")):e.right>c.right-W(o,"right")&&(d=e.right-c.right+W(i,"right")),d||f)if(a)s.defaultView.scrollBy(d,f);else{let p=l.scrollLeft,h=l.scrollTop;f&&(l.scrollTop+=f),d&&(l.scrollLeft+=d);let g=l.scrollLeft-p,m=l.scrollTop-h;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let u=a?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(u))break;r=u=="absolute"?r.offsetParent:ce(r)}}function zn(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),o,i;for(let s=(e.left+e.right)/2,r=n+1;r<Math.min(innerHeight,e.bottom);r+=5){let l=t.root.elementFromPoint(s,r);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){o=l,i=a.top;break}}return{refDOM:o,refTop:i,stack:yt(t.dom)}}function yt(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=ce(o));return e}function Ln({refDOM:t,refTop:e,stack:n}){let o=t?t.getBoundingClientRect().top:0;bt(n,o==0?0:o-e)}function bt(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:i,left:s}=t[n];o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}let fe=null;function $n(t){if(t.setActive)return t.setActive();if(fe)return t.focus(fe);let e=yt(t);t.focus(fe==null?{get preventScroll(){return fe={preventScroll:!0},!0}}:void 0),fe||(fe=!1,bt(e,0))}function Dt(t,e){let n,o=2e8,i,s=0,r=e.top,l=e.top,a,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let u;if(d.nodeType==1)u=d.getClientRects();else if(d.nodeType==3)u=K(d).getClientRects();else continue;for(let p=0;p<u.length;p++){let h=u[p];if(h.top<=r&&h.bottom>=l){r=Math.max(h.bottom,r),l=Math.min(h.top,l);let g=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(g<o){n=d,o=g,i=g&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,d.nodeType==1&&g&&(s=f+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=d,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=f+1)}}return!n&&a&&(n=a,i=c,o=0),n&&n.nodeType==3?qn(n,i):!n||o&&n.nodeType==1?{node:t,offset:s}:Dt(n,i)}function qn(t,e){let n=t.nodeValue.length,o=document.createRange();for(let i=0;i<n;i++){o.setEnd(t,i+1),o.setStart(t,i);let s=Y(o,1);if(s.top!=s.bottom&&We(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function We(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Kn(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Hn(t,e,n){let{node:o,offset:i}=Dt(e,n),s=-1;if(o.nodeType==1&&!o.firstChild){let r=o.getBoundingClientRect();s=r.left!=r.right&&n.left>(r.left+r.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}function Wn(t,e,n,o){let i=-1;for(let s=e,r=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!r&&a.left>o.left||a.top>o.top?i=l.posBefore:(!r&&a.right<o.left||a.bottom<o.top)&&(i=l.posAfter),r=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?o.top<(a.top+a.bottom)/2:o.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Nt(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let r=t.childNodes[s];if(r.nodeType==1){let l=r.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(We(e,c))return Nt(r,e,c)}}if((s=(s+1)%o)==i)break}return t}function _n(t,e){let n=t.dom.ownerDocument,o,i=0,s=Vn(n,e.left,e.top);s&&({node:o,offset:i}=s);let r=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!r||!t.dom.contains(r.nodeType!=1?r.parentNode:r)){let c=t.dom.getBoundingClientRect();if(!We(e,c)||(r=Nt(t.dom,e,c),!r))return null}if(x)for(let c=r;o&&c;c=ce(c))c.draggable&&(o=void 0);if(r=Kn(r,e),o){if(F&&o.nodeType==1&&(i=Math.min(i,o.childNodes.length),i<o.childNodes.length)){let d=o.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;ye&&i&&o.nodeType==1&&(c=o.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,o==t.dom&&i==o.childNodes.length-1&&o.lastChild.nodeType==1&&e.top>o.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||o.nodeType!=1||o.childNodes[i-1].nodeName!="BR")&&(l=Wn(t,o,i,e))}l==null&&(l=Hn(t,r,e));let a=t.docView.nearestDesc(r,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function St(t){return t.top<t.bottom||t.left<t.right}function Y(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(St(o))return o}return Array.prototype.find.call(n,St)||t.getBoundingClientRect()}const jn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ct(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),r=ye||F;if(o.nodeType==3)if(r&&(jn.test(o.nodeValue)||(n<0?!i:i==o.nodeValue.length))){let a=Y(K(o,i,i),n);if(F&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=Y(K(o,i-1,i-1),-1);if(c.top==a.top){let d=Y(K(o,i,i+1),-1);if(d.top!=a.top)return be(d,d.left<c.left)}}return a}else{let a=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==o.nodeValue.length?(a--,d=1):n<0?a--:c++,be(Y(K(o,a,c),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==V(o))){let a=o.childNodes[i-1];if(a.nodeType==1)return _e(a.getBoundingClientRect(),!1)}if(s==null&&i<V(o)){let a=o.childNodes[i];if(a.nodeType==1)return _e(a.getBoundingClientRect(),!0)}return _e(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==V(o))){let a=o.childNodes[i-1],c=a.nodeType==3?K(a,V(a)-(r?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return be(Y(c,1),!1)}if(s==null&&i<V(o)){let a=o.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?K(a,0,r?0:1):a.nodeType==1?a:null:null;if(c)return be(Y(c,-1),!0)}return be(Y(o.nodeType==3?K(o):o,-n),n>=0)}function be(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function _e(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ot(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}function Un(t,e,n){let o=e.selection,i=n=="up"?o.$from:o.$to;return Ot(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let r=Ct(t,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=K(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let d=a[c];if(d.bottom>d.top+1&&(n=="up"?r.top-d.top>(d.bottom-r.top)*2:d.bottom-r.bottom>(r.bottom-d.top)*2))return!1}}return!0})}const Yn=/[\u0590-\u08ac]/;function Gn(t,e,n){let{$head:o}=e.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,s=!i,r=i==o.parent.content.size,l=t.domSelection();return l?!Yn.test(o.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:r:Ot(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),u=l.caretBidiLevel;l.modify("move",n,"character");let p=o.depth?t.docView.domAfterPos(o.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==g;try{l.collapse(d,f),a&&(a!=d||c!=f)&&l.extend&&l.extend(a,c)}catch{}return u!=null&&(l.caretBidiLevel=u),m}):o.pos==o.start()||o.pos==o.end()}let Mt=null,xt=null,kt=!1;function Xn(t,e,n){return Mt==e&&xt==n?kt:(Mt=e,xt=n,kt=n=="up"||n=="down"?Un(t,e,n):Gn(t,e,n))}const B=0,Tt=1,oe=2,$=3;class De{constructor(e,n,o,i){this.parent=e,this.children=n,this.dom=o,this.contentDOM=i,this.dirty=B,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let i=this.children[n];if(i==e)return o;o+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(o<0){let s,r;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((r=s.pmViewDesc)&&r.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(r)+r.size:this.posAtStart}else{let s,r;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((r=s.pmViewDesc)&&r.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(r):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>D(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),r;if(s&&(!n||s.node))if(o&&(r=s.nodeDOM)&&!(r.nodeType==1?r.contains(e.nodeType==1?e:e.parentNode):r==e))o=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let i=this.children[n],s=o+i.size;if(o==e&&s!=o){for(;!i.border&&i.children.length;)for(let r=0;r<i.children.length;r++){let l=i.children[r];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-o-i.border);o=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,i=0;for(let s=0;o<this.children.length;o++){let r=this.children[o],l=s+r.size;if(l>e||r instanceof Pt){i=e-s;break}s=l}if(i)return this.children[o].domFromPos(i-this.children[o].border,n);for(let s;o&&!(s=this.children[o-1]).size&&s instanceof At&&s.side>=0;o--);if(n<=0){let s,r=!0;for(;s=o?this.children[o-1]:null,!(!s||s.dom.parentNode==this.contentDOM);o--,r=!1);return s&&n&&r&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?D(s.dom)+1:0}}else{let s,r=!0;for(;s=o<this.children.length?this.children[o]:null,!(!s||s.dom.parentNode==this.contentDOM);o++,r=!1);return s&&r&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?D(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let r=o,l=0;;l++){let a=this.children[l],c=r+a.size;if(i==-1&&e<=c){let d=r+a.border;if(e>=d&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,d);e=r;for(let f=l;f>0;f--){let u=this.children[f-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){i=D(u.dom)+1;break}e-=u.size}i==-1&&(i=0)}if(i>-1&&(c>n||l==this.children.length-1)){n=c;for(let d=l+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=D(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}r=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,i=!1){let s=Math.min(e,n),r=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let g=this.children[p],m=h+g.size;if(s>h&&r<m)return g.setSelection(e-h-g.border,n-h-g.border,o,i);h=m}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=o.root.getSelection(),d=o.domSelectionRange(),f=!1;if((F||x)&&e==n){let{node:p,offset:h}=l;if(p.nodeType==3){if(f=!!(h&&p.nodeValue[h-1]==`
|
|
2
2
|
`),f&&h==p.nodeValue.length)for(let g=p,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:D(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=p.childNodes[h-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(F&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&x)&&te(l.node,l.offset,d.anchorNode,d.anchorOffset)&&te(a.node,a.offset,d.focusNode,d.focusOffset))return;let u=!1;if((c.extend||e==n)&&!f){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),u=!0}catch{}}if(!u){if(e>n){let h=l;l=a,a=h}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let o=0,i=0;i<this.children.length;i++){let s=this.children[i],r=o+s.size;if(o==r?e<=r&&n>=o:e<r&&n>o){let l=o+s.border,a=r-s.border;if(e>=l&&n<=a){this.dirty=e==o||n==r?oe:Tt,e==l&&n==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=$:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?oe:$}o=r}this.dirty=oe}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let o=e==1?oe:Tt;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class At extends De{constructor(e,n,o,i){let s,r=n.type.toDOM;if(typeof r=="function"&&(r=r(o,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(r.nodeType!=1){let l=document.createElement("span");l.appendChild(r),r=l}r.contentEditable="false",r.classList.add("ProseMirror-widget")}super(e,[],r,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==B&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Jn extends De{constructor(e,n,o,i){super(e,[],n,null),this.textDOM=o,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ie extends De{constructor(e,n,o,i,s){super(e,[],o,i),this.mark=n,this.spec=s}static create(e,n,o,i){let s=i.nodeViews[n.type.name],r=s&&s(n,i,o);return(!r||!r.dom)&&(r=me.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new ie(e,n,r.dom,r.contentDOM||r.dom,r)}parseRule(){return this.dirty&$||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=$&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=B){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=B}}slice(e,n,o){let i=ie.create(this.parent,this.mark,!0,o),s=this.children,r=this.size;n<r&&(s=Ue(s,n,r,o)),e>0&&(s=Ue(s,0,e,o));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class G extends De{constructor(e,n,o,i,s,r,l,a,c){super(e,[],s,r),this.node=n,this.outerDeco=o,this.innerDeco=i,this.nodeDOM=l}static create(e,n,o,i,s,r){let l=s.nodeViews[n.type.name],a,c=l&&l(n,s,()=>{if(!a)return r;if(a.parent)return a.parent.posBeforeChild(a)},o,i),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=me.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let u=d;return d=Bt(d,o,n),c?a=new Zn(e,n,o,i,d,f||null,u,c,s,r+1):n.isText?new Te(e,n,o,i,d,u,s):new G(e,n,o,i,d,f||null,u,s,r+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let o=this.children[n];if(this.dom.contains(o.dom.parentNode)){e.contentElement=o.dom.parentNode;break}}e.contentElement||(e.getContent=()=>z.empty)}return e}matchesNode(e,n,o){return this.dirty==B&&e.eq(this.node)&&Ae(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let o=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,r=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new wn(this,r&&r.node,e);to(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?a.syncToMarks(c.spec.marks,o,e):c.type.side>=0&&!f&&a.syncToMarks(d==this.node.childCount?dt.none:this.node.child(d).marks,o,e),a.placeWidget(c,e,i)},(c,d,f,u)=>{a.syncToMarks(c.marks,o,e);let p;a.findNodeMatch(c,d,f,u)||l&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(c,d,f,p,e)||a.updateNextNode(c,d,f,e,u,i)||a.addNode(c,d,f,e,i),i+=c.nodeSize}),a.syncToMarks([],o,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==oe)&&(r&&this.protectLocalComposition(e,r),Vt(this.contentDOM,this.children,e),de&&no(this.dom))}localCompositionInfo(e,n){let{from:o,to:i}=e.state.selection;if(!(e.state.selection instanceof C)||o<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let r=s.nodeValue,l=oo(this.node.content,r,o-n,i-n);return l<0?null:{node:s,pos:l,text:r}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:o,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let r=new Jn(this,s,n,i);e.input.compositionNodes.push(r),this.children=Ue(this.children,o,o+i.length,e,r)}update(e,n,o,i){return this.dirty==$||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,o,i),!0)}updateInner(e,n,o,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=B}updateOuterDeco(e){if(Ae(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=Rt(this.dom,this.nodeDOM,je(this.outerDeco,this.node,n),je(e,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Et(t,e,n,o,i){Bt(o,e,t);let s=new G(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Te extends G{constructor(e,n,o,i,s,r,l){super(e,n,o,i,s,null,r,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,o,i){return this.dirty==$||this.dirty!=B&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=B||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=B,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,o)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,o){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Te(this.parent,i,this.outerDeco,this.innerDeco,s,s,o)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=$)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Pt extends De{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==B&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Zn extends G{constructor(e,n,o,i,s,r,l,a,c,d){super(e,n,o,i,s,r,l,c,d),this.spec=a}update(e,n,o,i){if(this.dirty==$)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,o);return s&&this.updateInner(e,n,o,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,o,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,o,i){this.spec.setSelection?this.spec.setSelection(e,n,o.root):super.setSelection(e,n,o,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Vt(t,e,n){let o=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let r=e[s],l=r.dom;if(l.parentNode==t){for(;l!=o;)o=It(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(l,o);if(r instanceof ie){let a=o?o.previousSibling:t.lastChild;Vt(r.contentDOM,r.children,n),o=a?a.nextSibling:t.firstChild}}for(;o;)o=It(o),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ne=function(t){t&&(this.nodeName=t)};Ne.prototype=Object.create(null);const se=[new Ne];function je(t,e,n){if(t.length==0)return se;let o=n?se[0]:new Ne,i=[o];for(let s=0;s<t.length;s++){let r=t[s].type.attrs;if(r){r.nodeName&&i.push(o=new Ne(r.nodeName));for(let l in r){let a=r[l];a!=null&&(n&&i.length==1&&i.push(o=new Ne(e.isInline?"span":"div")),l=="class"?o.class=(o.class?o.class+" ":"")+a:l=="style"?o.style=(o.style?o.style+";":"")+a:l!="nodeName"&&(o[l]=a))}}}return i}function Rt(t,e,n,o){if(n==se&&o==se)return e;let i=e;for(let s=0;s<o.length;s++){let r=o[s],l=n[s];if(s){let a;l&&l.nodeName==r.nodeName&&i!=t&&(a=i.parentNode)&&a.nodeName.toLowerCase()==r.nodeName||(a=document.createElement(r.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=se[0]),i=a}Qn(i,l||se[0],r)}return i}function Qn(t,e,n){for(let o in e)o!="class"&&o!="style"&&o!="nodeName"&&!(o in n)&&t.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){let o=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<o.length;s++)i.indexOf(o[s])==-1&&t.classList.remove(o[s]);for(let s=0;s<i.length;s++)o.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=o.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Bt(t,e,n){return Rt(t,t,se,je(e,n,t.nodeType!=1))}function Ae(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function It(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class wn{constructor(e,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=vn(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let o=e;o<n;o++)this.top.children[o].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,o){let i=0,s=this.stack.length>>1,r=Math.min(s,e.length);for(;i<r&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=B,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=ie.create(this.top,e[s],n,o);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,o,i){let s=-1,r;if(i>=this.preMatch.index&&(r=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&r.matchesNode(e,n,o))s=this.top.children.indexOf(r,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,o)&&!this.preMatch.matched.has(c)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,o,i,s){let r=this.top.children[i];return r.dirty==$&&r.dom==r.contentDOM&&(r.dirty=oe),r.update(e,n,o,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=e.pmViewDesc;if(o){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==o)return i}return-1}e=n}}updateNextNode(e,n,o,i,s,r){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof G){let c=this.preMatch.matched.get(a);if(c!=null&&c!=s)return!1;let d=a.dom,f,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=$&&Ae(n,a.outerDeco));if(!u&&a.update(e,n,o,i))return this.destroyBetween(this.index,l),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(f=this.recreateWrapper(a,e,n,o,i,r)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=oe,f.updateChildren(i,r+1),f.dirty=B),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,o,i,s,r){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ae(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=G.create(this.top,n,o,i,s,r);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,o,i,s){let r=G.create(this.top,e,n,o,i,s);r.contentDOM&&r.updateChildren(i,s+1),this.top.children.splice(this.index++,0,r),this.changed=!0}placeWidget(e,n,o){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new At(this.top,e,n,o);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ie;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Te)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((x||O)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let o=document.createElement(e);e=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),e=="BR"&&(o.className="ProseMirror-trailingBreak");let i=new Pt(this.top,[],o,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function vn(t,e){let n=e,o=n.children.length,i=t.childCount,s=new Map,r=[];e:for(;i>0;){let l;for(;;)if(o){let c=n.children[o-1];if(c instanceof ie)n=c,o=c.children.length;else{l=c,o--;break}}else{if(n==e)break e;o=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,s.set(l,i),r.push(l)}}return{index:i,matched:s,matches:r.reverse()}}function eo(t,e){return t.type.side-e.type.side}function to(t,e,n,o){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);o(d,i,e.forChild(s,d),c),s+=d.nodeSize}return}let r=0,l=[],a=null;for(let c=0;;){let d,f;for(;r<i.length&&i[r].to==s;){let m=i[r++];m.widget&&(d?(f||(f=[d])).push(m):d=m)}if(d)if(f){f.sort(eo);for(let m=0;m<f.length;m++)n(f[m],c,!!a)}else n(d,c,!!a);let u,p;if(a)p=-1,u=a,a=null;else if(c<t.childCount)p=c,u=t.child(c++);else break;for(let m=0;m<l.length;m++)l[m].to<=s&&l.splice(m--,1);for(;r<i.length&&i[r].from<=s&&i[r].to>s;)l.push(i[r++]);let h=s+u.nodeSize;if(u.isText){let m=h;r<i.length&&i[r].from<m&&(m=i[r].from);for(let y=0;y<l.length;y++)l[y].to<m&&(m=l[y].to);m<h&&(a=u.cut(m-s),u=u.cut(0,m-s),h=m,p=-1)}else for(;r<i.length&&i[r].to<h;)r++;let g=u.isInline&&!u.isLeaf?l.filter(m=>!m.inline):l.slice();o(u,g,e.forChild(s,u),p),s=h}}function no(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function oo(t,e,n,o){for(let i=0,s=0;i<t.childCount&&s<=o;){let r=t.child(i++),l=s;if(s+=r.nodeSize,!r.isText)continue;let a=r.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;a+=c.text}if(s>=n){if(s>=o&&a.slice(o-e.length-l,o-l)==e)return o-e.length;let c=l<o?a.lastIndexOf(e,o-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==o&&a.length>=o+e.length-l&&a.slice(o-l,o-l+e.length)==e)return o}}return-1}function Ue(t,e,n,o,i){let s=[];for(let r=0,l=0;r<t.length;r++){let a=t[r],c=l,d=l+=a.size;c>=n||d<=e?s.push(a):(c<e&&s.push(a.slice(0,e-c,o)),i&&(s.push(i),i=void 0),d>n&&s.push(a.slice(n-c,a.size,o)))}return s}function Ye(t,e=null){let n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,r=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(r<0)return null;let l=o.resolve(r),a,c;if(ke(n)){for(a=r;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&N.isSelectable(f)&&i.parent&&!(f.isInline&&En(n.focusNode,n.focusOffset,i.dom))){let u=i.posBefore;c=new N(r==u?l:o.resolve(u))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=r,u=r;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),u=Math.max(u,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(f<0)return null;[a,r]=u==t.state.selection.anchor?[u,f]:[f,u],l=o.resolve(r)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=o.resolve(a);if(!c){let f=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;c=Xe(t,d,l,f)}return c}function Ft(t){return t.editable?t.hasFocus():Wt(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function _(t,e=!1){let n=t.state.selection;if(qt(t,n),!!Ft(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&O){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&te(o.anchorNode,o.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)so(t);else{let{anchor:o,head:i}=n,s,r;zt&&!(n instanceof C)&&(n.$from.parent.inlineContent||(s=Lt(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(r=Lt(t,n.to))),t.docView.setSelection(o,i,t,e),zt&&(s&&$t(s),r&&$t(r)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&io(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const zt=x||O&&mt<63;function Lt(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(x&&i&&i.contentEditable=="false")return Ge(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Ge(i);if(s)return Ge(s)}}function Ge(t){return t.contentEditable="true",x&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function $t(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function io(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),o=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=o||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ft(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function so(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let o=t.cursorWrapper.dom,i=o.nodeName=="IMG";i?n.setStart(o.parentNode,D(o)+1):n.setStart(o,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&A&&U<=11&&(o.disabled=!0,o.disabled=!1)}function qt(t,e){if(e instanceof N){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Kt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Kt(t)}function Kt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Xe(t,e,n,o){return t.someProp("createSelectionBetween",i=>i(t,e,n))||C.between(e,n,o)}function Ht(t){return t.editable&&!t.hasFocus()?!1:Wt(t)}function Wt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ro(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return te(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Je(t,e){let{$anchor:n,$head:o}=t.selection,i=e>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ee.findFrom(s,e)}function X(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function _t(t,e,n){let o=t.state.selection;if(o instanceof C)if(n.indexOf("s")>-1){let{$head:i}=o,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let r=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return X(t,new C(o.$anchor,r))}else if(o.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Je(t.state,e);return i&&i instanceof N?X(t,i):!1}else if(!(R&&n.indexOf("m")>-1)){let i=o.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,r;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(r=t.docView.descAt(l))&&!r.contentDOM?N.isSelectable(s)?X(t,new N(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):ye?X(t,new C(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(o instanceof N&&o.node.isInline)return X(t,new C(e>0?o.$to:o.$from));{let i=Je(t.state,e);return i?X(t,i):!1}}}function Ee(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Se(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function he(t,e){return e<0?lo(t):ao(t)}function lo(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i,s,r=!1;for(F&&n.nodeType==1&&o<Ee(n)&&Se(n.childNodes[o],-1)&&(r=!0);;)if(o>0){if(n.nodeType!=1)break;{let l=n.childNodes[o-1];if(Se(l,-1))i=n,s=--o;else if(l.nodeType==3)n=l,o=n.nodeValue.length;else break}}else{if(jt(n))break;{let l=n.previousSibling;for(;l&&Se(l,-1);)i=n.parentNode,s=D(l),l=l.previousSibling;if(l)n=l,o=Ee(n);else{if(n=n.parentNode,n==t.dom)break;o=0}}}r?Ze(t,n,o):i&&Ze(t,i,s)}function ao(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i=Ee(n),s,r;for(;;)if(o<i){if(n.nodeType!=1)break;let l=n.childNodes[o];if(Se(l,1))s=n,r=++o;else break}else{if(jt(n))break;{let l=n.nextSibling;for(;l&&Se(l,1);)s=l.parentNode,r=D(l)+1,l=l.nextSibling;if(l)n=l,o=0,i=Ee(n);else{if(n=n.parentNode,n==t.dom)break;o=i=0}}}s&&Ze(t,s,r)}function jt(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function co(t,e){for(;t&&e==t.childNodes.length&&!ge(t);)e=D(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function fo(t,e){for(;t&&!e&&!ge(t);)e=D(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ze(t,e,n){if(e.nodeType!=3){let s,r;(r=co(e,n))?(e=r,n=0):(s=fo(e,n))&&(e=s,n=s.nodeValue.length)}let o=t.domSelection();if(!o)return;if(ke(o)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),o.removeAllRanges(),o.addRange(s)}else o.extend&&o.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&_(t)},50)}function Ut(t,e){let n=t.state.doc.resolve(e);if(!(O||Rn)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),r=(s.top+s.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),r=(s.top+s.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Yt(t,e,n){let o=t.state.selection;if(o instanceof C&&!o.empty||n.indexOf("s")>-1||R&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let r=Je(t.state,e);if(r&&r instanceof N)return X(t,r)}if(!i.parent.inlineContent){let r=e<0?i:s,l=o instanceof ct?ee.near(r,e):ee.findFrom(r,e);return l?X(t,l):!1}return!1}function Gt(t,e){if(!(t.state.selection instanceof C))return!0;let{$head:n,$anchor:o,empty:i}=t.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=t.state.tr;return e<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),t.dispatch(r),!0}return!1}function Xt(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ho(t){if(!x||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let o=e.firstChild;Xt(t,o,"true"),setTimeout(()=>Xt(t,o,"false"),20)}return!1}function uo(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function po(t,e){let n=e.keyCode,o=uo(e);if(n==8||R&&n==72&&o=="c")return Gt(t,-1)||he(t,-1);if(n==46&&!e.shiftKey||R&&n==68&&o=="c")return Gt(t,1)||he(t,1);if(n==13||n==27)return!0;if(n==37||R&&n==66&&o=="c"){let i=n==37?Ut(t,t.state.selection.from)=="ltr"?-1:1:-1;return _t(t,i,o)||he(t,i)}else if(n==39||R&&n==70&&o=="c"){let i=n==39?Ut(t,t.state.selection.from)=="ltr"?1:-1:1;return _t(t,i,o)||he(t,i)}else{if(n==38||R&&n==80&&o=="c")return Yt(t,-1,o)||he(t,-1);if(n==40||R&&n==78&&o=="c")return ho(t)||Yt(t,1,o)||he(t,1);if(o==(R?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Qe(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:o,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&o.childCount==1&&o.firstChild.childCount==1;){i--,s--;let p=o.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),o=p.content}let r=t.someProp("clipboardSerializer")||me.fromSchema(t.state.schema),l=nn(),a=l.createElement("div");a.appendChild(r.serializeFragment(o,{document:l}));let c=a.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=en[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let h=l.createElement(d[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),f++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let u=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
3
3
|
|
|
4
4
|
`);return{dom:a,text:u,slice:e}}function Jt(t,e,n,o,i){let s=i.parent.type.spec.code,r,l;if(!n&&!e)return null;let a=e&&(o||s||!n);if(a){if(t.someProp("transformPastedText",u=>{e=u(e,s||o,t)}),s)return e?new q(z.from(t.state.schema.text(e.replace(/\r\n?/g,`
|