@speclynx/apidom-ns-json-schema-draft-4 2.13.0 → 3.0.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 +19 -0
- package/dist/apidom-ns-json-schema-draft-4.browser.js +246 -100
- package/dist/apidom-ns-json-schema-draft-4.browser.min.js +1 -1
- package/package.json +5 -5
- package/src/refractor/index.cjs +4 -2
- package/src/refractor/index.mjs +4 -2
- package/src/refractor/plugins/replace-empty-element.cjs +4 -3
- package/src/refractor/plugins/replace-empty-element.mjs +4 -3
- package/src/refractor/visitors/FallbackVisitor.cjs +1 -1
- package/src/refractor/visitors/FallbackVisitor.mjs +1 -1
- package/src/refractor/visitors/SpecificationVisitor.cjs +2 -2
- package/src/refractor/visitors/SpecificationVisitor.mjs +2 -2
- package/src/refractor/visitors/Visitor.cjs +10 -8
- package/src/refractor/visitors/Visitor.mjs +11 -9
- package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +4 -3
- package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +4 -3
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +4 -2
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +4 -2
- package/src/refractor/visitors/json-schema/index.cjs +5 -4
- package/src/refractor/visitors/json-schema/index.mjs +6 -5
- package/types/apidom-ns-json-schema-draft-4.d.ts +6 -2
|
@@ -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.apidomNsJSONSchemaDraft4=t():e.apidomNsJSONSchemaDraft4=t()}(self,()=>(()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},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,{AllOfVisitorBase:()=>Qn,AlternatingVisitor:()=>Vi,AnyOfVisitorBase:()=>Zn,DefinitionsVisitorBase:()=>ri,DependenciesVisitorBase:()=>ni,FallbackVisitor:()=>dn,FixedFieldsVisitor:()=>On,ItemsVisitor:()=>di,ItemsVisitorBase:()=>ti,JSONReferenceElement:()=>H,JSONReferenceVisitorBase:()=>Wn,JSONSchemaDraft4MediaTypes:()=>m,JSONSchemaElement:()=>U,JSONSchemaVisitor:()=>pi,JSONSchemaVisitorBase:()=>Xn,LinkDescriptionElement:()=>J,LinkDescriptionVisitor:()=>Gi,LinkDescriptionVisitorBase:()=>Yn,LinksVisitorBase:()=>si,MapVisitor:()=>Jn,MediaElement:()=>G,MediaVisitorBase:()=>Kn,OneOfVisitorBase:()=>ei,ParentSchemaAwareVisitor:()=>zn,PatternPropertiesVisitorBase:()=>ii,PatternedFieldsVisitor:()=>Gn,PropertiesVisitorBase:()=>oi,SpecificationVisitor:()=>kn,Visitor:()=>hn,default:()=>z,isJSONReferenceElement:()=>ai,isJSONReferenceLikeElement:()=>hi,isJSONSchemaElement:()=>ci,isLinkDescriptionElement:()=>ui,isMediaElement:()=>li,mediaTypes:()=>y,refract:()=>Zi,refractJSONReference:()=>Yi,refractJSONSchema:()=>Wi,refractLinkDescription:()=>Qi,refractMedia:()=>Ki,refractorPluginReplaceEmptyElement:()=>Zs,specificationObj:()=>Ji});var s={};e.r(s),e.d(s,{isJSONReferenceElement:()=>ai,isJSONSchemaElement:()=>ci,isLinkDescriptionElement:()=>ui,isMediaElement:()=>li});var r={};function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(s){return 0===arguments.length||n(s)?t:e.apply(this,arguments)}}function o(e,t){return t[e<0?t.length+e:e]}e.r(r),e.d(r,{isJSONReferenceLikeElement:()=>hi});const c=i(function(e){return o(-1,e)});class a extends AggregateError{constructor(e,t,s){super(e,t,s),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const l=a;class u extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(l,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const p=u;const h=class extends p{};const d=class extends h{};const f=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new d("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new d("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new d("latest method in MediaTypes class is not yet implemented.")}};class m extends f{filterByFormat(e="generic"){const t="generic"===e?"schema;version":e;return this.filter(e=>e.includes(t))}findBy(e="draft-04",t="generic"){const s="generic"===t?`schema;version=${e}`:`schema+${t};version=${e}`;return this.find(e=>e.includes(s))||this.unknownMediaType}latest(e="generic"){return c(this.filterByFormat(e))}}const y=new m("application/schema;version=draft-04","application/schema+json;version=draft-04","application/schema+yaml;version=draft-04");function g(e){return function t(s,r){switch(arguments.length){case 0:return t;case 1:return n(s)?t:i(function(t){return e(s,t)});default:return n(s)&&n(r)?t:n(s)?i(function(t){return e(t,r)}):n(r)?i(function(t){return e(s,t)}):e(s,r)}}}function x(e){for(var t,s=[];!(t=e.next()).done;)s.push(t.value);return s}function b(e,t,s){for(var r=0,n=s.length;r<n;){if(e(t,s[r]))return!0;r+=1}return!1}function v(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const w="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var k=Object.prototype.toString;const O=function(){return"[object Arguments]"===k.call(arguments)?function(e){return"[object Arguments]"===k.call(e)}:function(e){return v("callee",e)}}();var E=!{toString:null}.propertyIsEnumerable("toString"),S=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],A=function(){return arguments.propertyIsEnumerable("length")}(),j=function(e,t){for(var s=0;s<e.length;){if(e[s]===t)return!0;s+=1}return!1},I="function"!=typeof Object.keys||A?i(function(e){if(Object(e)!==e)return[];var t,s,r=[],n=A&&O(e);for(t in e)!v(t,e)||n&&"length"===t||(r[r.length]=t);if(E)for(s=S.length-1;s>=0;)v(t=S[s],e)&&!j(r,t)&&(r[r.length]=t),s-=1;return r}):i(function(e){return Object(e)!==e?[]:Object.keys(e)});const M=I;const T=i(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function P(e,t,s,r){var n=x(e);function i(e,t){return F(e,t,s.slice(),r.slice())}return!b(function(e,t){return!b(i,t,e)},x(t),n)}function F(e,t,s,r){if(w(e,t))return!0;var n=T(e);if(n!==T(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(n){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||!w(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!w(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 i=s.length-1;i>=0;){if(s[i]===e)return r[i]===t;i-=1}switch(n){case"Map":return e.size===t.size&&P(e.entries(),t.entries(),s.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&P(e.values(),t.values(),s.concat([e]),r.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 o=M(e);if(o.length!==M(t).length)return!1;var c=s.concat([e]),a=r.concat([t]);for(i=o.length-1;i>=0;){var l=o[i];if(!v(l,t)||!F(t[l],e[l],c,a))return!1;i-=1}return!0}const C=g(function(e,t){return F(e,t,[],[])});const N=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class D{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(s=>{const r=s.value,n=s.key;if(void 0===r||void 0===n)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,n,s):e(r,n,s)})}filter(e,t){const s=this.elements.filter(s=>{const r=s.value,n=s.key;return void 0!==r&&void 0!==n&&(void 0!==t?e.call(t,r,n,s):e(r,n,s))});return new D(s)}reject(e,t){const s=[];for(const r of this.elements){const n=r.value,i=r.key;void 0!==n&&void 0!==i&&(e.call(t,n,i,r)||s.push(r))}return new D(s)}forEach(e,t){this.elements.forEach((s,r)=>{const n=s.value,i=s.key;void 0!==n&&void 0!==i&&(void 0!==t?e.call(t,n,i,s,r):e(n,i,s,r))})}find(e,t){return this.elements.find(s=>{const r=s.value,n=s.key;return void 0!==r&&void 0!==n&&(void 0!==t?e.call(t,r,n,s):e(r,n,s))})}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 B=D;class _{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,s){void 0!==t&&(this.meta=t),void 0!==s&&(this.attributes=s),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 _)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 N)this._content=e;else if(e instanceof B)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 _?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 _?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 N){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof _?[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 _||e instanceof N?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof _?e.toValue():e;return C(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 s=new this.RefElement(t);return"string"==typeof e&&(s.path=this.refract(e)),s}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 L=_;class q extends L{constructor(e,t,s){super(e||[],t,s)}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 s=t||{},r=!!s.recursive,n=void 0===s.results?[]:s.results;for(let t=0;t<this._content.length;t+=1){const s=this._content[t],i=s;r&&"function"==typeof i.findElements&&i.findElements(e,{results:n,recursive:r}),e(s,t,void 0)&&n.push(s)}return n}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 s=t.classes;return"function"==typeof s.includes&&s.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 $=q;const R=class extends L{constructor(e,t,s,r){super(new N,s,r),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 V=class extends ${constructor(e,t,s){super(e||[],t,s),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(s=>s.key.toValue()!==e||(t=s,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const s=this.getMember(e);s?s.value=t:this._content.push(new R(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(s=>e.call(t,s.value,s.key,s))}compactMap(e,t){const s=[];return this.forEach((r,n,i)=>{const o=e.call(t,r,n,i);o&&s.push(o)}),s}filter(e,t){return new B(this._content).filter(e,t)}reject(e,t){const s=[];for(const r of this._content)e.call(t,r.value,r.key,r)||s.push(r);return new B(s)}forEach(e,t){this._content.forEach(s=>e.call(t,s.value,s.key,s))}reduce(e,t){let s,r;void 0!==t?(s=0,r=this.refract(t)):(s=1,r=this._content[0]?.value);for(let t=s;t<this._content.length;t+=1){const s=this._content[t],n=e(r,s.value,s.key,s,this);r=void 0===n?n:this.refract(n)}return r}empty(){return new this.constructor([])}};const U=class extends V{constructor(e,t,s){super(e,t,s),this.element="JSONSchemaDraft4"}get idField(){return this.get("id")}set idField(e){this.set("id",e)}get $schema(){return this.get("$schema")}set $schema(e){this.set("$schema",e)}get multipleOf(){return this.get("multipleOf")}set multipleOf(e){this.set("multipleOf",e)}get maximum(){return this.get("maximum")}set maximum(e){this.set("maximum",e)}get exclusiveMaximum(){return this.get("exclusiveMaximum")}set exclusiveMaximum(e){this.set("exclusiveMaximum",e)}get minimum(){return this.get("minimum")}set minimum(e){this.set("minimum",e)}get exclusiveMinimum(){return this.get("exclusiveMinimum")}set exclusiveMinimum(e){this.set("exclusiveMinimum",e)}get maxLength(){return this.get("maxLength")}set maxLength(e){this.set("maxLength",e)}get minLength(){return this.get("minLength")}set minLength(e){this.set("minLength",e)}get pattern(){return this.get("pattern")}set pattern(e){this.set("pattern",e)}get additionalItems(){return this.get("additionalItems")}set additionalItems(e){this.set("additionalItems",e)}get itemsField(){return this.get("items")}set itemsField(e){this.set("items",e)}get maxItems(){return this.get("maxItems")}set maxItems(e){this.set("maxItems",e)}get minItems(){return this.get("minItems")}set minItems(e){this.set("minItems",e)}get uniqueItems(){return this.get("uniqueItems")}set uniqueItems(e){this.set("uniqueItems",e)}get maxProperties(){return this.get("maxProperties")}set maxProperties(e){this.set("maxProperties",e)}get minProperties(){return this.get("minProperties")}set minProperties(e){this.set("minProperties",e)}get required(){return this.get("required")}set required(e){this.set("required",e)}get properties(){return this.get("properties")}set properties(e){this.set("properties",e)}get additionalProperties(){return this.get("additionalProperties")}set additionalProperties(e){this.set("additionalProperties",e)}get patternProperties(){return this.get("patternProperties")}set patternProperties(e){this.set("patternProperties",e)}get dependencies(){return this.get("dependencies")}set dependencies(e){this.set("dependencies",e)}get enum(){return this.get("enum")}set enum(e){this.set("enum",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}get allOf(){return this.get("allOf")}set allOf(e){this.set("allOf",e)}get anyOf(){return this.get("anyOf")}set anyOf(e){this.set("anyOf",e)}get oneOf(){return this.get("oneOf")}set oneOf(e){this.set("oneOf",e)}get not(){return this.get("not")}set not(e){this.set("not",e)}get definitions(){return this.get("definitions")}set definitions(e){this.set("definitions",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get default(){return this.get("default")}set default(e){this.set("default",e)}get format(){return this.get("format")}set format(e){this.set("format",e)}get base(){return this.get("base")}set base(e){this.set("base",e)}get linksField(){return this.get("links")}set linksField(e){this.set("links",e)}get media(){return this.get("media")}set media(e){this.set("media",e)}get readOnly(){return this.get("readOnly")}set readOnly(e){this.set("readOnly",e)}};const H=class extends V{constructor(e,t,s){super(e,t,s),this.element="JSONReference",this.classes.push("json-reference")}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}};const G=class extends V{constructor(e,t,s){super(e,t,s),this.element="media"}get binaryEncoding(){return this.get("binaryEncoding")}set binaryEncoding(e){this.set("binaryEncoding",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}};const J=class extends V{constructor(e,t,s){super(e,t,s),this.element="linkDescription"}get href(){return this.get("href")}set href(e){this.set("href",e)}get rel(){return this.get("rel")}set rel(e){this.set("rel",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get targetSchema(){return this.get("targetSchema")}set targetSchema(e){this.set("targetSchema",e)}get mediaType(){return this.get("mediaType")}set mediaType(e){this.set("mediaType",e)}get method(){return this.get("method")}set method(e){this.set("method",e)}get encType(){return this.get("encType")}set encType(e){this.set("encType",e)}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}},z={namespace:e=>{const{base:t}=e;return t.register("jSONSchemaDraft4",U),t.register("jSONReference",H),t.register("media",G),t.register("linkDescription",J),t}};const X=class extends L{constructor(e,t,s){super(e,t,s),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const W=class extends L{constructor(e,t,s){super(e,t,s),this.element="number"}primitive(){return"number"}};const Y=class extends L{constructor(e,t,s){super(e??null,t,s),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const K=class extends L{constructor(e,t,s){super(e,t,s),this.element="boolean"}primitive(){return"boolean"}};const Q=class extends ${constructor(e,t,s){super(e||[],t,s),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 s=[];for(const r of this._content){const n=e.call(t,r);n&&s.push(n)}return s}filter(e,t){const s=this._content.filter(e,t);return new this.constructor(s)}reject(e,t){const s=[];for(const r of this._content)e.call(t,r)||s.push(r);return new this.constructor(s)}reduce(e,t){let s,r;void 0!==t?(s=0,r=this.refract(t)):(s=1,r=this.first);for(let t=s;t<this.length;t+=1){const s=e(r,this._content[t],t,this);r=void 0===s?s:this.refract(s)}return r}forEach(e,t){this._content.forEach((s,r)=>{e.call(t,s,r)})}empty(){return new this.constructor([])}},Z=e=>e instanceof L,ee=e=>e instanceof X,te=e=>e instanceof W,se=e=>e instanceof Y,re=e=>e instanceof K,ne=e=>e instanceof Q,ie=e=>e instanceof V,oe=e=>e instanceof R,ce=e=>void 0!==e.style,ae=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,le=(e,t)=>0===t.length||!!Z(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));function ue(e,t,s){if(s||(s=new pe),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,n=function(r){var n=s.get(e);if(n)return n;for(var i in s.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?ue(e[i],!0,s):e[i]);return r};switch(T(e)){case"Object":return n(Object.create(Object.getPrototypeOf(e)));case"Array":return n(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.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 pe=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var s=this.hash(e),r=this.map[s];r||(this.map[s]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var s in e)t.push(Object.prototype.toString.call(e[s]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var s=this.map[t],r=0;r<s.length;r+=1){if((i=s[r])[0]===e)return i[1]}else{var n=this.hash(e);if(s=this.map[n])for(r=0;r<s.length;r+=1){var i;if((i=s[r])[0]===e)return i[1]}}},e}();const he=i(function(e){return null!=e&&"function"==typeof e.clone?e.clone():ue(e,!0)});class de extends X{constructor(e,t,s){super(e,t,s),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:s,startOffset:r,endLine:n,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof s||"number"!=typeof r||"number"!=typeof n||"number"!=typeof i||"number"!=typeof o)return;const c="sm1:"+[t,s,r,n,i,o].map(me).join("");const a=new de(c);return a.startLine=t,a.startCharacter=s,a.startOffset=r,a.endLine=n,a.endCharacter=i,a.endOffset=o,a}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,s=[];let r=0;for(let e=0;e<6;e++){const e=ye(t,r);s.push(e.value),r=e.next}return s}(this.content))}}const fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function me(e){let t=e>>>0,s="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),s+=fe[e]}while(0!==t);return s}function ye(e,t=0){let s=0,r=0,n=t;for(;;){const t=e[n++],i=fe.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(s|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:s>>>0,next:n}}const ge=de;const xe=class extends p{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...s}=t;Object.assign(this,s)}}};const be=class extends xe{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const ve=class extends be{};const we=class extends be{},ke=(e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const n=Ae(e);s.set(e,n);const{content:i}=e;return Array.isArray(i)?n.content=i.map(e=>ke(e,r)):Z(i)?n.content=ke(i,r):n.content=i instanceof N?Oe(i,r):i,n},Oe=(e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const{key:n,value:i}=e,o=void 0!==n?ke(n,r):void 0,c=void 0!==i?ke(i,r):void 0,a=new N(o,c);return s.set(e,a),a},Ee=(e,t={})=>{if(e instanceof N)return Oe(e,t);if(e instanceof B)return((e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const n=[...e].map(e=>ke(e,r)),i=new B(n);return s.set(e,i),i})(e,t);if(Z(e))return ke(e,t);throw new ve("Value provided to cloneDeep function couldn't be cloned",{value:e})};Ee.safe=e=>{try{return Ee(e)}catch{return e}};const Se=e=>{const{key:t,value:s}=e;return new N(t,s)},Ae=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=Ee(e.meta)),e.isAttributesEmpty||(t.attributes=Ee(e.attributes)),ae(e)&&ge.transfer(e,t),ce(e)&&(t.style=he(e.style));const{content:s}=e;return Z(s)?t.content=Ae(s):Array.isArray(s)?t.content=[...s]:t.content=s instanceof N?Se(s):s,t},je=e=>{if(e instanceof N)return Se(e);if(e instanceof B)return(e=>{const t=[...e];return new B(t)})(e);if(Z(e))return Ae(e);throw new we("Value provided to cloneShallow function couldn't be cloned",{value:e})};je.safe=e=>{try{return je(e)}catch{return e}};class Ie extends V{constructor(e,t,s){super(e,t,s),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new Ie(e.style)}applyTo(e){e.style=this.toValue()}}const Me=Ie;const Te=class extends L{constructor(e,t,s){super(e||[],t,s),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const Pe=class extends L{constructor(e,t,s){super(e||[],t,s),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Fe=class extends X{constructor(e,t,s){super(e,t,s),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Ce=class extends X{constructor(e,t,s){super(e,t,s),this.element="comment"}};const Ne=class extends Q{constructor(e,t,s){super(e,t,s),this.element="parseResult"}get api(){return this.filter(e=>le(e,["api"])).first}get results(){return this.filter(e=>le(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&le(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&le(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const s=this._content,r=s.findIndex(e=>e===t);return-1!==r&&(s[r]=e,!0)}},De=e=>e instanceof Te,Be=e=>e instanceof Pe,_e=e=>{if(!Z(e))return e;if(ee(e)||te(e)||re(e)||se(e))return e.toValue();const t=new WeakMap,s=e=>{if(!Z(e))return e;if(ie(e)){if(t.has(e))return t.get(e);const r={};return t.set(e,r),e.forEach((e,t)=>{const n=s(t),i=s(e);"string"==typeof n&&(r[n]=i)}),r}if(ne(e)){if(t.has(e))return t.get(e);const r=[];return t.set(e,r),e.forEach(e=>r.push(s(e))),r}return Be(e)?String(e.toValue()):De(e)?ee(e.href)?e.href.toValue():"":e.toValue()};return s(e)},Le=function(){const e=$e,t=qe,s=this,r="parser.js: Parser(): ";s.ast=void 0,s.stats=void 0,s.trace=void 0,s.callbacks=[];let n,i,o,c,a,l,u,p=0,h=0,d=0,f=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};s.parse=(g,x,v,w)=>{const k=`${r}parse(): `;p=0,h=0,d=0,f=0,m=0,n=void 0,i=void 0,o=void 0,c=void 0,y.refresh(),a=void 0,l=void 0,u=void 0,c=t.stringToChars(v),n=g.rules,i=g.udts;const O=x.toLowerCase();let E;for(const e in n)if(n.hasOwnProperty(e)&&O===n[e].lower){E=n[e].index;break}if(void 0===E)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${r}initializeCallbacks(): `;let t,o;for(a=[],l=[],t=0;t<n.length;t+=1)a[t]=void 0;for(t=0;t<i.length;t+=1)l[t]=void 0;const c=[];for(t=0;t<n.length;t+=1)c.push(n[t].lower);for(t=0;t<i.length;t+=1)c.push(i[t].lower);for(const r in s.callbacks)if(s.callbacks.hasOwnProperty(r)){if(t=c.indexOf(r.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${r}' not a rule or udt name`);if(o=s.callbacks[r]?s.callbacks[r]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${r}] must be function reference or falsy)`);t<n.length?a[t]=o:l[t-n.length]=o}})(),s.trace&&s.trace.init(n,i,c),s.stats&&s.stats.init(n,i),s.ast&&s.ast.init(n,i,c),u=w,o=[{type:e.RNM,index:E}],b(0,0),o=void 0;let S=!1;switch(y.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=y.phraseLength===c.length;break;default:throw new Error("unrecognized state")}return{success:S,state:y.state,stateName:e.idName(y.state),length:c.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:d,nodeHits:f}};const g=(t,s,n,i)=>{if(s.phraseLength>n){let e=`${r}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${s.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(s.state){case e.ACTIVE:if(!i)throw new Error(`${r}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:s.phraseLength=0;break;case e.MATCH:0===s.phraseLength&&(s.state=e.EMPTY);break;case e.NOMATCH:s.phraseLength=0;break;default:throw new Error(`${r}opRNM(${t.name}): callback function return error. Unrecognized return state: ${s.state}`)}},x=(t,a)=>{let h,d,f;const m=o[t],g=i[m.index];y.UdtIndex=g.index,p||(f=s.ast&&s.ast.udtDefined(m.index),f&&(d=n.length+m.index,h=s.ast.getLength(),s.ast.down(d,g.name)));const x=c.length-a;l[m.index](y,c,a,u),((t,s,n)=>{if(s.phraseLength>n){let e=`${r}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${s.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(s.state){case e.ACTIVE:throw new Error(`${r}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);s.phraseLength=0;break;case e.MATCH:if(0===s.phraseLength){if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);s.state=e.EMPTY}break;case e.NOMATCH:s.phraseLength=0;break;default:throw new Error(`${r}opUDT(${t.name}): callback function return error. Unrecognized return state: ${s.state}`)}})(g,y,x),p||f&&(y.state===e.NOMATCH?s.ast.setLength(h):s.ast.up(d,g.name,a,y.phraseLength))},b=(t,i)=>{const l=`${r}opExecute(): `,v=o[t];switch(f+=1,h>d&&(d=h),h+=1,y.refresh(),s.trace&&s.trace.down(v,i),v.type){case e.ALT:((t,s)=>{const r=o[t];for(let t=0;t<r.children.length&&(b(r.children[t],s),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,r)=>{let n,i,c,a;const l=o[t];s.ast&&(i=s.ast.getLength()),n=!0,c=r,a=0;for(let t=0;t<l.children.length;t+=1){if(b(l.children[t],c),y.state===e.NOMATCH){n=!1;break}c+=y.phraseLength,a+=y.phraseLength}n?(y.state=0===a?e.EMPTY:e.MATCH,y.phraseLength=a):(y.state=e.NOMATCH,y.phraseLength=0,s.ast&&s.ast.setLength(i))})(t,i);break;case e.REP:((t,r)=>{let n,i,a,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=r,a=0,l=0,s.ast&&(n=s.ast.getLength());!(i>=c.length)&&(b(t+1,i),y.state!==e.NOMATCH)&&y.state!==e.EMPTY&&(l+=1,a+=y.phraseLength,i+=y.phraseLength,l!==u.max););y.state===e.EMPTY||l>=u.min?(y.state=0===a?e.EMPTY:e.MATCH,y.phraseLength=a):(y.state=e.NOMATCH,y.phraseLength=0,s.ast&&s.ast.setLength(n))})(t,i);break;case e.RNM:((t,r)=>{let i,l,h;const d=o[t],f=n[d.index],m=a[f.index];if(p||(l=s.ast&&s.ast.ruleDefined(d.index),l&&(i=s.ast.getLength(),s.ast.down(d.index,n[d.index].name))),m){const t=c.length-r;m(y,c,r,u),g(f,y,t,!0),y.state===e.ACTIVE&&(h=o,o=f.opcodes,b(0,r),o=h,m(y,c,r,u),g(f,y,t,!1))}else h=o,o=f.opcodes,b(0,r,y),o=h;p||l&&(y.state===e.NOMATCH?s.ast.setLength(i):s.ast.up(d.index,f.name,r,y.phraseLength))})(t,i);break;case e.TRG:((t,s)=>{const r=o[t];y.state=e.NOMATCH,s<c.length&&r.min<=c[s]&&c[s]<=r.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,s)=>{const r=o[t],n=r.string.length;if(y.state=e.NOMATCH,s+n<=c.length){for(let e=0;e<n;e+=1)if(c[s+e]!==r.string[e])return;y.state=e.MATCH,y.phraseLength=n}})(t,i);break;case e.TLS:((t,s)=>{let r;const n=o[t];y.state=e.NOMATCH;const i=n.string.length;if(0!==i){if(s+i<=c.length){for(let e=0;e<i;e+=1)if(r=c[s+e],r>=65&&r<=90&&(r+=32),r!==n.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:x(t,i);break;case e.AND:((t,s)=>{switch(p+=1,b(t+1,s),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.EMPTY;break;case e.NOMATCH:y.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${y.state}`)}})(t,i);break;case e.NOT:((t,s)=>{switch(p+=1,b(t+1,s),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.NOMATCH;break;case e.NOMATCH:y.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${y.state}`)}})(t,i);break;default:throw new Error(`${l}unrecognized operator`)}p||i+y.phraseLength>m&&(m=i+y.phraseLength),s.stats&&s.stats.collect(v,y),s.trace&&s.trace.up(v,y.state,i,y.phraseLength),h-=1}},qe={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,s)=>{let r=e;for(;!(void 0===t||t<0);){if(void 0===s){r=e.slice(t);break}if(s<=0)return"";r=e.slice(t,t+s);break}return String.fromCodePoint(...r)}},$e={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 $e.ALT:return"ALT";case $e.CAT:return"CAT";case $e.REP:return"REP";case $e.RNM:return"RNM";case $e.TRG:return"TRG";case $e.TBS:return"TBS";case $e.TLS:return"TLS";case $e.UDT:return"UDT";case $e.AND:return"AND";case $e.NOT:return"NOT";case $e.ACTIVE:return"ACTIVE";case $e.EMPTY:return"EMPTY";case $e.MATCH:return"MATCH";case $e.NOMATCH:return"NOMATCH";case $e.SEM_PRE:return"SEM_PRE";case $e.SEM_POST:return"SEM_POST";case $e.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function Re(){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 Ve 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,...s}=t;Object.assign(this,s)}}}const Ue=Ve;new Re;new Re,new Le,new Re,new Le,new Re,new Le,new Re,new Le;const He=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 Ge=class extends Ue{},Je=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 He(String(e))}).join("/")}`}catch(t){throw new Ge("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class ze 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,...s}=t;Object.assign(this,s)}}}const Xe=ze;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 We=class extends Xe{},Ye=e=>{if(!Array.isArray(e))throw new We("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 s of e){const e=s.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")}`:s}}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 We("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},Ke=(e,t,s,r)=>{const{realm:n}=e,{value:i}=s;if(n.isObject(t)&&n.hasProperty(t,i)){r(n.getProperty(t,i),i)}},Qe=(e,t,s,r)=>{const{realm:n}=e,{value:i}=s;if(!n.isArray(t))return;const o=n.getLength(t),c=((e,t)=>e>=0?e:t+e)(i,o);if(c>=0&&c<o){r(n.getElement(t,c),c)}},Ze=(e,t,s,r)=>{const{realm:n}=e;for(const[e,s]of n.entries(t))r(s,e)},et=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),tt=(e,t,s,r)=>{const{realm:n}=e,{start:i,end:o,step:c}=s;if(!n.isArray(t))return;const a=((e,t,s,r)=>{const n=s??1;if(0===n)return null;let i,o;if(n>0){const s=0,n=r,c=null!==e?et(e,r):s,a=null!==t?et(t,r):n;i=Math.max(c,0),o=Math.min(a,r)}else{const s=r-1,n=-r-1,c=null!==e?e>=0?Math.min(e,r-1):Math.max(r+e,-1):s,a=null!==t?t>=0?Math.min(t,r-1):Math.max(r+t,-1):n;o=Math.min(c,r-1),i=Math.max(a,-1)}return{lower:i,upper:o,step:n}})(i,o,c,n.getLength(t));if(null===a)return;const{lower:l,upper:u,step:p}=a;if(p>0)for(let e=l;e<u;e+=p){r(n.getElement(t,e),e)}else for(let e=u;e>l;e+=p){r(n.getElement(t,e),e)}},st=(e,t,s,r)=>r.value,rt=(e,t,s)=>{const{realm:r}=e,{selector:n}=s;switch(n.type){case"NameSelector":{const{value:e}=n;return r.isObject(t)&&r.hasProperty(t,e)?r.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=n;if(!r.isArray(t))return;const s=r.getLength(t),i=e>=0?e:s+e;return i>=0&&i<s?r.getElement(t,i):void 0}default:return}},nt=(e,t,s,r)=>{const{selectors:n}=s;for(const s of n)yt(e,t,s,r)},it=(e,t,s)=>{const r=[],n=e=>{r.push(e)},{selector:i}=s;switch(i.type){case"BracketedSelection":nt(e,t,i,n);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":yt(e,t,i,n)}return r},ot=(e,t,s,r)=>{let n=s;for(const t of r){const s=[];if("DescendantSegment"===t.type){const r=n=>{const{realm:i}=e,o=it(e,n,t);s.push(...o);for(const[,e]of i.entries(n))r(e)};for(const e of n)r(e)}else for(const r of n){const n=it(e,r,t);s.push(...n)}n=s}return n},ct=(e,t,s,r)=>{const{query:n}=r;let i;switch(n.type){case"RelQuery":i=((e,t,s,r)=>{const{segments:n}=r;return 0===n.length?[s]:ot(e,0,[s],n)})(e,0,s,n);break;case"JsonPathQuery":i=((e,t,s,r)=>{const{segments:n}=r;return 0===n.length?[t]:ot(e,0,[t],n)})(e,t,0,n);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let at;const lt=(e,t,s,r)=>{const{name:n,arguments:i}=r,o=e.functions[n];if("function"!=typeof o)return;const c=i.map(r=>((e,t,s,r)=>{switch(r.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return ut(e,t,s,r);case"FilterQuery":return ct(e,t,s,r);case"TestExpr":return"FilterQuery"===r.expression.type?ct(e,t,s,r.expression):"FunctionExpr"===r.expression.type?ut(e,t,s,r.expression):at(e,t,s,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return at(e,t,s,r);default:return}})(e,t,s,r));return o(e.realm,...c)},ut=(e,t,s,r)=>{switch(r.type){case"Literal":return st(e,t,s,r);case"RelSingularQuery":return((e,t,s,r)=>{let n=s;for(const t of r.segments)if(n=rt(e,n,t),void 0===n)return;return n})(e,0,s,r);case"AbsSingularQuery":return((e,t,s,r)=>{let n=t;for(const t of r.segments)if(n=rt(e,n,t),void 0===n)return;return n})(e,t,0,r);case"FunctionExpr":return lt(e,t,s,r);default:return}},pt=(e,t,s,r)=>{const{left:n,op:i,right:o}=r,c=ut(e,t,s,n),a=ut(e,t,s,o);return e.realm.compare(c,i,a)},ht=e=>Array.isArray(e),dt=(e,t,s,r)=>{switch(r.type){case"LogicalOrExpr":return!!dt(e,t,s,r.left)||dt(e,t,s,r.right);case"LogicalAndExpr":return!!dt(e,t,s,r.left)&&dt(e,t,s,r.right);case"LogicalNotExpr":return!dt(e,t,s,r.expression);case"TestExpr":{const{expression:n}=r;if("FilterQuery"===n.type){return ct(e,t,s,n).length>0}if("FunctionExpr"===n.type){const r=lt(e,t,s,n);return"boolean"==typeof r?r:void 0!==r&&(ht(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return pt(e,t,s,r);default:return!1}};at=dt;const ft=dt,mt=(e,t,s,r)=>{const{realm:n,root:i}=e,{expression:o}=s;for(const[s,c]of n.entries(t)){ft(e,i,c,o)&&r(c,s)}},yt=(e,t,s,r)=>{switch(s.type){case"NameSelector":Ke(e,t,s,r);break;case"IndexSelector":Qe(e,t,s,r);break;case"WildcardSelector":Ze(e,t,s,r);break;case"SliceSelector":tt(e,t,s,r);break;case"FilterSelector":mt(e,t,s,r)}};new Map;class gt{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#s=!1;#r=!1;#n;#i=!1;constructor(e,t,s,r,n){this.node=e,this.parent=t,this.parentPath=s,this.key=r,this.index=n&&"number"==typeof r?r:void 0,this.inList=n}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#s}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:s,parent:r,parentPath:n}=t;if(oe(r)&&"value"===s){if(!ee(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else ne(n?.node)&&"number"==typeof s&&e.unshift(s);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?Ye(t):Je(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.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&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.#r=!0,this.#n=e,this.node=e}remove(){this.#i&&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.#s=!0}_getReplacementNode(){return this.#n}_wasReplaced(){return this.#r}_reset(){this.#e=!1,this.#t=!1,this.#s=!1,this.#r=!1,this.#n=void 0}_markStale(){this.#i=!0}}function xt(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,s){return t.apply(this,arguments)};case 3:return function(e,s,r){return t.apply(this,arguments)};case 4:return function(e,s,r,n){return t.apply(this,arguments)};case 5:return function(e,s,r,n,i){return t.apply(this,arguments)};case 6:return function(e,s,r,n,i,o){return t.apply(this,arguments)};case 7:return function(e,s,r,n,i,o,c){return t.apply(this,arguments)};case 8:return function(e,s,r,n,i,o,c,a){return t.apply(this,arguments)};case 9:return function(e,s,r,n,i,o,c,a,l){return t.apply(this,arguments)};case 10:return function(e,s,r,n,i,o,c,a,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 bt(e,t,s){return function(){for(var r=[],i=0,o=e,c=0,a=!1;c<t.length||i<arguments.length;){var l;c<t.length&&(!n(t[c])||i>=arguments.length)?l=t[c]:(l=arguments[i],i+=1),r[c]=l,n(l)?a=!0:o-=1,c+=1}return!a&&o<=0?s.apply(this,r):xt(Math.max(0,o),bt(e,r,s))}}var vt=g(function(e,t){return 1===e?i(t):xt(e,bt(e,[],t))});const wt=vt;function kt(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Ot=g(function(e,t){return e&&t});function Et(e,t,s){for(var r=0,n=s.length;r<n;)t=e(t,s[r]),r+=1;return t}const St=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function At(e){return"[object String]"===Object.prototype.toString.call(e)}const jt=i(function(e){return!!St(e)||!!e&&("object"==typeof e&&(!At(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var It="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Mt(e,t,s){return function(r,n,i){if(jt(i))return e(r,n,i);if(null==i)return n;if("function"==typeof i["fantasy-land/reduce"])return t(r,n,i,"fantasy-land/reduce");if(null!=i[It])return s(r,n,i[It]());if("function"==typeof i.next)return s(r,n,i);if("function"==typeof i.reduce)return t(r,n,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Tt(e,t,s){for(var r=s.next();!r.done;)t=e(t,r.value),r=s.next();return t}function Pt(e,t,s,r){return s[r](e,t)}const Ft=Mt(Et,Pt,Tt);function Ct(e,t,s){return function(){if(0===arguments.length)return s();var r=arguments[arguments.length-1];if(!St(r)){for(var n=0;n<e.length;){if("function"==typeof r[e[n]])return r[e[n]].apply(r,Array.prototype.slice.call(arguments,0,-1));n+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return s.apply(this,arguments)}}function Nt(e,t){for(var s=0,r=t.length,n=Array(r);s<r;)n[s]=e(t[s]),s+=1;return n}const Dt=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"]=Dt,e.prototype["@@transducer/result"]=Bt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Lt=g(Ct(["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 wt(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Et(function(s,r){return s[r]=e(t[r]),s},{},M(t));default:return Nt(e,t)}}));const qt=Lt;const $t=g(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(s){return e(s)(t(s))}:Ft(function(e,s){return function(e,t){var s;t=t||[];var r=(e=e||[]).length,n=t.length,i=[];for(s=0;s<r;)i[i.length]=e[s],s+=1;for(s=0;s<n;)i[i.length]=t[s],s+=1;return i}(e,qt(s,t))},[],e)});var Rt=g(function(e,t){var s=wt(e,t);return wt(e,function(){return Et($t,qt(s,arguments[0]),Array.prototype.slice.call(arguments,1))})});const Vt=Rt;var Ut=i(function(e){return Vt(e.length,e)});const Ht=Ut;const Gt=g(function(e,t){return kt(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:Ht(Ot)(e,t)});function Jt(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function zt(e){return function t(s,r,o){switch(arguments.length){case 0:return t;case 1:return n(s)?t:g(function(t,r){return e(s,t,r)});case 2:return n(s)&&n(r)?t:n(s)?g(function(t,s){return e(t,r,s)}):n(r)?g(function(t,r){return e(s,t,r)}):i(function(t){return e(s,r,t)});default:return n(s)&&n(r)&&n(o)?t:n(s)&&n(r)?g(function(t,s){return e(t,s,o)}):n(s)&&n(o)?g(function(t,s){return e(t,r,s)}):n(r)&&n(o)?g(function(t,r){return e(s,t,r)}):n(s)?i(function(t){return e(t,r,o)}):n(r)?i(function(t){return e(s,t,o)}):n(o)?i(function(t){return e(s,r,t)}):e(s,r,o)}}}function Xt(e,t,s){for(var r=0,n=s.length;r<n;){if((t=e["@@transducer/step"](t,s[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}var Wt=g(function(e,t){return xt(e.length,function(){return e.apply(t,arguments)})});const Yt=Wt;function Kt(e,t,s){for(var r=s.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=s.next()}return e["@@transducer/result"](t)}function Qt(e,t,s,r){return e["@@transducer/result"](s[r](Yt(e["@@transducer/step"],e),t))}const Zt=Mt(Xt,Qt,Kt);var es=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 ts=zt(function(e,t,s){return Zt("function"==typeof e?function(e){return new es(e)}(e):e,t,s)});const ss=ts;function rs(e,t){return function(){var s=arguments.length;if(0===s)return t();var r=arguments[s-1];return St(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,s-1))}}const ns=zt(rs("slice",function(e,t,s){return Array.prototype.slice.call(s,e,t)}));const is=i(rs("tail",ns(1,1/0)));function os(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return xt(arguments[0].length,ss(Jt,arguments[0],is(arguments)))}function cs(e,t){return function(e,t,s){var r,n;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(r=1/t;s<e.length;){if(0===(n=e[s])&&1/n===r)return s;s+=1}return-1}if(t!=t){for(;s<e.length;){if("number"==typeof(n=e[s])&&n!=n)return s;s+=1}return-1}return e.indexOf(t,s);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,s);case"object":if(null===t)return e.indexOf(t,s)}for(;s<e.length;){if(C(e[s],t))return s;s+=1}return-1}(t,e,0)>=0}function as(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 ls=function(e){return(e<10?"0":"")+e};const us="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+ls(e.getUTCMonth()+1)+"-"+ls(e.getUTCDate())+"T"+ls(e.getUTCHours())+":"+ls(e.getUTCMinutes())+":"+ls(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function ps(e){return"[object Object]"===Object.prototype.toString.call(e)}var hs=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Dt,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 ds(e){return function(t){return new hs(e,t)}}var fs=g(Ct(["fantasy-land/filter","filter"],ds,function(e,t){return ps(t)?Et(function(s,r){return e(t[r])&&(s[r]=t[r]),s},{},M(t)):(s=t,"[object Map]"===Object.prototype.toString.call(s)?function(e,t){for(var s=new Map,r=t.entries(),n=r.next();!n.done;)e(n.value[1])&&s.set(n.value[0],n.value[1]),n=r.next();return s}(e,t):function(e,t){for(var s=0,r=t.length,n=[];s<r;)e(t[s])&&(n[n.length]=t[s]),s+=1;return n}(e,t));var s}));const ms=fs;const ys=g(function(e,t){return ms((s=e,function(){return!s.apply(this,arguments)}),t);var s});function gs(e,t){var s=function(s){var r=t.concat([e]);return cs(s,r)?"<Circular>":gs(s,r)},r=function(e,t){return Nt(function(t){return as(t)+": "+s(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+Nt(s,e).join(", ")+"))";case"[object Array]":return"["+Nt(s,e).concat(r(e,ys(function(e){return/^\d+$/.test(e)},M(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+s(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?s(NaN):as(us(e)))+")";case"[object Map]":return"new Map("+s(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+s(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+s(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+s(e.valueOf())+")":as(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+r(e,M(e)).join(", ")+"}"}}const xs=i(function(e){return gs(e,[])});const bs=g(function(e,t){return e||t});const vs=g(function(e,t){return kt(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:Ht(bs)(e,t)});const ws=Ht(i(function(e){return!e}));const ks=C(null);const Os=ws(ks);const Es=g(function(e,t){if(e===t)return t;function s(e,t){if(e>t!=t>e)return t>e?t:e}var r=s(e,t);if(void 0!==r)return r;var n=s(typeof e,typeof t);if(void 0!==n)return n===typeof e?e:t;var i=xs(e),o=s(i,xs(t));return void 0!==o&&o===i?e:t}),Ss=Number.isInteger||function(e){return(e|0)===e};const As=g(function(e,t){if(null!=t)return Ss(e)?o(e,t):t[e]});const js=g(function(e,t){return qt(As(e),t)});const Is=i(function(e){return wt(ss(Es,0,js("length",e)),function(){for(var t=0,s=e.length;t<s;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Ms=function(e,t){switch(arguments.length){case 0:return Ms;case 1:return function t(s){return 0===arguments.length?t:w(e,s)};default:return w(e,t)}};const Ts=Ms;const Ps=wt(1,os(T,Ts("GeneratorFunction")));const Fs=wt(1,os(T,Ts("AsyncFunction")));const Cs=Is([os(T,Ts("Function")),Ps,Fs]);function Ns(e){return Ns="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},Ns(e)}const Ds=function(e){return"object"===Ns(e)};const Bs=wt(1,Gt(Os,vs(Ds,Cs)));const _s=wt(1,Gt(Bs,os(xs,C("[object Promise]")))),Ls=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},qs=e=>Z(e),$s=e=>je(e),Rs=(e,t,s)=>{oe(e)?e.value=s:Array.isArray(e)?e[t]=null===s?void 0:s:null===s?delete e[t]:e[t]=s},Vs=e=>oe(e)?["key","value"]:ne(e)||ie(e)?["content"]:[],Us=(e,t)=>{if(void 0!==e[t])return e[t];const s=t.length;for(const r in e){if(!r.includes("|"))continue;const n=r.indexOf(t);if(-1===n)continue;const i=0===n||"|"===r[n-1],o=n+s===r.length||"|"===r[n+s];if(i&&o)return e[r]}},Hs=(e,t,s)=>{if(void 0===t)return null;const r=e,n=s?"leave":"enter",i=Us(r,t);if(!s&&"function"==typeof i)return i;if(null!=i){const e=i[n];if("function"==typeof e)return e}const o=r[n];if("function"==typeof o)return o;if(null!=o){const e=Us(o,t);if("function"==typeof e)return e}return null},Gs=(e,t={})=>{const{visitFnGetter:s=Hs,nodeTypeGetter:r=Ls,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),c=new Array(e.length).fill(i);return{enter(t){let a=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(c[u]===i){const i=s(e[u],r(a),!1);if("function"==typeof i){const s=zs(t,a),r=i.call(e[u],s);if(_s(r))throw new xe("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(s.shouldStop){c[u]=o;break}if(s.shouldSkip&&(c[u]=a),s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();if(!n)return t.replaceWith(e),e;a=e,l=!0}else if(void 0!==r){if(!n)return t.replaceWith(r),r;a=r,l=!0}}}if(l)return t.replaceWith(a),a},leave(t){const n=t.node;for(let a=0;a<e.length;a+=1)if(c[a]===i){const i=s(e[a],r(n),!0);if("function"==typeof i){const s=zs(t,n),r=i.call(e[a],s);if(_s(r))throw new xe("Async visitor not supported in sync mode",{visitor:e[a],visitFn:i});if(s.shouldStop){c[a]=o;break}if(s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else c[a]===n&&(c[a]=i)}}},Js=(e,t={})=>{const{visitFnGetter:s=Hs,nodeTypeGetter:r=Ls,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),c=new Array(e.length).fill(i);return{async enter(t){let a=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(c[u]===i){const i=s(e[u],r(a),!1);if("function"==typeof i){const s=zs(t,a),r=await i.call(e[u],s);if(s.shouldStop){c[u]=o;break}if(s.shouldSkip&&(c[u]=a),s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();if(!n)return t.replaceWith(e),e;a=e,l=!0}else if(void 0!==r){if(!n)return t.replaceWith(r),r;a=r,l=!0}}}if(l)return t.replaceWith(a),a},async leave(t){const n=t.node;for(let a=0;a<e.length;a+=1)if(c[a]===i){const i=s(e[a],r(n),!0);if("function"==typeof i){const s=zs(t,n),r=await i.call(e[a],s);if(s.shouldStop){c[a]=o;break}if(s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else c[a]===n&&(c[a]=i)}}};function zs(e,t){return new gt(t,e.parent,e.parentPath,e.key,e.inList)}function*Xs(e,t,s){const{keyMap:r,state:n,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:c,detectCycles:a,mutable:l,mutationFn:u}=s,p="function"==typeof r;let h,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,v=null;const w=[];do{y+=1;const e=y===m.length;let s;const k=e&&0!==g.length;if(e){if(s=0===w.length?void 0:b?.key,x=d,d=w.pop(),v=b?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,s]of g){const r=t-e;null===s?(x.splice(r,1),e+=1):x[r]=s}}else{x=c(x);for(const[e,t]of g)x[e]=t}if(void 0!==h){y=h.index,m=h.keys,g=h.edits;const e=h.inArray;if(v=h.parentPath,h=h.prev,k&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(s=f?y:m[y],x=d[s],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new xe(`Invalid AST Node: ${String(x)}`,{node:x});if(a&&w.includes(x))continue;b=new gt(x,d,v,s,f);const r=Hs(t,i(x),e);if(r){for(const[e,s]of Object.entries(n))t[e]=s;const i=yield{visitFn:r,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([s,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([s,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([s,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(h={inArray:f,index:y,keys:m,edits:g,parentPath:v,prev:h},f=Array.isArray(x),f)m=x;else if(p)m=r(x);else{const e=i(x);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&w.push(d),d=x,v=b}}while(void 0!==h);return 0!==g.length?g.at(-1)[1]:e}Gs[Symbol.for("nodejs.util.promisify.custom")]=Js;const Ws=(e,t,s={})=>{const r=Xs(e,t,{keyMap:s.keyMap??Vs,state:s.state??{},nodeTypeGetter:s.nodeTypeGetter??Ls,nodePredicate:s.nodePredicate??qs,nodeCloneFn:s.nodeCloneFn??$s,detectCycles:s.detectCycles??!0,mutable:s.mutable??!1,mutationFn:s.mutationFn??Rs});let n=r.next();for(;!n.done;){const e=n.value,s=e.visitFn.call(t,e.path);if(_s(s))throw new xe("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});n=r.next(s)}return n.value},Ys=async(e,t,s={})=>{const r=Xs(e,t,{keyMap:s.keyMap??Vs,state:s.state??{},nodeTypeGetter:s.nodeTypeGetter??Ls,nodePredicate:s.nodePredicate??qs,nodeCloneFn:s.nodeCloneFn??$s,detectCycles:s.detectCycles??!0,mutable:s.mutable??!1,mutationFn:s.mutationFn??Rs});let n=r.next();for(;!n.done;){const e=n.value,s=await e.visitFn.call(t,e.path);n=r.next(s)}return n.value};Ws[Symbol.for("nodejs.util.promisify.custom")]=Ys,gt.prototype.traverse=function(e,t){return Ws(this.node,e,t)},gt.prototype.traverseAsync=function(e,t){return Ys(this.node,e,t)};const Ks={JSONSchemaDraft4Element:{additionalItems:(...e)=>new U(...e),items:(...e)=>new U(...e),required(...e){const t=new Q(...e);return t.classes.push("json-schema-required"),t},properties(...e){const t=new V(...e);return t.classes.push("json-schema-properties"),t},additionalProperties:(...e)=>new U(...e),patternProperties(...e){const t=new V(...e);return t.classes.push("json-schema-patternProperties"),t},dependencies(...e){const t=new V(...e);return t.classes.push("json-schema-dependencies"),t},enum(...e){const t=new Q(...e);return t.classes.push("json-schema-enum"),t},allOf(...e){const t=new Q(...e);return t.classes.push("json-schema-allOf"),t},anyOf(...e){const t=new Q(...e);return t.classes.push("json-schema-anyOf"),t},oneOf(...e){const t=new Q(...e);return t.classes.push("json-schema-oneOf"),t},not:(...e)=>new U(...e),definitions(...e){const t=new V(...e);return t.classes.push("json-schema-definitions"),t},links(...e){const t=new Q(...e);return t.classes.push("json-schema-links"),t},media:(...e)=>new G(...e)},LinkDescriptionElement:{targetSchema:(...e)=>new U(...e),schema:(...e)=>new U(...e)},"json-schema-properties":{"[key: *]":function(...e){return new U(...e)}},"json-schema-patternProperties":{"[key: *]":function(...e){return new U(...e)}},"json-schema-dependencies":{"[key: *]":function(...e){return new U(...e)}},"json-schema-allOf":{"<*>":function(...e){return new U(...e)}},"json-schema-anyOf":{"<*>":function(...e){return new U(...e)}},"json-schema-oneOf":{"<*>":function(...e){return new U(...e)}},"json-schema-definitions":{"[key: *]":function(...e){return new U(...e)}},"json-schema-links":{"<*>":function(...e){return new J(...e)}}},Qs=(e,t)=>{const s=Ls(e),r=Ks[s]||Ks[_e(e.classes.first)];return void 0===r?void 0:Object.hasOwn(r,"[key: *]")?r["[key: *]"]:r[t]},Zs=()=>()=>({visitor:{StringElement(e){const t=e.node;if(!(e=>ee(e)&&le(e,["yaml-e-node","yaml-e-scalar"]))(t))return;const s=e.getAncestorNodes().reverse().filter(Z),r=s.at(-1);let n,i;if(ne(r)?(i=t,n=Qs(r,"<*>")):oe(r)&&(i=s.at(-2),n=Qs(i,_e(r.key))),"function"!=typeof n)return;const o=n.call({context:i},void 0,Ee(t.meta),Ee(t.attributes));ge.transfer(t,o),Me.transfer(t,o),e.replaceWith(o)}}});var er=g(function(e,t){return Et(function(s,r){return s[r]=e(t[r],r,t),s},{},M(t))});const tr=er;const sr=i(function(e){return null==e});var rr=g(function(e,t){if(0===e.length||sr(t))return!1;for(var s=t,r=0;r<e.length;){if(sr(s)||!v(e[r],s))return!1;s=s[e[r]],r+=1}return!0});const nr=rr;var ir=g(function(e,t){return nr([e],t)});const or=ir;const cr=zt(function(e,t,s){return e(As(t,s))});function ar(e,t){for(var s=t,r=0;r<e.length;r+=1){if(null==s)return;var n=e[r];s=Ss(n)?o(n,s):s[n]}return s}const lr=g(ar);const ur=zt(function(e,t,s){return e(ar(t,s))});const pr=wt(1,Gt(Os,Ds));var hr=os(T,Ts("Object")),dr=os(xs,C(xs(Object))),fr=ur(Gt(Cs,dr),["constructor"]);const mr=wt(1,function(e){if(!pr(e)||!hr(e))return!1;var t=Object.getPrototypeOf(e);return!!ks(t)||fr(t)});const yr=wt(1,os(T,Ts("String")));var gr=i(function(e){return wt(e.length,e)});const xr=gr;const br=g(function(e,t){return wt(e+1,function(){var s=arguments[e];if(null!=s&&kt(s[t]))return s[t].apply(s,Array.prototype.slice.call(arguments,0,e));throw new TypeError(xs(s)+' does not have a method named "'+t+'"')})});const vr=br(1,"split");var wr=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Dt,e.prototype["@@transducer/result"]=Bt,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function kr(e){return function(t){return new wr(e,t)}}const Or=g(Ct(["dropWhile"],kr,function(e,t){for(var s=0,r=t.length;s<r&&e(t[s]);)s+=1;return ns(s,1/0,t)}));const Er=br(1,"join");var Sr=i(function(e){return wt(e.length,function(t,s){var r=Array.prototype.slice.call(arguments,0);return r[0]=s,r[1]=t,e.apply(this,r)})});const Ar=Sr(g(cs));const jr=xr(function(e,t){return os(vr(""),Or(Ar(e)),Er(""))(t)}),Ir=new WeakMap;var Mr=zt(function(e,t,s){var r,n={};for(r in s=s||{},t=t||{})v(r,t)&&(n[r]=v(r,s)?e(r,t[r],s[r]):t[r]);for(r in s)v(r,s)&&!v(r,n)&&(n[r]=s[r]);return n});const Tr=Mr;var Pr=zt(function e(t,s,r){return Tr(function(s,r,n){return ps(r)&&ps(n)?e(t,r,n):t(s,r,n)},s,r)});const Fr=Pr;const Cr=g(function(e,t){return Fr(function(e,t,s){return s},e,t)});const Nr=g(function(e,t){return null==t||t!=t?e:t});const Dr=zt(function(e,t,s){return Nr(e,As(t,s))});const Br=ns(0,-1);var _r=g(function(e,t){return e.apply(this,t)});const Lr=_r;const qr=ws(Cs);var $r=i(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:St(e)?[]:At(e)?"":ps(e)?{}:O(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const Rr=$r;const Vr=i(function(e){return null!=e&&C(e,Rr(e))});const Ur=wt(1,Cs(Array.isArray)?Array.isArray:os(T,Ts("Array")));const Hr=Gt(Ur,Vr);const Gr=wt(3,function(e,t,s){var r=lr(e,s),n=lr(Br(e),s);if(!qr(r)&&!Hr(e)){var i=Yt(r,n);return Lr(i,t)}});const Jr=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(e.isMetaEmpty||(t.meta=this.serialiseObject(e.meta)),e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof ge)){const s=ge.from(e);s&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(s))}if(!(e instanceof Me)){const s=Me.from(e);s&&(t.meta||(t.meta={}),t.meta.__styles__=this.serialise(s))}const s=this.serialiseContent(e.content);return void 0!==s&&(t.content=s),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let s,r;t.element!==e.element&&(t.element=e.element);let n=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;s=t,r=i,n=Object.keys(o).length>0?o:void 0}if(n&&this.deserialiseObject(n,t.meta),s){this.deserialise(s).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const i=this.deserialiseContent(e.content);return void 0===i&&null!==t.content||(t.content=i),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,s={key:this.serialise(t.key)};return t.value&&(s.value=this.serialise(t.value)),s}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseObject(e){const t={};if(e.forEach((e,s)=>{e&&(t[s.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(s=>{t.set(s,this.deserialise(e[s]))})}},zr=e=>null===e,Xr=e=>"string"==typeof e,Wr=e=>"number"==typeof e,Yr=e=>"boolean"==typeof e,Kr=e=>null!==e&&"object"==typeof e;class Qr{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=L,this.KeyValuePair=N,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",Y).register("string",X).register("number",W).register("boolean",K).register("array",Q).register("object",V).register("member",R).register("ref",Pe).register("link",Te).register("sourceMap",ge),this.detect(zr,Y,!1).detect(Xr,X,!1).detect(Wr,W,!1).detect(Yr,K,!1).detect(Array.isArray,Q,!1).detect(Kr,V,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,s){return void 0===s||s?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[s,r]of this.elementDetection)if(s(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Jr(this)}}Jr.prototype.Namespace=Qr;const Zr=Qr,en=new Zr,tn={isElement:Z,isStringElement:ee,isNumberElement:te,isNullElement:se,isBooleanElement:re,isArrayElement:ne,isObjectElement:ie,isMemberElement:oe,isPrimitiveElement:e=>ie(e)&&"object"===e.element||ne(e)&&"array"===e.element||re(e)&&"boolean"===e.element||te(e)&&"number"===e.element||ee(e)&&"string"===e.element||se(e)&&"null"===e.element||oe(e)&&"member"===e.element,isLinkElement:De,isRefElement:Be,isAnnotationElement:e=>e instanceof Fe,isCommentElement:e=>e instanceof Ce,isParseResultElement:e=>e instanceof Ne,isSourceMapElement:e=>e instanceof ge,hasElementStyle:ce,hasElementSourceMap:ae,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const s=e.attributes.get("symbols");return!!ne(s)&&t.every(e=>s.includes(e))},includesClasses:le},sn={toolboxCreator:()=>({predicates:tn,namespace:en}),visitorOptions:{exposeEdits:!0}},rn=(e,t,s={})=>{if(0===t.length)return e;const r=Cr(sn,s),{toolboxCreator:n,visitorOptions:i}=r,o=n(),c=t.map(e=>e(o)),a=Gs(c.map(Dr({},"visitor")),i);c.forEach(Gr(["pre"],[]));const l=Ws(e,a);return c.forEach(Gr(["post"],[])),l};function nn(e){return void 0===e?new Y:on(e)}function on(e){if(e instanceof L)return e;if("string"==typeof e)return new X(e);if("number"==typeof e)return new W(e);if("boolean"==typeof e)return new K(e);if(null===e)return new Y;if(Array.isArray(e))return new Q(e.map(nn));if("object"==typeof e)return new V(e);throw new Error("Cannot refract value of type "+typeof e)}rn[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,s={})=>{if(0===t.length)return e;const r=Cr(sn,s),{toolboxCreator:n,visitorOptions:i}=r,o=n(),c=t.map(e=>e(o)),a=Js(c.map(Dr({},"visitor")),i);await Promise.allSettled(c.map(Gr(["pre"],[])));const l=await Ys(e,a);return await Promise.allSettled(c.map(Gr(["post"],[]))),l},L.prototype.ObjectElement=V,L.prototype.ArrayElement=Q,L.prototype.RefElement=Pe,L.prototype.MemberElement=R,L.prototype.refract=on;const cn=e=>{const t=e.isMetaEmpty?void 0:Ee(e.meta),s=e.isAttributesEmpty?void 0:Ee(e.attributes);return new e.constructor(void 0,t,s)},an=(e,t)=>t.clone&&t.isMergeableElement(e)?un(cn(e),e,t):e,ln={clone:!0,isMergeableElement:e=>ie(e)||ne(e),arrayElementMerge:(e,t,s)=>new(0,e.constructor)(e.concat(t).map(e=>an(e,s))),objectElementMerge:(e,t,s)=>{const r=ie(e)?cn(e):cn(t);return ie(e)&&e.forEach((e,t,n)=>{const i=je(n);i.value=an(e,s),r.content.push(i)}),t.forEach((t,n,i)=>{const o=_e(n);let c;if(ie(e)&&e.hasKey(o)&&s.isMergeableElement(t)){const r=e.get(o);c=je(i),c.value=((e,t)=>{if("function"!=typeof t.customMerge)return un;const s=t.customMerge(e,t);return"function"==typeof s?s:un})(n,s)(r,t,s)}else c=je(i),c.value=an(t,s);r.remove(o),r.content.push(c)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},un=(e,t,s)=>{const r={...ln,...s};r.isMergeableElement=r.isMergeableElement??ln.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??ln.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??ln.objectElementMerge;const n=ne(t);if(!(n===ne(e)))return an(t,r);const i=n&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>Ee(e):e.customMetaMerge)(r)(e.meta,t.meta),i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>Ee(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};un.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new V:e.reduce((e,s)=>un(e,s,t),cn(e[0]))};const pn=un;const hn=class{element;constructor(e){Object.assign(this,e)}copyMetaAndAttributes(e,t){if(!e.isMetaEmpty||!t.isMetaEmpty){const s=t.isMetaEmpty?new V:t.meta,r=e.isMetaEmpty?new V:e.meta;t.meta=pn(s,r)}if(!e.isAttributesEmpty||!t.isAttributesEmpty){const s=t.isAttributesEmpty?new V:t.attributes,r=e.isAttributesEmpty?new V:e.attributes;t.attributes=pn(s,r)}ge.transfer(e,t),Me.transfer(e,t)}};const dn=class extends hn{enter(e){this.element=Ee(e.node),e.stop()}};const fn=i(function(e){return function(){return e}});const mn=fn(void 0);const yn=C(mn());const gn=i(function(e){return wt(ss(Es,0,js("length",e)),function(){for(var t=0,s=e.length;t<s;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0})});const xn=i(function(e){return!Vr(e)});var bn=ws(Bs);const vn=gn([yr,bn,xn]);const wn=g(function(e,t){for(var s={},r=0;r<e.length;)e[r]in t&&(s[e[r]]=t[e[r]]),r+=1;return s});const kn=class extends hn{specObj;passingOptionsNames=["specObj","parent"];constructor({specObj:e,...t}){super({...t}),this.specObj=e}retrievePassingOptions(){return wn(this.passingOptionsNames,this)}retrieveFixedFields(e){const t=lr(["visitors",...e,"fixedFields"],this.specObj);return"object"==typeof t&&null!==t?Object.keys(t):[]}retrieveVisitor(e){return ur(Cs,["visitors",...e],this.specObj)?lr(["visitors",...e],this.specObj):lr(["visitors",...e,"$visitor"],this.specObj)}retrieveVisitorInstance(e,t={}){const s=this.retrievePassingOptions();return new(this.retrieveVisitor(e))({...s,...t})}toRefractedElement(e,t,s={}){const r=this.retrieveVisitorInstance(e,s);return r instanceof dn&&r?.constructor===dn?Ee(t):(Ws(t,r,s),r.element)}};const On=class extends kn{specPath;ignoredFields;constructor({specPath:e,ignoredFields:t,...s}){super({...s}),this.specPath=e,this.ignoredFields=t||[]}ObjectElement(e){const t=e.node,s=this.specPath(t),r=this.retrieveFixedFields(s);t.forEach((e,t,n)=>{const i=_e(t);if(ee(t)&&r.includes(i)&&!this.ignoredFields.includes(i)){const r=this.toRefractedElement([...s,"fixedFields",i],e),o=new R(Ee(t),r);this.copyMetaAndAttributes(n,o),o.classes.push("fixed-field"),this.element.content.push(o)}else this.ignoredFields.includes(i)||this.element.content.push(Ee(n))}),this.copyMetaAndAttributes(t,this.element),e.stop()}},En=(e,t,s=[])=>{const r=Object.getOwnPropertyDescriptors(t);for(let e of s)delete r[e];Object.defineProperties(e,r)},Sn=(e,t=[e])=>{const s=Object.getPrototypeOf(e);return null===s?t:Sn(s,[...t,s])},An=(e,t,s=[])=>{var r;const n=null!==(r=((...e)=>{if(0===e.length)return;let t;const s=e.map(e=>Sn(e));for(;s.every(e=>e.length>0);){const e=s.map(e=>e.pop()),r=e[0];if(!e.every(e=>e===r))break;t=r}return t})(...e))&&void 0!==r?r:Object.prototype,i=Object.create(n),o=Sn(n);for(let t of e){let e=Sn(t);for(let t=e.length-1;t>=0;t--){let r=e[t];-1===o.indexOf(r)&&(En(i,r,["constructor",...s]),o.push(r))}}return i.constructor=t,i},jn=e=>e.filter((t,s)=>e.indexOf(t)==s),In=(e,t)=>{const s=t.map(e=>Sn(e));let r=0,n=!0;for(;n;){n=!1;for(let i=t.length-1;i>=0;i--){const t=s[i][r];if(null!=t&&(n=!0,null!=Object.getOwnPropertyDescriptor(t,e)))return s[i][0]}r++}},Mn=(e,t=Object.prototype)=>new Proxy({},{getPrototypeOf:()=>t,setPrototypeOf(){throw Error("Cannot set prototype of Proxies created by ts-mixer")},getOwnPropertyDescriptor:(t,s)=>Object.getOwnPropertyDescriptor(In(s,e)||{},s),defineProperty(){throw new Error("Cannot define new properties on Proxies created by ts-mixer")},has:(s,r)=>void 0!==In(r,e)||void 0!==t[r],get:(s,r)=>(In(r,e)||t)[r],set(t,s,r){const n=In(s,e);if(void 0===n)throw new Error("Cannot set new properties on Proxies created by ts-mixer");return n[s]=r,!0},deleteProperty(){throw new Error("Cannot delete properties on Proxies created by ts-mixer")},ownKeys:()=>e.map(Object.getOwnPropertyNames).reduce((e,t)=>t.concat(e.filter(e=>t.indexOf(e)<0)))}),Tn=null,Pn="copy",Fn="copy",Cn="deep",Nn=new WeakMap,Dn=e=>Nn.get(e),Bn=(e,t)=>{var s,r;const n=jn([...Object.getOwnPropertyNames(e),...Object.getOwnPropertyNames(t)]),i={};for(let o of n)i[o]=jn([...null!==(s=null==e?void 0:e[o])&&void 0!==s?s:[],...null!==(r=null==t?void 0:t[o])&&void 0!==r?r:[]]);return i},_n=(e,t)=>{var s,r,n,i;return{property:Bn(null!==(s=null==e?void 0:e.property)&&void 0!==s?s:{},null!==(r=null==t?void 0:t.property)&&void 0!==r?r:{}),method:Bn(null!==(n=null==e?void 0:e.method)&&void 0!==n?n:{},null!==(i=null==t?void 0:t.method)&&void 0!==i?i:{})}},Ln=(e,t)=>{var s,r,n,i,o,c;return{class:jn([...null!==(s=null==e?void 0:e.class)&&void 0!==s?s:[],...null!==(r=null==t?void 0:t.class)&&void 0!==r?r:[]]),static:_n(null!==(n=null==e?void 0:e.static)&&void 0!==n?n:{},null!==(i=null==t?void 0:t.static)&&void 0!==i?i:{}),instance:_n(null!==(o=null==e?void 0:e.instance)&&void 0!==o?o:{},null!==(c=null==t?void 0:t.instance)&&void 0!==c?c:{})}},qn=new Map,$n=(...e)=>{const t=((...e)=>{var t;const s=new Set,r=new Set([...e]);for(;r.size>0;)for(let e of r){const n=[...Sn(e.prototype).map(e=>e.constructor),...null!==(t=Dn(e))&&void 0!==t?t:[]].filter(e=>!s.has(e));for(let e of n)r.add(e);s.add(e),r.delete(e)}return[...s]})(...e).map(e=>qn.get(e)).filter(e=>!!e);return 0==t.length?{}:1==t.length?t[0]:t.reduce((e,t)=>Ln(e,t))},Rn=e=>{let t=qn.get(e);return t||(t={},qn.set(e,t)),t};function Vn(...e){var t,s,r;const n=e.map(e=>e.prototype),i=Tn;if(null!==i){const e=n.map(e=>e[i]).filter(e=>"function"==typeof e),t=function(...t){for(let s of e)s.apply(this,t)},s={[i]:t};n.push(s)}function o(...t){for(const s of e)En(this,new s(...t));null!==i&&"function"==typeof this[i]&&this[i].apply(this,t)}var c,a;o.prototype="copy"===Fn?An(n,o):(c=n,a=o,Mn([...c,{constructor:a}])),Object.setPrototypeOf(o,"copy"===Pn?An(e,null,["prototype"]):Mn(e,Function.prototype));let l=o;if("none"!==Cn){const n="deep"===Cn?$n(...e):((...e)=>{const t=e.map(e=>Rn(e));return 0===t.length?{}:1===t.length?t[0]:t.reduce((e,t)=>Ln(e,t))})(...e);for(let e of null!==(t=null==n?void 0:n.class)&&void 0!==t?t:[]){const t=e(l);t&&(l=t)}Un(null!==(s=null==n?void 0:n.static)&&void 0!==s?s:{},l),Un(null!==(r=null==n?void 0:n.instance)&&void 0!==r?r:{},l.prototype)}var u,p;return u=l,p=e,Nn.set(u,p),l}const Un=(e,t)=>{const s=e.property,r=e.method;if(s)for(let e in s)for(let r of s[e])r(t,e);if(r)for(let e in r)for(let s of r[e])s(t,e,Object.getOwnPropertyDescriptor(t,e))};const Hn=function(){return!1};const Gn=class extends kn{specPath;ignoredFields;fieldPatternPredicate=Hn;constructor({specPath:e,ignoredFields:t,fieldPatternPredicate:s,...r}){super({...r}),this.specPath=e,this.ignoredFields=t||[],"function"==typeof s&&(this.fieldPatternPredicate=s)}ObjectElement(e){const t=e.node;t.forEach((e,t,s)=>{const r=_e(t);if(!this.ignoredFields.includes(r)&&this.fieldPatternPredicate(r)){const r=this.specPath(e),n=this.toRefractedElement(r,e),i=new R(Ee(t),n);this.copyMetaAndAttributes(s,i),i.classes.push("patterned-field"),this.element.content.push(i)}else this.ignoredFields.includes(r)||this.element.content.push(Ee(s))}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Jn=class extends Gn{constructor(e){super(e),this.fieldPatternPredicate=vn}};const zn=class{parent;constructor({parent:e}){this.parent=e}},Xn=Vn(On,zn,dn),Wn=Vn(On,dn),Yn=Vn(On,dn),Kn=Vn(On,dn),Qn=Vn(kn,zn,dn),Zn=Vn(kn,zn,dn),ei=Vn(kn,zn,dn),ti=Vn(kn,zn,dn),si=Vn(kn,zn,dn),ri=Vn(Jn,zn,dn),ni=Vn(Jn,zn,dn),ii=Vn(Jn,zn,dn),oi=Vn(Jn,zn,dn),ci=e=>e instanceof U,ai=e=>e instanceof H,li=e=>e instanceof G,ui=e=>e instanceof J;const pi=class extends Xn{constructor(e){super(e),this.element=new U,this.specPath=fn(["document","objects","JSONSchema"])}get defaultDialectIdentifier(){return"http://json-schema.org/draft-04/schema#"}ObjectElement(e){const t=e.node;return this.handleDialectIdentifier(t),this.handleSchemaIdentifier(t),this.parent=this.element,On.prototype.ObjectElement.call(this,e)}handleDialectIdentifier(e){if(yn(this.parent)&&!ee(e.get("$schema")))this.element.meta.set("inheritedDialectIdentifier",this.defaultDialectIdentifier);else if(ci(this.parent)&&!ee(e.get("$schema"))){const e=Nr(_e(this.parent.meta.get("inheritedDialectIdentifier")),_e(this.parent.$schema));this.element.meta.set("inheritedDialectIdentifier",e)}}handleSchemaIdentifier(e,t="id"){const s=void 0!==this.parent?Ee(this.parent.meta.get("ancestorsSchemaIdentifiers")??new Q):new Q,r=_e(e.get(t));vn(r)&&s.push(r),this.element.meta.set("ancestorsSchemaIdentifiers",s)}},hi=e=>ie(e)&&e.hasKey("$ref");const di=class extends ti{ObjectElement(e){const t=e.node,s=hi(t)?["document","objects","JSONReference"]:["document","objects","JSONSchema"];this.element=this.toRefractedElement(s,t),e.stop()}ArrayElement(e){const t=e.node;this.element=new Q,this.element.classes.push("json-schema-items"),t.forEach(e=>{const t=hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const fi=class extends dn{ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-required")}};const mi=class extends oi{constructor(e){super(e),this.element=new V,this.element.classes.push("json-schema-properties"),this.specPath=e=>hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const yi=class extends ii{constructor(e){super(e),this.element=new V,this.element.classes.push("json-schema-patternProperties"),this.specPath=e=>hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const gi=class extends ni{constructor(e){super(e),this.element=new V,this.element.classes.push("json-schema-dependencies"),this.specPath=e=>hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const xi=class extends dn{ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-enum")}};const bi=class extends dn{StringElement(e){super.enter(e),this.element.classes.push("json-schema-type")}ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-type")}};const vi=class extends Qn{constructor(e){super(e),this.element=new Q,this.element.classes.push("json-schema-allOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const wi=class extends Zn{constructor(e){super(e),this.element=new Q,this.element.classes.push("json-schema-anyOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const ki=class extends ei{constructor(e){super(e),this.element=new Q,this.element.classes.push("json-schema-oneOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Oi=class extends ri{constructor(e){super(e),this.element=new V,this.element.classes.push("json-schema-definitions"),this.specPath=e=>hi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const Ei=class extends si{constructor(e){super(e),this.element=new Q,this.element.classes.push("json-schema-links")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=this.toRefractedElement(["document","objects","LinkDescription"],e);this.element.push(t)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Si=class extends Wn{constructor(e){super(e),this.element=new H,this.specPath=fn(["document","objects","JSONReference"])}ObjectElement(e){On.prototype.ObjectElement.call(this,e),ee(this.element.$ref)&&this.element.classes.push("reference-element")}};const Ai=class extends dn{StringElement(e){super.enter(e),this.element.classes.push("reference-value")}};const ji=function(){return!0};const Ii=zt(function(e,t,s){return wt(Math.max(e.length,t.length,s.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):s.apply(this,arguments)})});const Mi=i(function(e){return function(t,s){return e(t,s)?-1:e(s,t)?1:0}});var Ti=g(function(e,t){return Array.prototype.slice.call(t,0).sort(e)});const Pi=Ti;const Fi=i(function(e){return o(0,e)});function Ci(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}const Ni=i(Ci);const Di=ws(sr);const Bi=Gt(Ur,xn);function _i(e){return function(e){if(Array.isArray(e))return Li(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Li(e,t);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Li(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Li(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,r=Array(t);s<t;s++)r[s]=e[s];return r}var qi=os(Pi(Mi(function(e,t){return e.length>t.length})),Fi,As("length")),$i=xr(function(e,t,s){var r=s.apply(void 0,_i(e));return Di(r)?Ni(r):t});const Ri=Ii(Bi,function(e){var t=qi(e);return wt(t,function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return ss($i(s),void 0,e)})},mn);const Vi=class extends kn{alternator;constructor({alternator:e,...t}){super({...t}),this.alternator=e}enter(e){const t=e.node,s=this.alternator.map(({predicate:e,specPath:t})=>Ii(e,fn(t),mn)),r=Ri(s)(t);this.element=this.toRefractedElement(r,t),e.stop()}};const Ui=class extends Vi{constructor(e){super(e),this.alternator=[{predicate:hi,specPath:["document","objects","JSONReference"]},{predicate:ji,specPath:["document","objects","JSONSchema"]}]}};const Hi=class extends Kn{constructor(e){super(e),this.element=new G,this.specPath=fn(["document","objects","Media"])}};const Gi=class extends Yn{constructor(e){super(e),this.element=new J,this.specPath=fn(["document","objects","LinkDescription"])}},Ji={visitors:{value:dn,JSONSchemaOrJSONReferenceVisitor:Ui,document:{objects:{JSONSchema:{element:"jSONSchemaDraft4",$visitor:pi,fixedFields:{id:{$ref:"#/visitors/value",alias:"idField"},$schema:{$ref:"#/visitors/value"},multipleOf:{$ref:"#/visitors/value"},maximum:{$ref:"#/visitors/value"},exclusiveMaximum:{$ref:"#/visitors/value"},minimum:{$ref:"#/visitors/value"},exclusiveMinimum:{$ref:"#/visitors/value"},maxLength:{$ref:"#/visitors/value"},minLength:{$ref:"#/visitors/value"},pattern:{$ref:"#/visitors/value"},additionalItems:Ui,items:{$visitor:di,alias:"itemsField"},maxItems:{$ref:"#/visitors/value"},minItems:{$ref:"#/visitors/value"},uniqueItems:{$ref:"#/visitors/value"},maxProperties:{$ref:"#/visitors/value"},minProperties:{$ref:"#/visitors/value"},required:fi,properties:mi,additionalProperties:Ui,patternProperties:yi,dependencies:gi,enum:xi,type:bi,allOf:vi,anyOf:wi,oneOf:ki,not:Ui,definitions:Oi,title:{$ref:"#/visitors/value"},description:{$ref:"#/visitors/value"},default:{$ref:"#/visitors/value"},format:{$ref:"#/visitors/value"},base:{$ref:"#/visitors/value"},links:{$visitor:Ei,alias:"linksField"},media:{$ref:"#/visitors/document/objects/Media"},readOnly:{$ref:"#/visitors/value"}}},JSONReference:{element:"jSONReference",$visitor:Si,fixedFields:{$ref:Ai}},Media:{element:"media",$visitor:Hi,fixedFields:{binaryEncoding:{$ref:"#/visitors/value"},type:{$ref:"#/visitors/value"}}},LinkDescription:{element:"linkDescription",$visitor:Gi,fixedFields:{href:{$ref:"#/visitors/value"},rel:{$ref:"#/visitors/value"},title:{$ref:"#/visitors/value"},targetSchema:Ui,mediaType:{$ref:"#/visitors/value"},method:{$ref:"#/visitors/value"},encType:{$ref:"#/visitors/value"},schema:Ui}}}}}},zi=()=>{const e=new Zr,t={...r,...s,isStringElement:ee};return e.use(z),{predicates:t,namespace:e}},Xi=(e,{element:t="jSONSchemaDraft4",plugins:s=[],specificationObj:r=Ji}={})=>{const n=on(e),i=(e=>{if(Ir.has(e))return Ir.get(e);const t={},s=(e,r,n)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...n,"$visitor"]:n),tr((e,t)=>{const i=[...n,t];if(mr(e)&&or("$ref",e)&&cr(yr,"$ref",e)){const t=lr(["$ref"],e),s=jr("#/",t),n=lr(s.split("/"),r),{$ref:i,...o}=e;return Object.keys(o).length>0&&mr(n)?{...n,...o}:n}return mr(e)?s(e,r,i):e},e)),r=s(e,e,[]);return r.elementMap=t,Ir.set(e,r),r})(r),o=i.elementMap[t];if(!o)throw new Error(`Unknown element type: "${t}"`);const c=new(lr(o,i))({specObj:i});return Ws(n,c),rn(c.element,s,{toolboxCreator:zi})},Wi=(e,t={})=>Xi(e,{...t,element:"jSONSchemaDraft4"}),Yi=(e,t={})=>Xi(e,{...t,element:"jSONReference"}),Ki=(e,t={})=>Xi(e,{...t,element:"media"}),Qi=(e,t={})=>Xi(e,{...t,element:"linkDescription"}),Zi=Xi;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.apidomNsJSONSchemaDraft4=t():e.apidomNsJSONSchemaDraft4=t()}(self,()=>(()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},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,{AllOfVisitorBase:()=>ti,AlternatingVisitor:()=>Gi,AnyOfVisitorBase:()=>si,DefinitionsVisitorBase:()=>oi,DependenciesVisitorBase:()=>ci,FallbackVisitor:()=>yn,FixedFieldsVisitor:()=>An,ItemsVisitor:()=>yi,ItemsVisitorBase:()=>ni,JSONReferenceElement:()=>K,JSONReferenceVisitorBase:()=>Qn,JSONSchemaDraft4MediaTypes:()=>m,JSONSchemaElement:()=>W,JSONSchemaVisitor:()=>fi,JSONSchemaVisitorBase:()=>Yn,LinkDescriptionElement:()=>Q,LinkDescriptionVisitor:()=>Xi,LinkDescriptionVisitorBase:()=>Zn,LinksVisitorBase:()=>ii,MapVisitor:()=>Wn,MediaElement:()=>Y,MediaVisitorBase:()=>ei,OneOfVisitorBase:()=>ri,ParentSchemaAwareVisitor:()=>Kn,PatternPropertiesVisitorBase:()=>ai,PatternedFieldsVisitor:()=>Xn,PropertiesVisitorBase:()=>li,SpecificationVisitor:()=>Sn,Visitor:()=>mn,default:()=>Z,isJSONReferenceElement:()=>pi,isJSONReferenceLikeElement:()=>mi,isJSONSchemaElement:()=>ui,isLinkDescriptionElement:()=>di,isMediaElement:()=>hi,mediaTypes:()=>y,refract:()=>so,refractJSONReference:()=>Zi,refractJSONSchema:()=>Qi,refractLinkDescription:()=>to,refractMedia:()=>eo,refractorPluginReplaceEmptyElement:()=>sr,specificationObj:()=>Wi});var s={};e.r(s),e.d(s,{isJSONReferenceElement:()=>pi,isJSONSchemaElement:()=>ui,isLinkDescriptionElement:()=>di,isMediaElement:()=>hi});var r={};function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(s){return 0===arguments.length||n(s)?t:e.apply(this,arguments)}}function o(e,t){return t[e<0?t.length+e:e]}e.r(r),e.d(r,{isJSONReferenceLikeElement:()=>mi});const c=i(function(e){return o(-1,e)});class a extends AggregateError{constructor(e,t,s){super(e,t,s),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const l=a;class u extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(l,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const p=u;const h=class extends p{};const d=class extends h{};const f=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new d("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new d("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new d("latest method in MediaTypes class is not yet implemented.")}};class m extends f{filterByFormat(e="generic"){const t="generic"===e?"schema;version":e;return this.filter(e=>e.includes(t))}findBy(e="draft-04",t="generic"){const s="generic"===t?`schema;version=${e}`:`schema+${t};version=${e}`;return this.find(e=>e.includes(s))||this.unknownMediaType}latest(e="generic"){return c(this.filterByFormat(e))}}const y=new m("application/schema;version=draft-04","application/schema+json;version=draft-04","application/schema+yaml;version=draft-04");function g(e){return function t(s,r){switch(arguments.length){case 0:return t;case 1:return n(s)?t:i(function(t){return e(s,t)});default:return n(s)&&n(r)?t:n(s)?i(function(t){return e(t,r)}):n(r)?i(function(t){return e(s,t)}):e(s,r)}}}function x(e){for(var t,s=[];!(t=e.next()).done;)s.push(t.value);return s}function b(e,t,s){for(var r=0,n=s.length;r<n;){if(e(t,s[r]))return!0;r+=1}return!1}function v(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const w="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var O=Object.prototype.toString;const k=function(){return"[object Arguments]"===O.call(arguments)?function(e){return"[object Arguments]"===O.call(e)}:function(e){return v("callee",e)}}();var E=!{toString:null}.propertyIsEnumerable("toString"),S=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],A=function(){return arguments.propertyIsEnumerable("length")}(),j=function(e,t){for(var s=0;s<e.length;){if(e[s]===t)return!0;s+=1}return!1},I="function"!=typeof Object.keys||A?i(function(e){if(Object(e)!==e)return[];var t,s,r=[],n=A&&k(e);for(t in e)!v(t,e)||n&&"length"===t||(r[r.length]=t);if(E)for(s=S.length-1;s>=0;)v(t=S[s],e)&&!j(r,t)&&(r[r.length]=t),s-=1;return r}):i(function(e){return Object(e)!==e?[]:Object.keys(e)});const M=I;const T=i(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function F(e,t,s,r){var n=x(e);function i(e,t){return P(e,t,s.slice(),r.slice())}return!b(function(e,t){return!b(i,t,e)},x(t),n)}function P(e,t,s,r){if(w(e,t))return!0;var n=T(e);if(n!==T(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(n){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||!w(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!w(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 i=s.length-1;i>=0;){if(s[i]===e)return r[i]===t;i-=1}switch(n){case"Map":return e.size===t.size&&F(e.entries(),t.entries(),s.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&F(e.values(),t.values(),s.concat([e]),r.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 o=M(e);if(o.length!==M(t).length)return!1;var c=s.concat([e]),a=r.concat([t]);for(i=o.length-1;i>=0;){var l=o[i];if(!v(l,t)||!P(t[l],e[l],c,a))return!1;i-=1}return!0}const C=g(function(e,t){return P(e,t,[],[])});function D(e,t,s){if(s||(s=new N),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,n=function(r){var n=s.get(e);if(n)return n;for(var i in s.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?D(e[i],!0,s):e[i]);return r};switch(T(e)){case"Object":return n(Object.create(Object.getPrototypeOf(e)));case"Array":return n(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.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 N=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var s=this.hash(e),r=this.map[s];r||(this.map[s]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var s in e)t.push(Object.prototype.toString.call(e[s]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var s=this.map[t],r=0;r<s.length;r+=1){if((i=s[r])[0]===e)return i[1]}else{var n=this.hash(e);if(s=this.map[n])for(r=0;r<s.length;r+=1){var i;if((i=s[r])[0]===e)return i[1]}}},e}();const B=i(function(e){return null!=e&&"function"==typeof e.clone?e.clone():D(e,!0)});class _{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 _;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[s,r]of Object.entries(e)){const e=t.get(s);Array.isArray(e)&&Array.isArray(r)?t.set(s,[...e,...r]):t.set(s,r)}return t}cloneDeep(){const e=new _;for(const[t,s]of Object.entries(this))s instanceof this.Element?e.set(t,this.cloneDeepElement(s)):e.set(t,B(s));return e}}const L=_;const q=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class ${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(s=>{const r=s.value,n=s.key;if(void 0===r||void 0===n)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,n,s):e(r,n,s)})}filter(e,t){const s=this.elements.filter(s=>{const r=s.value,n=s.key;return void 0!==r&&void 0!==n&&(void 0!==t?e.call(t,r,n,s):e(r,n,s))});return new $(s)}reject(e,t){const s=[];for(const r of this.elements){const n=r.value,i=r.key;void 0!==n&&void 0!==i&&(e.call(t,n,i,r)||s.push(r))}return new $(s)}forEach(e,t){this.elements.forEach((s,r)=>{const n=s.value,i=s.key;void 0!==n&&void 0!==i&&(void 0!==t?e.call(t,n,i,s,r):e(n,i,s,r))})}find(e,t){return this.elements.find(s=>{const r=s.value,n=s.key;return void 0!==r&&void 0!==n&&(void 0!==t?e.call(t,r,n,s):e(r,n,s))})}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 R=$,V=Object.freeze(new L);class U{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,s){void 0!==t&&(this.meta=t),void 0!==s&&(this.attributes=s),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 U)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 q)this._content=e;else if(e instanceof R)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 V;this._meta=new L}return this._meta}set meta(e){if(e instanceof L)this._meta=e;else if(e&&"object"==typeof e){const t=new L;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 U?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 q){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof U?[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 U||e instanceof q?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof U?e.toValue():e;return C(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 s=new this.RefElement(t);return"string"==typeof e&&(s.path=this.refract(e)),s}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 H=U;class G extends H{constructor(e,t,s){super(e||[],t,s)}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 s=t||{},r=!!s.recursive,n=void 0===s.results?[]:s.results;for(let t=0;t<this._content.length;t+=1){const s=this._content[t],i=s;r&&"function"==typeof i.findElements&&i.findElements(e,{results:n,recursive:r}),e(s,t,void 0)&&n.push(s)}return n}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 s=t.classes;return"function"==typeof s.includes&&s.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 z=G;const J=class extends H{constructor(e,t,s,r){super(new q,s,r),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 X=class extends z{constructor(e,t,s){super(e||[],t,s),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(s=>s.key.toValue()!==e||(t=s,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const s=this.getMember(e);s?s.value=t:this._content.push(new J(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(s=>e.call(t,s.value,s.key,s))}compactMap(e,t){const s=[];return this.forEach((r,n,i)=>{const o=e.call(t,r,n,i);o&&s.push(o)}),s}filter(e,t){return new R(this._content).filter(e,t)}reject(e,t){const s=[];for(const r of this._content)e.call(t,r.value,r.key,r)||s.push(r);return new R(s)}forEach(e,t){this._content.forEach(s=>e.call(t,s.value,s.key,s))}reduce(e,t){let s,r;void 0!==t?(s=0,r=this.refract(t)):(s=1,r=this._content[0]?.value);for(let t=s;t<this._content.length;t+=1){const s=this._content[t],n=e(r,s.value,s.key,s,this);r=void 0===n?n:this.refract(n)}return r}empty(){return new this.constructor([])}};const W=class extends X{constructor(e,t,s){super(e,t,s),this.element="JSONSchemaDraft4"}get idField(){return this.get("id")}set idField(e){this.set("id",e)}get $schema(){return this.get("$schema")}set $schema(e){this.set("$schema",e)}get multipleOf(){return this.get("multipleOf")}set multipleOf(e){this.set("multipleOf",e)}get maximum(){return this.get("maximum")}set maximum(e){this.set("maximum",e)}get exclusiveMaximum(){return this.get("exclusiveMaximum")}set exclusiveMaximum(e){this.set("exclusiveMaximum",e)}get minimum(){return this.get("minimum")}set minimum(e){this.set("minimum",e)}get exclusiveMinimum(){return this.get("exclusiveMinimum")}set exclusiveMinimum(e){this.set("exclusiveMinimum",e)}get maxLength(){return this.get("maxLength")}set maxLength(e){this.set("maxLength",e)}get minLength(){return this.get("minLength")}set minLength(e){this.set("minLength",e)}get pattern(){return this.get("pattern")}set pattern(e){this.set("pattern",e)}get additionalItems(){return this.get("additionalItems")}set additionalItems(e){this.set("additionalItems",e)}get itemsField(){return this.get("items")}set itemsField(e){this.set("items",e)}get maxItems(){return this.get("maxItems")}set maxItems(e){this.set("maxItems",e)}get minItems(){return this.get("minItems")}set minItems(e){this.set("minItems",e)}get uniqueItems(){return this.get("uniqueItems")}set uniqueItems(e){this.set("uniqueItems",e)}get maxProperties(){return this.get("maxProperties")}set maxProperties(e){this.set("maxProperties",e)}get minProperties(){return this.get("minProperties")}set minProperties(e){this.set("minProperties",e)}get required(){return this.get("required")}set required(e){this.set("required",e)}get properties(){return this.get("properties")}set properties(e){this.set("properties",e)}get additionalProperties(){return this.get("additionalProperties")}set additionalProperties(e){this.set("additionalProperties",e)}get patternProperties(){return this.get("patternProperties")}set patternProperties(e){this.set("patternProperties",e)}get dependencies(){return this.get("dependencies")}set dependencies(e){this.set("dependencies",e)}get enum(){return this.get("enum")}set enum(e){this.set("enum",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}get allOf(){return this.get("allOf")}set allOf(e){this.set("allOf",e)}get anyOf(){return this.get("anyOf")}set anyOf(e){this.set("anyOf",e)}get oneOf(){return this.get("oneOf")}set oneOf(e){this.set("oneOf",e)}get not(){return this.get("not")}set not(e){this.set("not",e)}get definitions(){return this.get("definitions")}set definitions(e){this.set("definitions",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get default(){return this.get("default")}set default(e){this.set("default",e)}get format(){return this.get("format")}set format(e){this.set("format",e)}get base(){return this.get("base")}set base(e){this.set("base",e)}get linksField(){return this.get("links")}set linksField(e){this.set("links",e)}get media(){return this.get("media")}set media(e){this.set("media",e)}get readOnly(){return this.get("readOnly")}set readOnly(e){this.set("readOnly",e)}};const K=class extends X{constructor(e,t,s){super(e,t,s),this.element="JSONReference",this.classes.push("json-reference")}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}};const Y=class extends X{constructor(e,t,s){super(e,t,s),this.element="media"}get binaryEncoding(){return this.get("binaryEncoding")}set binaryEncoding(e){this.set("binaryEncoding",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}};const Q=class extends X{constructor(e,t,s){super(e,t,s),this.element="linkDescription"}get href(){return this.get("href")}set href(e){this.set("href",e)}get rel(){return this.get("rel")}set rel(e){this.set("rel",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get targetSchema(){return this.get("targetSchema")}set targetSchema(e){this.set("targetSchema",e)}get mediaType(){return this.get("mediaType")}set mediaType(e){this.set("mediaType",e)}get method(){return this.get("method")}set method(e){this.set("method",e)}get encType(){return this.get("encType")}set encType(e){this.set("encType",e)}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}},Z={namespace:e=>{const{base:t}=e;return t.register("jSONSchemaDraft4",W),t.register("jSONReference",K),t.register("media",Y),t.register("linkDescription",Q),t}};const ee=class extends H{constructor(e,t,s){super(e,t,s),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const te=class extends H{constructor(e,t,s){super(e,t,s),this.element="number"}primitive(){return"number"}};const se=class extends H{constructor(e,t,s){super(e??null,t,s),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const re=class extends H{constructor(e,t,s){super(e,t,s),this.element="boolean"}primitive(){return"boolean"}};const ne=class extends z{constructor(e,t,s){super(e||[],t,s),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 s=[];for(const r of this._content){const n=e.call(t,r);n&&s.push(n)}return s}filter(e,t){const s=this._content.filter(e,t);return new this.constructor(s)}reject(e,t){const s=[];for(const r of this._content)e.call(t,r)||s.push(r);return new this.constructor(s)}reduce(e,t){let s,r;void 0!==t?(s=0,r=this.refract(t)):(s=1,r=this.first);for(let t=s;t<this.length;t+=1){const s=e(r,this._content[t],t,this);r=void 0===s?s:this.refract(s)}return r}forEach(e,t){this._content.forEach((s,r)=>{e.call(t,s,r)})}empty(){return new this.constructor([])}},ie=e=>e instanceof H,oe=e=>e instanceof ee,ce=e=>e instanceof te,ae=e=>e instanceof se,le=e=>e instanceof re,ue=e=>e instanceof ne,pe=e=>e instanceof X,he=e=>e instanceof J,de=e=>void 0!==e.style,fe=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,me=(e,t)=>0===t.length||!!ie(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class ye extends ee{constructor(e,t,s){super(e,t,s),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:s,startOffset:r,endLine:n,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof s||"number"!=typeof r||"number"!=typeof n||"number"!=typeof i||"number"!=typeof o)return;const c="sm1:"+[t,s,r,n,i,o].map(xe).join("");const a=new ye(c);return a.startLine=t,a.startCharacter=s,a.startOffset=r,a.endLine=n,a.endCharacter=i,a.endOffset=o,a}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,s=[];let r=0;for(let e=0;e<6;e++){const e=be(t,r);s.push(e.value),r=e.next}return s}(this.content))}}const ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function xe(e){let t=e>>>0,s="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),s+=ge[e]}while(0!==t);return s}function be(e,t=0){let s=0,r=0,n=t;for(;;){const t=e[n++],i=ge.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(s|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:s>>>0,next:n}}const ve=ye;const we=class extends p{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...s}=t;Object.assign(this,s)}}};const Oe=class extends we{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const ke=class extends Oe{};const Ee=class extends Oe{},Se=(e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const n=Me(e);s.set(e,n);const{content:i}=e;return Array.isArray(i)?n.content=i.map(e=>Se(e,r)):ie(i)?n.content=Se(i,r):n.content=i instanceof q?Ae(i,r):i,n},Ae=(e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const{key:n,value:i}=e,o=void 0!==n?Se(n,r):void 0,c=void 0!==i?Se(i,r):void 0,a=new q(o,c);return s.set(e,a),a},je=(e,t={})=>{if(e instanceof q)return Ae(e,t);if(e instanceof R)return((e,t)=>{const{visited:s=new WeakMap}=t,r={...t,visited:s};if(s.has(e))return s.get(e);const n=[...e].map(e=>Se(e,r)),i=new R(n);return s.set(e,i),i})(e,t);if(ie(e))return Se(e,t);throw new ke("Value provided to cloneDeep function couldn't be cloned",{value:e})};je.safe=e=>{try{return je(e)}catch{return e}};const Ie=e=>{const{key:t,value:s}=e;return new q(t,s)},Me=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=je(e.attributes)),fe(e)&&ve.transfer(e,t),de(e)&&(t.style=B(e.style));const{content:s}=e;return ie(s)?t.content=Me(s):Array.isArray(s)?t.content=[...s]:t.content=s instanceof q?Ie(s):s,t},Te=e=>{if(e instanceof q)return Ie(e);if(e instanceof R)return(e=>{const t=[...e];return new R(t)})(e);if(ie(e))return Me(e);throw new Ee("Value provided to cloneShallow function couldn't be cloned",{value:e})};Te.safe=e=>{try{return Te(e)}catch{return e}};class Fe extends X{constructor(e,t,s){super(e,t,s),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new Fe(e.style)}applyTo(e){e.style=this.toValue()}}const Pe=Fe;const Ce=class extends H{constructor(e,t,s){super(e||[],t,s),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const De=class extends H{constructor(e,t,s){super(e||[],t,s),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Ne=class extends ee{constructor(e,t,s){super(e,t,s),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Be=class extends ee{constructor(e,t,s){super(e,t,s),this.element="comment"}};const _e=class extends ne{constructor(e,t,s){super(e,t,s),this.element="parseResult"}get api(){return this.filter(e=>me(e,["api"])).first}get results(){return this.filter(e=>me(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&me(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&me(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const s=this._content,r=s.findIndex(e=>e===t);return-1!==r&&(s[r]=e,!0)}},Le=e=>e instanceof Ce,qe=e=>e instanceof De,$e=e=>{if(!ie(e))return e;if(oe(e)||ce(e)||le(e)||ae(e))return e.toValue();const t=new WeakMap,s=e=>{if(!ie(e))return e;if(pe(e)){if(t.has(e))return t.get(e);const r={};return t.set(e,r),e.forEach((e,t)=>{const n=s(t),i=s(e);"string"==typeof n&&(r[n]=i)}),r}if(ue(e)){if(t.has(e))return t.get(e);const r=[];return t.set(e,r),e.forEach(e=>r.push(s(e))),r}return qe(e)?String(e.toValue()):Le(e)?oe(e.href)?e.href.toValue():"":e.toValue()};return s(e)},Re=function(){const e=Ue,t=Ve,s=this,r="parser.js: Parser(): ";s.ast=void 0,s.stats=void 0,s.trace=void 0,s.callbacks=[];let n,i,o,c,a,l,u,p=0,h=0,d=0,f=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};s.parse=(g,x,v,w)=>{const O=`${r}parse(): `;p=0,h=0,d=0,f=0,m=0,n=void 0,i=void 0,o=void 0,c=void 0,y.refresh(),a=void 0,l=void 0,u=void 0,c=t.stringToChars(v),n=g.rules,i=g.udts;const k=x.toLowerCase();let E;for(const e in n)if(n.hasOwnProperty(e)&&k===n[e].lower){E=n[e].index;break}if(void 0===E)throw new Error(`${O}start rule name '${startRule}' not recognized`);(()=>{const e=`${r}initializeCallbacks(): `;let t,o;for(a=[],l=[],t=0;t<n.length;t+=1)a[t]=void 0;for(t=0;t<i.length;t+=1)l[t]=void 0;const c=[];for(t=0;t<n.length;t+=1)c.push(n[t].lower);for(t=0;t<i.length;t+=1)c.push(i[t].lower);for(const r in s.callbacks)if(s.callbacks.hasOwnProperty(r)){if(t=c.indexOf(r.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${r}' not a rule or udt name`);if(o=s.callbacks[r]?s.callbacks[r]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${r}] must be function reference or falsy)`);t<n.length?a[t]=o:l[t-n.length]=o}})(),s.trace&&s.trace.init(n,i,c),s.stats&&s.stats.init(n,i),s.ast&&s.ast.init(n,i,c),u=w,o=[{type:e.RNM,index:E}],b(0,0),o=void 0;let S=!1;switch(y.state){case e.ACTIVE:throw new Error(`${O}final state should never be 'ACTIVE'`);case e.NOMATCH:S=!1;break;case e.EMPTY:case e.MATCH:S=y.phraseLength===c.length;break;default:throw new Error("unrecognized state")}return{success:S,state:y.state,stateName:e.idName(y.state),length:c.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:d,nodeHits:f}};const g=(t,s,n,i)=>{if(s.phraseLength>n){let e=`${r}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${s.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(s.state){case e.ACTIVE:if(!i)throw new Error(`${r}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:s.phraseLength=0;break;case e.MATCH:0===s.phraseLength&&(s.state=e.EMPTY);break;case e.NOMATCH:s.phraseLength=0;break;default:throw new Error(`${r}opRNM(${t.name}): callback function return error. Unrecognized return state: ${s.state}`)}},x=(t,a)=>{let h,d,f;const m=o[t],g=i[m.index];y.UdtIndex=g.index,p||(f=s.ast&&s.ast.udtDefined(m.index),f&&(d=n.length+m.index,h=s.ast.getLength(),s.ast.down(d,g.name)));const x=c.length-a;l[m.index](y,c,a,u),((t,s,n)=>{if(s.phraseLength>n){let e=`${r}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${s.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(s.state){case e.ACTIVE:throw new Error(`${r}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);s.phraseLength=0;break;case e.MATCH:if(0===s.phraseLength){if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);s.state=e.EMPTY}break;case e.NOMATCH:s.phraseLength=0;break;default:throw new Error(`${r}opUDT(${t.name}): callback function return error. Unrecognized return state: ${s.state}`)}})(g,y,x),p||f&&(y.state===e.NOMATCH?s.ast.setLength(h):s.ast.up(d,g.name,a,y.phraseLength))},b=(t,i)=>{const l=`${r}opExecute(): `,v=o[t];switch(f+=1,h>d&&(d=h),h+=1,y.refresh(),s.trace&&s.trace.down(v,i),v.type){case e.ALT:((t,s)=>{const r=o[t];for(let t=0;t<r.children.length&&(b(r.children[t],s),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,r)=>{let n,i,c,a;const l=o[t];s.ast&&(i=s.ast.getLength()),n=!0,c=r,a=0;for(let t=0;t<l.children.length;t+=1){if(b(l.children[t],c),y.state===e.NOMATCH){n=!1;break}c+=y.phraseLength,a+=y.phraseLength}n?(y.state=0===a?e.EMPTY:e.MATCH,y.phraseLength=a):(y.state=e.NOMATCH,y.phraseLength=0,s.ast&&s.ast.setLength(i))})(t,i);break;case e.REP:((t,r)=>{let n,i,a,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=r,a=0,l=0,s.ast&&(n=s.ast.getLength());!(i>=c.length)&&(b(t+1,i),y.state!==e.NOMATCH)&&y.state!==e.EMPTY&&(l+=1,a+=y.phraseLength,i+=y.phraseLength,l!==u.max););y.state===e.EMPTY||l>=u.min?(y.state=0===a?e.EMPTY:e.MATCH,y.phraseLength=a):(y.state=e.NOMATCH,y.phraseLength=0,s.ast&&s.ast.setLength(n))})(t,i);break;case e.RNM:((t,r)=>{let i,l,h;const d=o[t],f=n[d.index],m=a[f.index];if(p||(l=s.ast&&s.ast.ruleDefined(d.index),l&&(i=s.ast.getLength(),s.ast.down(d.index,n[d.index].name))),m){const t=c.length-r;m(y,c,r,u),g(f,y,t,!0),y.state===e.ACTIVE&&(h=o,o=f.opcodes,b(0,r),o=h,m(y,c,r,u),g(f,y,t,!1))}else h=o,o=f.opcodes,b(0,r,y),o=h;p||l&&(y.state===e.NOMATCH?s.ast.setLength(i):s.ast.up(d.index,f.name,r,y.phraseLength))})(t,i);break;case e.TRG:((t,s)=>{const r=o[t];y.state=e.NOMATCH,s<c.length&&r.min<=c[s]&&c[s]<=r.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,s)=>{const r=o[t],n=r.string.length;if(y.state=e.NOMATCH,s+n<=c.length){for(let e=0;e<n;e+=1)if(c[s+e]!==r.string[e])return;y.state=e.MATCH,y.phraseLength=n}})(t,i);break;case e.TLS:((t,s)=>{let r;const n=o[t];y.state=e.NOMATCH;const i=n.string.length;if(0!==i){if(s+i<=c.length){for(let e=0;e<i;e+=1)if(r=c[s+e],r>=65&&r<=90&&(r+=32),r!==n.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:x(t,i);break;case e.AND:((t,s)=>{switch(p+=1,b(t+1,s),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.EMPTY;break;case e.NOMATCH:y.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${y.state}`)}})(t,i);break;case e.NOT:((t,s)=>{switch(p+=1,b(t+1,s),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.NOMATCH;break;case e.NOMATCH:y.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${y.state}`)}})(t,i);break;default:throw new Error(`${l}unrecognized operator`)}p||i+y.phraseLength>m&&(m=i+y.phraseLength),s.stats&&s.stats.collect(v,y),s.trace&&s.trace.up(v,y.state,i,y.phraseLength),h-=1}},Ve={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,s)=>{let r=e;for(;!(void 0===t||t<0);){if(void 0===s){r=e.slice(t);break}if(s<=0)return"";r=e.slice(t,t+s);break}return String.fromCodePoint(...r)}},Ue={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 Ue.ALT:return"ALT";case Ue.CAT:return"CAT";case Ue.REP:return"REP";case Ue.RNM:return"RNM";case Ue.TRG:return"TRG";case Ue.TBS:return"TBS";case Ue.TLS:return"TLS";case Ue.UDT:return"UDT";case Ue.AND:return"AND";case Ue.NOT:return"NOT";case Ue.ACTIVE:return"ACTIVE";case Ue.EMPTY:return"EMPTY";case Ue.MATCH:return"MATCH";case Ue.NOMATCH:return"NOMATCH";case Ue.SEM_PRE:return"SEM_PRE";case Ue.SEM_POST:return"SEM_POST";case Ue.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function He(){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 Ge 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,...s}=t;Object.assign(this,s)}}}const ze=Ge;new He;new He,new Re,new He,new Re,new He,new Re,new He,new Re;const Je=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 Xe=class extends ze{},We=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 Je(String(e))}).join("/")}`}catch(t){throw new Xe("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class Ke 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,...s}=t;Object.assign(this,s)}}}const Ye=Ke;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 Ye{},Ze=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 s of e){const e=s.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")}`:s}}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})}},et=(e,t,s,r)=>{const{realm:n}=e,{value:i}=s;if(n.isObject(t)&&n.hasProperty(t,i)){r(n.getProperty(t,i),i)}},tt=(e,t,s,r)=>{const{realm:n}=e,{value:i}=s;if(!n.isArray(t))return;const o=n.getLength(t),c=((e,t)=>e>=0?e:t+e)(i,o);if(c>=0&&c<o){r(n.getElement(t,c),c)}},st=(e,t,s,r)=>{const{realm:n}=e;for(const[e,s]of n.entries(t))r(s,e)},rt=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),nt=(e,t,s,r)=>{const{realm:n}=e,{start:i,end:o,step:c}=s;if(!n.isArray(t))return;const a=((e,t,s,r)=>{const n=s??1;if(0===n)return null;let i,o;if(n>0){const s=0,n=r,c=null!==e?rt(e,r):s,a=null!==t?rt(t,r):n;i=Math.max(c,0),o=Math.min(a,r)}else{const s=r-1,n=-r-1,c=null!==e?e>=0?Math.min(e,r-1):Math.max(r+e,-1):s,a=null!==t?t>=0?Math.min(t,r-1):Math.max(r+t,-1):n;o=Math.min(c,r-1),i=Math.max(a,-1)}return{lower:i,upper:o,step:n}})(i,o,c,n.getLength(t));if(null===a)return;const{lower:l,upper:u,step:p}=a;if(p>0)for(let e=l;e<u;e+=p){r(n.getElement(t,e),e)}else for(let e=u;e>l;e+=p){r(n.getElement(t,e),e)}},it=(e,t,s,r)=>r.value,ot=(e,t,s)=>{const{realm:r}=e,{selector:n}=s;switch(n.type){case"NameSelector":{const{value:e}=n;return r.isObject(t)&&r.hasProperty(t,e)?r.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=n;if(!r.isArray(t))return;const s=r.getLength(t),i=e>=0?e:s+e;return i>=0&&i<s?r.getElement(t,i):void 0}default:return}},ct=(e,t,s,r)=>{const{selectors:n}=s;for(const s of n)bt(e,t,s,r)},at=(e,t,s)=>{const r=[],n=e=>{r.push(e)},{selector:i}=s;switch(i.type){case"BracketedSelection":ct(e,t,i,n);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":bt(e,t,i,n)}return r},lt=(e,t,s,r)=>{let n=s;for(const t of r){const s=[];if("DescendantSegment"===t.type){const r=n=>{const{realm:i}=e,o=at(e,n,t);s.push(...o);for(const[,e]of i.entries(n))r(e)};for(const e of n)r(e)}else for(const r of n){const n=at(e,r,t);s.push(...n)}n=s}return n},ut=(e,t,s,r)=>{const{query:n}=r;let i;switch(n.type){case"RelQuery":i=((e,t,s,r)=>{const{segments:n}=r;return 0===n.length?[s]:lt(e,0,[s],n)})(e,0,s,n);break;case"JsonPathQuery":i=((e,t,s,r)=>{const{segments:n}=r;return 0===n.length?[t]:lt(e,0,[t],n)})(e,t,0,n);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let pt;const ht=(e,t,s,r)=>{const{name:n,arguments:i}=r,o=e.functions[n];if("function"!=typeof o)return;const c=i.map(r=>((e,t,s,r)=>{switch(r.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return dt(e,t,s,r);case"FilterQuery":return ut(e,t,s,r);case"TestExpr":return"FilterQuery"===r.expression.type?ut(e,t,s,r.expression):"FunctionExpr"===r.expression.type?dt(e,t,s,r.expression):pt(e,t,s,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return pt(e,t,s,r);default:return}})(e,t,s,r));return o(e.realm,...c)},dt=(e,t,s,r)=>{switch(r.type){case"Literal":return it(e,t,s,r);case"RelSingularQuery":return((e,t,s,r)=>{let n=s;for(const t of r.segments)if(n=ot(e,n,t),void 0===n)return;return n})(e,0,s,r);case"AbsSingularQuery":return((e,t,s,r)=>{let n=t;for(const t of r.segments)if(n=ot(e,n,t),void 0===n)return;return n})(e,t,0,r);case"FunctionExpr":return ht(e,t,s,r);default:return}},ft=(e,t,s,r)=>{const{left:n,op:i,right:o}=r,c=dt(e,t,s,n),a=dt(e,t,s,o);return e.realm.compare(c,i,a)},mt=e=>Array.isArray(e),yt=(e,t,s,r)=>{switch(r.type){case"LogicalOrExpr":return!!yt(e,t,s,r.left)||yt(e,t,s,r.right);case"LogicalAndExpr":return!!yt(e,t,s,r.left)&&yt(e,t,s,r.right);case"LogicalNotExpr":return!yt(e,t,s,r.expression);case"TestExpr":{const{expression:n}=r;if("FilterQuery"===n.type){return ut(e,t,s,n).length>0}if("FunctionExpr"===n.type){const r=ht(e,t,s,n);return"boolean"==typeof r?r:void 0!==r&&(mt(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return ft(e,t,s,r);default:return!1}};pt=yt;const gt=yt,xt=(e,t,s,r)=>{const{realm:n,root:i}=e,{expression:o}=s;for(const[s,c]of n.entries(t)){gt(e,i,c,o)&&r(c,s)}},bt=(e,t,s,r)=>{switch(s.type){case"NameSelector":et(e,t,s,r);break;case"IndexSelector":tt(e,t,s,r);break;case"WildcardSelector":st(e,t,s,r);break;case"SliceSelector":nt(e,t,s,r);break;case"FilterSelector":xt(e,t,s,r)}};new Map;class vt{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#s=!1;#r=!1;#n;#i=!1;constructor(e,t,s,r,n){this.node=e,this.parent=t,this.parentPath=s,this.key=r,this.index=n&&"number"==typeof r?r:void 0,this.inList=n}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#s}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:s,parent:r,parentPath:n}=t;if(he(r)&&"value"===s){if(!oe(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else ue(n?.node)&&"number"==typeof s&&e.unshift(s);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?Ze(t):We(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.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&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.#r=!0,this.#n=e,this.node=e}remove(){this.#i&&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.#s=!0}_getReplacementNode(){return this.#n}_wasReplaced(){return this.#r}_reset(){this.#e=!1,this.#t=!1,this.#s=!1,this.#r=!1,this.#n=void 0}_markStale(){this.#i=!0}}function wt(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,s){return t.apply(this,arguments)};case 3:return function(e,s,r){return t.apply(this,arguments)};case 4:return function(e,s,r,n){return t.apply(this,arguments)};case 5:return function(e,s,r,n,i){return t.apply(this,arguments)};case 6:return function(e,s,r,n,i,o){return t.apply(this,arguments)};case 7:return function(e,s,r,n,i,o,c){return t.apply(this,arguments)};case 8:return function(e,s,r,n,i,o,c,a){return t.apply(this,arguments)};case 9:return function(e,s,r,n,i,o,c,a,l){return t.apply(this,arguments)};case 10:return function(e,s,r,n,i,o,c,a,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 Ot(e,t,s){return function(){for(var r=[],i=0,o=e,c=0,a=!1;c<t.length||i<arguments.length;){var l;c<t.length&&(!n(t[c])||i>=arguments.length)?l=t[c]:(l=arguments[i],i+=1),r[c]=l,n(l)?a=!0:o-=1,c+=1}return!a&&o<=0?s.apply(this,r):wt(Math.max(0,o),Ot(e,r,s))}}var kt=g(function(e,t){return 1===e?i(t):wt(e,Ot(e,[],t))});const Et=kt;function St(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const At=g(function(e,t){return e&&t});function jt(e,t,s){for(var r=0,n=s.length;r<n;)t=e(t,s[r]),r+=1;return t}const It=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function Mt(e){return"[object String]"===Object.prototype.toString.call(e)}const Tt=i(function(e){return!!It(e)||!!e&&("object"==typeof e&&(!Mt(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var Ft="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Pt(e,t,s){return function(r,n,i){if(Tt(i))return e(r,n,i);if(null==i)return n;if("function"==typeof i["fantasy-land/reduce"])return t(r,n,i,"fantasy-land/reduce");if(null!=i[Ft])return s(r,n,i[Ft]());if("function"==typeof i.next)return s(r,n,i);if("function"==typeof i.reduce)return t(r,n,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Ct(e,t,s){for(var r=s.next();!r.done;)t=e(t,r.value),r=s.next();return t}function Dt(e,t,s,r){return s[r](e,t)}const Nt=Pt(jt,Dt,Ct);function Bt(e,t,s){return function(){if(0===arguments.length)return s();var r=arguments[arguments.length-1];if(!It(r)){for(var n=0;n<e.length;){if("function"==typeof r[e[n]])return r[e[n]].apply(r,Array.prototype.slice.call(arguments,0,-1));n+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return s.apply(this,arguments)}}function _t(e,t){for(var s=0,r=t.length,n=Array(r);s<r;)n[s]=e(t[s]),s+=1;return n}const Lt=function(){return this.xf["@@transducer/init"]()},qt=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"]=qt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Rt=g(Bt(["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 Et(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return jt(function(s,r){return s[r]=e(t[r]),s},{},M(t));default:return _t(e,t)}}));const Vt=Rt;const Ut=g(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(s){return e(s)(t(s))}:Nt(function(e,s){return function(e,t){var s;t=t||[];var r=(e=e||[]).length,n=t.length,i=[];for(s=0;s<r;)i[i.length]=e[s],s+=1;for(s=0;s<n;)i[i.length]=t[s],s+=1;return i}(e,Vt(s,t))},[],e)});var Ht=g(function(e,t){var s=Et(e,t);return Et(e,function(){return jt(Ut,Vt(s,arguments[0]),Array.prototype.slice.call(arguments,1))})});const Gt=Ht;var zt=i(function(e){return Gt(e.length,e)});const Jt=zt;const Xt=g(function(e,t){return St(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:Jt(At)(e,t)});function Wt(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function Kt(e){return function t(s,r,o){switch(arguments.length){case 0:return t;case 1:return n(s)?t:g(function(t,r){return e(s,t,r)});case 2:return n(s)&&n(r)?t:n(s)?g(function(t,s){return e(t,r,s)}):n(r)?g(function(t,r){return e(s,t,r)}):i(function(t){return e(s,r,t)});default:return n(s)&&n(r)&&n(o)?t:n(s)&&n(r)?g(function(t,s){return e(t,s,o)}):n(s)&&n(o)?g(function(t,s){return e(t,r,s)}):n(r)&&n(o)?g(function(t,r){return e(s,t,r)}):n(s)?i(function(t){return e(t,r,o)}):n(r)?i(function(t){return e(s,t,o)}):n(o)?i(function(t){return e(s,r,t)}):e(s,r,o)}}}function Yt(e,t,s){for(var r=0,n=s.length;r<n;){if((t=e["@@transducer/step"](t,s[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}var Qt=g(function(e,t){return wt(e.length,function(){return e.apply(t,arguments)})});const Zt=Qt;function es(e,t,s){for(var r=s.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=s.next()}return e["@@transducer/result"](t)}function ts(e,t,s,r){return e["@@transducer/result"](s[r](Zt(e["@@transducer/step"],e),t))}const ss=Pt(Yt,ts,es);var rs=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 ns=Kt(function(e,t,s){return ss("function"==typeof e?function(e){return new rs(e)}(e):e,t,s)});const is=ns;function os(e,t){return function(){var s=arguments.length;if(0===s)return t();var r=arguments[s-1];return It(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,s-1))}}const cs=Kt(os("slice",function(e,t,s){return Array.prototype.slice.call(s,e,t)}));const as=i(os("tail",cs(1,1/0)));function ls(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return wt(arguments[0].length,is(Wt,arguments[0],as(arguments)))}function us(e,t){return function(e,t,s){var r,n;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(r=1/t;s<e.length;){if(0===(n=e[s])&&1/n===r)return s;s+=1}return-1}if(t!=t){for(;s<e.length;){if("number"==typeof(n=e[s])&&n!=n)return s;s+=1}return-1}return e.indexOf(t,s);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,s);case"object":if(null===t)return e.indexOf(t,s)}for(;s<e.length;){if(C(e[s],t))return s;s+=1}return-1}(t,e,0)>=0}function ps(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 hs=function(e){return(e<10?"0":"")+e};const ds="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+hs(e.getUTCMonth()+1)+"-"+hs(e.getUTCDate())+"T"+hs(e.getUTCHours())+":"+hs(e.getUTCMinutes())+":"+hs(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function fs(e){return"[object Object]"===Object.prototype.toString.call(e)}var ms=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Lt,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 ys(e){return function(t){return new ms(e,t)}}var gs=g(Bt(["fantasy-land/filter","filter"],ys,function(e,t){return fs(t)?jt(function(s,r){return e(t[r])&&(s[r]=t[r]),s},{},M(t)):(s=t,"[object Map]"===Object.prototype.toString.call(s)?function(e,t){for(var s=new Map,r=t.entries(),n=r.next();!n.done;)e(n.value[1])&&s.set(n.value[0],n.value[1]),n=r.next();return s}(e,t):function(e,t){for(var s=0,r=t.length,n=[];s<r;)e(t[s])&&(n[n.length]=t[s]),s+=1;return n}(e,t));var s}));const xs=gs;const bs=g(function(e,t){return xs((s=e,function(){return!s.apply(this,arguments)}),t);var s});function vs(e,t){var s=function(s){var r=t.concat([e]);return us(s,r)?"<Circular>":vs(s,r)},r=function(e,t){return _t(function(t){return ps(t)+": "+s(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+_t(s,e).join(", ")+"))";case"[object Array]":return"["+_t(s,e).concat(r(e,bs(function(e){return/^\d+$/.test(e)},M(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+s(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?s(NaN):ps(ds(e)))+")";case"[object Map]":return"new Map("+s(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+s(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+s(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+s(e.valueOf())+")":ps(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+r(e,M(e)).join(", ")+"}"}}const ws=i(function(e){return vs(e,[])});const Os=g(function(e,t){return e||t});const ks=g(function(e,t){return St(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:Jt(Os)(e,t)});const Es=Jt(i(function(e){return!e}));const Ss=C(null);const As=Es(Ss);const js=g(function(e,t){if(e===t)return t;function s(e,t){if(e>t!=t>e)return t>e?t:e}var r=s(e,t);if(void 0!==r)return r;var n=s(typeof e,typeof t);if(void 0!==n)return n===typeof e?e:t;var i=ws(e),o=s(i,ws(t));return void 0!==o&&o===i?e:t}),Is=Number.isInteger||function(e){return(e|0)===e};const Ms=g(function(e,t){if(null!=t)return Is(e)?o(e,t):t[e]});const Ts=g(function(e,t){return Vt(Ms(e),t)});const Fs=i(function(e){return Et(is(js,0,Ts("length",e)),function(){for(var t=0,s=e.length;t<s;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Ps=function(e,t){switch(arguments.length){case 0:return Ps;case 1:return function t(s){return 0===arguments.length?t:w(e,s)};default:return w(e,t)}};const Cs=Ps;const Ds=Et(1,ls(T,Cs("GeneratorFunction")));const Ns=Et(1,ls(T,Cs("AsyncFunction")));const Bs=Fs([ls(T,Cs("Function")),Ds,Ns]);function _s(e){return _s="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},_s(e)}const Ls=function(e){return"object"===_s(e)};const qs=Et(1,Xt(As,ks(Ls,Bs)));const $s=Et(1,Xt(qs,ls(ws,C("[object Promise]")))),Rs=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},Vs=e=>ie(e),Us=e=>Te(e),Hs=(e,t,s)=>{he(e)?e.value=s:Array.isArray(e)?e[t]=null===s?void 0:s:null===s?delete e[t]:e[t]=s},Gs=e=>he(e)?["key","value"]:ue(e)||pe(e)?["content"]:[],zs=(e,t)=>{if(void 0!==e[t])return e[t];const s=t.length;for(const r in e){if(!r.includes("|"))continue;const n=r.indexOf(t);if(-1===n)continue;const i=0===n||"|"===r[n-1],o=n+s===r.length||"|"===r[n+s];if(i&&o)return e[r]}},Js=(e,t,s)=>{if(void 0===t)return null;const r=e,n=s?"leave":"enter",i=zs(r,t);if(!s&&"function"==typeof i)return i;if(null!=i){const e=i[n];if("function"==typeof e)return e}const o=r[n];if("function"==typeof o)return o;if(null!=o){const e=zs(o,t);if("function"==typeof e)return e}return null},Xs=(e,t={})=>{const{visitFnGetter:s=Js,nodeTypeGetter:r=Rs,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),c=new Array(e.length).fill(i);return{enter(t){let a=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(c[u]===i){const i=s(e[u],r(a),!1);if("function"==typeof i){const s=Ks(t,a),r=i.call(e[u],s);if($s(r))throw new we("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(s.shouldStop){c[u]=o;break}if(s.shouldSkip&&(c[u]=a),s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();if(!n)return t.replaceWith(e),e;a=e,l=!0}else if(void 0!==r){if(!n)return t.replaceWith(r),r;a=r,l=!0}}}if(l)return t.replaceWith(a),a},leave(t){const n=t.node;for(let a=0;a<e.length;a+=1)if(c[a]===i){const i=s(e[a],r(n),!0);if("function"==typeof i){const s=Ks(t,n),r=i.call(e[a],s);if($s(r))throw new we("Async visitor not supported in sync mode",{visitor:e[a],visitFn:i});if(s.shouldStop){c[a]=o;break}if(s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else c[a]===n&&(c[a]=i)}}},Ws=(e,t={})=>{const{visitFnGetter:s=Js,nodeTypeGetter:r=Rs,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),c=new Array(e.length).fill(i);return{async enter(t){let a=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(c[u]===i){const i=s(e[u],r(a),!1);if("function"==typeof i){const s=Ks(t,a),r=await i.call(e[u],s);if(s.shouldStop){c[u]=o;break}if(s.shouldSkip&&(c[u]=a),s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();if(!n)return t.replaceWith(e),e;a=e,l=!0}else if(void 0!==r){if(!n)return t.replaceWith(r),r;a=r,l=!0}}}if(l)return t.replaceWith(a),a},async leave(t){const n=t.node;for(let a=0;a<e.length;a+=1)if(c[a]===i){const i=s(e[a],r(n),!0);if("function"==typeof i){const s=Ks(t,n),r=await i.call(e[a],s);if(s.shouldStop){c[a]=o;break}if(s.removed)return void t.remove();if(s._wasReplaced()){const e=s._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else c[a]===n&&(c[a]=i)}}};function Ks(e,t){return new vt(t,e.parent,e.parentPath,e.key,e.inList)}function*Ys(e,t,s){const{keyMap:r,state:n,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:c,detectCycles:a,mutable:l,mutationFn:u}=s,p="function"==typeof r;let h,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,v=null;const w=[];do{y+=1;const e=y===m.length;let s;const O=e&&0!==g.length;if(e){if(s=0===w.length?void 0:b?.key,x=d,d=w.pop(),v=b?.parentPath?.parentPath??null,O)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,s]of g){const r=t-e;null===s?(x.splice(r,1),e+=1):x[r]=s}}else{x=c(x);for(const[e,t]of g)x[e]=t}if(void 0!==h){y=h.index,m=h.keys,g=h.edits;const e=h.inArray;if(v=h.parentPath,h=h.prev,O&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(s=f?y:m[y],x=d[s],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new we(`Invalid AST Node: ${String(x)}`,{node:x});if(a&&w.includes(x))continue;b=new vt(x,d,v,s,f);const r=Js(t,i(x),e);if(r){for(const[e,s]of Object.entries(n))t[e]=s;const i=yield{visitFn:r,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([s,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([s,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([s,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(h={inArray:f,index:y,keys:m,edits:g,parentPath:v,prev:h},f=Array.isArray(x),f)m=x;else if(p)m=r(x);else{const e=i(x);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&w.push(d),d=x,v=b}}while(void 0!==h);return 0!==g.length?g.at(-1)[1]:e}Xs[Symbol.for("nodejs.util.promisify.custom")]=Ws;const Qs=(e,t,s={})=>{const r=Ys(e,t,{keyMap:s.keyMap??Gs,state:s.state??{},nodeTypeGetter:s.nodeTypeGetter??Rs,nodePredicate:s.nodePredicate??Vs,nodeCloneFn:s.nodeCloneFn??Us,detectCycles:s.detectCycles??!0,mutable:s.mutable??!1,mutationFn:s.mutationFn??Hs});let n=r.next();for(;!n.done;){const e=n.value,s=e.visitFn.call(t,e.path);if($s(s))throw new we("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});n=r.next(s)}return n.value},Zs=async(e,t,s={})=>{const r=Ys(e,t,{keyMap:s.keyMap??Gs,state:s.state??{},nodeTypeGetter:s.nodeTypeGetter??Rs,nodePredicate:s.nodePredicate??Vs,nodeCloneFn:s.nodeCloneFn??Us,detectCycles:s.detectCycles??!0,mutable:s.mutable??!1,mutationFn:s.mutationFn??Hs});let n=r.next();for(;!n.done;){const e=n.value,s=await e.visitFn.call(t,e.path);n=r.next(s)}return n.value};Qs[Symbol.for("nodejs.util.promisify.custom")]=Zs,vt.prototype.traverse=function(e,t){return Qs(this.node,e,t)},vt.prototype.traverseAsync=function(e,t){return Zs(this.node,e,t)};const er={JSONSchemaDraft4Element:{additionalItems:(...e)=>new W(...e),items:(...e)=>new W(...e),required(...e){const t=new ne(...e);return t.classes.push("json-schema-required"),t},properties(...e){const t=new X(...e);return t.classes.push("json-schema-properties"),t},additionalProperties:(...e)=>new W(...e),patternProperties(...e){const t=new X(...e);return t.classes.push("json-schema-patternProperties"),t},dependencies(...e){const t=new X(...e);return t.classes.push("json-schema-dependencies"),t},enum(...e){const t=new ne(...e);return t.classes.push("json-schema-enum"),t},allOf(...e){const t=new ne(...e);return t.classes.push("json-schema-allOf"),t},anyOf(...e){const t=new ne(...e);return t.classes.push("json-schema-anyOf"),t},oneOf(...e){const t=new ne(...e);return t.classes.push("json-schema-oneOf"),t},not:(...e)=>new W(...e),definitions(...e){const t=new X(...e);return t.classes.push("json-schema-definitions"),t},links(...e){const t=new ne(...e);return t.classes.push("json-schema-links"),t},media:(...e)=>new Y(...e)},LinkDescriptionElement:{targetSchema:(...e)=>new W(...e),schema:(...e)=>new W(...e)},"json-schema-properties":{"[key: *]":function(...e){return new W(...e)}},"json-schema-patternProperties":{"[key: *]":function(...e){return new W(...e)}},"json-schema-dependencies":{"[key: *]":function(...e){return new W(...e)}},"json-schema-allOf":{"<*>":function(...e){return new W(...e)}},"json-schema-anyOf":{"<*>":function(...e){return new W(...e)}},"json-schema-oneOf":{"<*>":function(...e){return new W(...e)}},"json-schema-definitions":{"[key: *]":function(...e){return new W(...e)}},"json-schema-links":{"<*>":function(...e){return new Q(...e)}}},tr=(e,t)=>{const s=Rs(e),r=e.isMetaEmpty?void 0:e.classes.at(0),n=er[s]||er[r];return void 0===n?void 0:Object.hasOwn(n,"[key: *]")?n["[key: *]"]:n[t]},sr=()=>()=>({visitor:{StringElement(e){const t=e.node;if(!(e=>oe(e)&&me(e,["yaml-e-node","yaml-e-scalar"]))(t))return;const s=e.getAncestorNodes().reverse().filter(ie),r=s.at(-1);let n,i;if(ue(r)?(i=t,n=tr(r,"<*>")):he(r)&&(i=s.at(-2),n=tr(i,$e(r.key))),"function"!=typeof n)return;const o=n.call({context:i},void 0,t.isMetaEmpty?void 0:t.meta.cloneDeep(),t.isAttributesEmpty?void 0:je(t.attributes));ve.transfer(t,o),Pe.transfer(t,o),e.replaceWith(o)}}});var rr=g(function(e,t){return jt(function(s,r){return s[r]=e(t[r],r,t),s},{},M(t))});const nr=rr;const ir=i(function(e){return null==e});var or=g(function(e,t){if(0===e.length||ir(t))return!1;for(var s=t,r=0;r<e.length;){if(ir(s)||!v(e[r],s))return!1;s=s[e[r]],r+=1}return!0});const cr=or;var ar=g(function(e,t){return cr([e],t)});const lr=ar;const ur=Kt(function(e,t,s){return e(Ms(t,s))});function pr(e,t){for(var s=t,r=0;r<e.length;r+=1){if(null==s)return;var n=e[r];s=Is(n)?o(n,s):s[n]}return s}const hr=g(pr);const dr=Kt(function(e,t,s){return e(pr(t,s))});const fr=Et(1,Xt(As,Ls));var mr=ls(T,Cs("Object")),yr=ls(ws,C(ws(Object))),gr=dr(Xt(Bs,yr),["constructor"]);const xr=Et(1,function(e){if(!fr(e)||!mr(e))return!1;var t=Object.getPrototypeOf(e);return!!Ss(t)||gr(t)});const br=Et(1,ls(T,Cs("String")));var vr=i(function(e){return Et(e.length,e)});const wr=vr;const Or=g(function(e,t){return Et(e+1,function(){var s=arguments[e];if(null!=s&&St(s[t]))return s[t].apply(s,Array.prototype.slice.call(arguments,0,e));throw new TypeError(ws(s)+' does not have a method named "'+t+'"')})});const kr=Or(1,"split");var Er=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Lt,e.prototype["@@transducer/result"]=qt,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function Sr(e){return function(t){return new Er(e,t)}}const Ar=g(Bt(["dropWhile"],Sr,function(e,t){for(var s=0,r=t.length;s<r&&e(t[s]);)s+=1;return cs(s,1/0,t)}));const jr=Or(1,"join");var Ir=i(function(e){return Et(e.length,function(t,s){var r=Array.prototype.slice.call(arguments,0);return r[0]=s,r[1]=t,e.apply(this,r)})});const Mr=Ir(g(us));const Tr=wr(function(e,t){return ls(kr(""),Ar(Mr(e)),jr(""))(t)}),Fr=new WeakMap;var Pr=Kt(function(e,t,s){var r,n={};for(r in s=s||{},t=t||{})v(r,t)&&(n[r]=v(r,s)?e(r,t[r],s[r]):t[r]);for(r in s)v(r,s)&&!v(r,n)&&(n[r]=s[r]);return n});const Cr=Pr;var Dr=Kt(function e(t,s,r){return Cr(function(s,r,n){return fs(r)&&fs(n)?e(t,r,n):t(s,r,n)},s,r)});const Nr=Dr;const Br=g(function(e,t){return Nr(function(e,t,s){return s},e,t)});const _r=g(function(e,t){return null==t||t!=t?e:t});const Lr=Kt(function(e,t,s){return _r(e,Ms(t,s))});const qr=cs(0,-1);var $r=g(function(e,t){return e.apply(this,t)});const Rr=$r;const Vr=Es(Bs);var Ur=i(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:It(e)?[]:Mt(e)?"":fs(e)?{}:k(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const Hr=Ur;const Gr=i(function(e){return null!=e&&C(e,Hr(e))});const zr=Et(1,Bs(Array.isArray)?Array.isArray:ls(T,Cs("Array")));const Jr=Xt(zr,Gr);const Xr=Et(3,function(e,t,s){var r=hr(e,s),n=hr(qr(e),s);if(!Vr(r)&&!Jr(e)){var i=Zt(r,n);return Rr(i,t)}});const Wr=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(!e.isMetaEmpty){const s=this.serialiseMeta(e);s&&(t.meta=s.meta,s.rawKeys.length>0&&(t.__meta_raw__=s.rawKeys))}if(e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof ve)){const s=ve.from(e);s&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(s))}if(!(e instanceof Pe)){const s=Pe.from(e);s&&(t.meta||(t.meta={}),t.meta.__styles__=this.serialise(s))}const s=this.serialiseContent(e.content);return void 0!==s&&(t.content=s),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let s,r;t.element!==e.element&&(t.element=e.element);let n=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;s=t,r=i,n=Object.keys(o).length>0?o:void 0}const i=e.__meta_raw__?new Set(e.__meta_raw__):void 0;if(n)for(const[e,s]of Object.entries(n)){const r=this.deserialise(s);t.setMetaProperty(e,i?.has(e)?r.toValue():r)}if(s){this.deserialise(s).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const o=this.deserialiseContent(e.content);return void 0===o&&null!==t.content||(t.content=o),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,s={key:this.serialise(t.key)};return t.value&&(s.value=this.serialise(t.value)),s}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseMeta(e){const t={},s=[];let r=!1;for(const[n,i]of Object.entries(e.meta))if(i instanceof this.namespace.elements.Element)t[n]=this.serialise(i),r=!0;else if(void 0!==i){const o=e.refract(i);t[n]=this.serialise(o),s.push(n),r=!0}return r?{meta:t,rawKeys:s}:void 0}serialiseObject(e){const t={};if(e.forEach((e,s)=>{e&&(t[s.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(s=>{t.set(s,this.deserialise(e[s]))})}},Kr=e=>null===e,Yr=e=>"string"==typeof e,Qr=e=>"number"==typeof e,Zr=e=>"boolean"==typeof e,en=e=>null!==e&&"object"==typeof e;class tn{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=H,this.KeyValuePair=q,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",se).register("string",ee).register("number",te).register("boolean",re).register("array",ne).register("object",X).register("member",J).register("ref",De).register("link",Ce).register("sourceMap",ve),this.detect(Kr,se,!1).detect(Yr,ee,!1).detect(Qr,te,!1).detect(Zr,re,!1).detect(Array.isArray,ne,!1).detect(en,X,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,s){return void 0===s||s?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[s,r]of this.elementDetection)if(s(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Wr(this)}}Wr.prototype.Namespace=tn;const sn=tn,rn=new sn,nn={isElement:ie,isStringElement:oe,isNumberElement:ce,isNullElement:ae,isBooleanElement:le,isArrayElement:ue,isObjectElement:pe,isMemberElement:he,isPrimitiveElement:e=>pe(e)&&"object"===e.element||ue(e)&&"array"===e.element||le(e)&&"boolean"===e.element||ce(e)&&"number"===e.element||oe(e)&&"string"===e.element||ae(e)&&"null"===e.element||he(e)&&"member"===e.element,isLinkElement:Le,isRefElement:qe,isAnnotationElement:e=>e instanceof Ne,isCommentElement:e=>e instanceof Be,isParseResultElement:e=>e instanceof _e,isSourceMapElement:e=>e instanceof ve,hasElementStyle:de,hasElementSourceMap:fe,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const s=e.attributes.get("symbols");return!!ue(s)&&t.every(e=>s.includes(e))},includesClasses:me},on={toolboxCreator:()=>({predicates:nn,namespace:rn}),visitorOptions:{exposeEdits:!0}},cn=(e,t,s={})=>{if(0===t.length)return e;const r=Br(on,s),{toolboxCreator:n,visitorOptions:i}=r,o=n(),c=t.map(e=>e(o)),a=Xs(c.map(Lr({},"visitor")),i);c.forEach(Xr(["pre"],[]));const l=Qs(e,a);return c.forEach(Xr(["post"],[])),l};function an(e){return void 0===e?new se:ln(e)}function ln(e){if(e instanceof H)return e;if("string"==typeof e)return new ee(e);if("number"==typeof e)return new te(e);if("boolean"==typeof e)return new re(e);if(null===e)return new se;if(Array.isArray(e))return new ne(e.map(an));if("object"==typeof e)return new X(e);throw new Error("Cannot refract value of type "+typeof e)}cn[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,s={})=>{if(0===t.length)return e;const r=Br(on,s),{toolboxCreator:n,visitorOptions:i}=r,o=n(),c=t.map(e=>e(o)),a=Ws(c.map(Lr({},"visitor")),i);await Promise.allSettled(c.map(Xr(["pre"],[])));const l=await Zs(e,a);return await Promise.allSettled(c.map(Xr(["post"],[]))),l},H.prototype.ObjectElement=X,H.prototype.ArrayElement=ne,H.prototype.RefElement=De,H.prototype.MemberElement=J,H.prototype.refract=ln,L.prototype.Element=H,L.prototype.cloneDeepElement=e=>je(e);const un=e=>{const t=e.isMetaEmpty?void 0:e.meta.cloneDeep(),s=e.isAttributesEmpty?void 0:je(e.attributes);return new e.constructor(void 0,t,s)},pn=(e,t)=>t.clone&&t.isMergeableElement(e)?dn(un(e),e,t):e,hn={clone:!0,isMergeableElement:e=>pe(e)||ue(e),arrayElementMerge:(e,t,s)=>new(0,e.constructor)(e.concat(t).map(e=>pn(e,s))),objectElementMerge:(e,t,s)=>{const r=pe(e)?un(e):un(t);return pe(e)&&e.forEach((e,t,n)=>{const i=Te(n);i.value=pn(e,s),r.content.push(i)}),t.forEach((t,n,i)=>{const o=$e(n);let c;if(pe(e)&&e.hasKey(o)&&s.isMergeableElement(t)){const r=e.get(o);c=Te(i),c.value=((e,t)=>{if("function"!=typeof t.customMerge)return dn;const s=t.customMerge(e,t);return"function"==typeof s?s:dn})(n,s)(r,t,s)}else c=Te(i),c.value=pn(t,s);r.remove(o),r.content.push(c)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},dn=(e,t,s)=>{const r={...hn,...s};r.isMergeableElement=r.isMergeableElement??hn.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??hn.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??hn.objectElementMerge;const n=ue(t);if(!(n===ue(e)))return pn(t,r);const i=n&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return e.isMetaEmpty||t.isMetaEmpty?e.isMetaEmpty?t.isMetaEmpty||(i.meta=t.meta.cloneDeep()):i.meta=e.meta.cloneDeep():i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>e.cloneDeep():e.customMetaMerge)(r)(e.meta,t.meta),e.isAttributesEmpty||t.isAttributesEmpty?e.isAttributesEmpty?t.isAttributesEmpty||(i.attributes=je(t.attributes)):i.attributes=je(e.attributes):i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>je(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};dn.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new X:e.reduce((e,s)=>dn(e,s,t),un(e[0]))};const fn=dn;const mn=class{element;consume=!1;consumeSafe=!1;constructor(e){Object.assign(this,e)}copyMetaAndAttributes(e,t){e.isMetaEmpty||t.isMetaEmpty?e.isMetaEmpty||(t.meta=e.meta.cloneDeep()):t.meta=t.meta.merge(e.meta),e.isAttributesEmpty||t.isAttributesEmpty?e.isAttributesEmpty||(t.attributes=je(e.attributes)):t.attributes=fn(t.attributes,e.attributes),ve.transfer(e,t),Pe.transfer(e,t)}};const yn=class extends mn{enter(e){this.element=this.consume?e.node:je(e.node),e.stop()}};const gn=i(function(e){return function(){return e}});const xn=gn(void 0);const bn=C(xn());const vn=i(function(e){return Et(is(js,0,Ts("length",e)),function(){for(var t=0,s=e.length;t<s;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0})});const wn=i(function(e){return!Gr(e)});var On=Es(qs);const kn=vn([br,On,wn]);const En=g(function(e,t){for(var s={},r=0;r<e.length;)e[r]in t&&(s[e[r]]=t[e[r]]),r+=1;return s});const Sn=class extends mn{specObj;passingOptionsNames=["specObj","parent","consume"];constructor({specObj:e,...t}){super({...t}),this.specObj=e}retrievePassingOptions(){return En(this.passingOptionsNames,this)}retrieveFixedFields(e){const t=hr(["visitors",...e,"fixedFields"],this.specObj);return"object"==typeof t&&null!==t?Object.keys(t):[]}retrieveVisitor(e){return dr(Bs,["visitors",...e],this.specObj)?hr(["visitors",...e],this.specObj):hr(["visitors",...e,"$visitor"],this.specObj)}retrieveVisitorInstance(e,t={}){const s=this.retrievePassingOptions();return new(this.retrieveVisitor(e))({...s,...t})}toRefractedElement(e,t,s={}){const r=this.retrieveVisitorInstance(e,s);return r instanceof yn&&r?.constructor===yn?this.consume?t:je(t):(Qs(t,r,s),r.element)}};const An=class extends Sn{specPath;ignoredFields;constructor({specPath:e,ignoredFields:t,...s}){super({...s}),this.specPath=e,this.ignoredFields=t||[]}ObjectElement(e){const t=e.node,s=this.specPath(t),r=this.retrieveFixedFields(s);t.forEach((e,t,n)=>{const i=$e(t);if(oe(t)&&r.includes(i)&&!this.ignoredFields.includes(i)){const r=this.toRefractedElement([...s,"fixedFields",i],e),o=new J(this.consume?t:je(t),r);this.copyMetaAndAttributes(n,o),this.element.content.push(o),this.consume&&this.consumeSafe&&!n.isFrozen&&(n.value=void 0)}else this.ignoredFields.includes(i)||this.element.content.push(this.consume?n:je(n))}),this.copyMetaAndAttributes(t,this.element),e.stop()}},jn=(e,t,s=[])=>{const r=Object.getOwnPropertyDescriptors(t);for(let e of s)delete r[e];Object.defineProperties(e,r)},In=(e,t=[e])=>{const s=Object.getPrototypeOf(e);return null===s?t:In(s,[...t,s])},Mn=(e,t,s=[])=>{var r;const n=null!==(r=((...e)=>{if(0===e.length)return;let t;const s=e.map(e=>In(e));for(;s.every(e=>e.length>0);){const e=s.map(e=>e.pop()),r=e[0];if(!e.every(e=>e===r))break;t=r}return t})(...e))&&void 0!==r?r:Object.prototype,i=Object.create(n),o=In(n);for(let t of e){let e=In(t);for(let t=e.length-1;t>=0;t--){let r=e[t];-1===o.indexOf(r)&&(jn(i,r,["constructor",...s]),o.push(r))}}return i.constructor=t,i},Tn=e=>e.filter((t,s)=>e.indexOf(t)==s),Fn=(e,t)=>{const s=t.map(e=>In(e));let r=0,n=!0;for(;n;){n=!1;for(let i=t.length-1;i>=0;i--){const t=s[i][r];if(null!=t&&(n=!0,null!=Object.getOwnPropertyDescriptor(t,e)))return s[i][0]}r++}},Pn=(e,t=Object.prototype)=>new Proxy({},{getPrototypeOf:()=>t,setPrototypeOf(){throw Error("Cannot set prototype of Proxies created by ts-mixer")},getOwnPropertyDescriptor:(t,s)=>Object.getOwnPropertyDescriptor(Fn(s,e)||{},s),defineProperty(){throw new Error("Cannot define new properties on Proxies created by ts-mixer")},has:(s,r)=>void 0!==Fn(r,e)||void 0!==t[r],get:(s,r)=>(Fn(r,e)||t)[r],set(t,s,r){const n=Fn(s,e);if(void 0===n)throw new Error("Cannot set new properties on Proxies created by ts-mixer");return n[s]=r,!0},deleteProperty(){throw new Error("Cannot delete properties on Proxies created by ts-mixer")},ownKeys:()=>e.map(Object.getOwnPropertyNames).reduce((e,t)=>t.concat(e.filter(e=>t.indexOf(e)<0)))}),Cn=null,Dn="copy",Nn="copy",Bn="deep",_n=new WeakMap,Ln=e=>_n.get(e),qn=(e,t)=>{var s,r;const n=Tn([...Object.getOwnPropertyNames(e),...Object.getOwnPropertyNames(t)]),i={};for(let o of n)i[o]=Tn([...null!==(s=null==e?void 0:e[o])&&void 0!==s?s:[],...null!==(r=null==t?void 0:t[o])&&void 0!==r?r:[]]);return i},$n=(e,t)=>{var s,r,n,i;return{property:qn(null!==(s=null==e?void 0:e.property)&&void 0!==s?s:{},null!==(r=null==t?void 0:t.property)&&void 0!==r?r:{}),method:qn(null!==(n=null==e?void 0:e.method)&&void 0!==n?n:{},null!==(i=null==t?void 0:t.method)&&void 0!==i?i:{})}},Rn=(e,t)=>{var s,r,n,i,o,c;return{class:Tn([...null!==(s=null==e?void 0:e.class)&&void 0!==s?s:[],...null!==(r=null==t?void 0:t.class)&&void 0!==r?r:[]]),static:$n(null!==(n=null==e?void 0:e.static)&&void 0!==n?n:{},null!==(i=null==t?void 0:t.static)&&void 0!==i?i:{}),instance:$n(null!==(o=null==e?void 0:e.instance)&&void 0!==o?o:{},null!==(c=null==t?void 0:t.instance)&&void 0!==c?c:{})}},Vn=new Map,Un=(...e)=>{const t=((...e)=>{var t;const s=new Set,r=new Set([...e]);for(;r.size>0;)for(let e of r){const n=[...In(e.prototype).map(e=>e.constructor),...null!==(t=Ln(e))&&void 0!==t?t:[]].filter(e=>!s.has(e));for(let e of n)r.add(e);s.add(e),r.delete(e)}return[...s]})(...e).map(e=>Vn.get(e)).filter(e=>!!e);return 0==t.length?{}:1==t.length?t[0]:t.reduce((e,t)=>Rn(e,t))},Hn=e=>{let t=Vn.get(e);return t||(t={},Vn.set(e,t)),t};function Gn(...e){var t,s,r;const n=e.map(e=>e.prototype),i=Cn;if(null!==i){const e=n.map(e=>e[i]).filter(e=>"function"==typeof e),t=function(...t){for(let s of e)s.apply(this,t)},s={[i]:t};n.push(s)}function o(...t){for(const s of e)jn(this,new s(...t));null!==i&&"function"==typeof this[i]&&this[i].apply(this,t)}var c,a;o.prototype="copy"===Nn?Mn(n,o):(c=n,a=o,Pn([...c,{constructor:a}])),Object.setPrototypeOf(o,"copy"===Dn?Mn(e,null,["prototype"]):Pn(e,Function.prototype));let l=o;if("none"!==Bn){const n="deep"===Bn?Un(...e):((...e)=>{const t=e.map(e=>Hn(e));return 0===t.length?{}:1===t.length?t[0]:t.reduce((e,t)=>Rn(e,t))})(...e);for(let e of null!==(t=null==n?void 0:n.class)&&void 0!==t?t:[]){const t=e(l);t&&(l=t)}zn(null!==(s=null==n?void 0:n.static)&&void 0!==s?s:{},l),zn(null!==(r=null==n?void 0:n.instance)&&void 0!==r?r:{},l.prototype)}var u,p;return u=l,p=e,_n.set(u,p),l}const zn=(e,t)=>{const s=e.property,r=e.method;if(s)for(let e in s)for(let r of s[e])r(t,e);if(r)for(let e in r)for(let s of r[e])s(t,e,Object.getOwnPropertyDescriptor(t,e))};const Jn=function(){return!1};const Xn=class extends Sn{specPath;ignoredFields;fieldPatternPredicate=Jn;constructor({specPath:e,ignoredFields:t,fieldPatternPredicate:s,...r}){super({...r}),this.specPath=e,this.ignoredFields=t||[],"function"==typeof s&&(this.fieldPatternPredicate=s)}ObjectElement(e){const t=e.node;t.forEach((e,t,s)=>{const r=$e(t);if(!this.ignoredFields.includes(r)&&this.fieldPatternPredicate(r)){const r=this.specPath(e),n=this.toRefractedElement(r,e),i=new J(this.consume?t:je(t),n);this.copyMetaAndAttributes(s,i),i.classes.push("patterned-field"),this.element.content.push(i),this.consume&&this.consumeSafe&&!s.isFrozen&&(s.value=void 0)}else this.ignoredFields.includes(r)||this.element.content.push(this.consume?s:je(s))}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Wn=class extends Xn{constructor(e){super(e),this.fieldPatternPredicate=kn}};const Kn=class{parent;constructor({parent:e}){this.parent=e}},Yn=Gn(An,Kn,yn),Qn=Gn(An,yn),Zn=Gn(An,yn),ei=Gn(An,yn),ti=Gn(Sn,Kn,yn),si=Gn(Sn,Kn,yn),ri=Gn(Sn,Kn,yn),ni=Gn(Sn,Kn,yn),ii=Gn(Sn,Kn,yn),oi=Gn(Wn,Kn,yn),ci=Gn(Wn,Kn,yn),ai=Gn(Wn,Kn,yn),li=Gn(Wn,Kn,yn),ui=e=>e instanceof W,pi=e=>e instanceof K,hi=e=>e instanceof Y,di=e=>e instanceof Q;const fi=class extends Yn{constructor(e){super(e),this.element=new W,this.consumeSafe=!0,this.specPath=gn(["document","objects","JSONSchema"])}get defaultDialectIdentifier(){return"http://json-schema.org/draft-04/schema#"}ObjectElement(e){const t=e.node;return this.handleDialectIdentifier(t),this.handleSchemaIdentifier(t),this.parent=this.element,An.prototype.ObjectElement.call(this,e)}handleDialectIdentifier(e){if(bn(this.parent)&&!oe(e.get("$schema")))this.element.meta.set("inheritedDialectIdentifier",this.defaultDialectIdentifier);else if(ui(this.parent)&&!oe(e.get("$schema"))){const e=_r(this.parent.meta.get("inheritedDialectIdentifier"),$e(this.parent.$schema));this.element.meta.set("inheritedDialectIdentifier",e)}}handleSchemaIdentifier(e,t="id"){const s=void 0!==this.parent?[...this.parent.meta.get("ancestorsSchemaIdentifiers")??[]]:[],r=$e(e.get(t));kn(r)&&s.push(r),this.element.meta.set("ancestorsSchemaIdentifiers",s)}},mi=e=>pe(e)&&e.hasKey("$ref");const yi=class extends ni{ObjectElement(e){const t=e.node,s=mi(t)?["document","objects","JSONReference"]:["document","objects","JSONSchema"];this.element=this.toRefractedElement(s,t),e.stop()}ArrayElement(e){const t=e.node;this.element=new ne,this.element.classes.push("json-schema-items"),t.forEach(e=>{const t=mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const gi=class extends yn{ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-required")}};const xi=class extends li{constructor(e){super(e),this.element=new X,this.element.classes.push("json-schema-properties"),this.specPath=e=>mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const bi=class extends ai{constructor(e){super(e),this.element=new X,this.element.classes.push("json-schema-patternProperties"),this.specPath=e=>mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const vi=class extends ci{constructor(e){super(e),this.element=new X,this.element.classes.push("json-schema-dependencies"),this.specPath=e=>mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const wi=class extends yn{ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-enum")}};const Oi=class extends yn{StringElement(e){super.enter(e),this.element.classes.push("json-schema-type")}ArrayElement(e){super.enter(e),this.element.classes.push("json-schema-type")}};const ki=class extends ti{constructor(e){super(e),this.element=new ne,this.element.classes.push("json-schema-allOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Ei=class extends si{constructor(e){super(e),this.element=new ne,this.element.classes.push("json-schema-anyOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Si=class extends ri{constructor(e){super(e),this.element=new ne,this.element.classes.push("json-schema-oneOf")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],s=this.toRefractedElement(t,e);this.element.push(s)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Ai=class extends oi{constructor(e){super(e),this.element=new X,this.element.classes.push("json-schema-definitions"),this.specPath=e=>mi(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]}};const ji=class extends ii{constructor(e){super(e),this.element=new ne,this.element.classes.push("json-schema-links")}ArrayElement(e){const t=e.node;t.forEach(e=>{const t=this.toRefractedElement(["document","objects","LinkDescription"],e);this.element.push(t)}),this.copyMetaAndAttributes(t,this.element),e.stop()}};const Ii=class extends Qn{constructor(e){super(e),this.element=new K,this.specPath=gn(["document","objects","JSONReference"])}ObjectElement(e){An.prototype.ObjectElement.call(this,e),oe(this.element.$ref)&&this.element.classes.push("reference-element")}};const Mi=class extends yn{StringElement(e){super.enter(e),this.element.classes.push("reference-value")}};const Ti=function(){return!0};const Fi=Kt(function(e,t,s){return Et(Math.max(e.length,t.length,s.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):s.apply(this,arguments)})});const Pi=i(function(e){return function(t,s){return e(t,s)?-1:e(s,t)?1:0}});var Ci=g(function(e,t){return Array.prototype.slice.call(t,0).sort(e)});const Di=Ci;const Ni=i(function(e){return o(0,e)});function Bi(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}const _i=i(Bi);const Li=Es(ir);const qi=Xt(zr,wn);function $i(e){return function(e){if(Array.isArray(e))return Ri(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ri(e,t);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Ri(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ri(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,r=Array(t);s<t;s++)r[s]=e[s];return r}var Vi=ls(Di(Pi(function(e,t){return e.length>t.length})),Ni,Ms("length")),Ui=wr(function(e,t,s){var r=s.apply(void 0,$i(e));return Li(r)?_i(r):t});const Hi=Fi(qi,function(e){var t=Vi(e);return Et(t,function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return is(Ui(s),void 0,e)})},xn);const Gi=class extends Sn{alternator;constructor({alternator:e,...t}){super({...t}),this.alternator=e}enter(e){const t=e.node,s=this.alternator.map(({predicate:e,specPath:t})=>Fi(e,gn(t),xn)),r=Hi(s)(t);this.element=this.toRefractedElement(r,t),e.stop()}};const zi=class extends Gi{constructor(e){super(e),this.alternator=[{predicate:mi,specPath:["document","objects","JSONReference"]},{predicate:Ti,specPath:["document","objects","JSONSchema"]}]}};const Ji=class extends ei{constructor(e){super(e),this.element=new Y,this.specPath=gn(["document","objects","Media"])}};const Xi=class extends Zn{constructor(e){super(e),this.element=new Q,this.specPath=gn(["document","objects","LinkDescription"])}},Wi={visitors:{value:yn,JSONSchemaOrJSONReferenceVisitor:zi,document:{objects:{JSONSchema:{element:"jSONSchemaDraft4",$visitor:fi,fixedFields:{id:{$ref:"#/visitors/value",alias:"idField"},$schema:{$ref:"#/visitors/value"},multipleOf:{$ref:"#/visitors/value"},maximum:{$ref:"#/visitors/value"},exclusiveMaximum:{$ref:"#/visitors/value"},minimum:{$ref:"#/visitors/value"},exclusiveMinimum:{$ref:"#/visitors/value"},maxLength:{$ref:"#/visitors/value"},minLength:{$ref:"#/visitors/value"},pattern:{$ref:"#/visitors/value"},additionalItems:zi,items:{$visitor:yi,alias:"itemsField"},maxItems:{$ref:"#/visitors/value"},minItems:{$ref:"#/visitors/value"},uniqueItems:{$ref:"#/visitors/value"},maxProperties:{$ref:"#/visitors/value"},minProperties:{$ref:"#/visitors/value"},required:gi,properties:xi,additionalProperties:zi,patternProperties:bi,dependencies:vi,enum:wi,type:Oi,allOf:ki,anyOf:Ei,oneOf:Si,not:zi,definitions:Ai,title:{$ref:"#/visitors/value"},description:{$ref:"#/visitors/value"},default:{$ref:"#/visitors/value"},format:{$ref:"#/visitors/value"},base:{$ref:"#/visitors/value"},links:{$visitor:ji,alias:"linksField"},media:{$ref:"#/visitors/document/objects/Media"},readOnly:{$ref:"#/visitors/value"}}},JSONReference:{element:"jSONReference",$visitor:Ii,fixedFields:{$ref:Mi}},Media:{element:"media",$visitor:Ji,fixedFields:{binaryEncoding:{$ref:"#/visitors/value"},type:{$ref:"#/visitors/value"}}},LinkDescription:{element:"linkDescription",$visitor:Xi,fixedFields:{href:{$ref:"#/visitors/value"},rel:{$ref:"#/visitors/value"},title:{$ref:"#/visitors/value"},targetSchema:zi,mediaType:{$ref:"#/visitors/value"},method:{$ref:"#/visitors/value"},encType:{$ref:"#/visitors/value"},schema:zi}}}}}},Ki=()=>{const e=new sn,t={...r,...s,isStringElement:oe};return e.use(Z),{predicates:t,namespace:e}},Yi=(e,{element:t="jSONSchemaDraft4",plugins:s=[],specificationObj:r=Wi,consume:n=!1}={})=>{const i=ln(e),o=(e=>{if(Fr.has(e))return Fr.get(e);const t={},s=(e,r,n)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...n,"$visitor"]:n),nr((e,t)=>{const i=[...n,t];if(xr(e)&&lr("$ref",e)&&ur(br,"$ref",e)){const t=hr(["$ref"],e),s=Tr("#/",t),n=hr(s.split("/"),r),{$ref:i,...o}=e;return Object.keys(o).length>0&&xr(n)?{...n,...o}:n}return xr(e)?s(e,r,i):e},e)),r=s(e,e,[]);return r.elementMap=t,Fr.set(e,r),r})(r),c=o.elementMap[t];if(!c)throw new Error(`Unknown element type: "${t}"`);const a=new(hr(c,o))({specObj:o,consume:n});return Qs(i,a),cn(a.element,s,{toolboxCreator:Ki})},Qi=(e,t={})=>Yi(e,{...t,element:"jSONSchemaDraft4"}),Zi=(e,t={})=>Yi(e,{...t,element:"jSONReference"}),eo=(e,t={})=>Yi(e,{...t,element:"media"}),to=(e,t={})=>Yi(e,{...t,element:"linkDescription"}),so=Yi;return t})());
|