@foris/avocado-not-front 1.12.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avocado-not-front.es.js +2191 -8
- package/dist/avocado-not-front.umd.js +3 -4642
- package/dist/hooks/useAction.d.ts +3 -3
- package/dist/services/axios/useFetchAndLoad.d.ts +1 -1
- package/dist/types/builder.type.d.ts +1 -0
- package/dist/types/components.type.d.ts +9 -1
- package/package.json +35 -18
- package/dist/abap-Y8Dl9g_6-Y8Dl9g_6.js +0 -6
- package/dist/actionscript-3-DZzbMeqX-DZzbMeqX.js +0 -6
- package/dist/ada-vP6ak0IW-vP6ak0IW.js +0 -6
- package/dist/andromeeda-BIpZ7gaU-BIpZ7gaU.js +0 -4
- package/dist/angular-html-DPB4Rf0C-1_1_4tyh.js +0 -34
- package/dist/angular-ts-CeqPwKaz-ohSx1G-R.js +0 -24
- package/dist/apache-BUjz-sD2-BUjz-sD2.js +0 -6
- package/dist/apex-oLhhs58q-oLhhs58q.js +0 -6
- package/dist/apl-Bfz1rp5e-DI6exAvT.js +0 -17
- package/dist/applescript-BPx7YFFu-BPx7YFFu.js +0 -6
- package/dist/ara-Z2fSOxSw-Z2fSOxSw.js +0 -6
- package/dist/arc-DHSZg76Q-C6o4oFmD.js +0 -85
- package/dist/architectureDiagram-VXUJARFQ-Cp8vugxX-9O3-degh.js +0 -4672
- package/dist/asciidoc-B-pCoB3G-B-pCoB3G.js +0 -6
- package/dist/asm-BTWLY5ym-BTWLY5ym.js +0 -6
- package/dist/astro-CFFExE8Q-D857V_mk.js +0 -18
- package/dist/aurora-x-BwoVEUWZ-BwoVEUWZ.js +0 -4
- package/dist/awk-Fb0P9dkn-Fb0P9dkn.js +0 -6
- package/dist/ayu-dark-CxPZkpb2-CxPZkpb2.js +0 -4
- package/dist/ballerina-oZK-YekG-oZK-YekG.js +0 -6
- package/dist/bat-0FvbqU9S-0FvbqU9S.js +0 -6
- package/dist/beancount-DqJEb89h-DqJEb89h.js +0 -6
- package/dist/berry-DODBq_Ff-DODBq_Ff.js +0 -6
- package/dist/bibtex-EULQRLY5-EULQRLY5.js +0 -6
- package/dist/bicep-BorU73w0-BorU73w0.js +0 -6
- package/dist/blade-DRRSiTQz-DuQj1Sqy.js +0 -21
- package/dist/blockDiagram-VD42YOAC-B4cTulr6-CNlYtTjf.js +0 -2407
- package/dist/bsl-NkNNwerW-DeWv6DbE.js +0 -8
- package/dist/c-eeMepfLm-eeMepfLm.js +0 -6
- package/dist/c4Diagram-YG6GDRKO-B8--s8xx-CZw1PsLU.js +0 -1585
- package/dist/cadence-02UX7mW8-02UX7mW8.js +0 -6
- package/dist/cairo-DM6WF2e3-BLxuUSuB.js +0 -8
- package/dist/catppuccin-frappe-D3cH2rXe-D3cH2rXe.js +0 -4
- package/dist/catppuccin-latte-C0LRGUW4-C0LRGUW4.js +0 -4
- package/dist/catppuccin-macchiato-c5wQ11TT-c5wQ11TT.js +0 -4
- package/dist/catppuccin-mocha-WMD6Qvya-WMD6Qvya.js +0 -4
- package/dist/channel-Cqk_cOiy-72hMZ_v0.js +0 -5
- package/dist/chunk-4BX2VUAB-Cb-wAjVN-DlY_dtbp.js +0 -9
- package/dist/chunk-55IACEB6-QFXfbMHG-AnxyrPT-.js +0 -8
- package/dist/chunk-B4BG7PRW-CFs53zrP-DB12fnkn.js +0 -1375
- package/dist/chunk-DI55MBZ5-CKjAOeh7-D98MsfUL.js +0 -1383
- package/dist/chunk-FMBD7UC4-B29MtLTn-tjtGIWPm.js +0 -19
- package/dist/chunk-QN33PNHL-5bU-bM6A-vK9OZVa6.js +0 -20
- package/dist/chunk-QZHKN3VN-B_Q6cMrq-78n0e61s.js +0 -15
- package/dist/chunk-TZMSLE5B-DlULRafu-BlGLxuE_.js +0 -64
- package/dist/clarity-PKm5CwqM-PKm5CwqM.js +0 -6
- package/dist/classDiagram-2ON5EDUG-DJmXfcVi-CF8YlvOv.js +0 -22
- package/dist/classDiagram-v2-WZHVMYZB-DJmXfcVi-CF8YlvOv.js +0 -22
- package/dist/clojure-CXJfHrL3-CXJfHrL3.js +0 -6
- package/dist/cmake-BJz8BOTU-BJz8BOTU.js +0 -6
- package/dist/cobol-DYTFdEK1-1eoMdnt0.js +0 -12
- package/dist/code-block-QI2IAROF-C_F85uim-MNaL7yo9.js +0 -2805
- package/dist/codeowners-Bt9yU6NX-Bt9yU6NX.js +0 -6
- package/dist/codeql-DHkodjjI-DHkodjjI.js +0 -6
- package/dist/coffee-DGBR_nr_-Cu5d6u6p.js +0 -8
- package/dist/common-lisp-EVqT9Zhp-EVqT9Zhp.js +0 -6
- package/dist/coq-B0L9upzn-B0L9upzn.js +0 -6
- package/dist/cose-bilkent-S5V4N54A-N3jM_XQd-BbbJbKzj.js +0 -2612
- package/dist/cpp-ZFnOq6fV-CkUSzFY-.js +0 -19
- package/dist/crystal-CRJyc4G--B_7jzPPy.js +0 -18
- package/dist/csharp-C7yUs7-w-C7yUs7-w.js +0 -6
- package/dist/css-CECN5uSL-CECN5uSL.js +0 -6
- package/dist/csv-CmYOceLb-DlI6xKnA.js +0 -6
- package/dist/cue-ZzumE7IT-ZzumE7IT.js +0 -6
- package/dist/cypher-jpdmjtA6-jpdmjtA6.js +0 -6
- package/dist/cytoscape.esm-ClN43hhW-Dh4GqQxb.js +0 -18836
- package/dist/d-CBagWSwH-CBagWSwH.js +0 -6
- package/dist/dagre-6UL2VRFP-CJdrtgOu-CLaqjT6l.js +0 -451
- package/dist/dark-plus-pUHDTVV0-pUHDTVV0.js +0 -4
- package/dist/dart-6ObCrKr9-6ObCrKr9.js +0 -6
- package/dist/dax-CcDT-8dH-CcDT-8dH.js +0 -6
- package/dist/defaultLocale-DcQU6Vee-C62bXCQv.js +0 -177
- package/dist/desktop-B93p9R9O-B93p9R9O.js +0 -6
- package/dist/diagram-PSM6KHXK-DSaDqHvO-DVH1Sew6.js +0 -544
- package/dist/diagram-QEK2KX5R-BbxboH_--DYDmO4S1.js +0 -224
- package/dist/diagram-S2PKOQOG-DWsCb5He--yPVUK-A.js +0 -146
- package/dist/diff-BxzP2J8R-BxzP2J8R.js +0 -6
- package/dist/docker-CsHqm9tx-CsHqm9tx.js +0 -6
- package/dist/dotenv-BMjVjUL1-BMjVjUL1.js +0 -6
- package/dist/dracula-BtZx2Kac-BtZx2Kac.js +0 -4
- package/dist/dracula-soft-BKa-aqBv-BKa-aqBv.js +0 -4
- package/dist/dream-maker-PAx17jaB-PAx17jaB.js +0 -6
- package/dist/edge-B882-fmN-CXsL8OuZ.js +0 -14
- package/dist/elixir-DRzNHQCz-EnC5QsDh.js +0 -10
- package/dist/elm-DZPAA5Qn-BCPZo0aa.js +0 -9
- package/dist/emacs-lisp-Cfxdx5D--Cfxdx5D-.js +0 -6
- package/dist/erDiagram-Q2GNP2WA-Bl0uHx93-Cm6cgw10.js +0 -844
- package/dist/erb-DB1DqdBc-CnAEHkSC.js +0 -27
- package/dist/erlang-DNcDT8Hi-Cs3llSSi.js +0 -8
- package/dist/everforest-dark-DMCBqXCK-DMCBqXCK.js +0 -4
- package/dist/everforest-light-BbXl82Em-BbXl82Em.js +0 -4
- package/dist/fennel-N4WcXuKx-N4WcXuKx.js +0 -6
- package/dist/fish-BTDEUgqH-BTDEUgqH.js +0 -6
- package/dist/flowDiagram-NV44I4VS-Dq0mXT8f-BL0sk42H.js +0 -1631
- package/dist/fluent-BMXUxfv1-BMXUxfv1.js +0 -6
- package/dist/fortran-fixed-form-DUsA-VGo-CYX4aMfD.js +0 -8
- package/dist/fortran-free-form-DPIT_jbP-DPIT_jbP.js +0 -6
- package/dist/fsharp-CYOiIVNx-D3KYyprZ.js +0 -8
- package/dist/ganttDiagram-JELNMOA3-Dj1adndm-BODWVm5T.js +0 -2702
- package/dist/gdresource-BwtMIoBm-DVtwhfL2.js +0 -10
- package/dist/gdscript-BifyeYhI-BifyeYhI.js +0 -6
- package/dist/gdshader-Bk8fF6yr-Bk8fF6yr.js +0 -6
- package/dist/genie-DzUvd7U9-DzUvd7U9.js +0 -6
- package/dist/gherkin-DHRaV0YP-DHRaV0YP.js +0 -6
- package/dist/git-commit-Bd32YZ0K-D9qSjMiw.js +0 -8
- package/dist/git-rebase-ZWUFO_T4-uqUGWt5o.js +0 -8
- package/dist/gitGraphDiagram-NY62KEGX-DIFZugA1-BsIE257G.js +0 -715
- package/dist/github-dark-DenFmJkN-DenFmJkN.js +0 -4
- package/dist/github-dark-default-BJPUVz4H-BJPUVz4H.js +0 -4
- package/dist/github-dark-dimmed-DUshB20C-DUshB20C.js +0 -4
- package/dist/github-dark-high-contrast-D3aGCnF8-D3aGCnF8.js +0 -4
- package/dist/github-light-JYsPkUQd-JYsPkUQd.js +0 -4
- package/dist/github-light-default-D99KPAby-D99KPAby.js +0 -4
- package/dist/github-light-high-contrast-BbmZE-Mp-BbmZE-Mp.js +0 -4
- package/dist/gleam-Bv284lvN-Bv284lvN.js +0 -6
- package/dist/glimmer-js-DkxNrfPT-Dr8vv_dk.js +0 -14
- package/dist/glimmer-ts-D6YZEmK_-CeJS1lkt.js +0 -14
- package/dist/glsl-CkUcVZNK-D6P60Alb.js +0 -8
- package/dist/gnuplot-yPG9-sE_-yPG9-sE_.js +0 -6
- package/dist/go-ChxJuLYK-ChxJuLYK.js +0 -6
- package/dist/graph-DB2UxkYH-Bs-uwV4G.js +0 -1190
- package/dist/graphql-CBu2ehBn-B9KpeKh4.js +0 -14
- package/dist/groovy-CJQTphOW-CJQTphOW.js +0 -6
- package/dist/gruvbox-dark-hard-C5HOtKIh-C5HOtKIh.js +0 -4
- package/dist/gruvbox-dark-medium-FVgwJHuz-FVgwJHuz.js +0 -4
- package/dist/gruvbox-dark-soft-B46F314v-B46F314v.js +0 -4
- package/dist/gruvbox-light-hard-CJD38wDZ-CJD38wDZ.js +0 -4
- package/dist/gruvbox-light-medium-BlIhMYTA-BlIhMYTA.js +0 -4
- package/dist/gruvbox-light-soft-DoPHyLVZ-DoPHyLVZ.js +0 -4
- package/dist/hack-DVWgrvc2-CFszvyOs.js +0 -12
- package/dist/haml-NZLVzu_R-6sAynSNG.js +0 -10
- package/dist/handlebars-mxStpSE7-C1GOcwW1.js +0 -14
- package/dist/haskell-WeIwNIP6-WeIwNIP6.js +0 -6
- package/dist/haxe-TztHsm5T-TztHsm5T.js +0 -6
- package/dist/hcl-D438OF-I-D438OF-I.js +0 -6
- package/dist/hjson-DYBUbqOl-DYBUbqOl.js +0 -6
- package/dist/hlsl-Bk8TCZNL-Bk8TCZNL.js +0 -6
- package/dist/houston-BDYrDoDW-BDYrDoDW.js +0 -4
- package/dist/html-B50bmoVb-BJ3eCZKL.js +0 -10
- package/dist/html-derivative-ByyNxAP5-BxLhKRHw.js +0 -10
- package/dist/http-BVIWqb92-CjnDmEd8.js +0 -19
- package/dist/hurl-B8OTiYoQ-DoRwHSAy.js +0 -17
- package/dist/hxml-GbqSQCLa-BnvJylRx.js +0 -8
- package/dist/hy-Brt5EZ7--Brt5EZ7-.js +0 -6
- package/dist/imba-CimUv-Uh-CimUv-Uh.js +0 -6
- package/dist/infoDiagram-WHAUD3N6-DPjzRs82-ChgGSBbk.js +0 -27
- package/dist/ini-BZIuRIvJ-BZIuRIvJ.js +0 -6
- package/dist/init-DjUOC4st-C8Nwz6AJ.js +0 -16
- package/dist/java-DY6VlHhP-DY6VlHhP.js +0 -6
- package/dist/javascript-C25yR2R2-C25yR2R2.js +0 -6
- package/dist/jinja-CI-LSgSv-BEWEZ83m.js +0 -13
- package/dist/jison-DdreslRX-DzaoIrEq.js +0 -8
- package/dist/journeyDiagram-XKPGCS4Q-DLrlPVyq-DYzqQ6Qu.js +0 -840
- package/dist/json-DxJze_jm-DxJze_jm.js +0 -6
- package/dist/json5-BT4Fjg39-BT4Fjg39.js +0 -6
- package/dist/jsonc-CHjZD8gR-CHjZD8gR.js +0 -6
- package/dist/jsonl-BGuvDmy9-BGuvDmy9.js +0 -6
- package/dist/jsonnet-Bx2cfsXg-Bx2cfsXg.js +0 -6
- package/dist/jssm-BcADi6EI-BcADi6EI.js +0 -6
- package/dist/jsx-BtKADgXT-BtKADgXT.js +0 -6
- package/dist/julia-ll8P6QXy-CifMye9u.js +0 -19
- package/dist/kanagawa-dragon-CiKur4Hl-CiKur4Hl.js +0 -4
- package/dist/kanagawa-lotus-BKu-smKu-BKu-smKu.js +0 -4
- package/dist/kanagawa-wave-CQwozSzG-CQwozSzG.js +0 -4
- package/dist/kanban-definition-3W4ZIXB7-BTI5yGHx-Bz8MmnxI.js +0 -724
- package/dist/katex.min-l0sNRNKZ-l0sNRNKZ.js +0 -1
- package/dist/kdl-BNOv9TC3-0Q4F1UAs.js +0 -6
- package/dist/kotlin-ByBMgTeR-ByBMgTeR.js +0 -6
- package/dist/kusto-VWFLl2T0-VWFLl2T0.js +0 -6
- package/dist/laserwave-6a00oqik-6a00oqik.js +0 -4
- package/dist/latex-DF20280u-RMy1LUrW.js +0 -9
- package/dist/layout-Q6wQN5dr-BC95Y2G0.js +0 -1727
- package/dist/lean-D5yRrexI-D5yRrexI.js +0 -6
- package/dist/less-B1GLI2Di-B1GLI2Di.js +0 -6
- package/dist/light-plus-CZuVqSLX-CZuVqSLX.js +0 -4
- package/dist/linear-UL3ZZUJv-CWZvrkAD.js +0 -277
- package/dist/liquid-CHzkx3jT-G75tv0iE.js +0 -14
- package/dist/llvm-co1rIKs3-co1rIKs3.js +0 -6
- package/dist/log-Al8wyEFV-Al8wyEFV.js +0 -6
- package/dist/logo-DBa4JDzV-DBa4JDzV.js +0 -6
- package/dist/lua-kX5WP_P5-DxLUTRud.js +0 -8
- package/dist/luau-DtBSxLyz-DtBSxLyz.js +0 -6
- package/dist/make-CsMclxtr-CsMclxtr.js +0 -6
- package/dist/markdown-CrScaQ96-CrScaQ96.js +0 -6
- package/dist/marko-ls0Jg2j8-BHrfxEh0.js +0 -14
- package/dist/material-theme-D6KBX41T-D6KBX41T.js +0 -4
- package/dist/material-theme-darker-CkRroheE-CkRroheE.js +0 -4
- package/dist/material-theme-lighter-BUBw43Yz-BUBw43Yz.js +0 -4
- package/dist/material-theme-ocean-ClGX14Ja-ClGX14Ja.js +0 -4
- package/dist/material-theme-palenight-C1RVm8K1-C1RVm8K1.js +0 -4
- package/dist/matlab-BOAaUVP0-BOAaUVP0.js +0 -6
- package/dist/mdc-DIP5_jeM-Cff0amyo.js +0 -15
- package/dist/mdx-BOhZZUJ8-BOhZZUJ8.js +0 -6
- package/dist/mermaid-B0ixDHKN-B0ixDHKN.js +0 -6
- package/dist/mermaid-NA5CF7SZ-BDJrKfjz-Cq0tva8U.js +0 -140994
- package/dist/mermaid.core-Cpfp0NBU-DQS-fLaZ.js +0 -14401
- package/dist/min-dark-C7ak0t6c-C7ak0t6c.js +0 -4
- package/dist/min-light-CKFxVcPp-CKFxVcPp.js +0 -4
- package/dist/mindmap-definition-VGOIOE7T-B6ovfeib-CXlRkpn9.js +0 -790
- package/dist/mipsasm-CTx18fBl-CTx18fBl.js +0 -6
- package/dist/mojo-BD611d7o-BD611d7o.js +0 -6
- package/dist/monokai-C1KBYcO0-C1KBYcO0.js +0 -4
- package/dist/move-F-dICmj2-F-dICmj2.js +0 -6
- package/dist/narrat-DmhDCBs--DmhDCBs-.js +0 -6
- package/dist/nextflow-DmSVRGjG-DmSVRGjG.js +0 -6
- package/dist/nginx-COxS3qoU-CvZmIOfz.js +0 -9
- package/dist/night-owl-Bm2rzalh-Bm2rzalh.js +0 -4
- package/dist/nim-CCwXZLHG-CVhjPGL5.js +0 -21
- package/dist/nix-BZK5F767-BZK5F767.js +0 -9
- package/dist/nord-CC5OiUXg-CC5OiUXg.js +0 -4
- package/dist/nushell-D8j3dhT--D8j3dhT-.js +0 -6
- package/dist/objective-c-Itk8tzmv-Itk8tzmv.js +0 -6
- package/dist/objective-cpp-DGt5UKRO-DGt5UKRO.js +0 -6
- package/dist/ocaml-eSVK32Eg-eSVK32Eg.js +0 -6
- package/dist/one-dark-pro-DTA3VF0_-DTA3VF0_.js +0 -4
- package/dist/one-light-D9sNaUtq-D9sNaUtq.js +0 -4
- package/dist/openscad-Sp5uZ6f2-Sp5uZ6f2.js +0 -6
- package/dist/ordinal-MUacOSdK-B1MUT0BL.js +0 -65
- package/dist/pascal-xy8pJNns-xy8pJNns.js +0 -6
- package/dist/perl-NvKK8p2P-DbsmNmLT.js +0 -17
- package/dist/php-CK5hNnT0-DEpqLZ_n.js +0 -19
- package/dist/pieDiagram-ADFJNKIX-Bn24elWA-iGwy_4tX.js +0 -166
- package/dist/pkl-C-zSNmaA-C-zSNmaA.js +0 -6
- package/dist/plastic-CSTz3KZp-CSTz3KZp.js +0 -4
- package/dist/plsql-pVbGZfOv-pVbGZfOv.js +0 -6
- package/dist/po-BNfHvqmm-BNfHvqmm.js +0 -6
- package/dist/poimandres-C-VADXHD-C-VADXHD.js +0 -4
- package/dist/polar-CAZahv3u-CAZahv3u.js +0 -6
- package/dist/postcss-05aHdL-n-05aHdL-n.js +0 -6
- package/dist/powerquery-DI9HkTvs-DI9HkTvs.js +0 -6
- package/dist/powershell-Clc4ydu--Clc4ydu-.js +0 -6
- package/dist/prisma-FZjmVtSl-FZjmVtSl.js +0 -6
- package/dist/prolog-C5-yg4TO-C5-yg4TO.js +0 -6
- package/dist/proto-MmCPeFAD-MmCPeFAD.js +0 -6
- package/dist/pug-XOw9Q1Ho-BO4tUzTj.js +0 -12
- package/dist/puppet-CUJHmnxV-CUJHmnxV.js +0 -6
- package/dist/purescript-rUfGld-4-rUfGld-4.js +0 -6
- package/dist/python-BFNSHbwJ-BFNSHbwJ.js +0 -6
- package/dist/qml-rTNXsquU-DeTe0b4l.js +0 -8
- package/dist/qmldir-BInDYbpo-BInDYbpo.js +0 -6
- package/dist/qss-AeJTysr_-AeJTysr_.js +0 -6
- package/dist/quadrantDiagram-AYHSOK5B-CsbmyLll-CFP8fgtI.js +0 -1030
- package/dist/r-Bm0uF0U2-Bm0uF0U2.js +0 -6
- package/dist/racket-B83wSAja-B83wSAja.js +0 -6
- package/dist/raku-nEQ4ZJJ7-nEQ4ZJJ7.js +0 -6
- package/dist/razor-CoqPuKQU-DUBs-Qe6.js +0 -12
- package/dist/red-7y8PH7HH-7y8PH7HH.js +0 -4
- package/dist/reg-m_s_Kiip-m_s_Kiip.js +0 -6
- package/dist/regexp-BazyLpPg-BazyLpPg.js +0 -6
- package/dist/rel-BcRfyd6Q-BcRfyd6Q.js +0 -6
- package/dist/requirementDiagram-UZGBJVZJ--9rfbKaz-CC8EZoyz.js +0 -854
- package/dist/riscv-Ce8MAQLP-Ce8MAQLP.js +0 -6
- package/dist/rose-pine-BKc3yVeu-BKc3yVeu.js +0 -4
- package/dist/rose-pine-dawn-BulJcPZT-BulJcPZT.js +0 -4
- package/dist/rose-pine-moon-j6jiXKV8-j6jiXKV8.js +0 -4
- package/dist/rosmsg-Cz0w1km8-Cz0w1km8.js +0 -6
- package/dist/rst-AoEjemIj-Dr7TcJwd.js +0 -36
- package/dist/ruby-CGSl8JoB-D4hDjzwe.js +0 -36
- package/dist/rust-CLzF9zIN-CLzF9zIN.js +0 -6
- package/dist/sankeyDiagram-TZEHDZUN-Cp2id-3k-DhByp8vU.js +0 -830
- package/dist/sas-fpEvgATw-D9dNv8Ej.js +0 -8
- package/dist/sass-DxHp5rTx-DxHp5rTx.js +0 -6
- package/dist/scala-D4grkFkl-D4grkFkl.js +0 -6
- package/dist/scheme-BCRWuEm4-BCRWuEm4.js +0 -6
- package/dist/scss-B1FaCqwR-DbNEJJFR.js +0 -8
- package/dist/sdbl-B7T8abf4-B7T8abf4.js +0 -6
- package/dist/sequenceDiagram-WL72ISMW-Bdoz1Co7-DcFuWrLs.js +0 -2526
- package/dist/shaderlab-Cr62-Wb4-D_jbKjpl.js +0 -8
- package/dist/shellscript-InADTalH-InADTalH.js +0 -6
- package/dist/shellsession-DiDJNQdy-BGvYrs9g.js +0 -8
- package/dist/slack-dark-i7wN4OET-i7wN4OET.js +0 -4
- package/dist/slack-ochin-ndHf0LoP-ndHf0LoP.js +0 -4
- package/dist/smalltalk-BlI1_OkM-BlI1_OkM.js +0 -6
- package/dist/snazzy-light-BlSJXAu4-BlSJXAu4.js +0 -4
- package/dist/solarized-dark-UTmkh7lw-UTmkh7lw.js +0 -4
- package/dist/solarized-light-BheCkDPT-BheCkDPT.js +0 -4
- package/dist/solidity-DUWnFhS6-DUWnFhS6.js +0 -6
- package/dist/soy-YPoZ1G2p-C1q7UQeu.js +0 -10
- package/dist/sparql-B0KWFEri-CqC-y0Su.js +0 -8
- package/dist/splunk-CRXR8A9s-CRXR8A9s.js +0 -6
- package/dist/sql-Cn_v3PB0-Cn_v3PB0.js +0 -6
- package/dist/ssh-config-DP-hNVbF-DP-hNVbF.js +0 -6
- package/dist/stata-B8c5fTjX-Bf3brRPV.js +0 -8
- package/dist/stateDiagram-FKZM4ZOC-BLHxjrc8-FBnBvaVW.js +0 -268
- package/dist/stateDiagram-v2-4FDKWEC3-CbxCwS8b-B_Pfgmu4.js +0 -21
- package/dist/stylus-CyKEU1Ej-CyKEU1Ej.js +0 -6
- package/dist/svelte-5UasyOg7-e8KUCojE.js +0 -14
- package/dist/swift-9UzSvamq-9UzSvamq.js +0 -6
- package/dist/synthwave-84-NU3C_KFZ-NU3C_KFZ.js +0 -4
- package/dist/system-verilog-BCm7smPJ-BCm7smPJ.js +0 -6
- package/dist/systemd-C-4qm6XH-C-4qm6XH.js +0 -6
- package/dist/talonscript-CFF3LF_O-CvtCkGGO.js +0 -6
- package/dist/tasl-Cg_WBUAe-Cg_WBUAe.js +0 -6
- package/dist/tcl-DN7buRTF-DN7buRTF.js +0 -6
- package/dist/templ-peLZIM2D-DkTUdVi-.js +0 -12
- package/dist/terraform-DGvcn9zM-DGvcn9zM.js +0 -6
- package/dist/tex-DpOayVob-BjP51rYh.js +0 -8
- package/dist/timeline-definition-IT6M3QCI-s3Wsbz6h-DfdfMl2Q.js +0 -805
- package/dist/tokyo-night-DP4TmcQl-DP4TmcQl.js +0 -4
- package/dist/toml-DY62mUL_-DY62mUL_.js +0 -6
- package/dist/treemap-KMMF4GRG-D_L55G0b-CANAYd5X.js +0 -15006
- package/dist/ts-tags-CWmBp2js-DrKIoTCJ.js +0 -43
- package/dist/tsv-BtvSkaG0-BtvSkaG0.js +0 -6
- package/dist/tsx-B8rCNbgL-B8rCNbgL.js +0 -6
- package/dist/turtle-_H59FV7D-_H59FV7D.js +0 -6
- package/dist/twig-Cpoho6oi-CQE9XWXP.js +0 -35
- package/dist/typescript-RycA9KXf-RycA9KXf.js +0 -6
- package/dist/typespec-DWqp-kUU-DWqp-kUU.js +0 -6
- package/dist/typst-D_1QKWns-D_1QKWns.js +0 -6
- package/dist/v-BPCNiyYe-BPCNiyYe.js +0 -6
- package/dist/vala-uxaPR7d1-uxaPR7d1.js +0 -6
- package/dist/vb-D8_c5-KN-D8_c5-KN.js +0 -6
- package/dist/verilog-B-bybjPF-B-bybjPF.js +0 -6
- package/dist/vesper-BckBta1U-BckBta1U.js +0 -4
- package/dist/vhdl-CUlNa8ac-CUlNa8ac.js +0 -6
- package/dist/viml-DsfA-sWm-DsfA-sWm.js +0 -6
- package/dist/vitesse-black-BoGvW84i-BoGvW84i.js +0 -4
- package/dist/vitesse-dark-Cym-eLtO-Cym-eLtO.js +0 -4
- package/dist/vitesse-light-CcmG315c-CcmG315c.js +0 -4
- package/dist/vue-DmFKWfEU-DXvRBLDJ.js +0 -31
- package/dist/vue-html-BB2aI7Yc-e0S8MQFq.js +0 -15
- package/dist/vue-vine-CznNap4x-DAbzn77p.js +0 -24
- package/dist/vyper-CPQuu50u-CPQuu50u.js +0 -6
- package/dist/wasm-BBXxrAl7-BBXxrAl7.js +0 -6
- package/dist/wasm-DQxwEHae-DQxwEHae.js +0 -7
- package/dist/wenyan-pbVjoM9_-pbVjoM9_.js +0 -6
- package/dist/wgsl-DY4iK1q1-DY4iK1q1.js +0 -6
- package/dist/wikitext-Z-MoUasO-Z-MoUasO.js +0 -6
- package/dist/wit-CQMQOlTg-CQMQOlTg.js +0 -6
- package/dist/wolfram-Dz4KXISs-Dz4KXISs.js +0 -6
- package/dist/xml-C2J0sS9M-IZlib8U3.js +0 -8
- package/dist/xsl-CbTBIiv3-CgleMmCH.js +0 -9
- package/dist/xychartDiagram-PRI3JC2R-D3ejwy7u-CFsnZXTL.js +0 -1345
- package/dist/yaml-DaO7k5B1-DaO7k5B1.js +0 -6
- package/dist/zenscript-CxBjpf9c-CxBjpf9c.js +0 -6
- package/dist/zig-Vm0PO9wB-Vm0PO9wB.js +0 -6
|
@@ -1,2805 +0,0 @@
|
|
|
1
|
-
import { O as Pe, w as A, L as On, _ as Dn, l as Tn, j as Wn } from "./mermaid-NA5CF7SZ-BDJrKfjz-Cq0tva8U.js";
|
|
2
|
-
import { memo as jn, useMemo as cn, useContext as zn, useState as Vn, useEffect as Hn } from "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
var Xn = Object.defineProperty, Zn = Object.getPrototypeOf, qn = Reflect.get, Qn = (e, n, t) => n in e ? Xn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, pn = (e, n, t) => (Qn(e, typeof n != "symbol" ? n + "" : n, t), t), Re = (e, n, t) => {
|
|
5
|
-
if (!n.has(e))
|
|
6
|
-
throw TypeError("Cannot " + t);
|
|
7
|
-
}, E = (e, n, t) => (Re(e, n, "read from private field"), t ? t.call(e) : n.get(e)), Z = (e, n, t) => {
|
|
8
|
-
if (n.has(e))
|
|
9
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
n instanceof WeakSet ? n.add(e) : n.set(e, t);
|
|
11
|
-
}, L = (e, n, t, r) => (Re(e, n, "write to private field"), n.set(e, t), t), Te = (e, n, t) => (Re(e, n, "access private method"), t), Kn = (e, n, t) => qn(Zn(e), t, n);
|
|
12
|
-
function te(e) {
|
|
13
|
-
if ([...e].length !== 1)
|
|
14
|
-
throw new Error(`Expected "${e}" to be a single code point`);
|
|
15
|
-
return e.codePointAt(0);
|
|
16
|
-
}
|
|
17
|
-
function Yn(e, n, t) {
|
|
18
|
-
return e.has(n) || e.set(n, t), e.get(n);
|
|
19
|
-
}
|
|
20
|
-
const Fe = /* @__PURE__ */ new Set(["alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit"]), x = String.raw;
|
|
21
|
-
function re(e, n) {
|
|
22
|
-
if (e == null)
|
|
23
|
-
throw new Error(n ?? "Value expected");
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
const dn = x`\[\^?`, fn = `c.? | C(?:-.?)?|${x`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${x`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${x`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${x`o\{[^\}]*\}?`}|${x`\d{1,3}`}`, Ue = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, le = new RegExp(x`
|
|
27
|
-
\\ (?:
|
|
28
|
-
${fn}
|
|
29
|
-
| [gk]<[^>]*>?
|
|
30
|
-
| [gk]'[^']*'?
|
|
31
|
-
| .
|
|
32
|
-
)
|
|
33
|
-
| \( (?:
|
|
34
|
-
\? (?:
|
|
35
|
-
[:=!>({]
|
|
36
|
-
| <[=!]
|
|
37
|
-
| <[^>]*>
|
|
38
|
-
| '[^']*'
|
|
39
|
-
| ~\|?
|
|
40
|
-
| #(?:[^)\\]|\\.?)*
|
|
41
|
-
| [^:)]*[:)]
|
|
42
|
-
)?
|
|
43
|
-
| \*[^\)]*\)?
|
|
44
|
-
)?
|
|
45
|
-
| (?:${Ue.source})+
|
|
46
|
-
| ${dn}
|
|
47
|
-
| .
|
|
48
|
-
`.replace(/\s+/g, ""), "gsu"), ye = new RegExp(x`
|
|
49
|
-
\\ (?:
|
|
50
|
-
${fn}
|
|
51
|
-
| .
|
|
52
|
-
)
|
|
53
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
54
|
-
| ${dn}
|
|
55
|
-
| &&
|
|
56
|
-
| .
|
|
57
|
-
`.replace(/\s+/g, ""), "gsu");
|
|
58
|
-
function Jn(e, n = {}) {
|
|
59
|
-
const t = { flags: "", ...n, rules: { captureGroup: !1, singleline: !1, ...n.rules } };
|
|
60
|
-
if (typeof e != "string")
|
|
61
|
-
throw new Error("String expected as pattern");
|
|
62
|
-
const r = yt(t.flags), a = [r.extended], o = { captureGroup: t.rules.captureGroup, getCurrentModX() {
|
|
63
|
-
return a.at(-1);
|
|
64
|
-
}, numOpenGroups: 0, popModX() {
|
|
65
|
-
a.pop();
|
|
66
|
-
}, pushModX(c) {
|
|
67
|
-
a.push(c);
|
|
68
|
-
}, replaceCurrentModX(c) {
|
|
69
|
-
a[a.length - 1] = c;
|
|
70
|
-
}, singleline: t.rules.singleline };
|
|
71
|
-
let s = [], i;
|
|
72
|
-
for (le.lastIndex = 0; i = le.exec(e); ) {
|
|
73
|
-
const c = et(o, e, i[0], le.lastIndex);
|
|
74
|
-
c.tokens ? s.push(...c.tokens) : c.token && s.push(c.token), c.lastIndex !== void 0 && (le.lastIndex = c.lastIndex);
|
|
75
|
-
}
|
|
76
|
-
const u = [];
|
|
77
|
-
let l = 0;
|
|
78
|
-
s.filter((c) => c.type === "GroupOpen").forEach((c) => {
|
|
79
|
-
c.kind === "capturing" ? c.number = ++l : c.raw === "(" && u.push(c);
|
|
80
|
-
}), l || u.forEach((c, d) => {
|
|
81
|
-
c.kind = "capturing", c.number = d + 1;
|
|
82
|
-
});
|
|
83
|
-
const p = l || u.length;
|
|
84
|
-
return { tokens: s.map((c) => c.type === "EscapedNumber" ? Ct(c, p) : c).flat(), flags: r };
|
|
85
|
-
}
|
|
86
|
-
function et(e, n, t, r) {
|
|
87
|
-
const [a, o] = t;
|
|
88
|
-
if (t === "[" || t === "[^") {
|
|
89
|
-
const s = nt(n, t, r);
|
|
90
|
-
return { tokens: s.tokens, lastIndex: s.lastIndex };
|
|
91
|
-
}
|
|
92
|
-
if (a === "\\") {
|
|
93
|
-
if ("AbBGyYzZ".includes(o))
|
|
94
|
-
return { token: We(t, t) };
|
|
95
|
-
if (/^\\g[<']/.test(t)) {
|
|
96
|
-
if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(t))
|
|
97
|
-
throw new Error(`Invalid group name "${t}"`);
|
|
98
|
-
return { token: pt(t) };
|
|
99
|
-
}
|
|
100
|
-
if (/^\\k[<']/.test(t)) {
|
|
101
|
-
if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(t))
|
|
102
|
-
throw new Error(`Invalid group name "${t}"`);
|
|
103
|
-
return { token: hn(t) };
|
|
104
|
-
}
|
|
105
|
-
if (o === "K")
|
|
106
|
-
return { token: wn("keep", t) };
|
|
107
|
-
if (o === "N" || o === "R")
|
|
108
|
-
return { token: V("newline", t, { negate: o === "N" }) };
|
|
109
|
-
if (o === "O")
|
|
110
|
-
return { token: V("any", t) };
|
|
111
|
-
if (o === "X")
|
|
112
|
-
return { token: V("text_segment", t) };
|
|
113
|
-
const s = gn(t, { inCharClass: !1 });
|
|
114
|
-
return Array.isArray(s) ? { tokens: s } : { token: s };
|
|
115
|
-
}
|
|
116
|
-
if (a === "(") {
|
|
117
|
-
if (o === "*")
|
|
118
|
-
return { token: ht(t) };
|
|
119
|
-
if (t === "(?{")
|
|
120
|
-
throw new Error(`Unsupported callout "${t}"`);
|
|
121
|
-
if (t.startsWith("(?#")) {
|
|
122
|
-
if (n[r] !== ")")
|
|
123
|
-
throw new Error('Unclosed comment group "(?#"');
|
|
124
|
-
return { lastIndex: r + 1 };
|
|
125
|
-
}
|
|
126
|
-
if (/^\(\?[-imx]+[:)]$/.test(t))
|
|
127
|
-
return { token: gt(t, e) };
|
|
128
|
-
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:")
|
|
129
|
-
return { token: ee("group", t) };
|
|
130
|
-
if (t === "(?>")
|
|
131
|
-
return { token: ee("atomic", t) };
|
|
132
|
-
if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!")
|
|
133
|
-
return { token: ee(t[2] === "<" ? "lookbehind" : "lookahead", t, { negate: t.endsWith("!") }) };
|
|
134
|
-
if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'"))
|
|
135
|
-
return { token: ee("capturing", t, { ...t !== "(" && { name: t.slice(3, -1) } }) };
|
|
136
|
-
if (t.startsWith("(?~")) {
|
|
137
|
-
if (t === "(?~|")
|
|
138
|
-
throw new Error(`Unsupported absence function kind "${t}"`);
|
|
139
|
-
return { token: ee("absence_repeater", t) };
|
|
140
|
-
}
|
|
141
|
-
throw t === "(?(" ? new Error(`Unsupported conditional "${t}"`) : new Error(`Invalid or unsupported group option "${t}"`);
|
|
142
|
-
}
|
|
143
|
-
if (t === ")") {
|
|
144
|
-
if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0)
|
|
145
|
-
throw new Error('Unmatched ")"');
|
|
146
|
-
return { token: ut(t) };
|
|
147
|
-
}
|
|
148
|
-
if (e.getCurrentModX()) {
|
|
149
|
-
if (t === "#") {
|
|
150
|
-
const s = n.indexOf(`
|
|
151
|
-
`, r);
|
|
152
|
-
return { lastIndex: s === -1 ? n.length : s };
|
|
153
|
-
}
|
|
154
|
-
if (/^\s$/.test(t)) {
|
|
155
|
-
const s = /\s+/y;
|
|
156
|
-
return s.lastIndex = r, { lastIndex: s.exec(n) ? s.lastIndex : r };
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (t === ".")
|
|
160
|
-
return { token: V("dot", t) };
|
|
161
|
-
if (t === "^" || t === "$") {
|
|
162
|
-
const s = e.singleline ? { "^": x`\A`, $: x`\Z` }[t] : t;
|
|
163
|
-
return { token: We(s, t) };
|
|
164
|
-
}
|
|
165
|
-
return t === "|" ? { token: rt(t) } : Ue.test(t) ? { tokens: xt(t) } : { token: F(te(t), t) };
|
|
166
|
-
}
|
|
167
|
-
function nt(e, n, t) {
|
|
168
|
-
const r = [je(n[1] === "^", n)];
|
|
169
|
-
let a = 1, o;
|
|
170
|
-
for (ye.lastIndex = t; o = ye.exec(e); ) {
|
|
171
|
-
const s = o[0];
|
|
172
|
-
if (s[0] === "[" && s[1] !== ":")
|
|
173
|
-
a++, r.push(je(s[1] === "^", s));
|
|
174
|
-
else if (s === "]") {
|
|
175
|
-
if (r.at(-1).type === "CharacterClassOpen")
|
|
176
|
-
r.push(F(93, s));
|
|
177
|
-
else if (a--, r.push(ot(s)), !a)
|
|
178
|
-
break;
|
|
179
|
-
} else {
|
|
180
|
-
const i = tt(s);
|
|
181
|
-
Array.isArray(i) ? r.push(...i) : r.push(i);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return { tokens: r, lastIndex: ye.lastIndex || e.length };
|
|
185
|
-
}
|
|
186
|
-
function tt(e) {
|
|
187
|
-
if (e[0] === "\\")
|
|
188
|
-
return gn(e, { inCharClass: !0 });
|
|
189
|
-
if (e[0] === "[") {
|
|
190
|
-
const n = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
|
|
191
|
-
if (!n || !Fe.has(n.groups.name))
|
|
192
|
-
throw new Error(`Invalid POSIX class "${e}"`);
|
|
193
|
-
return V("posix", e, { value: n.groups.name, negate: !!n.groups.negate });
|
|
194
|
-
}
|
|
195
|
-
return e === "-" ? at(e) : e === "&&" ? st(e) : F(te(e), e);
|
|
196
|
-
}
|
|
197
|
-
function gn(e, { inCharClass: n }) {
|
|
198
|
-
const t = e[1];
|
|
199
|
-
if (t === "c" || t === "C")
|
|
200
|
-
return ft(e);
|
|
201
|
-
if ("dDhHsSwW".includes(t))
|
|
202
|
-
return wt(e);
|
|
203
|
-
if (e.startsWith(x`\o{`))
|
|
204
|
-
throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
|
|
205
|
-
if (/^\\[pP]\{/.test(e)) {
|
|
206
|
-
if (e.length === 3)
|
|
207
|
-
throw new Error(`Incomplete or invalid Unicode property "${e}"`);
|
|
208
|
-
return mt(e);
|
|
209
|
-
}
|
|
210
|
-
if (new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}", "u").test(e))
|
|
211
|
-
try {
|
|
212
|
-
const r = e.split(/\\x/).slice(1).map((s) => parseInt(s, 16)), a = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }).decode(new Uint8Array(r)), o = new TextEncoder();
|
|
213
|
-
return [...a].map((s) => {
|
|
214
|
-
const i = [...o.encode(s)].map((u) => `\\x${u.toString(16)}`).join("");
|
|
215
|
-
return F(te(s), i);
|
|
216
|
-
});
|
|
217
|
-
} catch {
|
|
218
|
-
throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
|
|
219
|
-
}
|
|
220
|
-
if (t === "u" || t === "x")
|
|
221
|
-
return F(bt(e), e);
|
|
222
|
-
if (ze.has(t))
|
|
223
|
-
return F(ze.get(t), e);
|
|
224
|
-
if (/\d/.test(t))
|
|
225
|
-
return it(n, e);
|
|
226
|
-
if (e === "\\")
|
|
227
|
-
throw new Error(x`Incomplete escape "\"`);
|
|
228
|
-
if (t === "M")
|
|
229
|
-
throw new Error(`Unsupported meta "${e}"`);
|
|
230
|
-
if ([...e].length === 2)
|
|
231
|
-
return F(e.codePointAt(1), e);
|
|
232
|
-
throw new Error(`Unexpected escape "${e}"`);
|
|
233
|
-
}
|
|
234
|
-
function rt(e) {
|
|
235
|
-
return { type: "Alternator", raw: e };
|
|
236
|
-
}
|
|
237
|
-
function We(e, n) {
|
|
238
|
-
return { type: "Assertion", kind: e, raw: n };
|
|
239
|
-
}
|
|
240
|
-
function hn(e) {
|
|
241
|
-
return { type: "Backreference", raw: e };
|
|
242
|
-
}
|
|
243
|
-
function F(e, n) {
|
|
244
|
-
return { type: "Character", value: e, raw: n };
|
|
245
|
-
}
|
|
246
|
-
function ot(e) {
|
|
247
|
-
return { type: "CharacterClassClose", raw: e };
|
|
248
|
-
}
|
|
249
|
-
function at(e) {
|
|
250
|
-
return { type: "CharacterClassHyphen", raw: e };
|
|
251
|
-
}
|
|
252
|
-
function st(e) {
|
|
253
|
-
return { type: "CharacterClassIntersector", raw: e };
|
|
254
|
-
}
|
|
255
|
-
function je(e, n) {
|
|
256
|
-
return { type: "CharacterClassOpen", negate: e, raw: n };
|
|
257
|
-
}
|
|
258
|
-
function V(e, n, t = {}) {
|
|
259
|
-
return { type: "CharacterSet", kind: e, ...t, raw: n };
|
|
260
|
-
}
|
|
261
|
-
function wn(e, n, t = {}) {
|
|
262
|
-
return e === "keep" ? { type: "Directive", kind: e, raw: n } : { type: "Directive", kind: e, flags: re(t.flags), raw: n };
|
|
263
|
-
}
|
|
264
|
-
function it(e, n) {
|
|
265
|
-
return { type: "EscapedNumber", inCharClass: e, raw: n };
|
|
266
|
-
}
|
|
267
|
-
function ut(e) {
|
|
268
|
-
return { type: "GroupClose", raw: e };
|
|
269
|
-
}
|
|
270
|
-
function ee(e, n, t = {}) {
|
|
271
|
-
return { type: "GroupOpen", kind: e, ...t, raw: n };
|
|
272
|
-
}
|
|
273
|
-
function lt(e, n, t, r) {
|
|
274
|
-
return { type: "NamedCallout", kind: e, tag: n, arguments: t, raw: r };
|
|
275
|
-
}
|
|
276
|
-
function ct(e, n, t, r) {
|
|
277
|
-
return { type: "Quantifier", kind: e, min: n, max: t, raw: r };
|
|
278
|
-
}
|
|
279
|
-
function pt(e) {
|
|
280
|
-
return { type: "Subroutine", raw: e };
|
|
281
|
-
}
|
|
282
|
-
const dt = /* @__PURE__ */ new Set(["COUNT", "CMP", "ERROR", "FAIL", "MAX", "MISMATCH", "SKIP", "TOTAL_COUNT"]), ze = /* @__PURE__ */ new Map([["a", 7], ["b", 8], ["e", 27], ["f", 12], ["n", 10], ["r", 13], ["t", 9], ["v", 11]]);
|
|
283
|
-
function ft(e) {
|
|
284
|
-
const n = e[1] === "c" ? e[2] : e[3];
|
|
285
|
-
if (!n || !/[A-Za-z]/.test(n))
|
|
286
|
-
throw new Error(`Unsupported control character "${e}"`);
|
|
287
|
-
return F(te(n.toUpperCase()) - 64, e);
|
|
288
|
-
}
|
|
289
|
-
function gt(e, n) {
|
|
290
|
-
let { on: t, off: r } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
|
|
291
|
-
r ?? (r = "");
|
|
292
|
-
const a = (n.getCurrentModX() || t.includes("x")) && !r.includes("x"), o = He(t), s = He(r), i = {};
|
|
293
|
-
if (o && (i.enable = o), s && (i.disable = s), e.endsWith(")"))
|
|
294
|
-
return n.replaceCurrentModX(a), wn("flags", e, { flags: i });
|
|
295
|
-
if (e.endsWith(":"))
|
|
296
|
-
return n.pushModX(a), n.numOpenGroups++, ee("group", e, { ...(o || s) && { flags: i } });
|
|
297
|
-
throw new Error(`Unexpected flag modifier "${e}"`);
|
|
298
|
-
}
|
|
299
|
-
function ht(e) {
|
|
300
|
-
const n = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
|
|
301
|
-
if (!n)
|
|
302
|
-
throw new Error(`Incomplete or invalid named callout "${e}"`);
|
|
303
|
-
const { name: t, tag: r, args: a } = n.groups;
|
|
304
|
-
if (!t)
|
|
305
|
-
throw new Error(`Invalid named callout "${e}"`);
|
|
306
|
-
if (r === "")
|
|
307
|
-
throw new Error(`Named callout tag with empty value not allowed "${e}"`);
|
|
308
|
-
const o = a ? a.split(",").filter((p) => p !== "").map((p) => /^[+-]?\d+$/.test(p) ? +p : p) : [], [s, i, u] = o, l = dt.has(t) ? t.toLowerCase() : "custom";
|
|
309
|
-
switch (l) {
|
|
310
|
-
case "fail":
|
|
311
|
-
case "mismatch":
|
|
312
|
-
case "skip":
|
|
313
|
-
if (o.length > 0)
|
|
314
|
-
throw new Error(`Named callout arguments not allowed "${o}"`);
|
|
315
|
-
break;
|
|
316
|
-
case "error":
|
|
317
|
-
if (o.length > 1)
|
|
318
|
-
throw new Error(`Named callout allows only one argument "${o}"`);
|
|
319
|
-
if (typeof s == "string")
|
|
320
|
-
throw new Error(`Named callout argument must be a number "${s}"`);
|
|
321
|
-
break;
|
|
322
|
-
case "max":
|
|
323
|
-
if (!o.length || o.length > 2)
|
|
324
|
-
throw new Error(`Named callout must have one or two arguments "${o}"`);
|
|
325
|
-
if (typeof s == "string" && !/^[A-Za-z_]\w*$/.test(s))
|
|
326
|
-
throw new Error(`Named callout argument one must be a tag or number "${s}"`);
|
|
327
|
-
if (o.length === 2 && (typeof i == "number" || !/^[<>X]$/.test(i)))
|
|
328
|
-
throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);
|
|
329
|
-
break;
|
|
330
|
-
case "count":
|
|
331
|
-
case "total_count":
|
|
332
|
-
if (o.length > 1)
|
|
333
|
-
throw new Error(`Named callout allows only one argument "${o}"`);
|
|
334
|
-
if (o.length === 1 && (typeof s == "number" || !/^[<>X]$/.test(s)))
|
|
335
|
-
throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);
|
|
336
|
-
break;
|
|
337
|
-
case "cmp":
|
|
338
|
-
if (o.length !== 3)
|
|
339
|
-
throw new Error(`Named callout must have three arguments "${o}"`);
|
|
340
|
-
if (typeof s == "string" && !/^[A-Za-z_]\w*$/.test(s))
|
|
341
|
-
throw new Error(`Named callout argument one must be a tag or number "${s}"`);
|
|
342
|
-
if (typeof i == "number" || !/^(?:[<>!=]=|[<>])$/.test(i))
|
|
343
|
-
throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);
|
|
344
|
-
if (typeof u == "string" && !/^[A-Za-z_]\w*$/.test(u))
|
|
345
|
-
throw new Error(`Named callout argument three must be a tag or number "${u}"`);
|
|
346
|
-
break;
|
|
347
|
-
case "custom":
|
|
348
|
-
throw new Error(`Undefined callout name "${t}"`);
|
|
349
|
-
default:
|
|
350
|
-
throw new Error(`Unexpected named callout kind "${l}"`);
|
|
351
|
-
}
|
|
352
|
-
return lt(l, r ?? null, (a == null ? void 0 : a.split(",")) ?? null, e);
|
|
353
|
-
}
|
|
354
|
-
function Ve(e) {
|
|
355
|
-
let n = null, t, r;
|
|
356
|
-
if (e[0] === "{") {
|
|
357
|
-
const { minStr: a, maxStr: o } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, s = 1e5;
|
|
358
|
-
if (+a > s || o && +o > s)
|
|
359
|
-
throw new Error("Quantifier value unsupported in Oniguruma");
|
|
360
|
-
if (t = +a, r = o === void 0 ? +a : o === "" ? 1 / 0 : +o, t > r && (n = "possessive", [t, r] = [r, t]), e.endsWith("?")) {
|
|
361
|
-
if (n === "possessive")
|
|
362
|
-
throw new Error('Unsupported possessive interval quantifier chain with "?"');
|
|
363
|
-
n = "lazy";
|
|
364
|
-
} else
|
|
365
|
-
n || (n = "greedy");
|
|
366
|
-
} else
|
|
367
|
-
t = e[0] === "+" ? 1 : 0, r = e[0] === "?" ? 1 : 1 / 0, n = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
|
|
368
|
-
return ct(n, t, r, e);
|
|
369
|
-
}
|
|
370
|
-
function wt(e) {
|
|
371
|
-
const n = e[1].toLowerCase();
|
|
372
|
-
return V({ d: "digit", h: "hex", s: "space", w: "word" }[n], e, { negate: e[1] !== n });
|
|
373
|
-
}
|
|
374
|
-
function mt(e) {
|
|
375
|
-
const { p: n, neg: t, value: r } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
|
|
376
|
-
return V("property", e, { value: r, negate: n === "P" && !t || n === "p" && !!t });
|
|
377
|
-
}
|
|
378
|
-
function He(e) {
|
|
379
|
-
const n = {};
|
|
380
|
-
return e.includes("i") && (n.ignoreCase = !0), e.includes("m") && (n.dotAll = !0), e.includes("x") && (n.extended = !0), Object.keys(n).length ? n : null;
|
|
381
|
-
}
|
|
382
|
-
function yt(e) {
|
|
383
|
-
const n = { ignoreCase: !1, dotAll: !1, extended: !1, digitIsAscii: !1, posixIsAscii: !1, spaceIsAscii: !1, wordIsAscii: !1, textSegmentMode: null };
|
|
384
|
-
for (let t = 0; t < e.length; t++) {
|
|
385
|
-
const r = e[t];
|
|
386
|
-
if (!"imxDPSWy".includes(r))
|
|
387
|
-
throw new Error(`Invalid flag "${r}"`);
|
|
388
|
-
if (r === "y") {
|
|
389
|
-
if (!/^y{[gw]}/.test(e.slice(t)))
|
|
390
|
-
throw new Error('Invalid or unspecified flag "y" mode');
|
|
391
|
-
n.textSegmentMode = e[t + 2] === "g" ? "grapheme" : "word", t += 3;
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
n[{ i: "ignoreCase", m: "dotAll", x: "extended", D: "digitIsAscii", P: "posixIsAscii", S: "spaceIsAscii", W: "wordIsAscii" }[r]] = !0;
|
|
395
|
-
}
|
|
396
|
-
return n;
|
|
397
|
-
}
|
|
398
|
-
function bt(e) {
|
|
399
|
-
if (new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))", "u").test(e))
|
|
400
|
-
throw new Error(`Incomplete or invalid escape "${e}"`);
|
|
401
|
-
const n = e[2] === "{" ? new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)", "u").exec(e).groups.hex : e.slice(2);
|
|
402
|
-
return parseInt(n, 16);
|
|
403
|
-
}
|
|
404
|
-
function Ct(e, n) {
|
|
405
|
-
const { raw: t, inCharClass: r } = e, a = t.slice(1);
|
|
406
|
-
if (!r && (a !== "0" && a.length === 1 || a[0] !== "0" && +a <= n))
|
|
407
|
-
return [hn(t)];
|
|
408
|
-
const o = [], s = a.match(/^[0-7]+|\d/g);
|
|
409
|
-
for (let i = 0; i < s.length; i++) {
|
|
410
|
-
const u = s[i];
|
|
411
|
-
let l;
|
|
412
|
-
if (i === 0 && u !== "8" && u !== "9") {
|
|
413
|
-
if (l = parseInt(u, 8), l > 127)
|
|
414
|
-
throw new Error(x`Octal encoded byte above 177 unsupported "${t}"`);
|
|
415
|
-
} else
|
|
416
|
-
l = te(u);
|
|
417
|
-
o.push(F(l, (i === 0 ? "\\" : "") + u));
|
|
418
|
-
}
|
|
419
|
-
return o;
|
|
420
|
-
}
|
|
421
|
-
function xt(e) {
|
|
422
|
-
const n = [], t = new RegExp(Ue, "gy");
|
|
423
|
-
let r;
|
|
424
|
-
for (; r = t.exec(e); ) {
|
|
425
|
-
const a = r[0];
|
|
426
|
-
if (a[0] === "{") {
|
|
427
|
-
const o = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);
|
|
428
|
-
if (o) {
|
|
429
|
-
const { min: s, max: i } = o.groups;
|
|
430
|
-
if (+s > +i && a.endsWith("?")) {
|
|
431
|
-
t.lastIndex--, n.push(Ve(a.slice(0, -1)));
|
|
432
|
-
continue;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
n.push(Ve(a));
|
|
437
|
-
}
|
|
438
|
-
return n;
|
|
439
|
-
}
|
|
440
|
-
function mn(e, n) {
|
|
441
|
-
if (!Array.isArray(e.body))
|
|
442
|
-
throw new Error("Expected node with body array");
|
|
443
|
-
if (e.body.length !== 1)
|
|
444
|
-
return !1;
|
|
445
|
-
const t = e.body[0];
|
|
446
|
-
return !n || Object.keys(n).every((r) => n[r] === t[r]);
|
|
447
|
-
}
|
|
448
|
-
function kt(e) {
|
|
449
|
-
return Et.has(e.type);
|
|
450
|
-
}
|
|
451
|
-
const Et = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
|
|
452
|
-
function yn(e, n = {}) {
|
|
453
|
-
const t = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...n, rules: { captureGroup: !1, singleline: !1, ...n.rules } }, r = Jn(e, { flags: t.flags, rules: { captureGroup: t.rules.captureGroup, singleline: t.rules.singleline } }), a = (d, g) => {
|
|
454
|
-
const f = r.tokens[o.nextIndex];
|
|
455
|
-
switch (o.parent = d, o.nextIndex++, f.type) {
|
|
456
|
-
case "Alternator":
|
|
457
|
-
return H();
|
|
458
|
-
case "Assertion":
|
|
459
|
-
return $t(f);
|
|
460
|
-
case "Backreference":
|
|
461
|
-
return vt(f, o);
|
|
462
|
-
case "Character":
|
|
463
|
-
return he(f.value, { useLastValid: !!g.isCheckingRangeEnd });
|
|
464
|
-
case "CharacterClassHyphen":
|
|
465
|
-
return At(f, o, g);
|
|
466
|
-
case "CharacterClassOpen":
|
|
467
|
-
return It(f, o, g);
|
|
468
|
-
case "CharacterSet":
|
|
469
|
-
return St(f, o);
|
|
470
|
-
case "Directive":
|
|
471
|
-
return Rt(f.kind, { flags: f.flags });
|
|
472
|
-
case "GroupOpen":
|
|
473
|
-
return _t(f, o, g);
|
|
474
|
-
case "NamedCallout":
|
|
475
|
-
return Ut(f.kind, f.tag, f.arguments);
|
|
476
|
-
case "Quantifier":
|
|
477
|
-
return Nt(f, o);
|
|
478
|
-
case "Subroutine":
|
|
479
|
-
return Mt(f, o);
|
|
480
|
-
default:
|
|
481
|
-
throw new Error(`Unexpected token type "${f.type}"`);
|
|
482
|
-
}
|
|
483
|
-
}, o = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ new Map(), nextIndex: 0, normalizeUnknownPropertyNames: t.normalizeUnknownPropertyNames, parent: null, skipBackrefValidation: t.skipBackrefValidation, skipLookbehindValidation: t.skipLookbehindValidation, skipPropertyNameValidation: t.skipPropertyNameValidation, subroutines: [], tokens: r.tokens, unicodePropertyMap: t.unicodePropertyMap, walk: a }, s = Gt(Ft(r.flags));
|
|
484
|
-
let i = s.body[0];
|
|
485
|
-
for (; o.nextIndex < r.tokens.length; ) {
|
|
486
|
-
const d = a(i, {});
|
|
487
|
-
d.type === "Alternative" ? (s.body.push(d), i = d) : i.body.push(d);
|
|
488
|
-
}
|
|
489
|
-
const { capturingGroups: u, hasNumberedRef: l, namedGroupsByName: p, subroutines: c } = o;
|
|
490
|
-
if (l && p.size && !t.rules.captureGroup)
|
|
491
|
-
throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
492
|
-
for (const { ref: d } of c)
|
|
493
|
-
if (typeof d == "number") {
|
|
494
|
-
if (d > u.length)
|
|
495
|
-
throw new Error("Subroutine uses a group number that's not defined");
|
|
496
|
-
d && (u[d - 1].isSubroutined = !0);
|
|
497
|
-
} else if (p.has(d)) {
|
|
498
|
-
if (p.get(d).length > 1)
|
|
499
|
-
throw new Error(x`Subroutine uses a duplicate group name "\g<${d}>"`);
|
|
500
|
-
p.get(d)[0].isSubroutined = !0;
|
|
501
|
-
} else
|
|
502
|
-
throw new Error(x`Subroutine uses a group name that's not defined "\g<${d}>"`);
|
|
503
|
-
return s;
|
|
504
|
-
}
|
|
505
|
-
function $t({ kind: e }) {
|
|
506
|
-
return Se(re({ "^": "line_start", $: "line_end", "\\A": "string_start", "\\b": "word_boundary", "\\B": "word_boundary", "\\G": "search_start", "\\y": "text_segment_boundary", "\\Y": "text_segment_boundary", "\\z": "string_end", "\\Z": "string_end_newline" }[e], `Unexpected assertion kind "${e}"`), { negate: e === x`\B` || e === x`\Y` });
|
|
507
|
-
}
|
|
508
|
-
function vt({ raw: e }, n) {
|
|
509
|
-
const t = /^\\k[<']/.test(e), r = t ? e.slice(3, -1) : e.slice(1), a = (o, s = !1) => {
|
|
510
|
-
const i = n.capturingGroups.length;
|
|
511
|
-
let u = !1;
|
|
512
|
-
if (o > i)
|
|
513
|
-
if (n.skipBackrefValidation)
|
|
514
|
-
u = !0;
|
|
515
|
-
else
|
|
516
|
-
throw new Error(`Not enough capturing groups defined to the left "${e}"`);
|
|
517
|
-
return n.hasNumberedRef = !0, _e(s ? i + 1 - o : o, { orphan: u });
|
|
518
|
-
};
|
|
519
|
-
if (t) {
|
|
520
|
-
const o = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);
|
|
521
|
-
if (o)
|
|
522
|
-
return a(+o.groups.num, !!o.groups.sign);
|
|
523
|
-
if (/[-+]/.test(r))
|
|
524
|
-
throw new Error(`Invalid backref name "${e}"`);
|
|
525
|
-
if (!n.namedGroupsByName.has(r))
|
|
526
|
-
throw new Error(`Group name not defined to the left "${e}"`);
|
|
527
|
-
return _e(r);
|
|
528
|
-
}
|
|
529
|
-
return a(+r);
|
|
530
|
-
}
|
|
531
|
-
function At(e, n, t) {
|
|
532
|
-
const { tokens: r, walk: a } = n, o = n.parent, s = o.body.at(-1), i = r[n.nextIndex];
|
|
533
|
-
if (!t.isCheckingRangeEnd && s && s.type !== "CharacterClass" && s.type !== "CharacterClassRange" && i && i.type !== "CharacterClassOpen" && i.type !== "CharacterClassClose" && i.type !== "CharacterClassIntersector") {
|
|
534
|
-
const u = a(o, { ...t, isCheckingRangeEnd: !0 });
|
|
535
|
-
if (s.type === "Character" && u.type === "Character")
|
|
536
|
-
return o.body.pop(), Pt(s, u);
|
|
537
|
-
throw new Error("Invalid character class range");
|
|
538
|
-
}
|
|
539
|
-
return he(te("-"));
|
|
540
|
-
}
|
|
541
|
-
function It({ negate: e }, n, t) {
|
|
542
|
-
const { tokens: r, walk: a } = n, o = r[n.nextIndex], s = [fe()];
|
|
543
|
-
let i = qe(o);
|
|
544
|
-
for (; i.type !== "CharacterClassClose"; ) {
|
|
545
|
-
if (i.type === "CharacterClassIntersector")
|
|
546
|
-
s.push(fe()), n.nextIndex++;
|
|
547
|
-
else {
|
|
548
|
-
const l = s.at(-1);
|
|
549
|
-
l.body.push(a(l, t));
|
|
550
|
-
}
|
|
551
|
-
i = qe(r[n.nextIndex], o);
|
|
552
|
-
}
|
|
553
|
-
const u = fe({ negate: e });
|
|
554
|
-
return s.length === 1 ? u.body = s[0].body : (u.kind = "intersection", u.body = s.map((l) => l.body.length === 1 ? l.body[0] : l)), n.nextIndex++, u;
|
|
555
|
-
}
|
|
556
|
-
function St({ kind: e, negate: n, value: t }, r) {
|
|
557
|
-
const { normalizeUnknownPropertyNames: a, skipPropertyNameValidation: o, unicodePropertyMap: s } = r;
|
|
558
|
-
if (e === "property") {
|
|
559
|
-
const i = we(t);
|
|
560
|
-
if (Fe.has(i) && !(s != null && s.has(i)))
|
|
561
|
-
e = "posix", t = i;
|
|
562
|
-
else
|
|
563
|
-
return ne(t, { negate: n, normalizeUnknownPropertyNames: a, skipPropertyNameValidation: o, unicodePropertyMap: s });
|
|
564
|
-
}
|
|
565
|
-
return e === "posix" ? Bt(t, { negate: n }) : Ne(e, { negate: n });
|
|
566
|
-
}
|
|
567
|
-
function _t(e, n, t) {
|
|
568
|
-
const { tokens: r, capturingGroups: a, namedGroupsByName: o, skipLookbehindValidation: s, walk: i } = n, u = Ot(e), l = u.type === "AbsenceFunction", p = Ze(u), c = p && u.negate;
|
|
569
|
-
if (u.type === "CapturingGroup" && (a.push(u), u.name && Yn(o, u.name, []).push(u)), l && t.isInAbsenceFunction)
|
|
570
|
-
throw new Error("Nested absence function not supported by Oniguruma");
|
|
571
|
-
let d = Qe(r[n.nextIndex]);
|
|
572
|
-
for (; d.type !== "GroupClose"; ) {
|
|
573
|
-
if (d.type === "Alternator")
|
|
574
|
-
u.body.push(H()), n.nextIndex++;
|
|
575
|
-
else {
|
|
576
|
-
const g = u.body.at(-1), f = i(g, { ...t, isInAbsenceFunction: t.isInAbsenceFunction || l, isInLookbehind: t.isInLookbehind || p, isInNegLookbehind: t.isInNegLookbehind || c });
|
|
577
|
-
if (g.body.push(f), (p || t.isInLookbehind) && !s) {
|
|
578
|
-
const w = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
579
|
-
if (c || t.isInNegLookbehind) {
|
|
580
|
-
if (Xe(f) || f.type === "CapturingGroup")
|
|
581
|
-
throw new Error(w);
|
|
582
|
-
} else if (Xe(f) || Ze(f) && f.negate)
|
|
583
|
-
throw new Error(w);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
d = Qe(r[n.nextIndex]);
|
|
587
|
-
}
|
|
588
|
-
return n.nextIndex++, u;
|
|
589
|
-
}
|
|
590
|
-
function Nt({ kind: e, min: n, max: t }, r) {
|
|
591
|
-
const a = r.parent, o = a.body.at(-1);
|
|
592
|
-
if (!o || !kt(o))
|
|
593
|
-
throw new Error("Quantifier requires a repeatable token");
|
|
594
|
-
const s = Cn(e, n, t, o);
|
|
595
|
-
return a.body.pop(), s;
|
|
596
|
-
}
|
|
597
|
-
function Mt({ raw: e }, n) {
|
|
598
|
-
const { capturingGroups: t, subroutines: r } = n;
|
|
599
|
-
let a = e.slice(3, -1);
|
|
600
|
-
const o = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);
|
|
601
|
-
if (o) {
|
|
602
|
-
const i = +o.groups.num, u = t.length;
|
|
603
|
-
if (n.hasNumberedRef = !0, a = { "": i, "+": u + i, "-": u + 1 - i }[o.groups.sign], a < 1)
|
|
604
|
-
throw new Error("Invalid subroutine number");
|
|
605
|
-
} else
|
|
606
|
-
a === "0" && (a = 0);
|
|
607
|
-
const s = xn(a);
|
|
608
|
-
return r.push(s), s;
|
|
609
|
-
}
|
|
610
|
-
function Lt(e, n) {
|
|
611
|
-
return { type: "AbsenceFunction", kind: e, body: ue(void 0) };
|
|
612
|
-
}
|
|
613
|
-
function H(e) {
|
|
614
|
-
return { type: "Alternative", body: kn(e == null ? void 0 : e.body) };
|
|
615
|
-
}
|
|
616
|
-
function Se(e, n) {
|
|
617
|
-
const t = { type: "Assertion", kind: e };
|
|
618
|
-
return (e === "word_boundary" || e === "text_segment_boundary") && (t.negate = !!(n != null && n.negate)), t;
|
|
619
|
-
}
|
|
620
|
-
function _e(e, n) {
|
|
621
|
-
const t = !!(n != null && n.orphan);
|
|
622
|
-
return { type: "Backreference", ref: e, ...t && { orphan: t } };
|
|
623
|
-
}
|
|
624
|
-
function bn(e, n) {
|
|
625
|
-
const t = { name: void 0, isSubroutined: !1, ...n };
|
|
626
|
-
if (t.name !== void 0 && !Dt(t.name))
|
|
627
|
-
throw new Error(`Group name "${t.name}" invalid in Oniguruma`);
|
|
628
|
-
return { type: "CapturingGroup", number: e, ...t.name && { name: t.name }, ...t.isSubroutined && { isSubroutined: t.isSubroutined }, body: ue(n == null ? void 0 : n.body) };
|
|
629
|
-
}
|
|
630
|
-
function he(e, n) {
|
|
631
|
-
const t = { useLastValid: !1, ...n };
|
|
632
|
-
if (e > 1114111) {
|
|
633
|
-
const r = e.toString(16);
|
|
634
|
-
if (t.useLastValid)
|
|
635
|
-
e = 1114111;
|
|
636
|
-
else
|
|
637
|
-
throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${r}}"`) : new Error(`Invalid code point out of range in JS "\\x{${r}}"`);
|
|
638
|
-
}
|
|
639
|
-
return { type: "Character", value: e };
|
|
640
|
-
}
|
|
641
|
-
function fe(e) {
|
|
642
|
-
const n = { kind: "union", negate: !1, ...e };
|
|
643
|
-
return { type: "CharacterClass", kind: n.kind, negate: n.negate, body: kn(e == null ? void 0 : e.body) };
|
|
644
|
-
}
|
|
645
|
-
function Pt(e, n) {
|
|
646
|
-
if (n.value < e.value)
|
|
647
|
-
throw new Error("Character class range out of order");
|
|
648
|
-
return { type: "CharacterClassRange", min: e, max: n };
|
|
649
|
-
}
|
|
650
|
-
function Ne(e, n) {
|
|
651
|
-
const t = !!(n != null && n.negate), r = { type: "CharacterSet", kind: e };
|
|
652
|
-
return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (r.negate = t), (e === "text_segment" || e === "newline" && !t) && (r.variableLength = !0), r;
|
|
653
|
-
}
|
|
654
|
-
function Rt(e, n = {}) {
|
|
655
|
-
if (e === "keep")
|
|
656
|
-
return { type: "Directive", kind: e };
|
|
657
|
-
if (e === "flags")
|
|
658
|
-
return { type: "Directive", kind: e, flags: re(n.flags) };
|
|
659
|
-
throw new Error(`Unexpected directive kind "${e}"`);
|
|
660
|
-
}
|
|
661
|
-
function Ft(e) {
|
|
662
|
-
return { type: "Flags", ...e };
|
|
663
|
-
}
|
|
664
|
-
function N(e) {
|
|
665
|
-
const n = e == null ? void 0 : e.atomic, t = e == null ? void 0 : e.flags;
|
|
666
|
-
if (n && t)
|
|
667
|
-
throw new Error("Atomic group cannot have flags");
|
|
668
|
-
return { type: "Group", ...n && { atomic: n }, ...t && { flags: t }, body: ue(e == null ? void 0 : e.body) };
|
|
669
|
-
}
|
|
670
|
-
function z(e) {
|
|
671
|
-
const n = { behind: !1, negate: !1, ...e };
|
|
672
|
-
return { type: "LookaroundAssertion", kind: n.behind ? "lookbehind" : "lookahead", negate: n.negate, body: ue(e == null ? void 0 : e.body) };
|
|
673
|
-
}
|
|
674
|
-
function Ut(e, n, t) {
|
|
675
|
-
return { type: "NamedCallout", kind: e, tag: n, arguments: t };
|
|
676
|
-
}
|
|
677
|
-
function Bt(e, n) {
|
|
678
|
-
const t = !!(n != null && n.negate);
|
|
679
|
-
if (!Fe.has(e))
|
|
680
|
-
throw new Error(`Invalid POSIX class "${e}"`);
|
|
681
|
-
return { type: "CharacterSet", kind: "posix", value: e, negate: t };
|
|
682
|
-
}
|
|
683
|
-
function Cn(e, n, t, r) {
|
|
684
|
-
if (n > t)
|
|
685
|
-
throw new Error("Invalid reversed quantifier range");
|
|
686
|
-
return { type: "Quantifier", kind: e, min: n, max: t, body: r };
|
|
687
|
-
}
|
|
688
|
-
function Gt(e, n) {
|
|
689
|
-
return { type: "Regex", body: ue(void 0), flags: e };
|
|
690
|
-
}
|
|
691
|
-
function xn(e) {
|
|
692
|
-
return { type: "Subroutine", ref: e };
|
|
693
|
-
}
|
|
694
|
-
function ne(e, n) {
|
|
695
|
-
var t;
|
|
696
|
-
const r = { negate: !1, normalizeUnknownPropertyNames: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...n };
|
|
697
|
-
let a = (t = r.unicodePropertyMap) == null ? void 0 : t.get(we(e));
|
|
698
|
-
if (!a) {
|
|
699
|
-
if (r.normalizeUnknownPropertyNames)
|
|
700
|
-
a = Tt(e);
|
|
701
|
-
else if (r.unicodePropertyMap && !r.skipPropertyNameValidation)
|
|
702
|
-
throw new Error(x`Invalid Unicode property "\p{${e}}"`);
|
|
703
|
-
}
|
|
704
|
-
return { type: "CharacterSet", kind: "property", value: a ?? e, negate: r.negate };
|
|
705
|
-
}
|
|
706
|
-
function Ot({ flags: e, kind: n, name: t, negate: r, number: a }) {
|
|
707
|
-
switch (n) {
|
|
708
|
-
case "absence_repeater":
|
|
709
|
-
return Lt("repeater");
|
|
710
|
-
case "atomic":
|
|
711
|
-
return N({ atomic: !0 });
|
|
712
|
-
case "capturing":
|
|
713
|
-
return bn(a, { name: t });
|
|
714
|
-
case "group":
|
|
715
|
-
return N({ flags: e });
|
|
716
|
-
case "lookahead":
|
|
717
|
-
case "lookbehind":
|
|
718
|
-
return z({ behind: n === "lookbehind", negate: r });
|
|
719
|
-
default:
|
|
720
|
-
throw new Error(`Unexpected group kind "${n}"`);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
function ue(e) {
|
|
724
|
-
if (e === void 0)
|
|
725
|
-
e = [H()];
|
|
726
|
-
else if (!Array.isArray(e) || !e.length || !e.every((n) => n.type === "Alternative"))
|
|
727
|
-
throw new Error("Invalid body; expected array of one or more Alternative nodes");
|
|
728
|
-
return e;
|
|
729
|
-
}
|
|
730
|
-
function kn(e) {
|
|
731
|
-
if (e === void 0)
|
|
732
|
-
e = [];
|
|
733
|
-
else if (!Array.isArray(e) || !e.every((n) => !!n.type))
|
|
734
|
-
throw new Error("Invalid body; expected array of nodes");
|
|
735
|
-
return e;
|
|
736
|
-
}
|
|
737
|
-
function Xe(e) {
|
|
738
|
-
return e.type === "LookaroundAssertion" && e.kind === "lookahead";
|
|
739
|
-
}
|
|
740
|
-
function Ze(e) {
|
|
741
|
-
return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
|
|
742
|
-
}
|
|
743
|
-
function Dt(e) {
|
|
744
|
-
return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
|
|
745
|
-
}
|
|
746
|
-
function Tt(e) {
|
|
747
|
-
return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (n) => n[0].toUpperCase() + n.slice(1).toLowerCase());
|
|
748
|
-
}
|
|
749
|
-
function we(e) {
|
|
750
|
-
return e.replace(/[- _]+/g, "").toLowerCase();
|
|
751
|
-
}
|
|
752
|
-
function qe(e, n) {
|
|
753
|
-
return re(e, `${(n == null ? void 0 : n.type) === "Character" && n.value === 93 ? "Empty" : "Unclosed"} character class`);
|
|
754
|
-
}
|
|
755
|
-
function Qe(e) {
|
|
756
|
-
return re(e, "Unclosed group");
|
|
757
|
-
}
|
|
758
|
-
function se(e, n, t = null) {
|
|
759
|
-
function r(o, s) {
|
|
760
|
-
for (let i = 0; i < o.length; i++) {
|
|
761
|
-
const u = a(o[i], s, i, o);
|
|
762
|
-
i = Math.max(-1, i + u);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
function a(o, s = null, i = null, u = null) {
|
|
766
|
-
var l, p;
|
|
767
|
-
let c = 0, d = !1;
|
|
768
|
-
const g = { node: o, parent: s, key: i, container: u, root: e, remove() {
|
|
769
|
-
ce(u).splice(Math.max(0, q(i) + c), 1), c--, d = !0;
|
|
770
|
-
}, removeAllNextSiblings() {
|
|
771
|
-
return ce(u).splice(q(i) + 1);
|
|
772
|
-
}, removeAllPrevSiblings() {
|
|
773
|
-
const y = q(i) + c;
|
|
774
|
-
return c -= y, ce(u).splice(0, Math.max(0, y));
|
|
775
|
-
}, replaceWith(y, k = {}) {
|
|
776
|
-
const S = !!k.traverse;
|
|
777
|
-
u ? u[Math.max(0, q(i) + c)] = y : re(s, "Can't replace root node")[i] = y, S && a(y, s, i, u), d = !0;
|
|
778
|
-
}, replaceWithMultiple(y, k = {}) {
|
|
779
|
-
const S = !!k.traverse;
|
|
780
|
-
if (ce(u).splice(Math.max(0, q(i) + c), 1, ...y), c += y.length - 1, S) {
|
|
781
|
-
let D = 0;
|
|
782
|
-
for (let _ = 0; _ < y.length; _++)
|
|
783
|
-
D += a(y[_], s, q(i) + _ + D, u);
|
|
784
|
-
}
|
|
785
|
-
d = !0;
|
|
786
|
-
}, skip() {
|
|
787
|
-
d = !0;
|
|
788
|
-
} }, { type: f } = o, w = n["*"], m = n[f], M = typeof w == "function" ? w : w == null ? void 0 : w.enter, $ = typeof m == "function" ? m : m == null ? void 0 : m.enter;
|
|
789
|
-
if (M == null || M(g, t), $ == null || $(g, t), !d)
|
|
790
|
-
switch (f) {
|
|
791
|
-
case "AbsenceFunction":
|
|
792
|
-
case "CapturingGroup":
|
|
793
|
-
case "Group":
|
|
794
|
-
r(o.body, o);
|
|
795
|
-
break;
|
|
796
|
-
case "Alternative":
|
|
797
|
-
case "CharacterClass":
|
|
798
|
-
r(o.body, o);
|
|
799
|
-
break;
|
|
800
|
-
case "Assertion":
|
|
801
|
-
case "Backreference":
|
|
802
|
-
case "Character":
|
|
803
|
-
case "CharacterSet":
|
|
804
|
-
case "Directive":
|
|
805
|
-
case "Flags":
|
|
806
|
-
case "NamedCallout":
|
|
807
|
-
case "Subroutine":
|
|
808
|
-
break;
|
|
809
|
-
case "CharacterClassRange":
|
|
810
|
-
a(o.min, o, "min"), a(o.max, o, "max");
|
|
811
|
-
break;
|
|
812
|
-
case "LookaroundAssertion":
|
|
813
|
-
r(o.body, o);
|
|
814
|
-
break;
|
|
815
|
-
case "Quantifier":
|
|
816
|
-
a(o.body, o, "body");
|
|
817
|
-
break;
|
|
818
|
-
case "Regex":
|
|
819
|
-
r(o.body, o), a(o.flags, o, "flags");
|
|
820
|
-
break;
|
|
821
|
-
default:
|
|
822
|
-
throw new Error(`Unexpected node type "${f}"`);
|
|
823
|
-
}
|
|
824
|
-
return (l = m == null ? void 0 : m.exit) == null || l.call(m, g, t), (p = w == null ? void 0 : w.exit) == null || p.call(w, g, t), c;
|
|
825
|
-
}
|
|
826
|
-
return a(e), e;
|
|
827
|
-
}
|
|
828
|
-
function ce(e) {
|
|
829
|
-
if (!Array.isArray(e))
|
|
830
|
-
throw new Error("Container expected");
|
|
831
|
-
return e;
|
|
832
|
-
}
|
|
833
|
-
function q(e) {
|
|
834
|
-
if (typeof e != "number")
|
|
835
|
-
throw new Error("Numeric key expected");
|
|
836
|
-
return e;
|
|
837
|
-
}
|
|
838
|
-
const Wt = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
|
|
839
|
-
function jt(e, n) {
|
|
840
|
-
for (let t = 0; t < e.length; t++)
|
|
841
|
-
e[t] >= n && e[t]++;
|
|
842
|
-
}
|
|
843
|
-
function zt(e, n, t, r) {
|
|
844
|
-
return e.slice(0, n) + r + e.slice(n + t.length);
|
|
845
|
-
}
|
|
846
|
-
const I = Object.freeze({
|
|
847
|
-
DEFAULT: "DEFAULT",
|
|
848
|
-
CHAR_CLASS: "CHAR_CLASS"
|
|
849
|
-
});
|
|
850
|
-
function Be(e, n, t, r) {
|
|
851
|
-
const a = new RegExp(String.raw`${n}|(?<$skip>\[\^?|\\?.)`, "gsu"), o = [!1];
|
|
852
|
-
let s = 0, i = "";
|
|
853
|
-
for (const u of e.matchAll(a)) {
|
|
854
|
-
const { 0: l, groups: { $skip: p } } = u;
|
|
855
|
-
if (!p && (!r || r === I.DEFAULT == !s)) {
|
|
856
|
-
t instanceof Function ? i += t(u, {
|
|
857
|
-
context: s ? I.CHAR_CLASS : I.DEFAULT,
|
|
858
|
-
negated: o[o.length - 1]
|
|
859
|
-
}) : i += t;
|
|
860
|
-
continue;
|
|
861
|
-
}
|
|
862
|
-
l[0] === "[" ? (s++, o.push(l[1] === "^")) : l === "]" && s && (s--, o.pop()), i += l;
|
|
863
|
-
}
|
|
864
|
-
return i;
|
|
865
|
-
}
|
|
866
|
-
function En(e, n, t, r) {
|
|
867
|
-
Be(e, n, t, r);
|
|
868
|
-
}
|
|
869
|
-
function Vt(e, n, t = 0, r) {
|
|
870
|
-
if (!new RegExp(n, "su").test(e))
|
|
871
|
-
return null;
|
|
872
|
-
const a = new RegExp(`${n}|(?<$skip>\\\\?.)`, "gsu");
|
|
873
|
-
a.lastIndex = t;
|
|
874
|
-
let o = 0, s;
|
|
875
|
-
for (; s = a.exec(e); ) {
|
|
876
|
-
const { 0: i, groups: { $skip: u } } = s;
|
|
877
|
-
if (!u && (!r || r === I.DEFAULT == !o))
|
|
878
|
-
return s;
|
|
879
|
-
i === "[" ? o++ : i === "]" && o && o--, a.lastIndex == s.index && a.lastIndex++;
|
|
880
|
-
}
|
|
881
|
-
return null;
|
|
882
|
-
}
|
|
883
|
-
function pe(e, n, t) {
|
|
884
|
-
return !!Vt(e, n, 0, t);
|
|
885
|
-
}
|
|
886
|
-
function Ht(e, n) {
|
|
887
|
-
const t = /\\?./gsu;
|
|
888
|
-
t.lastIndex = n;
|
|
889
|
-
let r = e.length, a = 0, o = 1, s;
|
|
890
|
-
for (; s = t.exec(e); ) {
|
|
891
|
-
const [i] = s;
|
|
892
|
-
if (i === "[")
|
|
893
|
-
a++;
|
|
894
|
-
else if (a)
|
|
895
|
-
i === "]" && a--;
|
|
896
|
-
else if (i === "(")
|
|
897
|
-
o++;
|
|
898
|
-
else if (i === ")" && (o--, !o)) {
|
|
899
|
-
r = s.index;
|
|
900
|
-
break;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return e.slice(n, r);
|
|
904
|
-
}
|
|
905
|
-
const Ke = new RegExp(String.raw`(?<noncapturingStart>${Wt})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
|
|
906
|
-
function Xt(e, n) {
|
|
907
|
-
const t = (n == null ? void 0 : n.hiddenCaptures) ?? [];
|
|
908
|
-
let r = (n == null ? void 0 : n.captureTransfers) ?? /* @__PURE__ */ new Map();
|
|
909
|
-
if (!/\(\?>/.test(e))
|
|
910
|
-
return {
|
|
911
|
-
pattern: e,
|
|
912
|
-
captureTransfers: r,
|
|
913
|
-
hiddenCaptures: t
|
|
914
|
-
};
|
|
915
|
-
const a = "(?>", o = "(?:(?=(", s = [0], i = [];
|
|
916
|
-
let u = 0, l = 0, p = NaN, c;
|
|
917
|
-
do {
|
|
918
|
-
c = !1;
|
|
919
|
-
let d = 0, g = 0, f = !1, w;
|
|
920
|
-
for (Ke.lastIndex = Number.isNaN(p) ? 0 : p + o.length; w = Ke.exec(e); ) {
|
|
921
|
-
const { 0: m, index: M, groups: { capturingStart: $, noncapturingStart: y } } = w;
|
|
922
|
-
if (m === "[")
|
|
923
|
-
d++;
|
|
924
|
-
else if (d)
|
|
925
|
-
m === "]" && d--;
|
|
926
|
-
else if (m === a && !f)
|
|
927
|
-
p = M, f = !0;
|
|
928
|
-
else if (f && y)
|
|
929
|
-
g++;
|
|
930
|
-
else if ($)
|
|
931
|
-
f ? g++ : (u++, s.push(u + l));
|
|
932
|
-
else if (m === ")" && f) {
|
|
933
|
-
if (!g) {
|
|
934
|
-
l++;
|
|
935
|
-
const k = u + l;
|
|
936
|
-
if (e = `${e.slice(0, p)}${o}${e.slice(p + a.length, M)}))<$$${k}>)${e.slice(M + 1)}`, c = !0, i.push(k), jt(t, k), r.size) {
|
|
937
|
-
const S = /* @__PURE__ */ new Map();
|
|
938
|
-
r.forEach((D, _) => {
|
|
939
|
-
S.set(
|
|
940
|
-
_ >= k ? _ + 1 : _,
|
|
941
|
-
D.map((X) => X >= k ? X + 1 : X)
|
|
942
|
-
);
|
|
943
|
-
}), r = S;
|
|
944
|
-
}
|
|
945
|
-
break;
|
|
946
|
-
}
|
|
947
|
-
g--;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
} while (c);
|
|
951
|
-
return t.push(...i), e = Be(
|
|
952
|
-
e,
|
|
953
|
-
String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
|
|
954
|
-
({ 0: d, groups: { backrefNum: g, wrappedBackrefNum: f } }) => {
|
|
955
|
-
if (g) {
|
|
956
|
-
const w = +g;
|
|
957
|
-
if (w > s.length - 1)
|
|
958
|
-
throw new Error(`Backref "${d}" greater than number of captures`);
|
|
959
|
-
return `\\${s[w]}`;
|
|
960
|
-
}
|
|
961
|
-
return `\\${f}`;
|
|
962
|
-
},
|
|
963
|
-
I.DEFAULT
|
|
964
|
-
), {
|
|
965
|
-
pattern: e,
|
|
966
|
-
captureTransfers: r,
|
|
967
|
-
hiddenCaptures: t
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
const $n = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`, be = new RegExp(String.raw`
|
|
971
|
-
\\(?: \d+
|
|
972
|
-
| c[A-Za-z]
|
|
973
|
-
| [gk]<[^>]+>
|
|
974
|
-
| [pPu]\{[^\}]+\}
|
|
975
|
-
| u[A-Fa-f\d]{4}
|
|
976
|
-
| x[A-Fa-f\d]{2}
|
|
977
|
-
)
|
|
978
|
-
| \((?: \? (?: [:=!>]
|
|
979
|
-
| <(?:[=!]|[^>]+>)
|
|
980
|
-
| [A-Za-z\-]+:
|
|
981
|
-
| \(DEFINE\)
|
|
982
|
-
))?
|
|
983
|
-
| (?<qBase>${$n})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
984
|
-
| \\?.
|
|
985
|
-
`.replace(/\s+/g, ""), "gsu");
|
|
986
|
-
function Zt(e) {
|
|
987
|
-
if (!new RegExp(`${$n}\\+`).test(e))
|
|
988
|
-
return {
|
|
989
|
-
pattern: e
|
|
990
|
-
};
|
|
991
|
-
const n = [];
|
|
992
|
-
let t = null, r = null, a = "", o = 0, s;
|
|
993
|
-
for (be.lastIndex = 0; s = be.exec(e); ) {
|
|
994
|
-
const { 0: i, index: u, groups: { qBase: l, qMod: p, invalidQ: c } } = s;
|
|
995
|
-
if (i === "[")
|
|
996
|
-
o || (r = u), o++;
|
|
997
|
-
else if (i === "]")
|
|
998
|
-
o ? o-- : r = null;
|
|
999
|
-
else if (!o)
|
|
1000
|
-
if (p === "+" && a && !a.startsWith("(")) {
|
|
1001
|
-
if (c)
|
|
1002
|
-
throw new Error(`Invalid quantifier "${i}"`);
|
|
1003
|
-
let d = -1;
|
|
1004
|
-
if (/^\{\d+\}$/.test(l))
|
|
1005
|
-
e = zt(e, u + l.length, p, "");
|
|
1006
|
-
else {
|
|
1007
|
-
if (a === ")" || a === "]") {
|
|
1008
|
-
const g = a === ")" ? t : r;
|
|
1009
|
-
if (g === null)
|
|
1010
|
-
throw new Error(`Invalid unmatched "${a}"`);
|
|
1011
|
-
e = `${e.slice(0, g)}(?>${e.slice(g, u)}${l})${e.slice(u + i.length)}`;
|
|
1012
|
-
} else
|
|
1013
|
-
e = `${e.slice(0, u - a.length)}(?>${a}${l})${e.slice(u + i.length)}`;
|
|
1014
|
-
d += 4;
|
|
1015
|
-
}
|
|
1016
|
-
be.lastIndex += d;
|
|
1017
|
-
} else
|
|
1018
|
-
i[0] === "(" ? n.push(u) : i === ")" && (t = n.length ? n.pop() : null);
|
|
1019
|
-
a = i;
|
|
1020
|
-
}
|
|
1021
|
-
return {
|
|
1022
|
-
pattern: e
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
const v = String.raw, qt = v`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`, Me = v`\(\?R=(?<rDepth>[^\)]+)\)|${qt}`, me = v`\(\?<(?![=!])(?<captureName>[^>]+)>`, vn = v`${me}|(?<unnamed>\()(?!\?)`, T = new RegExp(v`${me}|${Me}|\(\?|\\?.`, "gsu"), Ce = "Cannot use multiple overlapping recursions";
|
|
1026
|
-
function Qt(e, n) {
|
|
1027
|
-
const { hiddenCaptures: t, mode: r } = {
|
|
1028
|
-
hiddenCaptures: [],
|
|
1029
|
-
mode: "plugin",
|
|
1030
|
-
...n
|
|
1031
|
-
};
|
|
1032
|
-
let a = (n == null ? void 0 : n.captureTransfers) ?? /* @__PURE__ */ new Map();
|
|
1033
|
-
if (!new RegExp(Me, "su").test(e))
|
|
1034
|
-
return {
|
|
1035
|
-
pattern: e,
|
|
1036
|
-
captureTransfers: a,
|
|
1037
|
-
hiddenCaptures: t
|
|
1038
|
-
};
|
|
1039
|
-
if (r === "plugin" && pe(e, v`\(\?\(DEFINE\)`, I.DEFAULT))
|
|
1040
|
-
throw new Error("DEFINE groups cannot be used with recursion");
|
|
1041
|
-
const o = [], s = pe(e, v`\\[1-9]`, I.DEFAULT), i = /* @__PURE__ */ new Map(), u = [];
|
|
1042
|
-
let l = !1, p = 0, c = 0, d;
|
|
1043
|
-
for (T.lastIndex = 0; d = T.exec(e); ) {
|
|
1044
|
-
const { 0: g, groups: { captureName: f, rDepth: w, gRNameOrNum: m, gRDepth: M } } = d;
|
|
1045
|
-
if (g === "[")
|
|
1046
|
-
p++;
|
|
1047
|
-
else if (p)
|
|
1048
|
-
g === "]" && p--;
|
|
1049
|
-
else if (w) {
|
|
1050
|
-
if (Ye(w), l)
|
|
1051
|
-
throw new Error(Ce);
|
|
1052
|
-
if (s)
|
|
1053
|
-
throw new Error(
|
|
1054
|
-
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
1055
|
-
// gone through conversion from named to numbered, so avoid a misleading error
|
|
1056
|
-
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
|
|
1057
|
-
);
|
|
1058
|
-
const $ = e.slice(0, d.index), y = e.slice(T.lastIndex);
|
|
1059
|
-
if (pe(y, Me, I.DEFAULT))
|
|
1060
|
-
throw new Error(Ce);
|
|
1061
|
-
const k = +w - 1;
|
|
1062
|
-
e = Je(
|
|
1063
|
-
$,
|
|
1064
|
-
y,
|
|
1065
|
-
k,
|
|
1066
|
-
!1,
|
|
1067
|
-
t,
|
|
1068
|
-
o,
|
|
1069
|
-
c
|
|
1070
|
-
), a = nn(
|
|
1071
|
-
a,
|
|
1072
|
-
$,
|
|
1073
|
-
k,
|
|
1074
|
-
o.length,
|
|
1075
|
-
0,
|
|
1076
|
-
c
|
|
1077
|
-
);
|
|
1078
|
-
break;
|
|
1079
|
-
} else if (m) {
|
|
1080
|
-
Ye(M);
|
|
1081
|
-
let $ = !1;
|
|
1082
|
-
for (const oe of u)
|
|
1083
|
-
if (oe.name === m || oe.num === +m) {
|
|
1084
|
-
if ($ = !0, oe.hasRecursedWithin)
|
|
1085
|
-
throw new Error(Ce);
|
|
1086
|
-
break;
|
|
1087
|
-
}
|
|
1088
|
-
if (!$)
|
|
1089
|
-
throw new Error(v`Recursive \g cannot be used outside the referenced group "${r === "external" ? m : v`\g<${m}&R=${M}>`}"`);
|
|
1090
|
-
const y = i.get(m), k = Ht(e, y);
|
|
1091
|
-
if (s && pe(k, v`${me}|\((?!\?)`, I.DEFAULT))
|
|
1092
|
-
throw new Error(
|
|
1093
|
-
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
1094
|
-
// gone through conversion from named to numbered, so avoid a misleading error
|
|
1095
|
-
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
|
|
1096
|
-
);
|
|
1097
|
-
const S = e.slice(y, d.index), D = k.slice(S.length + g.length), _ = o.length, X = +M - 1, De = Je(
|
|
1098
|
-
S,
|
|
1099
|
-
D,
|
|
1100
|
-
X,
|
|
1101
|
-
!0,
|
|
1102
|
-
t,
|
|
1103
|
-
o,
|
|
1104
|
-
c
|
|
1105
|
-
);
|
|
1106
|
-
a = nn(
|
|
1107
|
-
a,
|
|
1108
|
-
S,
|
|
1109
|
-
X,
|
|
1110
|
-
o.length - _,
|
|
1111
|
-
_,
|
|
1112
|
-
c
|
|
1113
|
-
);
|
|
1114
|
-
const Bn = e.slice(0, y), Gn = e.slice(y + k.length);
|
|
1115
|
-
e = `${Bn}${De}${Gn}`, T.lastIndex += De.length - g.length - S.length - D.length, u.forEach((oe) => oe.hasRecursedWithin = !0), l = !0;
|
|
1116
|
-
} else if (f)
|
|
1117
|
-
c++, i.set(String(c), T.lastIndex), i.set(f, T.lastIndex), u.push({
|
|
1118
|
-
num: c,
|
|
1119
|
-
name: f
|
|
1120
|
-
});
|
|
1121
|
-
else if (g[0] === "(") {
|
|
1122
|
-
const $ = g === "(";
|
|
1123
|
-
$ && (c++, i.set(String(c), T.lastIndex)), u.push($ ? { num: c } : {});
|
|
1124
|
-
} else
|
|
1125
|
-
g === ")" && u.pop();
|
|
1126
|
-
}
|
|
1127
|
-
return t.push(...o), {
|
|
1128
|
-
pattern: e,
|
|
1129
|
-
captureTransfers: a,
|
|
1130
|
-
hiddenCaptures: t
|
|
1131
|
-
};
|
|
1132
|
-
}
|
|
1133
|
-
function Ye(e) {
|
|
1134
|
-
const n = `Max depth must be integer between 2 and 100; used ${e}`;
|
|
1135
|
-
if (!/^[1-9]\d*$/.test(e))
|
|
1136
|
-
throw new Error(n);
|
|
1137
|
-
if (e = +e, e < 2 || e > 100)
|
|
1138
|
-
throw new Error(n);
|
|
1139
|
-
}
|
|
1140
|
-
function Je(e, n, t, r, a, o, s) {
|
|
1141
|
-
const i = /* @__PURE__ */ new Set();
|
|
1142
|
-
r && En(e + n, me, ({ groups: { captureName: l } }) => {
|
|
1143
|
-
i.add(l);
|
|
1144
|
-
}, I.DEFAULT);
|
|
1145
|
-
const u = [
|
|
1146
|
-
t,
|
|
1147
|
-
r ? i : null,
|
|
1148
|
-
a,
|
|
1149
|
-
o,
|
|
1150
|
-
s
|
|
1151
|
-
];
|
|
1152
|
-
return `${e}${en(`(?:${e}`, "forward", ...u)}(?:)${en(`${n})`, "backward", ...u)}${n}`;
|
|
1153
|
-
}
|
|
1154
|
-
function en(e, n, t, r, a, o, s) {
|
|
1155
|
-
const i = (l) => n === "forward" ? l + 2 : t - l + 2 - 1;
|
|
1156
|
-
let u = "";
|
|
1157
|
-
for (let l = 0; l < t; l++) {
|
|
1158
|
-
const p = i(l);
|
|
1159
|
-
u += Be(
|
|
1160
|
-
e,
|
|
1161
|
-
v`${vn}|\\k<(?<backref>[^>]+)>`,
|
|
1162
|
-
({ 0: c, groups: { captureName: d, unnamed: g, backref: f } }) => {
|
|
1163
|
-
if (f && r && !r.has(f))
|
|
1164
|
-
return c;
|
|
1165
|
-
const w = `_$${p}`;
|
|
1166
|
-
if (g || d) {
|
|
1167
|
-
const m = s + o.length + 1;
|
|
1168
|
-
return o.push(m), Kt(a, m), g ? c : `(?<${d}${w}>`;
|
|
1169
|
-
}
|
|
1170
|
-
return v`\k<${f}${w}>`;
|
|
1171
|
-
},
|
|
1172
|
-
I.DEFAULT
|
|
1173
|
-
);
|
|
1174
|
-
}
|
|
1175
|
-
return u;
|
|
1176
|
-
}
|
|
1177
|
-
function Kt(e, n) {
|
|
1178
|
-
for (let t = 0; t < e.length; t++)
|
|
1179
|
-
e[t] >= n && e[t]++;
|
|
1180
|
-
}
|
|
1181
|
-
function nn(e, n, t, r, a, o) {
|
|
1182
|
-
if (e.size && r) {
|
|
1183
|
-
let s = 0;
|
|
1184
|
-
En(n, vn, () => s++, I.DEFAULT);
|
|
1185
|
-
const i = o - s + a, u = /* @__PURE__ */ new Map();
|
|
1186
|
-
return e.forEach((l, p) => {
|
|
1187
|
-
const c = (r - s * t) / t, d = s * t, g = p > i + s ? p + r : p, f = [];
|
|
1188
|
-
for (const w of l)
|
|
1189
|
-
if (w <= i)
|
|
1190
|
-
f.push(w);
|
|
1191
|
-
else if (w > i + s + c)
|
|
1192
|
-
f.push(w + r);
|
|
1193
|
-
else if (w <= i + s)
|
|
1194
|
-
for (let m = 0; m <= t; m++)
|
|
1195
|
-
f.push(w + s * m);
|
|
1196
|
-
else
|
|
1197
|
-
for (let m = 0; m <= t; m++)
|
|
1198
|
-
f.push(w + d + c * m);
|
|
1199
|
-
u.set(g, f);
|
|
1200
|
-
}), u;
|
|
1201
|
-
}
|
|
1202
|
-
return e;
|
|
1203
|
-
}
|
|
1204
|
-
var C = String.fromCodePoint, h = String.raw, U = {
|
|
1205
|
-
flagGroups: (() => {
|
|
1206
|
-
try {
|
|
1207
|
-
new RegExp("(?i:)");
|
|
1208
|
-
} catch {
|
|
1209
|
-
return !1;
|
|
1210
|
-
}
|
|
1211
|
-
return !0;
|
|
1212
|
-
})(),
|
|
1213
|
-
unicodeSets: (() => {
|
|
1214
|
-
try {
|
|
1215
|
-
new RegExp("[[]]", "v");
|
|
1216
|
-
} catch {
|
|
1217
|
-
return !1;
|
|
1218
|
-
}
|
|
1219
|
-
return !0;
|
|
1220
|
-
})()
|
|
1221
|
-
};
|
|
1222
|
-
U.bugFlagVLiteralHyphenIsRange = U.unicodeSets ? (() => {
|
|
1223
|
-
try {
|
|
1224
|
-
new RegExp(h`[\d\-a]`, "v");
|
|
1225
|
-
} catch {
|
|
1226
|
-
return !0;
|
|
1227
|
-
}
|
|
1228
|
-
return !1;
|
|
1229
|
-
})() : !1;
|
|
1230
|
-
U.bugNestedClassIgnoresNegation = U.unicodeSets && new RegExp("[[^a]]", "v").test("a");
|
|
1231
|
-
function ge(e, { enable: n, disable: t }) {
|
|
1232
|
-
return {
|
|
1233
|
-
dotAll: !(t != null && t.dotAll) && !!(n != null && n.dotAll || e.dotAll),
|
|
1234
|
-
ignoreCase: !(t != null && t.ignoreCase) && !!(n != null && n.ignoreCase || e.ignoreCase)
|
|
1235
|
-
};
|
|
1236
|
-
}
|
|
1237
|
-
function ie(e, n, t) {
|
|
1238
|
-
return e.has(n) || e.set(n, t), e.get(n);
|
|
1239
|
-
}
|
|
1240
|
-
function Le(e, n) {
|
|
1241
|
-
return tn[e] >= tn[n];
|
|
1242
|
-
}
|
|
1243
|
-
function Yt(e, n) {
|
|
1244
|
-
if (e == null)
|
|
1245
|
-
throw new Error(n ?? "Value expected");
|
|
1246
|
-
return e;
|
|
1247
|
-
}
|
|
1248
|
-
var tn = {
|
|
1249
|
-
ES2025: 2025,
|
|
1250
|
-
ES2024: 2024,
|
|
1251
|
-
ES2018: 2018
|
|
1252
|
-
}, Jt = (
|
|
1253
|
-
/** @type {const} */
|
|
1254
|
-
{
|
|
1255
|
-
auto: "auto",
|
|
1256
|
-
ES2025: "ES2025",
|
|
1257
|
-
ES2024: "ES2024",
|
|
1258
|
-
ES2018: "ES2018"
|
|
1259
|
-
}
|
|
1260
|
-
);
|
|
1261
|
-
function An(e = {}) {
|
|
1262
|
-
if ({}.toString.call(e) !== "[object Object]")
|
|
1263
|
-
throw new Error("Unexpected options");
|
|
1264
|
-
if (e.target !== void 0 && !Jt[e.target])
|
|
1265
|
-
throw new Error(`Unexpected target "${e.target}"`);
|
|
1266
|
-
const n = {
|
|
1267
|
-
// Sets the level of emulation rigor/strictness.
|
|
1268
|
-
accuracy: "default",
|
|
1269
|
-
// Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in
|
|
1270
|
-
// certain patterns not being emulatable.
|
|
1271
|
-
avoidSubclass: !1,
|
|
1272
|
-
// Oniguruma flags; a string with `i`, `m`, `x`, `D`, `S`, `W`, `y{g}` in any order (all
|
|
1273
|
-
// optional). Oniguruma's `m` is equivalent to JavaScript's `s` (`dotAll`).
|
|
1274
|
-
flags: "",
|
|
1275
|
-
// Include JavaScript flag `g` (`global`) in the result.
|
|
1276
|
-
global: !1,
|
|
1277
|
-
// Include JavaScript flag `d` (`hasIndices`) in the result.
|
|
1278
|
-
hasIndices: !1,
|
|
1279
|
-
// Delay regex construction until first use if the transpiled pattern is at least this length.
|
|
1280
|
-
lazyCompileLength: 1 / 0,
|
|
1281
|
-
// JavaScript version used for generated regexes. Using `auto` detects the best value based on
|
|
1282
|
-
// your environment. Later targets allow faster processing, simpler generated source, and
|
|
1283
|
-
// support for additional features.
|
|
1284
|
-
target: "auto",
|
|
1285
|
-
// Disables minifications that simplify the pattern without changing the meaning.
|
|
1286
|
-
verbose: !1,
|
|
1287
|
-
...e,
|
|
1288
|
-
// Advanced options that override standard behavior, error checking, and flags when enabled.
|
|
1289
|
-
rules: {
|
|
1290
|
-
// Useful with TextMate grammars that merge backreferences across patterns.
|
|
1291
|
-
allowOrphanBackrefs: !1,
|
|
1292
|
-
// Use ASCII `\b` and `\B`, which increases search performance of generated regexes.
|
|
1293
|
-
asciiWordBoundaries: !1,
|
|
1294
|
-
// Allow unnamed captures and numbered calls (backreferences and subroutines) when using
|
|
1295
|
-
// named capture. This is Oniguruma option `ONIG_OPTION_CAPTURE_GROUP`; on by default in
|
|
1296
|
-
// `vscode-oniguruma`.
|
|
1297
|
-
captureGroup: !1,
|
|
1298
|
-
// Change the recursion depth limit from Oniguruma's `20` to an integer `2`–`20`.
|
|
1299
|
-
recursionLimit: 20,
|
|
1300
|
-
// `^` as `\A`; `$` as`\Z`. Improves search performance of generated regexes without changing
|
|
1301
|
-
// the meaning if searching line by line. This is Oniguruma option `ONIG_OPTION_SINGLELINE`.
|
|
1302
|
-
singleline: !1,
|
|
1303
|
-
...e.rules
|
|
1304
|
-
}
|
|
1305
|
-
};
|
|
1306
|
-
return n.target === "auto" && (n.target = U.flagGroups ? "ES2025" : U.unicodeSets ? "ES2024" : "ES2018"), n;
|
|
1307
|
-
}
|
|
1308
|
-
var er = "[ -\r ]", nr = /* @__PURE__ */ new Set([
|
|
1309
|
-
C(304),
|
|
1310
|
-
// İ
|
|
1311
|
-
C(305)
|
|
1312
|
-
// ı
|
|
1313
|
-
]), P = h`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
1314
|
-
function In(e) {
|
|
1315
|
-
if (nr.has(e))
|
|
1316
|
-
return [e];
|
|
1317
|
-
const n = /* @__PURE__ */ new Set(), t = e.toLowerCase(), r = t.toUpperCase(), a = or.get(t), o = tr.get(t), s = rr.get(t);
|
|
1318
|
-
return [...r].length === 1 && n.add(r), s && n.add(s), a && n.add(a), n.add(t), o && n.add(o), [...n];
|
|
1319
|
-
}
|
|
1320
|
-
var Ge = /* @__PURE__ */ new Map(
|
|
1321
|
-
`C Other
|
|
1322
|
-
Cc Control cntrl
|
|
1323
|
-
Cf Format
|
|
1324
|
-
Cn Unassigned
|
|
1325
|
-
Co Private_Use
|
|
1326
|
-
Cs Surrogate
|
|
1327
|
-
L Letter
|
|
1328
|
-
LC Cased_Letter
|
|
1329
|
-
Ll Lowercase_Letter
|
|
1330
|
-
Lm Modifier_Letter
|
|
1331
|
-
Lo Other_Letter
|
|
1332
|
-
Lt Titlecase_Letter
|
|
1333
|
-
Lu Uppercase_Letter
|
|
1334
|
-
M Mark Combining_Mark
|
|
1335
|
-
Mc Spacing_Mark
|
|
1336
|
-
Me Enclosing_Mark
|
|
1337
|
-
Mn Nonspacing_Mark
|
|
1338
|
-
N Number
|
|
1339
|
-
Nd Decimal_Number digit
|
|
1340
|
-
Nl Letter_Number
|
|
1341
|
-
No Other_Number
|
|
1342
|
-
P Punctuation punct
|
|
1343
|
-
Pc Connector_Punctuation
|
|
1344
|
-
Pd Dash_Punctuation
|
|
1345
|
-
Pe Close_Punctuation
|
|
1346
|
-
Pf Final_Punctuation
|
|
1347
|
-
Pi Initial_Punctuation
|
|
1348
|
-
Po Other_Punctuation
|
|
1349
|
-
Ps Open_Punctuation
|
|
1350
|
-
S Symbol
|
|
1351
|
-
Sc Currency_Symbol
|
|
1352
|
-
Sk Modifier_Symbol
|
|
1353
|
-
Sm Math_Symbol
|
|
1354
|
-
So Other_Symbol
|
|
1355
|
-
Z Separator
|
|
1356
|
-
Zl Line_Separator
|
|
1357
|
-
Zp Paragraph_Separator
|
|
1358
|
-
Zs Space_Separator
|
|
1359
|
-
ASCII
|
|
1360
|
-
ASCII_Hex_Digit AHex
|
|
1361
|
-
Alphabetic Alpha
|
|
1362
|
-
Any
|
|
1363
|
-
Assigned
|
|
1364
|
-
Bidi_Control Bidi_C
|
|
1365
|
-
Bidi_Mirrored Bidi_M
|
|
1366
|
-
Case_Ignorable CI
|
|
1367
|
-
Cased
|
|
1368
|
-
Changes_When_Casefolded CWCF
|
|
1369
|
-
Changes_When_Casemapped CWCM
|
|
1370
|
-
Changes_When_Lowercased CWL
|
|
1371
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
1372
|
-
Changes_When_Titlecased CWT
|
|
1373
|
-
Changes_When_Uppercased CWU
|
|
1374
|
-
Dash
|
|
1375
|
-
Default_Ignorable_Code_Point DI
|
|
1376
|
-
Deprecated Dep
|
|
1377
|
-
Diacritic Dia
|
|
1378
|
-
Emoji
|
|
1379
|
-
Emoji_Component EComp
|
|
1380
|
-
Emoji_Modifier EMod
|
|
1381
|
-
Emoji_Modifier_Base EBase
|
|
1382
|
-
Emoji_Presentation EPres
|
|
1383
|
-
Extended_Pictographic ExtPict
|
|
1384
|
-
Extender Ext
|
|
1385
|
-
Grapheme_Base Gr_Base
|
|
1386
|
-
Grapheme_Extend Gr_Ext
|
|
1387
|
-
Hex_Digit Hex
|
|
1388
|
-
IDS_Binary_Operator IDSB
|
|
1389
|
-
IDS_Trinary_Operator IDST
|
|
1390
|
-
ID_Continue IDC
|
|
1391
|
-
ID_Start IDS
|
|
1392
|
-
Ideographic Ideo
|
|
1393
|
-
Join_Control Join_C
|
|
1394
|
-
Logical_Order_Exception LOE
|
|
1395
|
-
Lowercase Lower
|
|
1396
|
-
Math
|
|
1397
|
-
Noncharacter_Code_Point NChar
|
|
1398
|
-
Pattern_Syntax Pat_Syn
|
|
1399
|
-
Pattern_White_Space Pat_WS
|
|
1400
|
-
Quotation_Mark QMark
|
|
1401
|
-
Radical
|
|
1402
|
-
Regional_Indicator RI
|
|
1403
|
-
Sentence_Terminal STerm
|
|
1404
|
-
Soft_Dotted SD
|
|
1405
|
-
Terminal_Punctuation Term
|
|
1406
|
-
Unified_Ideograph UIdeo
|
|
1407
|
-
Uppercase Upper
|
|
1408
|
-
Variation_Selector VS
|
|
1409
|
-
White_Space space
|
|
1410
|
-
XID_Continue XIDC
|
|
1411
|
-
XID_Start XIDS`.split(/\s/).map((e) => [we(e), e])
|
|
1412
|
-
), tr = /* @__PURE__ */ new Map([
|
|
1413
|
-
["s", C(383)],
|
|
1414
|
-
// s, ſ
|
|
1415
|
-
[C(383), "s"]
|
|
1416
|
-
// ſ, s
|
|
1417
|
-
]), rr = /* @__PURE__ */ new Map([
|
|
1418
|
-
[C(223), C(7838)],
|
|
1419
|
-
// ß, ẞ
|
|
1420
|
-
[C(107), C(8490)],
|
|
1421
|
-
// k, K (Kelvin)
|
|
1422
|
-
[C(229), C(8491)],
|
|
1423
|
-
// å, Å (Angstrom)
|
|
1424
|
-
[C(969), C(8486)]
|
|
1425
|
-
// ω, Ω (Ohm)
|
|
1426
|
-
]), or = new Map([
|
|
1427
|
-
G(453),
|
|
1428
|
-
G(456),
|
|
1429
|
-
G(459),
|
|
1430
|
-
G(498),
|
|
1431
|
-
...xe(8072, 8079),
|
|
1432
|
-
...xe(8088, 8095),
|
|
1433
|
-
...xe(8104, 8111),
|
|
1434
|
-
G(8124),
|
|
1435
|
-
G(8140),
|
|
1436
|
-
G(8188)
|
|
1437
|
-
]), ar = /* @__PURE__ */ new Map([
|
|
1438
|
-
["alnum", h`[\p{Alpha}\p{Nd}]`],
|
|
1439
|
-
["alpha", h`\p{Alpha}`],
|
|
1440
|
-
["ascii", h`\p{ASCII}`],
|
|
1441
|
-
["blank", h`[\p{Zs}\t]`],
|
|
1442
|
-
["cntrl", h`\p{Cc}`],
|
|
1443
|
-
["digit", h`\p{Nd}`],
|
|
1444
|
-
["graph", h`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
|
|
1445
|
-
["lower", h`\p{Lower}`],
|
|
1446
|
-
["print", h`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
|
|
1447
|
-
["punct", h`[\p{P}\p{S}]`],
|
|
1448
|
-
// Updated value from Onig 6.9.9; changed from Unicode `\p{punct}`
|
|
1449
|
-
["space", h`\p{space}`],
|
|
1450
|
-
["upper", h`\p{Upper}`],
|
|
1451
|
-
["word", h`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
1452
|
-
["xdigit", h`\p{AHex}`]
|
|
1453
|
-
]);
|
|
1454
|
-
function sr(e, n) {
|
|
1455
|
-
const t = [];
|
|
1456
|
-
for (let r = e; r <= n; r++)
|
|
1457
|
-
t.push(r);
|
|
1458
|
-
return t;
|
|
1459
|
-
}
|
|
1460
|
-
function G(e) {
|
|
1461
|
-
const n = C(e);
|
|
1462
|
-
return [n.toLowerCase(), n];
|
|
1463
|
-
}
|
|
1464
|
-
function xe(e, n) {
|
|
1465
|
-
return sr(e, n).map((t) => G(t));
|
|
1466
|
-
}
|
|
1467
|
-
var Sn = /* @__PURE__ */ new Set([
|
|
1468
|
-
"Lower",
|
|
1469
|
-
"Lowercase",
|
|
1470
|
-
"Upper",
|
|
1471
|
-
"Uppercase",
|
|
1472
|
-
"Ll",
|
|
1473
|
-
"Lowercase_Letter",
|
|
1474
|
-
"Lt",
|
|
1475
|
-
"Titlecase_Letter",
|
|
1476
|
-
"Lu",
|
|
1477
|
-
"Uppercase_Letter"
|
|
1478
|
-
// The `Changes_When_*` properties (and their aliases) could be included, but they're very rare.
|
|
1479
|
-
// Some other properties include a handful of chars with specific cases only, but these chars are
|
|
1480
|
-
// generally extreme edge cases and using such properties case insensitively generally produces
|
|
1481
|
-
// undesired behavior anyway
|
|
1482
|
-
]);
|
|
1483
|
-
function ir(e, n) {
|
|
1484
|
-
const t = {
|
|
1485
|
-
// A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
|
|
1486
|
-
// - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
|
|
1487
|
-
// Unicode data; a best-effort approximation requires knowing the target.
|
|
1488
|
-
// - `CharacterSet` kind `posix` with values `graph` and `print`: Their complex Unicode
|
|
1489
|
-
// representations would be hard to change to ASCII versions after the fact in the generator
|
|
1490
|
-
// based on `target`/`accuracy`, so produce the appropriate structure here.
|
|
1491
|
-
accuracy: "default",
|
|
1492
|
-
asciiWordBoundaries: !1,
|
|
1493
|
-
avoidSubclass: !1,
|
|
1494
|
-
bestEffortTarget: "ES2025",
|
|
1495
|
-
...n
|
|
1496
|
-
};
|
|
1497
|
-
_n(e);
|
|
1498
|
-
const r = {
|
|
1499
|
-
accuracy: t.accuracy,
|
|
1500
|
-
asciiWordBoundaries: t.asciiWordBoundaries,
|
|
1501
|
-
avoidSubclass: t.avoidSubclass,
|
|
1502
|
-
flagDirectivesByAlt: /* @__PURE__ */ new Map(),
|
|
1503
|
-
jsGroupNameMap: /* @__PURE__ */ new Map(),
|
|
1504
|
-
minTargetEs2024: Le(t.bestEffortTarget, "ES2024"),
|
|
1505
|
-
passedLookbehind: !1,
|
|
1506
|
-
strategy: null,
|
|
1507
|
-
// Subroutines can appear before the groups they ref, so collect reffed nodes for a second pass
|
|
1508
|
-
subroutineRefMap: /* @__PURE__ */ new Map(),
|
|
1509
|
-
supportedGNodes: /* @__PURE__ */ new Set(),
|
|
1510
|
-
digitIsAscii: e.flags.digitIsAscii,
|
|
1511
|
-
spaceIsAscii: e.flags.spaceIsAscii,
|
|
1512
|
-
wordIsAscii: e.flags.wordIsAscii
|
|
1513
|
-
};
|
|
1514
|
-
se(e, ur, r);
|
|
1515
|
-
const a = {
|
|
1516
|
-
dotAll: e.flags.dotAll,
|
|
1517
|
-
ignoreCase: e.flags.ignoreCase
|
|
1518
|
-
}, o = {
|
|
1519
|
-
currentFlags: a,
|
|
1520
|
-
prevFlags: null,
|
|
1521
|
-
globalFlags: a,
|
|
1522
|
-
groupOriginByCopy: /* @__PURE__ */ new Map(),
|
|
1523
|
-
groupsByName: /* @__PURE__ */ new Map(),
|
|
1524
|
-
multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
|
|
1525
|
-
openRefs: /* @__PURE__ */ new Map(),
|
|
1526
|
-
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
1527
|
-
subroutineRefMap: r.subroutineRefMap
|
|
1528
|
-
};
|
|
1529
|
-
se(e, lr, o);
|
|
1530
|
-
const s = {
|
|
1531
|
-
groupsByName: o.groupsByName,
|
|
1532
|
-
highestOrphanBackref: 0,
|
|
1533
|
-
numCapturesToLeft: 0,
|
|
1534
|
-
reffedNodesByReferencer: o.reffedNodesByReferencer
|
|
1535
|
-
};
|
|
1536
|
-
return se(e, cr, s), e._originMap = o.groupOriginByCopy, e._strategy = r.strategy, e;
|
|
1537
|
-
}
|
|
1538
|
-
var ur = {
|
|
1539
|
-
AbsenceFunction({ node: e, parent: n, replaceWith: t }) {
|
|
1540
|
-
const { body: r, kind: a } = e;
|
|
1541
|
-
if (a === "repeater") {
|
|
1542
|
-
const o = N();
|
|
1543
|
-
o.body[0].body.push(
|
|
1544
|
-
// Insert own alts as `body`
|
|
1545
|
-
z({ negate: !0, body: r }),
|
|
1546
|
-
ne("Any")
|
|
1547
|
-
);
|
|
1548
|
-
const s = N();
|
|
1549
|
-
s.body[0].body.push(
|
|
1550
|
-
Cn("greedy", 0, 1 / 0, o)
|
|
1551
|
-
), t(b(s, n), { traverse: !0 });
|
|
1552
|
-
} else
|
|
1553
|
-
throw new Error('Unsupported absence function "(?~|"');
|
|
1554
|
-
},
|
|
1555
|
-
Alternative: {
|
|
1556
|
-
enter({ node: e, parent: n, key: t }, { flagDirectivesByAlt: r }) {
|
|
1557
|
-
const a = e.body.filter((o) => o.kind === "flags");
|
|
1558
|
-
for (let o = t + 1; o < n.body.length; o++) {
|
|
1559
|
-
const s = n.body[o];
|
|
1560
|
-
ie(r, s, []).push(...a);
|
|
1561
|
-
}
|
|
1562
|
-
},
|
|
1563
|
-
exit({ node: e }, { flagDirectivesByAlt: n }) {
|
|
1564
|
-
var t;
|
|
1565
|
-
if ((t = n.get(e)) != null && t.length) {
|
|
1566
|
-
const r = Mn(n.get(e));
|
|
1567
|
-
if (r) {
|
|
1568
|
-
const a = N({ flags: r });
|
|
1569
|
-
a.body[0].body = e.body, e.body = [b(a, e)];
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
},
|
|
1574
|
-
Assertion({ node: e, parent: n, key: t, container: r, root: a, remove: o, replaceWith: s }, i) {
|
|
1575
|
-
const { kind: u, negate: l } = e, { asciiWordBoundaries: p, avoidSubclass: c, supportedGNodes: d, wordIsAscii: g } = i;
|
|
1576
|
-
if (u === "text_segment_boundary")
|
|
1577
|
-
throw new Error(`Unsupported text segment boundary "\\${l ? "Y" : "y"}"`);
|
|
1578
|
-
if (u === "line_end")
|
|
1579
|
-
s(b(z({ body: [
|
|
1580
|
-
H({ body: [Se("string_end")] }),
|
|
1581
|
-
H({ body: [he(10)] })
|
|
1582
|
-
// `\n`
|
|
1583
|
-
] }), n));
|
|
1584
|
-
else if (u === "line_start")
|
|
1585
|
-
s(b(R(h`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), n));
|
|
1586
|
-
else if (u === "search_start")
|
|
1587
|
-
if (d.has(e))
|
|
1588
|
-
a.flags.sticky = !0, o();
|
|
1589
|
-
else {
|
|
1590
|
-
const f = r[t - 1];
|
|
1591
|
-
if (f && wr(f))
|
|
1592
|
-
s(b(z({ negate: !0 }), n));
|
|
1593
|
-
else {
|
|
1594
|
-
if (c)
|
|
1595
|
-
throw new Error(h`Uses "\G" in a way that requires a subclass`);
|
|
1596
|
-
s(O(Se("string_start"), n)), i.strategy = "clip_search";
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
else if (!(u === "string_end" || u === "string_start"))
|
|
1600
|
-
if (u === "string_end_newline")
|
|
1601
|
-
s(b(R(h`(?=\n?\z)`), n));
|
|
1602
|
-
else if (u === "word_boundary") {
|
|
1603
|
-
if (!g && !p) {
|
|
1604
|
-
const f = `(?:(?<=${P})(?!${P})|(?<!${P})(?=${P}))`, w = `(?:(?<=${P})(?=${P})|(?<!${P})(?!${P}))`;
|
|
1605
|
-
s(b(R(l ? w : f), n));
|
|
1606
|
-
}
|
|
1607
|
-
} else
|
|
1608
|
-
throw new Error(`Unexpected assertion kind "${u}"`);
|
|
1609
|
-
},
|
|
1610
|
-
Backreference({ node: e }, { jsGroupNameMap: n }) {
|
|
1611
|
-
let { ref: t } = e;
|
|
1612
|
-
typeof t == "string" && !Ee(t) && (t = ke(t, n), e.ref = t);
|
|
1613
|
-
},
|
|
1614
|
-
CapturingGroup({ node: e }, { jsGroupNameMap: n, subroutineRefMap: t }) {
|
|
1615
|
-
let { name: r } = e;
|
|
1616
|
-
r && !Ee(r) && (r = ke(r, n), e.name = r), t.set(e.number, e), r && t.set(r, e);
|
|
1617
|
-
},
|
|
1618
|
-
CharacterClassRange({ node: e, parent: n, replaceWith: t }) {
|
|
1619
|
-
if (n.kind === "intersection") {
|
|
1620
|
-
const r = fe({ body: [e] });
|
|
1621
|
-
t(b(r, n), { traverse: !0 });
|
|
1622
|
-
}
|
|
1623
|
-
},
|
|
1624
|
-
CharacterSet({ node: e, parent: n, replaceWith: t }, { accuracy: r, minTargetEs2024: a, digitIsAscii: o, spaceIsAscii: s, wordIsAscii: i }) {
|
|
1625
|
-
const { kind: u, negate: l, value: p } = e;
|
|
1626
|
-
if (o && (u === "digit" || p === "digit")) {
|
|
1627
|
-
t(O(Ne("digit", { negate: l }), n));
|
|
1628
|
-
return;
|
|
1629
|
-
}
|
|
1630
|
-
if (s && (u === "space" || p === "space")) {
|
|
1631
|
-
t(b($e(R(er), l), n));
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
if (i && (u === "word" || p === "word")) {
|
|
1635
|
-
t(O(Ne("word", { negate: l }), n));
|
|
1636
|
-
return;
|
|
1637
|
-
}
|
|
1638
|
-
if (u === "any")
|
|
1639
|
-
t(O(ne("Any"), n));
|
|
1640
|
-
else if (u === "digit")
|
|
1641
|
-
t(O(ne("Nd", { negate: l }), n));
|
|
1642
|
-
else if (u !== "dot")
|
|
1643
|
-
if (u === "text_segment") {
|
|
1644
|
-
if (r === "strict")
|
|
1645
|
-
throw new Error(h`Use of "\X" requires non-strict accuracy`);
|
|
1646
|
-
const c = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", d = h`\p{RI}{2}|${c}(?:\u200D${c})*`;
|
|
1647
|
-
t(b(R(
|
|
1648
|
-
// Close approximation of an extended grapheme cluster; see <unicode.org/reports/tr29/>
|
|
1649
|
-
h`(?>\r\n|${a ? h`\p{RGI_Emoji}` : d}|\P{M}\p{M}*)`,
|
|
1650
|
-
// Allow JS property `RGI_Emoji` through
|
|
1651
|
-
{ skipPropertyNameValidation: !0 }
|
|
1652
|
-
), n));
|
|
1653
|
-
} else if (u === "hex")
|
|
1654
|
-
t(O(ne("AHex", { negate: l }), n));
|
|
1655
|
-
else if (u === "newline")
|
|
1656
|
-
t(b(R(l ? `[^
|
|
1657
|
-
]` : `(?>\r
|
|
1658
|
-
?|[
|
|
1659
|
-
\v\f
\u2028\u2029])`), n));
|
|
1660
|
-
else if (u === "posix")
|
|
1661
|
-
if (!a && (p === "graph" || p === "print")) {
|
|
1662
|
-
if (r === "strict")
|
|
1663
|
-
throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);
|
|
1664
|
-
let c = {
|
|
1665
|
-
graph: "!-~",
|
|
1666
|
-
print: " -~"
|
|
1667
|
-
}[p];
|
|
1668
|
-
l && (c = `\0-${C(c.codePointAt(0) - 1)}${C(c.codePointAt(2) + 1)}-`), t(b(R(`[${c}]`), n));
|
|
1669
|
-
} else
|
|
1670
|
-
t(b($e(R(ar.get(p)), l), n));
|
|
1671
|
-
else if (u === "property")
|
|
1672
|
-
Ge.has(we(p)) || (e.key = "sc");
|
|
1673
|
-
else if (u === "space")
|
|
1674
|
-
t(O(ne("space", { negate: l }), n));
|
|
1675
|
-
else if (u === "word")
|
|
1676
|
-
t(b($e(R(P), l), n));
|
|
1677
|
-
else
|
|
1678
|
-
throw new Error(`Unexpected character set kind "${u}"`);
|
|
1679
|
-
},
|
|
1680
|
-
Directive({ node: e, parent: n, root: t, remove: r, replaceWith: a, removeAllPrevSiblings: o, removeAllNextSiblings: s }) {
|
|
1681
|
-
const { kind: i, flags: u } = e;
|
|
1682
|
-
if (i === "flags")
|
|
1683
|
-
if (!u.enable && !u.disable)
|
|
1684
|
-
r();
|
|
1685
|
-
else {
|
|
1686
|
-
const l = N({ flags: u });
|
|
1687
|
-
l.body[0].body = s(), a(b(l, n), { traverse: !0 });
|
|
1688
|
-
}
|
|
1689
|
-
else if (i === "keep") {
|
|
1690
|
-
const l = t.body[0], p = t.body.length === 1 && // Not emulatable if within a `CapturingGroup`
|
|
1691
|
-
mn(l, { type: "Group" }) && l.body[0].body.length === 1 ? l.body[0] : t;
|
|
1692
|
-
if (n.parent !== p || p.body.length > 1)
|
|
1693
|
-
throw new Error(h`Uses "\K" in a way that's unsupported`);
|
|
1694
|
-
const c = z({ behind: !0 });
|
|
1695
|
-
c.body[0].body = o(), a(b(c, n));
|
|
1696
|
-
} else
|
|
1697
|
-
throw new Error(`Unexpected directive kind "${i}"`);
|
|
1698
|
-
},
|
|
1699
|
-
Flags({ node: e, parent: n }) {
|
|
1700
|
-
if (e.posixIsAscii)
|
|
1701
|
-
throw new Error('Unsupported flag "P"');
|
|
1702
|
-
if (e.textSegmentMode === "word")
|
|
1703
|
-
throw new Error('Unsupported flag "y{w}"');
|
|
1704
|
-
[
|
|
1705
|
-
"digitIsAscii",
|
|
1706
|
-
// Flag D
|
|
1707
|
-
"extended",
|
|
1708
|
-
// Flag x
|
|
1709
|
-
"posixIsAscii",
|
|
1710
|
-
// Flag P
|
|
1711
|
-
"spaceIsAscii",
|
|
1712
|
-
// Flag S
|
|
1713
|
-
"wordIsAscii",
|
|
1714
|
-
// Flag W
|
|
1715
|
-
"textSegmentMode"
|
|
1716
|
-
// Flag y{g} or y{w}
|
|
1717
|
-
].forEach((t) => delete e[t]), Object.assign(e, {
|
|
1718
|
-
// JS flag g; no Onig equiv
|
|
1719
|
-
global: !1,
|
|
1720
|
-
// JS flag d; no Onig equiv
|
|
1721
|
-
hasIndices: !1,
|
|
1722
|
-
// JS flag m; no Onig equiv but its behavior is always on in Onig. Onig's only line break
|
|
1723
|
-
// char is line feed, unlike JS, so this flag isn't used since it would produce inaccurate
|
|
1724
|
-
// results (also allows `^` and `$` to be used in the generator for string start and end)
|
|
1725
|
-
multiline: !1,
|
|
1726
|
-
// JS flag y; no Onig equiv, but used for `\G` emulation
|
|
1727
|
-
sticky: e.sticky ?? !1
|
|
1728
|
-
// Note: Regex+ doesn't allow explicitly adding flags it handles implicitly, so leave out
|
|
1729
|
-
// properties `unicode` (JS flag u) and `unicodeSets` (JS flag v). Keep the existing values
|
|
1730
|
-
// for `ignoreCase` (flag i) and `dotAll` (JS flag s, but Onig flag m)
|
|
1731
|
-
}), n.options = {
|
|
1732
|
-
disable: {
|
|
1733
|
-
// Onig uses different rules for flag x than Regex+, so disable the implicit flag
|
|
1734
|
-
x: !0,
|
|
1735
|
-
// Onig has no flag to control "named capture only" mode but contextually applies its
|
|
1736
|
-
// behavior when named capturing is used, so disable Regex+'s implicit flag for it
|
|
1737
|
-
n: !0
|
|
1738
|
-
},
|
|
1739
|
-
force: {
|
|
1740
|
-
// Always add flag v because we're generating an AST that relies on it (it enables JS
|
|
1741
|
-
// support for Onig features nested classes, intersection, Unicode properties, etc.).
|
|
1742
|
-
// However, the generator might disable flag v based on its `target` option
|
|
1743
|
-
v: !0
|
|
1744
|
-
}
|
|
1745
|
-
};
|
|
1746
|
-
},
|
|
1747
|
-
Group({ node: e }) {
|
|
1748
|
-
if (!e.flags)
|
|
1749
|
-
return;
|
|
1750
|
-
const { enable: n, disable: t } = e.flags;
|
|
1751
|
-
n != null && n.extended && delete n.extended, t != null && t.extended && delete t.extended, n != null && n.dotAll && t != null && t.dotAll && delete n.dotAll, n != null && n.ignoreCase && t != null && t.ignoreCase && delete n.ignoreCase, n && !Object.keys(n).length && delete e.flags.enable, t && !Object.keys(t).length && delete e.flags.disable, !e.flags.enable && !e.flags.disable && delete e.flags;
|
|
1752
|
-
},
|
|
1753
|
-
LookaroundAssertion({ node: e }, n) {
|
|
1754
|
-
const { kind: t } = e;
|
|
1755
|
-
t === "lookbehind" && (n.passedLookbehind = !0);
|
|
1756
|
-
},
|
|
1757
|
-
NamedCallout({ node: e, parent: n, replaceWith: t }) {
|
|
1758
|
-
const { kind: r } = e;
|
|
1759
|
-
if (r === "fail")
|
|
1760
|
-
t(b(z({ negate: !0 }), n));
|
|
1761
|
-
else
|
|
1762
|
-
throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`);
|
|
1763
|
-
},
|
|
1764
|
-
Quantifier({ node: e }) {
|
|
1765
|
-
if (e.body.type === "Quantifier") {
|
|
1766
|
-
const n = N();
|
|
1767
|
-
n.body[0].body.push(e.body), e.body = b(n, e);
|
|
1768
|
-
}
|
|
1769
|
-
},
|
|
1770
|
-
Regex: {
|
|
1771
|
-
enter({ node: e }, { supportedGNodes: n }) {
|
|
1772
|
-
const t = [];
|
|
1773
|
-
let r = !1, a = !1;
|
|
1774
|
-
for (const o of e.body)
|
|
1775
|
-
if (o.body.length === 1 && o.body[0].kind === "search_start")
|
|
1776
|
-
o.body.pop();
|
|
1777
|
-
else {
|
|
1778
|
-
const s = Pn(o.body);
|
|
1779
|
-
s ? (r = !0, Array.isArray(s) ? t.push(...s) : t.push(s)) : a = !0;
|
|
1780
|
-
}
|
|
1781
|
-
r && !a && t.forEach((o) => n.add(o));
|
|
1782
|
-
},
|
|
1783
|
-
exit(e, { accuracy: n, passedLookbehind: t, strategy: r }) {
|
|
1784
|
-
if (n === "strict" && t && r)
|
|
1785
|
-
throw new Error(h`Uses "\G" in a way that requires non-strict accuracy`);
|
|
1786
|
-
}
|
|
1787
|
-
},
|
|
1788
|
-
Subroutine({ node: e }, { jsGroupNameMap: n }) {
|
|
1789
|
-
let { ref: t } = e;
|
|
1790
|
-
typeof t == "string" && !Ee(t) && (t = ke(t, n), e.ref = t);
|
|
1791
|
-
}
|
|
1792
|
-
}, lr = {
|
|
1793
|
-
Backreference({ node: e }, { multiplexCapturesToLeftByRef: n, reffedNodesByReferencer: t }) {
|
|
1794
|
-
const { orphan: r, ref: a } = e;
|
|
1795
|
-
r || t.set(e, [...n.get(a).map(({ node: o }) => o)]);
|
|
1796
|
-
},
|
|
1797
|
-
CapturingGroup: {
|
|
1798
|
-
enter({
|
|
1799
|
-
node: e,
|
|
1800
|
-
parent: n,
|
|
1801
|
-
replaceWith: t,
|
|
1802
|
-
skip: r
|
|
1803
|
-
}, {
|
|
1804
|
-
groupOriginByCopy: a,
|
|
1805
|
-
groupsByName: o,
|
|
1806
|
-
multiplexCapturesToLeftByRef: s,
|
|
1807
|
-
openRefs: i,
|
|
1808
|
-
reffedNodesByReferencer: u
|
|
1809
|
-
}) {
|
|
1810
|
-
const l = a.get(e);
|
|
1811
|
-
if (l && i.has(e.number)) {
|
|
1812
|
-
const c = O(rn(e.number), n);
|
|
1813
|
-
u.set(c, i.get(e.number)), t(c);
|
|
1814
|
-
return;
|
|
1815
|
-
}
|
|
1816
|
-
i.set(e.number, e), s.set(e.number, []), e.name && ie(s, e.name, []);
|
|
1817
|
-
const p = s.get(e.name ?? e.number);
|
|
1818
|
-
for (let c = 0; c < p.length; c++) {
|
|
1819
|
-
const d = p[c];
|
|
1820
|
-
if (
|
|
1821
|
-
// This group is from subroutine expansion, and there's a multiplex value from either the
|
|
1822
|
-
// origin node or a prior subroutine expansion group with the same origin
|
|
1823
|
-
l === d.node || l && l === d.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
|
|
1824
|
-
// group that refers to this group
|
|
1825
|
-
e === d.origin
|
|
1826
|
-
) {
|
|
1827
|
-
p.splice(c, 1);
|
|
1828
|
-
break;
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
if (s.get(e.number).push({ node: e, origin: l }), e.name && s.get(e.name).push({ node: e, origin: l }), e.name) {
|
|
1832
|
-
const c = ie(o, e.name, /* @__PURE__ */ new Map());
|
|
1833
|
-
let d = !1;
|
|
1834
|
-
if (l)
|
|
1835
|
-
d = !0;
|
|
1836
|
-
else
|
|
1837
|
-
for (const g of c.values())
|
|
1838
|
-
if (!g.hasDuplicateNameToRemove) {
|
|
1839
|
-
d = !0;
|
|
1840
|
-
break;
|
|
1841
|
-
}
|
|
1842
|
-
o.get(e.name).set(e, { node: e, hasDuplicateNameToRemove: d });
|
|
1843
|
-
}
|
|
1844
|
-
},
|
|
1845
|
-
exit({ node: e }, { openRefs: n }) {
|
|
1846
|
-
n.delete(e.number);
|
|
1847
|
-
}
|
|
1848
|
-
},
|
|
1849
|
-
Group: {
|
|
1850
|
-
enter({ node: e }, n) {
|
|
1851
|
-
n.prevFlags = n.currentFlags, e.flags && (n.currentFlags = ge(n.currentFlags, e.flags));
|
|
1852
|
-
},
|
|
1853
|
-
exit(e, n) {
|
|
1854
|
-
n.currentFlags = n.prevFlags;
|
|
1855
|
-
}
|
|
1856
|
-
},
|
|
1857
|
-
Subroutine({ node: e, parent: n, replaceWith: t }, r) {
|
|
1858
|
-
const { isRecursive: a, ref: o } = e;
|
|
1859
|
-
if (a) {
|
|
1860
|
-
let p = n;
|
|
1861
|
-
for (; (p = p.parent) && !(p.type === "CapturingGroup" && (p.name === o || p.number === o)); )
|
|
1862
|
-
;
|
|
1863
|
-
r.reffedNodesByReferencer.set(e, p);
|
|
1864
|
-
return;
|
|
1865
|
-
}
|
|
1866
|
-
const s = r.subroutineRefMap.get(o), i = o === 0, u = i ? rn(0) : (
|
|
1867
|
-
// The reffed group might itself contain subroutines, which are expanded during sub-traversal
|
|
1868
|
-
Nn(s, r.groupOriginByCopy, null)
|
|
1869
|
-
);
|
|
1870
|
-
let l = u;
|
|
1871
|
-
if (!i) {
|
|
1872
|
-
const p = Mn(fr(
|
|
1873
|
-
s,
|
|
1874
|
-
(d) => d.type === "Group" && !!d.flags
|
|
1875
|
-
)), c = p ? ge(r.globalFlags, p) : r.globalFlags;
|
|
1876
|
-
pr(c, r.currentFlags) || (l = N({
|
|
1877
|
-
flags: gr(c)
|
|
1878
|
-
}), l.body[0].body.push(u));
|
|
1879
|
-
}
|
|
1880
|
-
t(b(l, n), { traverse: !i });
|
|
1881
|
-
}
|
|
1882
|
-
}, cr = {
|
|
1883
|
-
Backreference({ node: e, parent: n, replaceWith: t }, r) {
|
|
1884
|
-
if (e.orphan) {
|
|
1885
|
-
r.highestOrphanBackref = Math.max(r.highestOrphanBackref, e.ref);
|
|
1886
|
-
return;
|
|
1887
|
-
}
|
|
1888
|
-
const a = r.reffedNodesByReferencer.get(e).filter((o) => dr(o, e));
|
|
1889
|
-
if (!a.length)
|
|
1890
|
-
t(b(z({ negate: !0 }), n));
|
|
1891
|
-
else if (a.length > 1) {
|
|
1892
|
-
const o = N({
|
|
1893
|
-
atomic: !0,
|
|
1894
|
-
body: a.reverse().map((s) => H({
|
|
1895
|
-
body: [_e(s.number)]
|
|
1896
|
-
}))
|
|
1897
|
-
});
|
|
1898
|
-
t(b(o, n));
|
|
1899
|
-
} else
|
|
1900
|
-
e.ref = a[0].number;
|
|
1901
|
-
},
|
|
1902
|
-
CapturingGroup({ node: e }, n) {
|
|
1903
|
-
e.number = ++n.numCapturesToLeft, e.name && n.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove && delete e.name;
|
|
1904
|
-
},
|
|
1905
|
-
Regex: {
|
|
1906
|
-
exit({ node: e }, n) {
|
|
1907
|
-
const t = Math.max(n.highestOrphanBackref - n.numCapturesToLeft, 0);
|
|
1908
|
-
for (let r = 0; r < t; r++) {
|
|
1909
|
-
const a = bn();
|
|
1910
|
-
e.body.at(-1).body.push(a);
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
},
|
|
1914
|
-
Subroutine({ node: e }, n) {
|
|
1915
|
-
!e.isRecursive || e.ref === 0 || (e.ref = n.reffedNodesByReferencer.get(e).number);
|
|
1916
|
-
}
|
|
1917
|
-
};
|
|
1918
|
-
function _n(e) {
|
|
1919
|
-
se(e, {
|
|
1920
|
-
"*"({ node: n, parent: t }) {
|
|
1921
|
-
n.parent = t;
|
|
1922
|
-
}
|
|
1923
|
-
});
|
|
1924
|
-
}
|
|
1925
|
-
function pr(e, n) {
|
|
1926
|
-
return e.dotAll === n.dotAll && e.ignoreCase === n.ignoreCase;
|
|
1927
|
-
}
|
|
1928
|
-
function dr(e, n) {
|
|
1929
|
-
let t = n;
|
|
1930
|
-
do {
|
|
1931
|
-
if (t.type === "Regex")
|
|
1932
|
-
return !1;
|
|
1933
|
-
if (t.type === "Alternative")
|
|
1934
|
-
continue;
|
|
1935
|
-
if (t === e)
|
|
1936
|
-
return !1;
|
|
1937
|
-
const r = Ln(t.parent);
|
|
1938
|
-
for (const a of r) {
|
|
1939
|
-
if (a === t)
|
|
1940
|
-
break;
|
|
1941
|
-
if (a === e || Rn(a, e))
|
|
1942
|
-
return !0;
|
|
1943
|
-
}
|
|
1944
|
-
} while (t = t.parent);
|
|
1945
|
-
throw new Error("Unexpected path");
|
|
1946
|
-
}
|
|
1947
|
-
function Nn(e, n, t, r) {
|
|
1948
|
-
const a = Array.isArray(e) ? [] : {};
|
|
1949
|
-
for (const [o, s] of Object.entries(e))
|
|
1950
|
-
o === "parent" ? a.parent = Array.isArray(t) ? r : t : s && typeof s == "object" ? a[o] = Nn(s, n, a, t) : (o === "type" && s === "CapturingGroup" && n.set(a, n.get(e) ?? e), a[o] = s);
|
|
1951
|
-
return a;
|
|
1952
|
-
}
|
|
1953
|
-
function rn(e) {
|
|
1954
|
-
const n = xn(e);
|
|
1955
|
-
return n.isRecursive = !0, n;
|
|
1956
|
-
}
|
|
1957
|
-
function fr(e, n) {
|
|
1958
|
-
const t = [];
|
|
1959
|
-
for (; e = e.parent; )
|
|
1960
|
-
(!n || n(e)) && t.push(e);
|
|
1961
|
-
return t;
|
|
1962
|
-
}
|
|
1963
|
-
function ke(e, n) {
|
|
1964
|
-
if (n.has(e))
|
|
1965
|
-
return n.get(e);
|
|
1966
|
-
const t = `$${n.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug, "_")}`;
|
|
1967
|
-
return n.set(e, t), t;
|
|
1968
|
-
}
|
|
1969
|
-
function Mn(e) {
|
|
1970
|
-
const n = ["dotAll", "ignoreCase"], t = { enable: {}, disable: {} };
|
|
1971
|
-
return e.forEach(({ flags: r }) => {
|
|
1972
|
-
n.forEach((a) => {
|
|
1973
|
-
var o, s;
|
|
1974
|
-
(o = r.enable) != null && o[a] && (delete t.disable[a], t.enable[a] = !0), (s = r.disable) != null && s[a] && (t.disable[a] = !0);
|
|
1975
|
-
});
|
|
1976
|
-
}), Object.keys(t.enable).length || delete t.enable, Object.keys(t.disable).length || delete t.disable, t.enable || t.disable ? t : null;
|
|
1977
|
-
}
|
|
1978
|
-
function gr({ dotAll: e, ignoreCase: n }) {
|
|
1979
|
-
const t = {};
|
|
1980
|
-
return (e || n) && (t.enable = {}, e && (t.enable.dotAll = !0), n && (t.enable.ignoreCase = !0)), (!e || !n) && (t.disable = {}, !e && (t.disable.dotAll = !0), !n && (t.disable.ignoreCase = !0)), t;
|
|
1981
|
-
}
|
|
1982
|
-
function Ln(e) {
|
|
1983
|
-
if (!e)
|
|
1984
|
-
throw new Error("Node expected");
|
|
1985
|
-
const { body: n } = e;
|
|
1986
|
-
return Array.isArray(n) ? n : n ? [n] : null;
|
|
1987
|
-
}
|
|
1988
|
-
function Pn(e) {
|
|
1989
|
-
const n = e.find((t) => t.kind === "search_start" || mr(t, { negate: !1 }) || !hr(t));
|
|
1990
|
-
if (!n)
|
|
1991
|
-
return null;
|
|
1992
|
-
if (n.kind === "search_start")
|
|
1993
|
-
return n;
|
|
1994
|
-
if (n.type === "LookaroundAssertion")
|
|
1995
|
-
return n.body[0].body[0];
|
|
1996
|
-
if (n.type === "CapturingGroup" || n.type === "Group") {
|
|
1997
|
-
const t = [];
|
|
1998
|
-
for (const r of n.body) {
|
|
1999
|
-
const a = Pn(r.body);
|
|
2000
|
-
if (!a)
|
|
2001
|
-
return null;
|
|
2002
|
-
Array.isArray(a) ? t.push(...a) : t.push(a);
|
|
2003
|
-
}
|
|
2004
|
-
return t;
|
|
2005
|
-
}
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
|
-
function Rn(e, n) {
|
|
2009
|
-
const t = Ln(e) ?? [];
|
|
2010
|
-
for (const r of t)
|
|
2011
|
-
if (r === n || Rn(r, n))
|
|
2012
|
-
return !0;
|
|
2013
|
-
return !1;
|
|
2014
|
-
}
|
|
2015
|
-
function hr({ type: e }) {
|
|
2016
|
-
return e === "Assertion" || e === "Directive" || e === "LookaroundAssertion";
|
|
2017
|
-
}
|
|
2018
|
-
function wr(e) {
|
|
2019
|
-
const n = [
|
|
2020
|
-
"Character",
|
|
2021
|
-
"CharacterClass",
|
|
2022
|
-
"CharacterSet"
|
|
2023
|
-
];
|
|
2024
|
-
return n.includes(e.type) || e.type === "Quantifier" && e.min && n.includes(e.body.type);
|
|
2025
|
-
}
|
|
2026
|
-
function mr(e, n) {
|
|
2027
|
-
const t = {
|
|
2028
|
-
negate: null,
|
|
2029
|
-
...n
|
|
2030
|
-
};
|
|
2031
|
-
return e.type === "LookaroundAssertion" && (t.negate === null || e.negate === t.negate) && e.body.length === 1 && mn(e.body[0], {
|
|
2032
|
-
type: "Assertion",
|
|
2033
|
-
kind: "search_start"
|
|
2034
|
-
});
|
|
2035
|
-
}
|
|
2036
|
-
function Ee(e) {
|
|
2037
|
-
return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e);
|
|
2038
|
-
}
|
|
2039
|
-
function R(e, n) {
|
|
2040
|
-
const t = yn(e, {
|
|
2041
|
-
...n,
|
|
2042
|
-
// Providing a custom set of Unicode property names avoids converting some JS Unicode
|
|
2043
|
-
// properties (ex: `\p{Alpha}`) to Onig POSIX classes
|
|
2044
|
-
unicodePropertyMap: Ge
|
|
2045
|
-
}).body;
|
|
2046
|
-
return t.length > 1 || t[0].body.length > 1 ? N({ body: t }) : t[0].body[0];
|
|
2047
|
-
}
|
|
2048
|
-
function $e(e, n) {
|
|
2049
|
-
return e.negate = n, e;
|
|
2050
|
-
}
|
|
2051
|
-
function O(e, n) {
|
|
2052
|
-
return e.parent = n, e;
|
|
2053
|
-
}
|
|
2054
|
-
function b(e, n) {
|
|
2055
|
-
return _n(e), e.parent = n, e;
|
|
2056
|
-
}
|
|
2057
|
-
function yr(e, n) {
|
|
2058
|
-
const t = An(n), r = Le(t.target, "ES2024"), a = Le(t.target, "ES2025"), o = t.rules.recursionLimit;
|
|
2059
|
-
if (!Number.isInteger(o) || o < 2 || o > 20)
|
|
2060
|
-
throw new Error("Invalid recursionLimit; use 2-20");
|
|
2061
|
-
let s = null, i = null;
|
|
2062
|
-
if (!a) {
|
|
2063
|
-
const g = [e.flags.ignoreCase];
|
|
2064
|
-
se(e, br, {
|
|
2065
|
-
getCurrentModI: () => g.at(-1),
|
|
2066
|
-
popModI() {
|
|
2067
|
-
g.pop();
|
|
2068
|
-
},
|
|
2069
|
-
pushModI(f) {
|
|
2070
|
-
g.push(f);
|
|
2071
|
-
},
|
|
2072
|
-
setHasCasedChar() {
|
|
2073
|
-
g.at(-1) ? s = !0 : i = !0;
|
|
2074
|
-
}
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
const u = {
|
|
2078
|
-
dotAll: e.flags.dotAll,
|
|
2079
|
-
// - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
|
|
2080
|
-
// used (to avoid unnecessary node expansion).
|
|
2081
|
-
// - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
|
|
2082
|
-
// forced without the use of ES2025 flag groups)
|
|
2083
|
-
ignoreCase: !!((e.flags.ignoreCase || s) && !i)
|
|
2084
|
-
};
|
|
2085
|
-
let l = e;
|
|
2086
|
-
const p = {
|
|
2087
|
-
accuracy: t.accuracy,
|
|
2088
|
-
appliedGlobalFlags: u,
|
|
2089
|
-
captureMap: /* @__PURE__ */ new Map(),
|
|
2090
|
-
currentFlags: {
|
|
2091
|
-
dotAll: e.flags.dotAll,
|
|
2092
|
-
ignoreCase: e.flags.ignoreCase
|
|
2093
|
-
},
|
|
2094
|
-
inCharClass: !1,
|
|
2095
|
-
lastNode: l,
|
|
2096
|
-
originMap: e._originMap,
|
|
2097
|
-
recursionLimit: o,
|
|
2098
|
-
useAppliedIgnoreCase: !!(!a && s && i),
|
|
2099
|
-
useFlagMods: a,
|
|
2100
|
-
useFlagV: r,
|
|
2101
|
-
verbose: t.verbose
|
|
2102
|
-
};
|
|
2103
|
-
function c(g) {
|
|
2104
|
-
return p.lastNode = l, l = g, Yt(Cr[g.type], `Unexpected node type "${g.type}"`)(g, p, c);
|
|
2105
|
-
}
|
|
2106
|
-
const d = {
|
|
2107
|
-
pattern: e.body.map(c).join("|"),
|
|
2108
|
-
// Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
|
|
2109
|
-
flags: c(e.flags),
|
|
2110
|
-
options: { ...e.options }
|
|
2111
|
-
};
|
|
2112
|
-
return r || (delete d.options.force.v, d.options.disable.v = !0, d.options.unicodeSetsPlugin = null), d._captureTransfers = /* @__PURE__ */ new Map(), d._hiddenCaptures = [], p.captureMap.forEach((g, f) => {
|
|
2113
|
-
g.hidden && d._hiddenCaptures.push(f), g.transferTo && ie(d._captureTransfers, g.transferTo, []).push(f);
|
|
2114
|
-
}), d;
|
|
2115
|
-
}
|
|
2116
|
-
var br = {
|
|
2117
|
-
"*": {
|
|
2118
|
-
enter({ node: e }, n) {
|
|
2119
|
-
if (an(e)) {
|
|
2120
|
-
const t = n.getCurrentModI();
|
|
2121
|
-
n.pushModI(
|
|
2122
|
-
e.flags ? ge({ ignoreCase: t }, e.flags).ignoreCase : t
|
|
2123
|
-
);
|
|
2124
|
-
}
|
|
2125
|
-
},
|
|
2126
|
-
exit({ node: e }, n) {
|
|
2127
|
-
an(e) && n.popModI();
|
|
2128
|
-
}
|
|
2129
|
-
},
|
|
2130
|
-
Backreference(e, n) {
|
|
2131
|
-
n.setHasCasedChar();
|
|
2132
|
-
},
|
|
2133
|
-
Character({ node: e }, n) {
|
|
2134
|
-
Oe(C(e.value)) && n.setHasCasedChar();
|
|
2135
|
-
},
|
|
2136
|
-
CharacterClassRange({ node: e, skip: n }, t) {
|
|
2137
|
-
n(), Fn(e, { firstOnly: !0 }).length && t.setHasCasedChar();
|
|
2138
|
-
},
|
|
2139
|
-
CharacterSet({ node: e }, n) {
|
|
2140
|
-
e.kind === "property" && Sn.has(e.value) && n.setHasCasedChar();
|
|
2141
|
-
}
|
|
2142
|
-
}, Cr = {
|
|
2143
|
-
/**
|
|
2144
|
-
@param {AlternativeNode} node
|
|
2145
|
-
*/
|
|
2146
|
-
Alternative({ body: e }, n, t) {
|
|
2147
|
-
return e.map(t).join("");
|
|
2148
|
-
},
|
|
2149
|
-
/**
|
|
2150
|
-
@param {AssertionNode} node
|
|
2151
|
-
*/
|
|
2152
|
-
Assertion({ kind: e, negate: n }) {
|
|
2153
|
-
if (e === "string_end")
|
|
2154
|
-
return "$";
|
|
2155
|
-
if (e === "string_start")
|
|
2156
|
-
return "^";
|
|
2157
|
-
if (e === "word_boundary")
|
|
2158
|
-
return n ? h`\B` : h`\b`;
|
|
2159
|
-
throw new Error(`Unexpected assertion kind "${e}"`);
|
|
2160
|
-
},
|
|
2161
|
-
/**
|
|
2162
|
-
@param {BackreferenceNode} node
|
|
2163
|
-
*/
|
|
2164
|
-
Backreference({ ref: e }, n) {
|
|
2165
|
-
if (typeof e != "number")
|
|
2166
|
-
throw new Error("Unexpected named backref in transformed AST");
|
|
2167
|
-
if (!n.useFlagMods && n.accuracy === "strict" && n.currentFlags.ignoreCase && !n.captureMap.get(e).ignoreCase)
|
|
2168
|
-
throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
|
|
2169
|
-
return "\\" + e;
|
|
2170
|
-
},
|
|
2171
|
-
/**
|
|
2172
|
-
@param {CapturingGroupNode} node
|
|
2173
|
-
*/
|
|
2174
|
-
CapturingGroup(e, n, t) {
|
|
2175
|
-
const { body: r, name: a, number: o } = e, s = { ignoreCase: n.currentFlags.ignoreCase }, i = n.originMap.get(e);
|
|
2176
|
-
return i && (s.hidden = !0, o > i.number && (s.transferTo = i.number)), n.captureMap.set(o, s), `(${a ? `?<${a}>` : ""}${r.map(t).join("|")})`;
|
|
2177
|
-
},
|
|
2178
|
-
/**
|
|
2179
|
-
@param {CharacterNode} node
|
|
2180
|
-
*/
|
|
2181
|
-
Character({ value: e }, n) {
|
|
2182
|
-
const t = C(e), r = Q(e, {
|
|
2183
|
-
escDigit: n.lastNode.type === "Backreference",
|
|
2184
|
-
inCharClass: n.inCharClass,
|
|
2185
|
-
useFlagV: n.useFlagV
|
|
2186
|
-
});
|
|
2187
|
-
if (r !== t)
|
|
2188
|
-
return r;
|
|
2189
|
-
if (n.useAppliedIgnoreCase && n.currentFlags.ignoreCase && Oe(t)) {
|
|
2190
|
-
const a = In(t);
|
|
2191
|
-
return n.inCharClass ? a.join("") : a.length > 1 ? `[${a.join("")}]` : a[0];
|
|
2192
|
-
}
|
|
2193
|
-
return t;
|
|
2194
|
-
},
|
|
2195
|
-
/**
|
|
2196
|
-
@param {CharacterClassNode} node
|
|
2197
|
-
*/
|
|
2198
|
-
CharacterClass(e, n, t) {
|
|
2199
|
-
const { kind: r, negate: a, parent: o } = e;
|
|
2200
|
-
let { body: s } = e;
|
|
2201
|
-
if (r === "intersection" && !n.useFlagV)
|
|
2202
|
-
throw new Error("Use of character class intersection requires min target ES2024");
|
|
2203
|
-
U.bugFlagVLiteralHyphenIsRange && n.useFlagV && s.some(sn) && (s = [he(45), ...s.filter((l) => !sn(l))]);
|
|
2204
|
-
const i = () => `[${a ? "^" : ""}${s.map(t).join(r === "intersection" ? "&&" : "")}]`;
|
|
2205
|
-
if (!n.inCharClass) {
|
|
2206
|
-
if (
|
|
2207
|
-
// Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
|
|
2208
|
-
(!n.useFlagV || U.bugNestedClassIgnoresNegation) && !a
|
|
2209
|
-
) {
|
|
2210
|
-
const p = s.filter(
|
|
2211
|
-
(c) => c.type === "CharacterClass" && c.kind === "union" && c.negate
|
|
2212
|
-
);
|
|
2213
|
-
if (p.length) {
|
|
2214
|
-
const c = N(), d = c.body[0];
|
|
2215
|
-
return c.parent = o, d.parent = c, s = s.filter((g) => !p.includes(g)), e.body = s, s.length ? (e.parent = d, d.body.push(e)) : c.body.pop(), p.forEach((g) => {
|
|
2216
|
-
const f = H({ body: [g] });
|
|
2217
|
-
g.parent = f, f.parent = c, c.body.push(f);
|
|
2218
|
-
}), t(c);
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
n.inCharClass = !0;
|
|
2222
|
-
const l = i();
|
|
2223
|
-
return n.inCharClass = !1, l;
|
|
2224
|
-
}
|
|
2225
|
-
const u = s[0];
|
|
2226
|
-
if (
|
|
2227
|
-
// Already established that the parent is a char class via `inCharClass`; don't check again
|
|
2228
|
-
r === "union" && !a && u && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
|
|
2229
|
-
((!n.useFlagV || !n.verbose) && o.kind === "union" && !(U.bugFlagVLiteralHyphenIsRange && n.useFlagV) || !n.verbose && o.kind === "intersection" && // JS doesn't allow intersection with union or ranges
|
|
2230
|
-
s.length === 1 && u.type !== "CharacterClassRange")
|
|
2231
|
-
)
|
|
2232
|
-
return s.map(t).join("");
|
|
2233
|
-
if (!n.useFlagV && o.type === "CharacterClass")
|
|
2234
|
-
throw new Error("Uses nested character class in a way that requires min target ES2024");
|
|
2235
|
-
return i();
|
|
2236
|
-
},
|
|
2237
|
-
/**
|
|
2238
|
-
@param {CharacterClassRangeNode} node
|
|
2239
|
-
*/
|
|
2240
|
-
CharacterClassRange(e, n) {
|
|
2241
|
-
const t = e.min.value, r = e.max.value, a = {
|
|
2242
|
-
escDigit: !1,
|
|
2243
|
-
inCharClass: !0,
|
|
2244
|
-
useFlagV: n.useFlagV
|
|
2245
|
-
}, o = Q(t, a), s = Q(r, a), i = /* @__PURE__ */ new Set();
|
|
2246
|
-
if (n.useAppliedIgnoreCase && n.currentFlags.ignoreCase) {
|
|
2247
|
-
const u = Fn(e);
|
|
2248
|
-
vr(u).forEach((l) => {
|
|
2249
|
-
i.add(
|
|
2250
|
-
Array.isArray(l) ? `${Q(l[0], a)}-${Q(l[1], a)}` : Q(l, a)
|
|
2251
|
-
);
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
return `${o}-${s}${[...i].join("")}`;
|
|
2255
|
-
},
|
|
2256
|
-
/**
|
|
2257
|
-
@param {CharacterSetNode} node
|
|
2258
|
-
*/
|
|
2259
|
-
CharacterSet({ kind: e, negate: n, value: t, key: r }, a) {
|
|
2260
|
-
if (e === "dot")
|
|
2261
|
-
return a.currentFlags.dotAll ? a.appliedGlobalFlags.dotAll || a.useFlagMods ? "." : "[^]" : (
|
|
2262
|
-
// Onig's only line break char is line feed, unlike JS
|
|
2263
|
-
h`[^\n]`
|
|
2264
|
-
);
|
|
2265
|
-
if (e === "digit")
|
|
2266
|
-
return n ? h`\D` : h`\d`;
|
|
2267
|
-
if (e === "property") {
|
|
2268
|
-
if (a.useAppliedIgnoreCase && a.currentFlags.ignoreCase && Sn.has(t))
|
|
2269
|
-
throw new Error(`Unicode property "${t}" can't be case-insensitive when other chars have specific case`);
|
|
2270
|
-
return `${n ? h`\P` : h`\p`}{${r ? `${r}=` : ""}${t}}`;
|
|
2271
|
-
}
|
|
2272
|
-
if (e === "word")
|
|
2273
|
-
return n ? h`\W` : h`\w`;
|
|
2274
|
-
throw new Error(`Unexpected character set kind "${e}"`);
|
|
2275
|
-
},
|
|
2276
|
-
/**
|
|
2277
|
-
@param {FlagsNode} node
|
|
2278
|
-
*/
|
|
2279
|
-
Flags(e, n) {
|
|
2280
|
-
return (
|
|
2281
|
-
// The transformer should never turn on the properties for flags d, g, m since Onig doesn't
|
|
2282
|
-
// have equivs. Flag m is never used since Onig uses different line break chars than JS
|
|
2283
|
-
// (node.hasIndices ? 'd' : '') +
|
|
2284
|
-
// (node.global ? 'g' : '') +
|
|
2285
|
-
// (node.multiline ? 'm' : '') +
|
|
2286
|
-
(n.appliedGlobalFlags.ignoreCase ? "i" : "") + (e.dotAll ? "s" : "") + (e.sticky ? "y" : "")
|
|
2287
|
-
);
|
|
2288
|
-
},
|
|
2289
|
-
/**
|
|
2290
|
-
@param {GroupNode} node
|
|
2291
|
-
*/
|
|
2292
|
-
Group({ atomic: e, body: n, flags: t, parent: r }, a, o) {
|
|
2293
|
-
const s = a.currentFlags;
|
|
2294
|
-
t && (a.currentFlags = ge(s, t));
|
|
2295
|
-
const i = n.map(o).join("|"), u = !a.verbose && n.length === 1 && // Single alt
|
|
2296
|
-
r.type !== "Quantifier" && !e && (!a.useFlagMods || !t) ? i : `(?${Ar(e, t, a.useFlagMods)}${i})`;
|
|
2297
|
-
return a.currentFlags = s, u;
|
|
2298
|
-
},
|
|
2299
|
-
/**
|
|
2300
|
-
@param {LookaroundAssertionNode} node
|
|
2301
|
-
*/
|
|
2302
|
-
LookaroundAssertion({ body: e, kind: n, negate: t }, r, a) {
|
|
2303
|
-
return `(?${`${n === "lookahead" ? "" : "<"}${t ? "!" : "="}`}${e.map(a).join("|")})`;
|
|
2304
|
-
},
|
|
2305
|
-
/**
|
|
2306
|
-
@param {QuantifierNode} node
|
|
2307
|
-
*/
|
|
2308
|
-
Quantifier(e, n, t) {
|
|
2309
|
-
return t(e.body) + Ir(e);
|
|
2310
|
-
},
|
|
2311
|
-
/**
|
|
2312
|
-
@param {SubroutineNode & {isRecursive: true}} node
|
|
2313
|
-
*/
|
|
2314
|
-
Subroutine({ isRecursive: e, ref: n }, t) {
|
|
2315
|
-
if (!e)
|
|
2316
|
-
throw new Error("Unexpected non-recursive subroutine in transformed AST");
|
|
2317
|
-
const r = t.recursionLimit;
|
|
2318
|
-
return n === 0 ? `(?R=${r})` : h`\g<${n}&R=${r}>`;
|
|
2319
|
-
}
|
|
2320
|
-
}, xr = /* @__PURE__ */ new Set([
|
|
2321
|
-
"$",
|
|
2322
|
-
"(",
|
|
2323
|
-
")",
|
|
2324
|
-
"*",
|
|
2325
|
-
"+",
|
|
2326
|
-
".",
|
|
2327
|
-
"?",
|
|
2328
|
-
"[",
|
|
2329
|
-
"\\",
|
|
2330
|
-
"]",
|
|
2331
|
-
"^",
|
|
2332
|
-
"{",
|
|
2333
|
-
"|",
|
|
2334
|
-
"}"
|
|
2335
|
-
]), kr = /* @__PURE__ */ new Set([
|
|
2336
|
-
"-",
|
|
2337
|
-
"\\",
|
|
2338
|
-
"]",
|
|
2339
|
-
"^",
|
|
2340
|
-
// Literal `[` doesn't require escaping with flag u, but this can help work around regex source
|
|
2341
|
-
// linters and regex syntax processors that expect unescaped `[` to create a nested class
|
|
2342
|
-
"["
|
|
2343
|
-
]), Er = /* @__PURE__ */ new Set([
|
|
2344
|
-
"(",
|
|
2345
|
-
")",
|
|
2346
|
-
"-",
|
|
2347
|
-
"/",
|
|
2348
|
-
"[",
|
|
2349
|
-
"\\",
|
|
2350
|
-
"]",
|
|
2351
|
-
"^",
|
|
2352
|
-
"{",
|
|
2353
|
-
"|",
|
|
2354
|
-
"}",
|
|
2355
|
-
// Double punctuators; also includes already-listed `-` and `^`
|
|
2356
|
-
"!",
|
|
2357
|
-
"#",
|
|
2358
|
-
"$",
|
|
2359
|
-
"%",
|
|
2360
|
-
"&",
|
|
2361
|
-
"*",
|
|
2362
|
-
"+",
|
|
2363
|
-
",",
|
|
2364
|
-
".",
|
|
2365
|
-
":",
|
|
2366
|
-
";",
|
|
2367
|
-
"<",
|
|
2368
|
-
"=",
|
|
2369
|
-
">",
|
|
2370
|
-
"?",
|
|
2371
|
-
"@",
|
|
2372
|
-
"`",
|
|
2373
|
-
"~"
|
|
2374
|
-
]), on = /* @__PURE__ */ new Map([
|
|
2375
|
-
[9, h`\t`],
|
|
2376
|
-
// horizontal tab
|
|
2377
|
-
[10, h`\n`],
|
|
2378
|
-
// line feed
|
|
2379
|
-
[11, h`\v`],
|
|
2380
|
-
// vertical tab
|
|
2381
|
-
[12, h`\f`],
|
|
2382
|
-
// form feed
|
|
2383
|
-
[13, h`\r`],
|
|
2384
|
-
// carriage return
|
|
2385
|
-
[8232, h`\u2028`],
|
|
2386
|
-
// line separator
|
|
2387
|
-
[8233, h`\u2029`],
|
|
2388
|
-
// paragraph separator
|
|
2389
|
-
[65279, h`\uFEFF`]
|
|
2390
|
-
// ZWNBSP/BOM
|
|
2391
|
-
]), $r = new RegExp("^\\p{Cased}$", "u");
|
|
2392
|
-
function Oe(e) {
|
|
2393
|
-
return $r.test(e);
|
|
2394
|
-
}
|
|
2395
|
-
function Fn(e, n) {
|
|
2396
|
-
const t = !!(n != null && n.firstOnly), r = e.min.value, a = e.max.value, o = [];
|
|
2397
|
-
if (r < 65 && (a === 65535 || a >= 131071) || r === 65536 && a >= 131071)
|
|
2398
|
-
return o;
|
|
2399
|
-
for (let s = r; s <= a; s++) {
|
|
2400
|
-
const i = C(s);
|
|
2401
|
-
if (!Oe(i))
|
|
2402
|
-
continue;
|
|
2403
|
-
const u = In(i).filter((l) => {
|
|
2404
|
-
const p = l.codePointAt(0);
|
|
2405
|
-
return p < r || p > a;
|
|
2406
|
-
});
|
|
2407
|
-
if (u.length && (o.push(...u), t))
|
|
2408
|
-
break;
|
|
2409
|
-
}
|
|
2410
|
-
return o;
|
|
2411
|
-
}
|
|
2412
|
-
function Q(e, { escDigit: n, inCharClass: t, useFlagV: r }) {
|
|
2413
|
-
if (on.has(e))
|
|
2414
|
-
return on.get(e);
|
|
2415
|
-
if (
|
|
2416
|
-
// Control chars, etc.; condition modeled on the Chrome developer console's display for strings
|
|
2417
|
-
e < 32 || e > 126 && e < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
|
|
2418
|
-
e > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
|
|
2419
|
-
n && Sr(e)
|
|
2420
|
-
)
|
|
2421
|
-
return e > 255 ? `\\u{${e.toString(16).toUpperCase()}}` : `\\x${e.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
2422
|
-
const a = t ? r ? Er : kr : xr, o = C(e);
|
|
2423
|
-
return (a.has(o) ? "\\" : "") + o;
|
|
2424
|
-
}
|
|
2425
|
-
function vr(e) {
|
|
2426
|
-
const n = e.map((a) => a.codePointAt(0)).sort((a, o) => a - o), t = [];
|
|
2427
|
-
let r = null;
|
|
2428
|
-
for (let a = 0; a < n.length; a++)
|
|
2429
|
-
n[a + 1] === n[a] + 1 ? r ?? (r = n[a]) : r === null ? t.push(n[a]) : (t.push([r, n[a]]), r = null);
|
|
2430
|
-
return t;
|
|
2431
|
-
}
|
|
2432
|
-
function Ar(e, n, t) {
|
|
2433
|
-
if (e)
|
|
2434
|
-
return ">";
|
|
2435
|
-
let r = "";
|
|
2436
|
-
if (n && t) {
|
|
2437
|
-
const { enable: a, disable: o } = n;
|
|
2438
|
-
r = (a != null && a.ignoreCase ? "i" : "") + (a != null && a.dotAll ? "s" : "") + (o ? "-" : "") + (o != null && o.ignoreCase ? "i" : "") + (o != null && o.dotAll ? "s" : "");
|
|
2439
|
-
}
|
|
2440
|
-
return `${r}:`;
|
|
2441
|
-
}
|
|
2442
|
-
function Ir({ kind: e, max: n, min: t }) {
|
|
2443
|
-
let r;
|
|
2444
|
-
return !t && n === 1 ? r = "?" : !t && n === 1 / 0 ? r = "*" : t === 1 && n === 1 / 0 ? r = "+" : t === n ? r = `{${t}}` : r = `{${t},${n === 1 / 0 ? "" : n}}`, r + {
|
|
2445
|
-
greedy: "",
|
|
2446
|
-
lazy: "?",
|
|
2447
|
-
possessive: "+"
|
|
2448
|
-
}[e];
|
|
2449
|
-
}
|
|
2450
|
-
function an({ type: e }) {
|
|
2451
|
-
return e === "CapturingGroup" || e === "Group" || e === "LookaroundAssertion";
|
|
2452
|
-
}
|
|
2453
|
-
function Sr(e) {
|
|
2454
|
-
return e > 47 && e < 58;
|
|
2455
|
-
}
|
|
2456
|
-
function sn({ type: e, value: n }) {
|
|
2457
|
-
return e === "Character" && n === 45;
|
|
2458
|
-
}
|
|
2459
|
-
var W, B, K, j, Y, de, ve, ae, _r = (ae = class extends RegExp {
|
|
2460
|
-
/**
|
|
2461
|
-
@overload
|
|
2462
|
-
@param {string} pattern
|
|
2463
|
-
@param {string} [flags]
|
|
2464
|
-
@param {EmulatedRegExpOptions} [options]
|
|
2465
|
-
*/
|
|
2466
|
-
/**
|
|
2467
|
-
@overload
|
|
2468
|
-
@param {EmulatedRegExp} pattern
|
|
2469
|
-
@param {string} [flags]
|
|
2470
|
-
*/
|
|
2471
|
-
constructor(e, n, t) {
|
|
2472
|
-
var r = (...o) => (super(...o), /**
|
|
2473
|
-
Adds support for hidden and transfer captures.
|
|
2474
|
-
@param {string} str
|
|
2475
|
-
@returns
|
|
2476
|
-
*/
|
|
2477
|
-
Z(this, de), /**
|
|
2478
|
-
@type {Map<number, {
|
|
2479
|
-
hidden?: true;
|
|
2480
|
-
transferTo?: number;
|
|
2481
|
-
}>}
|
|
2482
|
-
*/
|
|
2483
|
-
Z(this, W, /* @__PURE__ */ new Map()), /**
|
|
2484
|
-
@type {RegExp | EmulatedRegExp | null}
|
|
2485
|
-
*/
|
|
2486
|
-
Z(this, B, null), /**
|
|
2487
|
-
@type {string}
|
|
2488
|
-
*/
|
|
2489
|
-
Z(this, K, void 0), /**
|
|
2490
|
-
@type {Map<number, string>?}
|
|
2491
|
-
*/
|
|
2492
|
-
Z(this, j, null), /**
|
|
2493
|
-
@type {string?}
|
|
2494
|
-
*/
|
|
2495
|
-
Z(this, Y, null), /**
|
|
2496
|
-
Can be used to serialize the instance.
|
|
2497
|
-
@type {EmulatedRegExpOptions}
|
|
2498
|
-
*/
|
|
2499
|
-
pn(this, "rawOptions", {}), this);
|
|
2500
|
-
const a = !!(t != null && t.lazyCompile);
|
|
2501
|
-
if (e instanceof RegExp) {
|
|
2502
|
-
if (t)
|
|
2503
|
-
throw new Error("Cannot provide options when copying a regexp");
|
|
2504
|
-
const o = e;
|
|
2505
|
-
r(o, n), L(this, K, o.source), o instanceof ae && (L(this, W, E(o, W)), L(this, j, E(o, j)), L(this, Y, E(o, Y)), this.rawOptions = o.rawOptions);
|
|
2506
|
-
} else {
|
|
2507
|
-
const o = {
|
|
2508
|
-
hiddenCaptures: [],
|
|
2509
|
-
strategy: null,
|
|
2510
|
-
transfers: [],
|
|
2511
|
-
...t
|
|
2512
|
-
};
|
|
2513
|
-
r(a ? "" : e, n), L(this, K, e), L(this, W, Mr(o.hiddenCaptures, o.transfers)), L(this, Y, o.strategy), this.rawOptions = t ?? {};
|
|
2514
|
-
}
|
|
2515
|
-
a || L(this, B, this);
|
|
2516
|
-
}
|
|
2517
|
-
// Override the getter with one that works with lazy-compiled regexes
|
|
2518
|
-
get source() {
|
|
2519
|
-
return E(this, K) || "(?:)";
|
|
2520
|
-
}
|
|
2521
|
-
/**
|
|
2522
|
-
Called internally by all String/RegExp methods that use regexes.
|
|
2523
|
-
@override
|
|
2524
|
-
@param {string} str
|
|
2525
|
-
@returns {RegExpExecArray?}
|
|
2526
|
-
*/
|
|
2527
|
-
exec(e) {
|
|
2528
|
-
if (!E(this, B)) {
|
|
2529
|
-
const { lazyCompile: r, ...a } = this.rawOptions;
|
|
2530
|
-
L(this, B, new ae(E(this, K), this.flags, a));
|
|
2531
|
-
}
|
|
2532
|
-
const n = this.global || this.sticky, t = this.lastIndex;
|
|
2533
|
-
if (E(this, Y) === "clip_search" && n && t) {
|
|
2534
|
-
this.lastIndex = 0;
|
|
2535
|
-
const r = Te(this, de, ve).call(this, e.slice(t));
|
|
2536
|
-
return r && (Nr(r, t, e, this.hasIndices), this.lastIndex += t), r;
|
|
2537
|
-
}
|
|
2538
|
-
return Te(this, de, ve).call(this, e);
|
|
2539
|
-
}
|
|
2540
|
-
}, W = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakSet(), ve = function(e) {
|
|
2541
|
-
E(this, B).lastIndex = this.lastIndex;
|
|
2542
|
-
const n = Kn(ae.prototype, this, "exec").call(E(this, B), e);
|
|
2543
|
-
if (this.lastIndex = E(this, B).lastIndex, !n || !E(this, W).size)
|
|
2544
|
-
return n;
|
|
2545
|
-
const t = [...n];
|
|
2546
|
-
n.length = 1;
|
|
2547
|
-
let r;
|
|
2548
|
-
this.hasIndices && (r = [...n.indices], n.indices.length = 1);
|
|
2549
|
-
const a = [0];
|
|
2550
|
-
for (let o = 1; o < t.length; o++) {
|
|
2551
|
-
const { hidden: s, transferTo: i } = E(this, W).get(o) ?? {};
|
|
2552
|
-
if (s ? a.push(null) : (a.push(n.length), n.push(t[o]), this.hasIndices && n.indices.push(r[o])), i && t[o] !== void 0) {
|
|
2553
|
-
const u = a[i];
|
|
2554
|
-
if (!u)
|
|
2555
|
-
throw new Error(`Invalid capture transfer to "${u}"`);
|
|
2556
|
-
if (n[u] = t[o], this.hasIndices && (n.indices[u] = r[o]), n.groups) {
|
|
2557
|
-
E(this, j) || L(this, j, Lr(this.source));
|
|
2558
|
-
const l = E(this, j).get(i);
|
|
2559
|
-
l && (n.groups[l] = t[o], this.hasIndices && (n.indices.groups[l] = r[o]));
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
return n;
|
|
2564
|
-
}, ae);
|
|
2565
|
-
function Nr(e, n, t, r) {
|
|
2566
|
-
if (e.index += n, e.input = t, r) {
|
|
2567
|
-
const a = e.indices;
|
|
2568
|
-
for (let s = 0; s < a.length; s++) {
|
|
2569
|
-
const i = a[s];
|
|
2570
|
-
i && (a[s] = [i[0] + n, i[1] + n]);
|
|
2571
|
-
}
|
|
2572
|
-
const o = a.groups;
|
|
2573
|
-
o && Object.keys(o).forEach((s) => {
|
|
2574
|
-
const i = o[s];
|
|
2575
|
-
i && (o[s] = [i[0] + n, i[1] + n]);
|
|
2576
|
-
});
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
function Mr(e, n) {
|
|
2580
|
-
const t = /* @__PURE__ */ new Map();
|
|
2581
|
-
for (const r of e)
|
|
2582
|
-
t.set(r, {
|
|
2583
|
-
hidden: !0
|
|
2584
|
-
});
|
|
2585
|
-
for (const [r, a] of n)
|
|
2586
|
-
for (const o of a)
|
|
2587
|
-
ie(t, o, {}).transferTo = r;
|
|
2588
|
-
return t;
|
|
2589
|
-
}
|
|
2590
|
-
function Lr(e) {
|
|
2591
|
-
const n = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, t = /* @__PURE__ */ new Map();
|
|
2592
|
-
let r = 0, a = 0, o;
|
|
2593
|
-
for (; o = n.exec(e); ) {
|
|
2594
|
-
const { 0: s, groups: { capture: i, name: u } } = o;
|
|
2595
|
-
s === "[" ? r++ : r ? s === "]" && r-- : i && (a++, u && t.set(a, u));
|
|
2596
|
-
}
|
|
2597
|
-
return t;
|
|
2598
|
-
}
|
|
2599
|
-
function Pr(e, n) {
|
|
2600
|
-
const t = Rr(e, n);
|
|
2601
|
-
return t.options ? new _r(t.pattern, t.flags, t.options) : new RegExp(t.pattern, t.flags);
|
|
2602
|
-
}
|
|
2603
|
-
function Rr(e, n) {
|
|
2604
|
-
const t = An(n), r = yn(e, {
|
|
2605
|
-
flags: t.flags,
|
|
2606
|
-
normalizeUnknownPropertyNames: !0,
|
|
2607
|
-
rules: {
|
|
2608
|
-
captureGroup: t.rules.captureGroup,
|
|
2609
|
-
singleline: t.rules.singleline
|
|
2610
|
-
},
|
|
2611
|
-
skipBackrefValidation: t.rules.allowOrphanBackrefs,
|
|
2612
|
-
unicodePropertyMap: Ge
|
|
2613
|
-
}), a = ir(r, {
|
|
2614
|
-
accuracy: t.accuracy,
|
|
2615
|
-
asciiWordBoundaries: t.rules.asciiWordBoundaries,
|
|
2616
|
-
avoidSubclass: t.avoidSubclass,
|
|
2617
|
-
bestEffortTarget: t.target
|
|
2618
|
-
}), o = yr(a, t), s = Qt(o.pattern, {
|
|
2619
|
-
captureTransfers: o._captureTransfers,
|
|
2620
|
-
hiddenCaptures: o._hiddenCaptures,
|
|
2621
|
-
mode: "external"
|
|
2622
|
-
}), i = Zt(s.pattern), u = Xt(i.pattern, {
|
|
2623
|
-
captureTransfers: s.captureTransfers,
|
|
2624
|
-
hiddenCaptures: s.hiddenCaptures
|
|
2625
|
-
}), l = {
|
|
2626
|
-
pattern: u.pattern,
|
|
2627
|
-
flags: `${t.hasIndices ? "d" : ""}${t.global ? "g" : ""}${o.flags}${o.options.disable.v ? "u" : "v"}`
|
|
2628
|
-
};
|
|
2629
|
-
if (t.avoidSubclass) {
|
|
2630
|
-
if (t.lazyCompileLength !== 1 / 0)
|
|
2631
|
-
throw new Error("Lazy compilation requires subclass");
|
|
2632
|
-
} else {
|
|
2633
|
-
const p = u.hiddenCaptures.sort((f, w) => f - w), c = Array.from(u.captureTransfers), d = a._strategy, g = l.pattern.length >= t.lazyCompileLength;
|
|
2634
|
-
(p.length || c.length || d || g) && (l.options = {
|
|
2635
|
-
...p.length && { hiddenCaptures: p },
|
|
2636
|
-
...c.length && { transfers: c },
|
|
2637
|
-
...d && { strategy: d },
|
|
2638
|
-
...g && { lazyCompile: g }
|
|
2639
|
-
});
|
|
2640
|
-
}
|
|
2641
|
-
return l;
|
|
2642
|
-
}
|
|
2643
|
-
const un = 4294967295;
|
|
2644
|
-
class Fr {
|
|
2645
|
-
constructor(n, t = {}) {
|
|
2646
|
-
pn(this, "regexps"), this.patterns = n, this.options = t;
|
|
2647
|
-
const {
|
|
2648
|
-
forgiving: r = !1,
|
|
2649
|
-
cache: a,
|
|
2650
|
-
regexConstructor: o
|
|
2651
|
-
} = t;
|
|
2652
|
-
if (!o)
|
|
2653
|
-
throw new Error("Option `regexConstructor` is not provided");
|
|
2654
|
-
this.regexps = n.map((s) => {
|
|
2655
|
-
if (typeof s != "string")
|
|
2656
|
-
return s;
|
|
2657
|
-
const i = a == null ? void 0 : a.get(s);
|
|
2658
|
-
if (i) {
|
|
2659
|
-
if (i instanceof RegExp)
|
|
2660
|
-
return i;
|
|
2661
|
-
if (r)
|
|
2662
|
-
return null;
|
|
2663
|
-
throw i;
|
|
2664
|
-
}
|
|
2665
|
-
try {
|
|
2666
|
-
const u = o(s);
|
|
2667
|
-
return a == null || a.set(s, u), u;
|
|
2668
|
-
} catch (u) {
|
|
2669
|
-
if (a == null || a.set(s, u), r)
|
|
2670
|
-
return null;
|
|
2671
|
-
throw u;
|
|
2672
|
-
}
|
|
2673
|
-
});
|
|
2674
|
-
}
|
|
2675
|
-
findNextMatchSync(n, t, r) {
|
|
2676
|
-
const a = typeof n == "string" ? n : n.content, o = [];
|
|
2677
|
-
function s(i, u, l = 0) {
|
|
2678
|
-
return {
|
|
2679
|
-
index: i,
|
|
2680
|
-
captureIndices: u.indices.map((p) => p == null ? {
|
|
2681
|
-
start: un,
|
|
2682
|
-
end: un,
|
|
2683
|
-
length: 0
|
|
2684
|
-
} : {
|
|
2685
|
-
start: p[0] + l,
|
|
2686
|
-
end: p[1] + l,
|
|
2687
|
-
length: p[1] - p[0]
|
|
2688
|
-
})
|
|
2689
|
-
};
|
|
2690
|
-
}
|
|
2691
|
-
for (let i = 0; i < this.regexps.length; i++) {
|
|
2692
|
-
const u = this.regexps[i];
|
|
2693
|
-
if (u)
|
|
2694
|
-
try {
|
|
2695
|
-
u.lastIndex = t;
|
|
2696
|
-
const l = u.exec(a);
|
|
2697
|
-
if (!l)
|
|
2698
|
-
continue;
|
|
2699
|
-
if (l.index === t)
|
|
2700
|
-
return s(i, l, 0);
|
|
2701
|
-
o.push([i, l, 0]);
|
|
2702
|
-
} catch (l) {
|
|
2703
|
-
if (this.options.forgiving)
|
|
2704
|
-
continue;
|
|
2705
|
-
throw l;
|
|
2706
|
-
}
|
|
2707
|
-
}
|
|
2708
|
-
if (o.length) {
|
|
2709
|
-
const i = Math.min(...o.map((u) => u[1].index));
|
|
2710
|
-
for (const [u, l, p] of o)
|
|
2711
|
-
if (l.index === i)
|
|
2712
|
-
return s(u, l, p);
|
|
2713
|
-
}
|
|
2714
|
-
return null;
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
function Ur(e, n) {
|
|
2718
|
-
return Pr(
|
|
2719
|
-
e,
|
|
2720
|
-
{
|
|
2721
|
-
global: !0,
|
|
2722
|
-
hasIndices: !0,
|
|
2723
|
-
// This has no benefit for the standard JS engine, but it avoids a perf penalty for
|
|
2724
|
-
// precompiled grammars when constructing extremely long patterns that aren't always used
|
|
2725
|
-
lazyCompileLength: 3e3,
|
|
2726
|
-
rules: {
|
|
2727
|
-
// Needed since TextMate grammars merge backrefs across patterns
|
|
2728
|
-
allowOrphanBackrefs: !0,
|
|
2729
|
-
// Improves search performance for generated regexes
|
|
2730
|
-
asciiWordBoundaries: !0,
|
|
2731
|
-
// Follow `vscode-oniguruma` which enables this Oniguruma option by default
|
|
2732
|
-
captureGroup: !0,
|
|
2733
|
-
// Oniguruma uses depth limit `20`; lowered here to keep regexes shorter and maybe
|
|
2734
|
-
// sometimes faster, but can be increased if issues reported due to low limit
|
|
2735
|
-
recursionLimit: 5,
|
|
2736
|
-
// Oniguruma option for `^`->`\A`, `$`->`\Z`; improves search performance without any
|
|
2737
|
-
// change in meaning since TM grammars search line by line
|
|
2738
|
-
singleline: !0
|
|
2739
|
-
},
|
|
2740
|
-
...n
|
|
2741
|
-
}
|
|
2742
|
-
);
|
|
2743
|
-
}
|
|
2744
|
-
function Br(e = {}) {
|
|
2745
|
-
const n = Object.assign(
|
|
2746
|
-
{
|
|
2747
|
-
target: "auto",
|
|
2748
|
-
cache: /* @__PURE__ */ new Map()
|
|
2749
|
-
},
|
|
2750
|
-
e
|
|
2751
|
-
);
|
|
2752
|
-
return n.regexConstructor || (n.regexConstructor = (t) => Ur(t, { target: n.target })), {
|
|
2753
|
-
createScanner(t) {
|
|
2754
|
-
return new Fr(t, n);
|
|
2755
|
-
},
|
|
2756
|
-
createString(t) {
|
|
2757
|
-
return {
|
|
2758
|
-
content: t
|
|
2759
|
-
};
|
|
2760
|
-
}
|
|
2761
|
-
};
|
|
2762
|
-
}
|
|
2763
|
-
var Gr = Pe("block", "before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-4", "before:mr-4", "before:text-[13px]", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none"), Or = jn(({ children: e, result: n, language: t, className: r, ...a }) => {
|
|
2764
|
-
let o = cn(() => ({ backgroundColor: n.bg, color: n.fg }), [n.bg, n.fg]);
|
|
2765
|
-
return A.jsx("pre", { className: Pe(r, "p-4 text-sm dark:bg-(--shiki-dark-bg)!"), "data-language": t, "data-streamdown": "code-block-body", style: o, ...a, children: A.jsx("code", { className: "[counter-increment:line_0] [counter-reset:line]", children: n.tokens.map((s, i) => A.jsx("span", { className: Gr, children: s.map((u, l) => A.jsx("span", { className: "dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!", style: { color: u.color, backgroundColor: u.bgColor, ...u.htmlStyle }, ...u.htmlAttrs, children: u.content }, l)) }, i)) }) });
|
|
2766
|
-
}, (e, n) => e.result === n.result && e.language === n.language && e.className === n.className), Dr = ({ className: e, language: n, style: t, ...r }) => A.jsx("div", { className: Pe("my-4 w-full overflow-hidden rounded-xl border border-border", e), "data-language": n, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...t }, ...r }), Tr = ({ language: e, children: n }) => A.jsxs("div", { className: "flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: [A.jsx("span", { className: "ml-1 font-mono lowercase", children: e }), A.jsx("div", { className: "flex items-center gap-2", children: n })] }), Wr = Br({ forgiving: !0 }), Ae = /* @__PURE__ */ new Map(), Ie = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), jr = (e, n) => `${e}-${n[0]}-${n[1]}`, zr = (e, n, t) => {
|
|
2767
|
-
let r = e.slice(0, 100), a = e.length > 100 ? e.slice(-100) : "";
|
|
2768
|
-
return `${n}:${t[0]}:${t[1]}:${e.length}:${r}:${a}`;
|
|
2769
|
-
}, Un = (e) => Object.hasOwn(Wn, e), Vr = (e, n) => {
|
|
2770
|
-
let t = Un(e) ? e : "text", r = jr(t, n);
|
|
2771
|
-
if (Ae.has(r))
|
|
2772
|
-
return Ae.get(r);
|
|
2773
|
-
let a = Tn({ themes: n, langs: [t], engine: Wr });
|
|
2774
|
-
return Ae.set(r, a), a;
|
|
2775
|
-
}, ln = (e, n, t, r) => {
|
|
2776
|
-
let a = Un(n) ? n : "text", o = zr(e, a, t);
|
|
2777
|
-
return Ie.has(o) ? Ie.get(o) : (r && (J.has(o) || J.set(o, /* @__PURE__ */ new Set()), J.get(o).add(r)), Vr(a, t).then((s) => {
|
|
2778
|
-
let i = s.codeToTokens(e, { lang: a, themes: { light: t[0], dark: t[1] } });
|
|
2779
|
-
Ie.set(o, i);
|
|
2780
|
-
let u = J.get(o);
|
|
2781
|
-
if (u) {
|
|
2782
|
-
for (let l of u)
|
|
2783
|
-
l(i);
|
|
2784
|
-
J.delete(o);
|
|
2785
|
-
}
|
|
2786
|
-
}).catch((s) => {
|
|
2787
|
-
console.error("Failed to highlight code:", s), J.delete(o);
|
|
2788
|
-
}), null);
|
|
2789
|
-
}, qr = ({ code: e, language: n, className: t, children: r, ...a }) => {
|
|
2790
|
-
let { shikiTheme: o } = zn(On), s = cn(() => ({ bg: "transparent", fg: "inherit", tokens: e.split(`
|
|
2791
|
-
`).map((l) => [{ content: l, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [e]), [i, u] = Vn(s);
|
|
2792
|
-
return Hn(() => {
|
|
2793
|
-
let l = ln(e, n, o);
|
|
2794
|
-
if (l) {
|
|
2795
|
-
u(l);
|
|
2796
|
-
return;
|
|
2797
|
-
}
|
|
2798
|
-
ln(e, n, o, (p) => {
|
|
2799
|
-
u(p);
|
|
2800
|
-
});
|
|
2801
|
-
}, [e, n, o]), A.jsx(Dn.Provider, { value: { code: e }, children: A.jsxs(Dr, { language: n, children: [A.jsx(Tr, { language: n, children: r }), A.jsx(Or, { className: t, language: n, result: i, ...a })] }) });
|
|
2802
|
-
};
|
|
2803
|
-
export {
|
|
2804
|
-
qr as CodeBlock
|
|
2805
|
-
};
|