@fewangsit/wangsvue-fats 1.0.0-alpha.42 → 1.0.0-alpha.44
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/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +44 -0
- package/components/index.d.ts +1 -0
- package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
- package/event-bus/index.d.ts +3 -0
- package/loading-page-BrQattYE.js +1 -0
- package/loading-page-CoC9UhfC.js +4 -0
- package/loading-page-DbLuqCHa.js +1 -0
- package/loading-page-f8D03l3G.js +4 -0
- package/loading-plane-CgfbWppy.js +1 -0
- package/loading-plane-CoXtqoc9.js +4 -0
- package/loading-table-Bdr9ZhtP.js +1 -0
- package/loading-table-ByUoWqUo.js +4 -0
- package/loading-table-BygEMzFM.js +4 -0
- package/loading-table-BzrSQlA0.js +1 -0
- package/loading-table-D9bw9OcI.js +4 -0
- package/loading-table-chOgXi94.js +1 -0
- package/no-data-CTKux8RI.js +4 -0
- package/no-data-Cgze_Rvp.js +1 -0
- package/{assets/lottiejs/no-data-DOy8kIGF.es.js → no-data-DLHO1L_u.js} +2 -13
- package/no-data-Dep79CBh.js +1 -0
- package/no-data-g0dJCy2p.js +4 -0
- package/no-data-y1X5WtcQ.js +1 -0
- package/package.json +3 -3
- package/stats.html +1 -1
- package/style.css +1 -1
- package/wangsvue-fats.js +51885 -346
- package/wangsvue-fats.system.js +312 -1
- package/assets/lottiejs/loading-page-B9ooQcfF.system.js +0 -1
- package/assets/lottiejs/loading-page-CQ0mKER2.es.js +0 -15
- package/assets/lottiejs/loading-table-B4T3FYiI.system.js +0 -1
- package/assets/lottiejs/loading-table-BnpbX8Ew.es.js +0 -15
- package/assets/lottiejs/no-data-CMWnya_k.system.js +0 -1
- package/components/animation/Animation-6756VN9N.system.js +0 -1
- package/components/animation/Animation-COWVilAA.es.js +0 -428
- 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-Bj0EjoML.es.js +0 -68
- package/components/badgegroup/BadgeGroup-Y-HhiHk8.system.js +0 -1
- package/components/basecalendar/BaseCalendar-47ahYXrt.es.js +0 -867
- package/components/basecalendar/BaseCalendar-Ce46jOkg.system.js +0 -1
- package/components/basetree/BaseTree-DDu1qI7t.system.js +0 -1
- package/components/basetree/BaseTree-DLSA5FMh.es.js +0 -167
- package/components/breadcrumb/Breadcrumb-B5bAijry.system.js +0 -1
- package/components/breadcrumb/Breadcrumb-BWSmLPqn.es.js +0 -46
- package/components/button/Button-D-MSv_AS.es.js +0 -120
- package/components/button/Button-Okx1_kOu.system.js +0 -1
- package/components/buttonbulkaction/ButtonBulkAction-B4RcdWmb.es.js +0 -185
- package/components/buttonbulkaction/ButtonBulkAction-DLmvicRL.system.js +0 -1
- package/components/buttoncopy/ButtonCopy-BZgQAFOM.es.js +0 -31
- 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-BIE-jM2i.es.js +0 -28
- package/components/buttonfilter/ButtonFilter-C4WRvUrj.system.js +0 -1
- package/components/buttonradio/ButtonRadio-5VUY8o5h.es.js +0 -83
- 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-Clbafqts.es.js +0 -70
- package/components/buttonsearch/ButtonSearch-e57pD5r3.system.js +0 -1
- package/components/buttonselecttree/ButtonSelectTree-B-_Iw5sB.es.js +0 -218
- package/components/buttonselecttree/ButtonSelectTree-Cbq1oeVK.system.js +0 -1
- package/components/buttonselectuser/ButtonSelectUser-Ar7Y8tVR.es.js +0 -101
- package/components/buttonselectuser/ButtonSelectUser-Cfe6m75Z.system.js +0 -1
- package/components/buttonsync/ButtonSync-Bc1GZXT6.es.js +0 -29
- package/components/buttonsync/ButtonSync-ClllEdAy.system.js +0 -1
- package/components/buttontoggle/ButtonToggle-DIy3M8Pz.es.js +0 -11
- package/components/buttontoggle/ButtonToggle-VNp0lbcW.system.js +0 -1
- package/components/buttonviewlog/ButtonViewLog-Ct8QwEey.system.js +0 -1
- package/components/buttonviewlog/ButtonViewLog-h9uVv5A5.es.js +0 -21
- package/components/calendar/Calendar-7yBKZsvj.system.js +0 -1
- package/components/calendar/Calendar-Df6CnW-l.es.js +0 -112
- package/components/card/Card-BUKU2FcT.system.js +0 -1
- package/components/card/Card-CwnxKNdM.es.js +0 -47
- package/components/checkbox/Checkbox-CCtItmVW.system.js +0 -1
- package/components/checkbox/Checkbox-DdsR222S.es.js +0 -135
- package/components/codesnippet/CodeSnippet-Bpps-Iyc.es.js +0 -127
- package/components/codesnippet/CodeSnippet-DvTtZ28b.system.js +0 -2
- package/components/codesnippetadapter/CodeSnippetAdapter-BtSqWBl1.system.js +0 -1
- package/components/codesnippetadapter/CodeSnippetAdapter-jgXoPKzr.es.js +0 -26
- 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-Dy93f91f.es.js +0 -121
- package/components/dialog/Dialog-WEl66uTI.system.js +0 -1
- package/components/dialogconfirm/DialogConfirm-BOFb7rJD.es.js +0 -139
- package/components/dialogconfirm/DialogConfirm-o7_v7F31.system.js +0 -1
- package/components/dialogform/DialogForm-C15nC1wH.es.js +0 -223
- package/components/dialogform/DialogForm-CdpY1_-F.system.js +0 -1
- package/components/dialogselecttree/DialogSelectTree-BA8xEqco.es.js +0 -268
- 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/dialogselectuserfilter/DialogSelectUserFilter-Dz5OxAU-.es.js +0 -40
- package/components/dropdown/Dropdown-D4S52rW5.es.js +0 -252
- package/components/dropdown/Dropdown-DuvNYyq0.system.js +0 -1
- package/components/editor/Editor-DQ7Xdy30.es.js +0 -1036
- package/components/editor/Editor-IfYw2Tps.system.js +0 -1
- package/components/editorbutton/EditorButton-DDgS2vga.es.js +0 -28
- package/components/editorbutton/EditorButton-DmVrr4Bk.system.js +0 -1
- package/components/fieldwrapper/FieldWrapper-C6HJ2HnC.es.js +0 -34
- package/components/fieldwrapper/FieldWrapper-DFjw9hA8.system.js +0 -1
- package/components/fileupload/FileUpload-B6PAucnD.es.js +0 -175
- 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/form/Form-eSj-nb1y.es.js +0 -181
- package/components/hardwaresync/HardwareSync--HomfQuH.system.js +0 -1
- package/components/hardwaresync/HardwareSync-DUsVwHx1.es.js +0 -236
- package/components/icon/Icon-DUylRmY4.system.js +0 -1
- package/components/icon/Icon-mDqG7urn.es.js +0 -82
- package/components/image/Image-BZ31CL-y.es.js +0 -169
- package/components/image/Image-DX6uB7Ns.system.js +0 -1
- package/components/imagecompressor/ImageCompressor-BLeJDvN3.system.js +0 -1
- package/components/imagecompressor/ImageCompressor-DaW0ak9c.es.js +0 -501
- package/components/imageinputinfo/ImageInputInfo-C5F14hbF.system.js +0 -1
- package/components/imageinputinfo/ImageInputInfo-oTtVBxzO.es.js +0 -46
- package/components/inlinemessage/InlineMessage-19w6FOcP.system.js +0 -1
- package/components/inlinemessage/InlineMessage-CBZT3jWS.es.js +0 -94
- package/components/inputbadge/InputBadge-CsdT7M7-.es.js +0 -186
- package/components/inputbadge/InputBadge-dgANMV70.system.js +0 -1
- package/components/inputcurrency/InputCurrency-B96npK8W.es.js +0 -1208
- package/components/inputcurrency/InputCurrency-ChqGX5L8.system.js +0 -1
- package/components/inputemail/InputEmail-BMzumenA.es.js +0 -49
- package/components/inputemail/InputEmail-CYILS9bp.system.js +0 -1
- package/components/inputgroup/InputGroup-G9TEI4vX.system.js +0 -1
- package/components/inputgroup/InputGroup-eNDRlJ5R.es.js +0 -56
- package/components/inputnumber/InputNumber-Bzk_YzWM.es.js +0 -232
- package/components/inputnumber/InputNumber-CRyg8Xw_.system.js +0 -1
- package/components/inputpassword/InputPassword-BMHMWLgU.es.js +0 -121
- 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-B1aAoKVj.es.js +0 -134
- package/components/inputrangenumber/InputRangeNumber-C28xgFBY.system.js +0 -1
- package/components/inputsearch/InputSearch--KHwTBTm.system.js +0 -1
- package/components/inputsearch/InputSearch-cPq3vqhy.es.js +0 -53
- package/components/inputtext/InputText-93zDNfC3.system.js +0 -1
- package/components/inputtext/InputText-_xEnXysf.es.js +0 -241
- package/components/inputurl/InputURL-aqx1PVKL.es.js +0 -61
- package/components/inputurl/InputURL-kWIiKGEG.system.js +0 -1
- package/components/invisiblefield/InvisibleField-4XbiOrqw.es.js +0 -27
- package/components/invisiblefield/InvisibleField-BHudtX2g.system.js +0 -1
- package/components/litedropdown/LiteDropdown-3KsCx4wX.system.js +0 -1
- package/components/litedropdown/LiteDropdown-DcSzP11l.es.js +0 -102
- package/components/loading/Loading-D8M801C9.es.js +0 -24
- package/components/loading/Loading-Diwog8dc.system.js +0 -1
- package/components/mentionlist/MentionList--7AymnhE.es.js +0 -58
- package/components/mentionlist/MentionList-600dsWhX.system.js +0 -1
- package/components/mentionsection/MentionSection-C1gWOzH2.system.js +0 -3
- package/components/mentionsection/MentionSection-C_c4qbpq.es.js +0 -52
- package/components/menu/Menu-BmTMFwBD.es.js +0 -73
- package/components/menu/Menu-OR25pAK3.system.js +0 -1
- package/components/menuitem/MenuItem-LoZMc0T9.es.js +0 -65
- package/components/menuitem/MenuItem-imQ-hYTP.system.js +0 -1
- package/components/multirow/MultiRow-ClSMxrEx.es.js +0 -52
- package/components/multirow/MultiRow-DKu6uIsI.system.js +0 -1
- package/components/multiselect/MultiSelect-DGhS1EyX.es.js +0 -189
- package/components/multiselect/MultiSelect-DKFYq47E.system.js +0 -1
- package/components/overlaypanel/OverlayPanel-C_WCcNPw.system.js +0 -1
- package/components/overlaypanel/OverlayPanel-DXNek7Yb.es.js +0 -49
- package/components/tabmenu/TabMenu-CAQqu-ff.system.js +0 -1
- package/components/tabmenu/TabMenu-iMeZa8gy.es.js +0 -108
- package/components/tagtype/TagType-CX7BVRrE.es.js +0 -49
- package/components/tagtype/TagType-IMYg8AJf.system.js +0 -1
- package/components/textarea/Textarea-ClnQ2qmf.es.js +0 -108
- 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/timelinecontentbytype/TimelineContentByType-ehFLzTA1.es.js +0 -111
- package/components/toast/Toast-DnALWJkx.es.js +0 -74
- package/components/toast/Toast-Pc_DOZ5-.system.js +0 -1
- package/components/toggleswitch/ToggleSwitch-WHdD3oYL.system.js +0 -1
- package/components/toggleswitch/ToggleSwitch-wRjnHRIw.es.js +0 -90
- package/components/transactionroles/TransactionRoles-B_67h5wb.es.js +0 -223
- 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/treenode/TreeNode-KJOUvlTH.es.js +0 -499
- package/components/treesearchinput/TreeSearchInput-B1PmhE7k.es.js +0 -56
- package/components/treesearchinput/TreeSearchInput-C-hXPV61.system.js +0 -1
- package/components/username/UserName-CCyPAYG6.system.js +0 -1
- package/components/username/UserName-CWs83BX6.es.js +0 -130
- package/components/userwithicon/UserWithIcon-CFjQcbAS.system.js +0 -1
- package/components/userwithicon/UserWithIcon-Dn3aNKdq.es.js +0 -18
- package/components/validatormessage/ValidatorMessage-BtKfBXzO.es.js +0 -19
- package/components/validatormessage/ValidatorMessage-VVfyqlRF.system.js +0 -1
- package/vendor/@popperjs/core-BDAJHTVh.es.js +0 -905
- package/vendor/@popperjs/core-DpNOCyB0.system.js +0 -1
- package/vendor/@tiptap/core-BLz8iRA3.es.js +0 -2868
- package/vendor/@tiptap/core-bnIgGWIt.system.js +0 -80
- package/vendor/@tiptap/extension-bold-BnsTNqIJ.es.js +0 -71
- package/vendor/@tiptap/extension-bold-C_KVm_D0.system.js +0 -1
- package/vendor/@tiptap/extension-bubble-menu-D421L1EU.system.js +0 -1
- package/vendor/@tiptap/extension-bubble-menu-D9Vgq7yO.es.js +0 -128
- package/vendor/@tiptap/extension-bullet-list-GNj3sKw9.es.js +0 -53
- package/vendor/@tiptap/extension-bullet-list-kXXFF-_p.system.js +0 -1
- package/vendor/@tiptap/extension-code-CfQ7g1i2.es.js +0 -51
- package/vendor/@tiptap/extension-code-Q8P1EHjz.system.js +0 -1
- package/vendor/@tiptap/extension-floating-menu-8rFSweor.system.js +0 -1
- package/vendor/@tiptap/extension-floating-menu-CSQuJzDM.es.js +0 -99
- package/vendor/@tiptap/extension-heading-BE64-Rg_.system.js +0 -1
- package/vendor/@tiptap/extension-heading-ZTlCgdtc.es.js +0 -54
- package/vendor/@tiptap/extension-history-GLkLmX-Y.system.js +0 -1
- package/vendor/@tiptap/extension-history-eJIThEn-.es.js +0 -35
- package/vendor/@tiptap/extension-image-B8NPUVFM.es.js +0 -64
- package/vendor/@tiptap/extension-image-rKrdkZpJ.system.js +0 -1
- package/vendor/@tiptap/extension-italic-C_CyJubw.es.js +0 -70
- package/vendor/@tiptap/extension-italic-Dg0Nosoc.system.js +0 -1
- package/vendor/@tiptap/extension-link-Cd8bTMBz.system.js +0 -1
- package/vendor/@tiptap/extension-link-D4PFdLvA.es.js +0 -262
- package/vendor/@tiptap/extension-list-item-7pIJ7t09.es.js +0 -33
- package/vendor/@tiptap/extension-list-item-Mnhfw2gP.system.js +0 -1
- package/vendor/@tiptap/extension-mention-DVF3rX_z.system.js +0 -1
- package/vendor/@tiptap/extension-mention-Dkg-tbrz.es.js +0 -130
- package/vendor/@tiptap/extension-ordered-list-DLI4xDN8.es.js +0 -71
- package/vendor/@tiptap/extension-ordered-list-Hl0QU8Zt.system.js +0 -1
- package/vendor/@tiptap/extension-placeholder-BeLl2T-f.system.js +0 -1
- package/vendor/@tiptap/extension-placeholder-V0iTxU19.es.js +0 -52
- package/vendor/@tiptap/extension-underline-BdcAQ4JH.system.js +0 -1
- package/vendor/@tiptap/extension-underline-DsGbvz80.es.js +0 -40
- package/vendor/@tiptap/suggestion-BpZSO8Lm.system.js +0 -1
- package/vendor/@tiptap/suggestion-C4sBhJAD.es.js +0 -131
- package/vendor/@tiptap/vue-3-BH1pZykd.system.js +0 -1
- package/vendor/@tiptap/vue-3-DceiR7pK.es.js +0 -436
- package/vendor/highlight.js-BAruEf1H.system.js +0 -2
- package/vendor/highlight.js-DHowhWoU.es.js +0 -2493
- package/vendor/linkifyjs-BxsOjwQz.es.js +0 -705
- package/vendor/linkifyjs-CMLfIa6I.system.js +0 -5
- package/vendor/lodash-DbIT-6qv.es.js +0 -127
- package/vendor/lodash-DbvKLWSv.system.js +0 -1
- package/vendor/lodash-es-C3G1Cc1m.system.js +0 -1
- package/vendor/lodash-es-CJerBxJQ.es.js +0 -766
- package/vendor/orderedmap-B3SOk52B.es.js +0 -103
- package/vendor/orderedmap-Dwr31MF0.system.js +0 -1
- package/vendor/primevue-CadmDhWp.es.js +0 -13928
- package/vendor/primevue-u6FsQONA.system.js +0 -193
- package/vendor/prosemirror-commands-DLmzIpoS.es.js +0 -383
- package/vendor/prosemirror-commands-DgY3QRzI.system.js +0 -2
- package/vendor/prosemirror-history-BMpJFORS.es.js +0 -248
- package/vendor/prosemirror-history-BrK-FTBv.system.js +0 -1
- package/vendor/prosemirror-keymap-COb3Dq2o.system.js +0 -1
- package/vendor/prosemirror-keymap-DF8LLxca.es.js +0 -60
- package/vendor/prosemirror-model-D2n-Dx_L.es.js +0 -2736
- package/vendor/prosemirror-model-DTWK5xnv.system.js +0 -4
- package/vendor/prosemirror-schema-list-BPpAP8wR.system.js +0 -1
- package/vendor/prosemirror-schema-list-BvrICwYb.es.js +0 -87
- package/vendor/prosemirror-state-CwkYUmNs.es.js +0 -820
- package/vendor/prosemirror-state-DzPLD-6l.system.js +0 -1
- package/vendor/prosemirror-transform-DvAmofec.es.js +0 -1507
- package/vendor/prosemirror-transform-VaXuT0NM.system.js +0 -2
- package/vendor/prosemirror-view-JTdpiWMD.system.js +0 -5
- package/vendor/prosemirror-view-ta7l3rKk.es.js +0 -3742
- package/vendor/rope-sequence-4t46C6az.system.js +0 -1
- package/vendor/rope-sequence-sEGCUMi8.es.js +0 -100
- package/vendor/simplebar-core-71xT5g0m.system.js +0 -1
- package/vendor/simplebar-core-Db65-Ath.es.js +0 -333
- package/vendor/simplebar-vue-BFEeFUIv.system.js +0 -1
- package/vendor/simplebar-vue-DAxqu0eM.es.js +0 -176
- package/vendor/tippy.js-CuKTz0UR.system.js +0 -1
- package/vendor/tippy.js-DNnwm2RY.es.js +0 -721
- package/vendor/uuid-93tp0umt.es.js +0 -9
- package/vendor/uuid-Cymn6orr.system.js +0 -1
- package/vendor/vee-validate-Cc_B-qII.system.js +0 -5
- package/vendor/vee-validate-RE5RuswC.es.js +0 -1309
- package/vendor/vue-advanced-cropper-CshlvNaD.es.js +0 -1380
- package/vendor/vue-advanced-cropper-NG93jHnU.system.js +0 -20
- package/vendor/w3c-keyname-BSD-PgAi.system.js +0 -1
- package/vendor/w3c-keyname-CLxH8j-f.es.js +0 -92
- /package/{assets/lottiejs/loading-plane-CgfbWppy.system.js → loading-page-CgfbWppy.js} +0 -0
- /package/{assets/lottiejs/loading-plane-CoXtqoc9.es.js → loading-page-CoXtqoc9.js} +0 -0
|
@@ -1,2493 +0,0 @@
|
|
|
1
|
-
import { g as un } from "../components/imagecompressor/ImageCompressor-DaW0ak9c.es.js";
|
|
2
|
-
function ke(e) {
|
|
3
|
-
return e instanceof Map ? e.clear = e.delete = e.set = function() {
|
|
4
|
-
throw new Error("map is read-only");
|
|
5
|
-
} : e instanceof Set && (e.add = e.clear = e.delete = function() {
|
|
6
|
-
throw new Error("set is read-only");
|
|
7
|
-
}), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((n) => {
|
|
8
|
-
const s = e[n], r = typeof s;
|
|
9
|
-
(r === "object" || r === "function") && !Object.isFrozen(s) && ke(s);
|
|
10
|
-
}), e;
|
|
11
|
-
}
|
|
12
|
-
class Oe {
|
|
13
|
-
/**
|
|
14
|
-
* @param {CompiledMode} mode
|
|
15
|
-
*/
|
|
16
|
-
constructor(n) {
|
|
17
|
-
n.data === void 0 && (n.data = {}), this.data = n.data, this.isMatchIgnored = !1;
|
|
18
|
-
}
|
|
19
|
-
ignoreMatch() {
|
|
20
|
-
this.isMatchIgnored = !0;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function De(e) {
|
|
24
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
25
|
-
}
|
|
26
|
-
function z(e, ...n) {
|
|
27
|
-
const s = /* @__PURE__ */ Object.create(null);
|
|
28
|
-
for (const r in e)
|
|
29
|
-
s[r] = e[r];
|
|
30
|
-
return n.forEach(function(r) {
|
|
31
|
-
for (const h in r)
|
|
32
|
-
s[h] = r[h];
|
|
33
|
-
}), /** @type {T} */
|
|
34
|
-
s;
|
|
35
|
-
}
|
|
36
|
-
const gn = "</span>", we = (e) => !!e.scope, fn = (e, { prefix: n }) => {
|
|
37
|
-
if (e.startsWith("language:"))
|
|
38
|
-
return e.replace("language:", "language-");
|
|
39
|
-
if (e.includes(".")) {
|
|
40
|
-
const s = e.split(".");
|
|
41
|
-
return [
|
|
42
|
-
`${n}${s.shift()}`,
|
|
43
|
-
...s.map((r, h) => `${r}${"_".repeat(h + 1)}`)
|
|
44
|
-
].join(" ");
|
|
45
|
-
}
|
|
46
|
-
return `${n}${e}`;
|
|
47
|
-
};
|
|
48
|
-
class dn {
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new HTMLRenderer
|
|
51
|
-
*
|
|
52
|
-
* @param {Tree} parseTree - the parse tree (must support `walk` API)
|
|
53
|
-
* @param {{classPrefix: string}} options
|
|
54
|
-
*/
|
|
55
|
-
constructor(n, s) {
|
|
56
|
-
this.buffer = "", this.classPrefix = s.classPrefix, n.walk(this);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Adds texts to the output stream
|
|
60
|
-
*
|
|
61
|
-
* @param {string} text */
|
|
62
|
-
addText(n) {
|
|
63
|
-
this.buffer += De(n);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Adds a node open to the output stream (if needed)
|
|
67
|
-
*
|
|
68
|
-
* @param {Node} node */
|
|
69
|
-
openNode(n) {
|
|
70
|
-
if (!we(n)) return;
|
|
71
|
-
const s = fn(
|
|
72
|
-
n.scope,
|
|
73
|
-
{ prefix: this.classPrefix }
|
|
74
|
-
);
|
|
75
|
-
this.span(s);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Adds a node close to the output stream (if needed)
|
|
79
|
-
*
|
|
80
|
-
* @param {Node} node */
|
|
81
|
-
closeNode(n) {
|
|
82
|
-
we(n) && (this.buffer += gn);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* returns the accumulated buffer
|
|
86
|
-
*/
|
|
87
|
-
value() {
|
|
88
|
-
return this.buffer;
|
|
89
|
-
}
|
|
90
|
-
// helpers
|
|
91
|
-
/**
|
|
92
|
-
* Builds a span element
|
|
93
|
-
*
|
|
94
|
-
* @param {string} className */
|
|
95
|
-
span(n) {
|
|
96
|
-
this.buffer += `<span class="${n}">`;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const Ie = (e = {}) => {
|
|
100
|
-
const n = { children: [] };
|
|
101
|
-
return Object.assign(n, e), n;
|
|
102
|
-
};
|
|
103
|
-
class pe {
|
|
104
|
-
constructor() {
|
|
105
|
-
this.rootNode = Ie(), this.stack = [this.rootNode];
|
|
106
|
-
}
|
|
107
|
-
get top() {
|
|
108
|
-
return this.stack[this.stack.length - 1];
|
|
109
|
-
}
|
|
110
|
-
get root() {
|
|
111
|
-
return this.rootNode;
|
|
112
|
-
}
|
|
113
|
-
/** @param {Node} node */
|
|
114
|
-
add(n) {
|
|
115
|
-
this.top.children.push(n);
|
|
116
|
-
}
|
|
117
|
-
/** @param {string} scope */
|
|
118
|
-
openNode(n) {
|
|
119
|
-
const s = Ie({ scope: n });
|
|
120
|
-
this.add(s), this.stack.push(s);
|
|
121
|
-
}
|
|
122
|
-
closeNode() {
|
|
123
|
-
if (this.stack.length > 1)
|
|
124
|
-
return this.stack.pop();
|
|
125
|
-
}
|
|
126
|
-
closeAllNodes() {
|
|
127
|
-
for (; this.closeNode(); ) ;
|
|
128
|
-
}
|
|
129
|
-
toJSON() {
|
|
130
|
-
return JSON.stringify(this.rootNode, null, 4);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* @typedef { import("./html_renderer").Renderer } Renderer
|
|
134
|
-
* @param {Renderer} builder
|
|
135
|
-
*/
|
|
136
|
-
walk(n) {
|
|
137
|
-
return this.constructor._walk(n, this.rootNode);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* @param {Renderer} builder
|
|
141
|
-
* @param {Node} node
|
|
142
|
-
*/
|
|
143
|
-
static _walk(n, s) {
|
|
144
|
-
return typeof s == "string" ? n.addText(s) : s.children && (n.openNode(s), s.children.forEach((r) => this._walk(n, r)), n.closeNode(s)), n;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* @param {Node} node
|
|
148
|
-
*/
|
|
149
|
-
static _collapse(n) {
|
|
150
|
-
typeof n != "string" && n.children && (n.children.every((s) => typeof s == "string") ? n.children = [n.children.join("")] : n.children.forEach((s) => {
|
|
151
|
-
pe._collapse(s);
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
class En extends pe {
|
|
156
|
-
/**
|
|
157
|
-
* @param {*} options
|
|
158
|
-
*/
|
|
159
|
-
constructor(n) {
|
|
160
|
-
super(), this.options = n;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* @param {string} text
|
|
164
|
-
*/
|
|
165
|
-
addText(n) {
|
|
166
|
-
n !== "" && this.add(n);
|
|
167
|
-
}
|
|
168
|
-
/** @param {string} scope */
|
|
169
|
-
startScope(n) {
|
|
170
|
-
this.openNode(n);
|
|
171
|
-
}
|
|
172
|
-
endScope() {
|
|
173
|
-
this.closeNode();
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* @param {Emitter & {root: DataNode}} emitter
|
|
177
|
-
* @param {string} name
|
|
178
|
-
*/
|
|
179
|
-
__addSublanguage(n, s) {
|
|
180
|
-
const r = n.root;
|
|
181
|
-
s && (r.scope = `language:${s}`), this.add(r);
|
|
182
|
-
}
|
|
183
|
-
toHTML() {
|
|
184
|
-
return new dn(this, this.options).value();
|
|
185
|
-
}
|
|
186
|
-
finalize() {
|
|
187
|
-
return this.closeAllNodes(), !0;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
function ie(e) {
|
|
191
|
-
return e ? typeof e == "string" ? e : e.source : null;
|
|
192
|
-
}
|
|
193
|
-
function Be(e) {
|
|
194
|
-
return j("(?=", e, ")");
|
|
195
|
-
}
|
|
196
|
-
function hn(e) {
|
|
197
|
-
return j("(?:", e, ")*");
|
|
198
|
-
}
|
|
199
|
-
function bn(e) {
|
|
200
|
-
return j("(?:", e, ")?");
|
|
201
|
-
}
|
|
202
|
-
function j(...e) {
|
|
203
|
-
return e.map((s) => ie(s)).join("");
|
|
204
|
-
}
|
|
205
|
-
function pn(e) {
|
|
206
|
-
const n = e[e.length - 1];
|
|
207
|
-
return typeof n == "object" && n.constructor === Object ? (e.splice(e.length - 1, 1), n) : {};
|
|
208
|
-
}
|
|
209
|
-
function _e(...e) {
|
|
210
|
-
return "(" + (pn(e).capture ? "" : "?:") + e.map((r) => ie(r)).join("|") + ")";
|
|
211
|
-
}
|
|
212
|
-
function Ue(e) {
|
|
213
|
-
return new RegExp(e.toString() + "|").exec("").length - 1;
|
|
214
|
-
}
|
|
215
|
-
function _n(e, n) {
|
|
216
|
-
const s = e && e.exec(n);
|
|
217
|
-
return s && s.index === 0;
|
|
218
|
-
}
|
|
219
|
-
const Nn = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
220
|
-
function Ne(e, { joinWith: n }) {
|
|
221
|
-
let s = 0;
|
|
222
|
-
return e.map((r) => {
|
|
223
|
-
s += 1;
|
|
224
|
-
const h = s;
|
|
225
|
-
let S = ie(r), c = "";
|
|
226
|
-
for (; S.length > 0; ) {
|
|
227
|
-
const i = Nn.exec(S);
|
|
228
|
-
if (!i) {
|
|
229
|
-
c += S;
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
c += S.substring(0, i.index), S = S.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? c += "\\" + String(Number(i[1]) + h) : (c += i[0], i[0] === "(" && s++);
|
|
233
|
-
}
|
|
234
|
-
return c;
|
|
235
|
-
}).map((r) => `(${r})`).join(n);
|
|
236
|
-
}
|
|
237
|
-
const Sn = /\b\B/, Pe = "[a-zA-Z]\\w*", Se = "[a-zA-Z_]\\w*", $e = "\\b\\d+(\\.\\d+)?", He = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", Ge = "\\b(0b[01]+)", An = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", Rn = (e = {}) => {
|
|
238
|
-
const n = /^#![ ]*\//;
|
|
239
|
-
return e.binary && (e.begin = j(
|
|
240
|
-
n,
|
|
241
|
-
/.*\b/,
|
|
242
|
-
e.binary,
|
|
243
|
-
/\b.*/
|
|
244
|
-
)), z({
|
|
245
|
-
scope: "meta",
|
|
246
|
-
begin: n,
|
|
247
|
-
end: /$/,
|
|
248
|
-
relevance: 0,
|
|
249
|
-
/** @type {ModeCallback} */
|
|
250
|
-
"on:begin": (s, r) => {
|
|
251
|
-
s.index !== 0 && r.ignoreMatch();
|
|
252
|
-
}
|
|
253
|
-
}, e);
|
|
254
|
-
}, re = {
|
|
255
|
-
begin: "\\\\[\\s\\S]",
|
|
256
|
-
relevance: 0
|
|
257
|
-
}, Tn = {
|
|
258
|
-
scope: "string",
|
|
259
|
-
begin: "'",
|
|
260
|
-
end: "'",
|
|
261
|
-
illegal: "\\n",
|
|
262
|
-
contains: [re]
|
|
263
|
-
}, Mn = {
|
|
264
|
-
scope: "string",
|
|
265
|
-
begin: '"',
|
|
266
|
-
end: '"',
|
|
267
|
-
illegal: "\\n",
|
|
268
|
-
contains: [re]
|
|
269
|
-
}, yn = {
|
|
270
|
-
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
271
|
-
}, fe = function(e, n, s = {}) {
|
|
272
|
-
const r = z(
|
|
273
|
-
{
|
|
274
|
-
scope: "comment",
|
|
275
|
-
begin: e,
|
|
276
|
-
end: n,
|
|
277
|
-
contains: []
|
|
278
|
-
},
|
|
279
|
-
s
|
|
280
|
-
);
|
|
281
|
-
r.contains.push({
|
|
282
|
-
scope: "doctag",
|
|
283
|
-
// hack to avoid the space from being included. the space is necessary to
|
|
284
|
-
// match here to prevent the plain text rule below from gobbling up doctags
|
|
285
|
-
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
286
|
-
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
287
|
-
excludeBegin: !0,
|
|
288
|
-
relevance: 0
|
|
289
|
-
});
|
|
290
|
-
const h = _e(
|
|
291
|
-
// list of common 1 and 2 letter words in English
|
|
292
|
-
"I",
|
|
293
|
-
"a",
|
|
294
|
-
"is",
|
|
295
|
-
"so",
|
|
296
|
-
"us",
|
|
297
|
-
"to",
|
|
298
|
-
"at",
|
|
299
|
-
"if",
|
|
300
|
-
"in",
|
|
301
|
-
"it",
|
|
302
|
-
"on",
|
|
303
|
-
// note: this is not an exhaustive list of contractions, just popular ones
|
|
304
|
-
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
|
|
305
|
-
// contractions - can't we'd they're let's, etc
|
|
306
|
-
/[A-Za-z]+[-][a-z]+/,
|
|
307
|
-
// `no-way`, etc.
|
|
308
|
-
/[A-Za-z][a-z]{2,}/
|
|
309
|
-
// allow capitalized words at beginning of sentences
|
|
310
|
-
);
|
|
311
|
-
return r.contains.push(
|
|
312
|
-
{
|
|
313
|
-
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
314
|
-
// comment delimiters?
|
|
315
|
-
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
|
|
316
|
-
// ---
|
|
317
|
-
// this tries to find sequences of 3 english words in a row (without any
|
|
318
|
-
// "programming" type syntax) this gives us a strong signal that we've
|
|
319
|
-
// TRULY found a comment - vs perhaps scanning with the wrong language.
|
|
320
|
-
// It's possible to find something that LOOKS like the start of the
|
|
321
|
-
// comment - but then if there is no readable text - good chance it is a
|
|
322
|
-
// false match and not a comment.
|
|
323
|
-
//
|
|
324
|
-
// for a visual example please see:
|
|
325
|
-
// https://github.com/highlightjs/highlight.js/issues/2827
|
|
326
|
-
begin: j(
|
|
327
|
-
/[ ]+/,
|
|
328
|
-
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
329
|
-
"(",
|
|
330
|
-
h,
|
|
331
|
-
/[.]?[:]?([.][ ]|[ ])/,
|
|
332
|
-
"){3}"
|
|
333
|
-
)
|
|
334
|
-
// look for 3 words in a row
|
|
335
|
-
}
|
|
336
|
-
), r;
|
|
337
|
-
}, On = fe("//", "$"), wn = fe("/\\*", "\\*/"), In = fe("#", "$"), xn = {
|
|
338
|
-
scope: "number",
|
|
339
|
-
begin: $e,
|
|
340
|
-
relevance: 0
|
|
341
|
-
}, Cn = {
|
|
342
|
-
scope: "number",
|
|
343
|
-
begin: He,
|
|
344
|
-
relevance: 0
|
|
345
|
-
}, mn = {
|
|
346
|
-
scope: "number",
|
|
347
|
-
begin: Ge,
|
|
348
|
-
relevance: 0
|
|
349
|
-
}, vn = {
|
|
350
|
-
scope: "regexp",
|
|
351
|
-
begin: /\/(?=[^/\n]*\/)/,
|
|
352
|
-
end: /\/[gimuy]*/,
|
|
353
|
-
contains: [
|
|
354
|
-
re,
|
|
355
|
-
{
|
|
356
|
-
begin: /\[/,
|
|
357
|
-
end: /\]/,
|
|
358
|
-
relevance: 0,
|
|
359
|
-
contains: [re]
|
|
360
|
-
}
|
|
361
|
-
]
|
|
362
|
-
}, Ln = {
|
|
363
|
-
scope: "title",
|
|
364
|
-
begin: Pe,
|
|
365
|
-
relevance: 0
|
|
366
|
-
}, kn = {
|
|
367
|
-
scope: "title",
|
|
368
|
-
begin: Se,
|
|
369
|
-
relevance: 0
|
|
370
|
-
}, Dn = {
|
|
371
|
-
// excludes method names from keyword processing
|
|
372
|
-
begin: "\\.\\s*" + Se,
|
|
373
|
-
relevance: 0
|
|
374
|
-
}, Bn = function(e) {
|
|
375
|
-
return Object.assign(
|
|
376
|
-
e,
|
|
377
|
-
{
|
|
378
|
-
/** @type {ModeCallback} */
|
|
379
|
-
"on:begin": (n, s) => {
|
|
380
|
-
s.data._beginMatch = n[1];
|
|
381
|
-
},
|
|
382
|
-
/** @type {ModeCallback} */
|
|
383
|
-
"on:end": (n, s) => {
|
|
384
|
-
s.data._beginMatch !== n[1] && s.ignoreMatch();
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
};
|
|
389
|
-
var le = /* @__PURE__ */ Object.freeze({
|
|
390
|
-
__proto__: null,
|
|
391
|
-
APOS_STRING_MODE: Tn,
|
|
392
|
-
BACKSLASH_ESCAPE: re,
|
|
393
|
-
BINARY_NUMBER_MODE: mn,
|
|
394
|
-
BINARY_NUMBER_RE: Ge,
|
|
395
|
-
COMMENT: fe,
|
|
396
|
-
C_BLOCK_COMMENT_MODE: wn,
|
|
397
|
-
C_LINE_COMMENT_MODE: On,
|
|
398
|
-
C_NUMBER_MODE: Cn,
|
|
399
|
-
C_NUMBER_RE: He,
|
|
400
|
-
END_SAME_AS_BEGIN: Bn,
|
|
401
|
-
HASH_COMMENT_MODE: In,
|
|
402
|
-
IDENT_RE: Pe,
|
|
403
|
-
MATCH_NOTHING_RE: Sn,
|
|
404
|
-
METHOD_GUARD: Dn,
|
|
405
|
-
NUMBER_MODE: xn,
|
|
406
|
-
NUMBER_RE: $e,
|
|
407
|
-
PHRASAL_WORDS_MODE: yn,
|
|
408
|
-
QUOTE_STRING_MODE: Mn,
|
|
409
|
-
REGEXP_MODE: vn,
|
|
410
|
-
RE_STARTERS_RE: An,
|
|
411
|
-
SHEBANG: Rn,
|
|
412
|
-
TITLE_MODE: Ln,
|
|
413
|
-
UNDERSCORE_IDENT_RE: Se,
|
|
414
|
-
UNDERSCORE_TITLE_MODE: kn
|
|
415
|
-
});
|
|
416
|
-
function Un(e, n) {
|
|
417
|
-
e.input[e.index - 1] === "." && n.ignoreMatch();
|
|
418
|
-
}
|
|
419
|
-
function Pn(e, n) {
|
|
420
|
-
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
421
|
-
}
|
|
422
|
-
function $n(e, n) {
|
|
423
|
-
n && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = Un, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
424
|
-
}
|
|
425
|
-
function Hn(e, n) {
|
|
426
|
-
Array.isArray(e.illegal) && (e.illegal = _e(...e.illegal));
|
|
427
|
-
}
|
|
428
|
-
function Gn(e, n) {
|
|
429
|
-
if (e.match) {
|
|
430
|
-
if (e.begin || e.end) throw new Error("begin & end are not supported with match");
|
|
431
|
-
e.begin = e.match, delete e.match;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
function Fn(e, n) {
|
|
435
|
-
e.relevance === void 0 && (e.relevance = 1);
|
|
436
|
-
}
|
|
437
|
-
const zn = (e, n) => {
|
|
438
|
-
if (!e.beforeMatch) return;
|
|
439
|
-
if (e.starts) throw new Error("beforeMatch cannot be used with starts");
|
|
440
|
-
const s = Object.assign({}, e);
|
|
441
|
-
Object.keys(e).forEach((r) => {
|
|
442
|
-
delete e[r];
|
|
443
|
-
}), e.keywords = s.keywords, e.begin = j(s.beforeMatch, Be(s.begin)), e.starts = {
|
|
444
|
-
relevance: 0,
|
|
445
|
-
contains: [
|
|
446
|
-
Object.assign(s, { endsParent: !0 })
|
|
447
|
-
]
|
|
448
|
-
}, e.relevance = 0, delete s.beforeMatch;
|
|
449
|
-
}, Zn = [
|
|
450
|
-
"of",
|
|
451
|
-
"and",
|
|
452
|
-
"for",
|
|
453
|
-
"in",
|
|
454
|
-
"not",
|
|
455
|
-
"or",
|
|
456
|
-
"if",
|
|
457
|
-
"then",
|
|
458
|
-
"parent",
|
|
459
|
-
// common variable name
|
|
460
|
-
"list",
|
|
461
|
-
// common variable name
|
|
462
|
-
"value"
|
|
463
|
-
// common variable name
|
|
464
|
-
], Kn = "keyword";
|
|
465
|
-
function Fe(e, n, s = Kn) {
|
|
466
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
467
|
-
return typeof e == "string" ? h(s, e.split(" ")) : Array.isArray(e) ? h(s, e) : Object.keys(e).forEach(function(S) {
|
|
468
|
-
Object.assign(
|
|
469
|
-
r,
|
|
470
|
-
Fe(e[S], n, S)
|
|
471
|
-
);
|
|
472
|
-
}), r;
|
|
473
|
-
function h(S, c) {
|
|
474
|
-
n && (c = c.map((i) => i.toLowerCase())), c.forEach(function(i) {
|
|
475
|
-
const u = i.split("|");
|
|
476
|
-
r[u[0]] = [S, Wn(u[0], u[1])];
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
function Wn(e, n) {
|
|
481
|
-
return n ? Number(n) : Xn(e) ? 0 : 1;
|
|
482
|
-
}
|
|
483
|
-
function Xn(e) {
|
|
484
|
-
return Zn.includes(e.toLowerCase());
|
|
485
|
-
}
|
|
486
|
-
const xe = {}, X = (e) => {
|
|
487
|
-
console.error(e);
|
|
488
|
-
}, Ce = (e, ...n) => {
|
|
489
|
-
console.log(`WARN: ${e}`, ...n);
|
|
490
|
-
}, V = (e, n) => {
|
|
491
|
-
xe[`${e}/${n}`] || (console.log(`Deprecated as of ${e}. ${n}`), xe[`${e}/${n}`] = !0);
|
|
492
|
-
}, ue = new Error();
|
|
493
|
-
function ze(e, n, { key: s }) {
|
|
494
|
-
let r = 0;
|
|
495
|
-
const h = e[s], S = {}, c = {};
|
|
496
|
-
for (let i = 1; i <= n.length; i++)
|
|
497
|
-
c[i + r] = h[i], S[i + r] = !0, r += Ue(n[i - 1]);
|
|
498
|
-
e[s] = c, e[s]._emit = S, e[s]._multi = !0;
|
|
499
|
-
}
|
|
500
|
-
function jn(e) {
|
|
501
|
-
if (Array.isArray(e.begin)) {
|
|
502
|
-
if (e.skip || e.excludeBegin || e.returnBegin)
|
|
503
|
-
throw X("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), ue;
|
|
504
|
-
if (typeof e.beginScope != "object" || e.beginScope === null)
|
|
505
|
-
throw X("beginScope must be object"), ue;
|
|
506
|
-
ze(e, e.begin, { key: "beginScope" }), e.begin = Ne(e.begin, { joinWith: "" });
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
function Yn(e) {
|
|
510
|
-
if (Array.isArray(e.end)) {
|
|
511
|
-
if (e.skip || e.excludeEnd || e.returnEnd)
|
|
512
|
-
throw X("skip, excludeEnd, returnEnd not compatible with endScope: {}"), ue;
|
|
513
|
-
if (typeof e.endScope != "object" || e.endScope === null)
|
|
514
|
-
throw X("endScope must be object"), ue;
|
|
515
|
-
ze(e, e.end, { key: "endScope" }), e.end = Ne(e.end, { joinWith: "" });
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
function Jn(e) {
|
|
519
|
-
e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
|
|
520
|
-
}
|
|
521
|
-
function Vn(e) {
|
|
522
|
-
Jn(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), jn(e), Yn(e);
|
|
523
|
-
}
|
|
524
|
-
function Qn(e) {
|
|
525
|
-
function n(c, i) {
|
|
526
|
-
return new RegExp(
|
|
527
|
-
ie(c),
|
|
528
|
-
"m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (i ? "g" : "")
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
class s {
|
|
532
|
-
constructor() {
|
|
533
|
-
this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
|
|
534
|
-
}
|
|
535
|
-
// @ts-ignore
|
|
536
|
-
addRule(i, u) {
|
|
537
|
-
u.position = this.position++, this.matchIndexes[this.matchAt] = u, this.regexes.push([u, i]), this.matchAt += Ue(i) + 1;
|
|
538
|
-
}
|
|
539
|
-
compile() {
|
|
540
|
-
this.regexes.length === 0 && (this.exec = () => null);
|
|
541
|
-
const i = this.regexes.map((u) => u[1]);
|
|
542
|
-
this.matcherRe = n(Ne(i, { joinWith: "|" }), !0), this.lastIndex = 0;
|
|
543
|
-
}
|
|
544
|
-
/** @param {string} s */
|
|
545
|
-
exec(i) {
|
|
546
|
-
this.matcherRe.lastIndex = this.lastIndex;
|
|
547
|
-
const u = this.matcherRe.exec(i);
|
|
548
|
-
if (!u)
|
|
549
|
-
return null;
|
|
550
|
-
const b = u.findIndex((I, R) => R > 0 && I !== void 0), p = this.matchIndexes[b];
|
|
551
|
-
return u.splice(0, b), Object.assign(u, p);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
class r {
|
|
555
|
-
constructor() {
|
|
556
|
-
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
|
|
557
|
-
}
|
|
558
|
-
// @ts-ignore
|
|
559
|
-
getMatcher(i) {
|
|
560
|
-
if (this.multiRegexes[i]) return this.multiRegexes[i];
|
|
561
|
-
const u = new s();
|
|
562
|
-
return this.rules.slice(i).forEach(([b, p]) => u.addRule(b, p)), u.compile(), this.multiRegexes[i] = u, u;
|
|
563
|
-
}
|
|
564
|
-
resumingScanAtSamePosition() {
|
|
565
|
-
return this.regexIndex !== 0;
|
|
566
|
-
}
|
|
567
|
-
considerAll() {
|
|
568
|
-
this.regexIndex = 0;
|
|
569
|
-
}
|
|
570
|
-
// @ts-ignore
|
|
571
|
-
addRule(i, u) {
|
|
572
|
-
this.rules.push([i, u]), u.type === "begin" && this.count++;
|
|
573
|
-
}
|
|
574
|
-
/** @param {string} s */
|
|
575
|
-
exec(i) {
|
|
576
|
-
const u = this.getMatcher(this.regexIndex);
|
|
577
|
-
u.lastIndex = this.lastIndex;
|
|
578
|
-
let b = u.exec(i);
|
|
579
|
-
if (this.resumingScanAtSamePosition() && !(b && b.index === this.lastIndex)) {
|
|
580
|
-
const p = this.getMatcher(0);
|
|
581
|
-
p.lastIndex = this.lastIndex + 1, b = p.exec(i);
|
|
582
|
-
}
|
|
583
|
-
return b && (this.regexIndex += b.position + 1, this.regexIndex === this.count && this.considerAll()), b;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
function h(c) {
|
|
587
|
-
const i = new r();
|
|
588
|
-
return c.contains.forEach((u) => i.addRule(u.begin, { rule: u, type: "begin" })), c.terminatorEnd && i.addRule(c.terminatorEnd, { type: "end" }), c.illegal && i.addRule(c.illegal, { type: "illegal" }), i;
|
|
589
|
-
}
|
|
590
|
-
function S(c, i) {
|
|
591
|
-
const u = (
|
|
592
|
-
/** @type CompiledMode */
|
|
593
|
-
c
|
|
594
|
-
);
|
|
595
|
-
if (c.isCompiled) return u;
|
|
596
|
-
[
|
|
597
|
-
Pn,
|
|
598
|
-
// do this early so compiler extensions generally don't have to worry about
|
|
599
|
-
// the distinction between match/begin
|
|
600
|
-
Gn,
|
|
601
|
-
Vn,
|
|
602
|
-
zn
|
|
603
|
-
].forEach((p) => p(c, i)), e.compilerExtensions.forEach((p) => p(c, i)), c.__beforeBegin = null, [
|
|
604
|
-
$n,
|
|
605
|
-
// do this later so compiler extensions that come earlier have access to the
|
|
606
|
-
// raw array if they wanted to perhaps manipulate it, etc.
|
|
607
|
-
Hn,
|
|
608
|
-
// default to 1 relevance if not specified
|
|
609
|
-
Fn
|
|
610
|
-
].forEach((p) => p(c, i)), c.isCompiled = !0;
|
|
611
|
-
let b = null;
|
|
612
|
-
return typeof c.keywords == "object" && c.keywords.$pattern && (c.keywords = Object.assign({}, c.keywords), b = c.keywords.$pattern, delete c.keywords.$pattern), b = b || /\w+/, c.keywords && (c.keywords = Fe(c.keywords, e.case_insensitive)), u.keywordPatternRe = n(b, !0), i && (c.begin || (c.begin = /\B|\b/), u.beginRe = n(u.begin), !c.end && !c.endsWithParent && (c.end = /\B|\b/), c.end && (u.endRe = n(u.end)), u.terminatorEnd = ie(u.end) || "", c.endsWithParent && i.terminatorEnd && (u.terminatorEnd += (c.end ? "|" : "") + i.terminatorEnd)), c.illegal && (u.illegalRe = n(
|
|
613
|
-
/** @type {RegExp | string} */
|
|
614
|
-
c.illegal
|
|
615
|
-
)), c.contains || (c.contains = []), c.contains = [].concat(...c.contains.map(function(p) {
|
|
616
|
-
return qn(p === "self" ? c : p);
|
|
617
|
-
})), c.contains.forEach(function(p) {
|
|
618
|
-
S(
|
|
619
|
-
/** @type Mode */
|
|
620
|
-
p,
|
|
621
|
-
u
|
|
622
|
-
);
|
|
623
|
-
}), c.starts && S(c.starts, i), u.matcher = h(u), u;
|
|
624
|
-
}
|
|
625
|
-
if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
|
|
626
|
-
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
627
|
-
return e.classNameAliases = z(e.classNameAliases || {}), S(
|
|
628
|
-
/** @type Mode */
|
|
629
|
-
e
|
|
630
|
-
);
|
|
631
|
-
}
|
|
632
|
-
function Ze(e) {
|
|
633
|
-
return e ? e.endsWithParent || Ze(e.starts) : !1;
|
|
634
|
-
}
|
|
635
|
-
function qn(e) {
|
|
636
|
-
return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(n) {
|
|
637
|
-
return z(e, { variants: null }, n);
|
|
638
|
-
})), e.cachedVariants ? e.cachedVariants : Ze(e) ? z(e, { starts: e.starts ? z(e.starts) : null }) : Object.isFrozen(e) ? z(e) : e;
|
|
639
|
-
}
|
|
640
|
-
var et = "11.10.0";
|
|
641
|
-
class nt extends Error {
|
|
642
|
-
constructor(n, s) {
|
|
643
|
-
super(n), this.name = "HTMLInjectionError", this.html = s;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
const be = De, me = z, ve = Symbol("nomatch"), tt = 7, Ke = function(e) {
|
|
647
|
-
const n = /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null), r = [];
|
|
648
|
-
let h = !0;
|
|
649
|
-
const S = "Could not find the language '{}', did you forget to load/include a language module?", c = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
650
|
-
let i = {
|
|
651
|
-
ignoreUnescapedHTML: !1,
|
|
652
|
-
throwUnescapedHTML: !1,
|
|
653
|
-
noHighlightRe: /^(no-?highlight)$/i,
|
|
654
|
-
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
655
|
-
classPrefix: "hljs-",
|
|
656
|
-
cssSelector: "pre code",
|
|
657
|
-
languages: null,
|
|
658
|
-
// beta configuration options, subject to change, welcome to discuss
|
|
659
|
-
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
660
|
-
__emitter: En
|
|
661
|
-
};
|
|
662
|
-
function u(t) {
|
|
663
|
-
return i.noHighlightRe.test(t);
|
|
664
|
-
}
|
|
665
|
-
function b(t) {
|
|
666
|
-
let a = t.className + " ";
|
|
667
|
-
a += t.parentNode ? t.parentNode.className : "";
|
|
668
|
-
const g = i.languageDetectRe.exec(a);
|
|
669
|
-
if (g) {
|
|
670
|
-
const E = m(g[1]);
|
|
671
|
-
return E || (Ce(S.replace("{}", g[1])), Ce("Falling back to no-highlight mode for this block.", t)), E ? g[1] : "no-highlight";
|
|
672
|
-
}
|
|
673
|
-
return a.split(/\s+/).find((E) => u(E) || m(E));
|
|
674
|
-
}
|
|
675
|
-
function p(t, a, g) {
|
|
676
|
-
let E = "", _ = "";
|
|
677
|
-
typeof a == "object" ? (E = t, g = a.ignoreIllegals, _ = a.language) : (V("10.7.0", "highlight(lang, code, ...args) has been deprecated."), V("10.7.0", `Please use highlight(code, options) instead.
|
|
678
|
-
https://github.com/highlightjs/highlight.js/issues/2277`), _ = t, E = a), g === void 0 && (g = !0);
|
|
679
|
-
const T = {
|
|
680
|
-
code: E,
|
|
681
|
-
language: _
|
|
682
|
-
};
|
|
683
|
-
F("before:highlight", T);
|
|
684
|
-
const w = T.result ? T.result : I(T.language, T.code, g);
|
|
685
|
-
return w.code = T.code, F("after:highlight", w), w;
|
|
686
|
-
}
|
|
687
|
-
function I(t, a, g, E) {
|
|
688
|
-
const _ = /* @__PURE__ */ Object.create(null);
|
|
689
|
-
function T(o, l) {
|
|
690
|
-
return o.keywords[l];
|
|
691
|
-
}
|
|
692
|
-
function w() {
|
|
693
|
-
if (!f.keywords) {
|
|
694
|
-
M.addText(A);
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
let o = 0;
|
|
698
|
-
f.keywordPatternRe.lastIndex = 0;
|
|
699
|
-
let l = f.keywordPatternRe.exec(A), d = "";
|
|
700
|
-
for (; l; ) {
|
|
701
|
-
d += A.substring(o, l.index);
|
|
702
|
-
const N = B.case_insensitive ? l[0].toLowerCase() : l[0], O = T(f, N);
|
|
703
|
-
if (O) {
|
|
704
|
-
const [H, on] = O;
|
|
705
|
-
if (M.addText(d), d = "", _[N] = (_[N] || 0) + 1, _[N] <= tt && (oe += on), H.startsWith("_"))
|
|
706
|
-
d += l[0];
|
|
707
|
-
else {
|
|
708
|
-
const ln = B.classNameAliases[H] || H;
|
|
709
|
-
D(l[0], ln);
|
|
710
|
-
}
|
|
711
|
-
} else
|
|
712
|
-
d += l[0];
|
|
713
|
-
o = f.keywordPatternRe.lastIndex, l = f.keywordPatternRe.exec(A);
|
|
714
|
-
}
|
|
715
|
-
d += A.substring(o), M.addText(d);
|
|
716
|
-
}
|
|
717
|
-
function ae() {
|
|
718
|
-
if (A === "") return;
|
|
719
|
-
let o = null;
|
|
720
|
-
if (typeof f.subLanguage == "string") {
|
|
721
|
-
if (!n[f.subLanguage]) {
|
|
722
|
-
M.addText(A);
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
o = I(f.subLanguage, A, !0, ye[f.subLanguage]), ye[f.subLanguage] = /** @type {CompiledMode} */
|
|
726
|
-
o._top;
|
|
727
|
-
} else
|
|
728
|
-
o = y(A, f.subLanguage.length ? f.subLanguage : null);
|
|
729
|
-
f.relevance > 0 && (oe += o.relevance), M.__addSublanguage(o._emitter, o.language);
|
|
730
|
-
}
|
|
731
|
-
function C() {
|
|
732
|
-
f.subLanguage != null ? ae() : w(), A = "";
|
|
733
|
-
}
|
|
734
|
-
function D(o, l) {
|
|
735
|
-
o !== "" && (M.startScope(l), M.addText(o), M.endScope());
|
|
736
|
-
}
|
|
737
|
-
function Ae(o, l) {
|
|
738
|
-
let d = 1;
|
|
739
|
-
const N = l.length - 1;
|
|
740
|
-
for (; d <= N; ) {
|
|
741
|
-
if (!o._emit[d]) {
|
|
742
|
-
d++;
|
|
743
|
-
continue;
|
|
744
|
-
}
|
|
745
|
-
const O = B.classNameAliases[o[d]] || o[d], H = l[d];
|
|
746
|
-
O ? D(H, O) : (A = H, w(), A = ""), d++;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
function Re(o, l) {
|
|
750
|
-
return o.scope && typeof o.scope == "string" && M.openNode(B.classNameAliases[o.scope] || o.scope), o.beginScope && (o.beginScope._wrap ? (D(A, B.classNameAliases[o.beginScope._wrap] || o.beginScope._wrap), A = "") : o.beginScope._multi && (Ae(o.beginScope, l), A = "")), f = Object.create(o, { parent: { value: f } }), f;
|
|
751
|
-
}
|
|
752
|
-
function Te(o, l, d) {
|
|
753
|
-
let N = _n(o.endRe, d);
|
|
754
|
-
if (N) {
|
|
755
|
-
if (o["on:end"]) {
|
|
756
|
-
const O = new Oe(o);
|
|
757
|
-
o["on:end"](l, O), O.isMatchIgnored && (N = !1);
|
|
758
|
-
}
|
|
759
|
-
if (N) {
|
|
760
|
-
for (; o.endsParent && o.parent; )
|
|
761
|
-
o = o.parent;
|
|
762
|
-
return o;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
if (o.endsWithParent)
|
|
766
|
-
return Te(o.parent, l, d);
|
|
767
|
-
}
|
|
768
|
-
function tn(o) {
|
|
769
|
-
return f.matcher.regexIndex === 0 ? (A += o[0], 1) : (he = !0, 0);
|
|
770
|
-
}
|
|
771
|
-
function sn(o) {
|
|
772
|
-
const l = o[0], d = o.rule, N = new Oe(d), O = [d.__beforeBegin, d["on:begin"]];
|
|
773
|
-
for (const H of O)
|
|
774
|
-
if (H && (H(o, N), N.isMatchIgnored))
|
|
775
|
-
return tn(l);
|
|
776
|
-
return d.skip ? A += l : (d.excludeBegin && (A += l), C(), !d.returnBegin && !d.excludeBegin && (A = l)), Re(d, o), d.returnBegin ? 0 : l.length;
|
|
777
|
-
}
|
|
778
|
-
function rn(o) {
|
|
779
|
-
const l = o[0], d = a.substring(o.index), N = Te(f, o, d);
|
|
780
|
-
if (!N)
|
|
781
|
-
return ve;
|
|
782
|
-
const O = f;
|
|
783
|
-
f.endScope && f.endScope._wrap ? (C(), D(l, f.endScope._wrap)) : f.endScope && f.endScope._multi ? (C(), Ae(f.endScope, o)) : O.skip ? A += l : (O.returnEnd || O.excludeEnd || (A += l), C(), O.excludeEnd && (A = l));
|
|
784
|
-
do
|
|
785
|
-
f.scope && M.closeNode(), !f.skip && !f.subLanguage && (oe += f.relevance), f = f.parent;
|
|
786
|
-
while (f !== N.parent);
|
|
787
|
-
return N.starts && Re(N.starts, o), O.returnEnd ? 0 : l.length;
|
|
788
|
-
}
|
|
789
|
-
function an() {
|
|
790
|
-
const o = [];
|
|
791
|
-
for (let l = f; l !== B; l = l.parent)
|
|
792
|
-
l.scope && o.unshift(l.scope);
|
|
793
|
-
o.forEach((l) => M.openNode(l));
|
|
794
|
-
}
|
|
795
|
-
let ce = {};
|
|
796
|
-
function Me(o, l) {
|
|
797
|
-
const d = l && l[0];
|
|
798
|
-
if (A += o, d == null)
|
|
799
|
-
return C(), 0;
|
|
800
|
-
if (ce.type === "begin" && l.type === "end" && ce.index === l.index && d === "") {
|
|
801
|
-
if (A += a.slice(l.index, l.index + 1), !h) {
|
|
802
|
-
const N = new Error(`0 width match regex (${t})`);
|
|
803
|
-
throw N.languageName = t, N.badRule = ce.rule, N;
|
|
804
|
-
}
|
|
805
|
-
return 1;
|
|
806
|
-
}
|
|
807
|
-
if (ce = l, l.type === "begin")
|
|
808
|
-
return sn(l);
|
|
809
|
-
if (l.type === "illegal" && !g) {
|
|
810
|
-
const N = new Error('Illegal lexeme "' + d + '" for mode "' + (f.scope || "<unnamed>") + '"');
|
|
811
|
-
throw N.mode = f, N;
|
|
812
|
-
} else if (l.type === "end") {
|
|
813
|
-
const N = rn(l);
|
|
814
|
-
if (N !== ve)
|
|
815
|
-
return N;
|
|
816
|
-
}
|
|
817
|
-
if (l.type === "illegal" && d === "")
|
|
818
|
-
return 1;
|
|
819
|
-
if (Ee > 1e5 && Ee > l.index * 3)
|
|
820
|
-
throw new Error("potential infinite loop, way more iterations than matches");
|
|
821
|
-
return A += d, d.length;
|
|
822
|
-
}
|
|
823
|
-
const B = m(t);
|
|
824
|
-
if (!B)
|
|
825
|
-
throw X(S.replace("{}", t)), new Error('Unknown language: "' + t + '"');
|
|
826
|
-
const cn = Qn(B);
|
|
827
|
-
let de = "", f = E || cn;
|
|
828
|
-
const ye = {}, M = new i.__emitter(i);
|
|
829
|
-
an();
|
|
830
|
-
let A = "", oe = 0, W = 0, Ee = 0, he = !1;
|
|
831
|
-
try {
|
|
832
|
-
if (B.__emitTokens)
|
|
833
|
-
B.__emitTokens(a, M);
|
|
834
|
-
else {
|
|
835
|
-
for (f.matcher.considerAll(); ; ) {
|
|
836
|
-
Ee++, he ? he = !1 : f.matcher.considerAll(), f.matcher.lastIndex = W;
|
|
837
|
-
const o = f.matcher.exec(a);
|
|
838
|
-
if (!o) break;
|
|
839
|
-
const l = a.substring(W, o.index), d = Me(l, o);
|
|
840
|
-
W = o.index + d;
|
|
841
|
-
}
|
|
842
|
-
Me(a.substring(W));
|
|
843
|
-
}
|
|
844
|
-
return M.finalize(), de = M.toHTML(), {
|
|
845
|
-
language: t,
|
|
846
|
-
value: de,
|
|
847
|
-
relevance: oe,
|
|
848
|
-
illegal: !1,
|
|
849
|
-
_emitter: M,
|
|
850
|
-
_top: f
|
|
851
|
-
};
|
|
852
|
-
} catch (o) {
|
|
853
|
-
if (o.message && o.message.includes("Illegal"))
|
|
854
|
-
return {
|
|
855
|
-
language: t,
|
|
856
|
-
value: be(a),
|
|
857
|
-
illegal: !0,
|
|
858
|
-
relevance: 0,
|
|
859
|
-
_illegalBy: {
|
|
860
|
-
message: o.message,
|
|
861
|
-
index: W,
|
|
862
|
-
context: a.slice(W - 100, W + 100),
|
|
863
|
-
mode: o.mode,
|
|
864
|
-
resultSoFar: de
|
|
865
|
-
},
|
|
866
|
-
_emitter: M
|
|
867
|
-
};
|
|
868
|
-
if (h)
|
|
869
|
-
return {
|
|
870
|
-
language: t,
|
|
871
|
-
value: be(a),
|
|
872
|
-
illegal: !1,
|
|
873
|
-
relevance: 0,
|
|
874
|
-
errorRaised: o,
|
|
875
|
-
_emitter: M,
|
|
876
|
-
_top: f
|
|
877
|
-
};
|
|
878
|
-
throw o;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
function R(t) {
|
|
882
|
-
const a = {
|
|
883
|
-
value: be(t),
|
|
884
|
-
illegal: !1,
|
|
885
|
-
relevance: 0,
|
|
886
|
-
_top: c,
|
|
887
|
-
_emitter: new i.__emitter(i)
|
|
888
|
-
};
|
|
889
|
-
return a._emitter.addText(t), a;
|
|
890
|
-
}
|
|
891
|
-
function y(t, a) {
|
|
892
|
-
a = a || i.languages || Object.keys(n);
|
|
893
|
-
const g = R(t), E = a.filter(m).filter(J).map(
|
|
894
|
-
(C) => I(C, t, !1)
|
|
895
|
-
);
|
|
896
|
-
E.unshift(g);
|
|
897
|
-
const _ = E.sort((C, D) => {
|
|
898
|
-
if (C.relevance !== D.relevance) return D.relevance - C.relevance;
|
|
899
|
-
if (C.language && D.language) {
|
|
900
|
-
if (m(C.language).supersetOf === D.language)
|
|
901
|
-
return 1;
|
|
902
|
-
if (m(D.language).supersetOf === C.language)
|
|
903
|
-
return -1;
|
|
904
|
-
}
|
|
905
|
-
return 0;
|
|
906
|
-
}), [T, w] = _, ae = T;
|
|
907
|
-
return ae.secondBest = w, ae;
|
|
908
|
-
}
|
|
909
|
-
function U(t, a, g) {
|
|
910
|
-
const E = a && s[a] || g;
|
|
911
|
-
t.classList.add("hljs"), t.classList.add(`language-${E}`);
|
|
912
|
-
}
|
|
913
|
-
function v(t) {
|
|
914
|
-
let a = null;
|
|
915
|
-
const g = b(t);
|
|
916
|
-
if (u(g)) return;
|
|
917
|
-
if (F(
|
|
918
|
-
"before:highlightElement",
|
|
919
|
-
{ el: t, language: g }
|
|
920
|
-
), t.dataset.highlighted) {
|
|
921
|
-
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", t);
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
if (t.children.length > 0 && (i.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(t)), i.throwUnescapedHTML))
|
|
925
|
-
throw new nt(
|
|
926
|
-
"One of your code blocks includes unescaped HTML.",
|
|
927
|
-
t.innerHTML
|
|
928
|
-
);
|
|
929
|
-
a = t;
|
|
930
|
-
const E = a.textContent, _ = g ? p(E, { language: g, ignoreIllegals: !0 }) : y(E);
|
|
931
|
-
t.innerHTML = _.value, t.dataset.highlighted = "yes", U(t, g, _.language), t.result = {
|
|
932
|
-
language: _.language,
|
|
933
|
-
// TODO: remove with version 11.0
|
|
934
|
-
re: _.relevance,
|
|
935
|
-
relevance: _.relevance
|
|
936
|
-
}, _.secondBest && (t.secondBest = {
|
|
937
|
-
language: _.secondBest.language,
|
|
938
|
-
relevance: _.secondBest.relevance
|
|
939
|
-
}), F("after:highlightElement", { el: t, result: _, text: E });
|
|
940
|
-
}
|
|
941
|
-
function L(t) {
|
|
942
|
-
i = me(i, t);
|
|
943
|
-
}
|
|
944
|
-
const q = () => {
|
|
945
|
-
k(), V("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
946
|
-
};
|
|
947
|
-
function P() {
|
|
948
|
-
k(), V("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
949
|
-
}
|
|
950
|
-
let G = !1;
|
|
951
|
-
function k() {
|
|
952
|
-
if (document.readyState === "loading") {
|
|
953
|
-
G = !0;
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
document.querySelectorAll(i.cssSelector).forEach(v);
|
|
957
|
-
}
|
|
958
|
-
function $() {
|
|
959
|
-
G && k();
|
|
960
|
-
}
|
|
961
|
-
typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", $, !1);
|
|
962
|
-
function x(t, a) {
|
|
963
|
-
let g = null;
|
|
964
|
-
try {
|
|
965
|
-
g = a(e);
|
|
966
|
-
} catch (E) {
|
|
967
|
-
if (X("Language definition for '{}' could not be registered.".replace("{}", t)), h)
|
|
968
|
-
X(E);
|
|
969
|
-
else
|
|
970
|
-
throw E;
|
|
971
|
-
g = c;
|
|
972
|
-
}
|
|
973
|
-
g.name || (g.name = t), n[t] = g, g.rawDefinition = a.bind(null, e), g.aliases && Y(g.aliases, { languageName: t });
|
|
974
|
-
}
|
|
975
|
-
function ee(t) {
|
|
976
|
-
delete n[t];
|
|
977
|
-
for (const a of Object.keys(s))
|
|
978
|
-
s[a] === t && delete s[a];
|
|
979
|
-
}
|
|
980
|
-
function Z() {
|
|
981
|
-
return Object.keys(n);
|
|
982
|
-
}
|
|
983
|
-
function m(t) {
|
|
984
|
-
return t = (t || "").toLowerCase(), n[t] || n[s[t]];
|
|
985
|
-
}
|
|
986
|
-
function Y(t, { languageName: a }) {
|
|
987
|
-
typeof t == "string" && (t = [t]), t.forEach((g) => {
|
|
988
|
-
s[g.toLowerCase()] = a;
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
function J(t) {
|
|
992
|
-
const a = m(t);
|
|
993
|
-
return a && !a.disableAutodetect;
|
|
994
|
-
}
|
|
995
|
-
function ne(t) {
|
|
996
|
-
t["before:highlightBlock"] && !t["before:highlightElement"] && (t["before:highlightElement"] = (a) => {
|
|
997
|
-
t["before:highlightBlock"](
|
|
998
|
-
Object.assign({ block: a.el }, a)
|
|
999
|
-
);
|
|
1000
|
-
}), t["after:highlightBlock"] && !t["after:highlightElement"] && (t["after:highlightElement"] = (a) => {
|
|
1001
|
-
t["after:highlightBlock"](
|
|
1002
|
-
Object.assign({ block: a.el }, a)
|
|
1003
|
-
);
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
function te(t) {
|
|
1007
|
-
ne(t), r.push(t);
|
|
1008
|
-
}
|
|
1009
|
-
function se(t) {
|
|
1010
|
-
const a = r.indexOf(t);
|
|
1011
|
-
a !== -1 && r.splice(a, 1);
|
|
1012
|
-
}
|
|
1013
|
-
function F(t, a) {
|
|
1014
|
-
const g = t;
|
|
1015
|
-
r.forEach(function(E) {
|
|
1016
|
-
E[g] && E[g](a);
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
function K(t) {
|
|
1020
|
-
return V("10.7.0", "highlightBlock will be removed entirely in v12.0"), V("10.7.0", "Please use highlightElement now."), v(t);
|
|
1021
|
-
}
|
|
1022
|
-
Object.assign(e, {
|
|
1023
|
-
highlight: p,
|
|
1024
|
-
highlightAuto: y,
|
|
1025
|
-
highlightAll: k,
|
|
1026
|
-
highlightElement: v,
|
|
1027
|
-
// TODO: Remove with v12 API
|
|
1028
|
-
highlightBlock: K,
|
|
1029
|
-
configure: L,
|
|
1030
|
-
initHighlighting: q,
|
|
1031
|
-
initHighlightingOnLoad: P,
|
|
1032
|
-
registerLanguage: x,
|
|
1033
|
-
unregisterLanguage: ee,
|
|
1034
|
-
listLanguages: Z,
|
|
1035
|
-
getLanguage: m,
|
|
1036
|
-
registerAliases: Y,
|
|
1037
|
-
autoDetection: J,
|
|
1038
|
-
inherit: me,
|
|
1039
|
-
addPlugin: te,
|
|
1040
|
-
removePlugin: se
|
|
1041
|
-
}), e.debugMode = function() {
|
|
1042
|
-
h = !1;
|
|
1043
|
-
}, e.safeMode = function() {
|
|
1044
|
-
h = !0;
|
|
1045
|
-
}, e.versionString = et, e.regex = {
|
|
1046
|
-
concat: j,
|
|
1047
|
-
lookahead: Be,
|
|
1048
|
-
either: _e,
|
|
1049
|
-
optional: bn,
|
|
1050
|
-
anyNumberOfTimes: hn
|
|
1051
|
-
};
|
|
1052
|
-
for (const t in le)
|
|
1053
|
-
typeof le[t] == "object" && ke(le[t]);
|
|
1054
|
-
return Object.assign(e, le), e;
|
|
1055
|
-
}, Q = Ke({});
|
|
1056
|
-
Q.newInstance = () => Ke({});
|
|
1057
|
-
var st = Q;
|
|
1058
|
-
Q.HighlightJS = Q;
|
|
1059
|
-
Q.default = Q;
|
|
1060
|
-
const ut = /* @__PURE__ */ un(st), Le = "[A-Za-z$_][0-9A-Za-z$_]*", it = [
|
|
1061
|
-
"as",
|
|
1062
|
-
// for exports
|
|
1063
|
-
"in",
|
|
1064
|
-
"of",
|
|
1065
|
-
"if",
|
|
1066
|
-
"for",
|
|
1067
|
-
"while",
|
|
1068
|
-
"finally",
|
|
1069
|
-
"var",
|
|
1070
|
-
"new",
|
|
1071
|
-
"function",
|
|
1072
|
-
"do",
|
|
1073
|
-
"return",
|
|
1074
|
-
"void",
|
|
1075
|
-
"else",
|
|
1076
|
-
"break",
|
|
1077
|
-
"catch",
|
|
1078
|
-
"instanceof",
|
|
1079
|
-
"with",
|
|
1080
|
-
"throw",
|
|
1081
|
-
"case",
|
|
1082
|
-
"default",
|
|
1083
|
-
"try",
|
|
1084
|
-
"switch",
|
|
1085
|
-
"continue",
|
|
1086
|
-
"typeof",
|
|
1087
|
-
"delete",
|
|
1088
|
-
"let",
|
|
1089
|
-
"yield",
|
|
1090
|
-
"const",
|
|
1091
|
-
"class",
|
|
1092
|
-
// JS handles these with a special rule
|
|
1093
|
-
// "get",
|
|
1094
|
-
// "set",
|
|
1095
|
-
"debugger",
|
|
1096
|
-
"async",
|
|
1097
|
-
"await",
|
|
1098
|
-
"static",
|
|
1099
|
-
"import",
|
|
1100
|
-
"from",
|
|
1101
|
-
"export",
|
|
1102
|
-
"extends"
|
|
1103
|
-
], rt = [
|
|
1104
|
-
"true",
|
|
1105
|
-
"false",
|
|
1106
|
-
"null",
|
|
1107
|
-
"undefined",
|
|
1108
|
-
"NaN",
|
|
1109
|
-
"Infinity"
|
|
1110
|
-
], We = [
|
|
1111
|
-
// Fundamental objects
|
|
1112
|
-
"Object",
|
|
1113
|
-
"Function",
|
|
1114
|
-
"Boolean",
|
|
1115
|
-
"Symbol",
|
|
1116
|
-
// numbers and dates
|
|
1117
|
-
"Math",
|
|
1118
|
-
"Date",
|
|
1119
|
-
"Number",
|
|
1120
|
-
"BigInt",
|
|
1121
|
-
// text
|
|
1122
|
-
"String",
|
|
1123
|
-
"RegExp",
|
|
1124
|
-
// Indexed collections
|
|
1125
|
-
"Array",
|
|
1126
|
-
"Float32Array",
|
|
1127
|
-
"Float64Array",
|
|
1128
|
-
"Int8Array",
|
|
1129
|
-
"Uint8Array",
|
|
1130
|
-
"Uint8ClampedArray",
|
|
1131
|
-
"Int16Array",
|
|
1132
|
-
"Int32Array",
|
|
1133
|
-
"Uint16Array",
|
|
1134
|
-
"Uint32Array",
|
|
1135
|
-
"BigInt64Array",
|
|
1136
|
-
"BigUint64Array",
|
|
1137
|
-
// Keyed collections
|
|
1138
|
-
"Set",
|
|
1139
|
-
"Map",
|
|
1140
|
-
"WeakSet",
|
|
1141
|
-
"WeakMap",
|
|
1142
|
-
// Structured data
|
|
1143
|
-
"ArrayBuffer",
|
|
1144
|
-
"SharedArrayBuffer",
|
|
1145
|
-
"Atomics",
|
|
1146
|
-
"DataView",
|
|
1147
|
-
"JSON",
|
|
1148
|
-
// Control abstraction objects
|
|
1149
|
-
"Promise",
|
|
1150
|
-
"Generator",
|
|
1151
|
-
"GeneratorFunction",
|
|
1152
|
-
"AsyncFunction",
|
|
1153
|
-
// Reflection
|
|
1154
|
-
"Reflect",
|
|
1155
|
-
"Proxy",
|
|
1156
|
-
// Internationalization
|
|
1157
|
-
"Intl",
|
|
1158
|
-
// WebAssembly
|
|
1159
|
-
"WebAssembly"
|
|
1160
|
-
], Xe = [
|
|
1161
|
-
"Error",
|
|
1162
|
-
"EvalError",
|
|
1163
|
-
"InternalError",
|
|
1164
|
-
"RangeError",
|
|
1165
|
-
"ReferenceError",
|
|
1166
|
-
"SyntaxError",
|
|
1167
|
-
"TypeError",
|
|
1168
|
-
"URIError"
|
|
1169
|
-
], je = [
|
|
1170
|
-
"setInterval",
|
|
1171
|
-
"setTimeout",
|
|
1172
|
-
"clearInterval",
|
|
1173
|
-
"clearTimeout",
|
|
1174
|
-
"require",
|
|
1175
|
-
"exports",
|
|
1176
|
-
"eval",
|
|
1177
|
-
"isFinite",
|
|
1178
|
-
"isNaN",
|
|
1179
|
-
"parseFloat",
|
|
1180
|
-
"parseInt",
|
|
1181
|
-
"decodeURI",
|
|
1182
|
-
"decodeURIComponent",
|
|
1183
|
-
"encodeURI",
|
|
1184
|
-
"encodeURIComponent",
|
|
1185
|
-
"escape",
|
|
1186
|
-
"unescape"
|
|
1187
|
-
], at = [
|
|
1188
|
-
"arguments",
|
|
1189
|
-
"this",
|
|
1190
|
-
"super",
|
|
1191
|
-
"console",
|
|
1192
|
-
"window",
|
|
1193
|
-
"document",
|
|
1194
|
-
"localStorage",
|
|
1195
|
-
"sessionStorage",
|
|
1196
|
-
"module",
|
|
1197
|
-
"global"
|
|
1198
|
-
// Node.js
|
|
1199
|
-
], ct = [].concat(
|
|
1200
|
-
je,
|
|
1201
|
-
We,
|
|
1202
|
-
Xe
|
|
1203
|
-
);
|
|
1204
|
-
function gt(e) {
|
|
1205
|
-
const n = e.regex, s = (a, { after: g }) => {
|
|
1206
|
-
const E = "</" + a[0].slice(1);
|
|
1207
|
-
return a.input.indexOf(E, g) !== -1;
|
|
1208
|
-
}, r = Le, h = {
|
|
1209
|
-
begin: "<>",
|
|
1210
|
-
end: "</>"
|
|
1211
|
-
}, S = /<[A-Za-z0-9\\._:-]+\s*\/>/, c = {
|
|
1212
|
-
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
1213
|
-
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
1214
|
-
/**
|
|
1215
|
-
* @param {RegExpMatchArray} match
|
|
1216
|
-
* @param {CallbackResponse} response
|
|
1217
|
-
*/
|
|
1218
|
-
isTrulyOpeningTag: (a, g) => {
|
|
1219
|
-
const E = a[0].length + a.index, _ = a.input[E];
|
|
1220
|
-
if (
|
|
1221
|
-
// HTML should not include another raw `<` inside a tag
|
|
1222
|
-
// nested type?
|
|
1223
|
-
// `<Array<Array<number>>`, etc.
|
|
1224
|
-
_ === "<" || // the , gives away that this is not HTML
|
|
1225
|
-
// `<T, A extends keyof T, V>`
|
|
1226
|
-
_ === ","
|
|
1227
|
-
) {
|
|
1228
|
-
g.ignoreMatch();
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
_ === ">" && (s(a, { after: E }) || g.ignoreMatch());
|
|
1232
|
-
let T;
|
|
1233
|
-
const w = a.input.substring(E);
|
|
1234
|
-
if (T = w.match(/^\s*=/)) {
|
|
1235
|
-
g.ignoreMatch();
|
|
1236
|
-
return;
|
|
1237
|
-
}
|
|
1238
|
-
if ((T = w.match(/^\s+extends\s+/)) && T.index === 0) {
|
|
1239
|
-
g.ignoreMatch();
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}, i = {
|
|
1244
|
-
$pattern: Le,
|
|
1245
|
-
keyword: it,
|
|
1246
|
-
literal: rt,
|
|
1247
|
-
built_in: ct,
|
|
1248
|
-
"variable.language": at
|
|
1249
|
-
}, u = "[0-9](_?[0-9])*", b = `\\.(${u})`, p = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", I = {
|
|
1250
|
-
className: "number",
|
|
1251
|
-
variants: [
|
|
1252
|
-
// DecimalLiteral
|
|
1253
|
-
{ begin: `(\\b(${p})((${b})|\\.)?|(${b}))[eE][+-]?(${u})\\b` },
|
|
1254
|
-
{ begin: `\\b(${p})\\b((${b})\\b|\\.)?|(${b})\\b` },
|
|
1255
|
-
// DecimalBigIntegerLiteral
|
|
1256
|
-
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
1257
|
-
// NonDecimalIntegerLiteral
|
|
1258
|
-
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
1259
|
-
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
1260
|
-
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
1261
|
-
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
|
1262
|
-
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
|
1263
|
-
{ begin: "\\b0[0-7]+n?\\b" }
|
|
1264
|
-
],
|
|
1265
|
-
relevance: 0
|
|
1266
|
-
}, R = {
|
|
1267
|
-
className: "subst",
|
|
1268
|
-
begin: "\\$\\{",
|
|
1269
|
-
end: "\\}",
|
|
1270
|
-
keywords: i,
|
|
1271
|
-
contains: []
|
|
1272
|
-
// defined later
|
|
1273
|
-
}, y = {
|
|
1274
|
-
begin: ".?html`",
|
|
1275
|
-
end: "",
|
|
1276
|
-
starts: {
|
|
1277
|
-
end: "`",
|
|
1278
|
-
returnEnd: !1,
|
|
1279
|
-
contains: [
|
|
1280
|
-
e.BACKSLASH_ESCAPE,
|
|
1281
|
-
R
|
|
1282
|
-
],
|
|
1283
|
-
subLanguage: "xml"
|
|
1284
|
-
}
|
|
1285
|
-
}, U = {
|
|
1286
|
-
begin: ".?css`",
|
|
1287
|
-
end: "",
|
|
1288
|
-
starts: {
|
|
1289
|
-
end: "`",
|
|
1290
|
-
returnEnd: !1,
|
|
1291
|
-
contains: [
|
|
1292
|
-
e.BACKSLASH_ESCAPE,
|
|
1293
|
-
R
|
|
1294
|
-
],
|
|
1295
|
-
subLanguage: "css"
|
|
1296
|
-
}
|
|
1297
|
-
}, v = {
|
|
1298
|
-
begin: ".?gql`",
|
|
1299
|
-
end: "",
|
|
1300
|
-
starts: {
|
|
1301
|
-
end: "`",
|
|
1302
|
-
returnEnd: !1,
|
|
1303
|
-
contains: [
|
|
1304
|
-
e.BACKSLASH_ESCAPE,
|
|
1305
|
-
R
|
|
1306
|
-
],
|
|
1307
|
-
subLanguage: "graphql"
|
|
1308
|
-
}
|
|
1309
|
-
}, L = {
|
|
1310
|
-
className: "string",
|
|
1311
|
-
begin: "`",
|
|
1312
|
-
end: "`",
|
|
1313
|
-
contains: [
|
|
1314
|
-
e.BACKSLASH_ESCAPE,
|
|
1315
|
-
R
|
|
1316
|
-
]
|
|
1317
|
-
}, P = {
|
|
1318
|
-
className: "comment",
|
|
1319
|
-
variants: [
|
|
1320
|
-
e.COMMENT(
|
|
1321
|
-
/\/\*\*(?!\/)/,
|
|
1322
|
-
"\\*/",
|
|
1323
|
-
{
|
|
1324
|
-
relevance: 0,
|
|
1325
|
-
contains: [
|
|
1326
|
-
{
|
|
1327
|
-
begin: "(?=@[A-Za-z]+)",
|
|
1328
|
-
relevance: 0,
|
|
1329
|
-
contains: [
|
|
1330
|
-
{
|
|
1331
|
-
className: "doctag",
|
|
1332
|
-
begin: "@[A-Za-z]+"
|
|
1333
|
-
},
|
|
1334
|
-
{
|
|
1335
|
-
className: "type",
|
|
1336
|
-
begin: "\\{",
|
|
1337
|
-
end: "\\}",
|
|
1338
|
-
excludeEnd: !0,
|
|
1339
|
-
excludeBegin: !0,
|
|
1340
|
-
relevance: 0
|
|
1341
|
-
},
|
|
1342
|
-
{
|
|
1343
|
-
className: "variable",
|
|
1344
|
-
begin: r + "(?=\\s*(-)|$)",
|
|
1345
|
-
endsParent: !0,
|
|
1346
|
-
relevance: 0
|
|
1347
|
-
},
|
|
1348
|
-
// eat spaces (not newlines) so we can find
|
|
1349
|
-
// types or variables
|
|
1350
|
-
{
|
|
1351
|
-
begin: /(?=[^\n])\s/,
|
|
1352
|
-
relevance: 0
|
|
1353
|
-
}
|
|
1354
|
-
]
|
|
1355
|
-
}
|
|
1356
|
-
]
|
|
1357
|
-
}
|
|
1358
|
-
),
|
|
1359
|
-
e.C_BLOCK_COMMENT_MODE,
|
|
1360
|
-
e.C_LINE_COMMENT_MODE
|
|
1361
|
-
]
|
|
1362
|
-
}, G = [
|
|
1363
|
-
e.APOS_STRING_MODE,
|
|
1364
|
-
e.QUOTE_STRING_MODE,
|
|
1365
|
-
y,
|
|
1366
|
-
U,
|
|
1367
|
-
v,
|
|
1368
|
-
L,
|
|
1369
|
-
// Skip numbers when they are part of a variable name
|
|
1370
|
-
{ match: /\$\d+/ },
|
|
1371
|
-
I
|
|
1372
|
-
// This is intentional:
|
|
1373
|
-
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
1374
|
-
// hljs.REGEXP_MODE
|
|
1375
|
-
];
|
|
1376
|
-
R.contains = G.concat({
|
|
1377
|
-
// we need to pair up {} inside our subst to prevent
|
|
1378
|
-
// it from ending too early by matching another }
|
|
1379
|
-
begin: /\{/,
|
|
1380
|
-
end: /\}/,
|
|
1381
|
-
keywords: i,
|
|
1382
|
-
contains: [
|
|
1383
|
-
"self"
|
|
1384
|
-
].concat(G)
|
|
1385
|
-
});
|
|
1386
|
-
const k = [].concat(P, R.contains), $ = k.concat([
|
|
1387
|
-
// eat recursive parens in sub expressions
|
|
1388
|
-
{
|
|
1389
|
-
begin: /(\s*)\(/,
|
|
1390
|
-
end: /\)/,
|
|
1391
|
-
keywords: i,
|
|
1392
|
-
contains: ["self"].concat(k)
|
|
1393
|
-
}
|
|
1394
|
-
]), x = {
|
|
1395
|
-
className: "params",
|
|
1396
|
-
// convert this to negative lookbehind in v12
|
|
1397
|
-
begin: /(\s*)\(/,
|
|
1398
|
-
// to match the parms with
|
|
1399
|
-
end: /\)/,
|
|
1400
|
-
excludeBegin: !0,
|
|
1401
|
-
excludeEnd: !0,
|
|
1402
|
-
keywords: i,
|
|
1403
|
-
contains: $
|
|
1404
|
-
}, ee = {
|
|
1405
|
-
variants: [
|
|
1406
|
-
// class Car extends vehicle
|
|
1407
|
-
{
|
|
1408
|
-
match: [
|
|
1409
|
-
/class/,
|
|
1410
|
-
/\s+/,
|
|
1411
|
-
r,
|
|
1412
|
-
/\s+/,
|
|
1413
|
-
/extends/,
|
|
1414
|
-
/\s+/,
|
|
1415
|
-
n.concat(r, "(", n.concat(/\./, r), ")*")
|
|
1416
|
-
],
|
|
1417
|
-
scope: {
|
|
1418
|
-
1: "keyword",
|
|
1419
|
-
3: "title.class",
|
|
1420
|
-
5: "keyword",
|
|
1421
|
-
7: "title.class.inherited"
|
|
1422
|
-
}
|
|
1423
|
-
},
|
|
1424
|
-
// class Car
|
|
1425
|
-
{
|
|
1426
|
-
match: [
|
|
1427
|
-
/class/,
|
|
1428
|
-
/\s+/,
|
|
1429
|
-
r
|
|
1430
|
-
],
|
|
1431
|
-
scope: {
|
|
1432
|
-
1: "keyword",
|
|
1433
|
-
3: "title.class"
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
]
|
|
1437
|
-
}, Z = {
|
|
1438
|
-
relevance: 0,
|
|
1439
|
-
match: n.either(
|
|
1440
|
-
// Hard coded exceptions
|
|
1441
|
-
/\bJSON/,
|
|
1442
|
-
// Float32Array, OutT
|
|
1443
|
-
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
|
1444
|
-
// CSSFactory, CSSFactoryT
|
|
1445
|
-
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
|
1446
|
-
// FPs, FPsT
|
|
1447
|
-
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
|
1448
|
-
// P
|
|
1449
|
-
// single letters are not highlighted
|
|
1450
|
-
// BLAH
|
|
1451
|
-
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
|
1452
|
-
),
|
|
1453
|
-
className: "title.class",
|
|
1454
|
-
keywords: {
|
|
1455
|
-
_: [
|
|
1456
|
-
// se we still get relevance credit for JS library classes
|
|
1457
|
-
...We,
|
|
1458
|
-
...Xe
|
|
1459
|
-
]
|
|
1460
|
-
}
|
|
1461
|
-
}, m = {
|
|
1462
|
-
label: "use_strict",
|
|
1463
|
-
className: "meta",
|
|
1464
|
-
relevance: 10,
|
|
1465
|
-
begin: /^\s*['"]use (strict|asm)['"]/
|
|
1466
|
-
}, Y = {
|
|
1467
|
-
variants: [
|
|
1468
|
-
{
|
|
1469
|
-
match: [
|
|
1470
|
-
/function/,
|
|
1471
|
-
/\s+/,
|
|
1472
|
-
r,
|
|
1473
|
-
/(?=\s*\()/
|
|
1474
|
-
]
|
|
1475
|
-
},
|
|
1476
|
-
// anonymous function
|
|
1477
|
-
{
|
|
1478
|
-
match: [
|
|
1479
|
-
/function/,
|
|
1480
|
-
/\s*(?=\()/
|
|
1481
|
-
]
|
|
1482
|
-
}
|
|
1483
|
-
],
|
|
1484
|
-
className: {
|
|
1485
|
-
1: "keyword",
|
|
1486
|
-
3: "title.function"
|
|
1487
|
-
},
|
|
1488
|
-
label: "func.def",
|
|
1489
|
-
contains: [x],
|
|
1490
|
-
illegal: /%/
|
|
1491
|
-
}, J = {
|
|
1492
|
-
relevance: 0,
|
|
1493
|
-
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
1494
|
-
className: "variable.constant"
|
|
1495
|
-
};
|
|
1496
|
-
function ne(a) {
|
|
1497
|
-
return n.concat("(?!", a.join("|"), ")");
|
|
1498
|
-
}
|
|
1499
|
-
const te = {
|
|
1500
|
-
match: n.concat(
|
|
1501
|
-
/\b/,
|
|
1502
|
-
ne([
|
|
1503
|
-
...je,
|
|
1504
|
-
"super",
|
|
1505
|
-
"import"
|
|
1506
|
-
].map((a) => `${a}\\s*\\(`)),
|
|
1507
|
-
r,
|
|
1508
|
-
n.lookahead(/\s*\(/)
|
|
1509
|
-
),
|
|
1510
|
-
className: "title.function",
|
|
1511
|
-
relevance: 0
|
|
1512
|
-
}, se = {
|
|
1513
|
-
begin: n.concat(/\./, n.lookahead(
|
|
1514
|
-
n.concat(r, /(?![0-9A-Za-z$_(])/)
|
|
1515
|
-
)),
|
|
1516
|
-
end: r,
|
|
1517
|
-
excludeBegin: !0,
|
|
1518
|
-
keywords: "prototype",
|
|
1519
|
-
className: "property",
|
|
1520
|
-
relevance: 0
|
|
1521
|
-
}, F = {
|
|
1522
|
-
match: [
|
|
1523
|
-
/get|set/,
|
|
1524
|
-
/\s+/,
|
|
1525
|
-
r,
|
|
1526
|
-
/(?=\()/
|
|
1527
|
-
],
|
|
1528
|
-
className: {
|
|
1529
|
-
1: "keyword",
|
|
1530
|
-
3: "title.function"
|
|
1531
|
-
},
|
|
1532
|
-
contains: [
|
|
1533
|
-
{
|
|
1534
|
-
// eat to avoid empty params
|
|
1535
|
-
begin: /\(\)/
|
|
1536
|
-
},
|
|
1537
|
-
x
|
|
1538
|
-
]
|
|
1539
|
-
}, K = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", t = {
|
|
1540
|
-
match: [
|
|
1541
|
-
/const|var|let/,
|
|
1542
|
-
/\s+/,
|
|
1543
|
-
r,
|
|
1544
|
-
/\s*/,
|
|
1545
|
-
/=\s*/,
|
|
1546
|
-
/(async\s*)?/,
|
|
1547
|
-
// async is optional
|
|
1548
|
-
n.lookahead(K)
|
|
1549
|
-
],
|
|
1550
|
-
keywords: "async",
|
|
1551
|
-
className: {
|
|
1552
|
-
1: "keyword",
|
|
1553
|
-
3: "title.function"
|
|
1554
|
-
},
|
|
1555
|
-
contains: [
|
|
1556
|
-
x
|
|
1557
|
-
]
|
|
1558
|
-
};
|
|
1559
|
-
return {
|
|
1560
|
-
name: "JavaScript",
|
|
1561
|
-
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
1562
|
-
keywords: i,
|
|
1563
|
-
// this will be extended by TypeScript
|
|
1564
|
-
exports: { PARAMS_CONTAINS: $, CLASS_REFERENCE: Z },
|
|
1565
|
-
illegal: /#(?![$_A-z])/,
|
|
1566
|
-
contains: [
|
|
1567
|
-
e.SHEBANG({
|
|
1568
|
-
label: "shebang",
|
|
1569
|
-
binary: "node",
|
|
1570
|
-
relevance: 5
|
|
1571
|
-
}),
|
|
1572
|
-
m,
|
|
1573
|
-
e.APOS_STRING_MODE,
|
|
1574
|
-
e.QUOTE_STRING_MODE,
|
|
1575
|
-
y,
|
|
1576
|
-
U,
|
|
1577
|
-
v,
|
|
1578
|
-
L,
|
|
1579
|
-
P,
|
|
1580
|
-
// Skip numbers when they are part of a variable name
|
|
1581
|
-
{ match: /\$\d+/ },
|
|
1582
|
-
I,
|
|
1583
|
-
Z,
|
|
1584
|
-
{
|
|
1585
|
-
className: "attr",
|
|
1586
|
-
begin: r + n.lookahead(":"),
|
|
1587
|
-
relevance: 0
|
|
1588
|
-
},
|
|
1589
|
-
t,
|
|
1590
|
-
{
|
|
1591
|
-
// "value" container
|
|
1592
|
-
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
1593
|
-
keywords: "return throw case",
|
|
1594
|
-
relevance: 0,
|
|
1595
|
-
contains: [
|
|
1596
|
-
P,
|
|
1597
|
-
e.REGEXP_MODE,
|
|
1598
|
-
{
|
|
1599
|
-
className: "function",
|
|
1600
|
-
// we have to count the parens to make sure we actually have the
|
|
1601
|
-
// correct bounding ( ) before the =>. There could be any number of
|
|
1602
|
-
// sub-expressions inside also surrounded by parens.
|
|
1603
|
-
begin: K,
|
|
1604
|
-
returnBegin: !0,
|
|
1605
|
-
end: "\\s*=>",
|
|
1606
|
-
contains: [
|
|
1607
|
-
{
|
|
1608
|
-
className: "params",
|
|
1609
|
-
variants: [
|
|
1610
|
-
{
|
|
1611
|
-
begin: e.UNDERSCORE_IDENT_RE,
|
|
1612
|
-
relevance: 0
|
|
1613
|
-
},
|
|
1614
|
-
{
|
|
1615
|
-
className: null,
|
|
1616
|
-
begin: /\(\s*\)/,
|
|
1617
|
-
skip: !0
|
|
1618
|
-
},
|
|
1619
|
-
{
|
|
1620
|
-
begin: /(\s*)\(/,
|
|
1621
|
-
end: /\)/,
|
|
1622
|
-
excludeBegin: !0,
|
|
1623
|
-
excludeEnd: !0,
|
|
1624
|
-
keywords: i,
|
|
1625
|
-
contains: $
|
|
1626
|
-
}
|
|
1627
|
-
]
|
|
1628
|
-
}
|
|
1629
|
-
]
|
|
1630
|
-
},
|
|
1631
|
-
{
|
|
1632
|
-
// could be a comma delimited list of params to a function call
|
|
1633
|
-
begin: /,/,
|
|
1634
|
-
relevance: 0
|
|
1635
|
-
},
|
|
1636
|
-
{
|
|
1637
|
-
match: /\s+/,
|
|
1638
|
-
relevance: 0
|
|
1639
|
-
},
|
|
1640
|
-
{
|
|
1641
|
-
// JSX
|
|
1642
|
-
variants: [
|
|
1643
|
-
{ begin: h.begin, end: h.end },
|
|
1644
|
-
{ match: S },
|
|
1645
|
-
{
|
|
1646
|
-
begin: c.begin,
|
|
1647
|
-
// we carefully check the opening tag to see if it truly
|
|
1648
|
-
// is a tag and not a false positive
|
|
1649
|
-
"on:begin": c.isTrulyOpeningTag,
|
|
1650
|
-
end: c.end
|
|
1651
|
-
}
|
|
1652
|
-
],
|
|
1653
|
-
subLanguage: "xml",
|
|
1654
|
-
contains: [
|
|
1655
|
-
{
|
|
1656
|
-
begin: c.begin,
|
|
1657
|
-
end: c.end,
|
|
1658
|
-
skip: !0,
|
|
1659
|
-
contains: ["self"]
|
|
1660
|
-
}
|
|
1661
|
-
]
|
|
1662
|
-
}
|
|
1663
|
-
]
|
|
1664
|
-
},
|
|
1665
|
-
Y,
|
|
1666
|
-
{
|
|
1667
|
-
// prevent this from getting swallowed up by function
|
|
1668
|
-
// since they appear "function like"
|
|
1669
|
-
beginKeywords: "while if switch catch for"
|
|
1670
|
-
},
|
|
1671
|
-
{
|
|
1672
|
-
// we have to count the parens to make sure we actually have the correct
|
|
1673
|
-
// bounding ( ). There could be any number of sub-expressions inside
|
|
1674
|
-
// also surrounded by parens.
|
|
1675
|
-
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
1676
|
-
// end parens
|
|
1677
|
-
returnBegin: !0,
|
|
1678
|
-
label: "func.def",
|
|
1679
|
-
contains: [
|
|
1680
|
-
x,
|
|
1681
|
-
e.inherit(e.TITLE_MODE, { begin: r, className: "title.function" })
|
|
1682
|
-
]
|
|
1683
|
-
},
|
|
1684
|
-
// catch ... so it won't trigger the property rule below
|
|
1685
|
-
{
|
|
1686
|
-
match: /\.\.\./,
|
|
1687
|
-
relevance: 0
|
|
1688
|
-
},
|
|
1689
|
-
se,
|
|
1690
|
-
// hack: prevents detection of keywords in some circumstances
|
|
1691
|
-
// .keyword()
|
|
1692
|
-
// $keyword = x
|
|
1693
|
-
{
|
|
1694
|
-
match: "\\$" + r,
|
|
1695
|
-
relevance: 0
|
|
1696
|
-
},
|
|
1697
|
-
{
|
|
1698
|
-
match: [/\bconstructor(?=\s*\()/],
|
|
1699
|
-
className: { 1: "title.function" },
|
|
1700
|
-
contains: [x]
|
|
1701
|
-
},
|
|
1702
|
-
te,
|
|
1703
|
-
J,
|
|
1704
|
-
ee,
|
|
1705
|
-
F,
|
|
1706
|
-
{
|
|
1707
|
-
match: /\$[(.]/
|
|
1708
|
-
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
1709
|
-
}
|
|
1710
|
-
]
|
|
1711
|
-
};
|
|
1712
|
-
}
|
|
1713
|
-
function ft(e) {
|
|
1714
|
-
const n = {
|
|
1715
|
-
className: "attr",
|
|
1716
|
-
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
1717
|
-
relevance: 1.01
|
|
1718
|
-
}, s = {
|
|
1719
|
-
match: /[{}[\],:]/,
|
|
1720
|
-
className: "punctuation",
|
|
1721
|
-
relevance: 0
|
|
1722
|
-
}, r = [
|
|
1723
|
-
"true",
|
|
1724
|
-
"false",
|
|
1725
|
-
"null"
|
|
1726
|
-
], h = {
|
|
1727
|
-
scope: "literal",
|
|
1728
|
-
beginKeywords: r.join(" ")
|
|
1729
|
-
};
|
|
1730
|
-
return {
|
|
1731
|
-
name: "JSON",
|
|
1732
|
-
aliases: ["jsonc"],
|
|
1733
|
-
keywords: {
|
|
1734
|
-
literal: r
|
|
1735
|
-
},
|
|
1736
|
-
contains: [
|
|
1737
|
-
n,
|
|
1738
|
-
s,
|
|
1739
|
-
e.QUOTE_STRING_MODE,
|
|
1740
|
-
h,
|
|
1741
|
-
e.C_NUMBER_MODE,
|
|
1742
|
-
e.C_LINE_COMMENT_MODE,
|
|
1743
|
-
e.C_BLOCK_COMMENT_MODE
|
|
1744
|
-
],
|
|
1745
|
-
illegal: "\\S"
|
|
1746
|
-
};
|
|
1747
|
-
}
|
|
1748
|
-
const ge = "[A-Za-z$_][0-9A-Za-z$_]*", Ye = [
|
|
1749
|
-
"as",
|
|
1750
|
-
// for exports
|
|
1751
|
-
"in",
|
|
1752
|
-
"of",
|
|
1753
|
-
"if",
|
|
1754
|
-
"for",
|
|
1755
|
-
"while",
|
|
1756
|
-
"finally",
|
|
1757
|
-
"var",
|
|
1758
|
-
"new",
|
|
1759
|
-
"function",
|
|
1760
|
-
"do",
|
|
1761
|
-
"return",
|
|
1762
|
-
"void",
|
|
1763
|
-
"else",
|
|
1764
|
-
"break",
|
|
1765
|
-
"catch",
|
|
1766
|
-
"instanceof",
|
|
1767
|
-
"with",
|
|
1768
|
-
"throw",
|
|
1769
|
-
"case",
|
|
1770
|
-
"default",
|
|
1771
|
-
"try",
|
|
1772
|
-
"switch",
|
|
1773
|
-
"continue",
|
|
1774
|
-
"typeof",
|
|
1775
|
-
"delete",
|
|
1776
|
-
"let",
|
|
1777
|
-
"yield",
|
|
1778
|
-
"const",
|
|
1779
|
-
"class",
|
|
1780
|
-
// JS handles these with a special rule
|
|
1781
|
-
// "get",
|
|
1782
|
-
// "set",
|
|
1783
|
-
"debugger",
|
|
1784
|
-
"async",
|
|
1785
|
-
"await",
|
|
1786
|
-
"static",
|
|
1787
|
-
"import",
|
|
1788
|
-
"from",
|
|
1789
|
-
"export",
|
|
1790
|
-
"extends"
|
|
1791
|
-
], Je = [
|
|
1792
|
-
"true",
|
|
1793
|
-
"false",
|
|
1794
|
-
"null",
|
|
1795
|
-
"undefined",
|
|
1796
|
-
"NaN",
|
|
1797
|
-
"Infinity"
|
|
1798
|
-
], Ve = [
|
|
1799
|
-
// Fundamental objects
|
|
1800
|
-
"Object",
|
|
1801
|
-
"Function",
|
|
1802
|
-
"Boolean",
|
|
1803
|
-
"Symbol",
|
|
1804
|
-
// numbers and dates
|
|
1805
|
-
"Math",
|
|
1806
|
-
"Date",
|
|
1807
|
-
"Number",
|
|
1808
|
-
"BigInt",
|
|
1809
|
-
// text
|
|
1810
|
-
"String",
|
|
1811
|
-
"RegExp",
|
|
1812
|
-
// Indexed collections
|
|
1813
|
-
"Array",
|
|
1814
|
-
"Float32Array",
|
|
1815
|
-
"Float64Array",
|
|
1816
|
-
"Int8Array",
|
|
1817
|
-
"Uint8Array",
|
|
1818
|
-
"Uint8ClampedArray",
|
|
1819
|
-
"Int16Array",
|
|
1820
|
-
"Int32Array",
|
|
1821
|
-
"Uint16Array",
|
|
1822
|
-
"Uint32Array",
|
|
1823
|
-
"BigInt64Array",
|
|
1824
|
-
"BigUint64Array",
|
|
1825
|
-
// Keyed collections
|
|
1826
|
-
"Set",
|
|
1827
|
-
"Map",
|
|
1828
|
-
"WeakSet",
|
|
1829
|
-
"WeakMap",
|
|
1830
|
-
// Structured data
|
|
1831
|
-
"ArrayBuffer",
|
|
1832
|
-
"SharedArrayBuffer",
|
|
1833
|
-
"Atomics",
|
|
1834
|
-
"DataView",
|
|
1835
|
-
"JSON",
|
|
1836
|
-
// Control abstraction objects
|
|
1837
|
-
"Promise",
|
|
1838
|
-
"Generator",
|
|
1839
|
-
"GeneratorFunction",
|
|
1840
|
-
"AsyncFunction",
|
|
1841
|
-
// Reflection
|
|
1842
|
-
"Reflect",
|
|
1843
|
-
"Proxy",
|
|
1844
|
-
// Internationalization
|
|
1845
|
-
"Intl",
|
|
1846
|
-
// WebAssembly
|
|
1847
|
-
"WebAssembly"
|
|
1848
|
-
], Qe = [
|
|
1849
|
-
"Error",
|
|
1850
|
-
"EvalError",
|
|
1851
|
-
"InternalError",
|
|
1852
|
-
"RangeError",
|
|
1853
|
-
"ReferenceError",
|
|
1854
|
-
"SyntaxError",
|
|
1855
|
-
"TypeError",
|
|
1856
|
-
"URIError"
|
|
1857
|
-
], qe = [
|
|
1858
|
-
"setInterval",
|
|
1859
|
-
"setTimeout",
|
|
1860
|
-
"clearInterval",
|
|
1861
|
-
"clearTimeout",
|
|
1862
|
-
"require",
|
|
1863
|
-
"exports",
|
|
1864
|
-
"eval",
|
|
1865
|
-
"isFinite",
|
|
1866
|
-
"isNaN",
|
|
1867
|
-
"parseFloat",
|
|
1868
|
-
"parseInt",
|
|
1869
|
-
"decodeURI",
|
|
1870
|
-
"decodeURIComponent",
|
|
1871
|
-
"encodeURI",
|
|
1872
|
-
"encodeURIComponent",
|
|
1873
|
-
"escape",
|
|
1874
|
-
"unescape"
|
|
1875
|
-
], en = [
|
|
1876
|
-
"arguments",
|
|
1877
|
-
"this",
|
|
1878
|
-
"super",
|
|
1879
|
-
"console",
|
|
1880
|
-
"window",
|
|
1881
|
-
"document",
|
|
1882
|
-
"localStorage",
|
|
1883
|
-
"sessionStorage",
|
|
1884
|
-
"module",
|
|
1885
|
-
"global"
|
|
1886
|
-
// Node.js
|
|
1887
|
-
], nn = [].concat(
|
|
1888
|
-
qe,
|
|
1889
|
-
Ve,
|
|
1890
|
-
Qe
|
|
1891
|
-
);
|
|
1892
|
-
function ot(e) {
|
|
1893
|
-
const n = e.regex, s = (a, { after: g }) => {
|
|
1894
|
-
const E = "</" + a[0].slice(1);
|
|
1895
|
-
return a.input.indexOf(E, g) !== -1;
|
|
1896
|
-
}, r = ge, h = {
|
|
1897
|
-
begin: "<>",
|
|
1898
|
-
end: "</>"
|
|
1899
|
-
}, S = /<[A-Za-z0-9\\._:-]+\s*\/>/, c = {
|
|
1900
|
-
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
1901
|
-
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
1902
|
-
/**
|
|
1903
|
-
* @param {RegExpMatchArray} match
|
|
1904
|
-
* @param {CallbackResponse} response
|
|
1905
|
-
*/
|
|
1906
|
-
isTrulyOpeningTag: (a, g) => {
|
|
1907
|
-
const E = a[0].length + a.index, _ = a.input[E];
|
|
1908
|
-
if (
|
|
1909
|
-
// HTML should not include another raw `<` inside a tag
|
|
1910
|
-
// nested type?
|
|
1911
|
-
// `<Array<Array<number>>`, etc.
|
|
1912
|
-
_ === "<" || // the , gives away that this is not HTML
|
|
1913
|
-
// `<T, A extends keyof T, V>`
|
|
1914
|
-
_ === ","
|
|
1915
|
-
) {
|
|
1916
|
-
g.ignoreMatch();
|
|
1917
|
-
return;
|
|
1918
|
-
}
|
|
1919
|
-
_ === ">" && (s(a, { after: E }) || g.ignoreMatch());
|
|
1920
|
-
let T;
|
|
1921
|
-
const w = a.input.substring(E);
|
|
1922
|
-
if (T = w.match(/^\s*=/)) {
|
|
1923
|
-
g.ignoreMatch();
|
|
1924
|
-
return;
|
|
1925
|
-
}
|
|
1926
|
-
if ((T = w.match(/^\s+extends\s+/)) && T.index === 0) {
|
|
1927
|
-
g.ignoreMatch();
|
|
1928
|
-
return;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
}, i = {
|
|
1932
|
-
$pattern: ge,
|
|
1933
|
-
keyword: Ye,
|
|
1934
|
-
literal: Je,
|
|
1935
|
-
built_in: nn,
|
|
1936
|
-
"variable.language": en
|
|
1937
|
-
}, u = "[0-9](_?[0-9])*", b = `\\.(${u})`, p = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", I = {
|
|
1938
|
-
className: "number",
|
|
1939
|
-
variants: [
|
|
1940
|
-
// DecimalLiteral
|
|
1941
|
-
{ begin: `(\\b(${p})((${b})|\\.)?|(${b}))[eE][+-]?(${u})\\b` },
|
|
1942
|
-
{ begin: `\\b(${p})\\b((${b})\\b|\\.)?|(${b})\\b` },
|
|
1943
|
-
// DecimalBigIntegerLiteral
|
|
1944
|
-
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
1945
|
-
// NonDecimalIntegerLiteral
|
|
1946
|
-
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
1947
|
-
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
1948
|
-
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
1949
|
-
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
|
1950
|
-
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
|
1951
|
-
{ begin: "\\b0[0-7]+n?\\b" }
|
|
1952
|
-
],
|
|
1953
|
-
relevance: 0
|
|
1954
|
-
}, R = {
|
|
1955
|
-
className: "subst",
|
|
1956
|
-
begin: "\\$\\{",
|
|
1957
|
-
end: "\\}",
|
|
1958
|
-
keywords: i,
|
|
1959
|
-
contains: []
|
|
1960
|
-
// defined later
|
|
1961
|
-
}, y = {
|
|
1962
|
-
begin: ".?html`",
|
|
1963
|
-
end: "",
|
|
1964
|
-
starts: {
|
|
1965
|
-
end: "`",
|
|
1966
|
-
returnEnd: !1,
|
|
1967
|
-
contains: [
|
|
1968
|
-
e.BACKSLASH_ESCAPE,
|
|
1969
|
-
R
|
|
1970
|
-
],
|
|
1971
|
-
subLanguage: "xml"
|
|
1972
|
-
}
|
|
1973
|
-
}, U = {
|
|
1974
|
-
begin: ".?css`",
|
|
1975
|
-
end: "",
|
|
1976
|
-
starts: {
|
|
1977
|
-
end: "`",
|
|
1978
|
-
returnEnd: !1,
|
|
1979
|
-
contains: [
|
|
1980
|
-
e.BACKSLASH_ESCAPE,
|
|
1981
|
-
R
|
|
1982
|
-
],
|
|
1983
|
-
subLanguage: "css"
|
|
1984
|
-
}
|
|
1985
|
-
}, v = {
|
|
1986
|
-
begin: ".?gql`",
|
|
1987
|
-
end: "",
|
|
1988
|
-
starts: {
|
|
1989
|
-
end: "`",
|
|
1990
|
-
returnEnd: !1,
|
|
1991
|
-
contains: [
|
|
1992
|
-
e.BACKSLASH_ESCAPE,
|
|
1993
|
-
R
|
|
1994
|
-
],
|
|
1995
|
-
subLanguage: "graphql"
|
|
1996
|
-
}
|
|
1997
|
-
}, L = {
|
|
1998
|
-
className: "string",
|
|
1999
|
-
begin: "`",
|
|
2000
|
-
end: "`",
|
|
2001
|
-
contains: [
|
|
2002
|
-
e.BACKSLASH_ESCAPE,
|
|
2003
|
-
R
|
|
2004
|
-
]
|
|
2005
|
-
}, P = {
|
|
2006
|
-
className: "comment",
|
|
2007
|
-
variants: [
|
|
2008
|
-
e.COMMENT(
|
|
2009
|
-
/\/\*\*(?!\/)/,
|
|
2010
|
-
"\\*/",
|
|
2011
|
-
{
|
|
2012
|
-
relevance: 0,
|
|
2013
|
-
contains: [
|
|
2014
|
-
{
|
|
2015
|
-
begin: "(?=@[A-Za-z]+)",
|
|
2016
|
-
relevance: 0,
|
|
2017
|
-
contains: [
|
|
2018
|
-
{
|
|
2019
|
-
className: "doctag",
|
|
2020
|
-
begin: "@[A-Za-z]+"
|
|
2021
|
-
},
|
|
2022
|
-
{
|
|
2023
|
-
className: "type",
|
|
2024
|
-
begin: "\\{",
|
|
2025
|
-
end: "\\}",
|
|
2026
|
-
excludeEnd: !0,
|
|
2027
|
-
excludeBegin: !0,
|
|
2028
|
-
relevance: 0
|
|
2029
|
-
},
|
|
2030
|
-
{
|
|
2031
|
-
className: "variable",
|
|
2032
|
-
begin: r + "(?=\\s*(-)|$)",
|
|
2033
|
-
endsParent: !0,
|
|
2034
|
-
relevance: 0
|
|
2035
|
-
},
|
|
2036
|
-
// eat spaces (not newlines) so we can find
|
|
2037
|
-
// types or variables
|
|
2038
|
-
{
|
|
2039
|
-
begin: /(?=[^\n])\s/,
|
|
2040
|
-
relevance: 0
|
|
2041
|
-
}
|
|
2042
|
-
]
|
|
2043
|
-
}
|
|
2044
|
-
]
|
|
2045
|
-
}
|
|
2046
|
-
),
|
|
2047
|
-
e.C_BLOCK_COMMENT_MODE,
|
|
2048
|
-
e.C_LINE_COMMENT_MODE
|
|
2049
|
-
]
|
|
2050
|
-
}, G = [
|
|
2051
|
-
e.APOS_STRING_MODE,
|
|
2052
|
-
e.QUOTE_STRING_MODE,
|
|
2053
|
-
y,
|
|
2054
|
-
U,
|
|
2055
|
-
v,
|
|
2056
|
-
L,
|
|
2057
|
-
// Skip numbers when they are part of a variable name
|
|
2058
|
-
{ match: /\$\d+/ },
|
|
2059
|
-
I
|
|
2060
|
-
// This is intentional:
|
|
2061
|
-
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
2062
|
-
// hljs.REGEXP_MODE
|
|
2063
|
-
];
|
|
2064
|
-
R.contains = G.concat({
|
|
2065
|
-
// we need to pair up {} inside our subst to prevent
|
|
2066
|
-
// it from ending too early by matching another }
|
|
2067
|
-
begin: /\{/,
|
|
2068
|
-
end: /\}/,
|
|
2069
|
-
keywords: i,
|
|
2070
|
-
contains: [
|
|
2071
|
-
"self"
|
|
2072
|
-
].concat(G)
|
|
2073
|
-
});
|
|
2074
|
-
const k = [].concat(P, R.contains), $ = k.concat([
|
|
2075
|
-
// eat recursive parens in sub expressions
|
|
2076
|
-
{
|
|
2077
|
-
begin: /(\s*)\(/,
|
|
2078
|
-
end: /\)/,
|
|
2079
|
-
keywords: i,
|
|
2080
|
-
contains: ["self"].concat(k)
|
|
2081
|
-
}
|
|
2082
|
-
]), x = {
|
|
2083
|
-
className: "params",
|
|
2084
|
-
// convert this to negative lookbehind in v12
|
|
2085
|
-
begin: /(\s*)\(/,
|
|
2086
|
-
// to match the parms with
|
|
2087
|
-
end: /\)/,
|
|
2088
|
-
excludeBegin: !0,
|
|
2089
|
-
excludeEnd: !0,
|
|
2090
|
-
keywords: i,
|
|
2091
|
-
contains: $
|
|
2092
|
-
}, ee = {
|
|
2093
|
-
variants: [
|
|
2094
|
-
// class Car extends vehicle
|
|
2095
|
-
{
|
|
2096
|
-
match: [
|
|
2097
|
-
/class/,
|
|
2098
|
-
/\s+/,
|
|
2099
|
-
r,
|
|
2100
|
-
/\s+/,
|
|
2101
|
-
/extends/,
|
|
2102
|
-
/\s+/,
|
|
2103
|
-
n.concat(r, "(", n.concat(/\./, r), ")*")
|
|
2104
|
-
],
|
|
2105
|
-
scope: {
|
|
2106
|
-
1: "keyword",
|
|
2107
|
-
3: "title.class",
|
|
2108
|
-
5: "keyword",
|
|
2109
|
-
7: "title.class.inherited"
|
|
2110
|
-
}
|
|
2111
|
-
},
|
|
2112
|
-
// class Car
|
|
2113
|
-
{
|
|
2114
|
-
match: [
|
|
2115
|
-
/class/,
|
|
2116
|
-
/\s+/,
|
|
2117
|
-
r
|
|
2118
|
-
],
|
|
2119
|
-
scope: {
|
|
2120
|
-
1: "keyword",
|
|
2121
|
-
3: "title.class"
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
]
|
|
2125
|
-
}, Z = {
|
|
2126
|
-
relevance: 0,
|
|
2127
|
-
match: n.either(
|
|
2128
|
-
// Hard coded exceptions
|
|
2129
|
-
/\bJSON/,
|
|
2130
|
-
// Float32Array, OutT
|
|
2131
|
-
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
|
2132
|
-
// CSSFactory, CSSFactoryT
|
|
2133
|
-
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
|
2134
|
-
// FPs, FPsT
|
|
2135
|
-
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
|
2136
|
-
// P
|
|
2137
|
-
// single letters are not highlighted
|
|
2138
|
-
// BLAH
|
|
2139
|
-
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
|
2140
|
-
),
|
|
2141
|
-
className: "title.class",
|
|
2142
|
-
keywords: {
|
|
2143
|
-
_: [
|
|
2144
|
-
// se we still get relevance credit for JS library classes
|
|
2145
|
-
...Ve,
|
|
2146
|
-
...Qe
|
|
2147
|
-
]
|
|
2148
|
-
}
|
|
2149
|
-
}, m = {
|
|
2150
|
-
label: "use_strict",
|
|
2151
|
-
className: "meta",
|
|
2152
|
-
relevance: 10,
|
|
2153
|
-
begin: /^\s*['"]use (strict|asm)['"]/
|
|
2154
|
-
}, Y = {
|
|
2155
|
-
variants: [
|
|
2156
|
-
{
|
|
2157
|
-
match: [
|
|
2158
|
-
/function/,
|
|
2159
|
-
/\s+/,
|
|
2160
|
-
r,
|
|
2161
|
-
/(?=\s*\()/
|
|
2162
|
-
]
|
|
2163
|
-
},
|
|
2164
|
-
// anonymous function
|
|
2165
|
-
{
|
|
2166
|
-
match: [
|
|
2167
|
-
/function/,
|
|
2168
|
-
/\s*(?=\()/
|
|
2169
|
-
]
|
|
2170
|
-
}
|
|
2171
|
-
],
|
|
2172
|
-
className: {
|
|
2173
|
-
1: "keyword",
|
|
2174
|
-
3: "title.function"
|
|
2175
|
-
},
|
|
2176
|
-
label: "func.def",
|
|
2177
|
-
contains: [x],
|
|
2178
|
-
illegal: /%/
|
|
2179
|
-
}, J = {
|
|
2180
|
-
relevance: 0,
|
|
2181
|
-
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
2182
|
-
className: "variable.constant"
|
|
2183
|
-
};
|
|
2184
|
-
function ne(a) {
|
|
2185
|
-
return n.concat("(?!", a.join("|"), ")");
|
|
2186
|
-
}
|
|
2187
|
-
const te = {
|
|
2188
|
-
match: n.concat(
|
|
2189
|
-
/\b/,
|
|
2190
|
-
ne([
|
|
2191
|
-
...qe,
|
|
2192
|
-
"super",
|
|
2193
|
-
"import"
|
|
2194
|
-
].map((a) => `${a}\\s*\\(`)),
|
|
2195
|
-
r,
|
|
2196
|
-
n.lookahead(/\s*\(/)
|
|
2197
|
-
),
|
|
2198
|
-
className: "title.function",
|
|
2199
|
-
relevance: 0
|
|
2200
|
-
}, se = {
|
|
2201
|
-
begin: n.concat(/\./, n.lookahead(
|
|
2202
|
-
n.concat(r, /(?![0-9A-Za-z$_(])/)
|
|
2203
|
-
)),
|
|
2204
|
-
end: r,
|
|
2205
|
-
excludeBegin: !0,
|
|
2206
|
-
keywords: "prototype",
|
|
2207
|
-
className: "property",
|
|
2208
|
-
relevance: 0
|
|
2209
|
-
}, F = {
|
|
2210
|
-
match: [
|
|
2211
|
-
/get|set/,
|
|
2212
|
-
/\s+/,
|
|
2213
|
-
r,
|
|
2214
|
-
/(?=\()/
|
|
2215
|
-
],
|
|
2216
|
-
className: {
|
|
2217
|
-
1: "keyword",
|
|
2218
|
-
3: "title.function"
|
|
2219
|
-
},
|
|
2220
|
-
contains: [
|
|
2221
|
-
{
|
|
2222
|
-
// eat to avoid empty params
|
|
2223
|
-
begin: /\(\)/
|
|
2224
|
-
},
|
|
2225
|
-
x
|
|
2226
|
-
]
|
|
2227
|
-
}, K = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", t = {
|
|
2228
|
-
match: [
|
|
2229
|
-
/const|var|let/,
|
|
2230
|
-
/\s+/,
|
|
2231
|
-
r,
|
|
2232
|
-
/\s*/,
|
|
2233
|
-
/=\s*/,
|
|
2234
|
-
/(async\s*)?/,
|
|
2235
|
-
// async is optional
|
|
2236
|
-
n.lookahead(K)
|
|
2237
|
-
],
|
|
2238
|
-
keywords: "async",
|
|
2239
|
-
className: {
|
|
2240
|
-
1: "keyword",
|
|
2241
|
-
3: "title.function"
|
|
2242
|
-
},
|
|
2243
|
-
contains: [
|
|
2244
|
-
x
|
|
2245
|
-
]
|
|
2246
|
-
};
|
|
2247
|
-
return {
|
|
2248
|
-
name: "JavaScript",
|
|
2249
|
-
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
2250
|
-
keywords: i,
|
|
2251
|
-
// this will be extended by TypeScript
|
|
2252
|
-
exports: { PARAMS_CONTAINS: $, CLASS_REFERENCE: Z },
|
|
2253
|
-
illegal: /#(?![$_A-z])/,
|
|
2254
|
-
contains: [
|
|
2255
|
-
e.SHEBANG({
|
|
2256
|
-
label: "shebang",
|
|
2257
|
-
binary: "node",
|
|
2258
|
-
relevance: 5
|
|
2259
|
-
}),
|
|
2260
|
-
m,
|
|
2261
|
-
e.APOS_STRING_MODE,
|
|
2262
|
-
e.QUOTE_STRING_MODE,
|
|
2263
|
-
y,
|
|
2264
|
-
U,
|
|
2265
|
-
v,
|
|
2266
|
-
L,
|
|
2267
|
-
P,
|
|
2268
|
-
// Skip numbers when they are part of a variable name
|
|
2269
|
-
{ match: /\$\d+/ },
|
|
2270
|
-
I,
|
|
2271
|
-
Z,
|
|
2272
|
-
{
|
|
2273
|
-
className: "attr",
|
|
2274
|
-
begin: r + n.lookahead(":"),
|
|
2275
|
-
relevance: 0
|
|
2276
|
-
},
|
|
2277
|
-
t,
|
|
2278
|
-
{
|
|
2279
|
-
// "value" container
|
|
2280
|
-
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
2281
|
-
keywords: "return throw case",
|
|
2282
|
-
relevance: 0,
|
|
2283
|
-
contains: [
|
|
2284
|
-
P,
|
|
2285
|
-
e.REGEXP_MODE,
|
|
2286
|
-
{
|
|
2287
|
-
className: "function",
|
|
2288
|
-
// we have to count the parens to make sure we actually have the
|
|
2289
|
-
// correct bounding ( ) before the =>. There could be any number of
|
|
2290
|
-
// sub-expressions inside also surrounded by parens.
|
|
2291
|
-
begin: K,
|
|
2292
|
-
returnBegin: !0,
|
|
2293
|
-
end: "\\s*=>",
|
|
2294
|
-
contains: [
|
|
2295
|
-
{
|
|
2296
|
-
className: "params",
|
|
2297
|
-
variants: [
|
|
2298
|
-
{
|
|
2299
|
-
begin: e.UNDERSCORE_IDENT_RE,
|
|
2300
|
-
relevance: 0
|
|
2301
|
-
},
|
|
2302
|
-
{
|
|
2303
|
-
className: null,
|
|
2304
|
-
begin: /\(\s*\)/,
|
|
2305
|
-
skip: !0
|
|
2306
|
-
},
|
|
2307
|
-
{
|
|
2308
|
-
begin: /(\s*)\(/,
|
|
2309
|
-
end: /\)/,
|
|
2310
|
-
excludeBegin: !0,
|
|
2311
|
-
excludeEnd: !0,
|
|
2312
|
-
keywords: i,
|
|
2313
|
-
contains: $
|
|
2314
|
-
}
|
|
2315
|
-
]
|
|
2316
|
-
}
|
|
2317
|
-
]
|
|
2318
|
-
},
|
|
2319
|
-
{
|
|
2320
|
-
// could be a comma delimited list of params to a function call
|
|
2321
|
-
begin: /,/,
|
|
2322
|
-
relevance: 0
|
|
2323
|
-
},
|
|
2324
|
-
{
|
|
2325
|
-
match: /\s+/,
|
|
2326
|
-
relevance: 0
|
|
2327
|
-
},
|
|
2328
|
-
{
|
|
2329
|
-
// JSX
|
|
2330
|
-
variants: [
|
|
2331
|
-
{ begin: h.begin, end: h.end },
|
|
2332
|
-
{ match: S },
|
|
2333
|
-
{
|
|
2334
|
-
begin: c.begin,
|
|
2335
|
-
// we carefully check the opening tag to see if it truly
|
|
2336
|
-
// is a tag and not a false positive
|
|
2337
|
-
"on:begin": c.isTrulyOpeningTag,
|
|
2338
|
-
end: c.end
|
|
2339
|
-
}
|
|
2340
|
-
],
|
|
2341
|
-
subLanguage: "xml",
|
|
2342
|
-
contains: [
|
|
2343
|
-
{
|
|
2344
|
-
begin: c.begin,
|
|
2345
|
-
end: c.end,
|
|
2346
|
-
skip: !0,
|
|
2347
|
-
contains: ["self"]
|
|
2348
|
-
}
|
|
2349
|
-
]
|
|
2350
|
-
}
|
|
2351
|
-
]
|
|
2352
|
-
},
|
|
2353
|
-
Y,
|
|
2354
|
-
{
|
|
2355
|
-
// prevent this from getting swallowed up by function
|
|
2356
|
-
// since they appear "function like"
|
|
2357
|
-
beginKeywords: "while if switch catch for"
|
|
2358
|
-
},
|
|
2359
|
-
{
|
|
2360
|
-
// we have to count the parens to make sure we actually have the correct
|
|
2361
|
-
// bounding ( ). There could be any number of sub-expressions inside
|
|
2362
|
-
// also surrounded by parens.
|
|
2363
|
-
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
2364
|
-
// end parens
|
|
2365
|
-
returnBegin: !0,
|
|
2366
|
-
label: "func.def",
|
|
2367
|
-
contains: [
|
|
2368
|
-
x,
|
|
2369
|
-
e.inherit(e.TITLE_MODE, { begin: r, className: "title.function" })
|
|
2370
|
-
]
|
|
2371
|
-
},
|
|
2372
|
-
// catch ... so it won't trigger the property rule below
|
|
2373
|
-
{
|
|
2374
|
-
match: /\.\.\./,
|
|
2375
|
-
relevance: 0
|
|
2376
|
-
},
|
|
2377
|
-
se,
|
|
2378
|
-
// hack: prevents detection of keywords in some circumstances
|
|
2379
|
-
// .keyword()
|
|
2380
|
-
// $keyword = x
|
|
2381
|
-
{
|
|
2382
|
-
match: "\\$" + r,
|
|
2383
|
-
relevance: 0
|
|
2384
|
-
},
|
|
2385
|
-
{
|
|
2386
|
-
match: [/\bconstructor(?=\s*\()/],
|
|
2387
|
-
className: { 1: "title.function" },
|
|
2388
|
-
contains: [x]
|
|
2389
|
-
},
|
|
2390
|
-
te,
|
|
2391
|
-
J,
|
|
2392
|
-
ee,
|
|
2393
|
-
F,
|
|
2394
|
-
{
|
|
2395
|
-
match: /\$[(.]/
|
|
2396
|
-
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
2397
|
-
}
|
|
2398
|
-
]
|
|
2399
|
-
};
|
|
2400
|
-
}
|
|
2401
|
-
function dt(e) {
|
|
2402
|
-
const n = ot(e), s = ge, r = [
|
|
2403
|
-
"any",
|
|
2404
|
-
"void",
|
|
2405
|
-
"number",
|
|
2406
|
-
"boolean",
|
|
2407
|
-
"string",
|
|
2408
|
-
"object",
|
|
2409
|
-
"never",
|
|
2410
|
-
"symbol",
|
|
2411
|
-
"bigint",
|
|
2412
|
-
"unknown"
|
|
2413
|
-
], h = {
|
|
2414
|
-
begin: [
|
|
2415
|
-
/namespace/,
|
|
2416
|
-
/\s+/,
|
|
2417
|
-
e.IDENT_RE
|
|
2418
|
-
],
|
|
2419
|
-
beginScope: {
|
|
2420
|
-
1: "keyword",
|
|
2421
|
-
3: "title.class"
|
|
2422
|
-
}
|
|
2423
|
-
}, S = {
|
|
2424
|
-
beginKeywords: "interface",
|
|
2425
|
-
end: /\{/,
|
|
2426
|
-
excludeEnd: !0,
|
|
2427
|
-
keywords: {
|
|
2428
|
-
keyword: "interface extends",
|
|
2429
|
-
built_in: r
|
|
2430
|
-
},
|
|
2431
|
-
contains: [n.exports.CLASS_REFERENCE]
|
|
2432
|
-
}, c = {
|
|
2433
|
-
className: "meta",
|
|
2434
|
-
relevance: 10,
|
|
2435
|
-
begin: /^\s*['"]use strict['"]/
|
|
2436
|
-
}, i = [
|
|
2437
|
-
"type",
|
|
2438
|
-
// "namespace",
|
|
2439
|
-
"interface",
|
|
2440
|
-
"public",
|
|
2441
|
-
"private",
|
|
2442
|
-
"protected",
|
|
2443
|
-
"implements",
|
|
2444
|
-
"declare",
|
|
2445
|
-
"abstract",
|
|
2446
|
-
"readonly",
|
|
2447
|
-
"enum",
|
|
2448
|
-
"override",
|
|
2449
|
-
"satisfies"
|
|
2450
|
-
], u = {
|
|
2451
|
-
$pattern: ge,
|
|
2452
|
-
keyword: Ye.concat(i),
|
|
2453
|
-
literal: Je,
|
|
2454
|
-
built_in: nn.concat(r),
|
|
2455
|
-
"variable.language": en
|
|
2456
|
-
}, b = {
|
|
2457
|
-
className: "meta",
|
|
2458
|
-
begin: "@" + s
|
|
2459
|
-
}, p = (y, U, v) => {
|
|
2460
|
-
const L = y.contains.findIndex((q) => q.label === U);
|
|
2461
|
-
if (L === -1)
|
|
2462
|
-
throw new Error("can not find mode to replace");
|
|
2463
|
-
y.contains.splice(L, 1, v);
|
|
2464
|
-
};
|
|
2465
|
-
Object.assign(n.keywords, u), n.exports.PARAMS_CONTAINS.push(b);
|
|
2466
|
-
const I = n.contains.find((y) => y.className === "attr");
|
|
2467
|
-
n.exports.PARAMS_CONTAINS.push([
|
|
2468
|
-
n.exports.CLASS_REFERENCE,
|
|
2469
|
-
// class reference for highlighting the params types
|
|
2470
|
-
I
|
|
2471
|
-
// highlight the params key
|
|
2472
|
-
]), n.contains = n.contains.concat([
|
|
2473
|
-
b,
|
|
2474
|
-
h,
|
|
2475
|
-
S
|
|
2476
|
-
]), p(n, "shebang", e.SHEBANG()), p(n, "use_strict", c);
|
|
2477
|
-
const R = n.contains.find((y) => y.label === "func.def");
|
|
2478
|
-
return R.relevance = 0, Object.assign(n, {
|
|
2479
|
-
name: "TypeScript",
|
|
2480
|
-
aliases: [
|
|
2481
|
-
"ts",
|
|
2482
|
-
"tsx",
|
|
2483
|
-
"mts",
|
|
2484
|
-
"cts"
|
|
2485
|
-
]
|
|
2486
|
-
}), n;
|
|
2487
|
-
}
|
|
2488
|
-
export {
|
|
2489
|
-
ut as H,
|
|
2490
|
-
ft as a,
|
|
2491
|
-
gt as j,
|
|
2492
|
-
dt as t
|
|
2493
|
-
};
|