@septkit/ui 0.0.41 → 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.
Files changed (158) hide show
  1. package/dist/code/code-block.js +7 -0
  2. package/dist/code/code-block.vue_vue_type_script_setup_true_lang.js +63 -0
  3. package/dist/code/diff.js +35 -0
  4. package/dist/code/highlight.js +30 -0
  5. package/dist/code/index.js +5 -0
  6. package/dist/code/xml-diff.js +5 -0
  7. package/dist/code/xml-diff.vue_vue_type_script_setup_true_lang.js +33 -0
  8. package/dist/dialecte/composables/index.js +2 -1
  9. package/dist/dialecte/composables/use-active-document.js +24 -0
  10. package/dist/dialecte/create-document-store.js +3 -3
  11. package/dist/dialecte/index.js +2 -1
  12. package/dist/dialog/dialog-host.js +5 -0
  13. package/dist/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +33 -0
  14. package/dist/dialog/dialog.js +5 -0
  15. package/dist/dialog/dialog.vue_vue_type_script_setup_true_lang.js +72 -0
  16. package/dist/dialog/index.js +4 -0
  17. package/dist/dialog/use-dialog-host.js +32 -0
  18. package/dist/explorer/collect-expandable-node-ids.js +8 -0
  19. package/dist/explorer/explorer.js +1 -1
  20. package/dist/explorer/explorer.vue_vue_type_script_setup_true_lang.js +47 -33
  21. package/dist/explorer/index.js +3 -2
  22. package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/helpers.js +142 -0
  23. package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/index.js +3 -0
  24. 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
  25. 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
  26. package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/hooks-BTkrNj6r.js +25264 -0
  27. package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
  28. 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
  29. 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
  30. 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
  31. 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
  32. package/dist/external/.pnpm/@shikijs_core@3.23.0/node_modules/@shikijs/core/dist/index.js +1299 -0
  33. package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.js +34 -0
  34. package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.js +66 -0
  35. package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/java.js +3 -0
  36. package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/xml.js +5 -0
  37. package/dist/external/.pnpm/@shikijs_themes@3.23.0/node_modules/@shikijs/themes/dist/github-dark.js +4 -0
  38. package/dist/external/.pnpm/@shikijs_types@3.23.0/node_modules/@shikijs/types/dist/index.js +8 -0
  39. package/dist/external/.pnpm/@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.js +1576 -0
  40. 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
  41. 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
  42. package/dist/external/.pnpm/ccount@2.0.1/node_modules/ccount/index.js +10 -0
  43. package/dist/external/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js +257 -0
  44. package/dist/external/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js +4 -0
  45. package/dist/external/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js +7 -0
  46. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.js +11 -0
  47. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.js +6 -0
  48. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.js +49 -0
  49. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.js +28 -0
  50. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.js +7 -0
  51. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.js +6 -0
  52. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.js +8 -0
  53. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js +48 -0
  54. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.js +86 -0
  55. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.js +10 -0
  56. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.js +39 -0
  57. package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.js +13 -0
  58. package/dist/external/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js +10 -0
  59. package/dist/external/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js +25 -0
  60. package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js +23 -0
  61. package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js +419 -0
  62. package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +487 -0
  63. package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js +84 -0
  64. package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js +30 -0
  65. package/dist/external/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js +970 -0
  66. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/index.js +25 -0
  67. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js +61 -0
  68. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js +31 -0
  69. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js +326 -0
  70. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js +6 -0
  71. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js +564 -0
  72. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
  73. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
  74. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js +14 -0
  75. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js +18 -0
  76. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js +9 -0
  77. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js +9 -0
  78. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js +9 -0
  79. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js +16 -0
  80. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js +19 -0
  81. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js +15 -0
  82. package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js +14 -0
  83. package/dist/external/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js +110 -0
  84. package/dist/external/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js +56 -0
  85. package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js +94 -0
  86. package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/internals.js +2 -0
  87. package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js +10 -0
  88. 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
  89. 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
  90. 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
  91. 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
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. 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
  121. 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
  122. 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
  123. 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
  124. 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
  125. 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
  126. 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
  127. package/dist/external/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js +6 -0
  128. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.js +13 -0
  129. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.js +23 -0
  130. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.js +8 -0
  131. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.js +14 -0
  132. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.js +8 -0
  133. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.js +8 -0
  134. package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js +17 -0
  135. package/dist/external/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js +16 -0
  136. package/dist/index.d.ts +422 -4
  137. package/dist/index.js +24 -7
  138. package/dist/merge/build-view-model.js +168 -0
  139. package/dist/merge/decision-toggle.js +5 -0
  140. package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +40 -0
  141. package/dist/merge/element-detail.js +5 -0
  142. package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +53 -0
  143. package/dist/merge/index.js +6 -0
  144. package/dist/merge/merge-progress.js +5 -0
  145. package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +31 -0
  146. package/dist/merge/merge-review.js +5 -0
  147. package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +305 -0
  148. package/dist/merge/merge-summary.js +5 -0
  149. package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +76 -0
  150. package/dist/merge/merge-tree.js +5 -0
  151. package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +86 -0
  152. package/dist/merge/merge.service.js +69 -0
  153. package/dist/merge/use-document-progress.js +27 -0
  154. package/dist/merge/use-merge-session.js +151 -0
  155. package/dist/ui.css +1 -1
  156. package/package.json +4 -2
  157. package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/helpers.js +0 -13
  158. package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/index.js +0 -3
@@ -0,0 +1,419 @@
1
+ import { PosixClassNames as e, cpOf as t, getOrInsert as n, r, throwIfNullish as i } from "../utils.js";
2
+ import { tokenize as a } from "../tokenizer/tokenize.js";
3
+ import { hasOnlyChild as o, isQuantifiable as s } from "./node-utils.js";
4
+ //#region node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js
5
+ function c(e, t = {}) {
6
+ let n = {
7
+ flags: "",
8
+ normalizeUnknownPropertyNames: !1,
9
+ skipBackrefValidation: !1,
10
+ skipLookbehindValidation: !1,
11
+ skipPropertyNameValidation: !1,
12
+ unicodePropertyMap: null,
13
+ ...t,
14
+ rules: {
15
+ captureGroup: !1,
16
+ singleline: !1,
17
+ ...t.rules
18
+ }
19
+ }, i = a(e, {
20
+ flags: n.flags,
21
+ rules: {
22
+ captureGroup: n.rules.captureGroup,
23
+ singleline: n.rules.singleline
24
+ }
25
+ }), o = (e, t) => {
26
+ let n = i.tokens[s.nextIndex];
27
+ switch (s.parent = e, s.nextIndex++, n.type) {
28
+ case "Alternator": return v();
29
+ case "Assertion": return l(n);
30
+ case "Backreference": return u(n, s);
31
+ case "Character": return S(n.value, { useLastValid: !!t.isCheckingRangeEnd });
32
+ case "CharacterClassHyphen": return d(n, s, t);
33
+ case "CharacterClassOpen": return f(n, s, t);
34
+ case "CharacterSet": return p(n, s);
35
+ case "Directive": return E(n.kind, { flags: n.flags });
36
+ case "GroupOpen": return m(n, s, t);
37
+ case "NamedCallout": return A(n.kind, n.tag, n.arguments);
38
+ case "Quantifier": return h(n, s);
39
+ case "Subroutine": return g(n, s);
40
+ default: throw Error(`Unexpected token type "${n.type}"`);
41
+ }
42
+ }, s = {
43
+ capturingGroups: [],
44
+ hasNumberedRef: !1,
45
+ namedGroupsByName: /* @__PURE__ */ new Map(),
46
+ nextIndex: 0,
47
+ normalizeUnknownPropertyNames: n.normalizeUnknownPropertyNames,
48
+ parent: null,
49
+ skipBackrefValidation: n.skipBackrefValidation,
50
+ skipLookbehindValidation: n.skipLookbehindValidation,
51
+ skipPropertyNameValidation: n.skipPropertyNameValidation,
52
+ subroutines: [],
53
+ tokens: i.tokens,
54
+ unicodePropertyMap: n.unicodePropertyMap,
55
+ walk: o
56
+ }, c = N(D(i.flags)), _ = c.body[0];
57
+ for (; s.nextIndex < i.tokens.length;) {
58
+ let e = o(_, {});
59
+ e.type === "Alternative" ? (c.body.push(e), _ = e) : _.body.push(e);
60
+ }
61
+ let { capturingGroups: y, hasNumberedRef: b, namedGroupsByName: x, subroutines: C } = s;
62
+ if (b && x.size && !n.rules.captureGroup) throw Error("Numbered backref/subroutine not allowed when using named capture");
63
+ for (let { ref: e } of C) if (typeof e == "number") {
64
+ if (e > y.length) throw Error("Subroutine uses a group number that's not defined");
65
+ e && (y[e - 1].isSubroutined = !0);
66
+ } else if (x.has(e)) {
67
+ if (x.get(e).length > 1) throw Error(r`Subroutine uses a duplicate group name "\g<${e}>"`);
68
+ x.get(e)[0].isSubroutined = !0;
69
+ } else throw Error(r`Subroutine uses a group name that's not defined "\g<${e}>"`);
70
+ return c;
71
+ }
72
+ function l({ kind: e }) {
73
+ return y(i({
74
+ "^": "line_start",
75
+ $: "line_end",
76
+ "\\A": "string_start",
77
+ "\\b": "word_boundary",
78
+ "\\B": "word_boundary",
79
+ "\\G": "search_start",
80
+ "\\y": "text_segment_boundary",
81
+ "\\Y": "text_segment_boundary",
82
+ "\\z": "string_end",
83
+ "\\Z": "string_end_newline"
84
+ }[e], `Unexpected assertion kind "${e}"`), { negate: e === r`\B` || e === r`\Y` });
85
+ }
86
+ function u({ raw: e }, t) {
87
+ let n = /^\\k[<']/.test(e), r = n ? e.slice(3, -1) : e.slice(1), i = (n, r = !1) => {
88
+ let i = t.capturingGroups.length, a = !1;
89
+ if (n > i) if (t.skipBackrefValidation) a = !0;
90
+ else throw Error(`Not enough capturing groups defined to the left "${e}"`);
91
+ return t.hasNumberedRef = !0, b(r ? i + 1 - n : n, { orphan: a });
92
+ };
93
+ if (n) {
94
+ let n = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);
95
+ if (n) return i(+n.groups.num, !!n.groups.sign);
96
+ if (/[-+]/.test(r)) throw Error(`Invalid backref name "${e}"`);
97
+ if (!t.namedGroupsByName.has(r)) throw Error(`Group name not defined to the left "${e}"`);
98
+ return b(r);
99
+ }
100
+ return i(+r);
101
+ }
102
+ function d(e, n, r) {
103
+ let { tokens: i, walk: a } = n, o = n.parent, s = o.body.at(-1), c = i[n.nextIndex];
104
+ if (!r.isCheckingRangeEnd && s && s.type !== "CharacterClass" && s.type !== "CharacterClassRange" && c && c.type !== "CharacterClassOpen" && c.type !== "CharacterClassClose" && c.type !== "CharacterClassIntersector") {
105
+ let e = a(o, {
106
+ ...r,
107
+ isCheckingRangeEnd: !0
108
+ });
109
+ if (s.type === "Character" && e.type === "Character") return o.body.pop(), w(s, e);
110
+ throw Error("Invalid character class range");
111
+ }
112
+ return S(t("-"));
113
+ }
114
+ function f({ negate: e }, t, n) {
115
+ let { tokens: r, walk: i } = t, a = [C()], o = r[t.nextIndex], s = W(o);
116
+ for (; s.type !== "CharacterClassClose";) {
117
+ if (s.type === "CharacterClassIntersector") a.push(C()), t.nextIndex++;
118
+ else {
119
+ let e = a.at(-1);
120
+ e.body.push(i(e, n));
121
+ }
122
+ s = W(r[t.nextIndex], o);
123
+ }
124
+ let c = C({ negate: e });
125
+ return a.length === 1 ? c.body = a[0].body : (c.kind = "intersection", c.body = a.map((e) => e.body.length === 1 ? e.body[0] : e)), t.nextIndex++, c;
126
+ }
127
+ function p({ kind: t, negate: n, value: r }, i) {
128
+ let { normalizeUnknownPropertyNames: a, skipPropertyNameValidation: o, unicodePropertyMap: s } = i;
129
+ if (t === "property") {
130
+ let i = U(r);
131
+ if (e.has(i) && !s?.has(i)) t = "posix", r = i;
132
+ else return F(r, {
133
+ negate: n,
134
+ normalizeUnknownPropertyNames: a,
135
+ skipPropertyNameValidation: o,
136
+ unicodePropertyMap: s
137
+ });
138
+ }
139
+ return t === "posix" ? j(r, { negate: n }) : T(t, { negate: n });
140
+ }
141
+ function m(e, t, r) {
142
+ let { tokens: i, capturingGroups: a, namedGroupsByName: o, skipLookbehindValidation: s, walk: c } = t, l = I(e), u = l.type === "AbsenceFunction", d = B(l), f = d && l.negate;
143
+ if (l.type === "CapturingGroup" && (a.push(l), l.name && n(o, l.name, []).push(l)), u && r.isInAbsenceFunction) throw Error("Nested absence function not supported by Oniguruma");
144
+ let p = G(i[t.nextIndex]);
145
+ for (; p.type !== "GroupClose";) {
146
+ if (p.type === "Alternator") l.body.push(v()), t.nextIndex++;
147
+ else {
148
+ let e = l.body.at(-1), t = c(e, {
149
+ ...r,
150
+ isInAbsenceFunction: r.isInAbsenceFunction || u,
151
+ isInLookbehind: r.isInLookbehind || d,
152
+ isInNegLookbehind: r.isInNegLookbehind || f
153
+ });
154
+ if (e.body.push(t), (d || r.isInLookbehind) && !s) {
155
+ let e = "Lookbehind includes a pattern not allowed by Oniguruma";
156
+ if (f || r.isInNegLookbehind) {
157
+ if (z(t) || t.type === "CapturingGroup") throw Error(e);
158
+ } else if (z(t) || B(t) && t.negate) throw Error(e);
159
+ }
160
+ }
161
+ p = G(i[t.nextIndex]);
162
+ }
163
+ return t.nextIndex++, l;
164
+ }
165
+ function h({ kind: e, min: t, max: n }, r) {
166
+ let i = r.parent, a = i.body.at(-1);
167
+ if (!a || !s(a)) throw Error("Quantifier requires a repeatable token");
168
+ let o = M(e, t, n, a);
169
+ return i.body.pop(), o;
170
+ }
171
+ function g({ raw: e }, t) {
172
+ let { capturingGroups: n, subroutines: r } = t, i = e.slice(3, -1), a = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);
173
+ if (a) {
174
+ let e = +a.groups.num, r = n.length;
175
+ if (t.hasNumberedRef = !0, i = {
176
+ "": e,
177
+ "+": r + e,
178
+ "-": r + 1 - e
179
+ }[a.groups.sign], i < 1) throw Error("Invalid subroutine number");
180
+ } else i === "0" && (i = 0);
181
+ let o = P(i);
182
+ return r.push(o), o;
183
+ }
184
+ function _(e, t) {
185
+ if (e !== "repeater") throw Error(`Unexpected absence function kind "${e}"`);
186
+ return {
187
+ type: "AbsenceFunction",
188
+ kind: e,
189
+ body: L(t?.body)
190
+ };
191
+ }
192
+ function v(e) {
193
+ return {
194
+ type: "Alternative",
195
+ body: R(e?.body)
196
+ };
197
+ }
198
+ function y(e, t) {
199
+ let n = {
200
+ type: "Assertion",
201
+ kind: e
202
+ };
203
+ return (e === "word_boundary" || e === "text_segment_boundary") && (n.negate = !!t?.negate), n;
204
+ }
205
+ function b(e, t) {
206
+ let n = !!t?.orphan;
207
+ return {
208
+ type: "Backreference",
209
+ ref: e,
210
+ ...n && { orphan: n }
211
+ };
212
+ }
213
+ function x(e, t) {
214
+ let n = {
215
+ name: void 0,
216
+ isSubroutined: !1,
217
+ ...t
218
+ };
219
+ if (n.name !== void 0 && !V(n.name)) throw Error(`Group name "${n.name}" invalid in Oniguruma`);
220
+ return {
221
+ type: "CapturingGroup",
222
+ number: e,
223
+ ...n.name && { name: n.name },
224
+ ...n.isSubroutined && { isSubroutined: n.isSubroutined },
225
+ body: L(t?.body)
226
+ };
227
+ }
228
+ function S(e, t) {
229
+ let n = {
230
+ useLastValid: !1,
231
+ ...t
232
+ };
233
+ if (e > 1114111) {
234
+ let t = e.toString(16);
235
+ if (n.useLastValid) e = 1114111;
236
+ else throw Error(e > 1310719 ? `Invalid code point out of range "\\x{${t}}"` : `Invalid code point out of range in JS "\\x{${t}}"`);
237
+ }
238
+ return {
239
+ type: "Character",
240
+ value: e
241
+ };
242
+ }
243
+ function C(e) {
244
+ let t = {
245
+ kind: "union",
246
+ negate: !1,
247
+ ...e
248
+ };
249
+ return {
250
+ type: "CharacterClass",
251
+ kind: t.kind,
252
+ negate: t.negate,
253
+ body: R(e?.body)
254
+ };
255
+ }
256
+ function w(e, t) {
257
+ if (t.value < e.value) throw Error("Character class range out of order");
258
+ return {
259
+ type: "CharacterClassRange",
260
+ min: e,
261
+ max: t
262
+ };
263
+ }
264
+ function T(e, t) {
265
+ let n = !!t?.negate, r = {
266
+ type: "CharacterSet",
267
+ kind: e
268
+ };
269
+ return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (r.negate = n), (e === "text_segment" || e === "newline" && !n) && (r.variableLength = !0), r;
270
+ }
271
+ function E(e, t = {}) {
272
+ if (e === "keep") return {
273
+ type: "Directive",
274
+ kind: e
275
+ };
276
+ if (e === "flags") return {
277
+ type: "Directive",
278
+ kind: e,
279
+ flags: i(t.flags)
280
+ };
281
+ throw Error(`Unexpected directive kind "${e}"`);
282
+ }
283
+ function D(e) {
284
+ return {
285
+ type: "Flags",
286
+ ...e
287
+ };
288
+ }
289
+ function O(e) {
290
+ let t = e?.atomic, n = e?.flags;
291
+ if (t && n) throw Error("Atomic group cannot have flags");
292
+ return {
293
+ type: "Group",
294
+ ...t && { atomic: t },
295
+ ...n && { flags: n },
296
+ body: L(e?.body)
297
+ };
298
+ }
299
+ function k(e) {
300
+ let t = {
301
+ behind: !1,
302
+ negate: !1,
303
+ ...e
304
+ };
305
+ return {
306
+ type: "LookaroundAssertion",
307
+ kind: t.behind ? "lookbehind" : "lookahead",
308
+ negate: t.negate,
309
+ body: L(e?.body)
310
+ };
311
+ }
312
+ function A(e, t, n) {
313
+ return {
314
+ type: "NamedCallout",
315
+ kind: e,
316
+ tag: t,
317
+ arguments: n
318
+ };
319
+ }
320
+ function j(t, n) {
321
+ let r = !!n?.negate;
322
+ if (!e.has(t)) throw Error(`Invalid POSIX class "${t}"`);
323
+ return {
324
+ type: "CharacterSet",
325
+ kind: "posix",
326
+ value: t,
327
+ negate: r
328
+ };
329
+ }
330
+ function M(e, t, n, r) {
331
+ if (t > n) throw Error("Invalid reversed quantifier range");
332
+ return {
333
+ type: "Quantifier",
334
+ kind: e,
335
+ min: t,
336
+ max: n,
337
+ body: r
338
+ };
339
+ }
340
+ function N(e, t) {
341
+ return {
342
+ type: "Regex",
343
+ body: L(t?.body),
344
+ flags: e
345
+ };
346
+ }
347
+ function P(e) {
348
+ return {
349
+ type: "Subroutine",
350
+ ref: e
351
+ };
352
+ }
353
+ function F(e, t) {
354
+ let n = {
355
+ negate: !1,
356
+ normalizeUnknownPropertyNames: !1,
357
+ skipPropertyNameValidation: !1,
358
+ unicodePropertyMap: null,
359
+ ...t
360
+ }, i = n.unicodePropertyMap?.get(U(e));
361
+ if (!i) {
362
+ if (n.normalizeUnknownPropertyNames) i = H(e);
363
+ else if (n.unicodePropertyMap && !n.skipPropertyNameValidation) throw Error(r`Invalid Unicode property "\p{${e}}"`);
364
+ }
365
+ return {
366
+ type: "CharacterSet",
367
+ kind: "property",
368
+ value: i ?? e,
369
+ negate: n.negate
370
+ };
371
+ }
372
+ function I({ flags: e, kind: t, name: n, negate: r, number: i }) {
373
+ switch (t) {
374
+ case "absence_repeater": return _("repeater");
375
+ case "atomic": return O({ atomic: !0 });
376
+ case "capturing": return x(i, { name: n });
377
+ case "group": return O({ flags: e });
378
+ case "lookahead":
379
+ case "lookbehind": return k({
380
+ behind: t === "lookbehind",
381
+ negate: r
382
+ });
383
+ default: throw Error(`Unexpected group kind "${t}"`);
384
+ }
385
+ }
386
+ function L(e) {
387
+ if (e === void 0) e = [v()];
388
+ else if (!Array.isArray(e) || !e.length || !e.every((e) => e.type === "Alternative")) throw Error("Invalid body; expected array of one or more Alternative nodes");
389
+ return e;
390
+ }
391
+ function R(e) {
392
+ if (e === void 0) e = [];
393
+ else if (!Array.isArray(e) || !e.every((e) => !!e.type)) throw Error("Invalid body; expected array of nodes");
394
+ return e;
395
+ }
396
+ function z(e) {
397
+ return e.type === "LookaroundAssertion" && e.kind === "lookahead";
398
+ }
399
+ function B(e) {
400
+ return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
401
+ }
402
+ function V(e) {
403
+ return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
404
+ }
405
+ function H(e) {
406
+ return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (e) => e[0].toUpperCase() + e.slice(1).toLowerCase());
407
+ }
408
+ function U(e) {
409
+ return e.replace(/[- _]+/g, "").toLowerCase();
410
+ }
411
+ function W(e, t) {
412
+ let n = t;
413
+ return i(e, `Unclosed character class${n?.type === "Character" && n.value === 93 && n.raw === "]" ? " (started with \"]\")" : ""}`);
414
+ }
415
+ function G(e) {
416
+ return i(e, "Unclosed group");
417
+ }
418
+ //#endregion
419
+ export { _ as createAbsenceFunction, v as createAlternative, y as createAssertion, b as createBackreference, x as createCapturingGroup, S as createCharacter, C as createCharacterClass, w as createCharacterClassRange, T as createCharacterSet, E as createDirective, D as createFlags, O as createGroup, k as createLookaroundAssertion, A as createNamedCallout, j as createPosixClass, M as createQuantifier, N as createRegex, P as createSubroutine, F as createUnicodeProperty, o as hasOnlyChild, s as isQuantifiable, c as parse, U as slug };