@speclynx/apidom-json-pointer-relative 2.13.1 → 3.1.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.1.0](https://github.com/speclynx/apidom/compare/v3.0.0...v3.1.0) (2026-03-08)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-json-pointer-relative
9
+
10
+ # [3.0.0](https://github.com/speclynx/apidom/compare/v2.13.1...v3.0.0) (2026-03-05)
11
+
12
+ ### Features
13
+
14
+ - introduce new memory efficient meta data management ([#129](https://github.com/speclynx/apidom/issues/129)) ([82ae0d7](https://github.com/speclynx/apidom/commit/82ae0d7cc2e9ee7037c3d9681817add2ca18dc92))
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ - meta data use to be elements before, now they are simple primitives
19
+
6
20
  ## [2.13.1](https://github.com/speclynx/apidom/compare/v2.13.0...v2.13.1) (2026-02-28)
7
21
 
8
22
  **Note:** Version bump only for package @speclynx/apidom-json-pointer-relative
@@ -12859,6 +12859,104 @@ class KeyValuePair {
12859
12859
 
12860
12860
  /***/ },
12861
12861
 
12862
+ /***/ 1844
12863
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12864
+
12865
+ __webpack_require__.r(__webpack_exports__);
12866
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12867
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12868
+ /* harmony export */ });
12869
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
12870
+
12871
+ /**
12872
+ * Lightweight meta container for Element metadata.
12873
+ *
12874
+ * Data is stored as own properties on the instance; methods live on the prototype.
12875
+ * `Object.keys()`, `Object.entries()`, etc. only see data properties.
12876
+ *
12877
+ * @public
12878
+ */
12879
+ class Metadata {
12880
+ // Set via prototype assignment in registration.ts to avoid circular dependency
12881
+
12882
+ get(name) {
12883
+ return this[name];
12884
+ }
12885
+ set(name, value) {
12886
+ this[name] = value;
12887
+ }
12888
+ hasKey(name) {
12889
+ return Object.hasOwn(this, name);
12890
+ }
12891
+ keys() {
12892
+ return Object.keys(this);
12893
+ }
12894
+ remove(name) {
12895
+ delete this[name];
12896
+ }
12897
+ get isEmpty() {
12898
+ return Object.keys(this).length === 0;
12899
+ }
12900
+ get isFrozen() {
12901
+ return Object.isFrozen(this);
12902
+ }
12903
+ freeze() {
12904
+ for (const value of Object.values(this)) {
12905
+ if (value instanceof this.Element) {
12906
+ value.freeze();
12907
+ } else if (Array.isArray(value) || value !== null && typeof value === 'object') {
12908
+ Object.freeze(value);
12909
+ }
12910
+ }
12911
+ Object.freeze(this);
12912
+ }
12913
+
12914
+ /**
12915
+ * Creates a shallow clone. Same references, new container.
12916
+ */
12917
+ cloneShallow() {
12918
+ const clone = new Metadata();
12919
+ Object.assign(clone, this);
12920
+ return clone;
12921
+ }
12922
+
12923
+ /**
12924
+ * Merges another Metadata into a new instance.
12925
+ * Arrays are concatenated, all other values are overwritten by source.
12926
+ */
12927
+ merge(source) {
12928
+ const result = this.cloneShallow();
12929
+ for (const [key, value] of Object.entries(source)) {
12930
+ const existing = result.get(key);
12931
+ if (Array.isArray(existing) && Array.isArray(value)) {
12932
+ result.set(key, [...existing, ...value]);
12933
+ } else {
12934
+ result.set(key, value);
12935
+ }
12936
+ }
12937
+ return result;
12938
+ }
12939
+
12940
+ /**
12941
+ * Creates a deep clone. Elements are deep cloned,
12942
+ * all other values are deep cloned via ramda clone.
12943
+ */
12944
+ cloneDeep() {
12945
+ const copy = new Metadata();
12946
+ for (const [key, value] of Object.entries(this)) {
12947
+ if (value instanceof this.Element) {
12948
+ copy.set(key, this.cloneDeepElement(value));
12949
+ } else {
12950
+ copy.set(key, (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(value));
12951
+ }
12952
+ }
12953
+ return copy;
12954
+ }
12955
+ }
12956
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Metadata);
12957
+
12958
+ /***/ },
12959
+
12862
12960
  /***/ 8504
12863
12961
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12864
12962
 
@@ -13270,7 +13368,7 @@ const cloneShallowElement = element => {
13270
13368
  const copy = new Ctor();
13271
13369
  copy.element = element.element;
13272
13370
  if (!element.isMetaEmpty) {
13273
- copy.meta = cloneDeep(element.meta);
13371
+ copy.meta = element.meta.cloneDeep();
13274
13372
  }
13275
13373
  if (!element.isAttributesEmpty) {
13276
13374
  copy.attributes = cloneDeep(element.attributes);
@@ -13298,8 +13396,8 @@ const cloneShallowElement = element => {
13298
13396
 
13299
13397
  /**
13300
13398
  * Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
13301
- * The element itself is cloned, but content references are shared (except for
13302
- * meta and attributes which are deep cloned to preserve semantic information).
13399
+ * The element itself is cloned, but content references are shared.
13400
+ * Meta and attributes are deep cloned to preserve semantic information.
13303
13401
  * @public
13304
13402
  */
13305
13403
  const cloneShallow = value => {
@@ -14302,7 +14400,7 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
14302
14400
  * Search the tree recursively and find the element with the matching ID.
14303
14401
  */
14304
14402
  getById(id) {
14305
- return this.find(item => item.id.toValue() === id).first;
14403
+ return this.find(item => item.id === id).first;
14306
14404
  }
14307
14405
 
14308
14406
  /**
@@ -14331,18 +14429,24 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
14331
14429
 
14332
14430
  __webpack_require__.r(__webpack_exports__);
14333
14431
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14432
+ /* harmony export */ Metadata: () => (/* reexport safe */ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
14334
14433
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14335
14434
  /* harmony export */ });
14336
14435
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);
14337
- /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6663);
14338
- /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8504);
14436
+ /* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1844);
14437
+ /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6663);
14438
+ /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8504);
14439
+
14339
14440
 
14340
14441
 
14442
+ // shared singleton for frozen elements with no meta — avoids allocation on every access
14443
+ const FROZEN_EMPTY_METADATA = Object.freeze(new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]());
14341
14444
 
14342
14445
  /**
14343
14446
  * Valid content types for an Element.
14344
14447
  * @public
14345
14448
  */
14449
+
14346
14450
  /**
14347
14451
  * Base Element class that all ApiDOM elements extend.
14348
14452
  *
@@ -14440,7 +14544,7 @@ class Element {
14440
14544
  _attributes;
14441
14545
 
14442
14546
  // ============================================================
14443
- // Prototype-assigned properties (set in elements.ts)
14547
+ // Prototype-assigned properties (set in registration.ts)
14444
14548
  // Using 'declare' allows TypeScript to know about these
14445
14549
  // without generating runtime code.
14446
14550
  // ============================================================
@@ -14501,13 +14605,13 @@ class Element {
14501
14605
  }
14502
14606
 
14503
14607
  // KeyValuePair
14504
- if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
14608
+ if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
14505
14609
  this._content = value;
14506
14610
  return;
14507
14611
  }
14508
14612
 
14509
14613
  // ObjectSlice - extract elements array
14510
- if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
14614
+ if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
14511
14615
  this._content = value.elements;
14512
14616
  return;
14513
14617
  }
@@ -14528,24 +14632,22 @@ class Element {
14528
14632
 
14529
14633
  /**
14530
14634
  * Metadata about this element (id, classes, title, description, links).
14531
- * Lazily creates an ObjectElement if not set.
14635
+ * Lazily creates a Metadata instance if not set.
14532
14636
  */
14533
14637
  get meta() {
14534
14638
  if (!this._meta) {
14535
- if (this.isFrozen) {
14536
- const meta = new this.ObjectElement();
14537
- meta.freeze();
14538
- return meta;
14539
- }
14540
- this._meta = new this.ObjectElement();
14639
+ if (this.isFrozen) return FROZEN_EMPTY_METADATA;
14640
+ this._meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
14541
14641
  }
14542
14642
  return this._meta;
14543
14643
  }
14544
14644
  set meta(value) {
14545
- if (value instanceof Element) {
14645
+ if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
14546
14646
  this._meta = value;
14547
- } else {
14548
- this.meta.set(value ?? {});
14647
+ } else if (value && typeof value === 'object') {
14648
+ const meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
14649
+ Object.assign(meta, value);
14650
+ this._meta = meta;
14549
14651
  }
14550
14652
  }
14551
14653
 
@@ -14578,10 +14680,8 @@ class Element {
14578
14680
 
14579
14681
  /** Unique identifier for this element. */
14580
14682
  get id() {
14581
- if (this.isFrozen) {
14582
- return this.getMetaProperty('id', '');
14583
- }
14584
14683
  if (!this.hasMetaProperty('id')) {
14684
+ if (this.isFrozen) return '';
14585
14685
  this.setMetaProperty('id', '');
14586
14686
  }
14587
14687
  return this.meta.get('id');
@@ -14592,10 +14692,8 @@ class Element {
14592
14692
 
14593
14693
  /** CSS-like class names. */
14594
14694
  get classes() {
14595
- if (this.isFrozen) {
14596
- return this.getMetaProperty('classes', []);
14597
- }
14598
14695
  if (!this.hasMetaProperty('classes')) {
14696
+ if (this.isFrozen) return [];
14599
14697
  this.setMetaProperty('classes', []);
14600
14698
  }
14601
14699
  return this.meta.get('classes');
@@ -14606,11 +14704,13 @@ class Element {
14606
14704
 
14607
14705
  /** Hyperlinks associated with this element. */
14608
14706
  get links() {
14609
- if (this.isFrozen) {
14610
- return this.getMetaProperty('links', []);
14611
- }
14612
14707
  if (!this.hasMetaProperty('links')) {
14613
- this.setMetaProperty('links', []);
14708
+ if (this.isFrozen) {
14709
+ const empty = new this.ArrayElement();
14710
+ empty.freeze();
14711
+ return empty;
14712
+ }
14713
+ this.setMetaProperty('links', new this.ArrayElement());
14614
14714
  }
14615
14715
  return this.meta.get('links');
14616
14716
  }
@@ -14630,7 +14730,7 @@ class Element {
14630
14730
  if (Array.isArray(content)) {
14631
14731
  return content;
14632
14732
  }
14633
- if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
14733
+ if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
14634
14734
  const children = [];
14635
14735
  if (content.key) children.push(content.key);
14636
14736
  if (content.value) children.push(content.value);
@@ -14660,7 +14760,6 @@ class Element {
14660
14760
 
14661
14761
  // Freeze meta and attributes
14662
14762
  if (this._meta) {
14663
- this._meta.parent = this;
14664
14763
  this._meta.freeze();
14665
14764
  }
14666
14765
  if (this._attributes) {
@@ -14695,7 +14794,7 @@ class Element {
14695
14794
  if (_content instanceof Element) {
14696
14795
  return _content.toValue();
14697
14796
  }
14698
- if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
14797
+ if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
14699
14798
  return _content.toValue();
14700
14799
  }
14701
14800
  if (Array.isArray(_content)) {
@@ -14751,7 +14850,7 @@ class Element {
14751
14850
  * @throws Error if this element has no ID
14752
14851
  */
14753
14852
  toRef(path) {
14754
- const idValue = this.id.toValue();
14853
+ const idValue = this.id;
14755
14854
  if (idValue === '') {
14756
14855
  throw new Error('Cannot create reference to an element without an ID');
14757
14856
  }
@@ -14763,26 +14862,16 @@ class Element {
14763
14862
  }
14764
14863
 
14765
14864
  /**
14766
- * Gets a meta property.
14865
+ * Gets a meta property value.
14767
14866
  *
14768
14867
  * When the property doesn't exist:
14769
- * - With defaultValue: returns a new refracted element instance (not cached)
14868
+ * - With defaultValue: returns the provided default value
14770
14869
  * - Without defaultValue: returns undefined
14771
- *
14772
- * Note: Each call with a default creates a new instance. Use setMetaProperty
14773
- * first if you need reference equality across multiple accesses.
14774
14870
  */
14775
14871
 
14776
14872
  getMetaProperty(name, defaultValue) {
14777
14873
  if (!this.hasMetaProperty(name)) {
14778
- if (defaultValue === undefined) {
14779
- return undefined;
14780
- }
14781
- const element = this.refract(defaultValue);
14782
- if (element && this.isFrozen) {
14783
- element.freeze();
14784
- }
14785
- return element;
14874
+ return defaultValue;
14786
14875
  }
14787
14876
  return this.meta.get(name);
14788
14877
  }
@@ -14795,20 +14884,17 @@ class Element {
14795
14884
  }
14796
14885
 
14797
14886
  /**
14798
- * Has meta property.
14887
+ * Checks whether a meta property exists.
14799
14888
  */
14800
14889
  hasMetaProperty(name) {
14801
- if (!this.isMetaEmpty) {
14802
- return this.meta.hasKey(name);
14803
- }
14804
- return false;
14890
+ return this._meta !== undefined && this._meta.hasKey(name);
14805
14891
  }
14806
14892
 
14807
14893
  /**
14808
14894
  * Checks if meta is empty.
14809
14895
  */
14810
14896
  get isMetaEmpty() {
14811
- return this._meta === undefined || this.meta.isEmpty;
14897
+ return this._meta === undefined || this._meta.isEmpty;
14812
14898
  }
14813
14899
 
14814
14900
  /**
@@ -14834,7 +14920,7 @@ class Element {
14834
14920
  }
14835
14921
 
14836
14922
  /**
14837
- * Has attributes property.
14923
+ * Checks whether an attributes property exists.
14838
14924
  */
14839
14925
  hasAttributesProperty(name) {
14840
14926
  if (!this.isAttributesEmpty) {
@@ -14853,6 +14939,7 @@ class Element {
14853
14939
 
14854
14940
  // Re-export types for convenience
14855
14941
 
14942
+
14856
14943
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
14857
14944
 
14858
14945
  /***/ },
@@ -15392,6 +15479,10 @@ __webpack_require__.r(__webpack_exports__);
15392
15479
  /* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1198);
15393
15480
 
15394
15481
 
15482
+
15483
+ /**
15484
+ * @public
15485
+ */
15395
15486
  class ApiDOMEvaluationRealm extends _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__.EvaluationRealm {
15396
15487
  name = 'apidom';
15397
15488
  isArray(node) {
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomJsonPointerRelative=t():e.apidomJsonPointerRelative=t()}(self,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{CompilationRelativeJsonPointerError:()=>u,EvaluationRelativeJsonPointerError:()=>l,InvalidRelativeJsonPointerError:()=>c,RelativeJsonPointerError:()=>a,compile:()=>Y,evaluate:()=>Yr,isRelativeJsonPointer:()=>X,parse:()=>J});class r extends AggregateError{constructor(e,t,r){super(e,t,r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const n=r;class s extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(n,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const o=s;const i=class extends o{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}};const a=class extends i{};class c extends a{relativePointer;constructor(e,t){super(e,t),void 0!==t&&(this.relativePointer=t.relativePointer)}}const l=class extends a{relativePointer;currentElement;rootElement;cursorElement;constructor(e,t){super(e,t),void 0!==t&&(this.relativePointer=t.relativePointer,this.currentElement=t.currentElement,this.rootElement=t.rootElement,this.cursorElement=t.cursorElement)}};const u=class extends a{nonNegativeIntegerPrefix;indexManipulation;jsonPointerTokens;hashCharacter;constructor(e,t){super(e,t),void 0!==t&&(this.nonNegativeIntegerPrefix=t.relativePointer.nonNegativeIntegerPrefix,this.indexManipulation=t.relativePointer.indexManipulation,this.hashCharacter=t.relativePointer.hashCharacter,Array.isArray(t.relativePointer.jsonPointerTokens)&&(this.jsonPointerTokens=[...t.relativePointer.jsonPointerTokens]))}},p=function(){const e=m,t=y,r=this,n="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let s,o,i,a,c,l,u,p=0,h=0,d=0,f=0,g=0,x=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(y,m,w,b)=>{const k=`${n}parse(): `;p=0,h=0,d=0,f=0,g=0,s=void 0,o=void 0,i=void 0,a=void 0,x.refresh(),c=void 0,l=void 0,u=void 0,a=t.stringToChars(w),s=y.rules,o=y.udts;const T=m.toLowerCase();let A;for(const e in s)if(s.hasOwnProperty(e)&&T===s[e].lower){A=s[e].index;break}if(void 0===A)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${n}initializeCallbacks(): `;let t,i;for(c=[],l=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<o.length;t+=1)l[t]=void 0;const a=[];for(t=0;t<s.length;t+=1)a.push(s[t].lower);for(t=0;t<o.length;t+=1)a.push(o[t].lower);for(const n in r.callbacks)if(r.callbacks.hasOwnProperty(n)){if(t=a.indexOf(n.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${n}' not a rule or udt name`);if(i=r.callbacks[n]?r.callbacks[n]:void 0,"function"!=typeof i&&void 0!==i)throw new Error(`${e}syntax callback[${n}] must be function reference or falsy)`);t<s.length?c[t]=i:l[t-s.length]=i}})(),r.trace&&r.trace.init(s,o,a),r.stats&&r.stats.init(s,o),r.ast&&r.ast.init(s,o,a),u=b,i=[{type:e.RNM,index:A}],v(0,0),i=void 0;let S=!1;switch(x.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:S=!1;break;case e.EMPTY:case e.MATCH:S=x.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:S,state:x.state,stateName:e.idName(x.state),length:a.length,matched:x.phraseLength,maxMatched:g,maxTreeDepth:d,nodeHits:f}};const w=(t,r,s,o)=>{if(r.phraseLength>s){let e=`${n}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!o)throw new Error(`${n}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},b=(t,c)=>{let h,d,f;const y=i[t],m=o[y.index];x.UdtIndex=m.index,p||(f=r.ast&&r.ast.udtDefined(y.index),f&&(d=s.length+y.index,h=r.ast.getLength(),r.ast.down(d,m.name)));const g=a.length-c;l[y.index](x,a,c,u),((t,r,s)=>{if(r.phraseLength>s){let e=`${n}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${n}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(m,x,g),p||f&&(x.state===e.NOMATCH?r.ast.setLength(h):r.ast.up(d,m.name,c,x.phraseLength))},v=(t,o)=>{const l=`${n}opExecute(): `,y=i[t];switch(f+=1,h>d&&(d=h),h+=1,x.refresh(),r.trace&&r.trace.down(y,o),y.type){case e.ALT:((t,r)=>{const n=i[t];for(let t=0;t<n.children.length&&(v(n.children[t],r),x.state===e.NOMATCH);t+=1);})(t,o);break;case e.CAT:((t,n)=>{let s,o,a,c;const l=i[t];r.ast&&(o=r.ast.getLength()),s=!0,a=n,c=0;for(let t=0;t<l.children.length;t+=1){if(v(l.children[t],a),x.state===e.NOMATCH){s=!1;break}a+=x.phraseLength,c+=x.phraseLength}s?(x.state=0===c?e.EMPTY:e.MATCH,x.phraseLength=c):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(o))})(t,o);break;case e.REP:((t,n)=>{let s,o,c,l;const u=i[t];if(0===u.max)return x.state=e.EMPTY,void(x.phraseLength=0);for(o=n,c=0,l=0,r.ast&&(s=r.ast.getLength());!(o>=a.length)&&(v(t+1,o),x.state!==e.NOMATCH)&&x.state!==e.EMPTY&&(l+=1,c+=x.phraseLength,o+=x.phraseLength,l!==u.max););x.state===e.EMPTY||l>=u.min?(x.state=0===c?e.EMPTY:e.MATCH,x.phraseLength=c):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(s))})(t,o);break;case e.RNM:((t,n)=>{let o,l,h;const d=i[t],f=s[d.index],y=c[f.index];if(p||(l=r.ast&&r.ast.ruleDefined(d.index),l&&(o=r.ast.getLength(),r.ast.down(d.index,s[d.index].name))),y){const t=a.length-n;y(x,a,n,u),w(f,x,t,!0),x.state===e.ACTIVE&&(h=i,i=f.opcodes,v(0,n),i=h,y(x,a,n,u),w(f,x,t,!1))}else h=i,i=f.opcodes,v(0,n,x),i=h;p||l&&(x.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(d.index,f.name,n,x.phraseLength))})(t,o);break;case e.TRG:((t,r)=>{const n=i[t];x.state=e.NOMATCH,r<a.length&&n.min<=a[r]&&a[r]<=n.max&&(x.state=e.MATCH,x.phraseLength=1)})(t,o);break;case e.TBS:((t,r)=>{const n=i[t],s=n.string.length;if(x.state=e.NOMATCH,r+s<=a.length){for(let e=0;e<s;e+=1)if(a[r+e]!==n.string[e])return;x.state=e.MATCH,x.phraseLength=s}})(t,o);break;case e.TLS:((t,r)=>{let n;const s=i[t];x.state=e.NOMATCH;const o=s.string.length;if(0!==o){if(r+o<=a.length){for(let e=0;e<o;e+=1)if(n=a[r+e],n>=65&&n<=90&&(n+=32),n!==s.string[e])return;x.state=e.MATCH,x.phraseLength=o}}else x.state=e.EMPTY})(t,o);break;case e.UDT:b(t,o);break;case e.AND:((t,r)=>{switch(p+=1,v(t+1,r),p-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.EMPTY;break;case e.NOMATCH:x.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${x.state}`)}})(t,o);break;case e.NOT:((t,r)=>{switch(p+=1,v(t+1,r),p-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.NOMATCH;break;case e.NOMATCH:x.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${x.state}`)}})(t,o);break;default:throw new Error(`${l}unrecognized operator`)}p||o+x.phraseLength>g&&(g=o+x.phraseLength),r.stats&&r.stats.collect(y,x),r.trace&&r.trace.up(y,x.state,o,x.phraseLength),h-=1}},h=function(){const e=m,t=y,r=this;let n,s,o,i=0;const a=[],c=[],l=[];function u(e){let t="";for(;e-- >0;)t+=" ";return t}r.callbacks=[],r.init=(e,t,u)=>{let p;c.length=0,l.length=0,i=0,n=e,s=t,o=u;const h=[];for(p=0;p<n.length;p+=1)h.push(n[p].lower);for(p=0;p<s.length;p+=1)h.push(s[p].lower);for(i=n.length+s.length,p=0;p<i;p+=1)a[p]=void 0;for(const e in r.callbacks)if(r.callbacks.hasOwnProperty(e)){const t=e.toLowerCase();if(p=h.indexOf(t),p<0)throw new Error(`parser.js: Ast()): init: node '${e}' not a rule or udt name`);a[p]=r.callbacks[e]}},r.ruleDefined=e=>!!a[e],r.udtDefined=e=>!!a[n.length+e],r.down=(t,r)=>{const n=l.length;return c.push(n),l.push({name:r,thisIndex:n,thatIndex:void 0,state:e.SEM_PRE,callbackIndex:t,phraseIndex:void 0,phraseLength:void 0,stack:c.length}),n},r.up=(t,r,n,s)=>{const o=l.length,i=c.pop();return l.push({name:r,thisIndex:o,thatIndex:i,state:e.SEM_POST,callbackIndex:t,phraseIndex:n,phraseLength:s,stack:c.length}),l[i].thatIndex=o,l[i].phraseIndex=n,l[i].phraseLength=s,o},r.translate=t=>{let r,n;for(let s=0;s<l.length;s+=1)n=l[s],r=a[n.callbackIndex],r&&(n.state===e.SEM_PRE?r(e.SEM_PRE,o,n.phraseIndex,n.phraseLength,t):r&&r(e.SEM_POST,o,n.phraseIndex,n.phraseLength,t))},r.setLength=e=>{l.length=e,c.length=e>0?l[e-1].stack:0},r.getLength=()=>l.length,r.toXml=()=>{let r="",n=0;return r+='<?xml version="1.0" encoding="utf-8"?>\n',r+=`<root nodes="${l.length/2}" characters="${o.length}">\n`,r+="\x3c!-- input string --\x3e\n",r+=u(n+2),r+=t.charsToString(o),r+="\n",l.forEach(s=>{s.state===e.SEM_PRE?(n+=1,r+=u(n),r+=`<node name="${s.name}" index="${s.phraseIndex}" length="${s.phraseLength}">\n`,r+=u(n+2),r+=t.charsToString(o,s.phraseIndex,s.phraseLength),r+="\n"):(r+=u(n),r+=`</node>\x3c!-- name="${s.name}" --\x3e\n`,n-=1)}),r+="</root>\n",r}},d=function(){const e=m,t=y,r="parser.js: Trace(): ";let n,s,o,i="",a=0;const c=this,l=e=>{let t="",r=0;if(e>=0)for(;e--;)r+=1,5===r?(t+="|",r=0):t+=".";return t};c.init=(e,t,r)=>{s=e,o=t,n=r};const u=n=>{let i;switch(n.type){case e.ALT:i="ALT";break;case e.CAT:i="CAT";break;case e.REP:i=n.max===1/0?`REP(${n.min},inf)`:`REP(${n.min},${n.max})`;break;case e.RNM:i=`RNM(${s[n.index].name})`;break;case e.TRG:i=`TRG(${n.min},${n.max})`;break;case e.TBS:i=n.string.length>6?`TBS(${t.charsToString(n.string,0,3)}...)`:`TBS(${t.charsToString(n.string,0,6)})`;break;case e.TLS:i=n.string.length>6?`TLS(${t.charsToString(n.string,0,3)}...)`:`TLS(${t.charsToString(n.string,0,6)})`;break;case e.UDT:i=`UDT(${o[n.index].name})`;break;case e.AND:i="AND";break;case e.NOT:i="NOT";break;default:throw new Error(`${r}Trace: opName: unrecognized opcode`)}return i};c.down=(e,r)=>{const s=l(a),o=Math.min(100,n.length-r);let c=t.charsToString(n,r,o);o<n.length-r&&(c+="..."),c=`${s}|-|[${u(e)}]${c}\n`,i+=c,a+=1},c.up=(s,o,c,p)=>{const h=`${r}trace.up: `;a-=1;const d=l(a);let f,y,m;switch(o){case e.EMPTY:m="|E|",y="''";break;case e.MATCH:m="|M|",f=Math.min(100,p),y=f<p?`'${t.charsToString(n,c,f)}...'`:`'${t.charsToString(n,c,f)}'`;break;case e.NOMATCH:m="|N|",y="";break;default:throw new Error(`${h} unrecognized state`)}y=`${d}${m}[${u(s)}]${y}\n`,i+=y},c.displayTrace=()=>i},f=function(){const e=m;let t,r,n;const s=[],o=[],i=[];this.init=(e,n)=>{t=e,r=n,h()},this.collect=(t,r)=>{d(n,r.state,r.phraseLength),d(s[t.type],r.state,r.phraseLength),t.type===e.RNM&&d(o[t.index],r.state,r.phraseLength),t.type===e.UDT&&d(i[t.index],r.state,r.phraseLength)},this.displayStats=()=>{let t="";const r={match:0,empty:0,nomatch:0,total:0},n=(e,t,n,s,o)=>{r.match+=t,r.empty+=n,r.nomatch+=s,r.total+=o;return`${e} | ${a(t)} | ${a(n)} | ${a(s)} | ${a(o)} |\n`};return t+=" OPERATOR STATS\n",t+=" | MATCH | EMPTY | NOMATCH | TOTAL |\n",t+=n(" ALT",s[e.ALT].match,s[e.ALT].empty,s[e.ALT].nomatch,s[e.ALT].total),t+=n(" CAT",s[e.CAT].match,s[e.CAT].empty,s[e.CAT].nomatch,s[e.CAT].total),t+=n(" REP",s[e.REP].match,s[e.REP].empty,s[e.REP].nomatch,s[e.REP].total),t+=n(" RNM",s[e.RNM].match,s[e.RNM].empty,s[e.RNM].nomatch,s[e.RNM].total),t+=n(" TRG",s[e.TRG].match,s[e.TRG].empty,s[e.TRG].nomatch,s[e.TRG].total),t+=n(" TBS",s[e.TBS].match,s[e.TBS].empty,s[e.TBS].nomatch,s[e.TBS].total),t+=n(" TLS",s[e.TLS].match,s[e.TLS].empty,s[e.TLS].nomatch,s[e.TLS].total),t+=n(" UDT",s[e.UDT].match,s[e.UDT].empty,s[e.UDT].nomatch,s[e.UDT].total),t+=n(" AND",s[e.AND].match,s[e.AND].empty,s[e.AND].nomatch,s[e.AND].total),t+=n(" NOT",s[e.NOT].match,s[e.NOT].empty,s[e.NOT].nomatch,s[e.NOT].total),t+=n("TOTAL",r.match,r.empty,r.nomatch,r.total),t},this.displayHits=e=>{let t="";const r=(e,t,r,s,o)=>{n.match+=e,n.empty+=t,n.nomatch+=r,n.total+=s;return`| ${a(e)} | ${a(t)} | ${a(r)} | ${a(s)} | ${o}\n`};"string"==typeof e&&"a"===e.toLowerCase()[0]?(o.sort(c),i.sort(c),t+=" RULES/UDTS ALPHABETICALLY\n"):"string"==typeof e&&"i"===e.toLowerCase()[0]?(o.sort(u),i.sort(u),t+=" RULES/UDTS BY INDEX\n"):(o.sort(l),i.sort(l),t+=" RULES/UDTS BY HIT COUNT\n"),t+="| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";for(let e=0;e<o.length;e+=1){let n=o[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}for(let e=0;e<i.length;e+=1){let n=i[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}return t};const a=e=>e<10?` ${e}`:e<100?` ${e}`:e<1e3?` ${e}`:e<1e4?` ${e}`:e<1e5?` ${e}`:e<1e6?` ${e}`:`${e}`,c=(e,t)=>e.lower<t.lower?-1:e.lower>t.lower?1:0,l=(e,t)=>e.total<t.total?1:e.total>t.total?-1:c(e,t),u=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0,p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},h=()=>{s.length=0,n=new p,s[e.ALT]=new p,s[e.CAT]=new p,s[e.REP]=new p,s[e.RNM]=new p,s[e.TRG]=new p,s[e.TBS]=new p,s[e.TLS]=new p,s[e.UDT]=new p,s[e.AND]=new p,s[e.NOT]=new p,o.length=0;for(let e=0;e<t.length;e+=1)o.push({empty:0,match:0,nomatch:0,total:0,name:t[e].name,lower:t[e].lower,index:t[e].index});if(r.length>0){i.length=0;for(let e=0;e<r.length;e+=1)i.push({empty:0,match:0,nomatch:0,total:0,name:r[e].name,lower:r[e].lower,index:r[e].index})}},d=(t,r)=>{switch(t.total+=1,r){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`parser.js: Stats(): collect(): incStat(): unrecognized state: ${r}`)}}},y={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,r)=>{let n=e;for(;!(void 0===t||t<0);){if(void 0===r){n=e.slice(t);break}if(r<=0)return"";n=e.slice(t,t+r);break}return String.fromCodePoint(...n)}},m={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case m.ALT:return"ALT";case m.CAT:return"CAT";case m.REP:return"REP";case m.RNM:return"RNM";case m.TRG:return"TRG";case m.TBS:return"TBS";case m.TLS:return"TLS";case m.UDT:return"UDT";case m.AND:return"AND";case m.NOT:return"NOT";case m.ACTIVE:return"ACTIVE";case m.EMPTY:return"EMPTY";case m.MATCH:return"MATCH";case m.NOMATCH:return"NOMATCH";case m.SEM_PRE:return"SEM_PRE";case m.SEM_POST:return"SEM_POST";case m.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function g(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class x extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const w=x;const b=class extends w{},v=e=>(t,r,n,s,o)=>{if("object"!=typeof o||null===o||Array.isArray(o))throw new b("parser's user data must be an object");if(t===m.SEM_PRE){const t={type:e,text:y.charsToString(r,n,s),start:n,length:s,children:[]};if(o.stack.length>0){o.stack[o.stack.length-1].children.push(t)}else o.root=t;o.stack.push(t)}t===m.SEM_POST&&o.stack.pop()};const k=class extends h{constructor(){super(),this.callbacks["json-pointer"]=v("json-pointer"),this.callbacks["reference-token"]=v("reference-token"),this.callbacks.slash=v("text")}getTree(){const e={stack:[],root:null};return this.translate(e),delete e.stack,e}},T=e=>{if("string"!=typeof e)throw new TypeError("Reference token must be a string");return e.replace(/~1/g,"/").replace(/~0/g,"~")};const A=class extends k{getTree(){const{root:e}=super.getTree();return e.children.filter(({type:e})=>"reference-token"===e).map(({text:e})=>T(e))}};const S=class extends Array{toString(){return this.map(e=>`"${String(e)}"`).join(", ")}};const E=class extends d{inferExpectations(){const e=this.displayTrace().split("\n"),t=new Set;let r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.includes("M|")){const e=s.match(/]'(.*)'$/);e&&e[1]&&(r=n)}if(n>r){const e=s.match(/N\|\[TLS\(([^)]+)\)]/);e&&t.add(e[1])}}return new S(...t)}},O=new g,I=(e,{translator:t=new A,stats:r=!1,trace:n=!1}={})=>{if("string"!=typeof e)throw new TypeError("JSON Pointer must be a string");try{const s=new p;t&&(s.ast=t),r&&(s.stats=new f),n&&(s.trace=new E);const o=s.parse(O,"json-pointer",e);return{result:o,tree:o.success&&t?s.ast.getTree():void 0,stats:s.stats,trace:s.trace}}catch(t){throw new b("Unexpected error during JSON Pointer parsing",{cause:t,jsonPointer:e})}};new g,new p,new g,new p;const P=new g,C=new p,M=e=>{if("string"!=typeof e)return!1;try{return C.parse(P,"array-index",e).success}catch{return!1}},j=new g,N=new p,F=e=>{if("string"!=typeof e)return!1;try{return N.parse(j,"array-dash",e).success}catch{return!1}},D=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const L=class extends w{},B=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return D(String(e))}).join("/")}`}catch(t){throw new L("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};const $=class{#e;#t;#r;constructor(e,t={}){this.#e=e,this.#e.steps=[],this.#e.failed=!1,this.#e.failedAt=-1,this.#e.message=`JSON Pointer "${t.jsonPointer}" was successfully evaluated against the provided value`,this.#e.context={...t,realm:t.realm.name},this.#t=[],this.#r=t.realm}step({referenceToken:e,input:t,output:r,success:n=!0,reason:s}){const o=this.#t.length;this.#t.push(e);const i={referenceToken:e,referenceTokenPosition:o,input:t,inputType:this.#r.isObject(t)?"object":this.#r.isArray(t)?"array":"unrecognized",output:r,success:n};s&&(i.reason=s),this.#e.steps.push(i),n||(this.#e.failed=!0,this.#e.failedAt=o,this.#e.message=s)}};const q=class{name="";isArray(e){throw new w("Realm.isArray(node) must be implemented in a subclass")}isObject(e){throw new w("Realm.isObject(node) must be implemented in a subclass")}sizeOf(e){throw new w("Realm.sizeOf(node) must be implemented in a subclass")}has(e,t){throw new w("Realm.has(node) must be implemented in a subclass")}evaluate(e,t){throw new w("Realm.evaluate(node) must be implemented in a subclass")}};const R=class extends w{};const _=class extends R{};const U=class extends q{name="json";isArray(e){return Array.isArray(e)}isObject(e){return"object"==typeof e&&null!==e&&!this.isArray(e)}sizeOf(e){return this.isArray(e)?e.length:this.isObject(e)?Object.keys(e).length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new _(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)&&Object.prototype.hasOwnProperty.call(e,r)}return!!this.isObject(e)&&Object.prototype.hasOwnProperty.call(e,t)}evaluate(e,t){return this.isArray(e)?e[Number(t)]:e[t]}};const H=class extends R{};const G=class extends R{},z=(e,t,{strictArrays:r=!0,strictObjects:n=!0,realm:s=new U,trace:o=!0}={})=>{const{result:i,tree:a,trace:c}=I(t,{trace:!!o});if(!i.success){let e=`Invalid JSON Pointer: "${t}". Syntax error at position ${i.maxMatched}`;throw e+=c?`, expected ${c.inferExpectations()}`:"",new b(e,{jsonPointer:t})}const l="object"==typeof o&&null!==o?new $(o,{jsonPointer:t,referenceTokens:a,strictArrays:r,strictObjects:n,realm:s,value:e}):null;try{let o;return a.reduce((e,i,c)=>{if(s.isArray(e)){if(F(i)){if(r)throw new _(`Invalid array index "-" at position ${c} in "${t}". The "-" token always refers to a nonexistent element during evaluation`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,String(s.sizeOf(e))),null==l||l.step({referenceToken:i,input:e,output:o}),o}if(!M(i))throw new _(`Invalid array index "${i}" at position ${c} in "${t}": index MUST be "0", or digits without a leading "0"`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});const n=Number(i);if(!Number.isSafeInteger(n))throw new _(`Invalid array index "${i}" at position ${c} in "${t}": index must be a safe integer`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});if(!s.has(e,i)&&r)throw new _(`Invalid array index "${i}" at position ${c} in "${t}": index not found in array`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:o}),o}if(s.isObject(e)){if(!s.has(e,i)&&n)throw new G(`Invalid object key "${i}" at position ${c} in "${t}": key not found in object`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:o}),o}throw new H(`Invalid reference token "${i}" at position ${c} in "${t}": cannot be applied to a non-object/non-array value`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name})},e)}catch(e){if(null==l||l.step({referenceToken:e.referenceToken,input:e.currentValue,success:!1,reason:e.message}),e instanceof R)throw e;throw new R("Unexpected error during JSON Pointer evaluation",{cause:e,jsonPointer:t,referenceTokens:a})}};const V=new RegExp("^(?<nonNegativeIntegerPrefix>[1-9]\\d*|0)(?<indexManipulation>[+-][1-9]\\d*|0)?((?<hashCharacter>#)|(?<jsonPointer>\\/.*))?$"),X=e=>"string"==typeof e&&V.test(e),J=e=>{const t=e.match(V);if(null===t||void 0===t.groups)throw new c(`Invalid Relative JSON Pointer "${e}".`,{relativePointer:e});try{const e=parseInt(t.groups.nonNegativeIntegerPrefix,10),r="string"==typeof t.groups.indexManipulation?parseInt(t.groups.indexManipulation,10):void 0,n="string"==typeof t.groups.jsonPointer?I(t.groups.jsonPointer).tree:void 0;return{nonNegativeIntegerPrefix:e,indexManipulation:r,jsonPointerTokens:n,hashCharacter:"string"==typeof t.groups.hashCharacter}}catch(t){throw new c(`Relative JSON Pointer parsing of "${e}" encountered an error.`,{relativePointer:e,cause:t})}},Y=e=>{try{let t="";return t+=String(e.nonNegativeIntegerPrefix),"number"==typeof e.indexManipulation&&(t+=String(e.indexManipulation)),Array.isArray(e.jsonPointerTokens)?t+=B(e.jsonPointerTokens):e.hashCharacter&&(t+="#"),t}catch(t){throw new u("Relative JSON Pointer compilation encountered an error.",{relativePointer:e,cause:t})}};function W(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function Q(e){return function t(r){return 0===arguments.length||W(r)?t:e.apply(this,arguments)}}function K(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return W(r)?t:Q(function(t){return e(r,t)});default:return W(r)&&W(n)?t:W(r)?Q(function(t){return e(t,n)}):W(n)?Q(function(t){return e(r,t)}):e(r,n)}}}function Z(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function ee(e,t,r){for(var n=0,s=r.length;n<s;){if(e(t,r[n]))return!0;n+=1}return!1}function te(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const re="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var ne=Object.prototype.toString;const se=function(){return"[object Arguments]"===ne.call(arguments)?function(e){return"[object Arguments]"===ne.call(e)}:function(e){return te("callee",e)}}();var oe=!{toString:null}.propertyIsEnumerable("toString"),ie=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ae=function(){return arguments.propertyIsEnumerable("length")}(),ce=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},le="function"!=typeof Object.keys||ae?Q(function(e){if(Object(e)!==e)return[];var t,r,n=[],s=ae&&se(e);for(t in e)!te(t,e)||s&&"length"===t||(n[n.length]=t);if(oe)for(r=ie.length-1;r>=0;)te(t=ie[r],e)&&!ce(n,t)&&(n[n.length]=t),r-=1;return n}):Q(function(e){return Object(e)!==e?[]:Object.keys(e)});const ue=le;const pe=Q(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function he(e,t,r,n){var s=Z(e);function o(e,t){return de(e,t,r.slice(),n.slice())}return!ee(function(e,t){return!ee(o,t,e)},Z(t),s)}function de(e,t,r,n){if(re(e,t))return!0;var s=pe(e);if(s!==pe(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!re(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!re(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===e)return n[o]===t;o-=1}switch(s){case"Map":return e.size===t.size&&he(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&he(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=ue(e);if(i.length!==ue(t).length)return!1;var a=r.concat([e]),c=n.concat([t]);for(o=i.length-1;o>=0;){var l=i[o];if(!te(l,t)||!de(t[l],e[l],a,c))return!1;o-=1}return!0}const fe=K(function(e,t){return de(e,t,[],[])});const ye=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class me{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(r=>{const n=r.value,s=r.key;if(void 0===n||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,n,s,r):e(n,s,r)})}filter(e,t){const r=this.elements.filter(r=>{const n=r.value,s=r.key;return void 0!==n&&void 0!==s&&(void 0!==t?e.call(t,n,s,r):e(n,s,r))});return new me(r)}reject(e,t){const r=[];for(const n of this.elements){const s=n.value,o=n.key;void 0!==s&&void 0!==o&&(e.call(t,s,o,n)||r.push(n))}return new me(r)}forEach(e,t){this.elements.forEach((r,n)=>{const s=r.value,o=r.key;void 0!==s&&void 0!==o&&(void 0!==t?e.call(t,s,o,r,n):e(s,o,r,n))})}find(e,t){return this.elements.find(r=>{const n=r.value,s=r.key;return void 0!==n&&void 0!==s&&(void 0!==t?e.call(t,n,s,r):e(n,s,r))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const ge=me;class xe{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,r){void 0!==t&&(this.meta=t),void 0!==r&&(this.attributes=r),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof xe)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof ye)this._content=e;else if(e instanceof ge)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof xe?this._meta=e:this.meta.set(e??{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof xe?this._attributes=e:this.attributes.set(e??{})}get id(){return this.isFrozen?this.getMetaProperty("id",""):(this.hasMetaProperty("id")||this.setMetaProperty("id",""),this.meta.get("id"))}set id(e){this.setMetaProperty("id",e)}get classes(){return this.isFrozen?this.getMetaProperty("classes",[]):(this.hasMetaProperty("classes")||this.setMetaProperty("classes",[]),this.meta.get("classes"))}set classes(e){this.setMetaProperty("classes",e)}get links(){return this.isFrozen?this.getMetaProperty("links",[]):(this.hasMetaProperty("links")||this.setMetaProperty("links",[]),this.meta.get("links"))}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof ye){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof xe?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&(this._meta.parent=this,this._meta.freeze()),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof xe||e instanceof ye?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof xe?e.toValue():e;return fe(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id.toValue();if(""===t)throw new Error("Cannot create reference to an element without an ID");const r=new this.RefElement(t);return"string"==typeof e&&(r.path=this.refract(e)),r}getMetaProperty(e,t){if(!this.hasMetaProperty(e)){if(void 0===t)return;const e=this.refract(t);return e&&this.isFrozen&&e.freeze(),e}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return!this.isMetaEmpty&&this.meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this.meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const we=xe;const be=class extends we{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};class ve extends we{constructor(e,t,r){super(e||[],t,r)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const r=t||{},n=!!r.recursive,s=void 0===r.results?[]:r.results;for(let t=0;t<this._content.length;t+=1){const r=this._content[t],o=r;n&&"function"==typeof o.findElements&&o.findElements(e,{results:s,recursive:n}),e(r,t,void 0)&&s.push(r)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const r=t.classes;return"function"==typeof r.includes&&r.includes(e)})}getById(e){return this.find(t=>t.id.toValue()===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const ke=ve;const Te=class extends ke{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const r=[];for(const n of this._content){const s=e.call(t,n);s&&r.push(s)}return r}filter(e,t){const r=this._content.filter(e,t);return new this.constructor(r)}reject(e,t){const r=[];for(const n of this._content)e.call(t,n)||r.push(n);return new this.constructor(r)}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n=this.first);for(let t=r;t<this.length;t+=1){const r=e(n,this._content[t],t,this);n=void 0===r?r:this.refract(r)}return n}forEach(e,t){this._content.forEach((r,n)=>{e.call(t,r,n)})}empty(){return new this.constructor([])}};const Ae=class extends we{constructor(e,t,r,n){super(new ye,r,n),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const Se=class extends ke{constructor(e,t,r){super(e||[],t,r),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(r=>r.key.toValue()!==e||(t=r,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const r=this.getMember(e);r?r.value=t:this._content.push(new Ae(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(r=>e.call(t,r.value,r.key,r))}compactMap(e,t){const r=[];return this.forEach((n,s,o)=>{const i=e.call(t,n,s,o);i&&r.push(i)}),r}filter(e,t){return new ge(this._content).filter(e,t)}reject(e,t){const r=[];for(const n of this._content)e.call(t,n.value,n.key,n)||r.push(n);return new ge(r)}forEach(e,t){this._content.forEach(r=>e.call(t,r.value,r.key,r))}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n=this._content[0]?.value);for(let t=r;t<this._content.length;t+=1){const r=this._content[t],s=e(n,r.value,r.key,r,this);n=void 0===s?s:this.refract(s)}return n}empty(){return new this.constructor([])}};const Ee=e=>e instanceof we,Oe=e=>e instanceof be,Ie=e=>e instanceof Te,Pe=e=>e instanceof Se,Ce=e=>e instanceof Ae;function Me(e,t,r){if(r||(r=new je),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var n,s=function(n){var s=r.get(e);if(s)return s;for(var o in r.set(e,n),e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t?Me(e[o],!0,r):e[o]);return n};switch(pe(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return n=e,new RegExp(n.source,n.flags?n.flags:(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":"")+(n.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var je=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var r=this.hash(e),n=this.map[r];n||(this.map[r]=n=[]),n.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var r in e)t.push(Object.prototype.toString.call(e[r]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var r=this.map[t],n=0;n<r.length;n+=1){if((o=r[n])[0]===e)return o[1]}else{var s=this.hash(e);if(r=this.map[s])for(n=0;n<r.length;n+=1){var o;if((o=r[n])[0]===e)return o[1]}}},e}();const Ne=Q(function(e){return null!=e&&"function"==typeof e.clone?e.clone():Me(e,!0)});class Fe extends be{constructor(e,t,r){super(e,t,r),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:r,startOffset:n,endLine:s,endCharacter:o,endOffset:i}=e;if("number"!=typeof t||"number"!=typeof r||"number"!=typeof n||"number"!=typeof s||"number"!=typeof o||"number"!=typeof i)return;const a="sm1:"+[t,r,n,s,o,i].map(Le).join("");const c=new Fe(a);return c.startLine=t,c.startCharacter=r,c.startOffset=n,c.endLine=s,c.endCharacter=o,c.endOffset=i,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,r=[];let n=0;for(let e=0;e<6;e++){const e=Be(t,n);r.push(e.value),n=e.next}return r}(this.content))}}const De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Le(e){let t=e>>>0,r="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),r+=De[e]}while(0!==t);return r}function Be(e,t=0){let r=0,n=0,s=t;for(;;){const t=e[s++],o=De.indexOf(t);if(-1===o)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(r|=(31&o)<<n,n+=5,!!!(32&o))break}return{value:r>>>0,next:s}}const $e=Fe;const qe=class extends i{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const Re=class extends qe{};const _e=class extends qe{},Ue=(e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const s=Ve(e);r.set(e,s);const{content:o}=e;return Array.isArray(o)?s.content=o.map(e=>Ue(e,n)):Ee(o)?s.content=Ue(o,n):s.content=o instanceof ye?He(o,n):o,s},He=(e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const{key:s,value:o}=e,i=void 0!==s?Ue(s,n):void 0,a=void 0!==o?Ue(o,n):void 0,c=new ye(i,a);return r.set(e,c),c},Ge=(e,t={})=>{if(e instanceof ye)return He(e,t);if(e instanceof ge)return((e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const s=[...e].map(e=>Ue(e,n)),o=new ge(s);return r.set(e,o),o})(e,t);if(Ee(e))return Ue(e,t);throw new Re("Value provided to cloneDeep function couldn't be cloned",{value:e})};Ge.safe=e=>{try{return Ge(e)}catch{return e}};const ze=e=>{const{key:t,value:r}=e;return new ye(t,r)},Ve=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=Ge(e.meta)),e.isAttributesEmpty||(t.attributes=Ge(e.attributes)),(e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset)(e)&&$e.transfer(e,t),(e=>void 0!==e.style)(e)&&(t.style=Ne(e.style));const{content:r}=e;return Ee(r)?t.content=Ve(r):Array.isArray(r)?t.content=[...r]:t.content=r instanceof ye?ze(r):r,t},Xe=e=>{if(e instanceof ye)return ze(e);if(e instanceof ge)return(e=>{const t=[...e];return new ge(t)})(e);if(Ee(e))return Ve(e);throw new _e("Value provided to cloneShallow function couldn't be cloned",{value:e})};Xe.safe=e=>{try{return Xe(e)}catch{return e}};const Je=class extends we{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}};class Ye extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const We=Ye;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const Qe=class extends We{},Ke=e=>{if(!Array.isArray(e))throw new Qe("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const r of e){const e=r.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:r}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new Qe("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},Ze=(e,t,r,n)=>{const{realm:s}=e,{value:o}=r;if(s.isObject(t)&&s.hasProperty(t,o)){n(s.getProperty(t,o),o)}},et=(e,t,r,n)=>{const{realm:s}=e,{value:o}=r;if(!s.isArray(t))return;const i=s.getLength(t),a=((e,t)=>e>=0?e:t+e)(o,i);if(a>=0&&a<i){n(s.getElement(t,a),a)}},tt=(e,t,r,n)=>{const{realm:s}=e;for(const[e,r]of s.entries(t))n(r,e)},rt=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),nt=(e,t,r,n)=>{const{realm:s}=e,{start:o,end:i,step:a}=r;if(!s.isArray(t))return;const c=((e,t,r,n)=>{const s=r??1;if(0===s)return null;let o,i;if(s>0){const r=0,s=n,a=null!==e?rt(e,n):r,c=null!==t?rt(t,n):s;o=Math.max(a,0),i=Math.min(c,n)}else{const r=n-1,s=-n-1,a=null!==e?e>=0?Math.min(e,n-1):Math.max(n+e,-1):r,c=null!==t?t>=0?Math.min(t,n-1):Math.max(n+t,-1):s;i=Math.min(a,n-1),o=Math.max(c,-1)}return{lower:o,upper:i,step:s}})(o,i,a,s.getLength(t));if(null===c)return;const{lower:l,upper:u,step:p}=c;if(p>0)for(let e=l;e<u;e+=p){n(s.getElement(t,e),e)}else for(let e=u;e>l;e+=p){n(s.getElement(t,e),e)}},st=(e,t,r,n)=>n.value,ot=(e,t,r)=>{const{realm:n}=e,{selector:s}=r;switch(s.type){case"NameSelector":{const{value:e}=s;return n.isObject(t)&&n.hasProperty(t,e)?n.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=s;if(!n.isArray(t))return;const r=n.getLength(t),o=e>=0?e:r+e;return o>=0&&o<r?n.getElement(t,o):void 0}default:return}},it=(e,t,r,n)=>{const{selectors:s}=r;for(const r of s)xt(e,t,r,n)},at=(e,t,r)=>{const n=[],s=e=>{n.push(e)},{selector:o}=r;switch(o.type){case"BracketedSelection":it(e,t,o,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":xt(e,t,o,s)}return n},ct=(e,t,r,n)=>{let s=r;for(const t of n){const r=[];if("DescendantSegment"===t.type){const n=s=>{const{realm:o}=e,i=at(e,s,t);r.push(...i);for(const[,e]of o.entries(s))n(e)};for(const e of s)n(e)}else for(const n of s){const s=at(e,n,t);r.push(...s)}s=r}return s},lt=(e,t,r,n)=>{const{query:s}=n;let o;switch(s.type){case"RelQuery":o=((e,t,r,n)=>{const{segments:s}=n;return 0===s.length?[r]:ct(e,0,[r],s)})(e,0,r,s);break;case"JsonPathQuery":o=((e,t,r,n)=>{const{segments:s}=n;return 0===s.length?[t]:ct(e,0,[t],s)})(e,t,0,s);break;default:o=[]}return i=o,Object.defineProperty(i,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),i;var i};let ut;const pt=(e,t,r,n)=>{const{name:s,arguments:o}=n,i=e.functions[s];if("function"!=typeof i)return;const a=o.map(n=>((e,t,r,n)=>{switch(n.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return ht(e,t,r,n);case"FilterQuery":return lt(e,t,r,n);case"TestExpr":return"FilterQuery"===n.expression.type?lt(e,t,r,n.expression):"FunctionExpr"===n.expression.type?ht(e,t,r,n.expression):ut(e,t,r,n);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ut(e,t,r,n);default:return}})(e,t,r,n));return i(e.realm,...a)},ht=(e,t,r,n)=>{switch(n.type){case"Literal":return st(e,t,r,n);case"RelSingularQuery":return((e,t,r,n)=>{let s=r;for(const t of n.segments)if(s=ot(e,s,t),void 0===s)return;return s})(e,0,r,n);case"AbsSingularQuery":return((e,t,r,n)=>{let s=t;for(const t of n.segments)if(s=ot(e,s,t),void 0===s)return;return s})(e,t,0,n);case"FunctionExpr":return pt(e,t,r,n);default:return}},dt=(e,t,r,n)=>{const{left:s,op:o,right:i}=n,a=ht(e,t,r,s),c=ht(e,t,r,i);return e.realm.compare(a,o,c)},ft=e=>Array.isArray(e),yt=(e,t,r,n)=>{switch(n.type){case"LogicalOrExpr":return!!yt(e,t,r,n.left)||yt(e,t,r,n.right);case"LogicalAndExpr":return!!yt(e,t,r,n.left)&&yt(e,t,r,n.right);case"LogicalNotExpr":return!yt(e,t,r,n.expression);case"TestExpr":{const{expression:s}=n;if("FilterQuery"===s.type){return lt(e,t,r,s).length>0}if("FunctionExpr"===s.type){const n=pt(e,t,r,s);return"boolean"==typeof n?n:void 0!==n&&(ft(n)?n.length>0:Boolean(n))}return!1}case"ComparisonExpr":return dt(e,t,r,n);default:return!1}};ut=yt;const mt=yt,gt=(e,t,r,n)=>{const{realm:s,root:o}=e,{expression:i}=r;for(const[r,a]of s.entries(t)){mt(e,o,a,i)&&n(a,r)}},xt=(e,t,r,n)=>{switch(r.type){case"NameSelector":Ze(e,t,r,n);break;case"IndexSelector":et(e,t,r,n);break;case"WildcardSelector":tt(e,t,r,n);break;case"SliceSelector":nt(e,t,r,n);break;case"FilterSelector":gt(e,t,r,n)}};new Map;class wt{node;key;index;parent;parentPath;inList;#n=!1;#s=!1;#o=!1;#i=!1;#a;#c=!1;constructor(e,t,r,n,s){this.node=e,this.parent=t,this.parentPath=r,this.key=n,this.index=s&&"number"==typeof n?n:void 0,this.inList=s}get shouldSkip(){return this.#n}get shouldStop(){return this.#s}get removed(){return this.#o}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;){const{key:r,parent:n,parentPath:s}=t;if(Ce(n)&&"value"===r){if(!Oe(n.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(n.key.toValue())}else Ie(s?.node)&&"number"==typeof r&&e.unshift(r);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?Ke(t):B(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#n=!0}stop(){this.#s=!0}replaceWith(e){this.#c&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#i=!0,this.#a=e,this.node=e}remove(){this.#c&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#o=!0}_getReplacementNode(){return this.#a}_wasReplaced(){return this.#i}_reset(){this.#n=!1,this.#s=!1,this.#o=!1,this.#i=!1,this.#a=void 0}_markStale(){this.#c=!0}}function bt(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,s){return t.apply(this,arguments)};case 5:return function(e,r,n,s,o){return t.apply(this,arguments)};case 6:return function(e,r,n,s,o,i){return t.apply(this,arguments)};case 7:return function(e,r,n,s,o,i,a){return t.apply(this,arguments)};case 8:return function(e,r,n,s,o,i,a,c){return t.apply(this,arguments)};case 9:return function(e,r,n,s,o,i,a,c,l){return t.apply(this,arguments)};case 10:return function(e,r,n,s,o,i,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function vt(e,t,r){return function(){for(var n=[],s=0,o=e,i=0,a=!1;i<t.length||s<arguments.length;){var c;i<t.length&&(!W(t[i])||s>=arguments.length)?c=t[i]:(c=arguments[s],s+=1),n[i]=c,W(c)?a=!0:o-=1,i+=1}return!a&&o<=0?r.apply(this,n):bt(Math.max(0,o),vt(e,n,r))}}var kt=K(function(e,t){return 1===e?Q(t):bt(e,vt(e,[],t))});const Tt=kt;function At(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const St=K(function(e,t){return e&&t});function Et(e,t,r){for(var n=0,s=r.length;n<s;)t=e(t,r[n]),n+=1;return t}const Ot=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};const It=Q(function(e){return!!Ot(e)||!!e&&("object"==typeof e&&(!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var Pt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Ct(e,t,r){return function(n,s,o){if(It(o))return e(n,s,o);if(null==o)return s;if("function"==typeof o["fantasy-land/reduce"])return t(n,s,o,"fantasy-land/reduce");if(null!=o[Pt])return r(n,s,o[Pt]());if("function"==typeof o.next)return r(n,s,o);if("function"==typeof o.reduce)return t(n,s,o,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Mt(e,t,r){for(var n=r.next();!n.done;)t=e(t,n.value),n=r.next();return t}function jt(e,t,r,n){return r[n](e,t)}const Nt=Ct(Et,jt,Mt);function Ft(e,t,r){return function(){if(0===arguments.length)return r();var n=arguments[arguments.length-1];if(!Ot(n)){for(var s=0;s<e.length;){if("function"==typeof n[e[s]])return n[e[s]].apply(n,Array.prototype.slice.call(arguments,0,-1));s+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(n))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(n)}return r.apply(this,arguments)}}function Dt(e,t){for(var r=0,n=t.length,s=Array(n);r<n;)s[r]=e(t[r]),r+=1;return s}const Lt=function(){return this.xf["@@transducer/init"]()},Bt=function(e){return this.xf["@@transducer/result"](e)};var $t=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Lt,e.prototype["@@transducer/result"]=Bt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var qt=K(Ft(["fantasy-land/map","map"],function(e){return function(t){return new $t(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Tt(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Et(function(r,n){return r[n]=e(t[n]),r},{},ue(t));default:return Dt(e,t)}}));const Rt=qt;const _t=K(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:Nt(function(e,r){return function(e,t){var r;t=t||[];var n=(e=e||[]).length,s=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<s;)o[o.length]=t[r],r+=1;return o}(e,Rt(r,t))},[],e)});var Ut=K(function(e,t){var r=Tt(e,t);return Tt(e,function(){return Et(_t,Rt(r,arguments[0]),Array.prototype.slice.call(arguments,1))})});const Ht=Ut;var Gt=Q(function(e){return Ht(e.length,e)});const zt=Gt;const Vt=K(function(e,t){return At(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:zt(St)(e,t)});function Xt(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function Jt(e){return function t(r,n,s){switch(arguments.length){case 0:return t;case 1:return W(r)?t:K(function(t,n){return e(r,t,n)});case 2:return W(r)&&W(n)?t:W(r)?K(function(t,r){return e(t,n,r)}):W(n)?K(function(t,n){return e(r,t,n)}):Q(function(t){return e(r,n,t)});default:return W(r)&&W(n)&&W(s)?t:W(r)&&W(n)?K(function(t,r){return e(t,r,s)}):W(r)&&W(s)?K(function(t,r){return e(t,n,r)}):W(n)&&W(s)?K(function(t,n){return e(r,t,n)}):W(r)?Q(function(t){return e(t,n,s)}):W(n)?Q(function(t){return e(r,t,s)}):W(s)?Q(function(t){return e(r,n,t)}):e(r,n,s)}}}function Yt(e,t,r){for(var n=0,s=r.length;n<s;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}var Wt=K(function(e,t){return bt(e.length,function(){return e.apply(t,arguments)})});const Qt=Wt;function Kt(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function Zt(e,t,r,n){return e["@@transducer/result"](r[n](Qt(e["@@transducer/step"],e),t))}const er=Ct(Yt,Zt,Kt);var tr=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var rr=Jt(function(e,t,r){return er("function"==typeof e?function(e){return new tr(e)}(e):e,t,r)});const nr=rr;function sr(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return Ot(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}const or=Q(sr("tail",Jt(sr("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}))(1,1/0)));function ir(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return bt(arguments[0].length,nr(Xt,arguments[0],or(arguments)))}function ar(e,t){return function(e,t,r){var n,s;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(s=e[r])&&1/s===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(s=e[r])&&s!=s)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(fe(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function cr(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var lr=function(e){return(e<10?"0":"")+e};const ur="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+lr(e.getUTCMonth()+1)+"-"+lr(e.getUTCDate())+"T"+lr(e.getUTCHours())+":"+lr(e.getUTCMinutes())+":"+lr(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var pr=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Lt,e.prototype["@@transducer/result"]=Bt,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function hr(e){return function(t){return new pr(e,t)}}var dr=K(Ft(["fantasy-land/filter","filter"],hr,function(e,t){return r=t,"[object Object]"===Object.prototype.toString.call(r)?Et(function(r,n){return e(t[n])&&(r[n]=t[n]),r},{},ue(t)):function(e){return"[object Map]"===Object.prototype.toString.call(e)}(t)?function(e,t){for(var r=new Map,n=t.entries(),s=n.next();!s.done;)e(s.value[1])&&r.set(s.value[0],s.value[1]),s=n.next();return r}(e,t):function(e,t){for(var r=0,n=t.length,s=[];r<n;)e(t[r])&&(s[s.length]=t[r]),r+=1;return s}(e,t);var r}));const fr=dr;const yr=K(function(e,t){return fr((r=e,function(){return!r.apply(this,arguments)}),t);var r});function mr(e,t){var r=function(r){var n=t.concat([e]);return ar(r,n)?"<Circular>":mr(r,n)},n=function(e,t){return Dt(function(t){return cr(t)+": "+r(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+Dt(r,e).join(", ")+"))";case"[object Array]":return"["+Dt(r,e).concat(n(e,yr(function(e){return/^\d+$/.test(e)},ue(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):cr(ur(e)))+")";case"[object Map]":return"new Map("+r(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+r(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":cr(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var s=e.toString();if("[object Object]"!==s)return s}return"{"+n(e,ue(e)).join(", ")+"}"}}const gr=Q(function(e){return mr(e,[])});const xr=K(function(e,t){return e||t});const wr=K(function(e,t){return At(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:zt(xr)(e,t)});const br=zt(Q(function(e){return!e}))(fe(null));const vr=K(function(e,t){if(e===t)return t;function r(e,t){if(e>t!=t>e)return t>e?t:e}var n=r(e,t);if(void 0!==n)return n;var s=r(typeof e,typeof t);if(void 0!==s)return s===typeof e?e:t;var o=gr(e),i=r(o,gr(t));return void 0!==i&&i===o?e:t}),kr=Number.isInteger||function(e){return(e|0)===e};function Tr(e,t){return t[e<0?t.length+e:e]}const Ar=K(function(e,t){if(null!=t)return kr(e)?Tr(e,t):t[e]});const Sr=K(function(e,t){return Rt(Ar(e),t)});const Er=Q(function(e){return Tt(nr(vr,0,Sr("length",e)),function(){for(var t=0,r=e.length;t<r;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Or=function(e,t){switch(arguments.length){case 0:return Or;case 1:return function t(r){return 0===arguments.length?t:re(e,r)};default:return re(e,t)}};const Ir=Or;const Pr=Tt(1,ir(pe,Ir("GeneratorFunction")));const Cr=Tt(1,ir(pe,Ir("AsyncFunction")));var Mr=Er([ir(pe,Ir("Function")),Pr,Cr]);function jr(e){return jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jr(e)}var Nr=Tt(1,Vt(br,wr(function(e){return"object"===jr(e)},Mr)));const Fr=Tt(1,Vt(Nr,ir(gr,fe("[object Promise]")))),Dr=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},Lr=e=>Ee(e),Br=e=>Xe(e),$r=(e,t,r)=>{Ce(e)?e.value=r:Array.isArray(e)?e[t]=null===r?void 0:r:null===r?delete e[t]:e[t]=r},qr=e=>Ce(e)?["key","value"]:Ie(e)||Pe(e)?["content"]:[],Rr=(e,t)=>{if(void 0!==e[t])return e[t];const r=t.length;for(const n in e){if(!n.includes("|"))continue;const s=n.indexOf(t);if(-1===s)continue;const o=0===s||"|"===n[s-1],i=s+r===n.length||"|"===n[s+r];if(o&&i)return e[n]}},_r=(e,t,r)=>{if(void 0===t)return null;const n=e,s=r?"leave":"enter",o=Rr(n,t);if(!r&&"function"==typeof o)return o;if(null!=o){const e=o[s];if("function"==typeof e)return e}const i=n[s];if("function"==typeof i)return i;if(null!=i){const e=Rr(i,t);if("function"==typeof e)return e}return null};function Ur(e,t){return new wt(t,e.parent,e.parentPath,e.key,e.inList)}function*Hr(e,t,r){const{keyMap:n,state:s,nodeTypeGetter:o,nodePredicate:a,nodeCloneFn:c,detectCycles:l,mutable:u,mutationFn:p}=r,h="function"==typeof n;let d,f,y=Array.isArray(e),m=[e],g=-1,x=[],w=e,b=null,v=null;const k=[];do{g+=1;const e=g===m.length;let r;const T=e&&0!==x.length;if(e){if(r=0===k.length?void 0:b?.key,w=f,f=k.pop(),v=b?.parentPath?.parentPath??null,T)if(u)for(const[e,t]of x)p(w,e,t);else if(y){w=w.slice();let e=0;for(const[t,r]of x){const n=t-e;null===r?(w.splice(n,1),e+=1):w[n]=r}}else{w=c(w);for(const[e,t]of x)w[e]=t}if(void 0!==d){g=d.index,m=d.keys,x=d.edits;const e=d.inArray;if(v=d.parentPath,d=d.prev,T&&!u){const t=e?g:m[g];x.push([t,w])}y=e}}else if(void 0!==f&&(r=y?g:m[g],w=f[r],void 0===w))continue;if(!Array.isArray(w)){if(!a(w))throw new i(`Invalid AST Node: ${String(w)}`,{node:w});if(l&&k.includes(w))continue;b=new wt(w,f,v,r,y);const n=_r(t,o(w),e);if(n){for(const[e,r]of Object.entries(s))t[e]=r;const o=yield{visitFn:n,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(x.push([r,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(x.push([r,t]),!e){if(!a(t))continue;w=t}}else if(void 0!==o&&(x.push([r,o]),!e)){if(!a(o))continue;w=o}b._markStale()}}if(!e){if(d={inArray:y,index:g,keys:m,edits:x,parentPath:v,prev:d},y=Array.isArray(w),y)m=w;else if(h)m=n(w);else{const e=o(w);m=void 0!==e?n[e]??[]:[]}g=-1,x=[],void 0!==f&&k.push(f),f=w,v=b}}while(void 0!==d);return 0!==x.length?x.at(-1)[1]:e}((e,t={})=>{const{visitFnGetter:r=_r,nodeTypeGetter:n=Dr,exposeEdits:s=!1}=t,o=Symbol("internal-skip"),a=Symbol("break"),c=new Array(e.length).fill(o);return{enter(t){let l=t.node,u=!1;for(let p=0;p<e.length;p+=1)if(c[p]===o){const o=r(e[p],n(l),!1);if("function"==typeof o){const r=Ur(t,l),n=o.call(e[p],r);if(Fr(n))throw new i("Async visitor not supported in sync mode",{visitor:e[p],visitFn:o});if(r.shouldStop){c[p]=a;break}if(r.shouldSkip&&(c[p]=l),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!s)return t.replaceWith(e),e;l=e,u=!0}else if(void 0!==n){if(!s)return t.replaceWith(n),n;l=n,u=!0}}}if(u)return t.replaceWith(l),l},leave(t){const s=t.node;for(let l=0;l<e.length;l+=1)if(c[l]===o){const o=r(e[l],n(s),!0);if("function"==typeof o){const r=Ur(t,s),n=o.call(e[l],r);if(Fr(n))throw new i("Async visitor not supported in sync mode",{visitor:e[l],visitFn:o});if(r.shouldStop){c[l]=a;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==n)return t.replaceWith(n),n}}else c[l]===s&&(c[l]=o)}}})[Symbol.for("nodejs.util.promisify.custom")]=(e,t={})=>{const{visitFnGetter:r=_r,nodeTypeGetter:n=Dr,exposeEdits:s=!1}=t,o=Symbol("internal-skip"),i=Symbol("break"),a=new Array(e.length).fill(o);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===o){const o=r(e[u],n(c),!1);if("function"==typeof o){const r=Ur(t,c),n=await o.call(e[u],r);if(r.shouldStop){a[u]=i;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==n){if(!s)return t.replaceWith(n),n;c=n,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===o){const o=r(e[c],n(s),!0);if("function"==typeof o){const r=Ur(t,s),n=await o.call(e[c],r);if(r.shouldStop){a[c]=i;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==n)return t.replaceWith(n),n}}else a[c]===s&&(a[c]=o)}}};const Gr=(e,t,r={})=>{const n=Hr(e,t,{keyMap:r.keyMap??qr,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??Dr,nodePredicate:r.nodePredicate??Lr,nodeCloneFn:r.nodeCloneFn??Br,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??$r});let s=n.next();for(;!s.done;){const e=s.value,r=e.visitFn.call(t,e.path);if(Fr(r))throw new i("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=n.next(r)}return s.value},zr=async(e,t,r={})=>{const n=Hr(e,t,{keyMap:r.keyMap??qr,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??Dr,nodePredicate:r.nodePredicate??Lr,nodeCloneFn:r.nodeCloneFn??Br,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??$r});let s=n.next();for(;!s.done;){const e=s.value,r=await e.visitFn.call(t,e.path);s=n.next(r)}return s.value};Gr[Symbol.for("nodejs.util.promisify.custom")]=zr,wt.prototype.traverse=function(e,t){return Gr(this.node,e,t)},wt.prototype.traverseAsync=function(e,t){return zr(this.node,e,t)};const Vr=class extends q{name="apidom";isArray(e){return Ie(e)}isObject(e){return Pe(e)}sizeOf(e){return this.isArray(e)||this.isObject(e)?e.length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new _(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)}if(this.isObject(e)){const r=e.keys(),n=new Set(r);if(r.length!==n.size)throw new G(`Object key "${t}" is not unique — JSON Pointer requires unique member names`,{referenceToken:t,currentValue:e,realm:this.name});return e.hasKey(t)}return!1}evaluate(e,t){return this.isArray(e)?e.get(Number(t)):e.get(t)}},Xr=new Vr;const Jr=Q(function(e){return Tr(-1,e)}),Yr=(e,t,r)=>{let n,s=[],o=t;if(Gr(r,{enter(e){e.node===t&&(s=e.getAncestorNodes().reverse().filter(Ee),e.stop())}}),0===s.length)throw new l("Relative JSON Pointer evaluation failed. Current element not found inside the root element",{relativePointer:e,currentElement:Ge(t),rootElement:Ge(r),cursorElement:Ge.safe(o)});if(Jr(s)===r)throw new l("Relative JSON Pointer evaluation failed. Current element cannot be the root element",{relativePointer:e,currentElement:t,rootElement:r,cursorElement:o});try{n=J(e)}catch(r){throw new l("Relative JSON Pointer evaluation failed while parsing the pointer.",{relativePointer:e,currentElement:Ge(t),rootElement:Ge(t),cursorElement:Ge.safe(o),cause:r})}if(n.nonNegativeIntegerPrefix>0){const i=[...s];for(let{nonNegativeIntegerPrefix:e}=n;e>0;e-=1)o=i.pop(),Ce(o)&&(o=i.pop());if(void 0===o)throw new l(`Relative JSON Pointer evaluation failed on non-negative-integer prefix of "${n.nonNegativeIntegerPrefix}"`,{relativePointer:e,currentElement:Ge(t),rootElement:Ge(r),cursorElement:Ge.safe(o)});s=i}if("number"==typeof n.indexManipulation){const i=Jr(s);if(void 0===i||!Ie(i))throw new l(`Relative JSON Pointer evaluation failed failed on index-manipulation "${n.indexManipulation}"`,{relativePointer:e,currentElement:Ge(t),rootElement:Ge(r),cursorElement:Ge.safe(o)});const a=i.content,c=a.indexOf(o);if(o=a[c+n.indexManipulation],void 0===o)throw new l(`Relative JSON Pointer evaluation failed on index-manipulation "${n.indexManipulation}"`,{relativePointer:e,currentElement:Ge(t),rootElement:Ge(r),cursorElement:Ge.safe(o)})}if(Array.isArray(n.jsonPointerTokens)){o=((e,t,r={})=>z(e,t,{...r,realm:Xr}))(o,B(n.jsonPointerTokens))}else if(n.hashCharacter){if(o===r)throw new l('Relative JSON Pointer evaluation failed. Current element cannot be the root element to apply "#"',{relativePointer:e,currentElement:Ge(t),rootElement:Ge(r),cursorElement:Ge.safe(o)});const n=Jr(s);void 0!==n&&(Ce(n)?o=n.key:Ie(n)&&(o=new Je(n.content.indexOf(o))))}return o};return t})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomJsonPointerRelative=t():e.apidomJsonPointerRelative=t()}(self,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{CompilationRelativeJsonPointerError:()=>u,EvaluationRelativeJsonPointerError:()=>l,InvalidRelativeJsonPointerError:()=>c,RelativeJsonPointerError:()=>a,compile:()=>Y,evaluate:()=>Qr,isRelativeJsonPointer:()=>X,parse:()=>J});class r extends AggregateError{constructor(e,t,r){super(e,t,r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const n=r;class s extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(n,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const o=s;const i=class extends o{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}};const a=class extends i{};class c extends a{relativePointer;constructor(e,t){super(e,t),void 0!==t&&(this.relativePointer=t.relativePointer)}}const l=class extends a{relativePointer;currentElement;rootElement;cursorElement;constructor(e,t){super(e,t),void 0!==t&&(this.relativePointer=t.relativePointer,this.currentElement=t.currentElement,this.rootElement=t.rootElement,this.cursorElement=t.cursorElement)}};const u=class extends a{nonNegativeIntegerPrefix;indexManipulation;jsonPointerTokens;hashCharacter;constructor(e,t){super(e,t),void 0!==t&&(this.nonNegativeIntegerPrefix=t.relativePointer.nonNegativeIntegerPrefix,this.indexManipulation=t.relativePointer.indexManipulation,this.hashCharacter=t.relativePointer.hashCharacter,Array.isArray(t.relativePointer.jsonPointerTokens)&&(this.jsonPointerTokens=[...t.relativePointer.jsonPointerTokens]))}},p=function(){const e=m,t=y,r=this,n="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let s,o,i,a,c,l,u,p=0,h=0,d=0,f=0,g=0,x=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(y,m,w,b)=>{const k=`${n}parse(): `;p=0,h=0,d=0,f=0,g=0,s=void 0,o=void 0,i=void 0,a=void 0,x.refresh(),c=void 0,l=void 0,u=void 0,a=t.stringToChars(w),s=y.rules,o=y.udts;const T=m.toLowerCase();let A;for(const e in s)if(s.hasOwnProperty(e)&&T===s[e].lower){A=s[e].index;break}if(void 0===A)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${n}initializeCallbacks(): `;let t,i;for(c=[],l=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<o.length;t+=1)l[t]=void 0;const a=[];for(t=0;t<s.length;t+=1)a.push(s[t].lower);for(t=0;t<o.length;t+=1)a.push(o[t].lower);for(const n in r.callbacks)if(r.callbacks.hasOwnProperty(n)){if(t=a.indexOf(n.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${n}' not a rule or udt name`);if(i=r.callbacks[n]?r.callbacks[n]:void 0,"function"!=typeof i&&void 0!==i)throw new Error(`${e}syntax callback[${n}] must be function reference or falsy)`);t<s.length?c[t]=i:l[t-s.length]=i}})(),r.trace&&r.trace.init(s,o,a),r.stats&&r.stats.init(s,o),r.ast&&r.ast.init(s,o,a),u=b,i=[{type:e.RNM,index:A}],v(0,0),i=void 0;let S=!1;switch(x.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:S=!1;break;case e.EMPTY:case e.MATCH:S=x.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:S,state:x.state,stateName:e.idName(x.state),length:a.length,matched:x.phraseLength,maxMatched:g,maxTreeDepth:d,nodeHits:f}};const w=(t,r,s,o)=>{if(r.phraseLength>s){let e=`${n}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!o)throw new Error(`${n}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},b=(t,c)=>{let h,d,f;const y=i[t],m=o[y.index];x.UdtIndex=m.index,p||(f=r.ast&&r.ast.udtDefined(y.index),f&&(d=s.length+y.index,h=r.ast.getLength(),r.ast.down(d,m.name)));const g=a.length-c;l[y.index](x,a,c,u),((t,r,s)=>{if(r.phraseLength>s){let e=`${n}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${n}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(m,x,g),p||f&&(x.state===e.NOMATCH?r.ast.setLength(h):r.ast.up(d,m.name,c,x.phraseLength))},v=(t,o)=>{const l=`${n}opExecute(): `,y=i[t];switch(f+=1,h>d&&(d=h),h+=1,x.refresh(),r.trace&&r.trace.down(y,o),y.type){case e.ALT:((t,r)=>{const n=i[t];for(let t=0;t<n.children.length&&(v(n.children[t],r),x.state===e.NOMATCH);t+=1);})(t,o);break;case e.CAT:((t,n)=>{let s,o,a,c;const l=i[t];r.ast&&(o=r.ast.getLength()),s=!0,a=n,c=0;for(let t=0;t<l.children.length;t+=1){if(v(l.children[t],a),x.state===e.NOMATCH){s=!1;break}a+=x.phraseLength,c+=x.phraseLength}s?(x.state=0===c?e.EMPTY:e.MATCH,x.phraseLength=c):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(o))})(t,o);break;case e.REP:((t,n)=>{let s,o,c,l;const u=i[t];if(0===u.max)return x.state=e.EMPTY,void(x.phraseLength=0);for(o=n,c=0,l=0,r.ast&&(s=r.ast.getLength());!(o>=a.length)&&(v(t+1,o),x.state!==e.NOMATCH)&&x.state!==e.EMPTY&&(l+=1,c+=x.phraseLength,o+=x.phraseLength,l!==u.max););x.state===e.EMPTY||l>=u.min?(x.state=0===c?e.EMPTY:e.MATCH,x.phraseLength=c):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(s))})(t,o);break;case e.RNM:((t,n)=>{let o,l,h;const d=i[t],f=s[d.index],y=c[f.index];if(p||(l=r.ast&&r.ast.ruleDefined(d.index),l&&(o=r.ast.getLength(),r.ast.down(d.index,s[d.index].name))),y){const t=a.length-n;y(x,a,n,u),w(f,x,t,!0),x.state===e.ACTIVE&&(h=i,i=f.opcodes,v(0,n),i=h,y(x,a,n,u),w(f,x,t,!1))}else h=i,i=f.opcodes,v(0,n,x),i=h;p||l&&(x.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(d.index,f.name,n,x.phraseLength))})(t,o);break;case e.TRG:((t,r)=>{const n=i[t];x.state=e.NOMATCH,r<a.length&&n.min<=a[r]&&a[r]<=n.max&&(x.state=e.MATCH,x.phraseLength=1)})(t,o);break;case e.TBS:((t,r)=>{const n=i[t],s=n.string.length;if(x.state=e.NOMATCH,r+s<=a.length){for(let e=0;e<s;e+=1)if(a[r+e]!==n.string[e])return;x.state=e.MATCH,x.phraseLength=s}})(t,o);break;case e.TLS:((t,r)=>{let n;const s=i[t];x.state=e.NOMATCH;const o=s.string.length;if(0!==o){if(r+o<=a.length){for(let e=0;e<o;e+=1)if(n=a[r+e],n>=65&&n<=90&&(n+=32),n!==s.string[e])return;x.state=e.MATCH,x.phraseLength=o}}else x.state=e.EMPTY})(t,o);break;case e.UDT:b(t,o);break;case e.AND:((t,r)=>{switch(p+=1,v(t+1,r),p-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.EMPTY;break;case e.NOMATCH:x.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${x.state}`)}})(t,o);break;case e.NOT:((t,r)=>{switch(p+=1,v(t+1,r),p-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.NOMATCH;break;case e.NOMATCH:x.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${x.state}`)}})(t,o);break;default:throw new Error(`${l}unrecognized operator`)}p||o+x.phraseLength>g&&(g=o+x.phraseLength),r.stats&&r.stats.collect(y,x),r.trace&&r.trace.up(y,x.state,o,x.phraseLength),h-=1}},h=function(){const e=m,t=y,r=this;let n,s,o,i=0;const a=[],c=[],l=[];function u(e){let t="";for(;e-- >0;)t+=" ";return t}r.callbacks=[],r.init=(e,t,u)=>{let p;c.length=0,l.length=0,i=0,n=e,s=t,o=u;const h=[];for(p=0;p<n.length;p+=1)h.push(n[p].lower);for(p=0;p<s.length;p+=1)h.push(s[p].lower);for(i=n.length+s.length,p=0;p<i;p+=1)a[p]=void 0;for(const e in r.callbacks)if(r.callbacks.hasOwnProperty(e)){const t=e.toLowerCase();if(p=h.indexOf(t),p<0)throw new Error(`parser.js: Ast()): init: node '${e}' not a rule or udt name`);a[p]=r.callbacks[e]}},r.ruleDefined=e=>!!a[e],r.udtDefined=e=>!!a[n.length+e],r.down=(t,r)=>{const n=l.length;return c.push(n),l.push({name:r,thisIndex:n,thatIndex:void 0,state:e.SEM_PRE,callbackIndex:t,phraseIndex:void 0,phraseLength:void 0,stack:c.length}),n},r.up=(t,r,n,s)=>{const o=l.length,i=c.pop();return l.push({name:r,thisIndex:o,thatIndex:i,state:e.SEM_POST,callbackIndex:t,phraseIndex:n,phraseLength:s,stack:c.length}),l[i].thatIndex=o,l[i].phraseIndex=n,l[i].phraseLength=s,o},r.translate=t=>{let r,n;for(let s=0;s<l.length;s+=1)n=l[s],r=a[n.callbackIndex],r&&(n.state===e.SEM_PRE?r(e.SEM_PRE,o,n.phraseIndex,n.phraseLength,t):r&&r(e.SEM_POST,o,n.phraseIndex,n.phraseLength,t))},r.setLength=e=>{l.length=e,c.length=e>0?l[e-1].stack:0},r.getLength=()=>l.length,r.toXml=()=>{let r="",n=0;return r+='<?xml version="1.0" encoding="utf-8"?>\n',r+=`<root nodes="${l.length/2}" characters="${o.length}">\n`,r+="\x3c!-- input string --\x3e\n",r+=u(n+2),r+=t.charsToString(o),r+="\n",l.forEach(s=>{s.state===e.SEM_PRE?(n+=1,r+=u(n),r+=`<node name="${s.name}" index="${s.phraseIndex}" length="${s.phraseLength}">\n`,r+=u(n+2),r+=t.charsToString(o,s.phraseIndex,s.phraseLength),r+="\n"):(r+=u(n),r+=`</node>\x3c!-- name="${s.name}" --\x3e\n`,n-=1)}),r+="</root>\n",r}},d=function(){const e=m,t=y,r="parser.js: Trace(): ";let n,s,o,i="",a=0;const c=this,l=e=>{let t="",r=0;if(e>=0)for(;e--;)r+=1,5===r?(t+="|",r=0):t+=".";return t};c.init=(e,t,r)=>{s=e,o=t,n=r};const u=n=>{let i;switch(n.type){case e.ALT:i="ALT";break;case e.CAT:i="CAT";break;case e.REP:i=n.max===1/0?`REP(${n.min},inf)`:`REP(${n.min},${n.max})`;break;case e.RNM:i=`RNM(${s[n.index].name})`;break;case e.TRG:i=`TRG(${n.min},${n.max})`;break;case e.TBS:i=n.string.length>6?`TBS(${t.charsToString(n.string,0,3)}...)`:`TBS(${t.charsToString(n.string,0,6)})`;break;case e.TLS:i=n.string.length>6?`TLS(${t.charsToString(n.string,0,3)}...)`:`TLS(${t.charsToString(n.string,0,6)})`;break;case e.UDT:i=`UDT(${o[n.index].name})`;break;case e.AND:i="AND";break;case e.NOT:i="NOT";break;default:throw new Error(`${r}Trace: opName: unrecognized opcode`)}return i};c.down=(e,r)=>{const s=l(a),o=Math.min(100,n.length-r);let c=t.charsToString(n,r,o);o<n.length-r&&(c+="..."),c=`${s}|-|[${u(e)}]${c}\n`,i+=c,a+=1},c.up=(s,o,c,p)=>{const h=`${r}trace.up: `;a-=1;const d=l(a);let f,y,m;switch(o){case e.EMPTY:m="|E|",y="''";break;case e.MATCH:m="|M|",f=Math.min(100,p),y=f<p?`'${t.charsToString(n,c,f)}...'`:`'${t.charsToString(n,c,f)}'`;break;case e.NOMATCH:m="|N|",y="";break;default:throw new Error(`${h} unrecognized state`)}y=`${d}${m}[${u(s)}]${y}\n`,i+=y},c.displayTrace=()=>i},f=function(){const e=m;let t,r,n;const s=[],o=[],i=[];this.init=(e,n)=>{t=e,r=n,h()},this.collect=(t,r)=>{d(n,r.state,r.phraseLength),d(s[t.type],r.state,r.phraseLength),t.type===e.RNM&&d(o[t.index],r.state,r.phraseLength),t.type===e.UDT&&d(i[t.index],r.state,r.phraseLength)},this.displayStats=()=>{let t="";const r={match:0,empty:0,nomatch:0,total:0},n=(e,t,n,s,o)=>{r.match+=t,r.empty+=n,r.nomatch+=s,r.total+=o;return`${e} | ${a(t)} | ${a(n)} | ${a(s)} | ${a(o)} |\n`};return t+=" OPERATOR STATS\n",t+=" | MATCH | EMPTY | NOMATCH | TOTAL |\n",t+=n(" ALT",s[e.ALT].match,s[e.ALT].empty,s[e.ALT].nomatch,s[e.ALT].total),t+=n(" CAT",s[e.CAT].match,s[e.CAT].empty,s[e.CAT].nomatch,s[e.CAT].total),t+=n(" REP",s[e.REP].match,s[e.REP].empty,s[e.REP].nomatch,s[e.REP].total),t+=n(" RNM",s[e.RNM].match,s[e.RNM].empty,s[e.RNM].nomatch,s[e.RNM].total),t+=n(" TRG",s[e.TRG].match,s[e.TRG].empty,s[e.TRG].nomatch,s[e.TRG].total),t+=n(" TBS",s[e.TBS].match,s[e.TBS].empty,s[e.TBS].nomatch,s[e.TBS].total),t+=n(" TLS",s[e.TLS].match,s[e.TLS].empty,s[e.TLS].nomatch,s[e.TLS].total),t+=n(" UDT",s[e.UDT].match,s[e.UDT].empty,s[e.UDT].nomatch,s[e.UDT].total),t+=n(" AND",s[e.AND].match,s[e.AND].empty,s[e.AND].nomatch,s[e.AND].total),t+=n(" NOT",s[e.NOT].match,s[e.NOT].empty,s[e.NOT].nomatch,s[e.NOT].total),t+=n("TOTAL",r.match,r.empty,r.nomatch,r.total),t},this.displayHits=e=>{let t="";const r=(e,t,r,s,o)=>{n.match+=e,n.empty+=t,n.nomatch+=r,n.total+=s;return`| ${a(e)} | ${a(t)} | ${a(r)} | ${a(s)} | ${o}\n`};"string"==typeof e&&"a"===e.toLowerCase()[0]?(o.sort(c),i.sort(c),t+=" RULES/UDTS ALPHABETICALLY\n"):"string"==typeof e&&"i"===e.toLowerCase()[0]?(o.sort(u),i.sort(u),t+=" RULES/UDTS BY INDEX\n"):(o.sort(l),i.sort(l),t+=" RULES/UDTS BY HIT COUNT\n"),t+="| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";for(let e=0;e<o.length;e+=1){let n=o[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}for(let e=0;e<i.length;e+=1){let n=i[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}return t};const a=e=>e<10?` ${e}`:e<100?` ${e}`:e<1e3?` ${e}`:e<1e4?` ${e}`:e<1e5?` ${e}`:e<1e6?` ${e}`:`${e}`,c=(e,t)=>e.lower<t.lower?-1:e.lower>t.lower?1:0,l=(e,t)=>e.total<t.total?1:e.total>t.total?-1:c(e,t),u=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0,p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},h=()=>{s.length=0,n=new p,s[e.ALT]=new p,s[e.CAT]=new p,s[e.REP]=new p,s[e.RNM]=new p,s[e.TRG]=new p,s[e.TBS]=new p,s[e.TLS]=new p,s[e.UDT]=new p,s[e.AND]=new p,s[e.NOT]=new p,o.length=0;for(let e=0;e<t.length;e+=1)o.push({empty:0,match:0,nomatch:0,total:0,name:t[e].name,lower:t[e].lower,index:t[e].index});if(r.length>0){i.length=0;for(let e=0;e<r.length;e+=1)i.push({empty:0,match:0,nomatch:0,total:0,name:r[e].name,lower:r[e].lower,index:r[e].index})}},d=(t,r)=>{switch(t.total+=1,r){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`parser.js: Stats(): collect(): incStat(): unrecognized state: ${r}`)}}},y={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,r)=>{let n=e;for(;!(void 0===t||t<0);){if(void 0===r){n=e.slice(t);break}if(r<=0)return"";n=e.slice(t,t+r);break}return String.fromCodePoint(...n)}},m={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case m.ALT:return"ALT";case m.CAT:return"CAT";case m.REP:return"REP";case m.RNM:return"RNM";case m.TRG:return"TRG";case m.TBS:return"TBS";case m.TLS:return"TLS";case m.UDT:return"UDT";case m.AND:return"AND";case m.NOT:return"NOT";case m.ACTIVE:return"ACTIVE";case m.EMPTY:return"EMPTY";case m.MATCH:return"MATCH";case m.NOMATCH:return"NOMATCH";case m.SEM_PRE:return"SEM_PRE";case m.SEM_POST:return"SEM_POST";case m.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function g(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class x extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const w=x;const b=class extends w{},v=e=>(t,r,n,s,o)=>{if("object"!=typeof o||null===o||Array.isArray(o))throw new b("parser's user data must be an object");if(t===m.SEM_PRE){const t={type:e,text:y.charsToString(r,n,s),start:n,length:s,children:[]};if(o.stack.length>0){o.stack[o.stack.length-1].children.push(t)}else o.root=t;o.stack.push(t)}t===m.SEM_POST&&o.stack.pop()};const k=class extends h{constructor(){super(),this.callbacks["json-pointer"]=v("json-pointer"),this.callbacks["reference-token"]=v("reference-token"),this.callbacks.slash=v("text")}getTree(){const e={stack:[],root:null};return this.translate(e),delete e.stack,e}},T=e=>{if("string"!=typeof e)throw new TypeError("Reference token must be a string");return e.replace(/~1/g,"/").replace(/~0/g,"~")};const A=class extends k{getTree(){const{root:e}=super.getTree();return e.children.filter(({type:e})=>"reference-token"===e).map(({text:e})=>T(e))}};const S=class extends Array{toString(){return this.map(e=>`"${String(e)}"`).join(", ")}};const E=class extends d{inferExpectations(){const e=this.displayTrace().split("\n"),t=new Set;let r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.includes("M|")){const e=s.match(/]'(.*)'$/);e&&e[1]&&(r=n)}if(n>r){const e=s.match(/N\|\[TLS\(([^)]+)\)]/);e&&t.add(e[1])}}return new S(...t)}},O=new g,I=(e,{translator:t=new A,stats:r=!1,trace:n=!1}={})=>{if("string"!=typeof e)throw new TypeError("JSON Pointer must be a string");try{const s=new p;t&&(s.ast=t),r&&(s.stats=new f),n&&(s.trace=new E);const o=s.parse(O,"json-pointer",e);return{result:o,tree:o.success&&t?s.ast.getTree():void 0,stats:s.stats,trace:s.trace}}catch(t){throw new b("Unexpected error during JSON Pointer parsing",{cause:t,jsonPointer:e})}};new g,new p,new g,new p;const P=new g,C=new p,M=e=>{if("string"!=typeof e)return!1;try{return C.parse(P,"array-index",e).success}catch{return!1}},j=new g,N=new p,F=e=>{if("string"!=typeof e)return!1;try{return N.parse(j,"array-dash",e).success}catch{return!1}},D=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const L=class extends w{},B=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return D(String(e))}).join("/")}`}catch(t){throw new L("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};const $=class{#e;#t;#r;constructor(e,t={}){this.#e=e,this.#e.steps=[],this.#e.failed=!1,this.#e.failedAt=-1,this.#e.message=`JSON Pointer "${t.jsonPointer}" was successfully evaluated against the provided value`,this.#e.context={...t,realm:t.realm.name},this.#t=[],this.#r=t.realm}step({referenceToken:e,input:t,output:r,success:n=!0,reason:s}){const o=this.#t.length;this.#t.push(e);const i={referenceToken:e,referenceTokenPosition:o,input:t,inputType:this.#r.isObject(t)?"object":this.#r.isArray(t)?"array":"unrecognized",output:r,success:n};s&&(i.reason=s),this.#e.steps.push(i),n||(this.#e.failed=!0,this.#e.failedAt=o,this.#e.message=s)}};const _=class{name="";isArray(e){throw new w("Realm.isArray(node) must be implemented in a subclass")}isObject(e){throw new w("Realm.isObject(node) must be implemented in a subclass")}sizeOf(e){throw new w("Realm.sizeOf(node) must be implemented in a subclass")}has(e,t){throw new w("Realm.has(node) must be implemented in a subclass")}evaluate(e,t){throw new w("Realm.evaluate(node) must be implemented in a subclass")}};const q=class extends w{};const R=class extends q{};const U=class extends _{name="json";isArray(e){return Array.isArray(e)}isObject(e){return"object"==typeof e&&null!==e&&!this.isArray(e)}sizeOf(e){return this.isArray(e)?e.length:this.isObject(e)?Object.keys(e).length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new R(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)&&Object.prototype.hasOwnProperty.call(e,r)}return!!this.isObject(e)&&Object.prototype.hasOwnProperty.call(e,t)}evaluate(e,t){return this.isArray(e)?e[Number(t)]:e[t]}};const H=class extends q{};const G=class extends q{},z=(e,t,{strictArrays:r=!0,strictObjects:n=!0,realm:s=new U,trace:o=!0}={})=>{const{result:i,tree:a,trace:c}=I(t,{trace:!!o});if(!i.success){let e=`Invalid JSON Pointer: "${t}". Syntax error at position ${i.maxMatched}`;throw e+=c?`, expected ${c.inferExpectations()}`:"",new b(e,{jsonPointer:t})}const l="object"==typeof o&&null!==o?new $(o,{jsonPointer:t,referenceTokens:a,strictArrays:r,strictObjects:n,realm:s,value:e}):null;try{let o;return a.reduce((e,i,c)=>{if(s.isArray(e)){if(F(i)){if(r)throw new R(`Invalid array index "-" at position ${c} in "${t}". The "-" token always refers to a nonexistent element during evaluation`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,String(s.sizeOf(e))),null==l||l.step({referenceToken:i,input:e,output:o}),o}if(!M(i))throw new R(`Invalid array index "${i}" at position ${c} in "${t}": index MUST be "0", or digits without a leading "0"`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});const n=Number(i);if(!Number.isSafeInteger(n))throw new R(`Invalid array index "${i}" at position ${c} in "${t}": index must be a safe integer`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});if(!s.has(e,i)&&r)throw new R(`Invalid array index "${i}" at position ${c} in "${t}": index not found in array`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:o}),o}if(s.isObject(e)){if(!s.has(e,i)&&n)throw new G(`Invalid object key "${i}" at position ${c} in "${t}": key not found in object`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return o=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:o}),o}throw new H(`Invalid reference token "${i}" at position ${c} in "${t}": cannot be applied to a non-object/non-array value`,{jsonPointer:t,referenceTokens:a,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name})},e)}catch(e){if(null==l||l.step({referenceToken:e.referenceToken,input:e.currentValue,success:!1,reason:e.message}),e instanceof q)throw e;throw new q("Unexpected error during JSON Pointer evaluation",{cause:e,jsonPointer:t,referenceTokens:a})}};const V=new RegExp("^(?<nonNegativeIntegerPrefix>[1-9]\\d*|0)(?<indexManipulation>[+-][1-9]\\d*|0)?((?<hashCharacter>#)|(?<jsonPointer>\\/.*))?$"),X=e=>"string"==typeof e&&V.test(e),J=e=>{const t=e.match(V);if(null===t||void 0===t.groups)throw new c(`Invalid Relative JSON Pointer "${e}".`,{relativePointer:e});try{const e=parseInt(t.groups.nonNegativeIntegerPrefix,10),r="string"==typeof t.groups.indexManipulation?parseInt(t.groups.indexManipulation,10):void 0,n="string"==typeof t.groups.jsonPointer?I(t.groups.jsonPointer).tree:void 0;return{nonNegativeIntegerPrefix:e,indexManipulation:r,jsonPointerTokens:n,hashCharacter:"string"==typeof t.groups.hashCharacter}}catch(t){throw new c(`Relative JSON Pointer parsing of "${e}" encountered an error.`,{relativePointer:e,cause:t})}},Y=e=>{try{let t="";return t+=String(e.nonNegativeIntegerPrefix),"number"==typeof e.indexManipulation&&(t+=String(e.indexManipulation)),Array.isArray(e.jsonPointerTokens)?t+=B(e.jsonPointerTokens):e.hashCharacter&&(t+="#"),t}catch(t){throw new u("Relative JSON Pointer compilation encountered an error.",{relativePointer:e,cause:t})}};function W(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function K(e){return function t(r){return 0===arguments.length||W(r)?t:e.apply(this,arguments)}}function Q(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return W(r)?t:K(function(t){return e(r,t)});default:return W(r)&&W(n)?t:W(r)?K(function(t){return e(t,n)}):W(n)?K(function(t){return e(r,t)}):e(r,n)}}}function Z(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function ee(e,t,r){for(var n=0,s=r.length;n<s;){if(e(t,r[n]))return!0;n+=1}return!1}function te(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const re="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var ne=Object.prototype.toString;const se=function(){return"[object Arguments]"===ne.call(arguments)?function(e){return"[object Arguments]"===ne.call(e)}:function(e){return te("callee",e)}}();var oe=!{toString:null}.propertyIsEnumerable("toString"),ie=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ae=function(){return arguments.propertyIsEnumerable("length")}(),ce=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},le="function"!=typeof Object.keys||ae?K(function(e){if(Object(e)!==e)return[];var t,r,n=[],s=ae&&se(e);for(t in e)!te(t,e)||s&&"length"===t||(n[n.length]=t);if(oe)for(r=ie.length-1;r>=0;)te(t=ie[r],e)&&!ce(n,t)&&(n[n.length]=t),r-=1;return n}):K(function(e){return Object(e)!==e?[]:Object.keys(e)});const ue=le;const pe=K(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function he(e,t,r,n){var s=Z(e);function o(e,t){return de(e,t,r.slice(),n.slice())}return!ee(function(e,t){return!ee(o,t,e)},Z(t),s)}function de(e,t,r,n){if(re(e,t))return!0;var s=pe(e);if(s!==pe(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!re(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!re(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===e)return n[o]===t;o-=1}switch(s){case"Map":return e.size===t.size&&he(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&he(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=ue(e);if(i.length!==ue(t).length)return!1;var a=r.concat([e]),c=n.concat([t]);for(o=i.length-1;o>=0;){var l=i[o];if(!te(l,t)||!de(t[l],e[l],a,c))return!1;o-=1}return!0}const fe=Q(function(e,t){return de(e,t,[],[])});function ye(e,t,r){if(r||(r=new me),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var n,s=function(n){var s=r.get(e);if(s)return s;for(var o in r.set(e,n),e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t?ye(e[o],!0,r):e[o]);return n};switch(pe(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return n=e,new RegExp(n.source,n.flags?n.flags:(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":"")+(n.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var me=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var r=this.hash(e),n=this.map[r];n||(this.map[r]=n=[]),n.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var r in e)t.push(Object.prototype.toString.call(e[r]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var r=this.map[t],n=0;n<r.length;n+=1){if((o=r[n])[0]===e)return o[1]}else{var s=this.hash(e);if(r=this.map[s])for(n=0;n<r.length;n+=1){var o;if((o=r[n])[0]===e)return o[1]}}},e}();const ge=K(function(e){return null!=e&&"function"==typeof e.clone?e.clone():ye(e,!0)});class xe{get(e){return this[e]}set(e,t){this[e]=t}hasKey(e){return Object.hasOwn(this,e)}keys(){return Object.keys(this)}remove(e){delete this[e]}get isEmpty(){return 0===Object.keys(this).length}get isFrozen(){return Object.isFrozen(this)}freeze(){for(const e of Object.values(this))e instanceof this.Element?e.freeze():(Array.isArray(e)||null!==e&&"object"==typeof e)&&Object.freeze(e);Object.freeze(this)}cloneShallow(){const e=new xe;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[r,n]of Object.entries(e)){const e=t.get(r);Array.isArray(e)&&Array.isArray(n)?t.set(r,[...e,...n]):t.set(r,n)}return t}cloneDeep(){const e=new xe;for(const[t,r]of Object.entries(this))r instanceof this.Element?e.set(t,this.cloneDeepElement(r)):e.set(t,ge(r));return e}}const we=xe;const be=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class ve{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(r=>{const n=r.value,s=r.key;if(void 0===n||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,n,s,r):e(n,s,r)})}filter(e,t){const r=this.elements.filter(r=>{const n=r.value,s=r.key;return void 0!==n&&void 0!==s&&(void 0!==t?e.call(t,n,s,r):e(n,s,r))});return new ve(r)}reject(e,t){const r=[];for(const n of this.elements){const s=n.value,o=n.key;void 0!==s&&void 0!==o&&(e.call(t,s,o,n)||r.push(n))}return new ve(r)}forEach(e,t){this.elements.forEach((r,n)=>{const s=r.value,o=r.key;void 0!==s&&void 0!==o&&(void 0!==t?e.call(t,s,o,r,n):e(s,o,r,n))})}find(e,t){return this.elements.find(r=>{const n=r.value,s=r.key;return void 0!==n&&void 0!==s&&(void 0!==t?e.call(t,n,s,r):e(n,s,r))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const ke=ve,Te=Object.freeze(new we);class Ae{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,r){void 0!==t&&(this.meta=t),void 0!==r&&(this.attributes=r),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof Ae)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof be)this._content=e;else if(e instanceof ke)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen)return Te;this._meta=new we}return this._meta}set meta(e){if(e instanceof we)this._meta=e;else if(e&&"object"==typeof e){const t=new we;Object.assign(t,e),this._meta=t}}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof Ae?this._attributes=e:this.attributes.set(e??{})}get id(){if(!this.hasMetaProperty("id")){if(this.isFrozen)return"";this.setMetaProperty("id","")}return this.meta.get("id")}set id(e){this.setMetaProperty("id",e)}get classes(){if(!this.hasMetaProperty("classes")){if(this.isFrozen)return[];this.setMetaProperty("classes",[])}return this.meta.get("classes")}set classes(e){this.setMetaProperty("classes",e)}get links(){if(!this.hasMetaProperty("links")){if(this.isFrozen){const e=new this.ArrayElement;return e.freeze(),e}this.setMetaProperty("links",new this.ArrayElement)}return this.meta.get("links")}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof be){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof Ae?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&this._meta.freeze(),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof Ae||e instanceof be?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof Ae?e.toValue():e;return fe(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id;if(""===t)throw new Error("Cannot create reference to an element without an ID");const r=new this.RefElement(t);return"string"==typeof e&&(r.path=this.refract(e)),r}getMetaProperty(e,t){return this.hasMetaProperty(e)?this.meta.get(e):t}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return void 0!==this._meta&&this._meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this._meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const Se=Ae;const Ee=class extends Se{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};class Oe extends Se{constructor(e,t,r){super(e||[],t,r)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const r=t||{},n=!!r.recursive,s=void 0===r.results?[]:r.results;for(let t=0;t<this._content.length;t+=1){const r=this._content[t],o=r;n&&"function"==typeof o.findElements&&o.findElements(e,{results:s,recursive:n}),e(r,t,void 0)&&s.push(r)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const r=t.classes;return"function"==typeof r.includes&&r.includes(e)})}getById(e){return this.find(t=>t.id===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const Ie=Oe;const Pe=class extends Ie{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const r=[];for(const n of this._content){const s=e.call(t,n);s&&r.push(s)}return r}filter(e,t){const r=this._content.filter(e,t);return new this.constructor(r)}reject(e,t){const r=[];for(const n of this._content)e.call(t,n)||r.push(n);return new this.constructor(r)}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n=this.first);for(let t=r;t<this.length;t+=1){const r=e(n,this._content[t],t,this);n=void 0===r?r:this.refract(r)}return n}forEach(e,t){this._content.forEach((r,n)=>{e.call(t,r,n)})}empty(){return new this.constructor([])}};const Ce=class extends Se{constructor(e,t,r,n){super(new be,r,n),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const Me=class extends Ie{constructor(e,t,r){super(e||[],t,r),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(r=>r.key.toValue()!==e||(t=r,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const r=this.getMember(e);r?r.value=t:this._content.push(new Ce(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(r=>e.call(t,r.value,r.key,r))}compactMap(e,t){const r=[];return this.forEach((n,s,o)=>{const i=e.call(t,n,s,o);i&&r.push(i)}),r}filter(e,t){return new ke(this._content).filter(e,t)}reject(e,t){const r=[];for(const n of this._content)e.call(t,n.value,n.key,n)||r.push(n);return new ke(r)}forEach(e,t){this._content.forEach(r=>e.call(t,r.value,r.key,r))}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n=this._content[0]?.value);for(let t=r;t<this._content.length;t+=1){const r=this._content[t],s=e(n,r.value,r.key,r,this);n=void 0===s?s:this.refract(s)}return n}empty(){return new this.constructor([])}};const je=e=>e instanceof Se,Ne=e=>e instanceof Ee,Fe=e=>e instanceof Pe,De=e=>e instanceof Me,Le=e=>e instanceof Ce;class Be extends Ee{constructor(e,t,r){super(e,t,r),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:r,startOffset:n,endLine:s,endCharacter:o,endOffset:i}=e;if("number"!=typeof t||"number"!=typeof r||"number"!=typeof n||"number"!=typeof s||"number"!=typeof o||"number"!=typeof i)return;const a="sm1:"+[t,r,n,s,o,i].map(_e).join("");const c=new Be(a);return c.startLine=t,c.startCharacter=r,c.startOffset=n,c.endLine=s,c.endCharacter=o,c.endOffset=i,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,r=[];let n=0;for(let e=0;e<6;e++){const e=qe(t,n);r.push(e.value),n=e.next}return r}(this.content))}}const $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _e(e){let t=e>>>0,r="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),r+=$e[e]}while(0!==t);return r}function qe(e,t=0){let r=0,n=0,s=t;for(;;){const t=e[s++],o=$e.indexOf(t);if(-1===o)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(r|=(31&o)<<n,n+=5,!!!(32&o))break}return{value:r>>>0,next:s}}const Re=Be;const Ue=class extends i{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const He=class extends Ue{};const Ge=class extends Ue{},ze=(e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const s=Ye(e);r.set(e,s);const{content:o}=e;return Array.isArray(o)?s.content=o.map(e=>ze(e,n)):je(o)?s.content=ze(o,n):s.content=o instanceof be?Ve(o,n):o,s},Ve=(e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const{key:s,value:o}=e,i=void 0!==s?ze(s,n):void 0,a=void 0!==o?ze(o,n):void 0,c=new be(i,a);return r.set(e,c),c},Xe=(e,t={})=>{if(e instanceof be)return Ve(e,t);if(e instanceof ke)return((e,t)=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);const s=[...e].map(e=>ze(e,n)),o=new ke(s);return r.set(e,o),o})(e,t);if(je(e))return ze(e,t);throw new He("Value provided to cloneDeep function couldn't be cloned",{value:e})};Xe.safe=e=>{try{return Xe(e)}catch{return e}};const Je=e=>{const{key:t,value:r}=e;return new be(t,r)},Ye=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=Xe(e.attributes)),(e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset)(e)&&Re.transfer(e,t),(e=>void 0!==e.style)(e)&&(t.style=ge(e.style));const{content:r}=e;return je(r)?t.content=Ye(r):Array.isArray(r)?t.content=[...r]:t.content=r instanceof be?Je(r):r,t},We=e=>{if(e instanceof be)return Je(e);if(e instanceof ke)return(e=>{const t=[...e];return new ke(t)})(e);if(je(e))return Ye(e);throw new Ge("Value provided to cloneShallow function couldn't be cloned",{value:e})};We.safe=e=>{try{return We(e)}catch{return e}};const Ke=class extends Se{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}};class Qe extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const Ze=Qe;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const et=class extends Ze{},tt=e=>{if(!Array.isArray(e))throw new et("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const r of e){const e=r.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:r}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new et("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},rt=(e,t,r,n)=>{const{realm:s}=e,{value:o}=r;if(s.isObject(t)&&s.hasProperty(t,o)){n(s.getProperty(t,o),o)}},nt=(e,t,r,n)=>{const{realm:s}=e,{value:o}=r;if(!s.isArray(t))return;const i=s.getLength(t),a=((e,t)=>e>=0?e:t+e)(o,i);if(a>=0&&a<i){n(s.getElement(t,a),a)}},st=(e,t,r,n)=>{const{realm:s}=e;for(const[e,r]of s.entries(t))n(r,e)},ot=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),it=(e,t,r,n)=>{const{realm:s}=e,{start:o,end:i,step:a}=r;if(!s.isArray(t))return;const c=((e,t,r,n)=>{const s=r??1;if(0===s)return null;let o,i;if(s>0){const r=0,s=n,a=null!==e?ot(e,n):r,c=null!==t?ot(t,n):s;o=Math.max(a,0),i=Math.min(c,n)}else{const r=n-1,s=-n-1,a=null!==e?e>=0?Math.min(e,n-1):Math.max(n+e,-1):r,c=null!==t?t>=0?Math.min(t,n-1):Math.max(n+t,-1):s;i=Math.min(a,n-1),o=Math.max(c,-1)}return{lower:o,upper:i,step:s}})(o,i,a,s.getLength(t));if(null===c)return;const{lower:l,upper:u,step:p}=c;if(p>0)for(let e=l;e<u;e+=p){n(s.getElement(t,e),e)}else for(let e=u;e>l;e+=p){n(s.getElement(t,e),e)}},at=(e,t,r,n)=>n.value,ct=(e,t,r)=>{const{realm:n}=e,{selector:s}=r;switch(s.type){case"NameSelector":{const{value:e}=s;return n.isObject(t)&&n.hasProperty(t,e)?n.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=s;if(!n.isArray(t))return;const r=n.getLength(t),o=e>=0?e:r+e;return o>=0&&o<r?n.getElement(t,o):void 0}default:return}},lt=(e,t,r,n)=>{const{selectors:s}=r;for(const r of s)vt(e,t,r,n)},ut=(e,t,r)=>{const n=[],s=e=>{n.push(e)},{selector:o}=r;switch(o.type){case"BracketedSelection":lt(e,t,o,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":vt(e,t,o,s)}return n},pt=(e,t,r,n)=>{let s=r;for(const t of n){const r=[];if("DescendantSegment"===t.type){const n=s=>{const{realm:o}=e,i=ut(e,s,t);r.push(...i);for(const[,e]of o.entries(s))n(e)};for(const e of s)n(e)}else for(const n of s){const s=ut(e,n,t);r.push(...s)}s=r}return s},ht=(e,t,r,n)=>{const{query:s}=n;let o;switch(s.type){case"RelQuery":o=((e,t,r,n)=>{const{segments:s}=n;return 0===s.length?[r]:pt(e,0,[r],s)})(e,0,r,s);break;case"JsonPathQuery":o=((e,t,r,n)=>{const{segments:s}=n;return 0===s.length?[t]:pt(e,0,[t],s)})(e,t,0,s);break;default:o=[]}return i=o,Object.defineProperty(i,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),i;var i};let dt;const ft=(e,t,r,n)=>{const{name:s,arguments:o}=n,i=e.functions[s];if("function"!=typeof i)return;const a=o.map(n=>((e,t,r,n)=>{switch(n.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return yt(e,t,r,n);case"FilterQuery":return ht(e,t,r,n);case"TestExpr":return"FilterQuery"===n.expression.type?ht(e,t,r,n.expression):"FunctionExpr"===n.expression.type?yt(e,t,r,n.expression):dt(e,t,r,n);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return dt(e,t,r,n);default:return}})(e,t,r,n));return i(e.realm,...a)},yt=(e,t,r,n)=>{switch(n.type){case"Literal":return at(e,t,r,n);case"RelSingularQuery":return((e,t,r,n)=>{let s=r;for(const t of n.segments)if(s=ct(e,s,t),void 0===s)return;return s})(e,0,r,n);case"AbsSingularQuery":return((e,t,r,n)=>{let s=t;for(const t of n.segments)if(s=ct(e,s,t),void 0===s)return;return s})(e,t,0,n);case"FunctionExpr":return ft(e,t,r,n);default:return}},mt=(e,t,r,n)=>{const{left:s,op:o,right:i}=n,a=yt(e,t,r,s),c=yt(e,t,r,i);return e.realm.compare(a,o,c)},gt=e=>Array.isArray(e),xt=(e,t,r,n)=>{switch(n.type){case"LogicalOrExpr":return!!xt(e,t,r,n.left)||xt(e,t,r,n.right);case"LogicalAndExpr":return!!xt(e,t,r,n.left)&&xt(e,t,r,n.right);case"LogicalNotExpr":return!xt(e,t,r,n.expression);case"TestExpr":{const{expression:s}=n;if("FilterQuery"===s.type){return ht(e,t,r,s).length>0}if("FunctionExpr"===s.type){const n=ft(e,t,r,s);return"boolean"==typeof n?n:void 0!==n&&(gt(n)?n.length>0:Boolean(n))}return!1}case"ComparisonExpr":return mt(e,t,r,n);default:return!1}};dt=xt;const wt=xt,bt=(e,t,r,n)=>{const{realm:s,root:o}=e,{expression:i}=r;for(const[r,a]of s.entries(t)){wt(e,o,a,i)&&n(a,r)}},vt=(e,t,r,n)=>{switch(r.type){case"NameSelector":rt(e,t,r,n);break;case"IndexSelector":nt(e,t,r,n);break;case"WildcardSelector":st(e,t,r,n);break;case"SliceSelector":it(e,t,r,n);break;case"FilterSelector":bt(e,t,r,n)}};new Map;class kt{node;key;index;parent;parentPath;inList;#n=!1;#s=!1;#o=!1;#i=!1;#a;#c=!1;constructor(e,t,r,n,s){this.node=e,this.parent=t,this.parentPath=r,this.key=n,this.index=s&&"number"==typeof n?n:void 0,this.inList=s}get shouldSkip(){return this.#n}get shouldStop(){return this.#s}get removed(){return this.#o}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;){const{key:r,parent:n,parentPath:s}=t;if(Le(n)&&"value"===r){if(!Ne(n.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(n.key.toValue())}else Fe(s?.node)&&"number"==typeof r&&e.unshift(r);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?tt(t):B(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#n=!0}stop(){this.#s=!0}replaceWith(e){this.#c&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#i=!0,this.#a=e,this.node=e}remove(){this.#c&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#o=!0}_getReplacementNode(){return this.#a}_wasReplaced(){return this.#i}_reset(){this.#n=!1,this.#s=!1,this.#o=!1,this.#i=!1,this.#a=void 0}_markStale(){this.#c=!0}}function Tt(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,s){return t.apply(this,arguments)};case 5:return function(e,r,n,s,o){return t.apply(this,arguments)};case 6:return function(e,r,n,s,o,i){return t.apply(this,arguments)};case 7:return function(e,r,n,s,o,i,a){return t.apply(this,arguments)};case 8:return function(e,r,n,s,o,i,a,c){return t.apply(this,arguments)};case 9:return function(e,r,n,s,o,i,a,c,l){return t.apply(this,arguments)};case 10:return function(e,r,n,s,o,i,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function At(e,t,r){return function(){for(var n=[],s=0,o=e,i=0,a=!1;i<t.length||s<arguments.length;){var c;i<t.length&&(!W(t[i])||s>=arguments.length)?c=t[i]:(c=arguments[s],s+=1),n[i]=c,W(c)?a=!0:o-=1,i+=1}return!a&&o<=0?r.apply(this,n):Tt(Math.max(0,o),At(e,n,r))}}var St=Q(function(e,t){return 1===e?K(t):Tt(e,At(e,[],t))});const Et=St;function Ot(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const It=Q(function(e,t){return e&&t});function Pt(e,t,r){for(var n=0,s=r.length;n<s;)t=e(t,r[n]),n+=1;return t}const Ct=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};const Mt=K(function(e){return!!Ct(e)||!!e&&("object"==typeof e&&(!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var jt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Nt(e,t,r){return function(n,s,o){if(Mt(o))return e(n,s,o);if(null==o)return s;if("function"==typeof o["fantasy-land/reduce"])return t(n,s,o,"fantasy-land/reduce");if(null!=o[jt])return r(n,s,o[jt]());if("function"==typeof o.next)return r(n,s,o);if("function"==typeof o.reduce)return t(n,s,o,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Ft(e,t,r){for(var n=r.next();!n.done;)t=e(t,n.value),n=r.next();return t}function Dt(e,t,r,n){return r[n](e,t)}const Lt=Nt(Pt,Dt,Ft);function Bt(e,t,r){return function(){if(0===arguments.length)return r();var n=arguments[arguments.length-1];if(!Ct(n)){for(var s=0;s<e.length;){if("function"==typeof n[e[s]])return n[e[s]].apply(n,Array.prototype.slice.call(arguments,0,-1));s+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(n))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(n)}return r.apply(this,arguments)}}function $t(e,t){for(var r=0,n=t.length,s=Array(n);r<n;)s[r]=e(t[r]),r+=1;return s}const _t=function(){return this.xf["@@transducer/init"]()},qt=function(e){return this.xf["@@transducer/result"](e)};var Rt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=_t,e.prototype["@@transducer/result"]=qt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Ut=Q(Bt(["fantasy-land/map","map"],function(e){return function(t){return new Rt(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Et(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Pt(function(r,n){return r[n]=e(t[n]),r},{},ue(t));default:return $t(e,t)}}));const Ht=Ut;const Gt=Q(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:Lt(function(e,r){return function(e,t){var r;t=t||[];var n=(e=e||[]).length,s=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<s;)o[o.length]=t[r],r+=1;return o}(e,Ht(r,t))},[],e)});var zt=Q(function(e,t){var r=Et(e,t);return Et(e,function(){return Pt(Gt,Ht(r,arguments[0]),Array.prototype.slice.call(arguments,1))})});const Vt=zt;var Xt=K(function(e){return Vt(e.length,e)});const Jt=Xt;const Yt=Q(function(e,t){return Ot(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:Jt(It)(e,t)});function Wt(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function Kt(e){return function t(r,n,s){switch(arguments.length){case 0:return t;case 1:return W(r)?t:Q(function(t,n){return e(r,t,n)});case 2:return W(r)&&W(n)?t:W(r)?Q(function(t,r){return e(t,n,r)}):W(n)?Q(function(t,n){return e(r,t,n)}):K(function(t){return e(r,n,t)});default:return W(r)&&W(n)&&W(s)?t:W(r)&&W(n)?Q(function(t,r){return e(t,r,s)}):W(r)&&W(s)?Q(function(t,r){return e(t,n,r)}):W(n)&&W(s)?Q(function(t,n){return e(r,t,n)}):W(r)?K(function(t){return e(t,n,s)}):W(n)?K(function(t){return e(r,t,s)}):W(s)?K(function(t){return e(r,n,t)}):e(r,n,s)}}}function Qt(e,t,r){for(var n=0,s=r.length;n<s;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}var Zt=Q(function(e,t){return Tt(e.length,function(){return e.apply(t,arguments)})});const er=Zt;function tr(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function rr(e,t,r,n){return e["@@transducer/result"](r[n](er(e["@@transducer/step"],e),t))}const nr=Nt(Qt,rr,tr);var sr=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var or=Kt(function(e,t,r){return nr("function"==typeof e?function(e){return new sr(e)}(e):e,t,r)});const ir=or;function ar(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return Ct(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}const cr=K(ar("tail",Kt(ar("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}))(1,1/0)));function lr(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Tt(arguments[0].length,ir(Wt,arguments[0],cr(arguments)))}function ur(e,t){return function(e,t,r){var n,s;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(s=e[r])&&1/s===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(s=e[r])&&s!=s)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(fe(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function pr(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var hr=function(e){return(e<10?"0":"")+e};const dr="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+hr(e.getUTCMonth()+1)+"-"+hr(e.getUTCDate())+"T"+hr(e.getUTCHours())+":"+hr(e.getUTCMinutes())+":"+hr(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var fr=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=_t,e.prototype["@@transducer/result"]=qt,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function yr(e){return function(t){return new fr(e,t)}}var mr=Q(Bt(["fantasy-land/filter","filter"],yr,function(e,t){return r=t,"[object Object]"===Object.prototype.toString.call(r)?Pt(function(r,n){return e(t[n])&&(r[n]=t[n]),r},{},ue(t)):function(e){return"[object Map]"===Object.prototype.toString.call(e)}(t)?function(e,t){for(var r=new Map,n=t.entries(),s=n.next();!s.done;)e(s.value[1])&&r.set(s.value[0],s.value[1]),s=n.next();return r}(e,t):function(e,t){for(var r=0,n=t.length,s=[];r<n;)e(t[r])&&(s[s.length]=t[r]),r+=1;return s}(e,t);var r}));const gr=mr;const xr=Q(function(e,t){return gr((r=e,function(){return!r.apply(this,arguments)}),t);var r});function wr(e,t){var r=function(r){var n=t.concat([e]);return ur(r,n)?"<Circular>":wr(r,n)},n=function(e,t){return $t(function(t){return pr(t)+": "+r(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+$t(r,e).join(", ")+"))";case"[object Array]":return"["+$t(r,e).concat(n(e,xr(function(e){return/^\d+$/.test(e)},ue(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):pr(dr(e)))+")";case"[object Map]":return"new Map("+r(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+r(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":pr(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var s=e.toString();if("[object Object]"!==s)return s}return"{"+n(e,ue(e)).join(", ")+"}"}}const br=K(function(e){return wr(e,[])});const vr=Q(function(e,t){return e||t});const kr=Q(function(e,t){return Ot(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:Jt(vr)(e,t)});const Tr=Jt(K(function(e){return!e}))(fe(null));const Ar=Q(function(e,t){if(e===t)return t;function r(e,t){if(e>t!=t>e)return t>e?t:e}var n=r(e,t);if(void 0!==n)return n;var s=r(typeof e,typeof t);if(void 0!==s)return s===typeof e?e:t;var o=br(e),i=r(o,br(t));return void 0!==i&&i===o?e:t}),Sr=Number.isInteger||function(e){return(e|0)===e};function Er(e,t){return t[e<0?t.length+e:e]}const Or=Q(function(e,t){if(null!=t)return Sr(e)?Er(e,t):t[e]});const Ir=Q(function(e,t){return Ht(Or(e),t)});const Pr=K(function(e){return Et(ir(Ar,0,Ir("length",e)),function(){for(var t=0,r=e.length;t<r;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Cr=function(e,t){switch(arguments.length){case 0:return Cr;case 1:return function t(r){return 0===arguments.length?t:re(e,r)};default:return re(e,t)}};const Mr=Cr;const jr=Et(1,lr(pe,Mr("GeneratorFunction")));const Nr=Et(1,lr(pe,Mr("AsyncFunction")));var Fr=Pr([lr(pe,Mr("Function")),jr,Nr]);function Dr(e){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dr(e)}var Lr=Et(1,Yt(Tr,kr(function(e){return"object"===Dr(e)},Fr)));const Br=Et(1,Yt(Lr,lr(br,fe("[object Promise]")))),$r=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},_r=e=>je(e),qr=e=>We(e),Rr=(e,t,r)=>{Le(e)?e.value=r:Array.isArray(e)?e[t]=null===r?void 0:r:null===r?delete e[t]:e[t]=r},Ur=e=>Le(e)?["key","value"]:Fe(e)||De(e)?["content"]:[],Hr=(e,t)=>{if(void 0!==e[t])return e[t];const r=t.length;for(const n in e){if(!n.includes("|"))continue;const s=n.indexOf(t);if(-1===s)continue;const o=0===s||"|"===n[s-1],i=s+r===n.length||"|"===n[s+r];if(o&&i)return e[n]}},Gr=(e,t,r)=>{if(void 0===t)return null;const n=e,s=r?"leave":"enter",o=Hr(n,t);if(!r&&"function"==typeof o)return o;if(null!=o){const e=o[s];if("function"==typeof e)return e}const i=n[s];if("function"==typeof i)return i;if(null!=i){const e=Hr(i,t);if("function"==typeof e)return e}return null};function zr(e,t){return new kt(t,e.parent,e.parentPath,e.key,e.inList)}function*Vr(e,t,r){const{keyMap:n,state:s,nodeTypeGetter:o,nodePredicate:a,nodeCloneFn:c,detectCycles:l,mutable:u,mutationFn:p}=r,h="function"==typeof n;let d,f,y=Array.isArray(e),m=[e],g=-1,x=[],w=e,b=null,v=null;const k=[];do{g+=1;const e=g===m.length;let r;const T=e&&0!==x.length;if(e){if(r=0===k.length?void 0:b?.key,w=f,f=k.pop(),v=b?.parentPath?.parentPath??null,T)if(u)for(const[e,t]of x)p(w,e,t);else if(y){w=w.slice();let e=0;for(const[t,r]of x){const n=t-e;null===r?(w.splice(n,1),e+=1):w[n]=r}}else{w=c(w);for(const[e,t]of x)w[e]=t}if(void 0!==d){g=d.index,m=d.keys,x=d.edits;const e=d.inArray;if(v=d.parentPath,d=d.prev,T&&!u){const t=e?g:m[g];x.push([t,w])}y=e}}else if(void 0!==f&&(r=y?g:m[g],w=f[r],void 0===w))continue;if(!Array.isArray(w)){if(!a(w))throw new i(`Invalid AST Node: ${String(w)}`,{node:w});if(l&&k.includes(w))continue;b=new kt(w,f,v,r,y);const n=Gr(t,o(w),e);if(n){for(const[e,r]of Object.entries(s))t[e]=r;const o=yield{visitFn:n,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(x.push([r,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(x.push([r,t]),!e){if(!a(t))continue;w=t}}else if(void 0!==o&&(x.push([r,o]),!e)){if(!a(o))continue;w=o}b._markStale()}}if(!e){if(d={inArray:y,index:g,keys:m,edits:x,parentPath:v,prev:d},y=Array.isArray(w),y)m=w;else if(h)m=n(w);else{const e=o(w);m=void 0!==e?n[e]??[]:[]}g=-1,x=[],void 0!==f&&k.push(f),f=w,v=b}}while(void 0!==d);return 0!==x.length?x.at(-1)[1]:e}((e,t={})=>{const{visitFnGetter:r=Gr,nodeTypeGetter:n=$r,exposeEdits:s=!1}=t,o=Symbol("internal-skip"),a=Symbol("break"),c=new Array(e.length).fill(o);return{enter(t){let l=t.node,u=!1;for(let p=0;p<e.length;p+=1)if(c[p]===o){const o=r(e[p],n(l),!1);if("function"==typeof o){const r=zr(t,l),n=o.call(e[p],r);if(Br(n))throw new i("Async visitor not supported in sync mode",{visitor:e[p],visitFn:o});if(r.shouldStop){c[p]=a;break}if(r.shouldSkip&&(c[p]=l),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!s)return t.replaceWith(e),e;l=e,u=!0}else if(void 0!==n){if(!s)return t.replaceWith(n),n;l=n,u=!0}}}if(u)return t.replaceWith(l),l},leave(t){const s=t.node;for(let l=0;l<e.length;l+=1)if(c[l]===o){const o=r(e[l],n(s),!0);if("function"==typeof o){const r=zr(t,s),n=o.call(e[l],r);if(Br(n))throw new i("Async visitor not supported in sync mode",{visitor:e[l],visitFn:o});if(r.shouldStop){c[l]=a;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==n)return t.replaceWith(n),n}}else c[l]===s&&(c[l]=o)}}})[Symbol.for("nodejs.util.promisify.custom")]=(e,t={})=>{const{visitFnGetter:r=Gr,nodeTypeGetter:n=$r,exposeEdits:s=!1}=t,o=Symbol("internal-skip"),i=Symbol("break"),a=new Array(e.length).fill(o);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===o){const o=r(e[u],n(c),!1);if("function"==typeof o){const r=zr(t,c),n=await o.call(e[u],r);if(r.shouldStop){a[u]=i;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==n){if(!s)return t.replaceWith(n),n;c=n,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===o){const o=r(e[c],n(s),!0);if("function"==typeof o){const r=zr(t,s),n=await o.call(e[c],r);if(r.shouldStop){a[c]=i;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==n)return t.replaceWith(n),n}}else a[c]===s&&(a[c]=o)}}};const Xr=(e,t,r={})=>{const n=Vr(e,t,{keyMap:r.keyMap??Ur,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??$r,nodePredicate:r.nodePredicate??_r,nodeCloneFn:r.nodeCloneFn??qr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??Rr});let s=n.next();for(;!s.done;){const e=s.value,r=e.visitFn.call(t,e.path);if(Br(r))throw new i("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=n.next(r)}return s.value},Jr=async(e,t,r={})=>{const n=Vr(e,t,{keyMap:r.keyMap??Ur,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??$r,nodePredicate:r.nodePredicate??_r,nodeCloneFn:r.nodeCloneFn??qr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??Rr});let s=n.next();for(;!s.done;){const e=s.value,r=await e.visitFn.call(t,e.path);s=n.next(r)}return s.value};Xr[Symbol.for("nodejs.util.promisify.custom")]=Jr,kt.prototype.traverse=function(e,t){return Xr(this.node,e,t)},kt.prototype.traverseAsync=function(e,t){return Jr(this.node,e,t)};const Yr=class extends _{name="apidom";isArray(e){return Fe(e)}isObject(e){return De(e)}sizeOf(e){return this.isArray(e)||this.isObject(e)?e.length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new R(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)}if(this.isObject(e)){const r=e.keys(),n=new Set(r);if(r.length!==n.size)throw new G(`Object key "${t}" is not unique — JSON Pointer requires unique member names`,{referenceToken:t,currentValue:e,realm:this.name});return e.hasKey(t)}return!1}evaluate(e,t){return this.isArray(e)?e.get(Number(t)):e.get(t)}},Wr=new Yr;const Kr=K(function(e){return Er(-1,e)}),Qr=(e,t,r)=>{let n,s=[],o=t;if(Xr(r,{enter(e){e.node===t&&(s=e.getAncestorNodes().reverse().filter(je),e.stop())}}),0===s.length)throw new l("Relative JSON Pointer evaluation failed. Current element not found inside the root element",{relativePointer:e,currentElement:Xe(t),rootElement:Xe(r),cursorElement:Xe.safe(o)});if(Kr(s)===r)throw new l("Relative JSON Pointer evaluation failed. Current element cannot be the root element",{relativePointer:e,currentElement:t,rootElement:r,cursorElement:o});try{n=J(e)}catch(r){throw new l("Relative JSON Pointer evaluation failed while parsing the pointer.",{relativePointer:e,currentElement:Xe(t),rootElement:Xe(t),cursorElement:Xe.safe(o),cause:r})}if(n.nonNegativeIntegerPrefix>0){const i=[...s];for(let{nonNegativeIntegerPrefix:e}=n;e>0;e-=1)o=i.pop(),Le(o)&&(o=i.pop());if(void 0===o)throw new l(`Relative JSON Pointer evaluation failed on non-negative-integer prefix of "${n.nonNegativeIntegerPrefix}"`,{relativePointer:e,currentElement:Xe(t),rootElement:Xe(r),cursorElement:Xe.safe(o)});s=i}if("number"==typeof n.indexManipulation){const i=Kr(s);if(void 0===i||!Fe(i))throw new l(`Relative JSON Pointer evaluation failed failed on index-manipulation "${n.indexManipulation}"`,{relativePointer:e,currentElement:Xe(t),rootElement:Xe(r),cursorElement:Xe.safe(o)});const a=i.content,c=a.indexOf(o);if(o=a[c+n.indexManipulation],void 0===o)throw new l(`Relative JSON Pointer evaluation failed on index-manipulation "${n.indexManipulation}"`,{relativePointer:e,currentElement:Xe(t),rootElement:Xe(r),cursorElement:Xe.safe(o)})}if(Array.isArray(n.jsonPointerTokens)){o=((e,t,r={})=>z(e,t,{...r,realm:Wr}))(o,B(n.jsonPointerTokens))}else if(n.hashCharacter){if(o===r)throw new l('Relative JSON Pointer evaluation failed. Current element cannot be the root element to apply "#"',{relativePointer:e,currentElement:Xe(t),rootElement:Xe(r),cursorElement:Xe.safe(o)});const n=Kr(s);void 0!==n&&(Le(n)?o=n.key:Fe(n)&&(o=new Ke(n.content.indexOf(o))))}return o};return t})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speclynx/apidom-json-pointer-relative",
3
- "version": "2.13.1",
3
+ "version": "3.1.0",
4
4
  "description": "Evaluate Relative JSON Pointer expressions against ApiDOM.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -39,11 +39,10 @@
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
41
  "@babel/runtime-corejs3": "^7.28.4",
42
- "@speclynx/apidom-core": "2.13.1",
43
- "@speclynx/apidom-datamodel": "2.13.1",
44
- "@speclynx/apidom-error": "2.13.1",
45
- "@speclynx/apidom-json-pointer": "2.13.1",
46
- "@speclynx/apidom-traverse": "2.13.1",
42
+ "@speclynx/apidom-datamodel": "3.1.0",
43
+ "@speclynx/apidom-error": "3.1.0",
44
+ "@speclynx/apidom-json-pointer": "3.1.0",
45
+ "@speclynx/apidom-traverse": "3.1.0",
47
46
  "ramda": "~0.32.0",
48
47
  "ramda-adjunct": "^6.0.0"
49
48
  },
@@ -57,5 +56,5 @@
57
56
  "README.md",
58
57
  "CHANGELOG.md"
59
58
  ],
60
- "gitHead": "7a15e77dd776ef85f3e4421f0b4be52362b16f68"
59
+ "gitHead": "c0807dd0b7770eaaf594bd0013be65e2c28c504a"
61
60
  }