@swagger-api/apidom-json-pointer 1.5.0 → 1.5.1

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.
@@ -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.apidomJsonPointer=t():e.apidomJsonPointer=t()}(self,(()=>(()=>{var e={88:(e,t,r)=>{var n=r(4700);e.exports=function(e){return n(this,e).get(e)}},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},195:(e,t,r)=>{var n=r(4882),s=r(8121),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return s(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},353:(e,t,r)=>{var n=r(1340),s=r(3934),a=r(8861),i=r(1182),o=r(8486),c=r(3142),l=r(5853),u=r(8666),h="[object Arguments]",p="[object Array]",f="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,d,y,g){var b=c(e),v=c(t),x=b?p:o(e),E=v?p:o(t),w=(x=x==h?f:x)==f,T=(E=E==h?f:E)==f,k=x==E;if(k&&l(e)){if(!l(t))return!1;b=!0,w=!1}if(k&&!w)return g||(g=new n),b||u(e)?s(e,t,r,d,y,g):a(e,t,x,r,d,y,g);if(!(1&r)){var O=w&&m.call(e,"__wrapped__"),j=T&&m.call(t,"__wrapped__");if(O||j){var A=O?e.value():e,_=j?t.value():t;return g||(g=new n),y(A,_,r,d,g)}}return!!k&&(g||(g=new n),i(e,t,r,d,y,g))}},358:(e,t,r)=>{var n=r(6137),s=r(3283),a=r(3142),i=r(5853),o=r(9632),c=r(8666),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),u=!r&&s(e),h=!r&&!u&&i(e),p=!r&&!u&&!h&&c(e),f=r||u||h||p,m=f?n(e.length,String):[],d=m.length;for(var y in e)!t&&!l.call(e,y)||f&&("length"==y||h&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||o(y,d))||m.push(y);return m}},393:(e,t,r)=>{var n=r(8244),s=r(7979),a=r(1211);e.exports=function(e){return n(e,a,s)}},394:e=>{e.exports=class{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};e._meta&&e._meta.length>0&&(t.meta=this.serialiseObject(e.meta)),e._attributes&&e._attributes.length>0&&(t.attributes=this.serialiseObject(e.attributes));const r=this.serialiseContent(e.content);return void 0!==r&&(t.content=r),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));t.element!==e.element&&(t.element=e.element),e.meta&&this.deserialiseObject(e.meta,t.meta),e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const r=this.deserialiseContent(e.content);return void 0===r&&null!==t.content||(t.content=r),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}if(e&&e.map){if(0===e.length)return;return e.map(this.serialise,this)}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(e.map)return e.map(this.deserialise,this)}return e}serialiseObject(e){const t={};if(e.forEach(((e,r)=>{e&&(t[r.toValue()]=this.serialise(e))})),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach((r=>{t.set(r,this.deserialise(e[r]))}))}}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},593:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||[],t,r),this.element="ref",this.path||(this.path="element")}get path(){return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}}},674:(e,t,r)=>{var n=r(7379),s=r(5387),a=r(547),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&s(e.length)&&!!i[n(e)]}},986:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return"number"==typeof e||s(e)&&"[object Number]"==n(e)}},1112:(e,t,r)=>{var n=r(4497),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return s.call(t,e)?t[e]:void 0}},1129:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}},1182:(e,t,r)=>{var n=r(393),s=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,a,i,o){var c=1&r,l=n(e),u=l.length;if(u!=n(t).length&&!c)return!1;for(var h=u;h--;){var p=l[h];if(!(c?p in t:s.call(t,p)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var d=!0;o.set(e,t),o.set(t,e);for(var y=c;++h<u;){var g=e[p=l[h]],b=t[p];if(a)var v=c?a(b,g,p,t,e,o):a(g,b,p,e,t,o);if(!(void 0===v?g===b||i(g,b,r,a,o):v)){d=!1;break}y||(y="constructor"==p)}if(d&&!y){var x=e.constructor,E=t.constructor;x==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof E&&E instanceof E||(d=!1)}return o.delete(e),o.delete(t),d}},1211:(e,t,r)=>{var n=r(358),s=r(195),a=r(6529);e.exports=function(e){return a(e)?n(e):s(e)}},1340:(e,t,r)=>{var n=r(1386),s=r(4103),a=r(1779),i=r(4162),o=r(7462),c=r(6638);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=s,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=c,e.exports=l},1386:(e,t,r)=>{var n=r(2393),s=r(2049),a=r(7144),i=r(7452),o=r(3964);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=a,c.prototype.has=i,c.prototype.set=o,e.exports=c},1517:e=>{e.exports=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1623:(e,t,r)=>{var n=r(8942).Uint8Array;e.exports=n},1779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},1877:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1950:(e,t,r)=>{var n=r(8942)["__core-js_shared__"];e.exports=n},2049:(e,t,r)=>{var n=r(7034),s=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():s.call(t,r,1),--this.size,!0)}},2306:(e,t,r)=>{e=r.nmd(e);var n=r(4967),s=t&&!t.nodeType&&t,a=s&&e&&!e.nodeType&&e,i=a&&a.exports===s&&n.process,o=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o},2322:e=>{class t{constructor(e,t){this.key=e,this.value=t}clone(){const e=new t;return this.key&&(e.key=this.key.clone()),this.value&&(e.value=this.value.clone()),e}}e.exports=t},2393:e=>{e.exports=function(){this.__data__=[],this.size=0}},2536:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}}},2555:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="boolean"}primitive(){return"boolean"}}},2563:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return!0===e||!1===e||s(e)&&"[object Boolean]"==n(e)}},3004:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||null,t,r),this.element="null"}primitive(){return"null"}set(){return new Error("Cannot set the value of null")}}},3103:(e,t,r)=>{var n=r(4715)(r(8942),"DataView");e.exports=n},3142:e=>{var t=Array.isArray;e.exports=t},3148:(e,t,r)=>{const n=r(394);e.exports=class extends n{serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);let t;e._attributes&&e.attributes.get("variable")&&(t=e.attributes.get("variable"));const r={element:e.element};e._meta&&e._meta.length>0&&(r.meta=this.serialiseObject(e.meta));const n="enum"===e.element||-1!==e.attributes.keys().indexOf("enumerations");if(n){const t=this.enumSerialiseAttributes(e);t&&(r.attributes=t)}else if(e._attributes&&e._attributes.length>0){let{attributes:n}=e;n.get("metadata")&&(n=n.clone(),n.set("meta",n.get("metadata")),n.remove("metadata")),"member"===e.element&&t&&(n=n.clone(),n.remove("variable")),n.length>0&&(r.attributes=this.serialiseObject(n))}if(n)r.content=this.enumSerialiseContent(e,r);else if(this[`${e.element}SerialiseContent`])r.content=this[`${e.element}SerialiseContent`](e,r);else if(void 0!==e.content){let n;t&&e.content.key?(n=e.content.clone(),n.key.attributes.set("variable",t),n=this.serialiseContent(n)):n=this.serialiseContent(e.content),this.shouldSerialiseContent(e,n)&&(r.content=n)}else this.shouldSerialiseContent(e,e.content)&&e instanceof this.namespace.elements.Array&&(r.content=[]);return r}shouldSerialiseContent(e,t){return"parseResult"===e.element||"httpRequest"===e.element||"httpResponse"===e.element||"category"===e.element||"link"===e.element||void 0!==t&&(!Array.isArray(t)||0!==t.length)}refSerialiseContent(e,t){return delete t.attributes,{href:e.toValue(),path:e.path.toValue()}}sourceMapSerialiseContent(e){return e.toValue()}dataStructureSerialiseContent(e){return[this.serialiseContent(e.content)]}enumSerialiseAttributes(e){const t=e.attributes.clone(),r=t.remove("enumerations")||new this.namespace.elements.Array([]),n=t.get("default");let s=t.get("samples")||new this.namespace.elements.Array([]);if(n&&n.content&&(n.content.attributes&&n.content.attributes.remove("typeAttributes"),t.set("default",new this.namespace.elements.Array([n.content]))),s.forEach((e=>{e.content&&e.content.element&&e.content.attributes.remove("typeAttributes")})),e.content&&0!==r.length&&s.unshift(e.content),s=s.map((e=>e instanceof this.namespace.elements.Array?[e]:new this.namespace.elements.Array([e.content]))),s.length&&t.set("samples",s),t.length>0)return this.serialiseObject(t)}enumSerialiseContent(e){if(e._attributes){const t=e.attributes.get("enumerations");if(t&&t.length>0)return t.content.map((e=>{const t=e.clone();return t.attributes.remove("typeAttributes"),this.serialise(t)}))}if(e.content){const t=e.content.clone();return t.attributes.remove("typeAttributes"),[this.serialise(t)]}return[]}deserialise(e){if("string"==typeof e)return new this.namespace.elements.String(e);if("number"==typeof e)return new this.namespace.elements.Number(e);if("boolean"==typeof e)return new this.namespace.elements.Boolean(e);if(null===e)return new this.namespace.elements.Null;if(Array.isArray(e))return new this.namespace.elements.Array(e.map(this.deserialise,this));const t=this.namespace.getElementClass(e.element),r=new t;r.element!==e.element&&(r.element=e.element),e.meta&&this.deserialiseObject(e.meta,r.meta),e.attributes&&this.deserialiseObject(e.attributes,r.attributes);const n=this.deserialiseContent(e.content);if(void 0===n&&null!==r.content||(r.content=n),"enum"===r.element){r.content&&r.attributes.set("enumerations",r.content);let e=r.attributes.get("samples");if(r.attributes.remove("samples"),e){const n=e;e=new this.namespace.elements.Array,n.forEach((n=>{n.forEach((n=>{const s=new t(n);s.element=r.element,e.push(s)}))}));const s=e.shift();r.content=s?s.content:void 0,r.attributes.set("samples",e)}else r.content=void 0;let n=r.attributes.get("default");if(n&&n.length>0){n=n.get(0);const e=new t(n);e.element=r.element,r.attributes.set("default",e)}}else if("dataStructure"===r.element&&Array.isArray(r.content))[r.content]=r.content;else if("category"===r.element){const e=r.attributes.get("meta");e&&(r.attributes.set("metadata",e),r.attributes.remove("meta"))}else"member"===r.element&&r.key&&r.key._attributes&&r.key._attributes.getValue("variable")&&(r.attributes.set("variable",r.key.attributes.get("variable")),r.key.attributes.remove("variable"));return r}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}return e&&e.map?e.map(this.serialise,this):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(e.map)return e.map(this.deserialise,this)}return e}shouldRefract(e){return!!(e._attributes&&e.attributes.keys().length||e._meta&&e.meta.keys().length)||"enum"!==e.element&&(e.element!==e.primitive()||"member"===e.element)}convertKeyToRefract(e,t){return this.shouldRefract(t)?this.serialise(t):"enum"===t.element?this.serialiseEnum(t):"array"===t.element?t.map((t=>this.shouldRefract(t)||"default"===e?this.serialise(t):"array"===t.element||"object"===t.element||"enum"===t.element?t.children.map((e=>this.serialise(e))):t.toValue())):"object"===t.element?(t.content||[]).map(this.serialise,this):t.toValue()}serialiseEnum(e){return e.children.map((e=>this.serialise(e)))}serialiseObject(e){const t={};return e.forEach(((e,r)=>{if(e){const n=r.toValue();t[n]=this.convertKeyToRefract(n,e)}})),t}deserialiseObject(e,t){Object.keys(e).forEach((r=>{t.set(r,this.deserialise(e[r]))}))}}},3212:(e,t,r)=>{var n=r(8250),s=r(1877),a=r(8006);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}i.prototype.add=i.prototype.push=s,i.prototype.has=a,e.exports=i},3283:(e,t,r)=>{var n=r(6027),s=r(547),a=Object.prototype,i=a.hasOwnProperty,o=a.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return s(e)&&i.call(e,"callee")&&!o.call(e,"callee")};e.exports=c},3305:(e,t,r)=>{var n=r(4497);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},3311:(e,t,r)=>{const n=r(1517),s=r(4123);class a extends s{map(e,t){return this.elements.map((r=>e.bind(t)(r.value,r.key,r)))}filter(e,t){return new a(this.elements.filter((r=>e.bind(t)(r.value,r.key,r))))}reject(e,t){return this.filter(n(e.bind(t)))}forEach(e,t){return this.elements.forEach(((r,n)=>{e.bind(t)(r.value,r.key,r,n)}))}keys(){return this.map(((e,t)=>t.toValue()))}values(){return this.map((e=>e.toValue()))}}e.exports=a},3655:(e,t,r)=>{var n=r(7379),s=r(1580);e.exports=function(e){if(!s(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3766:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},3934:(e,t,r)=>{var n=r(3212),s=r(6465),a=r(5568);e.exports=function(e,t,r,i,o,c){var l=1&r,u=e.length,h=t.length;if(u!=h&&!(l&&h>u))return!1;var p=c.get(e),f=c.get(t);if(p&&f)return p==t&&f==e;var m=-1,d=!0,y=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++m<u;){var g=e[m],b=t[m];if(i)var v=l?i(b,g,m,t,e,c):i(g,b,m,e,t,c);if(void 0!==v){if(v)continue;d=!1;break}if(y){if(!s(t,(function(e,t){if(!a(y,t)&&(g===e||o(g,e,r,i,c)))return y.push(t)}))){d=!1;break}}else if(g!==b&&!o(g,b,r,i,c)){d=!1;break}}return c.delete(e),c.delete(t),d}},3964:(e,t,r)=>{var n=r(7034);e.exports=function(e,t){var r=this.__data__,s=n(r,e);return s<0?(++this.size,r.push([e,t])):r[s][1]=t,this}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4103:(e,t,r)=>{var n=r(1386);e.exports=function(){this.__data__=new n,this.size=0}},4123:(e,t,r)=>{const n=r(1517);function s(e){return"string"==typeof e?t=>t.element===e:e.constructor&&e.extend?t=>t instanceof e:e}class a{constructor(e){this.elements=e||[]}toValue(){return this.elements.map((e=>e.toValue()))}map(e,t){return this.elements.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const r=[];return this.forEach((n=>{const s=e.bind(t)(n);s&&r.push(s)})),r}filter(e,t){return e=s(e),new a(this.elements.filter(e,t))}reject(e,t){return e=s(e),new a(this.elements.filter(n(e),t))}find(e,t){return e=s(e),this.elements.find(e,t)}forEach(e,t){this.elements.forEach(e,t)}reduce(e,t){return this.elements.reduce(e,t)}includes(e){return this.elements.some((t=>t.equals(e)))}shift(){return this.elements.shift()}unshift(e){this.elements.unshift(this.refract(e))}push(e){return this.elements.push(this.refract(e)),this}add(e){this.push(e)}get(e){return this.elements[e]}getValue(e){const t=this.elements[e];if(t)return t.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=function(){return this.elements[Symbol.iterator]()}),e.exports=a},4162:e=>{e.exports=function(e){return this.__data__.get(e)}},4497:(e,t,r)=>{var n=r(4715)(Object,"create");e.exports=n},4512:(e,t,r)=>{var n=r(4715)(r(8942),"Set");e.exports=n},4687:(e,t,r)=>{var n=r(353),s=r(547);e.exports=function e(t,r,a,i,o){return t===r||(null==t||null==r||!s(t)&&!s(r)?t!=t&&r!=r:n(t,r,a,i,e,o))}},4700:(e,t,r)=>{var n=r(9067);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},4715:(e,t,r)=>{var n=r(9624),s=r(155);e.exports=function(e,t){var r=s(e,t);return n(r)?r:void 0}},4732:(e,t,r)=>{var n=r(4700);e.exports=function(e){return n(this,e).has(e)}},4759:(e,t,r)=>{var n,s=r(1950),a=(n=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},4772:e=>{e.exports=function(){return!1}},4882:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},4967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5071:(e,t,r)=>{var n=r(4497);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},5098:(e,t,r)=>{var n=r(3305),s=r(9361),a=r(1112),i=r(5276),o=r(5071);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=a,c.prototype.has=i,c.prototype.set=o,e.exports=c},5276:(e,t,r)=>{var n=r(4497),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:s.call(t,e)}},5387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},5568:e=>{e.exports=function(e,t){return e.has(t)}},5642:(e,t,r)=>{const n=r(1517),s=r(1580),a=r(9796),i=r(7309),o=r(3311);e.exports=class extends a{constructor(e,t,r){super(e||[],t,r),this.element="object"}primitive(){return"object"}toValue(){return this.content.reduce(((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e)),{})}get(e){const t=this.getMember(e);if(t)return t.value}getMember(e){if(void 0!==e)return this.content.find((t=>t.key.toValue()===e))}remove(e){let t=null;return this.content=this.content.filter((r=>r.key.toValue()!==e||(t=r,!1))),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if(s(e))return Object.keys(e).forEach((t=>{this.set(t,e[t])})),this;const r=e,n=this.getMember(r);return n?n.value=t:this.content.push(new i(r,t)),this}keys(){return this.content.map((e=>e.key.toValue()))}values(){return this.content.map((e=>e.value.toValue()))}hasKey(e){return this.content.some((t=>t.key.equals(e)))}items(){return this.content.map((e=>[e.key.toValue(),e.value.toValue()]))}map(e,t){return this.content.map((r=>e.bind(t)(r.value,r.key,r)))}compactMap(e,t){const r=[];return this.forEach(((n,s,a)=>{const i=e.bind(t)(n,s,a);i&&r.push(i)})),r}filter(e,t){return new o(this.content).filter(e,t)}reject(e,t){return this.filter(n(e),t)}forEach(e,t){return this.content.forEach((r=>e.bind(t)(r.value,r.key,r)))}}},5650:(e,t,r)=>{var n=r(8942).Symbol;e.exports=n},5681:(e,t,r)=>{var n=r(4700);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},5735:(e,t,r)=>{const n=r(9310),s=r(8138),a=r(986),i=r(2563),o=r(1580),c=r(394),l=r(7547);class u{constructor(e){this.elementMap={},this.elementDetection=[],this.Element=l.Element,this.KeyValuePair=l.KeyValuePair,e&&e.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",l.NullElement).register("string",l.StringElement).register("number",l.NumberElement).register("boolean",l.BooleanElement).register("array",l.ArrayElement).register("object",l.ObjectElement).register("member",l.MemberElement).register("ref",l.RefElement).register("link",l.LinkElement),this.detect(n,l.NullElement,!1).detect(s,l.StringElement,!1).detect(a,l.NumberElement,!1).detect(i,l.BooleanElement,!1).detect(Array.isArray,l.ArrayElement,!1).detect(o,l.ObjectElement,!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,r){return void 0===r||r?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(let r=0;r<this.elementDetection.length;r+=1){const n=this.elementDetection[r][0],s=this.elementDetection[r][1];if(n(e)){t=new s(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.substr(1);this._elements[t]=this.elementMap[e]}))),this._elements}get serialiser(){return new c(this)}}c.prototype.Namespace=u,e.exports=u},5853:(e,t,r)=>{e=r.nmd(e);var n=r(8942),s=r(4772),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a?n.Buffer:void 0,c=(o?o.isBuffer:void 0)||s;e.exports=c},5894:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},6027:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return s(e)&&"[object Arguments]"==n(e)}},6137:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},6285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6343:(e,t,r)=>{var n=r(4687);e.exports=function(e,t){return n(e,t)}},6465:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},6529:(e,t,r)=>{var n=r(3655),s=r(5387);e.exports=function(e){return null!=e&&s(e.length)&&!n(e)}},6638:(e,t,r)=>{var n=r(1386),s=r(9770),a=r(8250);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!s||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7034:(e,t,r)=>{var n=r(6285);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},7144:(e,t,r)=>{var n=r(7034);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7309:(e,t,r)=>{const n=r(2322),s=r(8631);e.exports=class extends s{constructor(e,t,r,s){super(new n,r,s),this.element="member",this.key=e,this.value=t}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=this.refract(e)}}},7379:(e,t,r)=>{var n=r(5650),s=r(8870),a=r(9005),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?s(e):a(e)}},7452:(e,t,r)=>{var n=r(7034);e.exports=function(e){return n(this.__data__,e)>-1}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},7547:(e,t,r)=>{const n=r(8631),s=r(3004),a=r(8712),i=r(2536),o=r(2555),c=r(9796),l=r(7309),u=r(5642),h=r(9620),p=r(593),f=r(4123),m=r(3311),d=r(2322);function y(e){if(e instanceof n)return e;if("string"==typeof e)return new a(e);if("number"==typeof e)return new i(e);if("boolean"==typeof e)return new o(e);if(null===e)return new s;if(Array.isArray(e))return new c(e.map(y));if("object"==typeof e){return new u(e)}return e}n.prototype.ObjectElement=u,n.prototype.RefElement=p,n.prototype.MemberElement=l,n.prototype.refract=y,f.prototype.refract=y,e.exports={Element:n,NullElement:s,StringElement:a,NumberElement:i,BooleanElement:o,ArrayElement:c,MemberElement:l,ObjectElement:u,LinkElement:h,RefElement:p,refract:y,ArraySlice:f,ObjectSlice:m,KeyValuePair:d}},7979:(e,t,r)=>{var n=r(9847),s=r(9306),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return a.call(e,t)})))}:s;e.exports=o},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},8121:(e,t,r)=>{var n=r(3766)(Object.keys,Object);e.exports=n},8138:(e,t,r)=>{var n=r(7379),s=r(3142),a=r(547);e.exports=function(e){return"string"==typeof e||!s(e)&&a(e)&&"[object String]"==n(e)}},8244:(e,t,r)=>{var n=r(1129),s=r(3142);e.exports=function(e,t,r){var a=t(e);return s(e)?a:n(a,r(e))}},8250:(e,t,r)=>{var n=r(9753),s=r(5681),a=r(88),i=r(4732),o=r(9068);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=a,c.prototype.has=i,c.prototype.set=o,e.exports=c},8326:(e,t,r)=>{const n=r(5735),s=r(7547);r(2322),s.ArraySlice,s.ObjectSlice,t.Hg=s.Element,t.Om=s.StringElement,t.kT=s.NumberElement,t.bd=s.BooleanElement,t.Os=s.NullElement,t.wE=s.ArrayElement,t.Sh=s.ObjectElement,t.Pr=s.MemberElement,t.sI=s.RefElement,t.Ft=s.LinkElement,s.refract,r(394),r(3148)},8486:(e,t,r)=>{var n=r(3103),s=r(9770),a=r(9413),i=r(4512),o=r(9270),c=r(7379),l=r(4066),u="[object Map]",h="[object Promise]",p="[object Set]",f="[object WeakMap]",m="[object DataView]",d=l(n),y=l(s),g=l(a),b=l(i),v=l(o),x=c;(n&&x(new n(new ArrayBuffer(1)))!=m||s&&x(new s)!=u||a&&x(a.resolve())!=h||i&&x(new i)!=p||o&&x(new o)!=f)&&(x=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case d:return m;case y:return u;case g:return h;case b:return p;case v:return f}return t}),e.exports=x},8631:(e,t,r)=>{const n=r(6343),s=r(2322),a=r(4123);class i{constructor(e,t,r){t&&(this.meta=t),r&&(this.attributes=r),this.content=e}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((e=>{e.parent=this,e.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const e=new this.constructor;return e.element=this.element,this.meta.length&&(e._meta=this.meta.clone()),this.attributes.length&&(e._attributes=this.attributes.clone()),this.content?this.content.clone?e.content=this.content.clone():Array.isArray(this.content)?e.content=this.content.map((e=>e.clone())):e.content=this.content:e.content=this.content,e}toValue(){return this.content instanceof i?this.content.toValue():this.content instanceof s?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((e=>e.toValue()),this):this.content}toRef(e){if(""===this.id.toValue())throw Error("Cannot create reference to an element that does not contain an ID");const t=new this.RefElement(this.id.toValue());return e&&(t.path=e),t}findRecursive(...e){if(arguments.length>1&&!this.isFrozen)throw new Error("Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`");const t=e.pop();let r=new a;const n=(e,t)=>(e.push(t),e),i=(e,r)=>{r.element===t&&e.push(r);const a=r.findRecursive(t);return a&&a.reduce(n,e),r.content instanceof s&&(r.content.key&&i(e,r.content.key),r.content.value&&i(e,r.content.value)),e};return this.content&&(this.content.element&&i(r,this.content),Array.isArray(this.content)&&this.content.reduce(i,r)),e.isEmpty||(r=r.filter((t=>{let r=t.parents.map((e=>e.element));for(const t in e){const n=e[t],s=r.indexOf(n);if(-1===s)return!1;r=r.splice(0,s)}return!0}))),r}set(e){return this.content=e,this}equals(e){return n(this.toValue(),e)}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}get element(){return this._storedElement||"element"}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof i)this._content=e;else if(e instanceof a)this.content=e.elements;else if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"null"===e||null==e)this._content=e;else if(e instanceof s)this._content=e;else if(Array.isArray(e))this._content=e.map(this.refract);else{if("object"!=typeof e)throw new Error("Cannot set content to given value");this._content=Object.keys(e).map((t=>new this.MemberElement(t,e[t])))}}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.ObjectElement?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.ObjectElement?this._attributes=e:this.attributes.set(e||{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get title(){return this.getMetaProperty("title","")}set title(e){this.setMetaProperty("title",e)}get description(){return this.getMetaProperty("description","")}set description(e){this.setMetaProperty("description",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:e}=this;const t=new a;for(;e;)t.push(e),e=e.parent;return t}get children(){if(Array.isArray(this.content))return new a(this.content);if(this.content instanceof s){const e=new a([this.content.key]);return this.content.value&&e.push(this.content.value),e}return this.content instanceof i?new a([this.content]):new a}get recursiveChildren(){const e=new a;return this.children.forEach((t=>{e.push(t),t.recursiveChildren.forEach((t=>{e.push(t)}))})),e}}e.exports=i},8666:(e,t,r)=>{var n=r(674),s=r(9460),a=r(2306),i=a&&a.isTypedArray,o=i?s(i):n;e.exports=o},8712:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content.length}}},8861:(e,t,r)=>{var n=r(5650),s=r(1623),a=r(6285),i=r(3934),o=r(5894),c=r(9828),l=n?n.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,r,n,l,h,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new s(e),new s(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=o;case"[object Set]":var m=1&n;if(f||(f=c),e.size!=t.size&&!m)return!1;var d=p.get(e);if(d)return d==t;n|=2,p.set(e,t);var y=i(f(e),f(t),n,l,h,p);return p.delete(e),y;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},8870:(e,t,r)=>{var n=r(5650),s=Object.prototype,a=s.hasOwnProperty,i=s.toString,o=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,o),r=e[o];try{e[o]=void 0;var n=!0}catch(e){}var s=i.call(e);return n&&(t?e[o]=r:delete e[o]),s}},8942:(e,t,r)=>{var n=r(4967),s="object"==typeof self&&self&&self.Object===Object&&self,a=n||s||Function("return this")();e.exports=a},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9068:(e,t,r)=>{var n=r(4700);e.exports=function(e,t){var r=n(this,e),s=r.size;return r.set(e,t),this.size+=r.size==s?0:1,this}},9270:(e,t,r)=>{var n=r(4715)(r(8942),"WeakMap");e.exports=n},9306:e=>{e.exports=function(){return[]}},9310:e=>{e.exports=function(e){return null===e}},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9413:(e,t,r)=>{var n=r(4715)(r(8942),"Promise");e.exports=n},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},9620:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||[],t,r),this.element="link"}get relation(){return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}}},9624:(e,t,r)=>{var n=r(3655),s=r(4759),a=r(1580),i=r(4066),o=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,h=l.hasOwnProperty,p=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||s(e))&&(n(e)?p:o).test(i(e))}},9632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9753:(e,t,r)=>{var n=r(5098),s=r(1386),a=r(9770);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||s),string:new n}}},9770:(e,t,r)=>{var n=r(4715)(r(8942),"Map");e.exports=n},9796:(e,t,r)=>{const n=r(1517),s=r(8631),a=r(4123);class i extends s{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this.content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}getIndex(e){return this.content[e]}set(e,t){return this.content[e]=this.refract(t),this}remove(e){const t=this.content.splice(e,1);return t.length?t[0]:null}map(e,t){return this.content.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const r=[];return this.forEach((n=>{const s=e.bind(t)(n);s&&r.push(s)})),r}filter(e,t){return new a(this.content.filter(e,t))}reject(e,t){return this.filter(n(e),t)}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n="object"===this.primitive()?this.first.value:this.first);for(let t=r;t<this.length;t+=1){const r=this.content[t];n="object"===this.primitive()?this.refract(e(n,r.value,r.key,r,this)):this.refract(e(n,r,t,this))}return n}forEach(e,t){this.content.forEach(((r,n)=>{e.bind(t)(r,this.refract(n))}))}shift(){return this.content.shift()}unshift(e){this.content.unshift(this.refract(e))}push(e){return this.content.push(this.refract(e)),this}add(e){this.push(e)}findElements(e,t){const r=t||{},n=!!r.recursive,s=void 0===r.results?[]:r.results;return this.forEach(((t,r,a)=>{n&&void 0!==t.findElements&&t.findElements(e,{results:s,recursive:n}),e(t,r,a)&&s.push(t)})),s}find(e){return new a(this.findElements(e,{recursive:!0}))}findByElement(e){return this.find((t=>t.element===e))}findByClass(e){return this.find((t=>t.classes.includes(e)))}getById(e){return this.find((t=>t.id.toValue()===e)).first}includes(e){return this.content.some((t=>t.equals(e)))}contains(e){return this.includes(e)}empty(){return new this.constructor([])}"fantasy-land/empty"(){return this.empty()}concat(e){return new this.constructor(this.content.concat(e.content))}"fantasy-land/concat"(e){return this.concat(e)}"fantasy-land/map"(e){return new this.constructor(this.map(e))}"fantasy-land/chain"(e){return this.map((t=>e(t)),this).reduce(((e,t)=>e.concat(t)),this.empty())}"fantasy-land/filter"(e){return new this.constructor(this.content.filter(e))}"fantasy-land/reduce"(e,t){return this.content.reduce(e,t)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}i.empty=function(){return new this},i["fantasy-land/empty"]=i.empty,"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.content[Symbol.iterator]()}),e.exports=i},9828:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},9847:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,s=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[s++]=i)}return a}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n](a,a.exports,r),a.loaded=!0,a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{ASTTranslator:()=>w,CSTTranslator:()=>x,Grammar:()=>l,JSONPointerCompileError:()=>U,JSONPointerError:()=>g,JSONPointerEvaluateError:()=>Y,JSONPointerIndexError:()=>J,JSONPointerKeyError:()=>W,JSONPointerParseError:()=>b,JSONPointerTypeError:()=>G,JSONString:()=>e,URIFragmentIdentifier:()=>t,XMLTranslator:()=>A,compile:()=>H,escape:()=>B,evaluate:()=>Ne,parse:()=>j,testArrayDash:()=>z,testArrayIndex:()=>I,testArrayLocation:()=>C,testJSONPointer:()=>_,testReferenceToken:()=>M,unescape:()=>E});var e={};r.r(e),r.d(e,{from:()=>a,to:()=>s});var t={};r.r(t),r.d(t,{from:()=>o,fromURIReference:()=>c,to:()=>i});const s=e=>JSON.stringify(e),a=e=>{try{return String(JSON.parse(e))}catch{return e}},i=e=>`#${[...e].map((e=>/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/.test(e)?e:encodeURIComponent(e))).join("")}`,o=e=>{try{const t=e.startsWith("#")?e.slice(1):e;return decodeURIComponent(t)}catch{return e}},c=e=>{const t=e.indexOf("#"),r=-1===t?"#":e.substring(t);return o(r)};function l(){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'}}const u=function(){const e=d,t=m,r=this,n="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let s,a,i,o,c,l,u,h=0,p=0,f=0,y=0,g=0,b=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(m,d,v,x)=>{const w=`${n}parse(): `;h=0,p=0,f=0,y=0,g=0,s=void 0,a=void 0,i=void 0,o=void 0,b.refresh(),c=void 0,l=void 0,u=void 0,o=t.stringToChars(v),s=m.rules,a=m.udts;const T=d.toLowerCase();let k;for(const e in s)if(s.hasOwnProperty(e)&&T===s[e].lower){k=s[e].index;break}if(void 0===k)throw new Error(`${w}start rule name '${startRule}' not recognized`);(()=>{const e=`${n}initializeCallbacks(): `;let t,i;for(c=[],l=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<a.length;t+=1)l[t]=void 0;const o=[];for(t=0;t<s.length;t+=1)o.push(s[t].lower);for(t=0;t<a.length;t+=1)o.push(a[t].lower);for(const n in r.callbacks)if(r.callbacks.hasOwnProperty(n)){if(t=o.indexOf(n.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${n}' not a rule or udt name`);if(i=r.callbacks[n]?r.callbacks[n]:void 0,"function"!=typeof i&&void 0!==i)throw new Error(`${e}syntax callback[${n}] must be function reference or falsy)`);t<s.length?c[t]=i:l[t-s.length]=i}})(),r.trace&&r.trace.init(s,a,o),r.stats&&r.stats.init(s,a),r.ast&&r.ast.init(s,a,o),u=x,i=[{type:e.RNM,index:k}],E(0,0),i=void 0;let O=!1;switch(b.state){case e.ACTIVE:throw new Error(`${w}final state should never be 'ACTIVE'`);case e.NOMATCH:O=!1;break;case e.EMPTY:case e.MATCH:O=b.phraseLength===o.length;break;default:throw new Error("unrecognized state")}return{success:O,state:b.state,stateName:e.idName(b.state),length:o.length,matched:b.phraseLength,maxMatched:g,maxTreeDepth:f,nodeHits:y}};const v=(t,r,s,a)=>{if(r.phraseLength>s){let e=`${n}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!a)throw new Error(`${n}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},x=(t,c)=>{let p,f,m;const d=i[t],y=a[d.index];b.UdtIndex=y.index,h||(m=r.ast&&r.ast.udtDefined(d.index),m&&(f=s.length+d.index,p=r.ast.getLength(),r.ast.down(f,y.name)));const g=o.length-c;l[d.index](b,o,c,u),((t,r,s)=>{if(r.phraseLength>s){let e=`${n}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${n}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(y,b,g),h||m&&(b.state===e.NOMATCH?r.ast.setLength(p):r.ast.up(f,y.name,c,b.phraseLength))},E=(t,a)=>{const l=`${n}opExecute(): `,m=i[t];switch(y+=1,p>f&&(f=p),p+=1,b.refresh(),r.trace&&r.trace.down(m,a),m.type){case e.ALT:((t,r)=>{const n=i[t];for(let t=0;t<n.children.length&&(E(n.children[t],r),b.state===e.NOMATCH);t+=1);})(t,a);break;case e.CAT:((t,n)=>{let s,a,o,c;const l=i[t];r.ast&&(a=r.ast.getLength()),s=!0,o=n,c=0;for(let t=0;t<l.children.length;t+=1){if(E(l.children[t],o),b.state===e.NOMATCH){s=!1;break}o+=b.phraseLength,c+=b.phraseLength}s?(b.state=0===c?e.EMPTY:e.MATCH,b.phraseLength=c):(b.state=e.NOMATCH,b.phraseLength=0,r.ast&&r.ast.setLength(a))})(t,a);break;case e.REP:((t,n)=>{let s,a,c,l;const u=i[t];if(0===u.max)return b.state=e.EMPTY,void(b.phraseLength=0);for(a=n,c=0,l=0,r.ast&&(s=r.ast.getLength());!(a>=o.length)&&(E(t+1,a),b.state!==e.NOMATCH)&&b.state!==e.EMPTY&&(l+=1,c+=b.phraseLength,a+=b.phraseLength,l!==u.max););b.state===e.EMPTY||l>=u.min?(b.state=0===c?e.EMPTY:e.MATCH,b.phraseLength=c):(b.state=e.NOMATCH,b.phraseLength=0,r.ast&&r.ast.setLength(s))})(t,a);break;case e.RNM:((t,n)=>{let a,l,p;const f=i[t],m=s[f.index],d=c[m.index];if(h||(l=r.ast&&r.ast.ruleDefined(f.index),l&&(a=r.ast.getLength(),r.ast.down(f.index,s[f.index].name))),d){const t=o.length-n;d(b,o,n,u),v(m,b,t,!0),b.state===e.ACTIVE&&(p=i,i=m.opcodes,E(0,n),i=p,d(b,o,n,u),v(m,b,t,!1))}else p=i,i=m.opcodes,E(0,n,b),i=p;h||l&&(b.state===e.NOMATCH?r.ast.setLength(a):r.ast.up(f.index,m.name,n,b.phraseLength))})(t,a);break;case e.TRG:((t,r)=>{const n=i[t];b.state=e.NOMATCH,r<o.length&&n.min<=o[r]&&o[r]<=n.max&&(b.state=e.MATCH,b.phraseLength=1)})(t,a);break;case e.TBS:((t,r)=>{const n=i[t],s=n.string.length;if(b.state=e.NOMATCH,r+s<=o.length){for(let e=0;e<s;e+=1)if(o[r+e]!==n.string[e])return;b.state=e.MATCH,b.phraseLength=s}})(t,a);break;case e.TLS:((t,r)=>{let n;const s=i[t];b.state=e.NOMATCH;const a=s.string.length;if(0!==a){if(r+a<=o.length){for(let e=0;e<a;e+=1)if(n=o[r+e],n>=65&&n<=90&&(n+=32),n!==s.string[e])return;b.state=e.MATCH,b.phraseLength=a}}else b.state=e.EMPTY})(t,a);break;case e.UDT:x(t,a);break;case e.AND:((t,r)=>{switch(h+=1,E(t+1,r),h-=1,b.phraseLength=0,b.state){case e.EMPTY:case e.MATCH:b.state=e.EMPTY;break;case e.NOMATCH:b.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${b.state}`)}})(t,a);break;case e.NOT:((t,r)=>{switch(h+=1,E(t+1,r),h-=1,b.phraseLength=0,b.state){case e.EMPTY:case e.MATCH:b.state=e.NOMATCH;break;case e.NOMATCH:b.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${b.state}`)}})(t,a);break;default:throw new Error(`${l}unrecognized operator`)}h||a+b.phraseLength>g&&(g=a+b.phraseLength),r.stats&&r.stats.collect(m,b),r.trace&&r.trace.up(m,b.state,a,b.phraseLength),p-=1}},h=function(){const e=d,t=m,r=this;let n,s,a,i=0;const o=[],c=[],l=[];function u(e){let t="";for(;e-- >0;)t+=" ";return t}r.callbacks=[],r.init=(e,t,u)=>{let h;c.length=0,l.length=0,i=0,n=e,s=t,a=u;const p=[];for(h=0;h<n.length;h+=1)p.push(n[h].lower);for(h=0;h<s.length;h+=1)p.push(s[h].lower);for(i=n.length+s.length,h=0;h<i;h+=1)o[h]=void 0;for(const e in r.callbacks)if(r.callbacks.hasOwnProperty(e)){const t=e.toLowerCase();if(h=p.indexOf(t),h<0)throw new Error(`parser.js: Ast()): init: node '${e}' not a rule or udt name`);o[h]=r.callbacks[e]}},r.ruleDefined=e=>!!o[e],r.udtDefined=e=>!!o[n.length+e],r.down=(t,r)=>{const n=l.length;return c.push(n),l.push({name:r,thisIndex:n,thatIndex:void 0,state:e.SEM_PRE,callbackIndex:t,phraseIndex:void 0,phraseLength:void 0,stack:c.length}),n},r.up=(t,r,n,s)=>{const a=l.length,i=c.pop();return l.push({name:r,thisIndex:a,thatIndex:i,state:e.SEM_POST,callbackIndex:t,phraseIndex:n,phraseLength:s,stack:c.length}),l[i].thatIndex=a,l[i].phraseIndex=n,l[i].phraseLength=s,a},r.translate=t=>{let r,n;for(let s=0;s<l.length;s+=1)n=l[s],r=o[n.callbackIndex],r&&(n.state===e.SEM_PRE?r(e.SEM_PRE,a,n.phraseIndex,n.phraseLength,t):r&&r(e.SEM_POST,a,n.phraseIndex,n.phraseLength,t))},r.setLength=e=>{l.length=e,c.length=e>0?l[e-1].stack:0},r.getLength=()=>l.length,r.toXml=()=>{let r="",n=0;return r+='<?xml version="1.0" encoding="utf-8"?>\n',r+=`<root nodes="${l.length/2}" characters="${a.length}">\n`,r+="\x3c!-- input string --\x3e\n",r+=u(n+2),r+=t.charsToString(a),r+="\n",l.forEach((s=>{s.state===e.SEM_PRE?(n+=1,r+=u(n),r+=`<node name="${s.name}" index="${s.phraseIndex}" length="${s.phraseLength}">\n`,r+=u(n+2),r+=t.charsToString(a,s.phraseIndex,s.phraseLength),r+="\n"):(r+=u(n),r+=`</node>\x3c!-- name="${s.name}" --\x3e\n`,n-=1)})),r+="</root>\n",r}},p=function(){const e=d,t=m,r="parser.js: Trace(): ";let n,s,a,i="",o=0;const c=this,l=e=>{let t="",r=0;if(e>=0)for(;e--;)r+=1,5===r?(t+="|",r=0):t+=".";return t};c.init=(e,t,r)=>{s=e,a=t,n=r};const u=n=>{let i;switch(n.type){case e.ALT:i="ALT";break;case e.CAT:i="CAT";break;case e.REP:i=n.max===1/0?`REP(${n.min},inf)`:`REP(${n.min},${n.max})`;break;case e.RNM:i=`RNM(${s[n.index].name})`;break;case e.TRG:i=`TRG(${n.min},${n.max})`;break;case e.TBS:i=n.string.length>6?`TBS(${t.charsToString(n.string,0,3)}...)`:`TBS(${t.charsToString(n.string,0,6)})`;break;case e.TLS:i=n.string.length>6?`TLS(${t.charsToString(n.string,0,3)}...)`:`TLS(${t.charsToString(n.string,0,6)})`;break;case e.UDT:i=`UDT(${a[n.index].name})`;break;case e.AND:i="AND";break;case e.NOT:i="NOT";break;default:throw new Error(`${r}Trace: opName: unrecognized opcode`)}return i};c.down=(e,r)=>{const s=l(o),a=Math.min(100,n.length-r);let c=t.charsToString(n,r,a);a<n.length-r&&(c+="..."),c=`${s}|-|[${u(e)}]${c}\n`,i+=c,o+=1},c.up=(s,a,c,h)=>{const p=`${r}trace.up: `;o-=1;const f=l(o);let m,d,y;switch(a){case e.EMPTY:y="|E|",d="''";break;case e.MATCH:y="|M|",m=Math.min(100,h),d=m<h?`'${t.charsToString(n,c,m)}...'`:`'${t.charsToString(n,c,m)}'`;break;case e.NOMATCH:y="|N|",d="";break;default:throw new Error(`${p} unrecognized state`)}d=`${f}${y}[${u(s)}]${d}\n`,i+=d},c.displayTrace=()=>i},f=function(){const e=d;let t,r,n;const s=[],a=[],i=[];this.init=(e,n)=>{t=e,r=n,p()},this.collect=(t,r)=>{f(n,r.state,r.phraseLength),f(s[t.type],r.state,r.phraseLength),t.type===e.RNM&&f(a[t.index],r.state,r.phraseLength),t.type===e.UDT&&f(i[t.index],r.state,r.phraseLength)},this.displayStats=()=>{let t="";const r={match:0,empty:0,nomatch:0,total:0},n=(e,t,n,s,a)=>{r.match+=t,r.empty+=n,r.nomatch+=s,r.total+=a;return`${e} | ${o(t)} | ${o(n)} | ${o(s)} | ${o(a)} |\n`};return t+=" OPERATOR STATS\n",t+=" | MATCH | EMPTY | NOMATCH | TOTAL |\n",t+=n(" ALT",s[e.ALT].match,s[e.ALT].empty,s[e.ALT].nomatch,s[e.ALT].total),t+=n(" CAT",s[e.CAT].match,s[e.CAT].empty,s[e.CAT].nomatch,s[e.CAT].total),t+=n(" REP",s[e.REP].match,s[e.REP].empty,s[e.REP].nomatch,s[e.REP].total),t+=n(" RNM",s[e.RNM].match,s[e.RNM].empty,s[e.RNM].nomatch,s[e.RNM].total),t+=n(" TRG",s[e.TRG].match,s[e.TRG].empty,s[e.TRG].nomatch,s[e.TRG].total),t+=n(" TBS",s[e.TBS].match,s[e.TBS].empty,s[e.TBS].nomatch,s[e.TBS].total),t+=n(" TLS",s[e.TLS].match,s[e.TLS].empty,s[e.TLS].nomatch,s[e.TLS].total),t+=n(" UDT",s[e.UDT].match,s[e.UDT].empty,s[e.UDT].nomatch,s[e.UDT].total),t+=n(" AND",s[e.AND].match,s[e.AND].empty,s[e.AND].nomatch,s[e.AND].total),t+=n(" NOT",s[e.NOT].match,s[e.NOT].empty,s[e.NOT].nomatch,s[e.NOT].total),t+=n("TOTAL",r.match,r.empty,r.nomatch,r.total),t},this.displayHits=e=>{let t="";const r=(e,t,r,s,a)=>{n.match+=e,n.empty+=t,n.nomatch+=r,n.total+=s;return`| ${o(e)} | ${o(t)} | ${o(r)} | ${o(s)} | ${a}\n`};"string"==typeof e&&"a"===e.toLowerCase()[0]?(a.sort(c),i.sort(c),t+=" RULES/UDTS ALPHABETICALLY\n"):"string"==typeof e&&"i"===e.toLowerCase()[0]?(a.sort(u),i.sort(u),t+=" RULES/UDTS BY INDEX\n"):(a.sort(l),i.sort(l),t+=" RULES/UDTS BY HIT COUNT\n"),t+="| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";for(let e=0;e<a.length;e+=1){let n=a[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}for(let e=0;e<i.length;e+=1){let n=i[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}return t};const o=e=>e<10?` ${e}`:e<100?` ${e}`:e<1e3?` ${e}`:e<1e4?` ${e}`:e<1e5?` ${e}`:e<1e6?` ${e}`:`${e}`,c=(e,t)=>e.lower<t.lower?-1:e.lower>t.lower?1:0,l=(e,t)=>e.total<t.total?1:e.total>t.total?-1:c(e,t),u=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0,h=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},p=()=>{s.length=0,n=new h,s[e.ALT]=new h,s[e.CAT]=new h,s[e.REP]=new h,s[e.RNM]=new h,s[e.TRG]=new h,s[e.TBS]=new h,s[e.TLS]=new h,s[e.UDT]=new h,s[e.AND]=new h,s[e.NOT]=new h,a.length=0;for(let e=0;e<t.length;e+=1)a.push({empty:0,match:0,nomatch:0,total:0,name:t[e].name,lower:t[e].lower,index:t[e].index});if(r.length>0){i.length=0;for(let e=0;e<r.length;e+=1)i.push({empty:0,match:0,nomatch:0,total:0,name:r[e].name,lower:r[e].lower,index:r[e].index})}},f=(t,r)=>{switch(t.total+=1,r){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`parser.js: Stats(): collect(): incStat(): unrecognized state: ${r}`)}}},m={stringToChars:e=>[...e].map((e=>e.codePointAt(0))),charsToString:(e,t,r)=>{let n=e;for(;!(void 0===t||t<0);){if(void 0===r){n=e.slice(t);break}if(r<=0)return"";n=e.slice(t,t+r);break}return String.fromCodePoint(...n)}},d={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 d.ALT:return"ALT";case d.CAT:return"CAT";case d.REP:return"REP";case d.RNM:return"RNM";case d.TRG:return"TRG";case d.TBS:return"TBS";case d.TLS:return"TLS";case d.UDT:return"UDT";case d.AND:return"AND";case d.NOT:return"NOT";case d.ACTIVE:return"ACTIVE";case d.EMPTY:return"EMPTY";case d.MATCH:return"MATCH";case d.NOMATCH:return"NOMATCH";case d.SEM_PRE:return"SEM_PRE";case d.SEM_POST:return"SEM_POST";case d.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};class y extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const g=y;const b=class extends g{},v=e=>(t,r,n,s,a)=>{if("object"!=typeof a||null===a||Array.isArray(a))throw new b("parser's user data must be an object");if(t===d.SEM_PRE){const t={type:e,text:m.charsToString(r,n,s),start:n,length:s,children:[]};if(a.stack.length>0){a.stack[a.stack.length-1].children.push(t)}else a.root=t;a.stack.push(t)}t===d.SEM_POST&&a.stack.pop()};const x=class extends h{constructor(){super(),this.callbacks["json-pointer"]=v("json-pointer"),this.callbacks["reference-token"]=v("reference-token"),this.callbacks.slash=v("text")}getTree(){const e={stack:[],root:null};return this.translate(e),delete e.stack,e}},E=e=>{if("string"!=typeof e)throw new TypeError("Reference token must be a string");return e.replace(/~1/g,"/").replace(/~0/g,"~")};const w=class extends x{getTree(){const{root:e}=super.getTree();return e.children.filter((({type:e})=>"reference-token"===e)).map((({text:e})=>E(e)))}};const T=class extends Array{toString(){return this.map((e=>`"${String(e)}"`)).join(", ")}};const k=class extends p{inferExpectations(){const e=this.displayTrace().split("\n"),t=new Set;let r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.includes("M|")){const e=s.match(/]'(.*)'$/);e&&e[1]&&(r=n)}if(n>r){const e=s.match(/N\|\[TLS\(([^)]+)\)]/);e&&t.add(e[1])}}return new T(...t)}},O=new l,j=(e,{translator:t=new w,stats:r=!1,trace:n=!1}={})=>{if("string"!=typeof e)throw new TypeError("JSON Pointer must be a string");try{const s=new u;t&&(s.ast=t),r&&(s.stats=new f),n&&(s.trace=new k);const a=s.parse(O,"json-pointer",e);return{result:a,tree:a.success&&t?s.ast.getTree():void 0,stats:s.stats,trace:s.trace}}catch(t){throw new b("Unexpected error during JSON Pointer parsing",{cause:t,jsonPointer:e})}};const A=class extends x{getTree(){return this.toXml()}},_=e=>{try{return j(e,{translator:null}).result.success}catch{return!1}},S=new l,P=new u,M=e=>{if("string"!=typeof e)return!1;try{return P.parse(S,"reference-token",e).success}catch{return!1}},N=new l,$=new u,C=e=>{if("string"!=typeof e)return!1;try{return $.parse(N,"array-location",e).success}catch{return!1}},L=new l,R=new u,I=e=>{if("string"!=typeof e)return!1;try{return R.parse(L,"array-index",e).success}catch{return!1}},V=new l,D=new u,z=e=>{if("string"!=typeof e)return!1;try{return D.parse(V,"array-dash",e).success}catch{return!1}},B=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 U=class extends g{},H=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 B(String(e))})).join("/")}`}catch(t){throw new U("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};const F=class{#e;#t;#r;constructor(e,t={}){this.#e=e,this.#e.steps=[],this.#e.failed=!1,this.#e.failedAt=-1,this.#e.message=`JSON Pointer "${t.jsonPointer}" was successfully evaluated against the provided value`,this.#e.context={...t,realm:t.realm.name},this.#t=[],this.#r=t.realm}step({referenceToken:e,input:t,output:r,success:n=!0,reason:s}){const a=this.#t.length;this.#t.push(e);const i={referenceToken:e,referenceTokenPosition:a,input:t,inputType:this.#r.isObject(t)?"object":this.#r.isArray(t)?"array":"unrecognized",output:r,success:n};s&&(i.reason=s),this.#e.steps.push(i),n||(this.#e.failed=!0,this.#e.failedAt=a,this.#e.message=s)}};const q=class{name="";isArray(e){throw new g("Realm.isArray(node) must be implemented in a subclass")}isObject(e){throw new g("Realm.isObject(node) must be implemented in a subclass")}sizeOf(e){throw new g("Realm.sizeOf(node) must be implemented in a subclass")}has(e,t){throw new g("Realm.has(node) must be implemented in a subclass")}evaluate(e,t){throw new g("Realm.evaluate(node) must be implemented in a subclass")}};const Y=class extends g{};const J=class extends Y{};const K=class extends q{name="json";isArray(e){return Array.isArray(e)}isObject(e){return"object"==typeof e&&null!==e&&!this.isArray(e)}sizeOf(e){return this.isArray(e)?e.length:this.isObject(e)?Object.keys(e).length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new J(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)&&Object.prototype.hasOwnProperty.call(e,r)}return!!this.isObject(e)&&Object.prototype.hasOwnProperty.call(e,t)}evaluate(e,t){return this.isArray(e)?e[Number(t)]:e[t]}};const G=class extends Y{};const W=class extends Y{},X=(e,t,{strictArrays:r=!0,strictObjects:n=!0,realm:s=new K,trace:a=!0}={})=>{const{result:i,tree:o,trace:c}=j(t,{trace:!!a}),l="object"==typeof a&&null!==a?new F(a,{jsonPointer:t,referenceTokens:o,strictArrays:r,strictObjects:n,realm:s,value:e}):null;try{let a;if(!i.success){let r=`Invalid JSON Pointer: "${t}". Syntax error at position ${i.maxMatched}`;throw r+=c?`, expected ${c.inferExpectations()}`:"",new Y(r,{jsonPointer:t,currentValue:e,realm:s.name})}return o.reduce(((e,i,c)=>{if(s.isArray(e)){if(z(i)){if(r)throw new J(`Invalid array index "-" at position ${c} in "${t}". The "-" token always refers to a nonexistent element during evaluation`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return a=s.evaluate(e,String(s.sizeOf(e))),null==l||l.step({referenceToken:i,input:e,output:a}),a}if(!I(i))throw new J(`Invalid array index "${i}" at position ${c} in "${t}": index MUST be "0", or digits without a leading "0"`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});const n=Number(i);if(!Number.isSafeInteger(n))throw new J(`Invalid array index "${i}" at position ${c} in "${t}": index must be a safe integer`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});if(!s.has(e,i)&&r)throw new J(`Invalid array index "${i}" at position ${c} in "${t}": index not found in array`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return a=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:a}),a}if(s.isObject(e)){if(!s.has(e,i)&&n)throw new W(`Invalid object key "${i}" at position ${c} in "${t}": key not found in object`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name});return a=s.evaluate(e,i),null==l||l.step({referenceToken:i,input:e,output:a}),a}throw new G(`Invalid reference token "${i}" at position ${c} in "${t}": cannot be applied to a non-object/non-array value`,{jsonPointer:t,referenceTokens:o,referenceToken:i,referenceTokenPosition:c,currentValue:e,realm:s.name})}),e)}catch(e){if(null==l||l.step({referenceToken:e.referenceToken,input:e.currentValue,success:!1,reason:e.message}),e instanceof Y)throw e;throw new Y("Unexpected error during JSON Pointer evaluation",{cause:e,jsonPointer:t,referenceTokens:o})}};var Z=r(8326);class Q extends Z.Om{constructor(e,t,r){super(e,t,r),this.element="annotation"}get code(){return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}}const ee=Q;class te extends Z.Om{constructor(e,t,r){super(e,t,r),this.element="comment"}}const re=te;function ne(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function se(e){return function t(r){return 0===arguments.length||ne(r)?t:e.apply(this,arguments)}}function ae(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return ne(r)?t:se((function(t){return e(r,t)}));default:return ne(r)&&ne(n)?t:ne(r)?se((function(t){return e(t,n)})):ne(n)?se((function(t){return e(r,t)})):e(r,n)}}}function ie(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function oe(e,t,r){for(var n=0,s=r.length;n<s;){if(e(t,r[n]))return!0;n+=1}return!1}function ce(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const le="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var ue=Object.prototype.toString;const he=function(){return"[object Arguments]"===ue.call(arguments)?function(e){return"[object Arguments]"===ue.call(e)}:function(e){return ce("callee",e)}}();var pe=!{toString:null}.propertyIsEnumerable("toString"),fe=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],me=function(){return arguments.propertyIsEnumerable("length")}(),de=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1};const ye="function"!=typeof Object.keys||me?se((function(e){if(Object(e)!==e)return[];var t,r,n=[],s=me&&he(e);for(t in e)!ce(t,e)||s&&"length"===t||(n[n.length]=t);if(pe)for(r=fe.length-1;r>=0;)ce(t=fe[r],e)&&!de(n,t)&&(n[n.length]=t),r-=1;return n})):se((function(e){return Object(e)!==e?[]:Object.keys(e)}));const ge=se((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function be(e,t,r,n){var s=ie(e);function a(e,t){return ve(e,t,r.slice(),n.slice())}return!oe((function(e,t){return!oe(a,t,e)}),ie(t),s)}function ve(e,t,r,n){if(le(e,t))return!0;var s,a,i=ge(e);if(i!==ge(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(i){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(s=e.constructor,null==(a=String(s).match(/^function (\w*)/))?"":a[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!le(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!le(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===e)return n[o]===t;o-=1}switch(i){case"Map":return e.size===t.size&&be(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&be(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=ye(e);if(c.length!==ye(t).length)return!1;var l=r.concat([e]),u=n.concat([t]);for(o=c.length-1;o>=0;){var h=c[o];if(!ce(h,t)||!ve(t[h],e[h],l,u))return!1;o-=1}return!0}const xe=ae((function(e,t){return ve(e,t,[],[])}))(se((function(e){return function(){return e}}))(void 0)());class Ee extends Z.wE{constructor(e,t,r){super(e,t,r),this.element="parseResult"}get api(){return this.children.filter((e=>e.classes.contains("api"))).first}get results(){return this.children.filter((e=>e.classes.contains("result")))}get result(){return this.results.first}get annotations(){return this.children.filter((e=>"annotation"===e.element))}get warnings(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("warning")))}get errors(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("error")))}get isEmpty(){return this.children.reject((e=>"annotation"===e.element)).isEmpty}replaceResult(e){const{result:t}=this;if(xe(t))return!1;const r=this.content.findIndex((e=>e===t));return-1!==r&&(this.content[r]=e,!0)}}const we=Ee,Te=(e,t)=>"object"==typeof t&&null!==t&&e in t&&"function"==typeof t[e],ke=e=>"object"==typeof e&&null!=e&&"_storedElement"in e&&"string"==typeof e._storedElement&&"_content"in e,Oe=(e,t)=>"object"==typeof t&&null!==t&&"primitive"in t&&("function"==typeof t.primitive&&t.primitive()===e),je=(e,t)=>"object"==typeof t&&null!==t&&"classes"in t&&(Array.isArray(t.classes)||t.classes instanceof Z.wE)&&t.classes.includes(e),Ae=(e,t)=>"object"==typeof t&&null!==t&&"element"in t&&t.element===e,_e=e=>e({hasMethod:Te,hasBasicElementProps:ke,primitiveEq:Oe,isElementType:Ae,hasClass:je}),Se=(_e((({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof Z.Hg||e(r)&&t(void 0,r))),_e((({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof Z.Om||e(r)&&t("string",r))),_e((({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof Z.kT||e(r)&&t("number",r))),_e((({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof Z.Os||e(r)&&t("null",r))),_e((({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof Z.bd||e(r)&&t("boolean",r))),_e((({hasBasicElementProps:e,primitiveEq:t,hasMethod:r})=>n=>n instanceof Z.Sh||e(n)&&t("object",n)&&r("keys",n)&&r("values",n)&&r("items",n)))),Pe=_e((({hasBasicElementProps:e,primitiveEq:t,hasMethod:r})=>n=>n instanceof Z.wE&&!(n instanceof Z.Sh)||e(n)&&t("array",n)&&r("push",n)&&r("unshift",n)&&r("map",n)&&r("reduce",n)));_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof Z.Pr||e(n)&&t("member",n)&&r(void 0,n))),_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof Z.Ft||e(n)&&t("link",n)&&r(void 0,n))),_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof Z.sI||e(n)&&t("ref",n)&&r(void 0,n))),_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof ee||e(n)&&t("annotation",n)&&r("array",n))),_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof re||e(n)&&t("comment",n)&&r("string",n))),_e((({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof we||e(n)&&t("parseResult",n)&&r("array",n)));const Me=class extends q{name="apidom";isArray(e){return Pe(e)}isObject(e){return Se(e)}sizeOf(e){return this.isArray(e)||this.isObject(e)?e.length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new J(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)}if(this.isObject(e)){const r=e.keys(),n=new Set(r);if(r.length!==n.size)throw new W(`Object key "${t}" is not unique — JSON Pointer requires unique member names`,{referenceToken:t,currentValue:e,realm:this.name});return e.hasKey(t)}return!1}evaluate(e,t){return this.isArray(e)?e.get(Number(t)):e.get(t)}},Ne=(e,t,r={})=>X(e,t,{...r,realm:new Me})})(),n})()));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).apidomJsonPointer={})}(this,(function(e){"use strict";const t=Object.freeze(Object.defineProperty({__proto__:null,from:e=>{try{return String(JSON.parse(e))}catch{return e}},to:e=>JSON.stringify(e)},Symbol.toStringTag,{value:"Module"})),n=e=>{try{const t=e.startsWith("#")?e.slice(1):e;return decodeURIComponent(t)}catch{return e}},r=Object.freeze(Object.defineProperty({__proto__:null,from:n,fromURIReference:e=>{const t=e.indexOf("#"),r=-1===t?"#":e.substring(t);return n(r)},to:e=>`#${[...e].map((e=>/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/.test(e)?e:encodeURIComponent(e))).join("")}`},Symbol.toStringTag,{value:"Module"}));function s(){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'}}const i=function(){const e=l,t=u,n=this,r="parser.js: Parser(): ";n.ast=void 0,n.stats=void 0,n.trace=void 0,n.callbacks=[];let s,i,a,o,c,h,f,p=0,m=0,d=0,y=0,g=0,b=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};n.parse=(u,l,v,E)=>{const T=`${r}parse(): `;p=0,m=0,d=0,y=0,g=0,s=void 0,i=void 0,a=void 0,o=void 0,b.refresh(),c=void 0,h=void 0,f=void 0,o=t.stringToChars(v),s=u.rules,i=u.udts;const k=l.toLowerCase();let A;for(const e in s)if(s.hasOwnProperty(e)&&k===s[e].lower){A=s[e].index;break}if(void 0===A)throw new Error(`${T}start rule name '${startRule}' not recognized`);(()=>{const e=`${r}initializeCallbacks(): `;let t,a;for(c=[],h=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<i.length;t+=1)h[t]=void 0;const o=[];for(t=0;t<s.length;t+=1)o.push(s[t].lower);for(t=0;t<i.length;t+=1)o.push(i[t].lower);for(const r in n.callbacks)if(n.callbacks.hasOwnProperty(r)){if(t=o.indexOf(r.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${r}' not a rule or udt name`);if(a=n.callbacks[r]?n.callbacks[r]:void 0,"function"!=typeof a&&void 0!==a)throw new Error(`${e}syntax callback[${r}] must be function reference or falsy)`);t<s.length?c[t]=a:h[t-s.length]=a}})(),n.trace&&n.trace.init(s,i,o),n.stats&&n.stats.init(s,i),n.ast&&n.ast.init(s,i,o),f=E,a=[{type:e.RNM,index:A}],w(0,0),a=void 0;let O=!1;switch(b.state){case e.ACTIVE:throw new Error(`${T}final state should never be 'ACTIVE'`);case e.NOMATCH:O=!1;break;case e.EMPTY:case e.MATCH:O=b.phraseLength===o.length;break;default:throw new Error("unrecognized state")}return{success:O,state:b.state,stateName:e.idName(b.state),length:o.length,matched:b.phraseLength,maxMatched:g,maxTreeDepth:d,nodeHits:y}};const v=(t,n,s,i)=>{if(n.phraseLength>s){let e=`${r}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.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:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},E=(t,c)=>{let u,l,m;const d=a[t],y=i[d.index];b.UdtIndex=y.index,p||(m=n.ast&&n.ast.udtDefined(d.index),m&&(l=s.length+d.index,u=n.ast.getLength(),n.ast.down(l,y.name)));const g=o.length-c;h[d.index](b,o,c,f),((t,n,s)=>{if(n.phraseLength>s){let e=`${r}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.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.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}})(y,b,g),p||m&&(b.state===e.NOMATCH?n.ast.setLength(u):n.ast.up(l,y.name,c,b.phraseLength))},w=(t,i)=>{const u=`${r}opExecute(): `,l=a[t];switch(y+=1,m>d&&(d=m),m+=1,b.refresh(),n.trace&&n.trace.down(l,i),l.type){case e.ALT:((t,n)=>{const r=a[t];for(let t=0;t<r.children.length&&(w(r.children[t],n),b.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,r)=>{let s,i,o,c;const u=a[t];n.ast&&(i=n.ast.getLength()),s=!0,o=r,c=0;for(let t=0;t<u.children.length;t+=1){if(w(u.children[t],o),b.state===e.NOMATCH){s=!1;break}o+=b.phraseLength,c+=b.phraseLength}s?(b.state=0===c?e.EMPTY:e.MATCH,b.phraseLength=c):(b.state=e.NOMATCH,b.phraseLength=0,n.ast&&n.ast.setLength(i))})(t,i);break;case e.REP:((t,r)=>{let s,i,c,u;const l=a[t];if(0===l.max)return b.state=e.EMPTY,void(b.phraseLength=0);for(i=r,c=0,u=0,n.ast&&(s=n.ast.getLength());!(i>=o.length)&&(w(t+1,i),b.state!==e.NOMATCH)&&b.state!==e.EMPTY&&(u+=1,c+=b.phraseLength,i+=b.phraseLength,u!==l.max););b.state===e.EMPTY||u>=l.min?(b.state=0===c?e.EMPTY:e.MATCH,b.phraseLength=c):(b.state=e.NOMATCH,b.phraseLength=0,n.ast&&n.ast.setLength(s))})(t,i);break;case e.RNM:((t,r)=>{let i,u,l;const h=a[t],m=s[h.index],d=c[m.index];if(p||(u=n.ast&&n.ast.ruleDefined(h.index),u&&(i=n.ast.getLength(),n.ast.down(h.index,s[h.index].name))),d){const t=o.length-r;d(b,o,r,f),v(m,b,t,!0),b.state===e.ACTIVE&&(l=a,a=m.opcodes,w(0,r),a=l,d(b,o,r,f),v(m,b,t,!1))}else l=a,a=m.opcodes,w(0,r),a=l;p||u&&(b.state===e.NOMATCH?n.ast.setLength(i):n.ast.up(h.index,m.name,r,b.phraseLength))})(t,i);break;case e.TRG:((t,n)=>{const r=a[t];b.state=e.NOMATCH,n<o.length&&r.min<=o[n]&&o[n]<=r.max&&(b.state=e.MATCH,b.phraseLength=1)})(t,i);break;case e.TBS:((t,n)=>{const r=a[t],s=r.string.length;if(b.state=e.NOMATCH,n+s<=o.length){for(let e=0;e<s;e+=1)if(o[n+e]!==r.string[e])return;b.state=e.MATCH,b.phraseLength=s}})(t,i);break;case e.TLS:((t,n)=>{let r;const s=a[t];b.state=e.NOMATCH;const i=s.string.length;if(0!==i){if(n+i<=o.length){for(let e=0;e<i;e+=1)if(r=o[n+e],r>=65&&r<=90&&(r+=32),r!==s.string[e])return;b.state=e.MATCH,b.phraseLength=i}}else b.state=e.EMPTY})(t,i);break;case e.UDT:E(t,i);break;case e.AND:((t,n)=>{switch(p+=1,w(t+1,n),p-=1,b.phraseLength=0,b.state){case e.EMPTY:case e.MATCH:b.state=e.EMPTY;break;case e.NOMATCH:b.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${b.state}`)}})(t,i);break;case e.NOT:((t,n)=>{switch(p+=1,w(t+1,n),p-=1,b.phraseLength=0,b.state){case e.EMPTY:case e.MATCH:b.state=e.NOMATCH;break;case e.NOMATCH:b.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${b.state}`)}})(t,i);break;default:throw new Error(`${u}unrecognized operator`)}p||i+b.phraseLength>g&&(g=i+b.phraseLength),n.stats&&n.stats.collect(l,b),n.trace&&n.trace.up(l,b.state,i,b.phraseLength),m-=1}},a=function(){const e=l,t=u,n=this;let r,s,i,a=0;const o=[],c=[],h=[];function f(e){let t="";for(;e-- >0;)t+=" ";return t}n.callbacks=[],n.init=(e,t,u)=>{let l;c.length=0,h.length=0,a=0,r=e,s=t,i=u;const f=[];for(l=0;l<r.length;l+=1)f.push(r[l].lower);for(l=0;l<s.length;l+=1)f.push(s[l].lower);for(a=r.length+s.length,l=0;l<a;l+=1)o[l]=void 0;for(const e in n.callbacks)if(n.callbacks.hasOwnProperty(e)){const t=e.toLowerCase();if(l=f.indexOf(t),l<0)throw new Error(`parser.js: Ast()): init: node '${e}' not a rule or udt name`);o[l]=n.callbacks[e]}},n.ruleDefined=e=>!!o[e],n.udtDefined=e=>!!o[r.length+e],n.down=(t,n)=>{const r=h.length;return c.push(r),h.push({name:n,thisIndex:r,thatIndex:void 0,state:e.SEM_PRE,callbackIndex:t,phraseIndex:void 0,phraseLength:void 0,stack:c.length}),r},n.up=(t,n,r,s)=>{const i=h.length,a=c.pop();return h.push({name:n,thisIndex:i,thatIndex:a,state:e.SEM_POST,callbackIndex:t,phraseIndex:r,phraseLength:s,stack:c.length}),h[a].thatIndex=i,h[a].phraseIndex=r,h[a].phraseLength=s,i},n.translate=t=>{let n,r;for(let s=0;s<h.length;s+=1)r=h[s],n=o[r.callbackIndex],n&&(r.state===e.SEM_PRE?n(e.SEM_PRE,i,r.phraseIndex,r.phraseLength,t):n&&n(e.SEM_POST,i,r.phraseIndex,r.phraseLength,t))},n.setLength=e=>{h.length=e,c.length=e>0?h[e-1].stack:0},n.getLength=()=>h.length,n.toXml=()=>{let n="",r=0;return n+='<?xml version="1.0" encoding="utf-8"?>\n',n+=`<root nodes="${h.length/2}" characters="${i.length}">\n`,n+="\x3c!-- input string --\x3e\n",n+=f(r+2),n+=t.charsToString(i),n+="\n",h.forEach((s=>{s.state===e.SEM_PRE?(r+=1,n+=f(r),n+=`<node name="${s.name}" index="${s.phraseIndex}" length="${s.phraseLength}">\n`,n+=f(r+2),n+=t.charsToString(i,s.phraseIndex,s.phraseLength),n+="\n"):(n+=f(r),n+=`</node>\x3c!-- name="${s.name}" --\x3e\n`,r-=1)})),n+="</root>\n",n}},o=function(){const e=l,t=u,n="parser.js: Trace(): ";let r,s,i,a="",o=0;const c=this,h=e=>{let t="",n=0;if(e>=0)for(;e--;)n+=1,5===n?(t+="|",n=0):t+=".";return t};c.init=(e,t,n)=>{s=e,i=t,r=n};const f=r=>{let a;switch(r.type){case e.ALT:a="ALT";break;case e.CAT:a="CAT";break;case e.REP:a=r.max===1/0?`REP(${r.min},inf)`:`REP(${r.min},${r.max})`;break;case e.RNM:a=`RNM(${s[r.index].name})`;break;case e.TRG:a=`TRG(${r.min},${r.max})`;break;case e.TBS:a=r.string.length>6?`TBS(${t.charsToString(r.string,0,3)}...)`:`TBS(${t.charsToString(r.string,0,6)})`;break;case e.TLS:a=r.string.length>6?`TLS(${t.charsToString(r.string,0,3)}...)`:`TLS(${t.charsToString(r.string,0,6)})`;break;case e.UDT:a=`UDT(${i[r.index].name})`;break;case e.AND:a="AND";break;case e.NOT:a="NOT";break;default:throw new Error(`${n}Trace: opName: unrecognized opcode`)}return a};c.down=(e,n)=>{const s=h(o),i=Math.min(100,r.length-n);let c=t.charsToString(r,n,i);i<r.length-n&&(c+="..."),c=`${s}|-|[${f(e)}]${c}\n`,a+=c,o+=1},c.up=(s,i,c,u)=>{const l=`${n}trace.up: `;o-=1;const p=h(o);let m,d,y;switch(i){case e.EMPTY:y="|E|",d="''";break;case e.MATCH:y="|M|",m=Math.min(100,u),d=m<u?`'${t.charsToString(r,c,m)}...'`:`'${t.charsToString(r,c,m)}'`;break;case e.NOMATCH:y="|N|",d="";break;default:throw new Error(`${l} unrecognized state`)}d=`${p}${y}[${f(s)}]${d}\n`,a+=d},c.displayTrace=()=>a},c=function(){const e=l;let t,n,r;const s=[],i=[],a=[];this.init=(e,r)=>{t=e,n=r,p()},this.collect=(t,n)=>{m(r,n.state,n.phraseLength),m(s[t.type],n.state,n.phraseLength),t.type===e.RNM&&m(i[t.index],n.state,n.phraseLength),t.type===e.UDT&&m(a[t.index],n.state,n.phraseLength)},this.displayStats=()=>{let t="";const n={match:0,empty:0,nomatch:0,total:0},r=(e,t,r,s,i)=>{n.match+=t,n.empty+=r,n.nomatch+=s,n.total+=i;return`${e} | ${o(t)} | ${o(r)} | ${o(s)} | ${o(i)} |\n`};return t+=" OPERATOR STATS\n",t+=" | MATCH | EMPTY | NOMATCH | TOTAL |\n",t+=r(" ALT",s[e.ALT].match,s[e.ALT].empty,s[e.ALT].nomatch,s[e.ALT].total),t+=r(" CAT",s[e.CAT].match,s[e.CAT].empty,s[e.CAT].nomatch,s[e.CAT].total),t+=r(" REP",s[e.REP].match,s[e.REP].empty,s[e.REP].nomatch,s[e.REP].total),t+=r(" RNM",s[e.RNM].match,s[e.RNM].empty,s[e.RNM].nomatch,s[e.RNM].total),t+=r(" TRG",s[e.TRG].match,s[e.TRG].empty,s[e.TRG].nomatch,s[e.TRG].total),t+=r(" TBS",s[e.TBS].match,s[e.TBS].empty,s[e.TBS].nomatch,s[e.TBS].total),t+=r(" TLS",s[e.TLS].match,s[e.TLS].empty,s[e.TLS].nomatch,s[e.TLS].total),t+=r(" UDT",s[e.UDT].match,s[e.UDT].empty,s[e.UDT].nomatch,s[e.UDT].total),t+=r(" AND",s[e.AND].match,s[e.AND].empty,s[e.AND].nomatch,s[e.AND].total),t+=r(" NOT",s[e.NOT].match,s[e.NOT].empty,s[e.NOT].nomatch,s[e.NOT].total),t+=r("TOTAL",n.match,n.empty,n.nomatch,n.total),t},this.displayHits=e=>{let t="";const n=(e,t,n,s,i)=>{r.match+=e,r.empty+=t,r.nomatch+=n,r.total+=s;return`| ${o(e)} | ${o(t)} | ${o(n)} | ${o(s)} | ${i}\n`};"string"==typeof e&&"a"===e.toLowerCase()[0]?(i.sort(c),a.sort(c),t+=" RULES/UDTS ALPHABETICALLY\n"):"string"==typeof e&&"i"===e.toLowerCase()[0]?(i.sort(h),a.sort(h),t+=" RULES/UDTS BY INDEX\n"):(i.sort(u),a.sort(u),t+=" RULES/UDTS BY HIT COUNT\n"),t+="| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";for(let e=0;e<i.length;e+=1){let r=i[e];r.total&&(t+=n(r.match,r.empty,r.nomatch,r.total,r.name))}for(let e=0;e<a.length;e+=1){let r=a[e];r.total&&(t+=n(r.match,r.empty,r.nomatch,r.total,r.name))}return t};const o=e=>e<10?` ${e}`:e<100?` ${e}`:e<1e3?` ${e}`:e<1e4?` ${e}`:e<1e5?` ${e}`:e<1e6?` ${e}`:`${e}`,c=(e,t)=>e.lower<t.lower?-1:e.lower>t.lower?1:0,u=(e,t)=>e.total<t.total?1:e.total>t.total?-1:c(e,t),h=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0,f=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},p=()=>{s.length=0,r=new f,s[e.ALT]=new f,s[e.CAT]=new f,s[e.REP]=new f,s[e.RNM]=new f,s[e.TRG]=new f,s[e.TBS]=new f,s[e.TLS]=new f,s[e.UDT]=new f,s[e.AND]=new f,s[e.NOT]=new f,i.length=0;for(let e=0;e<t.length;e+=1)i.push({empty:0,match:0,nomatch:0,total:0,name:t[e].name,lower:t[e].lower,index:t[e].index});if(n.length>0){a.length=0;for(let e=0;e<n.length;e+=1)a.push({empty:0,match:0,nomatch:0,total:0,name:n[e].name,lower:n[e].lower,index:n[e].index})}},m=(t,n)=>{switch(t.total+=1,n){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`parser.js: Stats(): collect(): incStat(): unrecognized state: ${n}`)}}},u={stringToChars:e=>[...e].map((e=>e.codePointAt(0))),charsToString:(e,t,n)=>{let r=e;for(;!(void 0===t||t<0);){if(void 0===n){r=e.slice(t);break}if(n<=0)return"";r=e.slice(t,t+n);break}return String.fromCodePoint(...r)}},l={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 l.ALT:return"ALT";case l.CAT:return"CAT";case l.REP:return"REP";case l.RNM:return"RNM";case l.TRG:return"TRG";case l.TBS:return"TBS";case l.TLS:return"TLS";case l.UDT:return"UDT";case l.AND:return"AND";case l.NOT:return"NOT";case l.ACTIVE:return"ACTIVE";case l.EMPTY:return"EMPTY";case l.MATCH:return"MATCH";case l.NOMATCH:return"NOMATCH";case l.SEM_PRE:return"SEM_PRE";case l.SEM_POST:return"SEM_POST";case l.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};class h 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,...n}=t;Object.assign(this,n)}}}class f extends h{}const p=e=>(t,n,r,s,i)=>{if("object"!=typeof i||null===i||Array.isArray(i))throw new f("parser's user data must be an object");if(t===l.SEM_PRE){const t={type:e,text:u.charsToString(n,r,s),start:r,length:s,children:[]};if(i.stack.length>0){i.stack[i.stack.length-1].children.push(t)}else i.root=t;i.stack.push(t)}t===l.SEM_POST&&i.stack.pop()};class m extends a{constructor(){super(),this.callbacks["json-pointer"]=p("json-pointer"),this.callbacks["reference-token"]=p("reference-token"),this.callbacks.slash=p("text")}getTree(){const e={stack:[],root:null};return this.translate(e),delete e.stack,e}}const d=e=>{if("string"!=typeof e)throw new TypeError("Reference token must be a string");return e.replace(/~1/g,"/").replace(/~0/g,"~")};class y extends m{getTree(){const{root:e}=super.getTree();return e.children.filter((({type:e})=>"reference-token"===e)).map((({text:e})=>d(e)))}}class g extends Array{toString(){return this.map((e=>`"${String(e)}"`)).join(", ")}}class b extends o{inferExpectations(){const e=this.displayTrace().split("\n"),t=new Set;let n=-1;for(let r=0;r<e.length;r++){const s=e[r];if(s.includes("M|")){const e=s.match(/]'(.*)'$/);e&&e[1]&&(n=r)}if(r>n){const e=s.match(/N\|\[TLS\(([^)]+)\)]/);e&&t.add(e[1])}}return new g(...t)}}const v=new s,E=(e,{translator:t=new y,stats:n=!1,trace:r=!1}={})=>{if("string"!=typeof e)throw new TypeError("JSON Pointer must be a string");try{const s=new i;t&&(s.ast=t),n&&(s.stats=new c),r&&(s.trace=new b);const a=s.parse(v,"json-pointer",e);return{result:a,tree:a.success&&t?s.ast.getTree():void 0,stats:s.stats,trace:s.trace}}catch(t){throw new f("Unexpected error during JSON Pointer parsing",{cause:t,jsonPointer:e})}};const w=new s,T=new i,k=new s,A=new i,O=new s,j=new i,_=e=>{if("string"!=typeof e)return!1;try{return j.parse(O,"array-index",e).success}catch{return!1}},x=new s,S=new i,M=e=>{if("string"!=typeof e)return!1;try{return S.parse(x,"array-dash",e).success}catch{return!1}},P=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")};class N extends h{}class ${#e;#t;#n;constructor(e,t={}){this.#e=e,this.#e.steps=[],this.#e.failed=!1,this.#e.failedAt=-1,this.#e.message=`JSON Pointer "${t.jsonPointer}" was successfully evaluated against the provided value`,this.#e.context={...t,realm:t.realm.name},this.#t=[],this.#n=t.realm}step({referenceToken:e,input:t,output:n,success:r=!0,reason:s}){const i=this.#t.length;this.#t.push(e);const a={referenceToken:e,referenceTokenPosition:i,input:t,inputType:this.#n.isObject(t)?"object":this.#n.isArray(t)?"array":"unrecognized",output:n,success:r};s&&(a.reason=s),this.#e.steps.push(a),r||(this.#e.failed=!0,this.#e.failedAt=i,this.#e.message=s)}}class C{name="";isArray(e){throw new h("Realm.isArray(node) must be implemented in a subclass")}isObject(e){throw new h("Realm.isObject(node) must be implemented in a subclass")}sizeOf(e){throw new h("Realm.sizeOf(node) must be implemented in a subclass")}has(e,t){throw new h("Realm.has(node) must be implemented in a subclass")}evaluate(e,t){throw new h("Realm.evaluate(node) must be implemented in a subclass")}}class L extends h{}class R extends L{}class I extends C{name="json";isArray(e){return Array.isArray(e)}isObject(e){return"object"==typeof e&&null!==e&&!this.isArray(e)}sizeOf(e){return this.isArray(e)?e.length:this.isObject(e)?Object.keys(e).length:0}has(e,t){if(this.isArray(e)){const n=Number(t),r=n>>>0;if(n!==r)throw new R(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return r<this.sizeOf(e)&&Object.prototype.hasOwnProperty.call(e,n)}return!!this.isObject(e)&&Object.prototype.hasOwnProperty.call(e,t)}evaluate(e,t){return this.isArray(e)?e[Number(t)]:e[t]}}class V extends L{}class z extends L{}function D(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function B(e){return function t(n){return 0===arguments.length||D(n)?t:e.apply(this,arguments)}}function U(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return D(n)?t:B((function(t){return e(n,t)}));default:return D(n)&&D(r)?t:D(n)?B((function(t){return e(t,r)})):D(r)?B((function(t){return e(n,t)})):e(n,r)}}}function H(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function q(e,t,n){for(var r=0,s=n.length;r<s;){if(e(t,n[r]))return!0;r+=1}return!1}function F(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const Y="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var J=Object.prototype.toString,K=function(){return"[object Arguments]"===J.call(arguments)?function(e){return"[object Arguments]"===J.call(e)}:function(e){return F("callee",e)}}(),G=!{toString:null}.propertyIsEnumerable("toString"),W=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],X=function(){return arguments.propertyIsEnumerable("length")}(),Z=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},Q="function"!=typeof Object.keys||X?B((function(e){if(Object(e)!==e)return[];var t,n,r=[],s=X&&K(e);for(t in e)!F(t,e)||s&&"length"===t||(r[r.length]=t);if(G)for(n=W.length-1;n>=0;)F(t=W[n],e)&&!Z(r,t)&&(r[r.length]=t),n-=1;return r})):B((function(e){return Object(e)!==e?[]:Object.keys(e)})),ee=B((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function te(e,t,n,r){var s=H(e);function i(e,t){return ne(e,t,n.slice(),r.slice())}return!q((function(e,t){return!q(i,t,e)}),H(t),s)}function ne(e,t,n,r){if(Y(e,t))return!0;var s,i,a=ee(e);if(a!==ee(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(a){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(s=e.constructor,null==(i=String(s).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!Y(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Y(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=n.length-1;o>=0;){if(n[o]===e)return r[o]===t;o-=1}switch(a){case"Map":return e.size===t.size&&te(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&te(e.values(),t.values(),n.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 c=Q(e);if(c.length!==Q(t).length)return!1;var u=n.concat([e]),l=r.concat([t]);for(o=c.length-1;o>=0;){var h=c[o];if(!F(h,t)||!ne(t[h],e[h],u,l))return!1;o-=1}return!0}var re,se,ie,ae,oe,ce,ue,le,he,fe,pe,me,de,ye,ge,be,ve,Ee,we,Te,ke,Ae,Oe,je,_e,xe,Se,Me,Pe,Ne,$e,Ce,Le,Re,Ie,Ve,ze,De,Be,Ue,He,qe,Fe,Ye,Je,Ke,Ge,We,Xe,Ze,Qe,et,tt,nt,rt,st,it,at,ot,ct,ut,lt,ht,ft,pt,mt,dt,yt,gt,bt,vt,Et,wt,Tt,kt,At,Ot,jt,_t,xt,St,Mt,Pt,Nt,$t,Ct,Lt,Rt,It,Vt,zt,Dt,Bt,Ut,Ht,qt,Ft,Yt,Jt,Kt,Gt,Wt,Xt,Zt,Qt,en,tn,nn,rn,sn,an,on,cn,un,ln,hn,fn,pn,mn,dn,yn,gn,bn,vn,En,wn,Tn,kn,An,On,jn,_n,xn,Sn,Mn,Pn,Nn,$n,Cn=U((function(e,t){return ne(e,t,[],[])}))(B((function(e){return function(){return e}}))(void 0)()),Ln="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Rn={};function In(){if(ae)return ie;ae=1;var e="object"==typeof Ln&&Ln&&Ln.Object===Object&&Ln;return ie=e}function Vn(){if(ce)return oe;ce=1;var e=In(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return oe=n}function zn(){if(le)return ue;le=1;var e=Vn().Symbol;return ue=e}function Dn(){if(ye)return de;ye=1;var e=zn(),t=function(){if(fe)return he;fe=1;var e=zn(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;return he=function(e){var t=n.call(e,s),i=e[s];try{e[s]=void 0;var a=!0}catch(e){}var o=r.call(e);return a&&(t?e[s]=i:delete e[s]),o}}(),n=function(){if(me)return pe;me=1;var e=Object.prototype.toString;return pe=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return de=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Bn(){if(be)return ge;be=1;var e=Array.isArray;return ge=e}function Un(){if(Ee)return ve;return Ee=1,ve=function(e){return null!=e&&"object"==typeof e}}function Hn(){if(xe)return _e;return xe=1,_e=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e}function qn(){if(Me)return Se;Me=1;return Se=class{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};e._meta&&e._meta.length>0&&(t.meta=this.serialiseObject(e.meta)),e._attributes&&e._attributes.length>0&&(t.attributes=this.serialiseObject(e.attributes));const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),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));t.element!==e.element&&(t.element=e.element),e.meta&&this.deserialiseObject(e.meta,t.meta),e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const n=this.deserialiseContent(e.content);return void 0===n&&null!==t.content||(t.content=n),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}if(e&&e.map){if(0===e.length)return;return e.map(this.serialise,this)}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(e.map)return e.map(this.deserialise,this)}return e}serialiseObject(e){const t={};if(e.forEach(((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))})),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach((n=>{t.set(n,this.deserialise(e[n]))}))}},Se}function Fn(){if(Ce)return $e;return Ce=1,$e=function(e,t){return e===t||e!=e&&t!=t}}function Yn(){if(Re)return Le;Re=1;var e=Fn();return Le=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Jn(){if(Ye)return Fe;Ye=1;var e=Ne?Pe:(Ne=1,Pe=function(){this.__data__=[],this.size=0}),t=function(){if(Ve)return Ie;Ve=1;var e=Yn(),t=Array.prototype.splice;return Ie=function(n){var r=this.__data__,s=e(r,n);return!(s<0||(s==r.length-1?r.pop():t.call(r,s,1),--this.size,0))}}(),n=function(){if(De)return ze;De=1;var e=Yn();return ze=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}}(),r=function(){if(Ue)return Be;Ue=1;var e=Yn();return Be=function(t){return e(this.__data__,t)>-1}}(),s=function(){if(qe)return He;qe=1;var e=Yn();return He=function(t,n){var r=this.__data__,s=e(r,t);return s<0?(++this.size,r.push([t,n])):r[s][1]=n,this}}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,Fe=i}function Kn(){if(nt)return tt;nt=1;var e=Dn(),t=Hn();return tt=function(n){if(!t(n))return!1;var r=e(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function Gn(){if(at)return it;at=1;var e,t=function(){if(st)return rt;st=1;var e=Vn()["__core-js_shared__"];return rt=e}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return it=function(e){return!!n&&n in e}}function Wn(){if(ct)return ot;ct=1;var e=Function.prototype.toString;return ot=function(t){if(null!=t){try{return e.call(t)}catch(e){}try{return t+""}catch(e){}}return""}}function Xn(){if(mt)return pt;mt=1;var e=function(){if(lt)return ut;lt=1;var e=Kn(),t=Gn(),n=Hn(),r=Wn(),s=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,o=i.toString,c=a.hasOwnProperty,u=RegExp("^"+o.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return ut=function(i){return!(!n(i)||t(i))&&(e(i)?u:s).test(r(i))}}(),t=ft?ht:(ft=1,ht=function(e,t){return null==e?void 0:e[t]});return pt=function(n,r){var s=t(n,r);return e(s)?s:void 0}}function Zn(){if(yt)return dt;yt=1;var e=Xn()(Vn(),"Map");return dt=e}function Qn(){if(bt)return gt;bt=1;var e=Xn()(Object,"create");return gt=e}function er(){if(Mt)return St;Mt=1;var e=function(){if(Et)return vt;Et=1;var e=Qn();return vt=function(){this.__data__=e?e(null):{},this.size=0}}(),t=Tt?wt:(Tt=1,wt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}),n=function(){if(At)return kt;At=1;var e=Qn(),t=Object.prototype.hasOwnProperty;return kt=function(n){var r=this.__data__;if(e){var s=r[n];return"__lodash_hash_undefined__"===s?void 0:s}return t.call(r,n)?r[n]:void 0}}(),r=function(){if(jt)return Ot;jt=1;var e=Qn(),t=Object.prototype.hasOwnProperty;return Ot=function(n){var r=this.__data__;return e?void 0!==r[n]:t.call(r,n)}}(),s=function(){if(xt)return _t;xt=1;var e=Qn();return _t=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=e&&void 0===n?"__lodash_hash_undefined__":n,this}}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,St=i}function tr(){if(Rt)return Lt;Rt=1;var e=(Ct||(Ct=1,$t=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}),$t);return Lt=function(t,n){var r=t.__data__;return e(n)?r["string"==typeof n?"string":"hash"]:r.map}}function nr(){if(Yt)return Ft;Yt=1;var e=function(){if(Nt)return Pt;Nt=1;var e=er(),t=Jn(),n=Zn();return Pt=function(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}}(),t=function(){if(Vt)return It;Vt=1;var e=tr();return It=function(t){var n=e(this,t).delete(t);return this.size-=n?1:0,n}}(),n=function(){if(Dt)return zt;Dt=1;var e=tr();return zt=function(t){return e(this,t).get(t)}}(),r=function(){if(Ut)return Bt;Ut=1;var e=tr();return Bt=function(t){return e(this,t).has(t)}}(),s=function(){if(qt)return Ht;qt=1;var e=tr();return Ht=function(t,n){var r=e(this,t),s=r.size;return r.set(t,n),this.size+=r.size==s?0:1,this}}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,Ft=i}function rr(){if(Wt)return Gt;Wt=1;var e=Jn(),t=function(){if(Ke)return Je;Ke=1;var e=Jn();return Je=function(){this.__data__=new e,this.size=0}}(),n=We?Ge:(We=1,Ge=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}),r=Ze?Xe:(Ze=1,Xe=function(e){return this.__data__.get(e)}),s=et?Qe:(et=1,Qe=function(e){return this.__data__.has(e)}),i=function(){if(Kt)return Jt;Kt=1;var e=Jn(),t=Zn(),n=nr();return Jt=function(r,s){var i=this.__data__;if(i instanceof e){var a=i.__data__;if(!t||a.length<199)return a.push([r,s]),this.size=++i.size,this;i=this.__data__=new n(a)}return i.set(r,s),this.size=i.size,this}}();function a(t){var n=this.__data__=new e(t);this.size=n.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=i,Gt=a}function sr(){if(nn)return tn;nn=1;var e=nr(),t=Zt?Xt:(Zt=1,Xt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),n=en?Qt:(en=1,Qt=function(e){return this.__data__.has(e)});function r(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new e;++n<r;)this.add(t[n])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,tn=r}function ir(){if(un)return cn;un=1;var e=sr(),t=sn?rn:(sn=1,rn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}),n=on?an:(on=1,an=function(e,t){return e.has(t)});return cn=function(r,s,i,a,o,c){var u=1&i,l=r.length,h=s.length;if(l!=h&&!(u&&h>l))return!1;var f=c.get(r),p=c.get(s);if(f&&p)return f==s&&p==r;var m=-1,d=!0,y=2&i?new e:void 0;for(c.set(r,s),c.set(s,r);++m<l;){var g=r[m],b=s[m];if(a)var v=u?a(b,g,m,s,r,c):a(g,b,m,r,s,c);if(void 0!==v){if(v)continue;d=!1;break}if(y){if(!t(s,(function(e,t){if(!n(y,t)&&(g===e||o(g,e,i,a,c)))return y.push(t)}))){d=!1;break}}else if(g!==b&&!o(g,b,i,a,c)){d=!1;break}}return c.delete(r),c.delete(s),d}}function ar(){if(gn)return yn;gn=1;var e=zn(),t=function(){if(hn)return ln;hn=1;var e=Vn().Uint8Array;return ln=e}(),n=Fn(),r=ir(),s=pn?fn:(pn=1,fn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}),i=dn?mn:(dn=1,mn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}),a=e?e.prototype:void 0,o=a?a.valueOf:void 0;return yn=function(e,a,c,u,l,h,f){switch(c){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!h(new t(e),new t(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var p=s;case"[object Set]":var m=1&u;if(p||(p=i),e.size!=a.size&&!m)return!1;var d=f.get(e);if(d)return d==a;u|=2,f.set(e,a);var y=r(p(e),p(a),u,l,h,f);return f.delete(e),y;case"[object Symbol]":if(o)return o.call(e)==o.call(a)}return!1}}function or(){if(wn)return En;wn=1;var e=vn?bn:(vn=1,bn=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}),t=Bn();return En=function(n,r,s){var i=r(n);return t(n)?i:e(i,s(n))}}function cr(){if(_n)return jn;_n=1;var e=kn?Tn:(kn=1,Tn=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[s++]=a)}return i}),t=On?An:(On=1,An=function(){return[]}),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return jn=r?function(t){return null==t?[]:(t=Object(t),e(r(t),(function(e){return n.call(t,e)})))}:t}function ur(){if($n)return Nn;$n=1;var e=function(){if(Pn)return Mn;Pn=1;var e=Dn(),t=Un();return Mn=function(n){return t(n)&&"[object Arguments]"==e(n)}}(),t=Un(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return t(e)&&r.call(e,"callee")&&!s.call(e,"callee")};return Nn=i}var lr,hr,fr,pr,mr,dr,yr,gr,br,vr,Er,wr={exports:{}};function Tr(){return fr||(fr=1,function(e,t){var n=Vn(),r=hr?lr:(hr=1,lr=function(){return!1}),s=t&&!t.nodeType&&t,i=s&&e&&!e.nodeType&&e,a=i&&i.exports===s?n.Buffer:void 0,o=(a?a.isBuffer:void 0)||r;e.exports=o}(wr,wr.exports)),wr.exports}function kr(){if(yr)return dr;yr=1;return dr=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}var Ar,Or,jr,_r,xr,Sr,Mr,Pr,Nr,$r,Cr,Lr,Rr,Ir,Vr,zr,Dr,Br,Ur,Hr,qr,Fr,Yr,Jr,Kr,Gr,Wr,Xr,Zr,Qr,es,ts,ns,rs,ss,is,as,os,cs,us,ls,hs,fs,ps,ms,ds,ys,gs,bs,vs,Es,ws,Ts,ks,As,Os,js,_s,xs,Ss,Ms,Ps,Ns,$s,Cs,Ls,Rs,Is,Vs,zs,Ds,Bs,Us={exports:{}};function Hs(){if(jr)return Or;jr=1;var e=function(){if(br)return gr;br=1;var e=Dn(),t=kr(),n=Un(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,gr=function(s){return n(s)&&t(s.length)&&!!r[e(s)]}}(),t=Er?vr:(Er=1,vr=function(e){return function(t){return e(t)}}),n=(Ar||(Ar=1,function(e,t){var n=In(),r=t&&!t.nodeType&&t,s=r&&e&&!e.nodeType&&e,i=s&&s.exports===r&&n.process,a=function(){try{return s&&s.require&&s.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(Us,Us.exports)),Us.exports),r=n&&n.isTypedArray,s=r?t(r):e;return Or=s}function qs(){if(xr)return _r;xr=1;var e=Sn?xn:(Sn=1,xn=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}),t=ur(),n=Bn(),r=Tr(),s=function(){if(mr)return pr;mr=1;var e=/^(?:0|[1-9]\d*)$/;return pr=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n},pr}(),i=Hs(),a=Object.prototype.hasOwnProperty;return _r=function(o,c){var u=n(o),l=!u&&t(o),h=!u&&!l&&r(o),f=!u&&!l&&!h&&i(o),p=u||l||h||f,m=p?e(o.length,String):[],d=m.length;for(var y in o)!c&&!a.call(o,y)||p&&("length"==y||h&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,d))||m.push(y);return m}}function Fs(){if(Cr)return $r;Cr=1;var e=(Nr?Pr:(Nr=1,Pr=function(e,t){return function(n){return e(t(n))}}))(Object.keys,Object);return $r=e}function Ys(){if(Rr)return Lr;Rr=1;var e=function(){if(Mr)return Sr;Mr=1;var e=Object.prototype;return Sr=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}}(),t=Fs(),n=Object.prototype.hasOwnProperty;return Lr=function(r){if(!e(r))return t(r);var s=[];for(var i in Object(r))n.call(r,i)&&"constructor"!=i&&s.push(i);return s}}function Js(){if(Dr)return zr;Dr=1;var e=qs(),t=Ys(),n=function(){if(Vr)return Ir;Vr=1;var e=Kn(),t=kr();return Ir=function(n){return null!=n&&t(n.length)&&!e(n)}}();return zr=function(r){return n(r)?e(r):t(r)}}function Ks(){if(qr)return Hr;qr=1;var e=function(){if(Ur)return Br;Ur=1;var e=or(),t=cr(),n=Js();return Br=function(r){return e(r,n,t)}}(),t=Object.prototype.hasOwnProperty;return Hr=function(n,r,s,i,a,o){var c=1&s,u=e(n),l=u.length;if(l!=e(r).length&&!c)return!1;for(var h=l;h--;){var f=u[h];if(!(c?f in r:t.call(r,f)))return!1}var p=o.get(n),m=o.get(r);if(p&&m)return p==r&&m==n;var d=!0;o.set(n,r),o.set(r,n);for(var y=c;++h<l;){var g=n[f=u[h]],b=r[f];if(i)var v=c?i(b,g,f,r,n,o):i(g,b,f,n,r,o);if(!(void 0===v?g===b||a(g,b,s,i,o):v)){d=!1;break}y||(y="constructor"==f)}if(d&&!y){var E=n.constructor,w=r.constructor;E==w||!("constructor"in n)||!("constructor"in r)||"function"==typeof E&&E instanceof E&&"function"==typeof w&&w instanceof w||(d=!1)}return o.delete(n),o.delete(r),d}}function Gs(){if(es)return Qr;es=1;var e=function(){if(Yr)return Fr;Yr=1;var e=Xn()(Vn(),"DataView");return Fr=e}(),t=Zn(),n=function(){if(Kr)return Jr;Kr=1;var e=Xn()(Vn(),"Promise");return Jr=e}(),r=function(){if(Wr)return Gr;Wr=1;var e=Xn()(Vn(),"Set");return Gr=e}(),s=function(){if(Zr)return Xr;Zr=1;var e=Xn()(Vn(),"WeakMap");return Xr=e}(),i=Dn(),a=Wn(),o="[object Map]",c="[object Promise]",u="[object Set]",l="[object WeakMap]",h="[object DataView]",f=a(e),p=a(t),m=a(n),d=a(r),y=a(s),g=i;return(e&&g(new e(new ArrayBuffer(1)))!=h||t&&g(new t)!=o||n&&g(n.resolve())!=c||r&&g(new r)!=u||s&&g(new s)!=l)&&(g=function(e){var t=i(e),n="[object Object]"==t?e.constructor:void 0,r=n?a(n):"";if(r)switch(r){case f:return h;case p:return o;case m:return c;case d:return u;case y:return l}return t}),Qr=g}function Ws(){if(ss)return rs;ss=1;var e=function(){if(ns)return ts;ns=1;var e=rr(),t=ir(),n=ar(),r=Ks(),s=Gs(),i=Bn(),a=Tr(),o=Hs(),c="[object Arguments]",u="[object Array]",l="[object Object]",h=Object.prototype.hasOwnProperty;return ts=function(f,p,m,d,y,g){var b=i(f),v=i(p),E=b?u:s(f),w=v?u:s(p),T=(E=E==c?l:E)==l,k=(w=w==c?l:w)==l,A=E==w;if(A&&a(f)){if(!a(p))return!1;b=!0,T=!1}if(A&&!T)return g||(g=new e),b||o(f)?t(f,p,m,d,y,g):n(f,p,E,m,d,y,g);if(!(1&m)){var O=T&&h.call(f,"__wrapped__"),j=k&&h.call(p,"__wrapped__");if(O||j){var _=O?f.value():f,x=j?p.value():p;return g||(g=new e),y(_,x,m,d,g)}}return!!A&&(g||(g=new e),r(f,p,m,d,y,g))}}(),t=Un();return rs=function n(r,s,i,a,o){return r===s||(null==r||null==s||!t(r)&&!t(s)?r!=r&&s!=s:e(r,s,i,a,n,o))},rs}function Xs(){if(cs)return os;cs=1;class e{constructor(e,t){this.key=e,this.value=t}clone(){const t=new e;return this.key&&(t.key=this.key.clone()),this.value&&(t.value=this.value.clone()),t}}return os=e}function Zs(){if(ls)return us;ls=1;return us=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}},us}function Qs(){if(fs)return hs;fs=1;const e=Zs();function t(e){return"string"==typeof e?t=>t.element===e:e.constructor&&e.extend?t=>t instanceof e:e}class n{constructor(e){this.elements=e||[]}toValue(){return this.elements.map((e=>e.toValue()))}map(e,t){return this.elements.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const n=[];return this.forEach((r=>{const s=e.bind(t)(r);s&&n.push(s)})),n}filter(e,r){return e=t(e),new n(this.elements.filter(e,r))}reject(r,s){return r=t(r),new n(this.elements.filter(e(r),s))}find(e,n){return e=t(e),this.elements.find(e,n)}forEach(e,t){this.elements.forEach(e,t)}reduce(e,t){return this.elements.reduce(e,t)}includes(e){return this.elements.some((t=>t.equals(e)))}shift(){return this.elements.shift()}unshift(e){this.elements.unshift(this.refract(e))}push(e){return this.elements.push(this.refract(e)),this}add(e){this.push(e)}get(e){return this.elements[e]}getValue(e){const t=this.elements[e];if(t)return t.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}return"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this.elements[Symbol.iterator]()}),hs=n}function ei(){if(ms)return ps;ms=1;const e=function(){if(as)return is;as=1;var e=Ws();return is=function(t,n){return e(t,n)}}(),t=Xs(),n=Qs();class r{constructor(e,t,n){t&&(this.meta=t),n&&(this.attributes=n),this.content=e}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((e=>{e.parent=this,e.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const e=new this.constructor;return e.element=this.element,this.meta.length&&(e._meta=this.meta.clone()),this.attributes.length&&(e._attributes=this.attributes.clone()),this.content?this.content.clone?e.content=this.content.clone():Array.isArray(this.content)?e.content=this.content.map((e=>e.clone())):e.content=this.content:e.content=this.content,e}toValue(){return this.content instanceof r?this.content.toValue():this.content instanceof t?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((e=>e.toValue()),this):this.content}toRef(e){if(""===this.id.toValue())throw Error("Cannot create reference to an element that does not contain an ID");const t=new this.RefElement(this.id.toValue());return e&&(t.path=e),t}findRecursive(...e){if(arguments.length>1&&!this.isFrozen)throw new Error("Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`");const r=e.pop();let s=new n;const i=(e,t)=>(e.push(t),e),a=(e,n)=>{n.element===r&&e.push(n);const s=n.findRecursive(r);return s&&s.reduce(i,e),n.content instanceof t&&(n.content.key&&a(e,n.content.key),n.content.value&&a(e,n.content.value)),e};return this.content&&(this.content.element&&a(s,this.content),Array.isArray(this.content)&&this.content.reduce(a,s)),e.isEmpty||(s=s.filter((t=>{let n=t.parents.map((e=>e.element));for(const t in e){const r=e[t],s=n.indexOf(r);if(-1===s)return!1;n=n.splice(0,s)}return!0}))),s}set(e){return this.content=e,this}equals(t){return e(this.toValue(),t)}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}get element(){return this._storedElement||"element"}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof r)this._content=e;else if(e instanceof n)this.content=e.elements;else if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"null"===e||null==e)this._content=e;else if(e instanceof t)this._content=e;else if(Array.isArray(e))this._content=e.map(this.refract);else{if("object"!=typeof e)throw new Error("Cannot set content to given value");this._content=Object.keys(e).map((t=>new this.MemberElement(t,e[t])))}}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.ObjectElement?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.ObjectElement?this._attributes=e:this.attributes.set(e||{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get title(){return this.getMetaProperty("title","")}set title(e){this.setMetaProperty("title",e)}get description(){return this.getMetaProperty("description","")}set description(e){this.setMetaProperty("description",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:e}=this;const t=new n;for(;e;)t.push(e),e=e.parent;return t}get children(){if(Array.isArray(this.content))return new n(this.content);if(this.content instanceof t){const e=new n([this.content.key]);return this.content.value&&e.push(this.content.value),e}return this.content instanceof r?new n([this.content]):new n}get recursiveChildren(){const e=new n;return this.children.forEach((t=>{e.push(t),t.recursiveChildren.forEach((t=>{e.push(t)}))})),e}}return ps=r}function ti(){if(As)return ks;As=1;const e=Zs(),t=ei(),n=Qs();class r extends t{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this.content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}getIndex(e){return this.content[e]}set(e,t){return this.content[e]=this.refract(t),this}remove(e){const t=this.content.splice(e,1);return t.length?t[0]:null}map(e,t){return this.content.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const n=[];return this.forEach((r=>{const s=e.bind(t)(r);s&&n.push(s)})),n}filter(e,t){return new n(this.content.filter(e,t))}reject(t,n){return this.filter(e(t),n)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r="object"===this.primitive()?this.first.value:this.first);for(let t=n;t<this.length;t+=1){const n=this.content[t];r="object"===this.primitive()?this.refract(e(r,n.value,n.key,n,this)):this.refract(e(r,n,t,this))}return r}forEach(e,t){this.content.forEach(((n,r)=>{e.bind(t)(n,this.refract(r))}))}shift(){return this.content.shift()}unshift(e){this.content.unshift(this.refract(e))}push(e){return this.content.push(this.refract(e)),this}add(e){this.push(e)}findElements(e,t){const n=t||{},r=!!n.recursive,s=void 0===n.results?[]:n.results;return this.forEach(((t,n,i)=>{r&&void 0!==t.findElements&&t.findElements(e,{results:s,recursive:r}),e(t,n,i)&&s.push(t)})),s}find(e){return new n(this.findElements(e,{recursive:!0}))}findByElement(e){return this.find((t=>t.element===e))}findByClass(e){return this.find((t=>t.classes.includes(e)))}getById(e){return this.find((t=>t.id.toValue()===e)).first}includes(e){return this.content.some((t=>t.equals(e)))}contains(e){return this.includes(e)}empty(){return new this.constructor([])}"fantasy-land/empty"(){return this.empty()}concat(e){return new this.constructor(this.content.concat(e.content))}"fantasy-land/concat"(e){return this.concat(e)}"fantasy-land/map"(e){return new this.constructor(this.map(e))}"fantasy-land/chain"(e){return this.map((t=>e(t)),this).reduce(((e,t)=>e.concat(t)),this.empty())}"fantasy-land/filter"(e){return new this.constructor(this.content.filter(e))}"fantasy-land/reduce"(e,t){return this.content.reduce(e,t)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}return r.empty=function(){return new this},r["fantasy-land/empty"]=r.empty,"undefined"!=typeof Symbol&&(r.prototype[Symbol.iterator]=function(){return this.content[Symbol.iterator]()}),ks=r}function ni(){if(js)return Os;js=1;const e=Xs(),t=ei();return Os=class extends t{constructor(t,n,r,s){super(new e,r,s),this.element="member",this.key=t,this.value=n}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=this.refract(e)}}}function ri(){if(xs)return _s;xs=1;const e=Zs(),t=Qs();class n extends t{map(e,t){return this.elements.map((n=>e.bind(t)(n.value,n.key,n)))}filter(e,t){return new n(this.elements.filter((n=>e.bind(t)(n.value,n.key,n))))}reject(t,n){return this.filter(e(t.bind(n)))}forEach(e,t){return this.elements.forEach(((n,r)=>{e.bind(t)(n.value,n.key,n,r)}))}keys(){return this.map(((e,t)=>t.toValue()))}values(){return this.map((e=>e.toValue()))}}return _s=n}function si(){if(Rs)return Ls;Rs=1;const e=ei(),t=function(){if(ys)return ds;ys=1;const e=ei();return ds=class extends e{constructor(e,t,n){super(e||null,t,n),this.element="null"}primitive(){return"null"}set(){return new Error("Cannot set the value of null")}}}(),n=function(){if(bs)return gs;bs=1;const e=ei();return gs=class extends e{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content.length}}}(),r=function(){if(Es)return vs;Es=1;const e=ei();return vs=class extends e{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}}}(),s=function(){if(Ts)return ws;Ts=1;const e=ei();return ws=class extends e{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}}}(),i=ti(),a=ni(),o=function(){if(Ms)return Ss;Ms=1;const e=Zs(),t=Hn(),n=ti(),r=ni(),s=ri();return Ss=class extends n{constructor(e,t,n){super(e||[],t,n),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}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((n=>n.key.toValue()!==e||(t=n,!1))),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,n){if(t(e))return Object.keys(e).forEach((t=>{this.set(t,e[t])})),this;const s=e,i=this.getMember(s);return i?i.value=n:this.content.push(new r(s,n)),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((n=>e.bind(t)(n.value,n.key,n)))}compactMap(e,t){const n=[];return this.forEach(((r,s,i)=>{const a=e.bind(t)(r,s,i);a&&n.push(a)})),n}filter(e,t){return new s(this.content).filter(e,t)}reject(t,n){return this.filter(e(t),n)}forEach(e,t){return this.content.forEach((n=>e.bind(t)(n.value,n.key,n)))}}}(),c=function(){if(Ns)return Ps;Ns=1;const e=ei();return Ps=class extends e{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}}}(),u=function(){if(Cs)return $s;Cs=1;const e=ei();return $s=class extends e{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}}}(),l=Qs(),h=ri(),f=Xs();function p(a){if(a instanceof e)return a;if("string"==typeof a)return new n(a);if("number"==typeof a)return new r(a);if("boolean"==typeof a)return new s(a);if(null===a)return new t;if(Array.isArray(a))return new i(a.map(p));if("object"==typeof a){return new o(a)}return a}return e.prototype.ObjectElement=o,e.prototype.RefElement=u,e.prototype.MemberElement=a,e.prototype.refract=p,l.prototype.refract=p,Ls={Element:e,NullElement:t,StringElement:n,NumberElement:r,BooleanElement:s,ArrayElement:i,MemberElement:a,ObjectElement:o,LinkElement:c,RefElement:u,refract:p,ArraySlice:l,ObjectSlice:h,KeyValuePair:f}}function ii(){if(Vs)return Is;Vs=1;const e=se?re:(se=1,re=function(e){return null===e}),t=function(){if(Te)return we;Te=1;var e=Dn(),t=Bn(),n=Un();return we=function(r){return"string"==typeof r||!t(r)&&n(r)&&"[object String]"==e(r)}}(),n=function(){if(Ae)return ke;Ae=1;var e=Dn(),t=Un();return ke=function(n){return"number"==typeof n||t(n)&&"[object Number]"==e(n)}}(),r=function(){if(je)return Oe;je=1;var e=Dn(),t=Un();return Oe=function(n){return!0===n||!1===n||t(n)&&"[object Boolean]"==e(n)}}(),s=Hn(),i=qn(),a=si();class o{constructor(e){this.elementMap={},this.elementDetection=[],this.Element=a.Element,this.KeyValuePair=a.KeyValuePair,e&&e.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",a.NullElement).register("string",a.StringElement).register("number",a.NumberElement).register("boolean",a.BooleanElement).register("array",a.ArrayElement).register("object",a.ObjectElement).register("member",a.MemberElement).register("ref",a.RefElement).register("link",a.LinkElement),this.detect(e,a.NullElement,!1).detect(t,a.StringElement,!1).detect(n,a.NumberElement,!1).detect(r,a.BooleanElement,!1).detect(Array.isArray,a.ArrayElement,!1).detect(s,a.ObjectElement,!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,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(let n=0;n<this.elementDetection.length;n+=1){const r=this.elementDetection[n][0],s=this.elementDetection[n][1];if(r(e)){t=new s(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.substr(1);this._elements[t]=this.elementMap[e]}))),this._elements}get serialiser(){return new i(this)}}return i.prototype.Namespace=o,Is=o}var ai=function(){if(Bs)return Rn;Bs=1;const e=ii(),t=si();return Rn.Namespace=e,Rn.namespace=function(t){return new e(t)},Rn.KeyValuePair=Xs(),Rn.ArraySlice=t.ArraySlice,Rn.ObjectSlice=t.ObjectSlice,Rn.Element=t.Element,Rn.StringElement=t.StringElement,Rn.NumberElement=t.NumberElement,Rn.BooleanElement=t.BooleanElement,Rn.NullElement=t.NullElement,Rn.ArrayElement=t.ArrayElement,Rn.ObjectElement=t.ObjectElement,Rn.MemberElement=t.MemberElement,Rn.RefElement=t.RefElement,Rn.LinkElement=t.LinkElement,Rn.refract=t.refract,Rn.JSONSerialiser=qn(),Rn.JSON06Serialiser=function(){if(Ds)return zs;Ds=1;const e=qn();return zs=class extends e{serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);let t;e._attributes&&e.attributes.get("variable")&&(t=e.attributes.get("variable"));const n={element:e.element};e._meta&&e._meta.length>0&&(n.meta=this.serialiseObject(e.meta));const r="enum"===e.element||-1!==e.attributes.keys().indexOf("enumerations");if(r){const t=this.enumSerialiseAttributes(e);t&&(n.attributes=t)}else if(e._attributes&&e._attributes.length>0){let{attributes:r}=e;r.get("metadata")&&(r=r.clone(),r.set("meta",r.get("metadata")),r.remove("metadata")),"member"===e.element&&t&&(r=r.clone(),r.remove("variable")),r.length>0&&(n.attributes=this.serialiseObject(r))}if(r)n.content=this.enumSerialiseContent(e,n);else if(this[`${e.element}SerialiseContent`])n.content=this[`${e.element}SerialiseContent`](e,n);else if(void 0!==e.content){let r;t&&e.content.key?(r=e.content.clone(),r.key.attributes.set("variable",t),r=this.serialiseContent(r)):r=this.serialiseContent(e.content),this.shouldSerialiseContent(e,r)&&(n.content=r)}else this.shouldSerialiseContent(e,e.content)&&e instanceof this.namespace.elements.Array&&(n.content=[]);return n}shouldSerialiseContent(e,t){return"parseResult"===e.element||"httpRequest"===e.element||"httpResponse"===e.element||"category"===e.element||"link"===e.element||void 0!==t&&(!Array.isArray(t)||0!==t.length)}refSerialiseContent(e,t){return delete t.attributes,{href:e.toValue(),path:e.path.toValue()}}sourceMapSerialiseContent(e){return e.toValue()}dataStructureSerialiseContent(e){return[this.serialiseContent(e.content)]}enumSerialiseAttributes(e){const t=e.attributes.clone(),n=t.remove("enumerations")||new this.namespace.elements.Array([]),r=t.get("default");let s=t.get("samples")||new this.namespace.elements.Array([]);if(r&&r.content&&(r.content.attributes&&r.content.attributes.remove("typeAttributes"),t.set("default",new this.namespace.elements.Array([r.content]))),s.forEach((e=>{e.content&&e.content.element&&e.content.attributes.remove("typeAttributes")})),e.content&&0!==n.length&&s.unshift(e.content),s=s.map((e=>e instanceof this.namespace.elements.Array?[e]:new this.namespace.elements.Array([e.content]))),s.length&&t.set("samples",s),t.length>0)return this.serialiseObject(t)}enumSerialiseContent(e){if(e._attributes){const t=e.attributes.get("enumerations");if(t&&t.length>0)return t.content.map((e=>{const t=e.clone();return t.attributes.remove("typeAttributes"),this.serialise(t)}))}if(e.content){const t=e.content.clone();return t.attributes.remove("typeAttributes"),[this.serialise(t)]}return[]}deserialise(e){if("string"==typeof e)return new this.namespace.elements.String(e);if("number"==typeof e)return new this.namespace.elements.Number(e);if("boolean"==typeof e)return new this.namespace.elements.Boolean(e);if(null===e)return new this.namespace.elements.Null;if(Array.isArray(e))return new this.namespace.elements.Array(e.map(this.deserialise,this));const t=this.namespace.getElementClass(e.element),n=new t;n.element!==e.element&&(n.element=e.element),e.meta&&this.deserialiseObject(e.meta,n.meta),e.attributes&&this.deserialiseObject(e.attributes,n.attributes);const r=this.deserialiseContent(e.content);if(void 0===r&&null!==n.content||(n.content=r),"enum"===n.element){n.content&&n.attributes.set("enumerations",n.content);let e=n.attributes.get("samples");if(n.attributes.remove("samples"),e){const r=e;e=new this.namespace.elements.Array,r.forEach((r=>{r.forEach((r=>{const s=new t(r);s.element=n.element,e.push(s)}))}));const s=e.shift();n.content=s?s.content:void 0,n.attributes.set("samples",e)}else n.content=void 0;let r=n.attributes.get("default");if(r&&r.length>0){r=r.get(0);const e=new t(r);e.element=n.element,n.attributes.set("default",e)}}else if("dataStructure"===n.element&&Array.isArray(n.content))[n.content]=n.content;else if("category"===n.element){const e=n.attributes.get("meta");e&&(n.attributes.set("metadata",e),n.attributes.remove("meta"))}else"member"===n.element&&n.key&&n.key._attributes&&n.key._attributes.getValue("variable")&&(n.attributes.set("variable",n.key.attributes.get("variable")),n.key.attributes.remove("variable"));return n}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}return e&&e.map?e.map(this.serialise,this):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(e.map)return e.map(this.deserialise,this)}return e}shouldRefract(e){return!!(e._attributes&&e.attributes.keys().length||e._meta&&e.meta.keys().length)||"enum"!==e.element&&(e.element!==e.primitive()||"member"===e.element)}convertKeyToRefract(e,t){return this.shouldRefract(t)?this.serialise(t):"enum"===t.element?this.serialiseEnum(t):"array"===t.element?t.map((t=>this.shouldRefract(t)||"default"===e?this.serialise(t):"array"===t.element||"object"===t.element||"enum"===t.element?t.children.map((e=>this.serialise(e))):t.toValue())):"object"===t.element?(t.content||[]).map(this.serialise,this):t.toValue()}serialiseEnum(e){return e.children.map((e=>this.serialise(e)))}serialiseObject(e){const t={};return e.forEach(((e,n)=>{if(e){const r=n.toValue();t[r]=this.convertKeyToRefract(r,e)}})),t}deserialiseObject(e,t){Object.keys(e).forEach((n=>{t.set(n,this.deserialise(e[n]))}))}},zs}(),Rn}();class oi extends ai.StringElement{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}}class ci extends ai.StringElement{constructor(e,t,n){super(e,t,n),this.element="comment"}}class ui extends ai.ArrayElement{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.children.filter((e=>e.classes.contains("api"))).first}get results(){return this.children.filter((e=>e.classes.contains("result")))}get result(){return this.results.first}get annotations(){return this.children.filter((e=>"annotation"===e.element))}get warnings(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("warning")))}get errors(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("error")))}get isEmpty(){return this.children.reject((e=>"annotation"===e.element)).isEmpty}replaceResult(e){const{result:t}=this;if(Cn(t))return!1;const n=this.content.findIndex((e=>e===t));return-1!==n&&(this.content[n]=e,!0)}}const li=(e,t)=>"object"==typeof t&&null!==t&&e in t&&"function"==typeof t[e],hi=e=>"object"==typeof e&&null!=e&&"_storedElement"in e&&"string"==typeof e._storedElement&&"_content"in e,fi=(e,t)=>"object"==typeof t&&null!==t&&"primitive"in t&&("function"==typeof t.primitive&&t.primitive()===e),pi=(e,t)=>"object"==typeof t&&null!==t&&"classes"in t&&(Array.isArray(t.classes)||t.classes instanceof ai.ArrayElement)&&t.classes.includes(e),mi=(e,t)=>"object"==typeof t&&null!==t&&"element"in t&&t.element===e,di=e=>e({hasMethod:li,hasBasicElementProps:hi,primitiveEq:fi,isElementType:mi,hasClass:pi});di((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof ai.Element||e(n)&&t(void 0,n))),di((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof ai.StringElement||e(n)&&t("string",n))),di((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof ai.NumberElement||e(n)&&t("number",n))),di((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof ai.NullElement||e(n)&&t("null",n))),di((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof ai.BooleanElement||e(n)&&t("boolean",n)));const yi=di((({hasBasicElementProps:e,primitiveEq:t,hasMethod:n})=>r=>r instanceof ai.ObjectElement||e(r)&&t("object",r)&&n("keys",r)&&n("values",r)&&n("items",r))),gi=di((({hasBasicElementProps:e,primitiveEq:t,hasMethod:n})=>r=>r instanceof ai.ArrayElement&&!(r instanceof ai.ObjectElement)||e(r)&&t("array",r)&&n("push",r)&&n("unshift",r)&&n("map",r)&&n("reduce",r)));di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ai.MemberElement||e(r)&&t("member",r)&&n(void 0,r))),di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ai.LinkElement||e(r)&&t("link",r)&&n(void 0,r))),di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ai.RefElement||e(r)&&t("ref",r)&&n(void 0,r))),di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof oi||e(r)&&t("annotation",r)&&n("array",r))),di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ci||e(r)&&t("comment",r)&&n("string",r))),di((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ui||e(r)&&t("parseResult",r)&&n("array",r)));class bi extends C{name="apidom";isArray(e){return gi(e)}isObject(e){return yi(e)}sizeOf(e){return this.isArray(e)||this.isObject(e)?e.length:0}has(e,t){if(this.isArray(e)){const n=Number(t),r=n>>>0;if(n!==r)throw new R(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return r<this.sizeOf(e)}if(this.isObject(e)){const n=e.keys(),r=new Set(n);if(n.length!==r.size)throw new z(`Object key "${t}" is not unique — JSON Pointer requires unique member names`,{referenceToken:t,currentValue:e,realm:this.name});return e.hasKey(t)}return!1}evaluate(e,t){return this.isArray(e)?e.get(Number(t)):e.get(t)}}e.ASTTranslator=y,e.CSTTranslator=m,e.Grammar=s,e.JSONPointerCompileError=N,e.JSONPointerError=h,e.JSONPointerEvaluateError=L,e.JSONPointerIndexError=R,e.JSONPointerKeyError=z,e.JSONPointerParseError=f,e.JSONPointerTypeError=V,e.JSONString=t,e.URIFragmentIdentifier=r,e.XMLTranslator=class extends m{getTree(){return this.toXml()}},e.compile=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 P(String(e))})).join("/")}`}catch(t){throw new N("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}},e.escape=P,e.evaluate=(e,t,n={})=>((e,t,{strictArrays:n=!0,strictObjects:r=!0,realm:s=new I,trace:i=!0}={})=>{const{result:a,tree:o,trace:c}=E(t,{trace:!!i}),u="object"==typeof i&&null!==i?new $(i,{jsonPointer:t,referenceTokens:o,strictArrays:n,strictObjects:r,realm:s,value:e}):null;try{let i;if(!a.success){let n=`Invalid JSON Pointer: "${t}". Syntax error at position ${a.maxMatched}`;throw n+=c?`, expected ${c.inferExpectations()}`:"",new L(n,{jsonPointer:t,currentValue:e,realm:s.name})}return o.reduce(((e,a,c)=>{if(s.isArray(e)){if(M(a)){if(n)throw new R(`Invalid array index "-" at position ${c} in "${t}". The "-" token always refers to a nonexistent element during evaluation`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,String(s.sizeOf(e))),null==u||u.step({referenceToken:a,input:e,output:i}),i}if(!_(a))throw new R(`Invalid array index "${a}" at position ${c} in "${t}": index MUST be "0", or digits without a leading "0"`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name});const r=Number(a);if(!Number.isSafeInteger(r))throw new R(`Invalid array index "${a}" at position ${c} in "${t}": index must be a safe integer`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name});if(!s.has(e,a)&&n)throw new R(`Invalid array index "${a}" at position ${c} in "${t}": index not found in array`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,a),null==u||u.step({referenceToken:a,input:e,output:i}),i}if(s.isObject(e)){if(!s.has(e,a)&&r)throw new z(`Invalid object key "${a}" at position ${c} in "${t}": key not found in object`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,a),null==u||u.step({referenceToken:a,input:e,output:i}),i}throw new V(`Invalid reference token "${a}" at position ${c} in "${t}": cannot be applied to a non-object/non-array value`,{jsonPointer:t,referenceTokens:o,referenceToken:a,referenceTokenPosition:c,currentValue:e,realm:s.name})}),e)}catch(e){if(null==u||u.step({referenceToken:e.referenceToken,input:e.currentValue,success:!1,reason:e.message}),e instanceof L)throw e;throw new L("Unexpected error during JSON Pointer evaluation",{cause:e,jsonPointer:t,referenceTokens:o})}})(e,t,{...n,realm:new bi}),e.parse=E,e.testArrayDash=M,e.testArrayIndex=_,e.testArrayLocation=e=>{if("string"!=typeof e)return!1;try{return A.parse(k,"array-location",e).success}catch{return!1}},e.testJSONPointer=e=>{try{return E(e,{translator:null}).result.success}catch{return!1}},e.testReferenceToken=e=>{if("string"!=typeof e)return!1;try{return T.parse(w,"reference-token",e).success}catch{return!1}},e.unescape=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-json-pointer",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Evaluate JSON Pointer expressions against ApiDOM.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "types": "./types/legacy/index.d.ts",
31
31
  "scripts": {
32
- "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
32
+ "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-6} typescript:declaration build:es build:cjs build:umd:browser",
33
33
  "build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
34
34
  "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
35
- "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
35
+ "build:umd:browser": "vite build",
36
36
  "lint": "eslint ./",
37
37
  "lint:fix": "eslint ./ --fix",
38
38
  "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
@@ -50,8 +50,8 @@
50
50
  "license": "Apache-2.0",
51
51
  "dependencies": {
52
52
  "@babel/runtime-corejs3": "^7.26.10",
53
- "@swagger-api/apidom-core": "^1.5.0",
54
- "@swagger-api/apidom-error": "^1.5.0",
53
+ "@swagger-api/apidom-core": "^1.5.1",
54
+ "@swagger-api/apidom-error": "^1.5.1",
55
55
  "@swaggerexpert/json-pointer": "^2.10.1"
56
56
  },
57
57
  "files": [
@@ -64,5 +64,5 @@
64
64
  "README.md",
65
65
  "CHANGELOG.md"
66
66
  ],
67
- "gitHead": "4bfa97c2350c1c3daa6a8a5ed002786f066b7729"
67
+ "gitHead": "103cc50a692501bc3101c2935a939c22c535471f"
68
68
  }