@septkit/ui 0.0.42 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code/code-block.js +7 -0
- package/dist/code/code-block.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/code/diff.js +35 -0
- package/dist/code/highlight.js +30 -0
- package/dist/code/index.js +5 -0
- package/dist/code/xml-diff.js +5 -0
- package/dist/code/xml-diff.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialecte/composables/index.js +2 -1
- package/dist/dialecte/composables/use-active-document.js +24 -0
- package/dist/dialecte/create-document-store.js +3 -3
- package/dist/dialecte/index.js +2 -1
- package/dist/dialog/dialog-host.js +5 -0
- package/dist/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialog/dialog.js +5 -0
- package/dist/dialog/dialog.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/dialog/index.js +4 -0
- package/dist/dialog/use-dialog-host.js +32 -0
- package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/helpers.js +142 -0
- package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/index.js +3 -0
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/project-E32sEthh.js → @dialecte_core@0.4.5/node_modules/@dialecte/core/dist/project-wohrish5.js} +3352 -1170
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/utils-DgKwrT2n.js → @dialecte_core@0.4.5/node_modules/@dialecte/core/dist/utils-C5_11hqg.js} +73 -3
- package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/hooks-BTkrNj6r.js +25264 -0
- package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/arrow-right.js +11 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/copy.js +16 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/text-wrap.js +22 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/x.js +11 -0
- package/dist/external/.pnpm/@shikijs_core@3.23.0/node_modules/@shikijs/core/dist/index.js +1299 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.js +34 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.js +66 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/java.js +3 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/xml.js +5 -0
- package/dist/external/.pnpm/@shikijs_themes@3.23.0/node_modules/@shikijs/themes/dist/github-dark.js +4 -0
- package/dist/external/.pnpm/@shikijs_types@3.23.0/node_modules/@shikijs/types/dist/index.js +8 -0
- package/dist/external/.pnpm/@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.js +1576 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +126 -43
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +84 -55
- package/dist/external/.pnpm/ccount@2.0.1/node_modules/ccount/index.js +10 -0
- package/dist/external/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js +257 -0
- package/dist/external/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js +4 -0
- package/dist/external/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.js +11 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.js +49 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.js +28 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.js +8 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js +48 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.js +86 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.js +10 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.js +39 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.js +13 -0
- package/dist/external/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js +10 -0
- package/dist/external/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js +25 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js +23 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js +419 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +487 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js +84 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js +30 -0
- package/dist/external/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js +970 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/index.js +25 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js +61 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js +31 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js +326 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js +564 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js +14 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js +18 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js +16 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js +15 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js +14 -0
- package/dist/external/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js +110 -0
- package/dist/external/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js +56 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js +94 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/internals.js +2 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContent.js +72 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentImpl.js +101 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentModal.js +83 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentNonModal.js +74 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlay.js +48 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlayImpl.js +47 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogRoot.js +61 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/utils.js +17 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Menu/utils.js +16 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterGroup.js +384 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterPanel.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterResizeHandle.js +119 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperIndicator.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperItem.js +67 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperRoot.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterBehavior.js +37 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterPanelGroupBehavior.js +82 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/arrays.js +7 -2
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/browser.js +4 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/assert.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/calculate.js +73 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/callPanelCallbacks.js +19 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/compare.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/debounce.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/dom.js +20 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/events.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/layout.js +103 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/pivot.js +8 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/rects.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/registry.js +106 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/resizePanel.js +15 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/stackingOrder.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/storage.js +50 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/style.js +35 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/units.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/validation.js +39 -0
- package/dist/external/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js +6 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.js +13 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.js +23 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.js +14 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js +17 -0
- package/dist/external/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js +16 -0
- package/dist/index.d.ts +402 -2
- package/dist/index.js +24 -8
- package/dist/merge/build-view-model.js +168 -0
- package/dist/merge/decision-toggle.js +5 -0
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/merge/element-detail.js +5 -0
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/merge/index.js +6 -0
- package/dist/merge/merge-progress.js +5 -0
- package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/merge/merge-review.js +5 -0
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +305 -0
- package/dist/merge/merge-summary.js +5 -0
- package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/merge/merge-tree.js +5 -0
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/merge/merge.service.js +69 -0
- package/dist/merge/use-document-progress.js +27 -0
- package/dist/merge/use-merge-session.js +151 -0
- package/dist/ui.css +1 -1
- package/package.json +4 -2
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/helpers.js +0 -13
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/index.js +0 -3
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import { PosixClassNames as e, cpOf as t, r as n, throwIfNullish as r } from "../utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js
|
|
3
|
+
var i = n`\[\^?`, a = `c.? | C(?:-.?)?|${n`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${n`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${n`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${n`o\{[^\}]*\}?`}|${n`\d{1,3}`}`, o = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, s = new RegExp(n`
|
|
4
|
+
\\ (?:
|
|
5
|
+
${a}
|
|
6
|
+
| [gk]<[^>]*>?
|
|
7
|
+
| [gk]'[^']*'?
|
|
8
|
+
| .
|
|
9
|
+
)
|
|
10
|
+
| \( (?:
|
|
11
|
+
\? (?:
|
|
12
|
+
[:=!>({]
|
|
13
|
+
| <[=!]
|
|
14
|
+
| <[^>]*>
|
|
15
|
+
| '[^']*'
|
|
16
|
+
| ~\|?
|
|
17
|
+
| #(?:[^)\\]|\\.?)*
|
|
18
|
+
| [^:)]*[:)]
|
|
19
|
+
)?
|
|
20
|
+
| \*[^\)]*\)?
|
|
21
|
+
)?
|
|
22
|
+
| (?:${o.source})+
|
|
23
|
+
| ${i}
|
|
24
|
+
| .
|
|
25
|
+
`.replace(/\s+/g, ""), "gsu"), c = new RegExp(n`
|
|
26
|
+
\\ (?:
|
|
27
|
+
${a}
|
|
28
|
+
| .
|
|
29
|
+
)
|
|
30
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
31
|
+
| ${i}
|
|
32
|
+
| &&
|
|
33
|
+
| .
|
|
34
|
+
`.replace(/\s+/g, ""), "gsu");
|
|
35
|
+
function l(e, t = {}) {
|
|
36
|
+
let n = {
|
|
37
|
+
flags: "",
|
|
38
|
+
...t,
|
|
39
|
+
rules: {
|
|
40
|
+
captureGroup: !1,
|
|
41
|
+
singleline: !1,
|
|
42
|
+
...t.rules
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (typeof e != "string") throw Error("String expected as pattern");
|
|
46
|
+
let r = z(n.flags), i = [r.extended], a = {
|
|
47
|
+
captureGroup: n.rules.captureGroup,
|
|
48
|
+
getCurrentModX() {
|
|
49
|
+
return i.at(-1);
|
|
50
|
+
},
|
|
51
|
+
numOpenGroups: 0,
|
|
52
|
+
popModX() {
|
|
53
|
+
i.pop();
|
|
54
|
+
},
|
|
55
|
+
pushModX(e) {
|
|
56
|
+
i.push(e);
|
|
57
|
+
},
|
|
58
|
+
replaceCurrentModX(e) {
|
|
59
|
+
i[i.length - 1] = e;
|
|
60
|
+
},
|
|
61
|
+
singleline: n.rules.singleline
|
|
62
|
+
}, o = [], c;
|
|
63
|
+
for (s.lastIndex = 0; c = s.exec(e);) {
|
|
64
|
+
let t = u(a, e, c[0], s.lastIndex);
|
|
65
|
+
t.tokens ? o.push(...t.tokens) : t.token && o.push(t.token), t.lastIndex !== void 0 && (s.lastIndex = t.lastIndex);
|
|
66
|
+
}
|
|
67
|
+
let l = [], d = 0;
|
|
68
|
+
o.filter((e) => e.type === "GroupOpen").forEach((e) => {
|
|
69
|
+
e.kind === "capturing" ? e.number = ++d : e.raw === "(" && l.push(e);
|
|
70
|
+
}), d || l.forEach((e, t) => {
|
|
71
|
+
e.kind = "capturing", e.number = t + 1;
|
|
72
|
+
});
|
|
73
|
+
let f = d || l.length;
|
|
74
|
+
return {
|
|
75
|
+
tokens: o.map((e) => e.type === "EscapedNumber" ? V(e, f) : e).flat(),
|
|
76
|
+
flags: r
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function u(e, r, i, a) {
|
|
80
|
+
let [s, c] = i;
|
|
81
|
+
if (i === "[" || i === "[^") {
|
|
82
|
+
let e = d(r, i, a);
|
|
83
|
+
return {
|
|
84
|
+
tokens: e.tokens,
|
|
85
|
+
lastIndex: e.lastIndex
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (s === "\\") {
|
|
89
|
+
if ("AbBGyYzZ".includes(c)) return { token: h(i, i) };
|
|
90
|
+
if (/^\\g[<']/.test(i)) {
|
|
91
|
+
if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(i)) throw Error(`Invalid group name "${i}"`);
|
|
92
|
+
return { token: k(i) };
|
|
93
|
+
}
|
|
94
|
+
if (/^\\k[<']/.test(i)) {
|
|
95
|
+
if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(i)) throw Error(`Invalid group name "${i}"`);
|
|
96
|
+
return { token: g(i) };
|
|
97
|
+
}
|
|
98
|
+
if (c === "K") return { token: C("keep", i) };
|
|
99
|
+
if (c === "N" || c === "R") return { token: S("newline", i, { negate: c === "N" }) };
|
|
100
|
+
if (c === "O") return { token: S("any", i) };
|
|
101
|
+
if (c === "X") return { token: S("text_segment", i) };
|
|
102
|
+
let e = p(i, { inCharClass: !1 });
|
|
103
|
+
return Array.isArray(e) ? { tokens: e } : { token: e };
|
|
104
|
+
}
|
|
105
|
+
if (s === "(") {
|
|
106
|
+
if (c === "*") return { token: P(i) };
|
|
107
|
+
if (i === "(?{") throw Error(`Unsupported callout "${i}"`);
|
|
108
|
+
if (i.startsWith("(?#")) {
|
|
109
|
+
if (r[a] !== ")") throw Error("Unclosed comment group \"(?#\"");
|
|
110
|
+
return { lastIndex: a + 1 };
|
|
111
|
+
}
|
|
112
|
+
if (/^\(\?[-imx]+[:)]$/.test(i)) return { token: N(i, e) };
|
|
113
|
+
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, i === "(" && !e.captureGroup || i === "(?:") return { token: E("group", i) };
|
|
114
|
+
if (i === "(?>") return { token: E("atomic", i) };
|
|
115
|
+
if (i === "(?=" || i === "(?!" || i === "(?<=" || i === "(?<!") return { token: E(i[2] === "<" ? "lookbehind" : "lookahead", i, { negate: i.endsWith("!") }) };
|
|
116
|
+
if (i === "(" && e.captureGroup || i.startsWith("(?<") && i.endsWith(">") || i.startsWith("(?'") && i.endsWith("'")) return { token: E("capturing", i, { ...i !== "(" && { name: i.slice(3, -1) } }) };
|
|
117
|
+
if (i.startsWith("(?~")) {
|
|
118
|
+
if (i === "(?~|") throw Error(`Unsupported absence function kind "${i}"`);
|
|
119
|
+
return { token: E("absence_repeater", i) };
|
|
120
|
+
}
|
|
121
|
+
throw Error(i === "(?(" ? `Unsupported conditional "${i}"` : `Invalid or unsupported group option "${i}"`);
|
|
122
|
+
}
|
|
123
|
+
if (i === ")") {
|
|
124
|
+
if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0) throw Error("Unmatched \")\"");
|
|
125
|
+
return { token: T(i) };
|
|
126
|
+
}
|
|
127
|
+
if (e.getCurrentModX()) {
|
|
128
|
+
if (i === "#") {
|
|
129
|
+
let e = r.indexOf("\n", a);
|
|
130
|
+
return { lastIndex: e === -1 ? r.length : e };
|
|
131
|
+
}
|
|
132
|
+
if (/^\s$/.test(i)) {
|
|
133
|
+
let e = /\s+/y;
|
|
134
|
+
return e.lastIndex = a, { lastIndex: e.exec(r) ? e.lastIndex : a };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return i === "." ? { token: S("dot", i) } : i === "^" || i === "$" ? { token: h(e.singleline ? {
|
|
138
|
+
"^": n`\A`,
|
|
139
|
+
$: n`\Z`
|
|
140
|
+
}[i] : i, i) } : i === "|" ? { token: m(i) } : o.test(i) ? { tokens: H(i) } : { token: _(t(i), i) };
|
|
141
|
+
}
|
|
142
|
+
function d(e, t, n) {
|
|
143
|
+
let r = [x(t[1] === "^", t)], i = 1, a;
|
|
144
|
+
for (c.lastIndex = n; a = c.exec(e);) {
|
|
145
|
+
let e = a[0];
|
|
146
|
+
if (e[0] === "[" && e[1] !== ":") i++, r.push(x(e[1] === "^", e));
|
|
147
|
+
else if (e === "]") {
|
|
148
|
+
if (r.at(-1).type === "CharacterClassOpen") r.push(_(93, e));
|
|
149
|
+
else if (i--, r.push(v(e)), !i) break;
|
|
150
|
+
} else {
|
|
151
|
+
let t = f(e);
|
|
152
|
+
Array.isArray(t) ? r.push(...t) : r.push(t);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
tokens: r,
|
|
157
|
+
lastIndex: c.lastIndex || e.length
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function f(n) {
|
|
161
|
+
if (n[0] === "\\") return p(n, { inCharClass: !0 });
|
|
162
|
+
if (n[0] === "[") {
|
|
163
|
+
let t = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(n);
|
|
164
|
+
if (!t || !e.has(t.groups.name)) throw Error(`Invalid POSIX class "${n}"`);
|
|
165
|
+
return S("posix", n, {
|
|
166
|
+
value: t.groups.name,
|
|
167
|
+
negate: !!t.groups.negate
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return n === "-" ? y(n) : n === "&&" ? b(n) : _(t(n), n);
|
|
171
|
+
}
|
|
172
|
+
function p(e, { inCharClass: r }) {
|
|
173
|
+
let i = e[1];
|
|
174
|
+
if (i === "c" || i === "C") return M(e);
|
|
175
|
+
if ("dDhHsSwW".includes(i)) return I(e);
|
|
176
|
+
if (e.startsWith(n`\o{`)) throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
|
|
177
|
+
if (/^\\[pP]\{/.test(e)) {
|
|
178
|
+
if (e.length === 3) throw Error(`Incomplete or invalid Unicode property "${e}"`);
|
|
179
|
+
return L(e);
|
|
180
|
+
}
|
|
181
|
+
if (/^\\x[89A-Fa-f]\p{AHex}/u.test(e)) try {
|
|
182
|
+
let n = e.split(/\\x/).slice(1).map((e) => parseInt(e, 16)), r = new TextDecoder("utf-8", {
|
|
183
|
+
ignoreBOM: !0,
|
|
184
|
+
fatal: !0
|
|
185
|
+
}).decode(new Uint8Array(n)), i = new TextEncoder();
|
|
186
|
+
return [...r].map((e) => {
|
|
187
|
+
let n = [...i.encode(e)].map((e) => `\\x${e.toString(16)}`).join("");
|
|
188
|
+
return _(t(e), n);
|
|
189
|
+
});
|
|
190
|
+
} catch {
|
|
191
|
+
throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
|
|
192
|
+
}
|
|
193
|
+
if (i === "u" || i === "x") return _(B(e), e);
|
|
194
|
+
if (j.has(i)) return _(j.get(i), e);
|
|
195
|
+
if (/\d/.test(i)) return w(r, e);
|
|
196
|
+
if (e === "\\") throw Error(n`Incomplete escape "\"`);
|
|
197
|
+
if (i === "M") throw Error(`Unsupported meta "${e}"`);
|
|
198
|
+
if ([...e].length === 2) return _(e.codePointAt(1), e);
|
|
199
|
+
throw Error(`Unexpected escape "${e}"`);
|
|
200
|
+
}
|
|
201
|
+
function m(e) {
|
|
202
|
+
return {
|
|
203
|
+
type: "Alternator",
|
|
204
|
+
raw: e
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function h(e, t) {
|
|
208
|
+
return {
|
|
209
|
+
type: "Assertion",
|
|
210
|
+
kind: e,
|
|
211
|
+
raw: t
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function g(e) {
|
|
215
|
+
return {
|
|
216
|
+
type: "Backreference",
|
|
217
|
+
raw: e
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function _(e, t) {
|
|
221
|
+
return {
|
|
222
|
+
type: "Character",
|
|
223
|
+
value: e,
|
|
224
|
+
raw: t
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function v(e) {
|
|
228
|
+
return {
|
|
229
|
+
type: "CharacterClassClose",
|
|
230
|
+
raw: e
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function y(e) {
|
|
234
|
+
return {
|
|
235
|
+
type: "CharacterClassHyphen",
|
|
236
|
+
raw: e
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function b(e) {
|
|
240
|
+
return {
|
|
241
|
+
type: "CharacterClassIntersector",
|
|
242
|
+
raw: e
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function x(e, t) {
|
|
246
|
+
return {
|
|
247
|
+
type: "CharacterClassOpen",
|
|
248
|
+
negate: e,
|
|
249
|
+
raw: t
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function S(e, t, n = {}) {
|
|
253
|
+
return {
|
|
254
|
+
type: "CharacterSet",
|
|
255
|
+
kind: e,
|
|
256
|
+
...n,
|
|
257
|
+
raw: t
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function C(e, t, n = {}) {
|
|
261
|
+
return e === "keep" ? {
|
|
262
|
+
type: "Directive",
|
|
263
|
+
kind: e,
|
|
264
|
+
raw: t
|
|
265
|
+
} : {
|
|
266
|
+
type: "Directive",
|
|
267
|
+
kind: e,
|
|
268
|
+
flags: r(n.flags),
|
|
269
|
+
raw: t
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function w(e, t) {
|
|
273
|
+
return {
|
|
274
|
+
type: "EscapedNumber",
|
|
275
|
+
inCharClass: e,
|
|
276
|
+
raw: t
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function T(e) {
|
|
280
|
+
return {
|
|
281
|
+
type: "GroupClose",
|
|
282
|
+
raw: e
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function E(e, t, n = {}) {
|
|
286
|
+
return {
|
|
287
|
+
type: "GroupOpen",
|
|
288
|
+
kind: e,
|
|
289
|
+
...n,
|
|
290
|
+
raw: t
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function D(e, t, n, r) {
|
|
294
|
+
return {
|
|
295
|
+
type: "NamedCallout",
|
|
296
|
+
kind: e,
|
|
297
|
+
tag: t,
|
|
298
|
+
arguments: n,
|
|
299
|
+
raw: r
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function O(e, t, n, r) {
|
|
303
|
+
return {
|
|
304
|
+
type: "Quantifier",
|
|
305
|
+
kind: e,
|
|
306
|
+
min: t,
|
|
307
|
+
max: n,
|
|
308
|
+
raw: r
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function k(e) {
|
|
312
|
+
return {
|
|
313
|
+
type: "Subroutine",
|
|
314
|
+
raw: e
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
var A = /* @__PURE__ */ new Set([
|
|
318
|
+
"COUNT",
|
|
319
|
+
"CMP",
|
|
320
|
+
"ERROR",
|
|
321
|
+
"FAIL",
|
|
322
|
+
"MAX",
|
|
323
|
+
"MISMATCH",
|
|
324
|
+
"SKIP",
|
|
325
|
+
"TOTAL_COUNT"
|
|
326
|
+
]), j = /* @__PURE__ */ new Map([
|
|
327
|
+
["a", 7],
|
|
328
|
+
["b", 8],
|
|
329
|
+
["e", 27],
|
|
330
|
+
["f", 12],
|
|
331
|
+
["n", 10],
|
|
332
|
+
["r", 13],
|
|
333
|
+
["t", 9],
|
|
334
|
+
["v", 11]
|
|
335
|
+
]);
|
|
336
|
+
function M(e) {
|
|
337
|
+
let n = e[1] === "c" ? e[2] : e[3];
|
|
338
|
+
if (!n || !/[A-Za-z]/.test(n)) throw Error(`Unsupported control character "${e}"`);
|
|
339
|
+
return _(t(n.toUpperCase()) - 64, e);
|
|
340
|
+
}
|
|
341
|
+
function N(e, t) {
|
|
342
|
+
let { on: n, off: r } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
|
|
343
|
+
r ??= "";
|
|
344
|
+
let i = (t.getCurrentModX() || n.includes("x")) && !r.includes("x"), a = R(n), o = R(r), s = {};
|
|
345
|
+
if (a && (s.enable = a), o && (s.disable = o), e.endsWith(")")) return t.replaceCurrentModX(i), C("flags", e, { flags: s });
|
|
346
|
+
if (e.endsWith(":")) return t.pushModX(i), t.numOpenGroups++, E("group", e, { ...(a || o) && { flags: s } });
|
|
347
|
+
throw Error(`Unexpected flag modifier "${e}"`);
|
|
348
|
+
}
|
|
349
|
+
function P(e) {
|
|
350
|
+
let t = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
|
|
351
|
+
if (!t) throw Error(`Incomplete or invalid named callout "${e}"`);
|
|
352
|
+
let { name: n, tag: r, args: i } = t.groups;
|
|
353
|
+
if (!n) throw Error(`Invalid named callout "${e}"`);
|
|
354
|
+
if (r === "") throw Error(`Named callout tag with empty value not allowed "${e}"`);
|
|
355
|
+
let a = i ? i.split(",").filter((e) => e !== "").map((e) => /^[+-]?\d+$/.test(e) ? +e : e) : [], [o, s, c] = a, l = A.has(n) ? n.toLowerCase() : "custom";
|
|
356
|
+
switch (l) {
|
|
357
|
+
case "fail":
|
|
358
|
+
case "mismatch":
|
|
359
|
+
case "skip":
|
|
360
|
+
if (a.length > 0) throw Error(`Named callout arguments not allowed "${a}"`);
|
|
361
|
+
break;
|
|
362
|
+
case "error":
|
|
363
|
+
if (a.length > 1) throw Error(`Named callout allows only one argument "${a}"`);
|
|
364
|
+
if (typeof o == "string") throw Error(`Named callout argument must be a number "${o}"`);
|
|
365
|
+
break;
|
|
366
|
+
case "max":
|
|
367
|
+
if (!a.length || a.length > 2) throw Error(`Named callout must have one or two arguments "${a}"`);
|
|
368
|
+
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
369
|
+
if (a.length === 2 && (typeof s == "number" || !/^[<>X]$/.test(s))) throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);
|
|
370
|
+
break;
|
|
371
|
+
case "count":
|
|
372
|
+
case "total_count":
|
|
373
|
+
if (a.length > 1) throw Error(`Named callout allows only one argument "${a}"`);
|
|
374
|
+
if (a.length === 1 && (typeof o == "number" || !/^[<>X]$/.test(o))) throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);
|
|
375
|
+
break;
|
|
376
|
+
case "cmp":
|
|
377
|
+
if (a.length !== 3) throw Error(`Named callout must have three arguments "${a}"`);
|
|
378
|
+
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
379
|
+
if (typeof s == "number" || !/^(?:[<>!=]=|[<>])$/.test(s)) throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);
|
|
380
|
+
if (typeof c == "string" && !/^[A-Za-z_]\w*$/.test(c)) throw Error(`Named callout argument three must be a tag or number "${c}"`);
|
|
381
|
+
break;
|
|
382
|
+
case "custom": throw Error(`Undefined callout name "${n}"`);
|
|
383
|
+
default: throw Error(`Unexpected named callout kind "${l}"`);
|
|
384
|
+
}
|
|
385
|
+
return D(l, r ?? null, i?.split(",") ?? null, e);
|
|
386
|
+
}
|
|
387
|
+
function F(e) {
|
|
388
|
+
let t = null, n, r;
|
|
389
|
+
if (e[0] === "{") {
|
|
390
|
+
let { minStr: i, maxStr: a } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, o = 1e5;
|
|
391
|
+
if (+i > o || a && +a > o) throw Error("Quantifier value unsupported in Oniguruma");
|
|
392
|
+
if (n = +i, r = a === void 0 ? +i : a === "" ? Infinity : +a, n > r && (t = "possessive", [n, r] = [r, n]), e.endsWith("?")) {
|
|
393
|
+
if (t === "possessive") throw Error("Unsupported possessive interval quantifier chain with \"?\"");
|
|
394
|
+
t = "lazy";
|
|
395
|
+
} else t ||= "greedy";
|
|
396
|
+
} else n = +(e[0] === "+"), r = e[0] === "?" ? 1 : Infinity, t = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
|
|
397
|
+
return O(t, n, r, e);
|
|
398
|
+
}
|
|
399
|
+
function I(e) {
|
|
400
|
+
let t = e[1].toLowerCase();
|
|
401
|
+
return S({
|
|
402
|
+
d: "digit",
|
|
403
|
+
h: "hex",
|
|
404
|
+
s: "space",
|
|
405
|
+
w: "word"
|
|
406
|
+
}[t], e, { negate: e[1] !== t });
|
|
407
|
+
}
|
|
408
|
+
function L(e) {
|
|
409
|
+
let { p: t, neg: n, value: r } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
|
|
410
|
+
return S("property", e, {
|
|
411
|
+
value: r,
|
|
412
|
+
negate: t === "P" && !n || t === "p" && !!n
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
function R(e) {
|
|
416
|
+
let t = {};
|
|
417
|
+
return e.includes("i") && (t.ignoreCase = !0), e.includes("m") && (t.dotAll = !0), e.includes("x") && (t.extended = !0), Object.keys(t).length ? t : null;
|
|
418
|
+
}
|
|
419
|
+
function z(e) {
|
|
420
|
+
let t = {
|
|
421
|
+
ignoreCase: !1,
|
|
422
|
+
dotAll: !1,
|
|
423
|
+
extended: !1,
|
|
424
|
+
digitIsAscii: !1,
|
|
425
|
+
posixIsAscii: !1,
|
|
426
|
+
spaceIsAscii: !1,
|
|
427
|
+
wordIsAscii: !1,
|
|
428
|
+
textSegmentMode: null
|
|
429
|
+
};
|
|
430
|
+
for (let n = 0; n < e.length; n++) {
|
|
431
|
+
let r = e[n];
|
|
432
|
+
if (!"imxDPSWy".includes(r)) throw Error(`Invalid flag "${r}"`);
|
|
433
|
+
if (r === "y") {
|
|
434
|
+
if (!/^y{[gw]}/.test(e.slice(n))) throw Error("Invalid or unspecified flag \"y\" mode");
|
|
435
|
+
t.textSegmentMode = e[n + 2] === "g" ? "grapheme" : "word", n += 3;
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
t[{
|
|
439
|
+
i: "ignoreCase",
|
|
440
|
+
m: "dotAll",
|
|
441
|
+
x: "extended",
|
|
442
|
+
D: "digitIsAscii",
|
|
443
|
+
P: "posixIsAscii",
|
|
444
|
+
S: "spaceIsAscii",
|
|
445
|
+
W: "wordIsAscii"
|
|
446
|
+
}[r]] = !0;
|
|
447
|
+
}
|
|
448
|
+
return t;
|
|
449
|
+
}
|
|
450
|
+
function B(e) {
|
|
451
|
+
if (/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e)) throw Error(`Incomplete or invalid escape "${e}"`);
|
|
452
|
+
let t = e[2] === "{" ? /^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex : e.slice(2);
|
|
453
|
+
return parseInt(t, 16);
|
|
454
|
+
}
|
|
455
|
+
function V(e, r) {
|
|
456
|
+
let { raw: i, inCharClass: a } = e, o = i.slice(1);
|
|
457
|
+
if (!a && (o !== "0" && o.length === 1 || o[0] !== "0" && +o <= r)) return [g(i)];
|
|
458
|
+
let s = [], c = o.match(/^[0-7]+|\d/g);
|
|
459
|
+
for (let e = 0; e < c.length; e++) {
|
|
460
|
+
let r = c[e], a;
|
|
461
|
+
if (e === 0 && r !== "8" && r !== "9") {
|
|
462
|
+
if (a = parseInt(r, 8), a > 127) throw Error(n`Octal encoded byte above 177 unsupported "${i}"`);
|
|
463
|
+
} else a = t(r);
|
|
464
|
+
s.push(_(a, (e === 0 ? "\\" : "") + r));
|
|
465
|
+
}
|
|
466
|
+
return s;
|
|
467
|
+
}
|
|
468
|
+
function H(e) {
|
|
469
|
+
let t = [], n = new RegExp(o, "gy"), r;
|
|
470
|
+
for (; r = n.exec(e);) {
|
|
471
|
+
let e = r[0];
|
|
472
|
+
if (e[0] === "{") {
|
|
473
|
+
let r = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);
|
|
474
|
+
if (r) {
|
|
475
|
+
let { min: i, max: a } = r.groups;
|
|
476
|
+
if (+i > +a && e.endsWith("?")) {
|
|
477
|
+
n.lastIndex--, t.push(F(e.slice(0, -1)));
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
t.push(F(e));
|
|
483
|
+
}
|
|
484
|
+
return t;
|
|
485
|
+
}
|
|
486
|
+
//#endregion
|
|
487
|
+
export { l as tokenize };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { throwIfNullish as e } from "../utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js
|
|
3
|
+
function t(t, i, a = null) {
|
|
4
|
+
function o(e, t) {
|
|
5
|
+
for (let n = 0; n < e.length; n++) {
|
|
6
|
+
let r = s(e[n], t, n, e);
|
|
7
|
+
n = Math.max(-1, n + r);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function s(c, l = null, u = null, d = null) {
|
|
11
|
+
let f = 0, p = !1, m = {
|
|
12
|
+
node: c,
|
|
13
|
+
parent: l,
|
|
14
|
+
key: u,
|
|
15
|
+
container: d,
|
|
16
|
+
root: t,
|
|
17
|
+
remove() {
|
|
18
|
+
n(d).splice(Math.max(0, r(u) + f), 1), f--, p = !0;
|
|
19
|
+
},
|
|
20
|
+
removeAllNextSiblings() {
|
|
21
|
+
return n(d).splice(r(u) + 1);
|
|
22
|
+
},
|
|
23
|
+
removeAllPrevSiblings() {
|
|
24
|
+
let e = r(u) + f;
|
|
25
|
+
return f -= e, n(d).splice(0, Math.max(0, e));
|
|
26
|
+
},
|
|
27
|
+
replaceWith(t, n = {}) {
|
|
28
|
+
let i = !!n.traverse;
|
|
29
|
+
d ? d[Math.max(0, r(u) + f)] = t : e(l, "Can't replace root node")[u] = t, i && s(t, l, u, d), p = !0;
|
|
30
|
+
},
|
|
31
|
+
replaceWithMultiple(e, t = {}) {
|
|
32
|
+
let i = !!t.traverse;
|
|
33
|
+
if (n(d).splice(Math.max(0, r(u) + f), 1, ...e), f += e.length - 1, i) {
|
|
34
|
+
let t = 0;
|
|
35
|
+
for (let n = 0; n < e.length; n++) t += s(e[n], l, r(u) + n + t, d);
|
|
36
|
+
}
|
|
37
|
+
p = !0;
|
|
38
|
+
},
|
|
39
|
+
skip() {
|
|
40
|
+
p = !0;
|
|
41
|
+
}
|
|
42
|
+
}, { type: h } = c, g = i["*"], _ = i[h], v = typeof g == "function" ? g : g?.enter, y = typeof _ == "function" ? _ : _?.enter;
|
|
43
|
+
if (v?.(m, a), y?.(m, a), !p) switch (h) {
|
|
44
|
+
case "AbsenceFunction":
|
|
45
|
+
case "Alternative":
|
|
46
|
+
case "CapturingGroup":
|
|
47
|
+
case "CharacterClass":
|
|
48
|
+
case "Group":
|
|
49
|
+
case "LookaroundAssertion":
|
|
50
|
+
o(c.body, c);
|
|
51
|
+
break;
|
|
52
|
+
case "Assertion":
|
|
53
|
+
case "Backreference":
|
|
54
|
+
case "Character":
|
|
55
|
+
case "CharacterSet":
|
|
56
|
+
case "Directive":
|
|
57
|
+
case "Flags":
|
|
58
|
+
case "NamedCallout":
|
|
59
|
+
case "Subroutine": break;
|
|
60
|
+
case "CharacterClassRange":
|
|
61
|
+
s(c.min, c, "min"), s(c.max, c, "max");
|
|
62
|
+
break;
|
|
63
|
+
case "Quantifier":
|
|
64
|
+
s(c.body, c, "body");
|
|
65
|
+
break;
|
|
66
|
+
case "Regex":
|
|
67
|
+
o(c.body, c), s(c.flags, c, "flags");
|
|
68
|
+
break;
|
|
69
|
+
default: throw Error(`Unexpected node type "${h}"`);
|
|
70
|
+
}
|
|
71
|
+
return _?.exit?.(m, a), g?.exit?.(m, a), f;
|
|
72
|
+
}
|
|
73
|
+
return s(t), t;
|
|
74
|
+
}
|
|
75
|
+
function n(e) {
|
|
76
|
+
if (!Array.isArray(e)) throw Error("Container expected");
|
|
77
|
+
return e;
|
|
78
|
+
}
|
|
79
|
+
function r(e) {
|
|
80
|
+
if (typeof e != "number") throw Error("Numeric key expected");
|
|
81
|
+
return e;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { t as traverse };
|
package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
if ([...e].length !== 1) throw Error(`Expected "${e}" to be a single code point`);
|
|
4
|
+
return e.codePointAt(0);
|
|
5
|
+
}
|
|
6
|
+
function t(e, t, n) {
|
|
7
|
+
return e.has(t) || e.set(t, n), e.get(t);
|
|
8
|
+
}
|
|
9
|
+
var n = /* @__PURE__ */ new Set([
|
|
10
|
+
"alnum",
|
|
11
|
+
"alpha",
|
|
12
|
+
"ascii",
|
|
13
|
+
"blank",
|
|
14
|
+
"cntrl",
|
|
15
|
+
"digit",
|
|
16
|
+
"graph",
|
|
17
|
+
"lower",
|
|
18
|
+
"print",
|
|
19
|
+
"punct",
|
|
20
|
+
"space",
|
|
21
|
+
"upper",
|
|
22
|
+
"word",
|
|
23
|
+
"xdigit"
|
|
24
|
+
]), r = String.raw;
|
|
25
|
+
function i(e, t) {
|
|
26
|
+
if (e == null) throw Error(t ?? "Value expected");
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { n as PosixClassNames, e as cpOf, t as getOrInsert, r, i as throwIfNullish };
|