db-studio 1.2.18 → 1.2.20
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/core-dist/assets/{_baseUniq-Ba6cdS3v.js → _baseUniq-CeqT3N-D.js} +1 -1
- package/dist/core-dist/assets/_pathlessLayout-DjLhpgxd.js +2 -0
- package/dist/core-dist/assets/_queryId-D0l8wnr_.js +1 -0
- package/dist/core-dist/assets/_table-D_on85wJ.js +1 -0
- package/dist/core-dist/assets/{arc-D8UcRNMa.js → arc-Dnc_3KxD.js} +1 -1
- package/dist/core-dist/assets/architectureDiagram-VXUJARFQ-D-naFXsN.js +36 -0
- package/dist/core-dist/assets/{blockDiagram-VD42YOAC-Key67jhL.js → blockDiagram-VD42YOAC-jp3IzhcG.js} +2 -2
- package/dist/core-dist/assets/{c4Diagram-YG6GDRKO-SLYVYNN5.js → c4Diagram-YG6GDRKO-CahI2eve.js} +4 -4
- package/dist/core-dist/assets/cdoe-editor-BswlKXRb.js +9 -0
- package/dist/core-dist/assets/channel-C4imq4Zh.js +1 -0
- package/dist/core-dist/assets/{chunk-4BX2VUAB-BHKffaup.js → chunk-4BX2VUAB-DNTUv4GR.js} +1 -1
- package/dist/core-dist/assets/{chunk-55IACEB6-Bp2-xSpt.js → chunk-55IACEB6-Xrs620gj.js} +1 -1
- package/dist/core-dist/assets/chunk-B4BG7PRW-COpTaouf.js +165 -0
- package/dist/core-dist/assets/chunk-DI55MBZ5-3wt5pOdw.js +220 -0
- package/dist/core-dist/assets/{chunk-FMBD7UC4-CXjDDSki.js → chunk-FMBD7UC4-BQmP0qBN.js} +1 -1
- package/dist/core-dist/assets/{chunk-QN33PNHL-D_22Snnm.js → chunk-QN33PNHL-f1y0j0u4.js} +1 -1
- package/dist/core-dist/assets/chunk-QZHKN3VN-C6jBpr-H.js +1 -0
- package/dist/core-dist/assets/{chunk-TZMSLE5B-cH4y8DMD.js → chunk-TZMSLE5B-31ka2vOU.js} +1 -1
- package/dist/core-dist/assets/classDiagram-2ON5EDUG-Q5JJrM4i.js +1 -0
- package/dist/core-dist/assets/classDiagram-v2-WZHVMYZB-Q5JJrM4i.js +1 -0
- package/dist/core-dist/assets/clone-DVHLGOmt.js +1 -0
- package/dist/core-dist/assets/{code-block-IT6T5CEO-BjXa4xsL.js → code-block-IT6T5CEO-B2LU0jbX.js} +4 -4
- package/dist/core-dist/assets/cose-bilkent-S5V4N54A-DsJKuZ9Q.js +1 -0
- package/dist/core-dist/assets/{css.worker-DBVD8oXr.js → css.worker-NZNbQL3P.js} +33 -33
- package/dist/core-dist/assets/dagre-6UL2VRFP-BnjHWLsZ.js +4 -0
- package/dist/core-dist/assets/diagram-PSM6KHXK-CnF6MjR2.js +24 -0
- package/dist/core-dist/assets/diagram-QEK2KX5R-DxVrT1PJ.js +43 -0
- package/dist/core-dist/assets/diagram-S2PKOQOG-BZ5b9Hv-.js +24 -0
- package/dist/core-dist/assets/erDiagram-Q2GNP2WA-s3KzkqPg.js +60 -0
- package/dist/core-dist/assets/flowDiagram-NV44I4VS-DFMBdQkp.js +162 -0
- package/dist/core-dist/assets/format-cell-value-Cn3RA9a1.js +1 -0
- package/dist/core-dist/assets/ganttDiagram-JELNMOA3-OzgA9GJ4.js +267 -0
- package/dist/core-dist/assets/gitGraphDiagram-NY62KEGX-LfOuHeDw.js +65 -0
- package/dist/core-dist/assets/{graph-CTgOz0UF.js → graph-CoUoQfuh.js} +1 -1
- package/dist/core-dist/assets/{html.worker-CwpTb9lJ.js → html.worker-eZJr__P7.js} +25 -25
- package/dist/core-dist/assets/icons-DJrV7d9i.js +1 -0
- package/dist/core-dist/assets/index-C4atBwjx.js +1 -0
- package/dist/core-dist/assets/index-CS7mbTnV.js +1 -0
- package/dist/core-dist/assets/index-Ch8XtMo1.css +1 -0
- package/dist/core-dist/assets/index-DOupmzl0.js +1 -0
- package/dist/core-dist/assets/index-ERxh7PXo.js +53 -0
- package/dist/core-dist/assets/indexes-COZEEebq.js +1 -0
- package/dist/core-dist/assets/infoDiagram-WHAUD3N6-D4mcM6pw.js +2 -0
- package/dist/core-dist/assets/{journeyDiagram-XKPGCS4Q-0eaJMAvF.js → journeyDiagram-XKPGCS4Q-CiAw1nw_.js} +5 -5
- package/dist/core-dist/assets/json.worker-C838mOW9.js +58 -0
- package/dist/core-dist/assets/{kanban-definition-3W4ZIXB7-C5OX0ahP.js → kanban-definition-3W4ZIXB7-Yuc0Z8QR.js} +2 -2
- package/dist/core-dist/assets/{layout-CsSbCnq2.js → layout-Cw4LVk42.js} +1 -1
- package/dist/core-dist/assets/{linear-D7wMV6wy.js → linear-CU5DgYOG.js} +1 -1
- package/dist/core-dist/assets/logs-BL7j4vCh.js +1 -0
- package/dist/core-dist/assets/mermaid-VLURNSYL-_Y2XU6_c.js +377 -0
- package/dist/core-dist/assets/mermaid.core-ds122QIK.js +191 -0
- package/dist/core-dist/assets/{min-i41Gt2X5.js → min-DFudLmkE.js} +1 -1
- package/dist/core-dist/assets/mindmap-definition-VGOIOE7T-D7KNYm2E.js +68 -0
- package/dist/core-dist/assets/monaco-editor-BMj4E99D.js +1230 -0
- package/dist/core-dist/assets/monaco-editor-Ck3IbhyB.css +1 -0
- package/dist/core-dist/assets/pieDiagram-ADFJNKIX-D6Z1CJPE.js +30 -0
- package/dist/core-dist/assets/quadrantDiagram-AYHSOK5B-CxzHU3WJ.js +7 -0
- package/dist/core-dist/assets/queries.store-Bxxvcbg7.js +1 -0
- package/dist/core-dist/assets/radix-ui-Cy3m1w7k.js +51 -0
- package/dist/core-dist/assets/react-dom-DJoE1oD9.js +9 -0
- package/dist/core-dist/assets/requirementDiagram-UZGBJVZJ-CJGHr0pf.js +64 -0
- package/dist/core-dist/assets/runner-tab-C3nQeksP.js +3 -0
- package/dist/core-dist/assets/sankeyDiagram-TZEHDZUN-CUlo_r1v.js +10 -0
- package/dist/core-dist/assets/schema-ChEV6sF4.js +1 -0
- package/dist/core-dist/assets/scroll-area-BrIAuvEe.js +1 -0
- package/dist/core-dist/assets/{sequenceDiagram-WL72ISMW-DJmT-TV8.js → sequenceDiagram-WL72ISMW-w51z8BRE.js} +10 -10
- package/dist/core-dist/assets/spinner-BESLBiEc.js +1 -0
- package/dist/core-dist/assets/stateDiagram-FKZM4ZOC-WlBCMI5F.js +1 -0
- package/dist/core-dist/assets/stateDiagram-v2-4FDKWEC3-CBo6ZLu7.js +1 -0
- package/dist/core-dist/assets/tanstack-qLXitSFb.js +9 -0
- package/dist/core-dist/assets/{timeline-definition-IT6M3QCI-CZ6VgbGA.js → timeline-definition-IT6M3QCI-C5ksKXI5.js} +2 -2
- package/dist/core-dist/assets/treemap-KMMF4GRG-DPEcHwuf.js +128 -0
- package/dist/core-dist/assets/{ts.worker-BH9nVgjN.js → ts.worker-BfwyojP3.js} +108 -108
- package/dist/core-dist/assets/visualizer-CEMTmyw2.js +1 -0
- package/dist/core-dist/assets/xychartDiagram-PRI3JC2R-CNj0xyV4.js +7 -0
- package/dist/core-dist/index.html +8 -2
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/core-dist/assets/_queryId-CtxjgPTw.js +0 -1
- package/dist/core-dist/assets/_table-QVQOem0H.js +0 -1
- package/dist/core-dist/assets/abap-DLDM7-KI.js +0 -1
- package/dist/core-dist/assets/apex-DNDY2TF8.js +0 -1
- package/dist/core-dist/assets/architectureDiagram-VXUJARFQ-qETUbLAF.js +0 -36
- package/dist/core-dist/assets/azcli-Y6nb8tq_.js +0 -1
- package/dist/core-dist/assets/bat-BwHxbl9M.js +0 -1
- package/dist/core-dist/assets/bicep-CFznDFnq.js +0 -2
- package/dist/core-dist/assets/cameligo-Bf6VGUru.js +0 -1
- package/dist/core-dist/assets/channel-DXRfMgFO.js +0 -1
- package/dist/core-dist/assets/chunk-B4BG7PRW-9F7cesSu.js +0 -165
- package/dist/core-dist/assets/chunk-DI55MBZ5-BJ4N1m8m.js +0 -220
- package/dist/core-dist/assets/chunk-QZHKN3VN-BI_2bsiS.js +0 -1
- package/dist/core-dist/assets/classDiagram-2ON5EDUG-DetPPK8G.js +0 -1
- package/dist/core-dist/assets/classDiagram-v2-WZHVMYZB-DetPPK8G.js +0 -1
- package/dist/core-dist/assets/clojure-Dnu-v4kV.js +0 -1
- package/dist/core-dist/assets/clone-ZzK9qmZ8.js +0 -1
- package/dist/core-dist/assets/coffee-Bd8akH9Z.js +0 -1
- package/dist/core-dist/assets/cose-bilkent-S5V4N54A-C6X32Xza.js +0 -1
- package/dist/core-dist/assets/cpp-BbWJElDN.js +0 -1
- package/dist/core-dist/assets/csharp-Co3qMtFm.js +0 -1
- package/dist/core-dist/assets/csp-D-4FJmMZ.js +0 -1
- package/dist/core-dist/assets/css-DdJfP1eB.js +0 -3
- package/dist/core-dist/assets/cssMode-COyIeO5D.js +0 -1
- package/dist/core-dist/assets/cypher-cTPe9QuQ.js +0 -1
- package/dist/core-dist/assets/dagre-6UL2VRFP-BQJjQlXe.js +0 -4
- package/dist/core-dist/assets/dart-BOtBlQCF.js +0 -1
- package/dist/core-dist/assets/diagram-PSM6KHXK-B_lyGamX.js +0 -24
- package/dist/core-dist/assets/diagram-QEK2KX5R-BXKMeskZ.js +0 -43
- package/dist/core-dist/assets/diagram-S2PKOQOG-DRgMDaOe.js +0 -24
- package/dist/core-dist/assets/dockerfile-BG73LgW2.js +0 -1
- package/dist/core-dist/assets/ecl-BEgZUVRK.js +0 -1
- package/dist/core-dist/assets/elixir-BkW5O-1t.js +0 -1
- package/dist/core-dist/assets/erDiagram-Q2GNP2WA-BO-W5nUt.js +0 -60
- package/dist/core-dist/assets/flow9-BeJ5waoc.js +0 -1
- package/dist/core-dist/assets/flowDiagram-NV44I4VS-Dz2q0_YK.js +0 -162
- package/dist/core-dist/assets/format-cell-value-X8lEs2y8.js +0 -7
- package/dist/core-dist/assets/freemarker2-gdEdc-lB.js +0 -3
- package/dist/core-dist/assets/fsharp-PahG7c26.js +0 -1
- package/dist/core-dist/assets/ganttDiagram-JELNMOA3-B543Dp2T.js +0 -267
- package/dist/core-dist/assets/gitGraphDiagram-NY62KEGX-aRaFIgsI.js +0 -65
- package/dist/core-dist/assets/go-acbASCJo.js +0 -1
- package/dist/core-dist/assets/graphql-BxJiqAUM.js +0 -1
- package/dist/core-dist/assets/handlebars-BBHQDTvc.js +0 -1
- package/dist/core-dist/assets/hcl-DtV1sZF8.js +0 -1
- package/dist/core-dist/assets/html-BHSCOa4F.js +0 -1
- package/dist/core-dist/assets/htmlMode-CkiHtpA8.js +0 -1
- package/dist/core-dist/assets/index-BTMIybLt.js +0 -1
- package/dist/core-dist/assets/index-BTOfnwiY.js +0 -1
- package/dist/core-dist/assets/index-Be72I791.js +0 -93
- package/dist/core-dist/assets/index-C1hGVAGZ.css +0 -1
- package/dist/core-dist/assets/index-Rq-jgZaW.js +0 -1
- package/dist/core-dist/assets/index-_iOa5gQT.js +0 -1
- package/dist/core-dist/assets/indexes-CZKaBB3n.js +0 -1
- package/dist/core-dist/assets/infoDiagram-WHAUD3N6-BxhzEtc1.js +0 -2
- package/dist/core-dist/assets/ini-Kd9XrMLS.js +0 -1
- package/dist/core-dist/assets/java-CXBNlu9o.js +0 -1
- package/dist/core-dist/assets/javascript-DkfOhMgX.js +0 -1
- package/dist/core-dist/assets/json.worker-BoL8UZqY.js +0 -58
- package/dist/core-dist/assets/jsonMode-DZ1izBRp.js +0 -7
- package/dist/core-dist/assets/julia-cl7-CwDS.js +0 -1
- package/dist/core-dist/assets/kotlin-s7OhZKlX.js +0 -1
- package/dist/core-dist/assets/less-9HpZscsL.js +0 -2
- package/dist/core-dist/assets/lexon-OrD6JF1K.js +0 -1
- package/dist/core-dist/assets/liquid-CSiyAE27.js +0 -1
- package/dist/core-dist/assets/logs-CorclGry.js +0 -1
- package/dist/core-dist/assets/lspLanguageFeatures-DfqpxEKm.js +0 -4
- package/dist/core-dist/assets/lua-Cyyb5UIc.js +0 -1
- package/dist/core-dist/assets/m3-B8OfTtLu.js +0 -1
- package/dist/core-dist/assets/markdown-BFxVWTOG.js +0 -1
- package/dist/core-dist/assets/mdx-uX3cu8xR.js +0 -1
- package/dist/core-dist/assets/mermaid-VLURNSYL-Dsp_Uc89.js +0 -385
- package/dist/core-dist/assets/mermaid.core-CqgD0fud.js +0 -191
- package/dist/core-dist/assets/mindmap-definition-VGOIOE7T-DjevekBL.js +0 -68
- package/dist/core-dist/assets/mips-CiqrrVzr.js +0 -1
- package/dist/core-dist/assets/msdax-DmeGPVcC.js +0 -1
- package/dist/core-dist/assets/mysql-C_tMU-Nz.js +0 -1
- package/dist/core-dist/assets/objective-c-BDtDVThU.js +0 -1
- package/dist/core-dist/assets/pascal-vHIfCaH5.js +0 -1
- package/dist/core-dist/assets/pascaligo-DtZ0uQbO.js +0 -1
- package/dist/core-dist/assets/perl-Ub6l9XKa.js +0 -1
- package/dist/core-dist/assets/pgsql-BlNEE0v7.js +0 -1
- package/dist/core-dist/assets/php-BBUBE1dy.js +0 -1
- package/dist/core-dist/assets/pieDiagram-ADFJNKIX-CPtZmRfi.js +0 -30
- package/dist/core-dist/assets/pla-DSh2-awV.js +0 -1
- package/dist/core-dist/assets/postiats-CocnycG-.js +0 -1
- package/dist/core-dist/assets/powerquery-tScXyioY.js +0 -1
- package/dist/core-dist/assets/powershell-COWaemsV.js +0 -1
- package/dist/core-dist/assets/protobuf-Brw8urJB.js +0 -2
- package/dist/core-dist/assets/pug-8SOpv6rk.js +0 -1
- package/dist/core-dist/assets/python-B9JzkkTC.js +0 -1
- package/dist/core-dist/assets/qsharp-Bw9ernYp.js +0 -1
- package/dist/core-dist/assets/quadrantDiagram-AYHSOK5B-S4R-vVvp.js +0 -7
- package/dist/core-dist/assets/queries.store-B1nG_ISF.js +0 -1
- package/dist/core-dist/assets/r-j7ic8hl3.js +0 -1
- package/dist/core-dist/assets/razor-CzwuFYGp.js +0 -1
- package/dist/core-dist/assets/redis-Bu5POkcn.js +0 -1
- package/dist/core-dist/assets/redshift-Bs9aos_-.js +0 -1
- package/dist/core-dist/assets/requirementDiagram-UZGBJVZJ-DLD6w2sA.js +0 -64
- package/dist/core-dist/assets/restructuredtext-CqXO7rUv.js +0 -1
- package/dist/core-dist/assets/ruby-zBfavPgS.js +0 -1
- package/dist/core-dist/assets/runner-tab-DPb19JM8.js +0 -915
- package/dist/core-dist/assets/runner-tab-Dvl_Svmm.css +0 -1
- package/dist/core-dist/assets/rust-BzKRNQWT.js +0 -1
- package/dist/core-dist/assets/sankeyDiagram-TZEHDZUN-BbQCHwbF.js +0 -10
- package/dist/core-dist/assets/sb-BBc9UKZt.js +0 -1
- package/dist/core-dist/assets/scala-D9hQfWCl.js +0 -1
- package/dist/core-dist/assets/schema-BD130Lxx.js +0 -1
- package/dist/core-dist/assets/scheme-BPhDTwHR.js +0 -1
- package/dist/core-dist/assets/scss-CBJaRo0y.js +0 -3
- package/dist/core-dist/assets/shell-DiJ1NA_G.js +0 -1
- package/dist/core-dist/assets/solidity-Db0IVjzk.js +0 -1
- package/dist/core-dist/assets/sophia-CnS9iZB_.js +0 -1
- package/dist/core-dist/assets/sparql-CJmd_6j2.js +0 -1
- package/dist/core-dist/assets/spinner-ChqXfynD.js +0 -1
- package/dist/core-dist/assets/sql-ClhHkBeG.js +0 -1
- package/dist/core-dist/assets/st-CHwy0fLd.js +0 -1
- package/dist/core-dist/assets/stateDiagram-FKZM4ZOC-CA3Y31oP.js +0 -1
- package/dist/core-dist/assets/stateDiagram-v2-4FDKWEC3-C9Mi7uYs.js +0 -1
- package/dist/core-dist/assets/swift-CnmFD0ga.js +0 -1
- package/dist/core-dist/assets/systemverilog-Bs9z6M-B.js +0 -1
- package/dist/core-dist/assets/tcl-Dm6ycUr_.js +0 -1
- package/dist/core-dist/assets/treemap-KMMF4GRG-CGReTPVL.js +0 -128
- package/dist/core-dist/assets/tsMode-CIVrOdYR.js +0 -11
- package/dist/core-dist/assets/twig-Csy3S7wG.js +0 -1
- package/dist/core-dist/assets/typescript-C-mVzuNT.js +0 -1
- package/dist/core-dist/assets/typespec-Btyra-wh.js +0 -1
- package/dist/core-dist/assets/vb-Db0cS2oM.js +0 -1
- package/dist/core-dist/assets/visualizer-CFH9tiUM.js +0 -1
- package/dist/core-dist/assets/wgsl-BTesnYfV.js +0 -298
- package/dist/core-dist/assets/xml-B32PQaiV.js +0 -1
- package/dist/core-dist/assets/xychartDiagram-PRI3JC2R-BP0zg957.js +0 -7
- package/dist/core-dist/assets/yaml-i7-mo1Cv.js +0 -1
package/dist/core-dist/assets/{code-block-IT6T5CEO-BjXa4xsL.js → code-block-IT6T5CEO-B2LU0jbX.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/latex-B4uzh10-.js","assets/tex-CvyZ59Mk.js","assets/liquid-DYVedYrR.js","assets/marko-DZsq8hO1.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-C1TweQQi.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-zxCyuUbr.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{w as Vt,s as Gr,f as Hn,a as zn,b as qn,c as er,z as Xn,h as Qn,d as Kn,C as Jn,D as Zn,u as Mt}from"./mermaid-VLURNSYL-Dsp_Uc89.js";import{_ as u,r as ue,j as V}from"./index-Be72I791.js";import"./queries.store-B1nG_ISF.js";import"./index-BTOfnwiY.js";import"./spinner-ChqXfynD.js";let I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Yn(t){return Gt(t)}function Gt(t){return Array.isArray(t)?ei(t):t instanceof RegExp?t:typeof t=="object"?ti(t):t}function ei(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Gt(t[r]);return e}function ti(t){let e={};for(let r in t)e[r]=Gt(t[r]);return e}function Br(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function Fr(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Fr(t.substring(0,t.length-1)):t.substr(~e+1)}var ot=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Te=class{static hasCaptures(t){return t===null?!1:(ot.lastIndex=0,ot.test(t))}static replaceCaptures(t,e,r){return t.replace(ot,(n,i,s,o)=>{let c=r[parseInt(i||s,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function jr(t,e){return t<e?-1:t>e?1:0}function Ur(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let s=jr(t[i],e[i]);if(s!==0)return s}return 0}return r-n}function tr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Wr(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Hr=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Be=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}static createFromRawTheme(t,e){return this.createFromParsedTheme(ii(t),e)}static createFromParsedTheme(t,e){return oi(t,e)}_cachedMatchRoot=new Hr(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>ri(t.parent,i.parentScopes));return n?new zr(n.fontStyle,n.foreground,n.background):null}},at=class Ve{constructor(e,r){this.parent=e,this.scopeName=r}static push(e,r){for(const n of r)e=new Ve(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new Ve(r,e[n]);return r}push(e){return new Ve(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function ri(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!ni(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function ni(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var zr=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}};function ii(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let p=o.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),c=p.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let p=o.settings.fontStyle.split(" ");for(let h=0,f=p.length;h<f;h++)switch(p[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof o.settings.foreground=="string"&&tr(o.settings.foreground)&&(l=o.settings.foreground);let d=null;typeof o.settings.background=="string"&&tr(o.settings.background)&&(d=o.settings.background);for(let p=0,h=c.length;p<h;p++){let m=c[p].trim().split(" "),y=m[m.length-1],E=null;m.length>1&&(E=m.slice(0,m.length-1),E.reverse()),r[n++]=new si(y,E,i,a,l,d)}}return r}var si=class{constructor(t,e,r,n,i,s){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=s}},O=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(O||{});function oi(t,e){t.sort((a,l)=>{let d=jr(a.scope,l.scope);return d!==0||(d=Ur(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(r=a.fontStyle),a.foreground!==null&&(n=a.foreground),a.background!==null&&(i=a.background)}let s=new ai(e),o=new zr(r,s.getId(n),s.getId(i)),c=new li(new Ct(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let d=t[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,s.getId(d.foreground),s.getId(d.background))}return new Be(s,o,c)}var ai=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ci=Object.freeze([]),Ct=class qr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,s){this.scopeDepth=e,this.parentScopes=r||ci,this.fontStyle=n,this.foreground=i,this.background=s}clone(){return new qr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},li=class At{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const s=r.parentScopes[i].length-e.parentScopes[n].length;if(s!==0)return s;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,s;if(n===-1?(i=e,s=""):(i=e.substring(0,n),s=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(At._cmpBySpecificity),r}insert(e,r,n,i,s,o){if(r===""){this._doInsertHere(e,n,i,s,o);return}let c=r.indexOf("."),a,l;c===-1?(a=r,l=""):(a=r.substring(0,c),l=r.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new At(this._mainRule.clone(),Ct.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,n,i,s,o)}_doInsertHere(e,r,n,i,s){if(r===null){this._mainRule.acceptOverwrite(e,n,i,s);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(Ur(a.parentScopes,r)===0){a.acceptOverwrite(e,n,i,s);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Ct(e,r,n,i,s))}},he=class D{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=D.getLanguageId(e),n=D.getTokenType(e),i=D.getFontStyle(e),s=D.getForeground(e),o=D.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:s,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,s,o,c){let a=D.getLanguageId(e),l=D.getTokenType(e),d=D.containsBalancedBrackets(e)?1:0,p=D.getFontStyle(e),h=D.getForeground(e),f=D.getBackground(e);return r!==0&&(a=r),n!==8&&(l=n),i!==null&&(d=i?1:0),s!==-1&&(p=s),o!==0&&(h=o),c!==0&&(f=c),(a<<0|l<<8|d<<10|p<<11|h<<15|f<<24)>>>0}};function Fe(t,e){const r=[],n=ui(t);let i=n.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let l=o();if(r.push({matcher:l,priority:a}),i!==",")break;i=n.next()}return r;function s(){if(i==="-"){i=n.next();const a=s();return l=>!!a&&!a(l)}if(i==="("){i=n.next();const a=c();return i===")"&&(i=n.next()),a}if(rr(i)){const a=[];do a.push(i),i=n.next();while(rr(i));return l=>e(a,l)}return null}function o(){const a=[];let l=s();for(;l;)a.push(l),l=s();return d=>a.every(p=>p(d))}function c(){const a=[];let l=o();for(;l&&(a.push(l),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");l=o()}return d=>a.some(p=>p(d))}}function rr(t){return!!t&&!!t.match(/[\w\.:]+/)}function ui(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function Xr(t){typeof t.dispose=="function"&&t.dispose()}var Ce=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},di=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},pi=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},hi=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ce(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new pi;for(const r of t)fi(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ce){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function fi(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=r.lookup(e);t instanceof Ce?Me({baseGrammar:s,selfGrammar:i},n):vt(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},n);const o=r.injections(t.scopeName);if(o)for(const c of o)n.add(new Ce(c))}function vt(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];je([n],e,r)}}function Me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&je(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&je(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function je(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?Br({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&je(n.patterns,{...e,repository:i},r);const s=n.include;if(!s)continue;const o=Qr(s);switch(o.kind){case 0:Me({...e,selfGrammar:e.baseGrammar},r);break;case 1:Me(e,r);break;case 2:vt(o.ruleName,{...e,repository:i},r);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:i};o.kind===4?vt(o.ruleName,a,r):Me(a,r)}else o.kind===4?r.add(new di(o.scopeName,o.ruleName)):r.add(new Ce(o.scopeName));break}}}var mi=class{kind=0},gi=class{kind=1},_i=class{constructor(t){this.ruleName=t}kind=2},yi=class{constructor(t){this.scopeName=t}kind=3},Ei=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Qr(t){if(t==="$base")return new mi;if(t==="$self")return new gi;const e=t.indexOf("#");if(e===-1)return new yi(t);if(e===0)return new _i(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new Ei(r,n)}}var bi=/\\(\d+)/,nr=/\\(\d+)/g,wi=-1,Kr=-2;var Se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Te.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Te.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Fr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Te.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Te.replaceCaptures(this._contentName,t,e)}},Ci=class extends Se{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Ai=class extends Se{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new Ae(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ir=class extends Se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},It=class extends Se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,s,o,c,a,l){super(t,e,r,n),this._begin=new Ae(i,this.id),this.beginCaptures=s,this._end=new Ae(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ue=class extends Se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,s,o,c,a){super(t,e,r,n),this._begin=new Ae(i,this.id),this.beginCaptures=s,this.whileCaptures=c,this._while=new Ae(o,Kr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Jr=class x{static createCaptureRule(e,r,n,i,s){return e.registerRule(o=>new Ci(r,o,n,i,s))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Ai(e.$vscodeTextmateLocation,e.id,e.name,e.match,x._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=Br({},n,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new ir(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,x._compilePatterns(s,r,n))}return e.while?new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,x._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,x._compileCaptures(e.whileCaptures||e.captures,r,n),x._compilePatterns(e.patterns,r,n)):new It(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,x._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,x._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,x._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>s&&(s=c)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=x.getCompiledRuleId(e[o],r,n)),i[c]=x.createCaptureRule(r,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let s=0,o=e.length;s<o;s++){const c=e[s];let a=-1;if(c.include){const l=Qr(c.include);switch(l.kind){case 0:case 1:a=x.getCompiledRuleId(n[c.include],r,n);break;case 2:let d=n[l.ruleName];d&&(a=x.getCompiledRuleId(d,r,n));break;case 3:case 4:const p=l.scopeName,h=l.kind===4?l.ruleName:null,f=r.getExternalGrammar(p,n);if(f)if(h){let m=f.repository[h];m&&(a=x.getCompiledRuleId(m,r,f.repository))}else a=x.getCompiledRuleId(f.repository.$self,r,f.repository);break}}else a=x.getCompiledRuleId(c,r,n);if(a!==-1){const l=r.getRule(a);let d=!1;if((l instanceof ir||l instanceof It||l instanceof Ue)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},Ae=class Zr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,s=[],o=!1;for(let c=0;c<n;c++)if(e.charAt(c)==="\\"&&c+1<n){const l=e.charAt(c+1);l==="z"?(s.push(e.substring(i,c)),s.push("$(?!\\n)(?<!\\n)"),i=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=e:(s.push(e.substring(i,n)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=bi.test(this.source):this.hasBackReferences=!1}clone(){return new Zr(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return nr.lastIndex=0,this.source.replace(nr,(i,s)=>Wr(n[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],s,o,c,a;for(s=0,o=this.source.length;s<o;s++)c=this.source.charAt(s),e[s]=c,r[s]=c,n[s]=c,i[s]=c,c==="\\"&&s+1<o&&(a=this.source.charAt(s+1),a==="A"?(e[s+1]="",r[s+1]="",n[s+1]="A",i[s+1]="A"):a==="G"?(e[s+1]="",r[s+1]="G",n[s+1]="",i[s+1]="G"):(e[s+1]=a,r[s+1]=a,n[s+1]=a,i[s+1]=a),s++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ve=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new sr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new sr(t,n,this._items.map(i=>i.ruleId))}},sr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
import{w as Vt,s as Gr,f as Hn,a as zn,b as qn,c as er,z as Xn,h as Qn,d as Kn,C as Jn,D as Zn,u as Mt}from"./mermaid-VLURNSYL-_Y2XU6_c.js";import{r as ue}from"./icons-DJrV7d9i.js";import{j as V}from"./radix-ui-Cy3m1w7k.js";import{_ as u}from"./monaco-editor-BMj4E99D.js";import"./tanstack-qLXitSFb.js";import"./react-dom-DJoE1oD9.js";import"./index-ERxh7PXo.js";import"./scroll-area-BrIAuvEe.js";import"./spinner-BESLBiEc.js";import"./_pathlessLayout-DjLhpgxd.js";import"./queries.store-Bxxvcbg7.js";let I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Yn(t){return Gt(t)}function Gt(t){return Array.isArray(t)?ei(t):t instanceof RegExp?t:typeof t=="object"?ti(t):t}function ei(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Gt(t[r]);return e}function ti(t){let e={};for(let r in t)e[r]=Gt(t[r]);return e}function Br(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function Fr(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Fr(t.substring(0,t.length-1)):t.substr(~e+1)}var ot=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Te=class{static hasCaptures(t){return t===null?!1:(ot.lastIndex=0,ot.test(t))}static replaceCaptures(t,e,r){return t.replace(ot,(n,i,s,o)=>{let c=r[parseInt(i||s,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function jr(t,e){return t<e?-1:t>e?1:0}function Ur(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let s=jr(t[i],e[i]);if(s!==0)return s}return 0}return r-n}function tr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Wr(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Hr=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Be=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}static createFromRawTheme(t,e){return this.createFromParsedTheme(ii(t),e)}static createFromParsedTheme(t,e){return oi(t,e)}_cachedMatchRoot=new Hr(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>ri(t.parent,i.parentScopes));return n?new zr(n.fontStyle,n.foreground,n.background):null}},at=class Ve{constructor(e,r){this.parent=e,this.scopeName=r}static push(e,r){for(const n of r)e=new Ve(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new Ve(r,e[n]);return r}push(e){return new Ve(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function ri(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!ni(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function ni(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var zr=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}};function ii(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let p=o.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),c=p.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let p=o.settings.fontStyle.split(" ");for(let h=0,f=p.length;h<f;h++)switch(p[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof o.settings.foreground=="string"&&tr(o.settings.foreground)&&(l=o.settings.foreground);let d=null;typeof o.settings.background=="string"&&tr(o.settings.background)&&(d=o.settings.background);for(let p=0,h=c.length;p<h;p++){let m=c[p].trim().split(" "),y=m[m.length-1],E=null;m.length>1&&(E=m.slice(0,m.length-1),E.reverse()),r[n++]=new si(y,E,i,a,l,d)}}return r}var si=class{constructor(t,e,r,n,i,s){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=s}},O=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(O||{});function oi(t,e){t.sort((a,l)=>{let d=jr(a.scope,l.scope);return d!==0||(d=Ur(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(r=a.fontStyle),a.foreground!==null&&(n=a.foreground),a.background!==null&&(i=a.background)}let s=new ai(e),o=new zr(r,s.getId(n),s.getId(i)),c=new li(new Ct(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let d=t[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,s.getId(d.foreground),s.getId(d.background))}return new Be(s,o,c)}var ai=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ci=Object.freeze([]),Ct=class qr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,s){this.scopeDepth=e,this.parentScopes=r||ci,this.fontStyle=n,this.foreground=i,this.background=s}clone(){return new qr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},li=class At{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const s=r.parentScopes[i].length-e.parentScopes[n].length;if(s!==0)return s;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,s;if(n===-1?(i=e,s=""):(i=e.substring(0,n),s=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(At._cmpBySpecificity),r}insert(e,r,n,i,s,o){if(r===""){this._doInsertHere(e,n,i,s,o);return}let c=r.indexOf("."),a,l;c===-1?(a=r,l=""):(a=r.substring(0,c),l=r.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new At(this._mainRule.clone(),Ct.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,n,i,s,o)}_doInsertHere(e,r,n,i,s){if(r===null){this._mainRule.acceptOverwrite(e,n,i,s);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(Ur(a.parentScopes,r)===0){a.acceptOverwrite(e,n,i,s);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Ct(e,r,n,i,s))}},he=class D{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=D.getLanguageId(e),n=D.getTokenType(e),i=D.getFontStyle(e),s=D.getForeground(e),o=D.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:s,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,s,o,c){let a=D.getLanguageId(e),l=D.getTokenType(e),d=D.containsBalancedBrackets(e)?1:0,p=D.getFontStyle(e),h=D.getForeground(e),f=D.getBackground(e);return r!==0&&(a=r),n!==8&&(l=n),i!==null&&(d=i?1:0),s!==-1&&(p=s),o!==0&&(h=o),c!==0&&(f=c),(a<<0|l<<8|d<<10|p<<11|h<<15|f<<24)>>>0}};function Fe(t,e){const r=[],n=ui(t);let i=n.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let l=o();if(r.push({matcher:l,priority:a}),i!==",")break;i=n.next()}return r;function s(){if(i==="-"){i=n.next();const a=s();return l=>!!a&&!a(l)}if(i==="("){i=n.next();const a=c();return i===")"&&(i=n.next()),a}if(rr(i)){const a=[];do a.push(i),i=n.next();while(rr(i));return l=>e(a,l)}return null}function o(){const a=[];let l=s();for(;l;)a.push(l),l=s();return d=>a.every(p=>p(d))}function c(){const a=[];let l=o();for(;l&&(a.push(l),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");l=o()}return d=>a.some(p=>p(d))}}function rr(t){return!!t&&!!t.match(/[\w\.:]+/)}function ui(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function Xr(t){typeof t.dispose=="function"&&t.dispose()}var Ce=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},di=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},pi=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},hi=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ce(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new pi;for(const r of t)fi(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ce){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function fi(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=r.lookup(e);t instanceof Ce?Me({baseGrammar:s,selfGrammar:i},n):vt(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},n);const o=r.injections(t.scopeName);if(o)for(const c of o)n.add(new Ce(c))}function vt(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];je([n],e,r)}}function Me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&je(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&je(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function je(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?Br({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&je(n.patterns,{...e,repository:i},r);const s=n.include;if(!s)continue;const o=Qr(s);switch(o.kind){case 0:Me({...e,selfGrammar:e.baseGrammar},r);break;case 1:Me(e,r);break;case 2:vt(o.ruleName,{...e,repository:i},r);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:i};o.kind===4?vt(o.ruleName,a,r):Me(a,r)}else o.kind===4?r.add(new di(o.scopeName,o.ruleName)):r.add(new Ce(o.scopeName));break}}}var mi=class{kind=0},gi=class{kind=1},_i=class{constructor(t){this.ruleName=t}kind=2},yi=class{constructor(t){this.scopeName=t}kind=3},Ei=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Qr(t){if(t==="$base")return new mi;if(t==="$self")return new gi;const e=t.indexOf("#");if(e===-1)return new yi(t);if(e===0)return new _i(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new Ei(r,n)}}var bi=/\\(\d+)/,nr=/\\(\d+)/g,wi=-1,Kr=-2;var Se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Te.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Te.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Fr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Te.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Te.replaceCaptures(this._contentName,t,e)}},Ci=class extends Se{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Ai=class extends Se{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new Ae(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ir=class extends Se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},It=class extends Se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,s,o,c,a,l){super(t,e,r,n),this._begin=new Ae(i,this.id),this.beginCaptures=s,this._end=new Ae(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ue=class extends Se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,s,o,c,a){super(t,e,r,n),this._begin=new Ae(i,this.id),this.beginCaptures=s,this.whileCaptures=c,this._while=new Ae(o,Kr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Jr=class x{static createCaptureRule(e,r,n,i,s){return e.registerRule(o=>new Ci(r,o,n,i,s))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Ai(e.$vscodeTextmateLocation,e.id,e.name,e.match,x._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=Br({},n,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new ir(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,x._compilePatterns(s,r,n))}return e.while?new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,x._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,x._compileCaptures(e.whileCaptures||e.captures,r,n),x._compilePatterns(e.patterns,r,n)):new It(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,x._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,x._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,x._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>s&&(s=c)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=x.getCompiledRuleId(e[o],r,n)),i[c]=x.createCaptureRule(r,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let s=0,o=e.length;s<o;s++){const c=e[s];let a=-1;if(c.include){const l=Qr(c.include);switch(l.kind){case 0:case 1:a=x.getCompiledRuleId(n[c.include],r,n);break;case 2:let d=n[l.ruleName];d&&(a=x.getCompiledRuleId(d,r,n));break;case 3:case 4:const p=l.scopeName,h=l.kind===4?l.ruleName:null,f=r.getExternalGrammar(p,n);if(f)if(h){let m=f.repository[h];m&&(a=x.getCompiledRuleId(m,r,f.repository))}else a=x.getCompiledRuleId(f.repository.$self,r,f.repository);break}}else a=x.getCompiledRuleId(c,r,n);if(a!==-1){const l=r.getRule(a);let d=!1;if((l instanceof ir||l instanceof It||l instanceof Ue)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},Ae=class Zr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,s=[],o=!1;for(let c=0;c<n;c++)if(e.charAt(c)==="\\"&&c+1<n){const l=e.charAt(c+1);l==="z"?(s.push(e.substring(i,c)),s.push("$(?!\\n)(?<!\\n)"),i=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=e:(s.push(e.substring(i,n)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=bi.test(this.source):this.hasBackReferences=!1}clone(){return new Zr(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return nr.lastIndex=0,this.source.replace(nr,(i,s)=>Wr(n[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],s,o,c,a;for(s=0,o=this.source.length;s<o;s++)c=this.source.charAt(s),e[s]=c,r[s]=c,n[s]=c,i[s]=c,c==="\\"&&s+1<o&&(a=this.source.charAt(s+1),a==="A"?(e[s+1]="",r[s+1]="",n[s+1]="A",i[s+1]="A"):a==="G"?(e[s+1]="",r[s+1]="G",n[s+1]="",i[s+1]="G"):(e[s+1]=a,r[s+1]=a,n[s+1]=a,i[s+1]=a),s++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ve=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new sr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new sr(t,n,this._items.map(i=>i.ruleId))}},sr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
3
3
|
`)}findNextMatchSync(t,e,r){const n=this.scanner.findNextMatchSync(t,e,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},ct=class{constructor(t,e){this.languageId=t,this.tokenType=e}},vi=class Rt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,r){this._defaultAttributes=new ct(e,8),this._embeddedLanguagesMatcher=new Ii(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Rt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new ct(0,0);_getBasicScopeAttributes=new Hr(e=>{const r=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new ct(r,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const r=e.match(Rt.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ii=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([r,n])=>Wr(r));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},or=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Yr(t,e,r,n,i,s,o,c){const a=e.content.length;let l=!1,d=-1;if(o){const f=Ri(t,e,r,n,i,s);i=f.stack,n=f.linePos,r=f.isFirstLine,d=f.anchorPosition}const p=Date.now();for(;!l;){if(c!==0&&Date.now()-p>c)return new or(i,!0);h()}return new or(i,!1);function h(){const f=Si(t,e,r,n,i,d);if(!f){s.produce(i,a),l=!0;return}const m=f.captureIndices,y=f.matchedRuleId,E=m&&m.length>0?m[0].end>n:!1;if(y===wi){const g=i.getRule(t);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ee(t,e,r,i,s,g.endCaptures,m),s.produce(i,m[0].end);const b=i;if(i=i.parent,d=b.getAnchorPos(),!E&&b.getEnterPos()===n){i=b,s.produce(i,a),l=!0;return}}else{const g=t.getRule(y);s.produce(i,m[0].start);const b=i,_=g.getName(e.content,m),w=i.contentNameScopesList.pushAttributed(_,t);if(i=i.push(y,n,d,m[0].end===a,null,w,w),g instanceof It){const A=g;Ee(t,e,r,i,s,A.beginCaptures,m),s.produce(i,m[0].end),d=m[0].end;const k=A.getContentName(e.content,m),N=w.pushAttributed(k,t);if(i=i.withContentNameScopesList(N),A.endHasBackReferences&&(i=i.withEndRule(A.getEndWithResolvedBackReferences(e.content,m))),!E&&b.hasSameRuleAs(i)){i=i.pop(),s.produce(i,a),l=!0;return}}else if(g instanceof Ue){const A=g;Ee(t,e,r,i,s,A.beginCaptures,m),s.produce(i,m[0].end),d=m[0].end;const k=A.getContentName(e.content,m),N=w.pushAttributed(k,t);if(i=i.withContentNameScopesList(N),A.whileHasBackReferences&&(i=i.withEndRule(A.getWhileWithResolvedBackReferences(e.content,m))),!E&&b.hasSameRuleAs(i)){i=i.pop(),s.produce(i,a),l=!0;return}}else if(Ee(t,e,r,i,s,g.captures,m),s.produce(i,m[0].end),i=i.pop(),!E){i=i.safePop(),s.produce(i,a),l=!0;return}}m[0].end>n&&(n=m[0].end,r=!1)}}function Ri(t,e,r,n,i,s){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let a=i;a;a=a.pop()){const l=a.getRule(t);l instanceof Ue&&c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){const{ruleScanner:l,findOptions:d}=Ti(a.rule,t,a.stack.endRule,r,n===o),p=l.findNextMatchSync(e,n,d);if(p){if(p.ruleId!==Kr){i=a.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(s.produce(a.stack,p.captureIndices[0].start),Ee(t,e,r,a.stack,s,a.rule.whileCaptures,p.captureIndices),s.produce(a.stack,p.captureIndices[0].end),o=p.captureIndices[0].end,p.captureIndices[0].end>n&&(n=p.captureIndices[0].end,r=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:n,anchorPosition:o,isFirstLine:r}}function Si(t,e,r,n,i,s){const o=Li(t,e,r,n,i,s),c=t.getInjections();if(c.length===0)return o;const a=ki(c,t,e,r,n,i,s);if(!a)return o;if(!o)return a;const l=o.captureIndices[0].start,d=a.captureIndices[0].start;return d<l||a.priorityMatch&&d===l?a:o}function Li(t,e,r,n,i,s){const o=i.getRule(t),{ruleScanner:c,findOptions:a}=en(o,t,i.endRule,r,n===s),l=c.findNextMatchSync(e,n,a);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function ki(t,e,r,n,i,s,o){let c=Number.MAX_VALUE,a=null,l,d=0;const p=s.contentNameScopesList.getScopeNames();for(let h=0,f=t.length;h<f;h++){const m=t[h];if(!m.matcher(p))continue;const y=e.getRule(m.ruleId),{ruleScanner:E,findOptions:g}=en(y,e,null,n,i===o),b=E.findNextMatchSync(r,i,g);if(!b)continue;const _=b.captureIndices[0].start;if(!(_>=c)&&(c=_,a=b.captureIndices,l=b.ruleId,d=m.priority,c===i))break}return a?{priorityMatch:d===-1,captureIndices:a,matchedRuleId:l}:null}function en(t,e,r,n,i){return{ruleScanner:t.compileAG(e,r,n,i),findOptions:0}}function Ti(t,e,r,n,i){return{ruleScanner:t.compileWhileAG(e,r,n,i),findOptions:0}}function Ee(t,e,r,n,i,s,o){if(s.length===0)return;const c=e.content,a=Math.min(s.length,o.length),l=[],d=o[0].end;for(let p=0;p<a;p++){const h=s[p];if(h===null)continue;const f=o[p];if(f.length===0)continue;if(f.start>d)break;for(;l.length>0&&l[l.length-1].endPos<=f.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,f.start):i.produce(n,f.start),h.retokenizeCapturedWithRuleId){const y=h.getName(c,o),E=n.contentNameScopesList.pushAttributed(y,t),g=h.getContentName(c,o),b=E.pushAttributed(g,t),_=n.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,E,b),w=t.createOnigString(c.substring(0,f.end));Yr(t,w,r&&f.start===0,f.start,_,i,!1,0),Xr(w);continue}const m=h.getName(c,o);if(m!==null){const E=(l.length>0?l[l.length-1].scopes:n.contentNameScopesList).pushAttributed(m,t);l.push(new Pi(E,f.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Pi=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function xi(t,e,r,n,i,s,o,c){return new Ni(t,e,r,n,i,s,o,c)}function ar(t,e,r,n,i){const s=Fe(e,We),o=Jr.getCompiledRuleId(r,n,i.repository);for(const c of s)t.push({debugSelector:e,matcher:c.matcher,ruleId:o,grammar:i,priority:c.priority})}function We(t,e){if(e.length<t.length)return!1;let r=0;return t.every(n=>{for(let i=r;i<e.length;i++)if(Oi(e[i],n))return r=i+1,!0;return!1})}function Oi(t,e){if(!t)return!1;if(t===e)return!0;const r=e.length;return t.length>r&&t.substr(0,r)===e&&t[r]==="."}var Ni=class{constructor(t,e,r,n,i,s,o,c){if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=c,this._basicScopeAttributesProvider=new vi(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=cr(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const l=Fe(a,We);for(const d of l)this._tokenTypeMatchers.push({matcher:d.matcher,type:i[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],r=this._rootScopeName,n=t.lookup(r);if(n){const i=n.injections;if(i)for(let o in i)ar(e,o,i[o],this,n);const s=this._grammarRepository.injections(r);s&&s.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const a=c.injectionSelector;a&&ar(e,a,c,this,c)}})}return e.sort((i,s)=>i.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,r=t(e);return this._ruleId2desc[e]=r,r}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const r=this._grammarRepository.lookup(t);if(r)return this._includedGrammars[t]=cr(r,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,r=0){const n=this._tokenize(t,e,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,r=0){const n=this._tokenize(t,e,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,r,n){this._rootId===-1&&(this._rootId=Jr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===St.NULL){i=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),p=he.set(0,l.languageId,l.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=be.createRootAndLookUpScopeName(h,p,this):f=be.createRoot("unknown",p),e=new St(null,this._rootId,-1,-1,!1,null,f,f)}else i=!1,e.reset();t=t+`
|
|
4
4
|
`;const s=this.createOnigString(t),o=s.content.length,c=new $i(r,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Yr(this,s,i,0,e,c,!0,n);return Xr(s),{lineLength:o,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function cr(t,e){return t=Yn(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var be=class B{constructor(e,r,n){this.parent=e,this.scopePath=r,this.tokenAttributes=n}static fromExtension(e,r){let n=e,i=e?.scopePath??null;for(const s of r)i=at.push(i,s.scopeNames),n=new B(n,i,s.encodedTokenAttributes);return n}static createRoot(e,r){return new B(null,new at(null,e),r)}static createRootAndLookUpScopeName(e,r,n){const i=n.getMetadataForScope(e),s=new at(null,e),o=n.themeProvider.themeMatch(s),c=B.mergeAttributes(r,i,o);return new B(null,s,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return B.equals(this,e)}static equals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.scopeName!==r.scopeName||e.tokenAttributes!==r.tokenAttributes)return!1;e=e.parent,r=r.parent}while(!0)}static mergeAttributes(e,r,n){let i=-1,s=0,o=0;return n!==null&&(i=n.fontStyle,s=n.foregroundId,o=n.backgroundId),he.set(e,r.languageId,r.tokenType,null,i,s,o)}pushAttributed(e,r){if(e===null)return this;if(e.indexOf(" ")===-1)return B._pushAttributed(this,e,r);const n=e.split(/ /g);let i=this;for(const s of n)i=B._pushAttributed(i,s,r);return i}static _pushAttributed(e,r,n){const i=n.getMetadataForScope(r),s=e.scopePath.push(r),o=n.themeProvider.themeMatch(s),c=B.mergeAttributes(e.tokenAttributes,i,o);return new B(e,s,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?r.reverse():void 0}},St=class Y{constructor(e,r,n,i,s,o,c,a){this.parent=e,this.ruleId=r,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new Y(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Y._equals(this,e)}static _equals(e,r){return e===r?!0:this._structuralEquals(e,r)?be.equals(e.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.depth!==r.depth||e.ruleId!==r.ruleId||e.endRule!==r.endRule)return!1;e=e.parent,r=r.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Y._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,r,n,i,s,o,c){return new Y(this,e,r,n,i,s,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,r){return this.parent&&(r=this.parent._writeString(e,r)),e[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Y(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let r=this;for(;r&&r._enterPos===e._enterPos;){if(r.ruleId===e.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,r){const n=be.fromExtension(e?.nameScopesList??null,r.nameScopesList);return new Y(e,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,be.fromExtension(n,r.contentNameScopesList))}},Di=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Fe(r,We).map(n=>n.matcher)),this.unbalancedBracketScopes=e.flatMap(r=>Fe(r,We).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},$i=class{constructor(t,e,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(n=he.set(n,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(n=he.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}const r=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:r}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},Vi=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,r,n,i){if(!this._grammars.has(t)){let s=this._rawGrammars.get(t);if(!s)return null;this._grammars.set(t,xi(t,s,e,r,n,i,this,this._onigLib))}return this._grammars.get(t)}},Mi=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Vi(Be.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,r){this._syncRegistry.setTheme(Be.createFromRawTheme(e,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,r,n){return this.loadGrammarWithConfiguration(e,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,r,n){return this._loadGrammar(e,r,n.embeddedLanguages,n.tokenTypes,new Di(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,r,n,i,s){const o=new hi(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(e,r,n,i,s)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const r=this._options.loadGrammar(e);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(e,r=[],n=0,i=null){return this._syncRegistry.addGrammar(e,r),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,r=0,n=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(e,r,n,i,s)}},Lt=St.NULL;const Gi=/["&'<>`]/g,Bi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fi=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ji=/[|\\{}()[\]^$+*?.]/g,lr=new WeakMap;function Ui(t,e){if(t=t.replace(e.subset?Wi(e.subset):Gi,n),e.subset||e.escapeOnly)return t;return t.replace(Bi,r).replace(Fi,n);function r(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function n(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function Wi(t){let e=lr.get(t);return e||(e=Hi(t),lr.set(t,e)),e}function Hi(t){const e=[];let r=-1;for(;++r<t.length;)e.push(t[r].replace(ji,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const zi=/[\dA-Fa-f]/;function qi(t,e,r){const n="&#x"+t.toString(16).toUpperCase();return r&&e&&!zi.test(String.fromCharCode(e))?n:n+";"}const Xi=/\d/;function Qi(t,e,r){const n="&#"+String(t);return r&&e&&!Xi.test(String.fromCharCode(e))?n:n+";"}const Ki=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],lt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ji=["cent","copy","divide","gt","lt","not","para","times"],tn={}.hasOwnProperty,kt={};let Pe;for(Pe in lt)tn.call(lt,Pe)&&(kt[lt[Pe]]=Pe);const Zi=/[^\dA-Za-z]/;function Yi(t,e,r,n){const i=String.fromCharCode(t);if(tn.call(kt,i)){const s=kt[i],o="&"+s;return r&&Ki.includes(s)&&!Ji.includes(s)&&(!n||e&&e!==61&&Zi.test(String.fromCharCode(e)))?o:o+";"}return""}function es(t,e,r){let n=qi(t,e,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=Yi(t,e,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const s=Qi(t,e,r.omitOptionalSemicolons);s.length<n.length&&(n=s)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function pe(t,e){return Ui(t,Object.assign({format:es},e))}const ts=/^>|^->|<!--|-->|--!>|<!-$/g,rs=[">"],ns=["<",">"];function is(t,e,r,n){return n.settings.bogusComments?"<?"+pe(t.value,Object.assign({},n.settings.characterReferences,{subset:rs}))+">":"<!--"+t.value.replace(ts,i)+"-->";function i(s){return pe(s,Object.assign({},n.settings.characterReferences,{subset:ns}))}}function ss(t,e,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}const L=nn(1),rn=nn(-1),os=[];function nn(t){return e;function e(r,n,i){const s=r?r.children:os;let o=(n||0)+t,c=s[o];if(!i)for(;c&&Vt(c);)o+=t,c=s[o];return c}}const as={}.hasOwnProperty;function sn(t){return e;function e(r,n,i){return as.call(t,r.tagName)&&t[r.tagName](r,n,i)}}const Bt=sn({body:ls,caption:ut,colgroup:ut,dd:hs,dt:ps,head:ut,html:cs,li:ds,optgroup:fs,option:ms,p:us,rp:ur,rt:ur,tbody:_s,td:dr,tfoot:ys,th:dr,thead:gs,tr:Es});function ut(t,e,r){const n=L(r,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&Vt(n.value.charAt(0)))}function cs(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function ls(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function us(t,e,r){const n=L(r,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function ds(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="li"}function ps(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function hs(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function ur(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function fs(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function ms(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function gs(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function _s(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function ys(t,e,r){return!L(r,e)}function Es(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="tr"}function dr(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const bs=sn({body:As,colgroup:vs,head:Cs,html:ws,tbody:Is});function ws(t){const e=L(t,-1);return!e||e.type!=="comment"}function Cs(t){const e=new Set;for(const n of t.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const r=t.children[0];return!r||r.type==="element"}function As(t){const e=L(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Vt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function vs(t,e,r){const n=rn(r,e),i=L(t,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&Bt(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Is(t,e,r){const n=rn(r,e),i=L(t,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&Bt(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const xe={name:[[`
|
|
5
5
|
\f\r &/=>`.split(""),`
|
|
@@ -42,7 +42,7 @@ import{w as Vt,s as Gr,f as Hn,a as zn,b as qn,c as er,z as Xn,h as Qn,d as Kn,C
|
|
|
42
42
|
| &&
|
|
43
43
|
| .
|
|
44
44
|
`.replace(/\s+/g,""),"gsu");function Zo(t,e={}){const r={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const n=_a(r.flags),i=[n.extended],s={captureGroup:r.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(p){i.push(p)},replaceCurrentModX(p){i[i.length-1]=p},singleline:r.rules.singleline};let o=[],c;for(Ne.lastIndex=0;c=Ne.exec(t);){const p=Yo(s,t,c[0],Ne.lastIndex);p.tokens?o.push(...p.tokens):p.token&&o.push(p.token),p.lastIndex!==void 0&&(Ne.lastIndex=p.lastIndex)}const a=[];let l=0;o.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++l:p.raw==="("&&a.push(p)}),l||a.forEach((p,h)=>{p.kind="capturing",p.number=h+1});const d=l||a.length;return{tokens:o.map(p=>p.type==="EscapedNumber"?Ea(p,d):p).flat(),flags:n}}function Yo(t,e,r,n){const[i,s]=r;if(r==="["||r==="[^"){const o=ea(e,r,n);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:yr(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:ua(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:An(r)}}if(s==="K")return{token:vn("keep",r)};if(s==="N"||s==="R")return{token:re("newline",r,{negate:s==="N"})};if(s==="O")return{token:re("any",r)};if(s==="X")return{token:re("text_segment",r)};const o=Cn(r,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:fa(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(e[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:ha(r,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,r==="("&&!t.captureGroup||r==="(?:")return{token:ce("group",r)};if(r==="(?>")return{token:ce("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:ce(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&t.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:ce("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:ce("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:aa(r)}}if(t.getCurrentModX()){if(r==="#"){const o=e.indexOf(`
|
|
45
|
-
`,n);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(r)){const o=/\s+/y;return o.lastIndex=n,{lastIndex:o.exec(e)?o.lastIndex:n}}}if(r===".")return{token:re("dot",r)};if(r==="^"||r==="$"){const o=t.singleline?{"^":P`\A`,$:P`\Z`}[r]:r;return{token:yr(o,r)}}return r==="|"?{token:ra(r)}:Qt.test(r)?{tokens:ba(r)}:{token:z(me(r),r)}}function ea(t,e,r){const n=[Er(e[1]==="^",e)];let i=1,s;for(ht.lastIndex=r;s=ht.exec(t);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,n.push(Er(o[1]==="^",o));else if(o==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(z(93,o));else if(i--,n.push(na(o)),!i)break}else{const c=ta(o);Array.isArray(c)?n.push(...c):n.push(c)}}return{tokens:n,lastIndex:ht.lastIndex||t.length}}function ta(t){if(t[0]==="\\")return Cn(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Xt.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return re("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?ia(t):t==="&&"?sa(t):z(me(t),t)}function Cn(t,{inCharClass:e}){const r=t[1];if(r==="c"||r==="C")return pa(t);if("dDhHsSwW".includes(r))return ma(t);if(t.startsWith(P`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return ga(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const n=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),s=new TextEncoder;return[...i].map(o=>{const c=[...s.encode(o)].map(a=>`\\x${a.toString(16)}`).join("");return z(me(o),c)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return z(ya(t),t);if(br.has(r))return z(br.get(r),t);if(/\d/.test(r))return oa(e,t);if(t==="\\")throw new Error(P`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return z(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function ra(t){return{type:"Alternator",raw:t}}function yr(t,e){return{type:"Assertion",kind:t,raw:e}}function An(t){return{type:"Backreference",raw:t}}function z(t,e){return{type:"Character",value:t,raw:e}}function na(t){return{type:"CharacterClassClose",raw:t}}function ia(t){return{type:"CharacterClassHyphen",raw:t}}function sa(t){return{type:"CharacterClassIntersector",raw:t}}function Er(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function re(t,e,r={}){return{type:"CharacterSet",kind:t,...r,raw:e}}function vn(t,e,r={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:ge(r.flags),raw:e}}function oa(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function aa(t){return{type:"GroupClose",raw:t}}function ce(t,e,r={}){return{type:"GroupOpen",kind:t,...r,raw:e}}function ca(t,e,r,n){return{type:"NamedCallout",kind:t,tag:e,arguments:r,raw:n}}function la(t,e,r,n){return{type:"Quantifier",kind:t,min:e,max:r,raw:n}}function ua(t){return{type:"Subroutine",raw:t}}const da=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),br=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function pa(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return z(me(e.toUpperCase())-64,t)}function ha(t,e){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;n??="";const i=(e.getCurrentModX()||r.includes("x"))&&!n.includes("x"),s=Cr(r),o=Cr(n),c={};if(s&&(c.enable=s),o&&(c.disable=o),t.endsWith(")"))return e.replaceCurrentModX(i),vn("flags",t,{flags:c});if(t.endsWith(":"))return e.pushModX(i),e.numOpenGroups++,ce("group",t,{...(s||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${t}"`)}function fa(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:r,tag:n,args:i}=e.groups;if(!r)throw new Error(`Invalid named callout "${t}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const s=i?i.split(",").filter(d=>d!=="").map(d=>/^[+-]?\d+$/.test(d)?+d:d):[],[o,c,a]=s,l=da.has(r)?r.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return ca(l,n??null,i?.split(",")??null,t)}function wr(t){let e=null,r,n;if(t[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=s===void 0?+i:s===""?1/0:+s,r>n&&(e="possessive",[r,n]=[n,r]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else r=t[0]==="+"?1:0,n=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return la(e,r,n,t)}function ma(t){const e=t[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function ga(t){const{p:e,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return re("property",t,{value:n,negate:e==="P"&&!r||e==="p"&&!!r})}function Cr(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function _a(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<t.length;r++){const n=t[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(t.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[r+2]==="g"?"grapheme":"word",r+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return e}function ya(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function Ea(t,e){const{raw:r,inCharClass:n}=t,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=e))return[An(r)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const a=o[c];let l;if(c===0&&a!=="8"&&a!=="9"){if(l=parseInt(a,8),l>127)throw new Error(P`Octal encoded byte above 177 unsupported "${r}"`)}else l=me(a);s.push(z(l,(c===0?"\\":"")+a))}return s}function ba(t){const e=[],r=new RegExp(Qt,"gy");let n;for(;n=r.exec(t);){const i=n[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:c}=s.groups;if(+o>+c&&i.endsWith("?")){r.lastIndex--,e.push(wr(i.slice(0,-1)));continue}}}e.push(wr(i))}return e}function In(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const r=t.body[0];return!e||Object.keys(e).every(n=>e[n]===r[n])}function wa(t){return Ca.has(t.type)}const Ca=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Rn(t,e={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},n=Zo(t,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(h,f)=>{const m=n.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,m.type){case"Alternator":return ne();case"Assertion":return Aa(m);case"Backreference":return va(m,s);case"Character":return tt(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Ia(m,s,f);case"CharacterClassOpen":return Ra(m,s,f);case"CharacterSet":return Sa(m,s);case"Directive":return Oa(m.kind,{flags:m.flags});case"GroupOpen":return La(m,s,f);case"NamedCallout":return Da(m.kind,m.tag,m.arguments);case"Quantifier":return ka(m,s);case"Subroutine":return Ta(m,s);default:throw new Error(`Unexpected token type "${m.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},o=Va(Na(n.flags));let c=o.body[0];for(;s.nextIndex<n.tokens.length;){const h=i(c,{});h.type==="Alternative"?(o.body.push(h),c=h):c.body.push(h)}const{capturingGroups:a,hasNumberedRef:l,namedGroupsByName:d,subroutines:p}=s;if(l&&d.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of p)if(typeof h=="number"){if(h>a.length)throw new Error("Subroutine uses a group number that's not defined");h&&(a[h-1].isSubroutined=!0)}else if(d.has(h)){if(d.get(h).length>1)throw new Error(P`Subroutine uses a duplicate group name "\g<${h}>"`);d.get(h)[0].isSubroutined=!0}else throw new Error(P`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function Aa({kind:t}){return Pt(ge({"^":"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"}[t],`Unexpected assertion kind "${t}"`),{negate:t===P`\B`||t===P`\Y`})}function va({raw:t},e){const r=/^\\k[<']/.test(t),n=r?t.slice(3,-1):t.slice(1),i=(s,o=!1)=>{const c=e.capturingGroups.length;let a=!1;if(s>c)if(e.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,xt(o?c+1-s:s,{orphan:a})};if(r){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${t}"`);return xt(n)}return i(+n)}function Ia(t,e,r){const{tokens:n,walk:i}=e,s=e.parent,o=s.body.at(-1),c=n[e.nextIndex];if(!r.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const a=i(s,{...r,isCheckingRangeEnd:!0});if(o.type==="Character"&&a.type==="Character")return s.body.pop(),xa(o,a);throw new Error("Invalid character class range")}return tt(me("-"))}function Ra({negate:t},e,r){const{tokens:n,walk:i}=e,s=n[e.nextIndex],o=[Ge()];let c=Ir(s);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(Ge()),e.nextIndex++;else{const l=o.at(-1);l.body.push(i(l,r))}c=Ir(n[e.nextIndex],s)}const a=Ge({negate:t});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(l=>l.body.length===1?l.body[0]:l)),e.nextIndex++,a}function Sa({kind:t,negate:e,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=n;if(t==="property"){const c=rt(r);if(Xt.has(c)&&!o?.has(c))t="posix",r=c;else return le(r,{negate:e,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return t==="posix"?$a(r,{negate:e}):Ot(t,{negate:e})}function La(t,e,r){const{tokens:n,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:c}=e,a=Ma(t),l=a.type==="AbsenceFunction",d=vr(a),p=d&&a.negate;if(a.type==="CapturingGroup"&&(i.push(a),a.name&&Jo(s,a.name,[]).push(a)),l&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Rr(n[e.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")a.body.push(ne()),e.nextIndex++;else{const f=a.body.at(-1),m=c(f,{...r,isInAbsenceFunction:r.isInAbsenceFunction||l,isInLookbehind:r.isInLookbehind||d,isInNegLookbehind:r.isInNegLookbehind||p});if(f.body.push(m),(d||r.isInLookbehind)&&!o){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(p||r.isInNegLookbehind){if(Ar(m)||m.type==="CapturingGroup")throw new Error(y)}else if(Ar(m)||vr(m)&&m.negate)throw new Error(y)}}h=Rr(n[e.nextIndex])}return e.nextIndex++,a}function ka({kind:t,min:e,max:r},n){const i=n.parent,s=i.body.at(-1);if(!s||!wa(s))throw new Error("Quantifier requires a repeatable token");const o=Ln(t,e,r,s);return i.body.pop(),o}function Ta({raw:t},e){const{capturingGroups:r,subroutines:n}=e;let i=t.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const c=+s.groups.num,a=r.length;if(e.hasNumberedRef=!0,i={"":c,"+":a+c,"-":a+1-c}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=kn(i);return n.push(o),o}function Pa(t,e){return{type:"AbsenceFunction",kind:t,body:Le(e?.body)}}function ne(t){return{type:"Alternative",body:Tn(t?.body)}}function Pt(t,e){const r={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(r.negate=!!e?.negate),r}function xt(t,e){const r=!!e?.orphan;return{type:"Backreference",ref:t,...r&&{orphan:r}}}function Sn(t,e){const r={name:void 0,isSubroutined:!1,...e};if(r.name!==void 0&&!Ga(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Le(e?.body)}}function tt(t,e){const r={useLastValid:!1,...e};if(t>1114111){const n=t.toString(16);if(r.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:t}}function Ge(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Tn(t?.body)}}function xa(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Ot(t,e){const r=!!e?.negate,n={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(n.negate=r),(t==="text_segment"||t==="newline"&&!r)&&(n.variableLength=!0),n}function Oa(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:ge(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Na(t){return{type:"Flags",...t}}function G(t){const e=t?.atomic,r=t?.flags;if(e&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...r&&{flags:r},body:Le(t?.body)}}function ee(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Le(t?.body)}}function Da(t,e,r){return{type:"NamedCallout",kind:t,tag:e,arguments:r}}function $a(t,e){const r=!!e?.negate;if(!Xt.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:r}}function Ln(t,e,r,n){if(e>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:r,body:n}}function Va(t,e){return{type:"Regex",body:Le(e?.body),flags:t}}function kn(t){return{type:"Subroutine",ref:t}}function le(t,e){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let n=r.unicodePropertyMap?.get(rt(t));if(!n){if(r.normalizeUnknownPropertyNames)n=Ba(t);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(P`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:n??t,negate:r.negate}}function Ma({flags:t,kind:e,name:r,negate:n,number:i}){switch(e){case"absence_repeater":return Pa("repeater");case"atomic":return G({atomic:!0});case"capturing":return Sn(i,{name:r});case"group":return G({flags:t});case"lookahead":case"lookbehind":return ee({behind:e==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${e}"`)}}function Le(t){if(t===void 0)t=[ne()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Tn(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function Ar(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function vr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Ga(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Ba(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Ir(t,e){return ge(t,`${e?.type==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function Rr(t){return ge(t,"Unclosed group")}function we(t,e,r=null){function n(s,o){for(let c=0;c<s.length;c++){const a=i(s[c],o,c,s);c=Math.max(-1,c+a)}}function i(s,o=null,c=null,a=null){let l=0,d=!1;const p={node:s,parent:o,key:c,container:a,root:t,remove(){De(a).splice(Math.max(0,se(c)+l),1),l--,d=!0},removeAllNextSiblings(){return De(a).splice(se(c)+1)},removeAllPrevSiblings(){const g=se(c)+l;return l-=g,De(a).splice(0,Math.max(0,g))},replaceWith(g,b={}){const _=!!b.traverse;a?a[Math.max(0,se(c)+l)]=g:ge(o,"Can't replace root node")[c]=g,_&&i(g,o,c,a),d=!0},replaceWithMultiple(g,b={}){const _=!!b.traverse;if(De(a).splice(Math.max(0,se(c)+l),1,...g),l+=g.length-1,_){let w=0;for(let A=0;A<g.length;A++)w+=i(g[A],o,se(c)+A+w,a)}d=!0},skip(){d=!0}},{type:h}=s,f=e["*"],m=e[h],y=typeof f=="function"?f:f?.enter,E=typeof m=="function"?m:m?.enter;if(y?.(p,r),E?.(p,r),!d)switch(h){case"AbsenceFunction":case"CapturingGroup":case"Group":n(s.body,s);break;case"Alternative":case"CharacterClass":n(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"LookaroundAssertion":n(s.body,s);break;case"Quantifier":i(s.body,s,"body");break;case"Regex":n(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return m?.exit?.(p,r),f?.exit?.(p,r),l}return i(t),t}function De(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function se(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const Fa=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ja(t,e){for(let r=0;r<t.length;r++)t[r]>=e&&t[r]++}function Ua(t,e,r,n){return t.slice(0,e)+n+t.slice(e+r.length)}const M=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Kt(t,e,r,n){const i=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,c="";for(const a of t.matchAll(i)){const{0:l,groups:{$skip:d}}=a;if(!d&&(!n||n===M.DEFAULT==!o)){r instanceof Function?c+=r(a,{context:o?M.CHAR_CLASS:M.DEFAULT,negated:s[s.length-1]}):c+=r;continue}l[0]==="["?(o++,s.push(l[1]==="^")):l==="]"&&o&&(o--,s.pop()),c+=l}return c}function Pn(t,e,r,n){Kt(t,e,r,n)}function Wa(t,e,r=0,n){if(!new RegExp(e,"su").test(t))return null;const i=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0,o;for(;o=i.exec(t);){const{0:c,groups:{$skip:a}}=o;if(!a&&(!n||n===M.DEFAULT==!s))return o;c==="["?s++:c==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function $e(t,e,r){return!!Wa(t,e,0,r)}function Ha(t,e){const r=/\\?./gsu;r.lastIndex=e;let n=t.length,i=0,s=1,o;for(;o=r.exec(t);){const[c]=o;if(c==="[")i++;else if(i)c==="]"&&i--;else if(c==="(")s++;else if(c===")"&&(s--,!s)){n=o.index;break}}return t.slice(e,n)}const Sr=new RegExp(String.raw`(?<noncapturingStart>${Fa})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function za(t,e){const r=e?.hiddenCaptures??[];let n=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:n,hiddenCaptures:r};const i="(?>",s="(?:(?=(",o=[0],c=[];let a=0,l=0,d=NaN,p;do{p=!1;let h=0,f=0,m=!1,y;for(Sr.lastIndex=Number.isNaN(d)?0:d+s.length;y=Sr.exec(t);){const{0:E,index:g,groups:{capturingStart:b,noncapturingStart:_}}=y;if(E==="[")h++;else if(h)E==="]"&&h--;else if(E===i&&!m)d=g,m=!0;else if(m&&_)f++;else if(b)m?f++:(a++,o.push(a+l));else if(E===")"&&m){if(!f){l++;const w=a+l;if(t=`${t.slice(0,d)}${s}${t.slice(d+i.length,g)}))<$$${w}>)${t.slice(g+1)}`,p=!0,c.push(w),ja(r,w),n.size){const A=new Map;n.forEach((k,N)=>{A.set(N>=w?N+1:N,k.map(j=>j>=w?j+1:j))}),n=A}break}f--}}}while(p);return r.push(...c),t=Kt(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){const y=+f;if(y>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[y]}`}return`\\${m}`},M.DEFAULT),{pattern:t,captureTransfers:n,hiddenCaptures:r}}const xn=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ft=new RegExp(String.raw`
|
|
45
|
+
`,n);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(r)){const o=/\s+/y;return o.lastIndex=n,{lastIndex:o.exec(e)?o.lastIndex:n}}}if(r===".")return{token:re("dot",r)};if(r==="^"||r==="$"){const o=t.singleline?{"^":P`\A`,$:P`\Z`}[r]:r;return{token:yr(o,r)}}return r==="|"?{token:ra(r)}:Qt.test(r)?{tokens:ba(r)}:{token:z(me(r),r)}}function ea(t,e,r){const n=[Er(e[1]==="^",e)];let i=1,s;for(ht.lastIndex=r;s=ht.exec(t);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,n.push(Er(o[1]==="^",o));else if(o==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(z(93,o));else if(i--,n.push(na(o)),!i)break}else{const c=ta(o);Array.isArray(c)?n.push(...c):n.push(c)}}return{tokens:n,lastIndex:ht.lastIndex||t.length}}function ta(t){if(t[0]==="\\")return Cn(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Xt.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return re("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?ia(t):t==="&&"?sa(t):z(me(t),t)}function Cn(t,{inCharClass:e}){const r=t[1];if(r==="c"||r==="C")return pa(t);if("dDhHsSwW".includes(r))return ma(t);if(t.startsWith(P`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return ga(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{const n=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),s=new TextEncoder;return[...i].map(o=>{const c=[...s.encode(o)].map(a=>`\\x${a.toString(16)}`).join("");return z(me(o),c)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return z(ya(t),t);if(br.has(r))return z(br.get(r),t);if(/\d/.test(r))return oa(e,t);if(t==="\\")throw new Error(P`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return z(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function ra(t){return{type:"Alternator",raw:t}}function yr(t,e){return{type:"Assertion",kind:t,raw:e}}function An(t){return{type:"Backreference",raw:t}}function z(t,e){return{type:"Character",value:t,raw:e}}function na(t){return{type:"CharacterClassClose",raw:t}}function ia(t){return{type:"CharacterClassHyphen",raw:t}}function sa(t){return{type:"CharacterClassIntersector",raw:t}}function Er(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function re(t,e,r={}){return{type:"CharacterSet",kind:t,...r,raw:e}}function vn(t,e,r={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:ge(r.flags),raw:e}}function oa(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function aa(t){return{type:"GroupClose",raw:t}}function ce(t,e,r={}){return{type:"GroupOpen",kind:t,...r,raw:e}}function ca(t,e,r,n){return{type:"NamedCallout",kind:t,tag:e,arguments:r,raw:n}}function la(t,e,r,n){return{type:"Quantifier",kind:t,min:e,max:r,raw:n}}function ua(t){return{type:"Subroutine",raw:t}}const da=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),br=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function pa(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return z(me(e.toUpperCase())-64,t)}function ha(t,e){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;n??="";const i=(e.getCurrentModX()||r.includes("x"))&&!n.includes("x"),s=Cr(r),o=Cr(n),c={};if(s&&(c.enable=s),o&&(c.disable=o),t.endsWith(")"))return e.replaceCurrentModX(i),vn("flags",t,{flags:c});if(t.endsWith(":"))return e.pushModX(i),e.numOpenGroups++,ce("group",t,{...(s||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${t}"`)}function fa(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:r,tag:n,args:i}=e.groups;if(!r)throw new Error(`Invalid named callout "${t}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const s=i?i.split(",").filter(d=>d!=="").map(d=>/^[+-]?\d+$/.test(d)?+d:d):[],[o,c,a]=s,l=da.has(r)?r.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return ca(l,n??null,i?.split(",")??null,t)}function wr(t){let e=null,r,n;if(t[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=s===void 0?+i:s===""?1/0:+s,r>n&&(e="possessive",[r,n]=[n,r]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else r=t[0]==="+"?1:0,n=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return la(e,r,n,t)}function ma(t){const e=t[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function ga(t){const{p:e,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return re("property",t,{value:n,negate:e==="P"&&!r||e==="p"&&!!r})}function Cr(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function _a(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<t.length;r++){const n=t[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(t.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[r+2]==="g"?"grapheme":"word",r+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return e}function ya(t){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function Ea(t,e){const{raw:r,inCharClass:n}=t,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=e))return[An(r)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const a=o[c];let l;if(c===0&&a!=="8"&&a!=="9"){if(l=parseInt(a,8),l>127)throw new Error(P`Octal encoded byte above 177 unsupported "${r}"`)}else l=me(a);s.push(z(l,(c===0?"\\":"")+a))}return s}function ba(t){const e=[],r=new RegExp(Qt,"gy");let n;for(;n=r.exec(t);){const i=n[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:c}=s.groups;if(+o>+c&&i.endsWith("?")){r.lastIndex--,e.push(wr(i.slice(0,-1)));continue}}}e.push(wr(i))}return e}function In(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const r=t.body[0];return!e||Object.keys(e).every(n=>e[n]===r[n])}function wa(t){return Ca.has(t.type)}const Ca=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Rn(t,e={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},n=Zo(t,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(h,f)=>{const m=n.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,m.type){case"Alternator":return ne();case"Assertion":return Aa(m);case"Backreference":return va(m,s);case"Character":return tt(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Ia(m,s,f);case"CharacterClassOpen":return Ra(m,s,f);case"CharacterSet":return Sa(m,s);case"Directive":return Oa(m.kind,{flags:m.flags});case"GroupOpen":return La(m,s,f);case"NamedCallout":return Da(m.kind,m.tag,m.arguments);case"Quantifier":return ka(m,s);case"Subroutine":return Ta(m,s);default:throw new Error(`Unexpected token type "${m.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},o=Va(Na(n.flags));let c=o.body[0];for(;s.nextIndex<n.tokens.length;){const h=i(c,{});h.type==="Alternative"?(o.body.push(h),c=h):c.body.push(h)}const{capturingGroups:a,hasNumberedRef:l,namedGroupsByName:d,subroutines:p}=s;if(l&&d.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of p)if(typeof h=="number"){if(h>a.length)throw new Error("Subroutine uses a group number that's not defined");h&&(a[h-1].isSubroutined=!0)}else if(d.has(h)){if(d.get(h).length>1)throw new Error(P`Subroutine uses a duplicate group name "\g<${h}>"`);d.get(h)[0].isSubroutined=!0}else throw new Error(P`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function Aa({kind:t}){return Pt(ge({"^":"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"}[t],`Unexpected assertion kind "${t}"`),{negate:t===P`\B`||t===P`\Y`})}function va({raw:t},e){const r=/^\\k[<']/.test(t),n=r?t.slice(3,-1):t.slice(1),i=(s,o=!1)=>{const c=e.capturingGroups.length;let a=!1;if(s>c)if(e.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,xt(o?c+1-s:s,{orphan:a})};if(r){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${t}"`);return xt(n)}return i(+n)}function Ia(t,e,r){const{tokens:n,walk:i}=e,s=e.parent,o=s.body.at(-1),c=n[e.nextIndex];if(!r.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const a=i(s,{...r,isCheckingRangeEnd:!0});if(o.type==="Character"&&a.type==="Character")return s.body.pop(),xa(o,a);throw new Error("Invalid character class range")}return tt(me("-"))}function Ra({negate:t},e,r){const{tokens:n,walk:i}=e,s=n[e.nextIndex],o=[Ge()];let c=Ir(s);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(Ge()),e.nextIndex++;else{const l=o.at(-1);l.body.push(i(l,r))}c=Ir(n[e.nextIndex],s)}const a=Ge({negate:t});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(l=>l.body.length===1?l.body[0]:l)),e.nextIndex++,a}function Sa({kind:t,negate:e,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=n;if(t==="property"){const c=rt(r);if(Xt.has(c)&&!o?.has(c))t="posix",r=c;else return le(r,{negate:e,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return t==="posix"?$a(r,{negate:e}):Ot(t,{negate:e})}function La(t,e,r){const{tokens:n,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:c}=e,a=Ma(t),l=a.type==="AbsenceFunction",d=vr(a),p=d&&a.negate;if(a.type==="CapturingGroup"&&(i.push(a),a.name&&Jo(s,a.name,[]).push(a)),l&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Rr(n[e.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")a.body.push(ne()),e.nextIndex++;else{const f=a.body.at(-1),m=c(f,{...r,isInAbsenceFunction:r.isInAbsenceFunction||l,isInLookbehind:r.isInLookbehind||d,isInNegLookbehind:r.isInNegLookbehind||p});if(f.body.push(m),(d||r.isInLookbehind)&&!o){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(p||r.isInNegLookbehind){if(Ar(m)||m.type==="CapturingGroup")throw new Error(y)}else if(Ar(m)||vr(m)&&m.negate)throw new Error(y)}}h=Rr(n[e.nextIndex])}return e.nextIndex++,a}function ka({kind:t,min:e,max:r},n){const i=n.parent,s=i.body.at(-1);if(!s||!wa(s))throw new Error("Quantifier requires a repeatable token");const o=Ln(t,e,r,s);return i.body.pop(),o}function Ta({raw:t},e){const{capturingGroups:r,subroutines:n}=e;let i=t.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const c=+s.groups.num,a=r.length;if(e.hasNumberedRef=!0,i={"":c,"+":a+c,"-":a+1-c}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=kn(i);return n.push(o),o}function Pa(t,e){return{type:"AbsenceFunction",kind:t,body:Le(e?.body)}}function ne(t){return{type:"Alternative",body:Tn(t?.body)}}function Pt(t,e){const r={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(r.negate=!!e?.negate),r}function xt(t,e){const r=!!e?.orphan;return{type:"Backreference",ref:t,...r&&{orphan:r}}}function Sn(t,e){const r={name:void 0,isSubroutined:!1,...e};if(r.name!==void 0&&!Ga(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Le(e?.body)}}function tt(t,e){const r={useLastValid:!1,...e};if(t>1114111){const n=t.toString(16);if(r.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:t}}function Ge(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Tn(t?.body)}}function xa(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Ot(t,e){const r=!!e?.negate,n={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(n.negate=r),(t==="text_segment"||t==="newline"&&!r)&&(n.variableLength=!0),n}function Oa(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:ge(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Na(t){return{type:"Flags",...t}}function G(t){const e=t?.atomic,r=t?.flags;if(e&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...r&&{flags:r},body:Le(t?.body)}}function ee(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Le(t?.body)}}function Da(t,e,r){return{type:"NamedCallout",kind:t,tag:e,arguments:r}}function $a(t,e){const r=!!e?.negate;if(!Xt.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:r}}function Ln(t,e,r,n){if(e>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:r,body:n}}function Va(t,e){return{type:"Regex",body:Le(e?.body),flags:t}}function kn(t){return{type:"Subroutine",ref:t}}function le(t,e){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let n=r.unicodePropertyMap?.get(rt(t));if(!n){if(r.normalizeUnknownPropertyNames)n=Ba(t);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(P`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:n??t,negate:r.negate}}function Ma({flags:t,kind:e,name:r,negate:n,number:i}){switch(e){case"absence_repeater":return Pa("repeater");case"atomic":return G({atomic:!0});case"capturing":return Sn(i,{name:r});case"group":return G({flags:t});case"lookahead":case"lookbehind":return ee({behind:e==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${e}"`)}}function Le(t){if(t===void 0)t=[ne()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Tn(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function Ar(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function vr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Ga(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Ba(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Ir(t,e){return ge(t,`${e?.type==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function Rr(t){return ge(t,"Unclosed group")}function we(t,e,r=null){function n(s,o){for(let c=0;c<s.length;c++){const a=i(s[c],o,c,s);c=Math.max(-1,c+a)}}function i(s,o=null,c=null,a=null){let l=0,d=!1;const p={node:s,parent:o,key:c,container:a,root:t,remove(){De(a).splice(Math.max(0,se(c)+l),1),l--,d=!0},removeAllNextSiblings(){return De(a).splice(se(c)+1)},removeAllPrevSiblings(){const g=se(c)+l;return l-=g,De(a).splice(0,Math.max(0,g))},replaceWith(g,b={}){const _=!!b.traverse;a?a[Math.max(0,se(c)+l)]=g:ge(o,"Can't replace root node")[c]=g,_&&i(g,o,c,a),d=!0},replaceWithMultiple(g,b={}){const _=!!b.traverse;if(De(a).splice(Math.max(0,se(c)+l),1,...g),l+=g.length-1,_){let w=0;for(let A=0;A<g.length;A++)w+=i(g[A],o,se(c)+A+w,a)}d=!0},skip(){d=!0}},{type:h}=s,f=e["*"],m=e[h],y=typeof f=="function"?f:f?.enter,E=typeof m=="function"?m:m?.enter;if(y?.(p,r),E?.(p,r),!d)switch(h){case"AbsenceFunction":case"CapturingGroup":case"Group":n(s.body,s);break;case"Alternative":case"CharacterClass":n(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"LookaroundAssertion":n(s.body,s);break;case"Quantifier":i(s.body,s,"body");break;case"Regex":n(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return m?.exit?.(p,r),f?.exit?.(p,r),l}return i(t),t}function De(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function se(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const Fa=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ja(t,e){for(let r=0;r<t.length;r++)t[r]>=e&&t[r]++}function Ua(t,e,r,n){return t.slice(0,e)+n+t.slice(e+r.length)}const M=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Kt(t,e,r,n){const i=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,c="";for(const a of t.matchAll(i)){const{0:l,groups:{$skip:d}}=a;if(!d&&(!n||n===M.DEFAULT==!o)){r instanceof Function?c+=r(a,{context:o?M.CHAR_CLASS:M.DEFAULT,negated:s[s.length-1]}):c+=r;continue}l[0]==="["?(o++,s.push(l[1]==="^")):l==="]"&&o&&(o--,s.pop()),c+=l}return c}function Pn(t,e,r,n){Kt(t,e,r,n)}function Wa(t,e,r=0,n){if(!new RegExp(e,"su").test(t))return null;const i=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0,o;for(;o=i.exec(t);){const{0:c,groups:{$skip:a}}=o;if(!a&&(!n||n===M.DEFAULT==!s))return o;c==="["?s++:c==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function $e(t,e,r){return!!Wa(t,e,0,r)}function Ha(t,e){const r=/\\?./gsu;r.lastIndex=e;let n=t.length,i=0,s=1,o;for(;o=r.exec(t);){const[c]=o;if(c==="[")i++;else if(i)c==="]"&&i--;else if(c==="(")s++;else if(c===")"&&(s--,!s)){n=o.index;break}}return t.slice(e,n)}const Sr=new RegExp(String.raw`(?<noncapturingStart>${Fa})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function za(t,e){const r=e?.hiddenCaptures??[];let n=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:n,hiddenCaptures:r};const i="(?>",s="(?:(?=(",o=[0],c=[];let a=0,l=0,d=NaN,p;do{p=!1;let h=0,f=0,m=!1,y;for(Sr.lastIndex=Number.isNaN(d)?0:d+s.length;y=Sr.exec(t);){const{0:E,index:g,groups:{capturingStart:b,noncapturingStart:_}}=y;if(E==="[")h++;else if(h)E==="]"&&h--;else if(E===i&&!m)d=g,m=!0;else if(m&&_)f++;else if(b)m?f++:(a++,o.push(a+l));else if(E===")"&&m){if(!f){l++;const w=a+l;if(t=`${t.slice(0,d)}${s}${t.slice(d+i.length,g)}))<$$${w}>)${t.slice(g+1)}`,p=!0,c.push(w),ja(r,w),n.size){const A=new Map;n.forEach((k,N)=>{A.set(N>=w?N+1:N,k.map(j=>j>=w?j+1:j))}),n=A}break}f--}}}while(p);return r.push(...c),t=Kt(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){const y=+f;if(y>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[y]}`}return`\\${m}`},M.DEFAULT),{pattern:t,captureTransfers:n,hiddenCaptures:r}}const xn=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ft=new RegExp(String.raw`
|
|
46
46
|
\\(?: \d+
|
|
47
47
|
| c[A-Za-z]
|
|
48
48
|
| [gk]<[^>]+>
|
|
@@ -150,5 +150,5 @@ XID_Continue XIDC
|
|
|
150
150
|
XID_Start XIDS`.split(/\s/).map(t=>[rt(t),t])),tc=new Map([["s",S(383)],[S(383),"s"]]),rc=new Map([[S(223),S(7838)],[S(107),S(8490)],[S(229),S(8491)],[S(969),S(8486)]]),nc=new Map([Q(453),Q(456),Q(459),Q(498),...gt(8072,8079),...gt(8088,8095),...gt(8104,8111),Q(8124),Q(8140),Q(8188)]),ic=new Map([["alnum",C`[\p{Alpha}\p{Nd}]`],["alpha",C`\p{Alpha}`],["ascii",C`\p{ASCII}`],["blank",C`[\p{Zs}\t]`],["cntrl",C`\p{Cc}`],["digit",C`\p{Nd}`],["graph",C`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",C`\p{Lower}`],["print",C`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",C`[\p{P}\p{S}]`],["space",C`\p{space}`],["upper",C`\p{Upper}`],["word",C`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",C`\p{AHex}`]]);function sc(t,e){const r=[];for(let n=t;n<=e;n++)r.push(n);return r}function Q(t){const e=S(t);return[e.toLowerCase(),e]}function gt(t,e){return sc(t,e).map(r=>Q(r))}var $n=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function oc(t,e){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};Vn(t);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Dt(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};we(t,ac,n);const i={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};we(t,cc,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return we(t,lc,o),t._originMap=s.groupOriginByCopy,t._strategy=n.strategy,t}var ac={AbsenceFunction({node:t,parent:e,replaceWith:r}){const{body:n,kind:i}=t;if(i==="repeater"){const s=G();s.body[0].body.push(ee({negate:!0,body:n}),le("Any"));const o=G();o.body[0].body.push(Ln("greedy",0,1/0,s)),r(v(o,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:r},{flagDirectivesByAlt:n}){const i=t.body.filter(s=>s.kind==="flags");for(let s=r+1;s<e.body.length;s++){const o=e.body[s];Re(n,o,[]).push(...i)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){const r=Gn(e.get(t));if(r){const n=G({flags:r});n.body[0].body=t.body,t.body=[v(n,t)]}}}},Assertion({node:t,parent:e,key:r,container:n,root:i,remove:s,replaceWith:o},c){const{kind:a,negate:l}=t,{asciiWordBoundaries:d,avoidSubclass:p,supportedGNodes:h,wordIsAscii:f}=c;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(a==="line_end")o(v(ee({body:[ne({body:[Pt("string_end")]}),ne({body:[tt(10)]})]}),e));else if(a==="line_start")o(v(H(C`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(a==="search_start")if(h.has(t))i.flags.sticky=!0,s();else{const m=n[r-1];if(m&&mc(m))o(v(ee({negate:!0}),e));else{if(p)throw new Error(C`Uses "\G" in a way that requires a subclass`);o(K(Pt("string_start"),e)),c.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")o(v(H(C`(?=\n?\z)`),e));else if(a==="word_boundary"){if(!f&&!d){const m=`(?:(?<=${W})(?!${W})|(?<!${W})(?=${W}))`,y=`(?:(?<=${W})(?=${W})|(?<!${W})(?!${W}))`;o(v(H(l?y:m),e))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!yt(r)&&(r=_t(r,e),t.ref=r)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:r}){let{name:n}=t;n&&!yt(n)&&(n=_t(n,e),t.name=n),r.set(t.number,t),n&&r.set(n,t)},CharacterClassRange({node:t,parent:e,replaceWith:r}){if(e.kind==="intersection"){const n=Ge({body:[t]});r(v(n,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:r},{accuracy:n,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:c}){const{kind:a,negate:l,value:d}=t;if(s&&(a==="digit"||d==="digit")){r(K(Ot("digit",{negate:l}),e));return}if(o&&(a==="space"||d==="space")){r(v(Et(H(Ya),l),e));return}if(c&&(a==="word"||d==="word")){r(K(Ot("word",{negate:l}),e));return}if(a==="any")r(K(le("Any"),e));else if(a==="digit")r(K(le("Nd",{negate:l}),e));else if(a!=="dot")if(a==="text_segment"){if(n==="strict")throw new Error(C`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=C`\p{RI}{2}|${p}(?:\u200D${p})*`;r(v(H(C`(?>\r\n|${i?C`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(a==="hex")r(K(le("AHex",{negate:l}),e));else if(a==="newline")r(v(H(l?`[^
|
|
151
151
|
]`:`(?>\r
|
|
152
152
|
?|[
|
|
153
|
-
\v\f
\u2028\u2029])`),e));else if(a==="posix")if(!i&&(d==="graph"||d==="print")){if(n==="strict")throw new Error(`POSIX class "${d}" requires min target ES2024 or non-strict accuracy`);let p={graph:"!-~",print:" -~"}[d];l&&(p=`\0-${S(p.codePointAt(0)-1)}${S(p.codePointAt(2)+1)}-`),r(v(H(`[${p}]`),e))}else r(v(Et(H(ic.get(d)),l),e));else if(a==="property")Jt.has(rt(d))||(t.key="sc");else if(a==="space")r(K(le("space",{negate:l}),e));else if(a==="word")r(v(Et(H(W),l),e));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:t,parent:e,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:c,flags:a}=t;if(c==="flags")if(!a.enable&&!a.disable)n();else{const l=G({flags:a});l.body[0].body=o(),i(v(l,e),{traverse:!0})}else if(c==="keep"){const l=r.body[0],p=r.body.length===1&&In(l,{type:"Group"})&&l.body[0].body.length===1?l.body[0]:r;if(e.parent!==p||p.body.length>1)throw new Error(C`Uses "\K" in a way that's unsupported`);const h=ee({behind:!0});h.body[0].body=s(),i(v(h,e))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete t[r]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:r}=t.flags;e?.extended&&delete e.extended,r?.extended&&delete r.extended,e?.dotAll&&r?.dotAll&&delete e.dotAll,e?.ignoreCase&&r?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,r&&!Object.keys(r).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:r}=t;r==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:r}){const{kind:n}=t;if(n==="fail")r(v(ee({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=G();e.body[0].body.push(t.body),t.body=v(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const r=[];let n=!1,i=!1;for(const s of t.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=Fn(s.body);o?(n=!0,Array.isArray(o)?r.push(...o):r.push(o)):i=!0}n&&!i&&r.forEach(s=>e.add(s))},exit(t,{accuracy:e,passedLookbehind:r,strategy:n}){if(e==="strict"&&r&&n)throw new Error(C`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!yt(r)&&(r=_t(r,e),t.ref=r)}},cc={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=t;n||r.set(t,[...e.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:a}){const l=i.get(t);if(l&&c.has(t.number)){const p=K(Or(t.number),e);a.set(p,c.get(t.number)),r(p);return}c.set(t.number,t),o.set(t.number,[]),t.name&&Re(o,t.name,[]);const d=o.get(t.name??t.number);for(let p=0;p<d.length;p++){const h=d[p];if(l===h.node||l&&l===h.origin||t===h.origin){d.splice(p,1);break}}if(o.get(t.number).push({node:t,origin:l}),t.name&&o.get(t.name).push({node:t,origin:l}),t.name){const p=Re(s,t.name,new Map);let h=!1;if(l)h=!0;else for(const f of p.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:h})}},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Ke(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:r},n){const{isRecursive:i,ref:s}=t;if(i){let d=e;for(;(d=d.parent)&&!(d.type==="CapturingGroup"&&(d.name===s||d.number===s)););n.reffedNodesByReferencer.set(t,d);return}const o=n.subroutineRefMap.get(s),c=s===0,a=c?Or(0):Mn(o,n.groupOriginByCopy,null);let l=a;if(!c){const d=Gn(pc(o,h=>h.type==="Group"&&!!h.flags)),p=d?Ke(n.globalFlags,d):n.globalFlags;uc(p,n.currentFlags)||(l=G({flags:hc(p)}),l.body[0].body.push(a))}r(v(l,e),{traverse:!c})}},lc={Backreference({node:t,parent:e,replaceWith:r},n){if(t.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,t.ref);return}const s=n.reffedNodesByReferencer.get(t).filter(o=>dc(o,t));if(!s.length)r(v(ee({negate:!0}),e));else if(s.length>1){const o=G({atomic:!0,body:s.reverse().map(c=>ne({body:[xt(c.number)]}))});r(v(o,e))}else t.ref=s[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const r=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=Sn();t.body.at(-1).body.push(i)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function Vn(t){we(t,{"*"({node:e,parent:r}){e.parent=r}})}function uc(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function dc(t,e){let r=e;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===t)return!1;const n=Bn(r.parent);for(const i of n){if(i===r)break;if(i===t||jn(i,t))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function Mn(t,e,r,n){const i=Array.isArray(t)?[]:{};for(const[s,o]of Object.entries(t))s==="parent"?i.parent=Array.isArray(r)?n:r:o&&typeof o=="object"?i[s]=Mn(o,e,i,r):(s==="type"&&o==="CapturingGroup"&&e.set(i,e.get(t)??t),i[s]=o);return i}function Or(t){const e=kn(t);return e.isRecursive=!0,e}function pc(t,e){const r=[];for(;t=t.parent;)(!e||e(t))&&r.push(t);return r}function _t(t,e){if(e.has(t))return e.get(t);const r=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,r),r}function Gn(t){const e=["dotAll","ignoreCase"],r={enable:{},disable:{}};return t.forEach(({flags:n})=>{e.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function hc({dotAll:t,ignoreCase:e}){const r={};return(t||e)&&(r.enable={},t&&(r.enable.dotAll=!0),e&&(r.enable.ignoreCase=!0)),(!t||!e)&&(r.disable={},!t&&(r.disable.dotAll=!0),!e&&(r.disable.ignoreCase=!0)),r}function Bn(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Fn(t){const e=t.find(r=>r.kind==="search_start"||gc(r,{negate:!1})||!fc(r));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const r=[];for(const n of e.body){const i=Fn(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function jn(t,e){const r=Bn(t)??[];for(const n of r)if(n===e||jn(n,e))return!0;return!1}function fc({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function mc(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function gc(t,e){const r={negate:null,...e};return t.type==="LookaroundAssertion"&&(r.negate===null||t.negate===r.negate)&&t.body.length===1&&In(t.body[0],{type:"Assertion",kind:"search_start"})}function yt(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function H(t,e){const n=Rn(t,{...e,unicodePropertyMap:Jt}).body;return n.length>1||n[0].body.length>1?G({body:n}):n[0].body[0]}function Et(t,e){return t.negate=e,t}function K(t,e){return t.parent=e,t}function v(t,e){return Vn(t),t.parent=e,t}function _c(t,e){const r=Nn(e),n=Dt(r.target,"ES2024"),i=Dt(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!i){const f=[t.flags.ignoreCase];we(t,yc,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?o=!0:c=!0}})}const a={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!c)};let l=t;const d={accuracy:r.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:t._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:n,verbose:r.verbose};function p(f){return d.lastNode=l,l=f,Ja(Ec[f.type],`Unexpected node type "${f.type}"`)(f,d,p)}const h={pattern:t.body.map(p).join("|"),flags:p(t.flags),options:{...t.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],d.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&Re(h._captureTransfers,f.transferTo,[]).push(m)}),h}var yc={"*":{enter({node:t},e){if(Dr(t)){const r=e.getCurrentModI();e.pushModI(t.flags?Ke({ignoreCase:r},t.flags).ignoreCase:r)}},exit({node:t},e){Dr(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Zt(S(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},r){e(),Un(t,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&$n.has(t.value)&&e.setHasCasedChar()}},Ec={Alternative({body:t},e,r){return t.map(r).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?C`\B`:C`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,r){const{body:n,name:i,number:s}=t,o={ignoreCase:e.currentFlags.ignoreCase},c=e.originMap.get(t);return c&&(o.hidden=!0,s>c.number&&(o.transferTo=c.number)),e.captureMap.set(s,o),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:t},e){const r=S(t),n=oe(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(n!==r)return n;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Zt(r)){const i=Dn(r);return e.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(t,e,r){const{kind:n,negate:i,parent:s}=t;let{body:o}=t;if(n==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");q.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some($r)&&(o=[tt(45),...o.filter(l=>!$r(l))]);const c=()=>`[${i?"^":""}${o.map(r).join(n==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||q.bugNestedClassIgnoresNegation)&&!i){const d=o.filter(p=>p.type==="CharacterClass"&&p.kind==="union"&&p.negate);if(d.length){const p=G(),h=p.body[0];return p.parent=s,h.parent=p,o=o.filter(f=>!d.includes(f)),t.body=o,o.length?(t.parent=h,h.body.push(t)):p.body.pop(),d.forEach(f=>{const m=ne({body:[f]});f.parent=m,m.parent=p,p.body.push(m)}),r(p)}}e.inCharClass=!0;const l=c();return e.inCharClass=!1,l}const a=o[0];if(n==="union"&&!i&&a&&((!e.useFlagV||!e.verbose)&&s.kind==="union"&&!(q.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&s.kind==="intersection"&&o.length===1&&a.type!=="CharacterClassRange"))return o.map(r).join("");if(!e.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(t,e){const r=t.min.value,n=t.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},s=oe(r,i),o=oe(n,i),c=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const a=Un(t);vc(a).forEach(d=>{c.add(Array.isArray(d)?`${oe(d[0],i)}-${oe(d[1],i)}`:oe(d,i))})}return`${s}-${o}${[...c].join("")}`},CharacterSet({kind:t,negate:e,value:r,key:n},i){if(t==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":C`[^\n]`;if(t==="digit")return e?C`\D`:C`\d`;if(t==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&$n.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${e?C`\P`:C`\p`}{${n?`${n}=`:""}${r}}`}if(t==="word")return e?C`\W`:C`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:r,parent:n},i,s){const o=i.currentFlags;r&&(i.currentFlags=Ke(o,r));const c=e.map(s).join("|"),a=!i.verbose&&e.length===1&&n.type!=="Quantifier"&&!t&&(!i.useFlagMods||!r)?c:`(?${Ic(t,r,i.useFlagMods)}${c})`;return i.currentFlags=o,a},LookaroundAssertion({body:t,kind:e,negate:r},n,i){return`(?${`${e==="lookahead"?"":"<"}${r?"!":"="}`}${t.map(i).join("|")})`},Quantifier(t,e,r){return r(t.body)+Rc(t)},Subroutine({isRecursive:t,ref:e},r){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return e===0?`(?R=${n})`:C`\g<${e}&R=${n}>`}},bc=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),wc=new Set(["-","\\","]","^","["]),Cc=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Nr=new Map([[9,C`\t`],[10,C`\n`],[11,C`\v`],[12,C`\f`],[13,C`\r`],[8232,C`\u2028`],[8233,C`\u2029`],[65279,C`\uFEFF`]]),Ac=new RegExp("^\\p{Cased}$","u");function Zt(t){return Ac.test(t)}function Un(t,e){const r=!!e?.firstOnly,n=t.min.value,i=t.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let o=n;o<=i;o++){const c=S(o);if(!Zt(c))continue;const a=Dn(c).filter(l=>{const d=l.codePointAt(0);return d<n||d>i});if(a.length&&(s.push(...a),r))break}return s}function oe(t,{escDigit:e,inCharClass:r,useFlagV:n}){if(Nr.has(t))return Nr.get(t);if(t<32||t>126&&t<160||t>262143||e&&Sc(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?Cc:wc:bc,s=S(t);return(i.has(s)?"\\":"")+s}function vc(t){const e=t.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<e.length;i++)e[i+1]===e[i]+1?n??=e[i]:n===null?r.push(e[i]):(r.push([n,e[i]]),n=null);return r}function Ic(t,e,r){if(t)return">";let n="";if(e&&r){const{enable:i,disable:s}=e;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${n}:`}function Rc({kind:t,max:e,min:r}){let n;return!r&&e===1?n="?":!r&&e===1/0?n="*":r===1&&e===1/0?n="+":r===e?n=`{${r}}`:n=`{${r},${e===1/0?"":e}}`,n+{greedy:"",lazy:"?",possessive:"+"}[t]}function Dr({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Sc(t){return t>47&&t<58}function $r({type:t,value:e}){return t==="Character"&&e===45}var Lc=class $t extends RegExp{#t=new Map;#e=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(e,r,n){const i=!!n?.lazyCompile;if(e instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const s=e;super(s,r),this.#n=s.source,s instanceof $t&&(this.#t=s.#t,this.#r=s.#r,this.#i=s.#i,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...n};super(i?"":e,r),this.#n=e,this.#t=Tc(s.hiddenCaptures,s.transfers),this.#i=s.strategy,this.rawOptions=n??{}}i||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new $t(this.#n,this.flags,s)}const r=this.global||this.sticky,n=this.lastIndex;if(this.#i==="clip_search"&&r&&n){this.lastIndex=0;const i=this.#s(e.slice(n));return i&&(kc(i,n,e,this.hasIndices),this.lastIndex+=n),i}return this.#s(e)}#s(e){this.#e.lastIndex=this.lastIndex;const r=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!r||!this.#t.size)return r;const n=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const s=[0];for(let o=1;o<n.length;o++){const{hidden:c,transferTo:a}=this.#t.get(o)??{};if(c?s.push(null):(s.push(r.length),r.push(n[o]),this.hasIndices&&r.indices.push(i[o])),a&&n[o]!==void 0){const l=s[a];if(!l)throw new Error(`Invalid capture transfer to "${l}"`);if(r[l]=n[o],this.hasIndices&&(r.indices[l]=i[o]),r.groups){this.#r||(this.#r=Pc(this.source));const d=this.#r.get(a);d&&(r.groups[d]=n[o],this.hasIndices&&(r.indices.groups[d]=i[o]))}}}return r}};function kc(t,e,r,n){if(t.index+=e,t.input=r,n){const i=t.indices;for(let o=0;o<i.length;o++){const c=i[o];c&&(i[o]=[c[0]+e,c[1]+e])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const c=s[o];c&&(s[o]=[c[0]+e,c[1]+e])})}}function Tc(t,e){const r=new Map;for(const n of t)r.set(n,{hidden:!0});for(const[n,i]of e)for(const s of i)Re(r,s,{}).transferTo=n;return r}function Pc(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=e.exec(t);){const{0:o,groups:{capture:c,name:a}}=s;o==="["?n++:n?o==="]"&&n--:c&&(i++,a&&r.set(i,a))}return r}function xc(t,e){const r=Oc(t,e);return r.options?new Lc(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Oc(t,e){const r=Nn(e),n=Rn(t,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Jt}),i=oc(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=_c(i,r),o=Qa(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),c=qa(o.pattern),a=za(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),l={pattern:a.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const d=a.hiddenCaptures.sort((m,y)=>m-y),p=Array.from(a.captureTransfers),h=i._strategy,f=l.pattern.length>=r.lazyCompileLength;(d.length||p.length||h||f)&&(l.options={...d.length&&{hiddenCaptures:d},...p.length&&{transfers:p},...h&&{strategy:h},...f&&{lazyCompile:f}})}return l}const Vr=4294967295;class Nc{constructor(e,r={}){this.patterns=e,this.options=r;const{forgiving:n=!1,cache:i,regexConstructor:s}=r;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const c=i?.get(o);if(c){if(c instanceof RegExp)return c;if(n)return null;throw c}try{const a=s(o);return i?.set(o,a),a}catch(a){if(i?.set(o,a),n)return null;throw a}})}regexps;findNextMatchSync(e,r,n){const i=typeof e=="string"?e:e.content,s=[];function o(c,a,l=0){return{index:c,captureIndices:a.indices.map(d=>d==null?{start:Vr,end:Vr,length:0}:{start:d[0]+l,end:d[1]+l,length:d[1]-d[0]})}}for(let c=0;c<this.regexps.length;c++){const a=this.regexps[c];if(a)try{a.lastIndex=r;const l=a.exec(i);if(!l)continue;if(l.index===r)return o(c,l,0);s.push([c,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(s.length){const c=Math.min(...s.map(a=>a[1].index));for(const[a,l,d]of s)if(l.index===c)return o(a,l,d)}return null}}function Dc(t,e){return xc(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function $c(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=r=>Dc(r,{target:e.target}),{createScanner(r){return new Nc(r,e)},createString(r){return{content:r}}}}var Vc=Mt("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"),Mc=ue.memo(({children:t,result:e,language:r,className:n,...i})=>{let s=ue.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return V.jsx("pre",{className:Mt(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":r,"data-streamdown":"code-block-body",style:s,...i,children:V.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((o,c)=>V.jsx("span",{className:Vc,children:o.map((a,l)=>V.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:a.color,backgroundColor:a.bgColor,...a.htmlStyle},...a.htmlAttrs,children:a.content},l))},c))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Gc=({className:t,language:e,style:r,...n})=>V.jsx("div",{className:Mt("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...n}),Bc=({language:t,children:e})=>V.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[V.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),V.jsx("div",{className:"flex items-center gap-2",children:e})]}),Fc=$c({forgiving:!0}),bt=new Map,wt=new Map,ae=new Map,jc=(t,e)=>`${t}-${e[0]}-${e[1]}`,Uc=(t,e,r)=>{let n=t.slice(0,100),i=t.length>100?t.slice(-100):"";return`${e}:${r[0]}:${r[1]}:${t.length}:${n}:${i}`},Wn=t=>Object.hasOwn(yn,t),Wc=(t,e)=>{let r=Wn(t)?t:"text",n=jc(r,e);if(bt.has(n))return bt.get(n);let i=Ko({themes:e,langs:[r],engine:Fc});return bt.set(n,i),i},Mr=(t,e,r,n)=>{let i=Wn(e)?e:"text",s=Uc(t,i,r);return wt.has(s)?wt.get(s):(n&&(ae.has(s)||ae.set(s,new Set),ae.get(s).add(n)),Wc(i,r).then(o=>{let c=o.codeToTokens(t,{lang:i,themes:{light:r[0],dark:r[1]}});wt.set(s,c);let a=ae.get(s);if(a){for(let l of a)l(c);ae.delete(s)}}).catch(o=>{console.error("Failed to highlight code:",o),ae.delete(s)}),null)},Yc=({code:t,language:e,className:r,children:n,...i})=>{let{shikiTheme:s}=ue.useContext(Jn),o=ue.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
|
|
154
|
-
`).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[t]),[c,a]=ue.useState(o);return ue.useEffect(()=>{let l=Mr(t,e,s);if(l){a(l);return}Mr(t,e,s,d=>{a(d)})},[t,e,s]),V.jsx(Zn.Provider,{value:{code:t},children:V.jsxs(Gc,{language:e,children:[V.jsx(Bc,{language:e,children:n}),V.jsx(Mc,{className:r,language:e,result:c,...i})]})})};export{
|
|
153
|
+
\v\f
\u2028\u2029])`),e));else if(a==="posix")if(!i&&(d==="graph"||d==="print")){if(n==="strict")throw new Error(`POSIX class "${d}" requires min target ES2024 or non-strict accuracy`);let p={graph:"!-~",print:" -~"}[d];l&&(p=`\0-${S(p.codePointAt(0)-1)}${S(p.codePointAt(2)+1)}-`),r(v(H(`[${p}]`),e))}else r(v(Et(H(ic.get(d)),l),e));else if(a==="property")Jt.has(rt(d))||(t.key="sc");else if(a==="space")r(K(le("space",{negate:l}),e));else if(a==="word")r(v(Et(H(W),l),e));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:t,parent:e,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:c,flags:a}=t;if(c==="flags")if(!a.enable&&!a.disable)n();else{const l=G({flags:a});l.body[0].body=o(),i(v(l,e),{traverse:!0})}else if(c==="keep"){const l=r.body[0],p=r.body.length===1&&In(l,{type:"Group"})&&l.body[0].body.length===1?l.body[0]:r;if(e.parent!==p||p.body.length>1)throw new Error(C`Uses "\K" in a way that's unsupported`);const h=ee({behind:!0});h.body[0].body=s(),i(v(h,e))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete t[r]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:r}=t.flags;e?.extended&&delete e.extended,r?.extended&&delete r.extended,e?.dotAll&&r?.dotAll&&delete e.dotAll,e?.ignoreCase&&r?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,r&&!Object.keys(r).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:r}=t;r==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:r}){const{kind:n}=t;if(n==="fail")r(v(ee({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=G();e.body[0].body.push(t.body),t.body=v(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const r=[];let n=!1,i=!1;for(const s of t.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=Fn(s.body);o?(n=!0,Array.isArray(o)?r.push(...o):r.push(o)):i=!0}n&&!i&&r.forEach(s=>e.add(s))},exit(t,{accuracy:e,passedLookbehind:r,strategy:n}){if(e==="strict"&&r&&n)throw new Error(C`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!yt(r)&&(r=_t(r,e),t.ref=r)}},cc={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=t;n||r.set(t,[...e.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:a}){const l=i.get(t);if(l&&c.has(t.number)){const p=K(Or(t.number),e);a.set(p,c.get(t.number)),r(p);return}c.set(t.number,t),o.set(t.number,[]),t.name&&Re(o,t.name,[]);const d=o.get(t.name??t.number);for(let p=0;p<d.length;p++){const h=d[p];if(l===h.node||l&&l===h.origin||t===h.origin){d.splice(p,1);break}}if(o.get(t.number).push({node:t,origin:l}),t.name&&o.get(t.name).push({node:t,origin:l}),t.name){const p=Re(s,t.name,new Map);let h=!1;if(l)h=!0;else for(const f of p.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:h})}},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Ke(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:r},n){const{isRecursive:i,ref:s}=t;if(i){let d=e;for(;(d=d.parent)&&!(d.type==="CapturingGroup"&&(d.name===s||d.number===s)););n.reffedNodesByReferencer.set(t,d);return}const o=n.subroutineRefMap.get(s),c=s===0,a=c?Or(0):Mn(o,n.groupOriginByCopy,null);let l=a;if(!c){const d=Gn(pc(o,h=>h.type==="Group"&&!!h.flags)),p=d?Ke(n.globalFlags,d):n.globalFlags;uc(p,n.currentFlags)||(l=G({flags:hc(p)}),l.body[0].body.push(a))}r(v(l,e),{traverse:!c})}},lc={Backreference({node:t,parent:e,replaceWith:r},n){if(t.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,t.ref);return}const s=n.reffedNodesByReferencer.get(t).filter(o=>dc(o,t));if(!s.length)r(v(ee({negate:!0}),e));else if(s.length>1){const o=G({atomic:!0,body:s.reverse().map(c=>ne({body:[xt(c.number)]}))});r(v(o,e))}else t.ref=s[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const r=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=Sn();t.body.at(-1).body.push(i)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function Vn(t){we(t,{"*"({node:e,parent:r}){e.parent=r}})}function uc(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function dc(t,e){let r=e;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===t)return!1;const n=Bn(r.parent);for(const i of n){if(i===r)break;if(i===t||jn(i,t))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function Mn(t,e,r,n){const i=Array.isArray(t)?[]:{};for(const[s,o]of Object.entries(t))s==="parent"?i.parent=Array.isArray(r)?n:r:o&&typeof o=="object"?i[s]=Mn(o,e,i,r):(s==="type"&&o==="CapturingGroup"&&e.set(i,e.get(t)??t),i[s]=o);return i}function Or(t){const e=kn(t);return e.isRecursive=!0,e}function pc(t,e){const r=[];for(;t=t.parent;)(!e||e(t))&&r.push(t);return r}function _t(t,e){if(e.has(t))return e.get(t);const r=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,r),r}function Gn(t){const e=["dotAll","ignoreCase"],r={enable:{},disable:{}};return t.forEach(({flags:n})=>{e.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function hc({dotAll:t,ignoreCase:e}){const r={};return(t||e)&&(r.enable={},t&&(r.enable.dotAll=!0),e&&(r.enable.ignoreCase=!0)),(!t||!e)&&(r.disable={},!t&&(r.disable.dotAll=!0),!e&&(r.disable.ignoreCase=!0)),r}function Bn(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Fn(t){const e=t.find(r=>r.kind==="search_start"||gc(r,{negate:!1})||!fc(r));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const r=[];for(const n of e.body){const i=Fn(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function jn(t,e){const r=Bn(t)??[];for(const n of r)if(n===e||jn(n,e))return!0;return!1}function fc({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function mc(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function gc(t,e){const r={negate:null,...e};return t.type==="LookaroundAssertion"&&(r.negate===null||t.negate===r.negate)&&t.body.length===1&&In(t.body[0],{type:"Assertion",kind:"search_start"})}function yt(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function H(t,e){const n=Rn(t,{...e,unicodePropertyMap:Jt}).body;return n.length>1||n[0].body.length>1?G({body:n}):n[0].body[0]}function Et(t,e){return t.negate=e,t}function K(t,e){return t.parent=e,t}function v(t,e){return Vn(t),t.parent=e,t}function _c(t,e){const r=Nn(e),n=Dt(r.target,"ES2024"),i=Dt(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!i){const f=[t.flags.ignoreCase];we(t,yc,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?o=!0:c=!0}})}const a={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!c)};let l=t;const d={accuracy:r.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:t._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:n,verbose:r.verbose};function p(f){return d.lastNode=l,l=f,Ja(Ec[f.type],`Unexpected node type "${f.type}"`)(f,d,p)}const h={pattern:t.body.map(p).join("|"),flags:p(t.flags),options:{...t.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],d.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&Re(h._captureTransfers,f.transferTo,[]).push(m)}),h}var yc={"*":{enter({node:t},e){if(Dr(t)){const r=e.getCurrentModI();e.pushModI(t.flags?Ke({ignoreCase:r},t.flags).ignoreCase:r)}},exit({node:t},e){Dr(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Zt(S(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},r){e(),Un(t,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&$n.has(t.value)&&e.setHasCasedChar()}},Ec={Alternative({body:t},e,r){return t.map(r).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?C`\B`:C`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,r){const{body:n,name:i,number:s}=t,o={ignoreCase:e.currentFlags.ignoreCase},c=e.originMap.get(t);return c&&(o.hidden=!0,s>c.number&&(o.transferTo=c.number)),e.captureMap.set(s,o),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:t},e){const r=S(t),n=oe(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(n!==r)return n;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Zt(r)){const i=Dn(r);return e.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(t,e,r){const{kind:n,negate:i,parent:s}=t;let{body:o}=t;if(n==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");q.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some($r)&&(o=[tt(45),...o.filter(l=>!$r(l))]);const c=()=>`[${i?"^":""}${o.map(r).join(n==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||q.bugNestedClassIgnoresNegation)&&!i){const d=o.filter(p=>p.type==="CharacterClass"&&p.kind==="union"&&p.negate);if(d.length){const p=G(),h=p.body[0];return p.parent=s,h.parent=p,o=o.filter(f=>!d.includes(f)),t.body=o,o.length?(t.parent=h,h.body.push(t)):p.body.pop(),d.forEach(f=>{const m=ne({body:[f]});f.parent=m,m.parent=p,p.body.push(m)}),r(p)}}e.inCharClass=!0;const l=c();return e.inCharClass=!1,l}const a=o[0];if(n==="union"&&!i&&a&&((!e.useFlagV||!e.verbose)&&s.kind==="union"&&!(q.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&s.kind==="intersection"&&o.length===1&&a.type!=="CharacterClassRange"))return o.map(r).join("");if(!e.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(t,e){const r=t.min.value,n=t.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},s=oe(r,i),o=oe(n,i),c=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const a=Un(t);vc(a).forEach(d=>{c.add(Array.isArray(d)?`${oe(d[0],i)}-${oe(d[1],i)}`:oe(d,i))})}return`${s}-${o}${[...c].join("")}`},CharacterSet({kind:t,negate:e,value:r,key:n},i){if(t==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":C`[^\n]`;if(t==="digit")return e?C`\D`:C`\d`;if(t==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&$n.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${e?C`\P`:C`\p`}{${n?`${n}=`:""}${r}}`}if(t==="word")return e?C`\W`:C`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:r,parent:n},i,s){const o=i.currentFlags;r&&(i.currentFlags=Ke(o,r));const c=e.map(s).join("|"),a=!i.verbose&&e.length===1&&n.type!=="Quantifier"&&!t&&(!i.useFlagMods||!r)?c:`(?${Ic(t,r,i.useFlagMods)}${c})`;return i.currentFlags=o,a},LookaroundAssertion({body:t,kind:e,negate:r},n,i){return`(?${`${e==="lookahead"?"":"<"}${r?"!":"="}`}${t.map(i).join("|")})`},Quantifier(t,e,r){return r(t.body)+Rc(t)},Subroutine({isRecursive:t,ref:e},r){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return e===0?`(?R=${n})`:C`\g<${e}&R=${n}>`}},bc=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),wc=new Set(["-","\\","]","^","["]),Cc=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Nr=new Map([[9,C`\t`],[10,C`\n`],[11,C`\v`],[12,C`\f`],[13,C`\r`],[8232,C`\u2028`],[8233,C`\u2029`],[65279,C`\uFEFF`]]),Ac=/^\p{Cased}$/u;function Zt(t){return Ac.test(t)}function Un(t,e){const r=!!e?.firstOnly,n=t.min.value,i=t.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let o=n;o<=i;o++){const c=S(o);if(!Zt(c))continue;const a=Dn(c).filter(l=>{const d=l.codePointAt(0);return d<n||d>i});if(a.length&&(s.push(...a),r))break}return s}function oe(t,{escDigit:e,inCharClass:r,useFlagV:n}){if(Nr.has(t))return Nr.get(t);if(t<32||t>126&&t<160||t>262143||e&&Sc(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?Cc:wc:bc,s=S(t);return(i.has(s)?"\\":"")+s}function vc(t){const e=t.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<e.length;i++)e[i+1]===e[i]+1?n??=e[i]:n===null?r.push(e[i]):(r.push([n,e[i]]),n=null);return r}function Ic(t,e,r){if(t)return">";let n="";if(e&&r){const{enable:i,disable:s}=e;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${n}:`}function Rc({kind:t,max:e,min:r}){let n;return!r&&e===1?n="?":!r&&e===1/0?n="*":r===1&&e===1/0?n="+":r===e?n=`{${r}}`:n=`{${r},${e===1/0?"":e}}`,n+{greedy:"",lazy:"?",possessive:"+"}[t]}function Dr({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Sc(t){return t>47&&t<58}function $r({type:t,value:e}){return t==="Character"&&e===45}var Lc=class $t extends RegExp{#t=new Map;#e=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(e,r,n){const i=!!n?.lazyCompile;if(e instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const s=e;super(s,r),this.#n=s.source,s instanceof $t&&(this.#t=s.#t,this.#r=s.#r,this.#i=s.#i,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...n};super(i?"":e,r),this.#n=e,this.#t=Tc(s.hiddenCaptures,s.transfers),this.#i=s.strategy,this.rawOptions=n??{}}i||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new $t(this.#n,this.flags,s)}const r=this.global||this.sticky,n=this.lastIndex;if(this.#i==="clip_search"&&r&&n){this.lastIndex=0;const i=this.#s(e.slice(n));return i&&(kc(i,n,e,this.hasIndices),this.lastIndex+=n),i}return this.#s(e)}#s(e){this.#e.lastIndex=this.lastIndex;const r=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!r||!this.#t.size)return r;const n=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const s=[0];for(let o=1;o<n.length;o++){const{hidden:c,transferTo:a}=this.#t.get(o)??{};if(c?s.push(null):(s.push(r.length),r.push(n[o]),this.hasIndices&&r.indices.push(i[o])),a&&n[o]!==void 0){const l=s[a];if(!l)throw new Error(`Invalid capture transfer to "${l}"`);if(r[l]=n[o],this.hasIndices&&(r.indices[l]=i[o]),r.groups){this.#r||(this.#r=Pc(this.source));const d=this.#r.get(a);d&&(r.groups[d]=n[o],this.hasIndices&&(r.indices.groups[d]=i[o]))}}}return r}};function kc(t,e,r,n){if(t.index+=e,t.input=r,n){const i=t.indices;for(let o=0;o<i.length;o++){const c=i[o];c&&(i[o]=[c[0]+e,c[1]+e])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const c=s[o];c&&(s[o]=[c[0]+e,c[1]+e])})}}function Tc(t,e){const r=new Map;for(const n of t)r.set(n,{hidden:!0});for(const[n,i]of e)for(const s of i)Re(r,s,{}).transferTo=n;return r}function Pc(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=e.exec(t);){const{0:o,groups:{capture:c,name:a}}=s;o==="["?n++:n?o==="]"&&n--:c&&(i++,a&&r.set(i,a))}return r}function xc(t,e){const r=Oc(t,e);return r.options?new Lc(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Oc(t,e){const r=Nn(e),n=Rn(t,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Jt}),i=oc(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=_c(i,r),o=Qa(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),c=qa(o.pattern),a=za(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),l={pattern:a.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const d=a.hiddenCaptures.sort((m,y)=>m-y),p=Array.from(a.captureTransfers),h=i._strategy,f=l.pattern.length>=r.lazyCompileLength;(d.length||p.length||h||f)&&(l.options={...d.length&&{hiddenCaptures:d},...p.length&&{transfers:p},...h&&{strategy:h},...f&&{lazyCompile:f}})}return l}const Vr=4294967295;class Nc{constructor(e,r={}){this.patterns=e,this.options=r;const{forgiving:n=!1,cache:i,regexConstructor:s}=r;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const c=i?.get(o);if(c){if(c instanceof RegExp)return c;if(n)return null;throw c}try{const a=s(o);return i?.set(o,a),a}catch(a){if(i?.set(o,a),n)return null;throw a}})}regexps;findNextMatchSync(e,r,n){const i=typeof e=="string"?e:e.content,s=[];function o(c,a,l=0){return{index:c,captureIndices:a.indices.map(d=>d==null?{start:Vr,end:Vr,length:0}:{start:d[0]+l,end:d[1]+l,length:d[1]-d[0]})}}for(let c=0;c<this.regexps.length;c++){const a=this.regexps[c];if(a)try{a.lastIndex=r;const l=a.exec(i);if(!l)continue;if(l.index===r)return o(c,l,0);s.push([c,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(s.length){const c=Math.min(...s.map(a=>a[1].index));for(const[a,l,d]of s)if(l.index===c)return o(a,l,d)}return null}}function Dc(t,e){return xc(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function $c(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=r=>Dc(r,{target:e.target}),{createScanner(r){return new Nc(r,e)},createString(r){return{content:r}}}}var Vc=Mt("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"),Mc=ue.memo(({children:t,result:e,language:r,className:n,...i})=>{let s=ue.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return V.jsx("pre",{className:Mt(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":r,"data-streamdown":"code-block-body",style:s,...i,children:V.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((o,c)=>V.jsx("span",{className:Vc,children:o.map((a,l)=>V.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:a.color,backgroundColor:a.bgColor,...a.htmlStyle},...a.htmlAttrs,children:a.content},l))},c))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Gc=({className:t,language:e,style:r,...n})=>V.jsx("div",{className:Mt("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...n}),Bc=({language:t,children:e})=>V.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[V.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),V.jsx("div",{className:"flex items-center gap-2",children:e})]}),Fc=$c({forgiving:!0}),bt=new Map,wt=new Map,ae=new Map,jc=(t,e)=>`${t}-${e[0]}-${e[1]}`,Uc=(t,e,r)=>{let n=t.slice(0,100),i=t.length>100?t.slice(-100):"";return`${e}:${r[0]}:${r[1]}:${t.length}:${n}:${i}`},Wn=t=>Object.hasOwn(yn,t),Wc=(t,e)=>{let r=Wn(t)?t:"text",n=jc(r,e);if(bt.has(n))return bt.get(n);let i=Ko({themes:e,langs:[r],engine:Fc});return bt.set(n,i),i},Mr=(t,e,r,n)=>{let i=Wn(e)?e:"text",s=Uc(t,i,r);return wt.has(s)?wt.get(s):(n&&(ae.has(s)||ae.set(s,new Set),ae.get(s).add(n)),Wc(i,r).then(o=>{let c=o.codeToTokens(t,{lang:i,themes:{light:r[0],dark:r[1]}});wt.set(s,c);let a=ae.get(s);if(a){for(let l of a)l(c);ae.delete(s)}}).catch(o=>{console.error("Failed to highlight code:",o),ae.delete(s)}),null)},sl=({code:t,language:e,className:r,children:n,...i})=>{let{shikiTheme:s}=ue.useContext(Jn),o=ue.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
|
|
154
|
+
`).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[t]),[c,a]=ue.useState(o);return ue.useEffect(()=>{let l=Mr(t,e,s);if(l){a(l);return}Mr(t,e,s,d=>{a(d)})},[t,e,s]),V.jsx(Zn.Provider,{value:{code:t},children:V.jsxs(Gc,{language:e,children:[V.jsx(Bc,{language:e,children:n}),V.jsx(Mc,{className:r,language:e,result:c,...i})]})})};export{sl as CodeBlock};
|