@blackglory/match 0.3.0 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/es2015/index.min.mjs +1 -8
  3. package/dist/es2015/index.min.mjs.map +1 -1
  4. package/dist/es2015/index.mjs +1731 -7791
  5. package/dist/es2015/index.mjs.map +1 -1
  6. package/dist/es2015/index.umd.js +1733 -7793
  7. package/dist/es2015/index.umd.js.map +1 -1
  8. package/dist/es2015/index.umd.min.js +1 -8
  9. package/dist/es2015/index.umd.min.js.map +1 -1
  10. package/dist/es2018/index.min.mjs +1 -8
  11. package/dist/es2018/index.min.mjs.map +1 -1
  12. package/dist/es2018/index.mjs +1731 -7791
  13. package/dist/es2018/index.mjs.map +1 -1
  14. package/dist/es2018/index.umd.js +1733 -7793
  15. package/dist/es2018/index.umd.js.map +1 -1
  16. package/dist/es2018/index.umd.min.js +1 -8
  17. package/dist/es2018/index.umd.min.js.map +1 -1
  18. package/lib/es2015/match-element.js +2 -2
  19. package/lib/es2015/match-element.js.map +1 -1
  20. package/lib/es2015/match.js +2 -2
  21. package/lib/es2015/match.js.map +1 -1
  22. package/lib/es2015/matchers/child-nodes.js +2 -2
  23. package/lib/es2015/matchers/child-nodes.js.map +1 -1
  24. package/lib/es2015/matchers/children.js +2 -2
  25. package/lib/es2015/matchers/children.js.map +1 -1
  26. package/lib/es2015/matchers/css.js +2 -2
  27. package/lib/es2015/matchers/css.js.map +1 -1
  28. package/lib/es2015/matchers/element.js +5 -5
  29. package/lib/es2015/matchers/element.js.map +1 -1
  30. package/lib/es2015/matchers/multiple.js +5 -5
  31. package/lib/es2015/matchers/multiple.js.map +1 -1
  32. package/lib/es2015/matchers/node.js +4 -4
  33. package/lib/es2015/matchers/node.js.map +1 -1
  34. package/lib/es2015/matchers/optional.js +1 -1
  35. package/lib/es2015/matchers/optional.js.map +1 -1
  36. package/lib/es2015/matchers/repeat.js +2 -2
  37. package/lib/es2015/matchers/repeat.js.map +1 -1
  38. package/lib/es2015/matchers/text-content-equals.js +1 -1
  39. package/lib/es2015/matchers/text-content-equals.js.map +1 -1
  40. package/lib/es2015/matchers/text-content-includes.js +1 -1
  41. package/lib/es2015/matchers/text-content-includes.js.map +1 -1
  42. package/lib/es2015/matchers/text-content-matches.js +1 -1
  43. package/lib/es2015/matchers/text-content-matches.js.map +1 -1
  44. package/lib/es2015/matchers/text-node.js +5 -5
  45. package/lib/es2015/matchers/text-node.js.map +1 -1
  46. package/lib/es2015/matchers/xpath.js +3 -3
  47. package/lib/es2015/matchers/xpath.js.map +1 -1
  48. package/lib/es2015/utils/match-multiple.js +1 -1
  49. package/lib/es2015/utils/match-multiple.js.map +1 -1
  50. package/lib/es2015/utils/match-one-by-one.js +3 -3
  51. package/lib/es2015/utils/match-one-by-one.js.map +1 -1
  52. package/lib/es2015/utils/merge.js +4 -3
  53. package/lib/es2015/utils/merge.js.map +1 -1
  54. package/lib/es2018/match-element.js +2 -2
  55. package/lib/es2018/match-element.js.map +1 -1
  56. package/lib/es2018/match.js +2 -2
  57. package/lib/es2018/match.js.map +1 -1
  58. package/lib/es2018/matchers/child-nodes.js +2 -2
  59. package/lib/es2018/matchers/child-nodes.js.map +1 -1
  60. package/lib/es2018/matchers/children.js +2 -2
  61. package/lib/es2018/matchers/children.js.map +1 -1
  62. package/lib/es2018/matchers/css.js +2 -2
  63. package/lib/es2018/matchers/css.js.map +1 -1
  64. package/lib/es2018/matchers/element.js +5 -5
  65. package/lib/es2018/matchers/element.js.map +1 -1
  66. package/lib/es2018/matchers/multiple.js +5 -5
  67. package/lib/es2018/matchers/multiple.js.map +1 -1
  68. package/lib/es2018/matchers/node.js +4 -4
  69. package/lib/es2018/matchers/node.js.map +1 -1
  70. package/lib/es2018/matchers/optional.js +1 -1
  71. package/lib/es2018/matchers/optional.js.map +1 -1
  72. package/lib/es2018/matchers/repeat.js +2 -2
  73. package/lib/es2018/matchers/repeat.js.map +1 -1
  74. package/lib/es2018/matchers/text-content-equals.js +1 -1
  75. package/lib/es2018/matchers/text-content-equals.js.map +1 -1
  76. package/lib/es2018/matchers/text-content-includes.js +1 -1
  77. package/lib/es2018/matchers/text-content-includes.js.map +1 -1
  78. package/lib/es2018/matchers/text-content-matches.js +1 -1
  79. package/lib/es2018/matchers/text-content-matches.js.map +1 -1
  80. package/lib/es2018/matchers/text-node.js +5 -5
  81. package/lib/es2018/matchers/text-node.js.map +1 -1
  82. package/lib/es2018/matchers/xpath.js +3 -3
  83. package/lib/es2018/matchers/xpath.js.map +1 -1
  84. package/lib/es2018/utils/match-multiple.js +1 -1
  85. package/lib/es2018/utils/match-multiple.js.map +1 -1
  86. package/lib/es2018/utils/match-one-by-one.js +3 -3
  87. package/lib/es2018/utils/match-one-by-one.js.map +1 -1
  88. package/lib/es2018/utils/merge.js +4 -3
  89. package/lib/es2018/utils/merge.js.map +1 -1
  90. package/package.json +24 -25
@@ -1,9 +1,2 @@
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).Match={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},n={},o={};function a(e){return e.cloneNode(!0)}o.copyNodesToChildNodes=o.cloneNodes=o.clone=void 0,o.clone=a,o.cloneNodes=function(e){return e.map((e=>a(e)))},o.copyNodesToChildNodes=function(e,t){e.forEach((e=>t.appendChild(e)))};var s={};s.removeAllChildren=void 0,s.removeAllChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},n.flatMap=void 0;const i=o,c=s;n.flatMap=function e(t,r){return i.cloneNodes(r(i.clone(t))).map((t=>{const n=[];for(const o of t.childNodes)n.push(...i.cloneNodes(e(o,r)));return c.removeAllChildren(t),i.copyNodesToChildNodes(n,t),t}))};var u={map:void 0};const l=o;u.map=function e(t,r){const n=l.clone(r(l.clone(t)));for(const t of n.childNodes)n.replaceChild(e(t,r),t);return n};var d={filter:void 0};const f=n;d.filter=function(e,t){const r=f.flatMap(e,(e=>t(e)?[e]:[]));if(1===r.length)return r[0]};var h={},m={},p={},y={},v={},g={};g.go=void 0,g.go=function(e){return e()},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]});(t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)})(g,e)}(v);var $={},b={CustomError:void 0};class w extends Error{get name(){return this.constructor.name}}b.CustomError=w;var _={ExpectedError:void 0};const E=b;class N extends E.CustomError{}_.ExpectedError=N;var S={AssertionError:void 0};const T=b;class P extends T.CustomError{}S.AssertionError=P;var O={};O.normalize=void 0,O.normalize=function(e){var t;return{name:e.name,message:e.message,stack:null!==(t=e.stack)&&void 0!==t?t:null}};var A={refute:void 0};const C=_;A.refute=function(e,t){if(e)throw new C.ExpectedError(t)};var k={assert:void 0};const D=S;k.assert=function(e,t){if(!e)throw new D.AssertionError(t)},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(b,e),n(_,e),n(S,e),n(O,e),n(A,e),n(k,e)}($),y.chunkAsync=void 0;const I=v,R=$;y.chunkAsync=function(e,t){return R.assert(Number.isInteger(t),"The parameter size must be an integer"),R.assert(t>0,"The parameter size must be greater than 0"),I.go((async function*(){let r=[];for await(const n of e)r.push(n),r.length>=t&&(yield r,r=[]);r.length&&(yield r)}))};var x={},j={},U={},M={};function q(e){return null===e}M.isntNull=M.isNull=void 0,M.isNull=q,M.isntNull=function(e){return!q(e)};var V={};function F(e){return void 0===e}V.isntUndefined=V.isUndefined=void 0,V.isUndefined=F,V.isntUndefined=function(e){return!F(e)},U.isntAsyncIterable=U.isAsyncIterable=void 0;const z=M,L=V;function K(e){return z.isntNull(e)&&L.isntUndefined(e)&&"function"==typeof e[Symbol.asyncIterator]}U.isAsyncIterable=K,U.isntAsyncIterable=function(e){return!K(e)};var B={};function J(e){return"boolean"==typeof e}B.isntBoolean=B.isBoolean=void 0,B.isBoolean=J,B.isntBoolean=function(e){return!J(e)};var H={},G={};function Y(e){return X(e)||W(e)}function X(e){return"string"==typeof e}function W(e){return"object"==typeof e&&e instanceof String}G.isntStringObject=G.isStringObject=G.isntStringPrimitive=G.isStringPrimitive=G.isntString=G.isString=void 0,G.isString=Y,G.isntString=function(e){return!Y(e)},G.isStringPrimitive=X,G.isntStringPrimitive=function(e){return!X(e)},G.isStringObject=W,G.isntStringObject=function(e){return!W(e)},H.isntCharObject=H.isCharObject=H.isntCharPrimitive=H.isCharPrimitive=H.isntChar=H.isChar=void 0;const Q=G;function Z(e){return(Q.isString(e)||Q.isStringObject(e))&&1===e.length}function ee(e){return Q.isString(e)&&1===e.length}function te(e){return Q.isStringObject(e)&&1===e.length}H.isChar=Z,H.isntChar=function(e){return!Z(e)},H.isCharPrimitive=ee,H.isntCharPrimitive=function(e){return!ee(e)},H.isCharObject=te,H.isntCharObject=function(e){return!te(e)};var re={};function ne(e){return e instanceof Date}re.isntDate=re.isDate=void 0,re.isDate=ne,re.isntDate=function(e){return!ne(e)};var oe={};function ae(e){return!e}oe.isntFalsy=oe.isFalsy=void 0,oe.isFalsy=ae,oe.isntFalsy=function(e){return!ae(e)};var se={};function ie(e){return"function"==typeof e}se.isntFunction=se.isFunction=void 0,se.isFunction=ie,se.isntFunction=function(e){return!ie(e)};var ce={};ce.isntIterable=ce.isIterable=void 0;const ue=M,le=V;function de(e){return ue.isntNull(e)&&le.isntUndefined(e)&&"function"==typeof e[Symbol.iterator]}ce.isIterable=de,ce.isntIterable=function(e){return!de(e)};var fe={},he={exports:{}},me={},pe={},ye={},ve={},ge={},$e={};!function(e){e.regexpCode=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let o=0;for(;o<t.length;)i(r,t[o]),r.push(e[++o]);return new n(r)}e._Code=n,e.nil=new n(""),e._=o;const a=new n("+");function s(e,...t){const r=[u(e[0])];let o=0;for(;o<t.length;)r.push(a),i(r,t[o]),r.push(a,u(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function i(e,t){var o;t instanceof n?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:u(Array.isArray(o)?o.join(","):o))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=i,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new n(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new n(`.${t}`):o`[${t}]`},e.regexpCode=function(e){return new n(e.toString())}}($e);var be={};!function(e){e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=$e;class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var n;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=o;class a extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${n}]`}}e.ValueScopeName=a;const s=t._`\n`;e.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(a);if(e)return e}else s=this._values[o]=new Map;s.set(a,n);const i=this._scope[o]||(this._scope[o]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,(r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(o,a,s={},i){let c=t.nil;for(const u in o){const l=o[u];if(!l)continue;const d=s[u]=s[u]||new Map;l.forEach((o=>{if(d.has(o))return;d.set(o,n.Started);let s=a(o);if(s){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${o} = ${s};${this.opts._n}`}else{if(!(s=null==i?void 0:i(o)))throw new r(o);c=t._`${c}${s}${this.opts._n}`}d.set(o,n.Completed)}))}return c}}}(be),function(e){e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=$e,r=be;var n=$e;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=be;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends i{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(C(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class m extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class p extends h{}class y extends m{}y.kind="else";class v extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(k(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}v.kind="if";class g extends m{}g.kind="for";class $ extends g{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class b extends g{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:o,to:a}=this;return`for(${t} ${n}=${o}; ${n}<${a}; ${n}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends g{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class _ extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class N extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class S extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}S.kind="catch";class T extends m{render(e){return"finally"+super.render(e)}}T.kind="finally";function P(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?P(e,r.names):e}function A(e,r,n){return e instanceof t.Name?a(e):(o=e)instanceof t._Code&&o._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=a(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var o;function a(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function k(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${x(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new p]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new s(e,o,r)),o}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new i(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){const r=["{"];for(const[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),t.addCodeArg(r,o));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(v,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new $(e),t)}forRange(e,t,n,o,a=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new b(a,s,t,n),(()=>o(s)))}forOf(e,n,o,a=r.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(s,t._`${e}[${r}]`),o(s)}))}return this._for(new w("of",a,s,n),(()=>o(s)))}forIn(e,n,o,a=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,o);const s=this._scope.toName(e);return this._for(new w("in",a,s,n),(()=>o(s)))}endFor(){return this._endBlockNode(g)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new l(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new N;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new S(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(S,T)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,o){return this._blockNode(new _(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=k;const D=R(e.operators.AND);e.and=function(...e){return e.reduce(D)};const I=R(e.operators.OR);function R(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${x(r)} ${e} ${x(n)}`}function x(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(I)}}(ge);var we={};!function(e){e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=ge,r=$e;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function i({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:o}){return(a,s,i,c)=>{const u=void 0===i?s:i instanceof t.Name?(s instanceof t.Name?e(a,s,i):r(a,s,i),i):s instanceof t.Name?(r(a,i,s),s):n(s,i);return c!==t.Name||u instanceof t.Name?u:o(a,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${t.getProperty(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!o(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=o,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,o,a){if(!a){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${t.getProperty(o)}`},e.unescapeFragment=function(e){return s(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(a(e))},e.escapeJsonPointer=a,e.unescapeJsonPointer=s,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:i({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:i({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const l={};var d;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:l[t.code]||(l[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const o=r===d.Num;return n?o?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:o?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?t.getProperty(e).toString():"/"+a(e)},e.checkStrictMode=f}(we);var _e={};const Ee=ge,Ne={data:new Ee.Name("data"),valCxt:new Ee.Name("valCxt"),instancePath:new Ee.Name("instancePath"),parentData:new Ee.Name("parentData"),parentDataProperty:new Ee.Name("parentDataProperty"),rootData:new Ee.Name("rootData"),dynamicAnchors:new Ee.Name("dynamicAnchors"),vErrors:new Ee.Name("vErrors"),errors:new Ee.Name("errors"),this:new Ee.Name("this"),self:new Ee.Name("self"),scope:new Ee.Name("scope"),json:new Ee.Name("json"),jsonPos:new Ee.Name("jsonPos"),jsonLen:new Ee.Name("jsonLen"),jsonPart:new Ee.Name("jsonPart")};_e.default=Ne,function(e){e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ge,r=we,n=_e;function o(e,r){const o=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${o}]`)),t._`${n.default.vErrors}.push(${o})`),e.code(t._`${n.default.errors}++`)}function a(e,r){const{gen:n,validateName:o,schemaEnv:a}=e;a.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${o}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`should pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,s,c){const{it:u}=r,{gen:l,compositeRule:d,allErrors:f}=u,h=i(r,n,s);(null!=c?c:d||f)?o(l,h):a(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){const{it:c}=t,{gen:u,compositeRule:l,allErrors:d}=c;o(u,i(t,r,s)),l||d||a(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:o,data:a,errsCount:s,it:i}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,n.default.errors,(s=>{e.const(c,t._`${n.default.vErrors}[${s}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,t.strConcat(n.default.instancePath,i.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${i.errSchemaPath}/${r}`),i.opts.verbose&&(e.assign(t._`${c}.schema`,o),e.assign(t._`${c}.data`,a))}))};const s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function i(e,r,o){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,r,o={}){const{gen:a,it:i}=e,l=[c(i,o),u(e,o)];return function(e,{params:r,message:o},a){const{keyword:i,data:c,schemaValue:u,it:l}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:m}=l;a.push([s.keyword,i],[s.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&a.push([s.message,"function"==typeof o?o(e):o]);d.verbose&&a.push([s.schema,u],[s.parentSchema,t._`${h}${m}`],[n.default.data,c]);f&&a.push([s.propertyName,f])}(e,r,l),a.object(...l)}(e,r,o)}function c({errorPath:e},{instancePath:o}){const a=o?t.str`${e}${r.getErrorPath(o,r.Type.Str)}`:e;return[n.default.instancePath,t.strConcat(n.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:o,parentSchema:a}){let i=a?n:t.str`${n}/${e}`;return o&&(i=t.str`${i}${r.getErrorPath(o,r.Type.Str)}`),[s.schemaPath,i]}}(ve),ye.boolOrEmptySchema=ye.topBoolOrEmptySchema=void 0;const Se=ve,Te=ge,Pe=_e,Oe={message:"boolean schema is false"};function Ae(e,t){const{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};Se.reportError(o,Oe,void 0,t)}ye.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Ae(e,!1):"object"==typeof r&&!0===r.$async?t.return(Pe.default.data):(t.assign(Te._`${n}.errors`,null),t.return(!0))},ye.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Ae(e)):r.var(t,!0)};var Ce={},ke={};ke.getRules=ke.isJSONType=void 0;const De=new Set(["string","number","integer","boolean","null","object","array"]);ke.isJSONType=function(e){return"string"==typeof e&&De.has(e)},ke.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}};var Ie={};function Re(e,t){return t.rules.some((t=>xe(e,t)))}function xe(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Ie.shouldUseRule=Ie.shouldUseGroup=Ie.schemaHasRulesForType=void 0,Ie.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&Re(e,n)},Ie.shouldUseGroup=Re,Ie.shouldUseRule=xe,function(e){e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=ke,r=Ie,n=ve,o=ge,a=we;var s;function i(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(s=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=i(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=i,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:a,opts:i}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&r.schemaHasRulesForType(e,t[0]));if(d){const r=l(t,a,i.strictNumbers,s.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:a,opts:s}=e,i=n.let("dataType",o._`typeof ${a}`),u=n.let("coerced",o._`undefined`);"array"===s.coerceTypes&&n.if(o._`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,o._`${a}[0]`).assign(i,o._`typeof ${a}`).if(l(t,a,s.strictNumbers),(()=>n.assign(u,a)))));n.if(o._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===s.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(o._`${i} == "number" || ${i} == "boolean"`).assign(u,o._`"" + ${a}`).elseIf(o._`${a} === null`).assign(u,o._`""`);case"number":return void n.elseIf(o._`${i} == "boolean" || ${a} === null
2
- || (${i} == "string" && ${a} && ${a} == +${a})`).assign(u,o._`+${a}`);case"integer":return void n.elseIf(o._`${i} === "boolean" || ${a} === null
3
- || (${i} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(u,o._`+${a}`);case"boolean":return void n.elseIf(o._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(u,!1).elseIf(o._`${a} === "true" || ${a} === 1`).assign(u,!0);case"null":return n.elseIf(o._`${a} === "" || ${a} === 0 || ${a} === false`),void n.assign(u,null);case"array":n.elseIf(o._`${i} === "string" || ${i} === "number"
4
- || ${i} === "boolean" || ${a} === null`).assign(u,o._`[${a}]`)}}n.else(),f(e),n.endIf(),n.if(o._`${u} !== undefined`,(()=>{n.assign(a,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):f(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=s.Correct){const a=n===s.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${a} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=c(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=c();break;default:return o._`typeof ${t} ${a} ${e}`}return n===s.Correct?i:o.not(i);function c(e=o.nil){return o.and(o._`typeof ${t} == "number"`,e,r?o._`isFinite(${t})`:o.nil)}}function l(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let s;const i=a.toHash(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;s=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=o.nil;i.number&&delete i.integer;for(const e in i)s=o.and(s,u(e,t,r,n));return s}e.checkDataType=u,e.checkDataTypes=l;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=a.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);n.reportError(t,d)}e.reportTypeError=f}(Ce);var je={assignDefaults:void 0};const Ue=ge,Me=we;function qe(e,t,r){const{gen:n,compositeRule:o,data:a,opts:s}=e;if(void 0===r)return;const i=Ue._`${a}${Ue.getProperty(t)}`;if(o)return void Me.checkStrictMode(e,`default is ignored for: ${i}`);let c=Ue._`${i} === undefined`;"empty"===s.useDefaults&&(c=Ue._`${c} || ${i} === null || ${i} === ""`),n.if(c,Ue._`${i} = ${Ue.stringify(r)}`)}je.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)qe(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>qe(e,r,t.default)))};var Ve={},Fe={};Fe.validateUnion=Fe.validateArray=Fe.usePattern=Fe.callValidateCode=Fe.schemaProperties=Fe.allSchemaProperties=Fe.noPropertyInData=Fe.propertyInData=Fe.isOwnProperty=Fe.hasPropFunc=Fe.reportMissingProp=Fe.checkMissingProp=Fe.checkReportMissingProp=void 0;const ze=ge,Le=we,Ke=_e;function Be(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:ze._`Object.prototype.hasOwnProperty`})}function Je(e,t,r){return ze._`${Be(e)}.call(${t}, ${r})`}function He(e,t,r,n){const o=ze._`${t}${ze.getProperty(r)} === undefined`;return n?ze.or(o,ze.not(Je(e,t,r))):o}function Ge(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}Fe.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:o}=e;r.if(He(r,n,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:ze._`${t}`},!0),e.error()}))},Fe.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,o){return ze.or(...n.map((n=>ze.and(He(e,t,n,r.ownProperties),ze._`${o} = ${n}`))))},Fe.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},Fe.hasPropFunc=Be,Fe.isOwnProperty=Je,Fe.propertyInData=function(e,t,r,n){const o=ze._`${t}${ze.getProperty(r)} !== undefined`;return n?ze._`${o} && ${Je(e,t,r)}`:o},Fe.noPropertyInData=He,Fe.allSchemaProperties=Ge,Fe.schemaProperties=function(e,t){return Ge(t).filter((r=>!Le.alwaysValidSchema(e,t[r])))},Fe.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:a},it:s},i,c,u){const l=u?ze._`${e}, ${t}, ${n}${o}`:t,d=[[Ke.default.instancePath,ze.strConcat(Ke.default.instancePath,a)],[Ke.default.parentData,s.parentData],[Ke.default.parentDataProperty,s.parentDataProperty],[Ke.default.rootData,Ke.default.rootData]];s.opts.dynamicRef&&d.push([Ke.default.dynamicAnchors,Ke.default.dynamicAnchors]);const f=ze._`${l}, ${r.object(...d)}`;return c!==ze.nil?ze._`${i}.call(${c}, ${f})`:ze._`${i}(${f})`},Fe.usePattern=function(e,t){return e.scopeValue("pattern",{key:t,ref:new RegExp(t,"u"),code:ze._`new RegExp(${t}, "u")`})},Fe.validateArray=function(e){const{gen:t,data:r,keyword:n,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return s((()=>t.assign(e,!1))),e}return t.var(a,!0),s((()=>t.break())),a;function s(o){const s=t.const("len",ze._`${r}.length`);t.forRange("i",0,s,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:Le.Type.Num},a),t.if(ze.not(a),o)}))}},Fe.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>Le.alwaysValidSchema(o,e)))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),s=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const i=e.subschema({keyword:n,schemaProp:o,compositeRule:!0},s);t.assign(a,ze._`${a} || ${s}`);e.mergeValidEvaluated(i,s)||t.if(ze.not(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))},Ve.validateKeywordUsage=Ve.validSchemaType=Ve.funcKeywordCode=Ve.macroKeywordCode=void 0;const Ye=ge,Xe=_e,We=Fe,Qe=ve;function Ze(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,Ye._`${n.parentData}[${n.parentDataProperty}]`)))}function et(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:Ye.stringify(r)})}Ve.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:o,parentSchema:a,it:s}=e,i=t.macro.call(s.self,o,a,s),c=et(r,n,i);!1!==s.opts.validateSchema&&s.self.validateSchema(i,!0);const u=r.name("valid");e.subschema({schema:i,schemaPath:Ye.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},Ve.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:o,schema:a,parentSchema:s,$data:i,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!i&&t.compile?t.compile.call(c.self,a,s,c):t.validate,l=et(n,o,u),d=n.let("valid");function f(r=(t.async?Ye._`await `:Ye.nil)){const o=c.opts.passContext?Xe.default.this:Xe.default.self,a=!("compile"in t&&!i||!1===t.schema);n.assign(d,Ye._`${r}${We.callValidateCode(e,l,o,a)}`,t.modifying)}function h(e){var r;n.if(Ye.not(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)f(),t.modifying&&Ze(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>f(Ye._`await `)),(t=>n.assign(d,!1).if(Ye._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,Ye._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=Ye._`${l}.errors`;return n.assign(e,null),f(Ye.nil),e}();t.modifying&&Ze(e),h((()=>function(e,t){const{gen:r}=e;r.if(Ye._`Array.isArray(${t})`,(()=>{r.assign(Xe.default.vErrors,Ye._`${Xe.default.vErrors} === null ? ${t} : ${Xe.default.vErrors}.concat(${t})`).assign(Xe.default.errors,Ye._`${Xe.default.vErrors}.length`),Qe.extendErrors(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},Ve.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},Ve.validateKeywordUsage=function({schema:e,opts:t,self:r},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");const a=n.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){const e="keyword value is invalid: "+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var tt={};tt.extendSubschemaMode=tt.extendSubschemaData=tt.getSubschema=void 0;const rt=ge,nt=we;tt.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:a,topSchemaRef:s}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:rt._`${e.schemaPath}${rt.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:rt._`${e.schemaPath}${rt.getProperty(t)}${rt.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${nt.escapeFragment(r)}`}}if(void 0!==n){if(void 0===o||void 0===a||void 0===s)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},tt.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:a,propertyName:s}){if(void 0!==o&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(void 0!==r){const{errorPath:o,dataPathArr:a,opts:s}=t;c(i.let("data",rt._`${t.data}${rt.getProperty(r)}`,!0)),e.errorPath=rt.str`${o}${nt.getErrorPath(r,n,s.jsPropertySyntax)}`,e.parentDataProperty=rt._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){c(o instanceof rt.Name?o:i.let("data",o,!0)),void 0!==s&&(e.propertyName=s)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}a&&(e.dataTypes=a)},tt.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:a}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r};var ot={},at=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var s=a[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r},st={exports:{}},it=st.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),ct(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function ct(e,t,r,n,o,a,s,i,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var l in t(n,o,a,s,i,c,u),n){var d=n[l];if(Array.isArray(d)){if(l in it.arrayKeywords)for(var f=0;f<d.length;f++)ct(e,t,r,d[f],o+"/"+l+"/"+f,a,o,l,n,f)}else if(l in it.propsKeywords){if(d&&"object"==typeof d)for(var h in d)ct(e,t,r,d[h],o+"/"+l+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,o,l,n,h)}else(l in it.keywords||e.allKeys&&!(l in it.skipKeywords))&&ct(e,t,r,d,o+"/"+l,a,o,l,n)}r(n,o,a,s,i,c,u)}}it.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},it.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},it.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},it.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};var ut={exports:{}};
5
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */!function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,o=1;o<n;++o)t[o]=t[o].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function s(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function i(e){var n="[A-Za-z]",o="[0-9]",a=t(o,"[A-Fa-f]"),s=r(r("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+r("%[89A-Fa-f]"+a+"%"+a+a)+"|"+r("%"+a+a)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");r(n+t(n,o,"[\\+\\-\\.]")+"*"),r(r(s+"|"+t(l,i,"[\\:]"))+"*");var d=r(r("25[0-5]")+"|"+r("2[0-4]"+o)+"|"+r("1"+o+o)+"|"+r("0?[1-9]"+o)+"|0?0?"+o),f=r(d+"\\."+d+"\\."+d+"\\."+d),h=r(a+"{1,4}"),m=r(r(h+"\\:"+h)+"|"+f),p=r(r(h+"\\:")+"{6}"+m),y=r("\\:\\:"+r(h+"\\:")+"{5}"+m),v=r(r(h)+"?\\:\\:"+r(h+"\\:")+"{4}"+m),g=r(r(r(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+r(h+"\\:")+"{3}"+m),$=r(r(r(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+r(h+"\\:")+"{2}"+m),b=r(r(r(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+m),w=r(r(r(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+m),_=r(r(r(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),E=r(r(r(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),N=r([p,y,v,g,$,b,w,_,E].join("|")),S=r(r(l+"|"+s)+"+");r("[vV]"+a+"+\\."+t(l,i,"[\\:]")+"+"),r(r(s+"|"+t(l,i))+"*");var T=r(s+"|"+t(l,i,"[\\:\\@]"));return r(r(s+"|"+t(l,i,"[\\@]"))+"+"),r(r(T+"|"+t("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(t("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,i),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+N+")"+r(r("\\%25|\\%(?!"+a+"{2})")+"("+S+")")+"?\\]?$")}}var c=i(!1),u=i(!0),l=function(){function e(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(o)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},f=2147483647,h=36,m=1,p=26,y=38,v=700,g=72,$=128,b="-",w=/^xn--/,_=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=h-m,T=Math.floor,P=String.fromCharCode;function O(e){throw new RangeError(N[e])}function A(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function C(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(E,".")).split("."),t).join(".")}function k(e){for(var t=[],r=0,n=e.length;r<n;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),r--)}else t.push(o)}return t}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},I=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},R=function(e,t,r){var n=0;for(e=r?T(e/v):e>>1,e+=T(e/t);e>S*p>>1;n+=h)e=T(e/S);return T(n+(S+1)*e/(e+y))},x=function(e){var t=[],r=e.length,n=0,o=$,a=g,s=e.lastIndexOf(b);s<0&&(s=0);for(var i=0;i<s;++i)e.charCodeAt(i)>=128&&O("not-basic"),t.push(e.charCodeAt(i));for(var c=s>0?s+1:0;c<r;){for(var u=n,l=1,d=h;;d+=h){c>=r&&O("invalid-input");var y=D(e.charCodeAt(c++));(y>=h||y>T((f-n)/l))&&O("overflow"),n+=y*l;var v=d<=a?m:d>=a+p?p:d-a;if(y<v)break;var w=h-v;l>T(f/w)&&O("overflow"),l*=w}var _=t.length+1;a=R(n-u,_,0==u),T(n/_)>f-o&&O("overflow"),o+=T(n/_),n%=_,t.splice(n++,0,o)}return String.fromCodePoint.apply(String,t)},j=function(e){var t=[],r=(e=k(e)).length,n=$,o=0,a=g,s=!0,i=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var d=u.value;d<128&&t.push(P(d))}}catch(e){i=!0,c=e}finally{try{!s&&l.return&&l.return()}finally{if(i)throw c}}var y=t.length,v=y;for(y&&t.push(b);v<r;){var w=f,_=!0,E=!1,N=void 0;try{for(var S,A=e[Symbol.iterator]();!(_=(S=A.next()).done);_=!0){var C=S.value;C>=n&&C<w&&(w=C)}}catch(e){E=!0,N=e}finally{try{!_&&A.return&&A.return()}finally{if(E)throw N}}var D=v+1;w-n>T((f-o)/D)&&O("overflow"),o+=(w-n)*D,n=w;var x=!0,j=!1,U=void 0;try{for(var M,q=e[Symbol.iterator]();!(x=(M=q.next()).done);x=!0){var V=M.value;if(V<n&&++o>f&&O("overflow"),V==n){for(var F=o,z=h;;z+=h){var L=z<=a?m:z>=a+p?p:z-a;if(F<L)break;var K=F-L,B=h-L;t.push(P(I(L+K%B,0))),F=T(K/B)}t.push(P(I(F,0))),a=R(o,D,v==y),o=0,++v}}}catch(e){j=!0,U=e}finally{try{!x&&q.return&&q.return()}finally{if(j)throw U}}++o,++n}return t.join("")},U=function(e){return C(e,(function(e){return w.test(e)?x(e.slice(4).toLowerCase()):e}))},M=function(e){return C(e,(function(e){return _.test(e)?"xn--"+j(e):e}))},q={version:"2.1.0",ucs2:{decode:k,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:x,encode:j,toASCII:M,toUnicode:U},V={};function F(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function z(e){for(var t="",r=0,n=e.length;r<n;){var o=parseInt(e.substr(r+1,2),16);if(o<128)t+=String.fromCharCode(o),r+=3;else if(o>=194&&o<224){if(n-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&o)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(o>=224){if(n-r>=9){var s=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function L(e,t){function r(e){var r=z(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,F).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,F).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,F).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,F).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,F).replace(t.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function B(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(K).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=l(r,3),o=n[1],a=n[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),i=l(s,2),c=i[0],u=i[1],d=u?u.split(":").map(K):[],f=c.split(":").map(K),h=t.IPV4ADDRESS.test(f[f.length-1]),m=h?7:8,p=f.length-m,y=Array(m),v=0;v<m;++v)y[v]=d[v]||f[p+v]||"";h&&(y[m-1]=B(y[m-1],t));var g=y.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],$=void 0;if(g&&g.length>1){var b=y.slice(0,g.index),w=y.slice(g.index+g.length);$=b.join(":")+"::"+w.join(":")}else $=y.join(":");return a&&($+="%"+a),$}return e}var H=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(H);if(o){G?(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5])):(r.scheme=o[1]||void 0,r.userinfo=-1!==e.indexOf("@")?o[3]:void 0,r.host=-1!==e.indexOf("//")?o[4]:void 0,r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=-1!==e.indexOf("?")?o[7]:void 0,r.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),r.host&&(r.host=J(B(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=V[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)L(r,n);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=q.toASCII(r.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}L(r,c)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function X(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(B(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var W=/^\.\.?\//,Q=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(W))e=e.replace(W,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],o=V[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(r.PCT_ENCODED,z).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}L(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=X(e,t);if(void 0!==a&&("suffix"!==t.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||o&&o.absolutePath||(s=te(s)),void 0===a&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=Y(re(e,r),r),t=Y(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function oe(e,t,r){var n=s({scheme:"null"},r);return re(ne(Y(e,n),Y(t,n),n,!0),n)}function ae(e,t){return"string"==typeof e?e=re(Y(e,t),t):"object"===n(e)&&(e=Y(re(e,t),t)),e}function se(e,t,r){return"string"==typeof e?e=re(Y(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(Y(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function ie(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,F)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=l(r,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},me={},pe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",ve=r(r("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+r("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+r("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",$e=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),be="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",we=new RegExp(pe,"g"),_e=new RegExp(ve,"g"),Ee=new RegExp(t("[^]",ge,"[\\.]",'[\\"]',$e),"g"),Ne=new RegExp(t("[^]",pe,be),"g"),Se=Ne;function Te(e){var t=z(e);return t.match(we)?t:e}var Pe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var o=!1,a={},s=r.query.split("&"),i=0,c=s.length;i<c;++i){var u=s[i].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),d=0,f=l.length;d<f;++d)n.push(l[d]);break;case"subject":r.subject=ce(u[1],t);break;case"body":r.body=ce(u[1],t);break;default:o=!0,a[ce(u[0],t)]=ce(u[1],t)}}o&&(r.headers=a)}r.query=void 0;for(var h=0,m=n.length;h<m;++h){var p=n[h].split("@");if(p[0]=ce(p[0]),t.unicodeSupport)p[1]=ce(p[1],t).toLowerCase();else try{p[1]=q.toASCII(ce(p[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=p.join("@")}return r},serialize:function(e,t){var r=e,n=a(e.to);if(n){for(var s=0,i=n.length;s<i;++s){var c=String(n[s]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(_e,Te).replace(_e,o).replace(Ee,F),d=c.slice(u+1);try{d=t.iri?q.toUnicode(d):q.toASCII(ce(d,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[s]=l+"@"+d}r.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var m in f)f[m]!==me[m]&&h.push(m.replace(_e,Te).replace(_e,o).replace(Ne,F)+"="+f[m].replace(_e,Te).replace(_e,o).replace(Se,F));return h.length&&(r.query=h.join("&")),r}},Oe=/^([^\:]+)\:(.*)/,Ae={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(Oe),n=e;if(r){var o=t.scheme||n.scheme||"urn",a=r[1].toLowerCase(),s=r[2],i=o+":"+(t.nid||a),c=V[i];n.nid=a,n.nss=s,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,o=r+":"+(t.nid||n),a=V[o];a&&(e=a.serialize(e,t));var s=e,i=e.nss;return s.path=(n||t.nid)+":"+i,s}},Ce=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ke={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(Ce)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};V[ue.scheme]=ue,V[le.scheme]=le,V[fe.scheme]=fe,V[he.scheme]=he,V[Pe.scheme]=Pe,V[Ae.scheme]=Ae,V[ke.scheme]=ke,e.SCHEMES=V,e.pctEncChar=F,e.pctDecChars=z,e.parse=Y,e.removeDotSegments=te,e.serialize=re,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=se,e.escapeComponent=ie,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,ut.exports),ot.getSchemaRefs=ot.resolveUrl=ot.normalizeId=ot._getFullPath=ot.getFullPath=ot.inlineRef=void 0;const lt=we,dt=at,ft=st.exports,ht=ut.exports,mt=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);ot.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!yt(e):!!t&&vt(e)<=t)};const pt=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function yt(e){for(const t in e){if(pt.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(yt))return!0;if("object"==typeof r&&yt(r))return!0}return!1}function vt(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!mt.has(r)&&("object"==typeof e[r]&&lt.eachItem(e[r],(e=>t+=vt(e))),t===1/0))return 1/0}return t}function gt(e="",t){!1!==t&&(e=wt(e));return $t(ht.parse(e))}function $t(e){return ht.serialize(e).split("#")[0]+"#"}ot.getFullPath=gt,ot._getFullPath=$t;const bt=/#\/?$/;function wt(e){return e?e.replace(bt,""):""}ot.normalizeId=wt,ot.resolveUrl=function(e,t){return t=wt(t),ht.resolve(e,t)};const _t=/^[a-z_][-a-z0-9._]*$/i;ot.getSchemaRefs=function(e){if("boolean"==typeof e)return{};const t=wt(e.$id),r={"":t},n=gt(t,!1),o={},a=new Set;return ft(e,{allKeys:!0},((e,t,c,u)=>{if(void 0===u)return;const l=n+t;let d=r[u];function f(t){if(t=wt(d?ht.resolve(d,t):t),a.has(t))throw i(t);a.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?s(e,r.schema,t):t!==wt(l)&&("#"===t[0]?(s(e,o[t],t),o[t]=e):this.refs[t]=l),t}function h(e){if("string"==typeof e){if(!_t.test(e))throw new Error(`invalid anchor "${e}"`);f.call(this,`#${e}`)}}"string"==typeof e.$id&&(d=f.call(this,e.$id)),h.call(this,e.$anchor),h.call(this,e.$dynamicAnchor),r[t]=d})),o;function s(e,t,r){if(void 0!==t&&!dt(e,t))throw i(r)}function i(e){return new Error(`reference "${e}" resolves to more than one schema`)}},pe.getData=pe.KeywordCxt=pe.validateFunctionCode=void 0;const Et=ye,Nt=Ce,St=Ie,Tt=Ce,Pt=je,Ot=Ve,At=tt,Ct=ge,kt=_e,Dt=ot,It=we,Rt=ve;function xt({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},a){o.code.es5?e.func(t,Ct._`${kt.default.data}, ${kt.default.valCxt}`,n.$async,(()=>{e.code(Ct._`"use strict"; ${jt(r,o)}`),function(e,t){e.if(kt.default.valCxt,(()=>{e.var(kt.default.instancePath,Ct._`${kt.default.valCxt}.${kt.default.instancePath}`),e.var(kt.default.parentData,Ct._`${kt.default.valCxt}.${kt.default.parentData}`),e.var(kt.default.parentDataProperty,Ct._`${kt.default.valCxt}.${kt.default.parentDataProperty}`),e.var(kt.default.rootData,Ct._`${kt.default.valCxt}.${kt.default.rootData}`),t.dynamicRef&&e.var(kt.default.dynamicAnchors,Ct._`${kt.default.valCxt}.${kt.default.dynamicAnchors}`)}),(()=>{e.var(kt.default.instancePath,Ct._`""`),e.var(kt.default.parentData,Ct._`undefined`),e.var(kt.default.parentDataProperty,Ct._`undefined`),e.var(kt.default.rootData,kt.default.data),t.dynamicRef&&e.var(kt.default.dynamicAnchors,Ct._`{}`)}))}(e,o),e.code(a)})):e.func(t,Ct._`${kt.default.data}, ${function(e){return Ct._`{${kt.default.instancePath}="", ${kt.default.parentData}, ${kt.default.parentDataProperty}, ${kt.default.rootData}=${kt.default.data}${e.dynamicRef?Ct._`, ${kt.default.dynamicAnchors}={}`:Ct.nil}}={}`}(o)}`,n.$async,(()=>e.code(jt(r,o)).code(a)))}function jt(e,t){return"object"==typeof e&&e.$id&&(t.code.source||t.code.process)?Ct._`/*# sourceURL=${e.$id} */`:Ct.nil}function Ut(e,t){qt(e)&&(Vt(e),Mt(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&zt(e);(function(e){e.schema.$id&&(e.baseId=Dt.resolveUrl(e.baseId,e.schema.$id))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const a=n.const("_errs",kt.default.errors);Ft(e,a),n.var(t,Ct._`${a} === ${kt.default.errors}`)}(e,t):Et.boolOrEmptySchema(e,t)}function Mt({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function qt(e){return"boolean"!=typeof e.schema}function Vt(e){It.checkUnknownRules(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&It.schemaHasRulesButRef(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function Ft(e,t){if(e.opts.jtd)return Lt(e,[],!1,t);const r=Nt.getSchemaTypes(e.schema);Lt(e,r,!Nt.coerceAndCheckDataType(e,r),t)}function zt({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const a=r.$comment;if(!0===o.$comment)e.code(Ct._`${kt.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const r=Ct.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(Ct._`${kt.default.self}.opts.$comment(${a}, ${r}, ${o}.schema)`)}}function Lt(e,t,r,n){const{gen:o,schema:a,data:s,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;function d(u){St.shouldUseGroup(a,u)&&(u.type?(o.if(Tt.checkDataType(u.type,s,c.strictNumbers)),Kt(e,u),1===t.length&&t[0]===u.type&&r&&(o.else(),Tt.reportTypeError(e)),o.endIf()):Kt(e,u),i||o.if(Ct._`${kt.default.errors} === ${n||0}`))}!a.$ref||!c.ignoreKeywordsWithRef&&It.schemaHasRulesButRef(a,l)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{Jt(e.dataTypes,t)||Ht(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>Jt(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&Ht(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&St.shouldUseRule(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>Bt(t,e)))&&Ht(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),o.block((()=>{for(const e of l.rules)d(e);d(l.post)}))):o.block((()=>Yt(e,"$ref",l.all.$ref.definition)))}function Kt(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&Pt.assignDefaults(e,t.type),r.block((()=>{for(const r of t.rules)St.shouldUseRule(n,r)&&Yt(e,r.keyword,r.definition,t.type)}))}function Bt(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function Jt(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function Ht(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,It.checkStrictMode(e,t,e.opts.strictTypes)}pe.validateFunctionCode=function(e){qt(e)&&(Vt(e),Mt(e))?function(e){const{schema:t,opts:r,gen:n}=e;xt(e,(()=>{r.$comment&&t.$comment&&zt(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&It.checkStrictMode(e,"default is ignored in the schema root")}(e),n.let(kt.default.vErrors,null),n.let(kt.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Ct._`${r}.evaluated`),t.if(Ct._`${e.evaluated}.dynamicProps`,(()=>t.assign(Ct._`${e.evaluated}.props`,Ct._`undefined`))),t.if(Ct._`${e.evaluated}.dynamicItems`,(()=>t.assign(Ct._`${e.evaluated}.items`,Ct._`undefined`)))}(e),Ft(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:a}=e;r.$async?t.if(Ct._`${kt.default.errors} === 0`,(()=>t.return(kt.default.data)),(()=>t.throw(Ct._`new ${o}(${kt.default.vErrors})`))):(t.assign(Ct._`${n}.errors`,kt.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof Ct.Name&&e.assign(Ct._`${t}.props`,r);n instanceof Ct.Name&&e.assign(Ct._`${t}.items`,n)}(e),t.return(Ct._`${kt.default.errors} === 0`))}(e)}))}(e):xt(e,(()=>Et.topBoolOrEmptySchema(e)))};class Gt{constructor(e,t,r){if(Ot.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=It.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Qt(this.$data,e));else if(this.schemaCode=this.schemaValue,!Ot.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",kt.default.errors))}result(e,t,r){this.gen.if(Ct.not(e)),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.result(e,void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(Ct._`${t} !== undefined && (${Ct.or(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?Rt.reportExtraError:Rt.reportError)(this,this.def.error,t)}$dataError(){Rt.reportError(this,this.def.$dataError||Rt.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');Rt.resetErrorsCount(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=Ct.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=Ct.nil,t=Ct.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:a}=this;r.if(Ct.or(Ct._`${n} === undefined`,t)),e!==Ct.nil&&r.assign(e,!0),(o.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Ct.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return Ct.or(function(){if(r.length){if(!(t instanceof Ct.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Ct._`${Tt.checkDataTypes(e,t,o.opts.strictNumbers,Tt.DataType.Wrong)}`}return Ct.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return Ct._`!${r}(${t})`}return Ct.nil}())}subschema(e,t){const r=At.getSubschema(this.it,e);At.extendSubschemaData(r,this.it,e),At.extendSubschemaMode(r,e);const n={...this.it,...r,items:void 0,props:void 0};return Ut(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=It.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=It.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,Ct.Name))),!0}}function Yt(e,t,r,n){const o=new Gt(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?Ot.funcKeywordCode(o,r):"macro"in r?Ot.macroKeywordCode(o,r):(r.compile||r.validate)&&Ot.funcKeywordCode(o,r)}pe.KeywordCxt=Gt;const Xt=/^\/(?:[^~]|~0|~1)*$/,Wt=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Qt(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,a;if(""===e)return kt.default.rootData;if("/"===e[0]){if(!Xt.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=kt.default.rootData}else{const s=Wt.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+s[1];if(o=s[2],"#"===o){if(i>=t)throw new Error(c("property/index",i));return n[t-i]}if(i>t)throw new Error(c("data",i));if(a=r[t-i],!o)return a}let s=a;const i=o.split("/");for(const e of i)e&&(a=Ct._`${a}${Ct.getProperty(It.unescapeJsonPointer(e))}`,s=Ct._`${s} && ${a}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}pe.getData=Qt;var Zt={};class er extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Zt.default=er;var tr={};const rr=ot;class nr extends Error{constructor(e,t,r){super(r||`can't resolve reference ${t} from id ${e}`),this.missingRef=rr.resolveUrl(e,t),this.missingSchema=rr.normalizeId(rr.getFullPath(this.missingRef))}}tr.default=nr;var or={};or.resolveSchema=or.getCompilingSchema=or.resolveRef=or.compileSchema=or.SchemaEnv=void 0;const ar=ge,sr=Zt,ir=_e,cr=ot,ur=we,lr=pe,dr=ut.exports;class fr{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:cr.normalizeId(null==r?void 0:r.$id),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function hr(e){const t=pr.call(this,e);if(t)return t;const r=cr.getFullPath(e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:a}=this.opts,s=new ar.CodeGen(this.scope,{es5:n,lines:o,ownProperties:a});let i;e.$async&&(i=s.scopeValue("Error",{ref:sr.default,code:ar._`require("ajv/dist/runtime/validation_error").default`}));const c=s.scopeName("validate");e.validateName=c;const u={gen:s,allErrors:this.opts.allErrors,data:ir.default.data,parentData:ir.default.parentData,parentDataProperty:ir.default.parentDataProperty,dataNames:[ir.default.data],dataPathArr:[ar.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:ar.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ar.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:ar._`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e),lr.validateFunctionCode(u),s.optimize(this.opts.code.optimize);const t=s.toString();l=`${s.scopeRefs(ir.default.scope)}return ${t}`,this.opts.code.process&&(l=this.opts.code.process(l,e));const r=new Function(`${ir.default.self}`,`${ir.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof ar.Name?void 0:e,items:t instanceof ar.Name?void 0:t,dynamicProps:e instanceof ar.Name,dynamicItems:t instanceof ar.Name},r.source&&(r.source.evaluated=ar.stringify(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),t}finally{this._compilations.delete(e)}}function mr(e){return cr.inlineRef(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:hr.call(this,e)}function pr(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function yr(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||vr.call(this,e,t)}function vr(e,t){const r=dr.parse(t),n=cr._getFullPath(r);let o=cr.getFullPath(e.baseId);if(Object.keys(e.schema).length>0&&n===o)return $r.call(this,r,e);const a=cr.normalizeId(n),s=this.refs[a]||this.schemas[a];if("string"==typeof s){const t=vr.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return $r.call(this,r,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||hr.call(this,s),a===cr.normalizeId(t)){const{schema:t}=s;return t.$id&&(o=cr.resolveUrl(o,t.$id)),new fr({schema:t,root:e,baseId:o})}return $r.call(this,r,s)}}or.SchemaEnv=fr,or.compileSchema=hr,or.resolveRef=function(e,t,r){var n;r=cr.resolveUrl(t,r);const o=e.refs[r];if(o)return o;let a=yr.call(this,e,r);if(void 0===a){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r];o&&(a=new fr({schema:o,root:e,baseId:t}))}return void 0!==a?e.refs[r]=mr.call(this,a):void 0},or.getCompilingSchema=pr,or.resolveSchema=vr;const gr=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $r(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;if(void 0===(r=r[ur.unescapeFragment(n)]))return;!gr.has(n)&&"object"==typeof r&&r.$id&&(t=cr.resolveUrl(t,r.$id))}let a;if("boolean"!=typeof r&&r.$ref&&!ur.schemaHasRulesButRef(r,this.RULES)){const e=cr.resolveUrl(t,r.$ref);a=vr.call(this,n,e)}return a=a||new fr({schema:r,root:n,baseId:t}),a.schema!==a.root.schema?a:void 0}var br={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};!function(e){e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=pe;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ge;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Zt,o=tr,a=ke,s=or,i=ge,c=ot,u=Ce,l=we,d=br,f=["removeAdditional","useDefaults","coerceTypes"],h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),m={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",schemaId:"JSON Schema draft-04 is not supported in Ajv v7/8.",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now, see option `strict`."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,r,n,o,a,s,i,c,u,l,d,f,h,m,p,y,v,g,$;const b=e.strict,w=null===(t=e.code)||void 0===t?void 0:t.optimize,_=!0===w||void 0===w?1:w||0;return{strictSchema:null===(n=null!==(r=e.strictSchema)&&void 0!==r?r:b)||void 0===n||n,strictNumbers:null===(a=null!==(o=e.strictNumbers)&&void 0!==o?o:b)||void 0===a||a,strictTypes:null!==(i=null!==(s=e.strictTypes)&&void 0!==s?s:b)&&void 0!==i?i:"log",strictTuples:null!==(u=null!==(c=e.strictTuples)&&void 0!==c?c:b)&&void 0!==u?u:"log",strictRequired:null!==(d=null!==(l=e.strictRequired)&&void 0!==l?l:b)&&void 0!==d&&d,code:e.code?{...e.code,optimize:_}:{optimize:_},loopRequired:null!==(f=e.loopRequired)&&void 0!==f?f:200,loopEnum:null!==(h=e.loopEnum)&&void 0!==h?h:200,meta:null===(m=e.meta)||void 0===m||m,messages:null===(p=e.messages)||void 0===p||p,inlineRefs:null===(y=e.inlineRefs)||void 0===y||y,addUsedSchema:null===(v=e.addUsedSchema)||void 0===v||v,validateSchema:null===(g=e.validateSchema)||void 0===g||g,validateFormats:null===($=e.validateFormats)||void 0===$||$}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:h,es5:t,lines:r}),this.logger=function(e){if(!1===e)return N;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=a.getRules(),g.call(this,m,e,"NOT SUPPORTED"),g.call(this,p,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),b.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t}=this.opts;t&&e&&this.addMetaSchema(d,d.$id,!1)}defaultMeta(){const{meta:e}=this.opts;return this.opts.defaultMeta="object"==typeof e?e.$id||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await a.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function a(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),s.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await a.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e&&(o=e.$id,void 0!==o&&"string"!=typeof o))throw new Error("schema $id must be string");return t=c.normalizeId(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){const r=new s.SchemaEnv({schema:{}});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e.$id;return r&&(r=c.normalizeId(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return l.eachItem(r,(e=>P.call(this,e))),this;A.call(this,t);const n={...t,type:u.getJSONTypes(t.type),schemaType:u.getJSONTypes(t.schemaType)};return l.eachItem(r,0===n.type.length?e=>P.call(this,e,n):e=>n.type.forEach((t=>P.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,a=o[e];n&&a&&(o[e]=k(a))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;if("object"==typeof e)a=e.$id;else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;const u=c.getSchemaRefs.call(this,e);return r=c.normalizeId(a||r),i=new s.SchemaEnv({schema:e,meta:t,baseId:r,localRefs:u}),this._cache.set(i.schema,i),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),n&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}function g(e,t,r,n="error"){for(const o in e){const a=o;a in t&&this.logger[n](`${r}: option ${o}. ${e[a]}`)}}function $(e){return e=c.normalizeId(e),this.schemas[e]||this.refs[e]}function b(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function w(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function E(){const e={...this.opts};for(const t of f)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=o.default;const N={log(){},warn(){},error(){}};const S=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if(l.eachItem(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!S.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let s=o?a.post:a.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:u.getJSONTypes(t.type),schemaType:u.getJSONTypes(t.schemaType)}};t.before?O.call(this,s,i,t.before):s.rules.push(i),a.all[e]=i,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function O(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function A(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=k(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function k(e){return{anyOf:[e,C]}}}(me);var wr={},_r={},Er={};const Nr={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Er.default=Nr;var Sr={};Sr.callRef=Sr.getValidate=void 0;const Tr=tr,Pr=Fe,Or=ge,Ar=_e,Cr=or,kr=we,Dr={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:a,validateName:s,opts:i,self:c}=n,{root:u}=a;if(("#"===r||"#/"===r)&&o===u.baseId)return function(){if(a===u)return Rr(e,s,a,a.$async);const r=t.scopeValue("root",{ref:u});return Rr(e,Or._`${r}.validate`,u,u.$async)}();const l=Cr.resolveRef.call(c,u,o,r);if(void 0===l)throw new Tr.default(o,r);return l instanceof Cr.SchemaEnv?function(t){const r=Ir(e,t);Rr(e,r,t,t.$async)}(l):function(n){const o=t.scopeValue("schema",!0===i.code.source?{ref:n,code:Or.stringify(n)}:{ref:n}),a=t.name("valid"),s=e.subschema({schema:n,dataTypes:[],schemaPath:Or.nil,topSchemaRef:o,errSchemaPath:r},a);e.mergeEvaluated(s),e.ok(a)}(l)}};function Ir(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Or._`${r.scopeValue("wrapper",{ref:t})}.validate`}function Rr(e,t,r,n){const{gen:o,it:a}=e,{allErrors:s,schemaEnv:i,opts:c}=a,u=c.passContext?Ar.default.this:Or.nil;function l(e){const t=Or._`${e}.errors`;o.assign(Ar.default.vErrors,Or._`${Ar.default.vErrors} === null ? ${t} : ${Ar.default.vErrors}.concat(${t})`),o.assign(Ar.default.errors,Or._`${Ar.default.vErrors}.length`)}function d(e){var t;if(!a.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==a.props)if(n&&!n.dynamicProps)void 0!==n.props&&(a.props=kr.mergeEvaluated.props(o,n.props,a.props));else{const t=o.var("props",Or._`${e}.evaluated.props`);a.props=kr.mergeEvaluated.props(o,t,a.props,Or.Name)}if(!0!==a.items)if(n&&!n.dynamicItems)void 0!==n.items&&(a.items=kr.mergeEvaluated.items(o,n.items,a.items));else{const t=o.var("items",Or._`${e}.evaluated.items`);a.items=kr.mergeEvaluated.items(o,t,a.items,Or.Name)}}n?function(){if(!i.$async)throw new Error("async schema referenced by sync schema");const r=o.let("valid");o.try((()=>{o.code(Or._`await ${Pr.callValidateCode(e,t,u)}`),d(t),s||o.assign(r,!0)}),(e=>{o.if(Or._`!(${e} instanceof ${a.ValidationError})`,(()=>o.throw(e))),l(e),s||o.assign(r,!1)})),e.ok(r)}():e.result(Pr.callValidateCode(e,t,u),(()=>d(t)),(()=>l(t)))}Sr.getValidate=Ir,Sr.callRef=Rr,Sr.default=Dr;const xr=Sr,jr=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Er.default,xr.default];_r.default=jr;var Ur={},Mr={};const qr=ge,Vr=qr.operators,Fr={maximum:{okStr:"<=",ok:Vr.LTE,fail:Vr.GT},minimum:{okStr:">=",ok:Vr.GTE,fail:Vr.LT},exclusiveMaximum:{okStr:"<",ok:Vr.LT,fail:Vr.GTE},exclusiveMinimum:{okStr:">",ok:Vr.GT,fail:Vr.LTE}},zr={message:({keyword:e,schemaCode:t})=>qr.str`must be ${Fr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>qr._`{comparison: ${Fr[e].okStr}, limit: ${t}}`},Lr={keyword:Object.keys(Fr),type:"number",schemaType:"number",$data:!0,error:zr,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(qr._`${r} ${Fr[t].fail} ${n} || isNaN(${r})`)}};Mr.default=Lr;var Kr={};const Br=ge,Jr={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>Br.str`must be multiple of ${e}`,params:({schemaCode:e})=>Br._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:o}=e,a=o.opts.multipleOfPrecision,s=t.let("res"),i=a?Br._`Math.abs(Math.round(${s}) - ${s}) > 1e-${a}`:Br._`${s} !== parseInt(${s})`;e.fail$data(Br._`(${n} === 0 || (${s} = ${r}/${n}, ${i}))`)}};Kr.default=Jr;var Hr={},Gr={};function Yr(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Gr.default=Yr,Yr.code='require("ajv/dist/runtime/ucs2length").default';const Xr=ge,Wr=we,Qr=Gr,Zr={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>Xr.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Xr._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n,it:o}=e,a="maxLength"===t?Xr.operators.GT:Xr.operators.LT,s=!1===o.opts.unicode?Xr._`${r}.length`:Xr._`${Wr.useFunc(e.gen,Qr.default)}(${r})`;e.fail$data(Xr._`${s} ${a} ${n}`)}};Hr.default=Zr;var en={};const tn=Fe,rn=ge,nn={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>rn.str`must match pattern "${e}"`,params:({schemaCode:e})=>rn._`{pattern: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:a}=e,s=n?rn._`(new RegExp(${a}, "u"))`:tn.usePattern(t,o);e.fail$data(rn._`!${s}.test(${r})`)}};en.default=nn;var on={};const an=ge,sn={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>an.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>an._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n}=e,o="maxProperties"===t?an.operators.GT:an.operators.LT;e.fail$data(an._`Object.keys(${r}).length ${o} ${n}`)}};on.default=sn;var cn={};const un=Fe,ln=ge,dn=we,fn={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>ln.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>ln._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:o,$data:a,it:s}=e,{opts:i}=s;if(!a&&0===r.length)return;const c=r.length>=i.loopRequired;if(s.allErrors?function(){if(c||a)e.block$data(ln.nil,u);else for(const t of r)un.checkReportMissingProp(e,t)}():function(){const s=t.let("missing");if(c||a){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,a){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(a,un.propertyInData(t,o,r,i.ownProperties)),t.if(ln.not(a),(()=>{e.error(),t.break()}))}),ln.nil)}(s,r))),e.ok(r)}else t.if(un.checkMissingProp(e,r,s)),un.reportMissingProp(e,s),t.else()}(),i.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${s.schemaEnv.baseId+s.errSchemaPath}" (strictRequired)`;dn.checkStrictMode(s,t,s.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if(un.noPropertyInData(t,o,r,i.ownProperties),(()=>e.error()))}))}}};cn.default=fn;var hn={};const mn=ge,pn={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>mn.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>mn._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n}=e,o="maxItems"===t?mn.operators.GT:mn.operators.LT;e.fail$data(mn._`${r}.length ${o} ${n}`)}};hn.default=pn;var yn={},vn={};const gn=at;gn.code='require("ajv/dist/runtime/equal").default',vn.default=gn;const $n=Ce,bn=ge,wn=we,_n=vn,En={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>bn.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>bn._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:o,parentSchema:a,schemaCode:s,it:i}=e;if(!n&&!o)return;const c=t.let("valid"),u=a.items?$n.getSchemaTypes(a.items):[];function l(n,o){const a=t.name("item"),s=$n.checkDataTypes(u,a,i.opts.strictNumbers,$n.DataType.Wrong),l=t.const("indices",bn._`{}`);t.for(bn._`;${n}--;`,(()=>{t.let(a,bn._`${r}[${n}]`),t.if(s,bn._`continue`),u.length>1&&t.if(bn._`typeof ${a} == "string"`,bn._`${a} += "_"`),t.if(bn._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(o,bn._`${l}[${a}]`),e.error(),t.assign(c,!1).break()})).code(bn._`${l}[${a}] = ${n}`)}))}function d(n,o){const a=wn.useFunc(t,_n.default),s=t.name("outer");t.label(s).for(bn._`;${n}--;`,(()=>t.for(bn._`${o} = ${n}; ${o}--;`,(()=>t.if(bn._`${a}(${r}[${n}], ${r}[${o}])`,(()=>{e.error(),t.assign(c,!1).break(s)}))))))}e.block$data(c,(function(){const n=t.let("i",bn._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(c,!0),t.if(bn._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?l:d)(n,o)))}),bn._`${s} === false`),e.ok(c)}};yn.default=En;var Nn={};const Sn=ge,Tn=we,Pn=vn,On={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Sn._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n}=e;e.fail$data(Sn._`!${Tn.useFunc(t,Pn.default)}(${r}, ${n})`)}};Nn.default=On;var An={};const Cn=ge,kn=we,Dn=vn,In={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Cn._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:a,it:s}=e;if(!n&&0===o.length)throw new Error("enum must have non-empty array");const i=o.length>=s.opts.loopEnum,c=kn.useFunc(t,Dn.default);let u;if(i||n)u=t.let("valid"),e.block$data(u,(function(){t.assign(u,!1),t.forOf("v",a,(e=>t.if(Cn._`${c}(${r}, ${e})`,(()=>t.assign(u,!0).break()))))}));else{if(!Array.isArray(o))throw new Error("ajv implementation error");const e=t.const("vSchema",a);u=Cn.or(...o.map(((t,n)=>function(e,t){const n=o[t];return n&&"object"==typeof n?Cn._`${c}(${r}, ${e}[${t}])`:Cn._`${r} === ${n}`}(e,n))))}e.pass(u)}};An.default=In;const Rn=Kr,xn=Hr,jn=en,Un=on,Mn=cn,qn=hn,Vn=yn,Fn=Nn,zn=An,Ln=[Mr.default,Rn.default,xn.default,jn.default,Un.default,Mn.default,qn.default,Vn.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Fn.default,zn.default];Ur.default=Ln;var Kn={},Bn={validateAdditionalItems:void 0};const Jn=ge,Hn=we,Gn={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Jn.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Jn._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Yn(e,n):Hn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Yn(e,t){const{gen:r,schema:n,data:o,keyword:a,it:s}=e;s.items=!0;const i=r.const("len",Jn._`${o}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Jn._`${i} <= ${t.length}`);else if("object"==typeof n&&!Hn.alwaysValidSchema(s,n)){const n=r.var("valid",Jn._`${i} <= ${t.length}`);r.if(Jn.not(n),(()=>function(n){r.forRange("i",t.length,i,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:Hn.Type.Num},n),s.allErrors||r.if(Jn.not(n),(()=>r.break()))}))}(n))),e.ok(n)}}Bn.validateAdditionalItems=Yn,Bn.default=Gn;var Xn={},Wn={validateTuple:void 0};const Qn=ge,Zn=we,eo=Fe,to={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ro(e,"additionalItems",t);r.items=!0,Zn.alwaysValidSchema(r,t)||e.ok(eo.validateArray(e))}};function ro(e,t,r=e.schema){const{gen:n,parentSchema:o,data:a,keyword:s,it:i}=e;!function(e){const{opts:n,errSchemaPath:o}=i,a=r.length,c=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${s}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;Zn.checkStrictMode(i,e,n.strictTuples)}}(o),i.opts.unevaluated&&r.length&&!0!==i.items&&(i.items=Zn.mergeEvaluated.items(n,r.length,i.items));const c=n.name("valid"),u=n.const("len",Qn._`${a}.length`);r.forEach(((t,r)=>{Zn.alwaysValidSchema(i,t)||(n.if(Qn._`${u} > ${r}`,(()=>e.subschema({keyword:s,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Wn.validateTuple=ro,Wn.default=to;const no=Wn,oo={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>no.validateTuple(e,"items")};Xn.default=oo;var ao={};const so=ge,io=we,co=Fe,uo=Bn,lo={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>so.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>so._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,io.alwaysValidSchema(n,t)||(o?uo.validateAdditionalItems(e,o):e.ok(co.validateArray(e)))}};ao.default=lo;var fo={};const ho=ge,mo=we,po={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?ho.str`must contain at least ${e} valid item(s)`:ho.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?ho._`{minContains: ${e}}`:ho._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:a}=e;let s,i;const{minContains:c,maxContains:u}=n;a.opts.next?(s=void 0===c?1:c,i=u):s=1;const l=t.const("len",ho._`${o}.length`);if(e.setParams({min:s,max:i}),void 0===i&&0===s)return void mo.checkStrictMode(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&s>i)return mo.checkStrictMode(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if(mo.alwaysValidSchema(a,r)){let t=ho._`${l} >= ${s}`;return void 0!==i&&(t=ho._`${t} && ${l} <= ${i}`),void e.pass(t)}a.items=!0;const d=t.name("valid");if(void 0===i&&1===s)f(d,(()=>t.if(d,(()=>t.break()))));else{t.let(d,!1);const e=t.name("_valid"),r=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(ho._`${e}++`),void 0===i?t.if(ho._`${e} >= ${s}`,(()=>t.assign(d,!0).break())):(t.if(ho._`${e} > ${i}`,(()=>t.assign(d,!1).break())),1===s?t.assign(d,!0):t.if(ho._`${e} >= ${s}`,(()=>t.assign(d,!0))))}(r)))))}function f(r,n){t.forRange("i",0,l,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:mo.Type.Num,compositeRule:!0},r),n()}))}e.result(d,(()=>e.reset()))}};fo.default=po;var yo={};!function(e){e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ge,r=we,n=Fe;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:o}})=>t._`{property: ${e},
6
- missingProperty: ${o},
7
- depsCount: ${r},
8
- deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);a(e,t),s(e,r)}};function a(e,r=e.schema){const{gen:o,data:a,it:s}=e;if(0===Object.keys(r).length)return;const i=o.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const l=n.propertyInData(o,a,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?o.if(l,(()=>{for(const t of u)n.checkReportMissingProp(e,t)})):(o.if(t._`${l} && (${n.checkMissingProp(e,u,i)})`),n.reportMissingProp(e,i),o.else())}}function s(e,t=e.schema){const{gen:o,data:a,keyword:s,it:i}=e,c=o.name("valid");for(const u in t)r.alwaysValidSchema(i,t[u])||(o.if(n.propertyInData(o,a,u,i.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>o.var(c,!0))),e.ok(c))}e.validatePropertyDeps=a,e.validateSchemaDeps=s,e.default=o}(yo);var vo={};const go=ge,$o=we,bo={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>go._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:o}=e;if($o.alwaysValidSchema(o,r))return;const a=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if(go.not(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};vo.default=bo;var wo={};const _o=Fe,Eo=ge,No=_e,So=we,To={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Eo._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:o,errsCount:a,it:s}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:i,opts:c}=s;if(s.props=!0,"all"!==c.removeAdditional&&So.alwaysValidSchema(s,r))return;const u=_o.allSchemaProperties(n.properties),l=_o.allSchemaProperties(n.patternProperties);function d(e){t.code(Eo._`delete ${o}[${e}]`)}function f(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(i||t.break());if("object"==typeof r&&!So.alwaysValidSchema(s,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if(Eo.not(r),(()=>{e.reset(),d(n)}))):(h(n,r),i||t.if(Eo.not(r),(()=>t.break())))}}}function h(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:So.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",o,(e=>{u.length||l.length?t.if(function(e){let r;if(u.length>8){const o=So.schemaRefOrVal(s,n.properties,"properties");r=_o.isOwnProperty(t,o,e)}else r=u.length?Eo.or(...u.map((t=>Eo._`${e} === ${t}`))):Eo.nil;return l.length&&(r=Eo.or(r,...l.map((r=>Eo._`${_o.usePattern(t,r)}.test(${e})`)))),Eo.not(r)}(e),(()=>f(e))):f(e)})),e.ok(Eo._`${a} === ${No.default.errors}`)}};wo.default=To;var Po={};const Oo=pe,Ao=Fe,Co=we,ko=wo,Do={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:a}=e;"all"===a.opts.removeAdditional&&void 0===n.additionalProperties&&ko.default.code(new Oo.KeywordCxt(a,ko.default,"additionalProperties"));const s=Ao.allSchemaProperties(r);for(const e of s)a.definedProperties.add(e);a.opts.unevaluated&&s.length&&!0!==a.props&&(a.props=Co.mergeEvaluated.props(t,Co.toHash(s),a.props));const i=s.filter((e=>!Co.alwaysValidSchema(a,r[e])));if(0===i.length)return;const c=t.name("valid");for(const r of i)u(r)?l(r):(t.if(Ao.propertyInData(t,o,r,a.opts.ownProperties)),l(r),a.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return a.opts.useDefaults&&!a.compositeRule&&void 0!==r[e].default}function l(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};Po.default=Do;var Io={};const Ro=Fe,xo=ge,jo=we,Uo=we,Mo={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:o,it:a}=e,{opts:s}=a,i=Ro.schemaProperties(a,r);if(0===i.length)return;const c=s.strictSchema&&!s.allowMatchingProperties&&o.properties,u=t.name("valid");!0===a.props||a.props instanceof xo.Name||(a.props=Uo.evaluatedPropsToName(t,a.props));const{props:l}=a;function d(e){for(const t in c)new RegExp(e).test(t)&&jo.checkStrictMode(a,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function f(r){t.forIn("key",n,(n=>{t.if(xo._`${Ro.usePattern(t,r)}.test(${n})`,(()=>{e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Uo.Type.Str},u),a.opts.unevaluated&&!0!==l?t.assign(xo._`${l}[${n}]`,!0):a.allErrors||t.if(xo.not(u),(()=>t.break()))}))}))}!function(){for(const e of i)c&&d(e),a.allErrors?f(e):(t.var(u,!0),f(e),t.if(u))}()}};Io.default=Mo;var qo={};const Vo=we,Fo={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if(Vo.alwaysValidSchema(n,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.result(o,(()=>e.error()),(()=>e.reset()))},error:{message:"must NOT be valid"}};qo.default=Fo;var zo={};const Lo={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Fe.validateUnion,error:{message:"must match a schema in anyOf"}};zo.default=Lo;var Ko={};const Bo=ge,Jo=we,Ho={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Bo._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;const a=r,s=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block((function(){a.forEach(((r,n)=>{let a;Jo.alwaysValidSchema(o,r)?t.var(c,!0):a=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Bo._`${c} && ${s}`).assign(s,!1).assign(i,Bo._`[${i}, ${n}]`).else(),t.if(c,(()=>{t.assign(s,!0),t.assign(i,n),a&&e.mergeEvaluated(a,Bo.Name)}))}))})),e.result(s,(()=>e.reset()),(()=>e.error(!0)))}};Ko.default=Ho;var Go={};const Yo=we,Xo={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach(((t,r)=>{if(Yo.alwaysValidSchema(n,t))return;const a=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(a)}))}};Go.default=Xo;var Wo={};const Qo=ge,Zo=we,ea={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Qo.str`must match "${e.ifClause}" schema`,params:({params:e})=>Qo._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&Zo.checkStrictMode(n,'"if" without "then" and "else" is ignored');const o=ta(n,"then"),a=ta(n,"else");if(!o&&!a)return;const s=t.let("valid",!0),i=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(t)}(),e.reset(),o&&a){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(i,c("then",r),c("else",r))}else o?t.if(i,c("then")):t.if(Qo.not(i),c("else"));function c(r,n){return()=>{const o=e.subschema({keyword:r},i);t.assign(s,i),e.mergeValidEvaluated(o,s),n?t.assign(n,Qo._`${r}`):e.setParams({ifClause:r})}}e.pass(s,(()=>e.error(!0)))}};function ta(e,t){const r=e.schema[t];return void 0!==r&&!Zo.alwaysValidSchema(e,r)}Wo.default=ea;var ra={};const na=we,oa={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&na.checkStrictMode(r,`"${e}" without "if" is ignored`)}};ra.default=oa;const aa=Bn,sa=Xn,ia=Wn,ca=ao,ua=fo,la=yo,da=vo,fa=wo,ha=Po,ma=Io,pa=qo,ya=zo,va=Ko,ga=Go,$a=Wo,ba=ra;Kn.default=function(e=!1){const t=[pa.default,ya.default,va.default,ga.default,$a.default,ba.default,da.default,fa.default,la.default,ha.default,ma.default];return e?t.push(sa.default,ca.default):t.push(aa.default,ia.default),t.push(ua.default),t};var wa={},_a={};const Ea=ge,Na={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Ea.str`must match format "${e}"`,params:({schemaCode:e})=>Ea._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:o,schema:a,schemaCode:s,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;c.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),a=r.const("fDef",Ea._`${o}[${s}]`),i=r.let("fType"),u=r.let("format");r.if(Ea._`typeof ${a} == "object" && !(${a} instanceof RegExp)`,(()=>r.assign(i,Ea._`${a}.type || "string"`).assign(u,Ea._`${a}.validate`)),(()=>r.assign(i,Ea._`"string"`).assign(u,a))),e.fail$data(Ea.or(!1===c.strictSchema?Ea.nil:Ea._`${s} && !${u}`,function(){const e=l.$async?Ea._`(${a}.async ? await ${u}(${n}) : ${u}(${n}))`:Ea._`${u}(${n})`,r=Ea._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Ea._`${u} && ${u} !== true && ${i} === ${t} && !${r}`}()))}():function(){const o=d.formats[a];if(!o)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${a}" ignored in schema at path "${u}"`}}();if(!0===o)return;const[s,i,f]=function(e){const t=e instanceof RegExp?Ea.regexpCode(e):c.code.formats?Ea._`${c.code.formats}${Ea.getProperty(a)}`:void 0,n=r.scopeValue("formats",{key:a,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Ea._`${n}.validate`];return["string",e,n]}(o);s===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!l.$async)throw new Error("async format in sync schema");return Ea._`await ${f}(${n})`}return"function"==typeof i?Ea._`${f}(${n})`:Ea._`${f}.test(${n})`}())}())}};_a.default=Na;const Sa=[_a.default];wa.default=Sa;var Ta={};Ta.contentVocabulary=Ta.metadataVocabulary=void 0,Ta.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ta.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];const Pa=Ur,Oa=Kn,Aa=wa,Ca=Ta,ka=[_r.default,Pa.default,Oa.default(),Aa.default,Ca.metadataVocabulary,Ca.contentVocabulary];wr.default=ka;var Da={},Ia={};!function(e){var t;e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(Ia);const Ra=ge,xa=Ia,ja={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===xa.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>Ra._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:o,it:a}=e,{oneOf:s}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if("string"!=typeof i)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",Ra._`${r}${Ra.getProperty(i)}`);function l(r){const n=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(o,Ra.Name),n}t.if(Ra._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=a(o);let n=!0;for(let t=0;t<s.length;t++){const o=s[t],u=null===(e=o.properties)||void 0===e?void 0:e[i];if("object"!=typeof u)throw new Error(`discriminator: oneOf schemas must have "properties/${i}"`);n=n&&(r||a(o)),c(u,t)}if(!n)throw new Error(`discriminator: "${i}" must be required`);return t;function a({required:e}){return Array.isArray(e)&&e.includes(i)}function c(e,t){if(e.const)u(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`);for(const r of e.enum)u(r,t)}}function u(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${i}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(Ra._`${u} === ${e}`),t.assign(c,l(r[e]));t.else(),e.error(!1,{discrError:xa.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}()),(()=>e.error(!1,{discrError:xa.DiscrError.Tag,tag:u,tagName:i}))),e.ok(c)}};Da.default=ja;var Ua={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};!function(e,t){t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=me,n=wr,o=Da,a=Ua,s=["/properties"],i="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(a,s):a;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}e.exports=t=c,t.default=c;var u=pe;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=ge;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}})}(he,he.exports),fe.isntJsonRpcError=fe.isJsonRpcError=fe.isntJsonRpcSuccess=fe.isJsonRpcSuccess=fe.isntJsonRpcRequest=fe.isJsonRpcRequest=fe.isntJsonRpcNotification=fe.isJsonRpcNotification=void 0;const Ma=he.exports,qa={oneOf:[{type:"string"},{type:"number"}]},Va={oneOf:[{type:"array"},{type:"object"}]},Fa={type:"object",properties:{jsonrpc:{type:"string"},method:{type:"string"},params:Va,id:!1},required:["jsonrpc","method"]},za={type:"object",properties:{jsonrpc:{type:"string"},id:qa,method:{type:"string"},params:Va},required:["jsonrpc","id","method"]},La={type:"object",properties:{jsonrpc:{type:"string"},id:qa,result:{}},required:["jsonrpc","id","result"]},Ka={type:"object",properties:{jsonrpc:{type:"string"},id:qa,error:{type:"object",properties:{code:{type:"number"},message:{type:"string"},data:{}},required:["code","message"]}},required:["jsonrpc","id","error"]};let Ba;function Ja(e){return Ba||(Ba=new Ma.default),Ba.validate(Fa,e)}function Ha(e){return Ba||(Ba=new Ma.default),Ba.validate(za,e)}function Ga(e){return Ba||(Ba=new Ma.default),Ba.validate(La,e)}function Ya(e){return Ba||(Ba=new Ma.default),Ba.validate(Ka,e)}fe.isJsonRpcNotification=Ja,fe.isntJsonRpcNotification=function(e){return!Ja(e)},fe.isJsonRpcRequest=Ha,fe.isntJsonRpcRequest=function(e){return!Ha(e)},fe.isJsonRpcSuccess=Ga,fe.isntJsonRpcSuccess=function(e){return!Ga(e)},fe.isJsonRpcError=Ya,fe.isntJsonRpcError=function(e){return!Ya(e)};var Xa={};Xa.isntJson=Xa.isJson=void 0,Xa.isJson=function(e){try{return JSON.stringify(e),!0}catch(e){return!1}},Xa.isntJson=function e(t){return!e()};var Wa={};function Qa(e){return"number"==typeof e}Wa.isntNumber=Wa.isNumber=void 0,Wa.isNumber=Qa,Wa.isntNumber=function(e){return!Qa(e)};var Za={};function es(e){return null!==e&&"object"==typeof e}Za.isntObject=Za.isObject=void 0,Za.isObject=es,Za.isntObject=function(e){return!es(e)};var ts={};ts.isAbsoluteURL=void 0,ts.isAbsoluteURL=function(e){try{return new URL(e),!0}catch(e){return!1}},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(U,e),n(B,e),n(H,e),n(re,e),n(oe,e),n(se,e),n(ce,e),n(fe,e),n(Xa,e),n(M,e),n(Wa,e),n(Za,e),n(G,e),n(V,e),n(ts,e)}(j),x.chunkByAsync=void 0;const rs=j;x.chunkByAsync=function(e,t){return rs.isAsyncIterable(e)?async function*(e){let r=[],n=0;for await(const o of e)r.push(o),await t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)}(e):async function*(e){let r=[],n=0;for(const o of e)r.push(o),await t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)}(e)};var ns={};ns.chunkBy=void 0,ns.chunkBy=function*(e,t){let r=[],n=0;for(const o of e)r.push(o),t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)};var os={chunk:void 0};const as=v,ss=$;os.chunk=function(e,t){return ss.assert(Number.isInteger(t),"The parameter size must be an integer"),ss.assert(t>0,"The parameter size must be greater than 0"),as.go((function*(){let r=[];for(const n of e)r.push(n),r.length>=t&&(yield r,r=[]);r.length&&(yield r)}))};var is={concatAsync:void 0};const cs=j,us=v;is.concatAsync=function(e,...t){return us.go((async function*(){for(const r of[e,...t])if(cs.isAsyncIterable(r))for await(const e of r)yield e;else for(const e of r)yield e}))};var ls={concat:void 0};const ds=v;ls.concat=function(e,...t){return ds.go((function*(){for(const r of[e,...t])yield*r}))};var fs={},hs={};hs.copyIterable=hs.copyAsyncIterable=void 0,hs.copyAsyncIterable=async function*(e){for await(const t of e)yield t},hs.copyIterable=function*(e){for(const t of e)yield t},fs.dropAsync=void 0;const ms=v,ps=hs,ys=$;fs.dropAsync=function(e,t){return ys.assert(Number.isInteger(t),"The parameter count must be an integer"),ys.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?ps.copyAsyncIterable(e):ms.go((async function*(){const r=e[Symbol.asyncIterator]();let n;for(;!(n=await r.next(),n.done||t<=0);)t--;for(;!n.done;)yield n.value,n=await r.next()}))};var vs={dropRightAsync:void 0};const gs=v,$s=hs,bs=$;vs.dropRightAsync=function(e,t){return bs.assert(Number.isInteger(t),"The parameter count must be an integer"),bs.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?$s.copyAsyncIterable(e):gs.go((async function*(){const r=(await async function(e){const t=[];for await(const r of e)t.push(r);return t}(e)).slice(0,-t);for(const e of r)yield e}))};var ws={dropRight:void 0};const _s=v,Es=hs,Ns=$;ws.dropRight=function(e,t){return Ns.assert(Number.isInteger(t),"The parameter count must be an integer"),Ns.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?Es.copyIterable(e):_s.go((function*(){const r=Array.from(e);yield*r.slice(0,-t)}))};var Ss={dropUntilAsync:void 0};const Ts=j;Ss.dropUntilAsync=function(e,t){return Ts.isAsyncIterable(e)?async function*(e){const r=e[Symbol.asyncIterator]();let n,o=0;for(;!(n=await r.next(),n.done||await t(n.value,o++)););for(;!n.done;)yield n.value,n=await r.next()}(e):async function*(e){const r=e[Symbol.iterator]();let n,o=0;for(;!(n=r.next(),n.done||await t(n.value,o++)););for(;!n.done;)yield n.value,n=r.next()}(e)};var Ps={};Ps.dropUntil=void 0,Ps.dropUntil=function*(e,t){const r=e[Symbol.iterator]();let n,o=0;for(;!(n=r.next(),n.done||t(n.value,o++)););for(;!n.done;)yield n.value,n=r.next()};var Os={drop:void 0};const As=v,Cs=hs,ks=$;Os.drop=function(e,t){return ks.assert(Number.isInteger(t),"The parameter count must be an integer"),ks.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?Cs.copyIterable(e):As.go((function*(){const r=e[Symbol.iterator]();let n;for(;!(n=r.next(),n.done||t<=0);)t--;for(;!n.done;)yield n.value,n=r.next()}))};var Ds={filterAsync:void 0};const Is=j;Ds.filterAsync=function(e,t){return Is.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)await t(n,r)&&(yield n),r++}(e):async function*(e){let r=0;for(const n of e)await t(n,r)&&(yield n),r++}(e)};var Rs={};Rs.filter=void 0,Rs.filter=function*(e,t){let r=0;for(const n of e)t(n,r)&&(yield n),r++};var xs={},js={},Us={flattenByAsync:void 0};const Ms=j;function qs(e){return Ms.isIterable(e)&&Ms.isntChar(e)}Us.flattenByAsync=function(e,t){return Ms.isAsyncIterable(e)?async function*(e){const n=1;for await(const o of e)qs(o)&&await t(o,n)?yield*r(o,n+1):yield o}(e):function(e){return r(e,1)}(e);async function*r(e,n){for(const o of e)qs(o)&&await t(o,n)?yield*r(o,n+1):yield o}},js.flattenDeepAsync=void 0;const Vs=Us,Fs=$;js.flattenDeepAsync=function(e,t=1/0){return Fs.assert(t===1/0||Number.isInteger(t),"The parameter depth must be an integer"),Fs.assert(t>=0,"The parameter depth must be greater than or equal to 0"),Vs.flattenByAsync(e,((e,r)=>r<=t))},xs.flattenAsync=void 0;const zs=js;xs.flattenAsync=function(e){return zs.flattenDeepAsync(e,1)};var Ls={flattenBy:void 0};const Ks=j;Ls.flattenBy=function(e,t){return function*e(r,n){for(const a of r)o=a,Ks.isIterable(o)&&Ks.isntChar(o)&&t(a,n)?yield*e(a,n+1):yield a;var o}(e,1)};var Bs={flattenDeep:void 0};const Js=Ls,Hs=$;Bs.flattenDeep=function(e,t=1/0){return Hs.assert(t===1/0||Number.isInteger(t),"The parameter depth must be an integer"),Hs.assert(t>=0,"The parameter depth must be greater than or equal to 0"),Js.flattenBy(e,((e,r)=>r<=t))};var Gs={flatten:void 0};const Ys=Bs;Gs.flatten=function(e){return Ys.flattenDeep(e,1)};var Xs={mapAsync:void 0};const Ws=j;Xs.mapAsync=function(e,t){return Ws.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)yield await t(n,r),r++}(e):async function*(e){let r=0;for(const n of e)yield await t(n,r),r++}(e)};var Qs={};Qs.map=void 0,Qs.map=function*(e,t){let r=0;for(const n of e)yield t(n,r),r++};var Zs={repeatAsync:void 0};const ei=v,ti=$;Zs.repeatAsync=function(e,t){return ti.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),ti.assert(t>=0,"The parameter times must be greater than or equal to 0"),t===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),ei.go((async function*(){const r=[];if(t>0){for await(const t of e)yield t,r.push(t);t--}for(;t>0;)yield*r,t--}))};var ri={repeat:void 0};const ni=v,oi=$;ri.repeat=function(e,t){return oi.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),oi.assert(t>=0,"The parameter times must be greater than or equal to 0"),t===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),ni.go((function*(){const r=[];if(t>0){for(const t of e)yield t,r.push(t);t--}for(;t>0;)yield*r,t--}))};var ai={sliceAsync:void 0};const si=v,ii=$;ai.sliceAsync=function(e,t,r=1/0){return ii.assert(Number.isInteger(t),"The parameter start must be an integer"),ii.assert(t>=0,"The parameter start must be greater than or equal to 0"),ii.assert(Number.isInteger(r),"The parameter end must be an integer"),ii.assert(r>=t,"The parameter end must be greater than or equal to start"),si.go((async function*(){let n=0;for await(const o of e){if(n>=r)break;n>=t&&(yield o),n++}}))};var ci={slice:void 0};const ui=v,li=$;ci.slice=function(e,t,r=1/0){return li.assert(Number.isInteger(t),"The parameter start must be an integer"),li.assert(t>=0,"The parameter start must be greater than or equal to 0"),li.assert(Number.isInteger(r),"The parameter end must be an integer"),li.assert(r>=t,"The parameter end must be greater than or equal to start"),ui.go((function*(){let n=0;for(const o of e){if(n>=r)break;n>=t&&(yield o),n++}}))};var di={};di.splitAsync=void 0,di.splitAsync=async function*(e,t){let r=[];for await(const n of e)n===t?(yield r,r=[]):r.push(n);yield r};var fi={splitByAsync:void 0};const hi=j;fi.splitByAsync=function(e,t){return hi.isAsyncIterable(e)?async function*(e){let r=[],n=0;for await(const o of e)await t(o,n)?(yield r,r=[]):r.push(o),n++;yield r}(e):async function*(e){let r=[],n=0;for(const o of e)await t(o,n)?(yield r,r=[]):r.push(o),n++;yield r}(e)};var mi={};mi.splitBy=void 0,mi.splitBy=function*(e,t){let r=[],n=0;for(const o of e)t(o,n)?(yield r,r=[]):r.push(o),n++;yield r};var pi={};pi.split=void 0,pi.split=function*(e,t){let r=[];for(const n of e)n===t?(yield r,r=[]):r.push(n);yield r};var yi={takeAsync:void 0};const vi=v,gi=$;yi.takeAsync=function(e,t){return gi.assert(Number.isInteger(t),"The parameter count must be an integer"),gi.assert(t>=0,"The parameter count must be greater than or equal to 0"),vi.go((async function*(){if(0!==t)for await(const r of e)if(yield r,0===--t)break}))};var $i={takeRightAsync:void 0};const bi=v,wi=$;$i.takeRightAsync=function(e,t){return wi.assert(Number.isInteger(t),"The parameter count must be an integer"),wi.assert(t>=0,"The parameter count must be greater than or equal to 0"),bi.go((async function*(){const r=e[Symbol.asyncIterator](),n=[];let o;for(;o=await r.next(),!o.done;)n.push(o.value),n.length>t&&n.shift();yield*n}))};var _i={takeRight:void 0};const Ei=v,Ni=$;_i.takeRight=function(e,t){return Ni.assert(Number.isInteger(t),"The parameter count must be an integer"),Ni.assert(t>=0,"The parameter count must be greater than or equal to 0"),Ei.go((function*(){const r=e[Symbol.iterator](),n=[];let o;for(;o=r.next(),!o.done;)n.push(o.value),n.length>t&&n.shift();yield*n}))};var Si={takeUntilAsync:void 0};const Ti=j;Si.takeUntilAsync=function(e,t){return Ti.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e){if(await t(n,r))break;yield n,r++}}(e):async function*(e){let r=0;for(const n of e){if(await t(n,r))break;yield n,r++}}(e)};var Pi={};Pi.takeUntil=void 0,Pi.takeUntil=function*(e,t){let r=0;for(const n of e){if(t(n,r))break;yield n,r++}};var Oi={take:void 0};const Ai=v,Ci=$;Oi.take=function(e,t){return Ci.assert(Number.isInteger(t),"The parameter count must be an integer"),Ci.assert(t>=0,"The parameter count must be greater than or equal to 0"),Ai.go((function*(){if(0!==t)for(const r of e)if(yield r,0===--t)break}))};var ki={tapAsync:void 0};const Di=j;ki.tapAsync=function(e,t){return Di.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)await t(n,r),yield n,r++}(e):async function*(e){let r=0;for(const n of e)await t(n,r),yield n,r++}(e)};var Ii={};Ii.tap=void 0,Ii.tap=function*(e,t){let r=0;for(const n of e)t(n,r),yield n,r++};var Ri={};Ri.toAsyncIterable=void 0,Ri.toAsyncIterable=async function*(e){for(const t of e)yield t};var xi={};xi.transformAsync=void 0,xi.transformAsync=async function*(e,t){yield*t(e)};var ji={};ji.transform=void 0,ji.transform=function*(e,t){yield*t(e)};var Ui={};Ui.uniqAsync=void 0,Ui.uniqAsync=async function*(e){const t=new Set;for await(const r of e)t.has(r)||(yield r,t.add(r))};var Mi={uniqByAsync:void 0};const qi=j;Mi.uniqByAsync=function(e,t){return qi.isAsyncIterable(e)?async function*(e){const r=new Set;let n=0;for await(const o of e){const e=await t(o,n);r.has(e)||(yield o,r.add(e)),n++}}(e):async function*(e){const r=new Set;let n=0;for(const o of e){const e=await t(o,n);r.has(e)||(yield o,r.add(e)),n++}}(e)};var Vi={};Vi.uniqBy=void 0,Vi.uniqBy=function*(e,t){const r=new Set;let n=0;for(const o of e){const e=t(o,n);r.has(e)||(yield o,r.add(e)),n++}};var Fi={};Fi.uniq=void 0,Fi.uniq=function*(e){const t=new Set;for(const r of e)t.has(r)||(yield r,t.add(r))};var zi={zipAsync:void 0};const Li=j;zi.zipAsync=function(e,...t){return async function*(...e){const t=e.length,r=e.map((e=>Li.isAsyncIterable(e)?[Symbol.asyncIterator,e[Symbol.asyncIterator]()]:[Symbol.iterator,e[Symbol.iterator]()]));for(;;){const e=new Array(t);for(let n=0;n<t;n++){const[t,o]=r[n];let a;if(a=t===Symbol.asyncIterator?await o.next():o.next(),a.done)return;e[n]=a.value}yield e}}(e,...t)};var Ki={};Ki.zip=void 0,Ki.zip=function(e,...t){return function*(...e){const t=e.length,r=e.map((e=>e[Symbol.iterator]()));for(;;){const e=new Array(t);for(let n=0;n<t;n++){const{value:t,done:o}=r[n].next();if(o)return;e[n]=t}yield e}}(e,...t)},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(y,e),n(x,e),n(ns,e),n(os,e),n(is,e),n(ls,e),n(fs,e),n(vs,e),n(ws,e),n(Ss,e),n(Ps,e),n(Os,e),n(Ds,e),n(Rs,e),n(xs,e),n(Us,e),n(Ls,e),n(js,e),n(Bs,e),n(Gs,e),n(Xs,e),n(Qs,e),n(Zs,e),n(ri,e),n(ai,e),n(ci,e),n(di,e),n(fi,e),n(mi,e),n(pi,e),n(yi,e),n($i,e),n(_i,e),n(Si,e),n(Pi,e),n(Oi,e),n(ki,e),n(Ii,e),n(Ri,e),n(xi,e),n(ji,e),n(Ui,e),n(Mi,e),n(Vi,e),n(Fi,e),n(zi,e),n(Ki,e)}(p);var Bi={},Ji={};Ji.consume=void 0,Ji.consume=function(e,t){return t(e)};var Hi={eachAsync:void 0};const Gi=j;Hi.eachAsync=function(e,t){return Gi.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e)await t(n,r),r++}(e):async function(e){let r=0;for(const n of e)await t(n,r),r++}(e)};var Yi={};Yi.each=void 0,Yi.each=function(e,t){let r=0;for(const n of e)t(n,r),r++};var Xi={everyAsync:void 0};const Wi=j;Xi.everyAsync=function(e,t){return Wi.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(!await t(n,r))return!1;r++}return!0}(e):async function(e){let r=0;for(const n of e){if(!await t(n,r))return!1;r++}return!0}(e)};var Qi={};Qi.every=void 0,Qi.every=function(e,t){let r=0;for(const n of e){if(!t(n,r))return!1;r++}return!0};var Zi={findAsync:void 0};const ec=j;Zi.findAsync=function(e,t){return ec.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(await t(n,r))return n;r++}return}(e):async function(e){let r=0;for(const n of e){if(await t(n,r))return n;r++}return}(e)};var tc={};tc.find=void 0,tc.find=function(e,t){let r=0;for(const n of e){if(t(n,r))return n;r++}};var rc={};rc.firstAsync=void 0,rc.firstAsync=async function(e){for await(const t of e)return t};var nc={};nc.first=void 0,nc.first=function(e){for(const t of e)return t};var oc={};oc.includesAsync=void 0,oc.includesAsync=async function(e,t){for await(const r of e)if(r===t)return!0;return!1};var ac={};ac.includes=void 0,ac.includes=function(e,t){for(const r of e)if(r===t)return!0;return!1};var sc={};sc.matchAsync=void 0,sc.matchAsync=async function(e,t){const r=t.length;let n=0;for await(const o of e)if(o===t[n]&&n++,n===r)return!0;return!1};var ic={};ic.match=void 0,ic.match=function(e,t){const r=t.length;let n=0;for(const o of e)if(o===t[n]&&n++,n===r)return!0;return!1};var cc={reduceAsync:void 0};const uc=j;cc.reduceAsync=function(e,t,r){return uc.isUndefined(r)?function(e,t){return uc.isAsyncIterable(e)?r(e):n(e);async function r(e){const[r,n]=await s(e);let o=r,a=1;for(;;){const e=await n.next();if(e.done)break;const r=e.value;o=await t(o,r,a++)}return o;async function s(e){const t=e[Symbol.asyncIterator](),r=await t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}async function n(e){const[r,n]=s(e);let o=r,a=1;for(;;){const e=n.next();if(e.done)break;const r=e.value;o=await t(o,r,a++)}return o;function s(e){const t=e[Symbol.iterator](),r=t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}}(e,t):function(e,t,r){return uc.isAsyncIterable(e)?o(e):n(e);async function n(e){let n=r,o=0;for(const r of e)n=await t(n,r,o++);return n}async function o(e){let n=r,o=0;for await(const r of e)n=await t(n,r,o++);return n}}(e,t,r)};var lc={reduce:void 0};const dc=j;lc.reduce=function(e,t,r){return dc.isUndefined(r)?function(e,t){const[r,n]=s(e);let o=r,a=1;for(;;){const e=n.next();if(e.done)break;o=t(o,e.value,a++)}return o;function s(e){const t=e[Symbol.iterator](),r=t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}(e,t):function(e,t,r){let n=r,o=0;for(const r of e)n=t(n,r,o++);return n}(e,t,r)};var fc={someAsync:void 0};const hc=j;fc.someAsync=function(e,t){return hc.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(await t(n,r))return!0;r++}return!1}(e):async function(e){let r=0;for(const n of e){if(await t(n,r))return!0;r++}return!1}(e)};var mc={};mc.some=void 0,mc.some=function(e,t){let r=0;for(const n of e){if(t(n,r))return!0;r++}return!1};var pc={};pc.lastAsync=void 0,pc.lastAsync=async function(e){const t=e[Symbol.asyncIterator]();let{value:r,done:n}=await t.next();if(n)return;let o=r;for(;({value:r,done:n}=await t.next()),!n;)o=r;return o};var yc={};yc.last=void 0,yc.last=function(e){const t=e[Symbol.iterator]();let{value:r,done:n}=t.next();if(n)return;let o=r;for(;({value:r,done:n}=t.next()),!n;)o=r;return o};var vc={toArrayAsync:void 0};const gc=Ji;vc.toArrayAsync=function(e){return gc.consume(e,(async e=>{const t=[];for await(const r of e)t.push(r);return t}))};var $c={toArray:void 0};const bc=Ji;$c.toArray=function(e){return bc.consume(e,(e=>Array.from(e)))};var wc={toSetAsync:void 0};const _c=Ji;wc.toSetAsync=function(e){return _c.consume(e,(async e=>{const t=new Set;for await(const r of e)t.add(r);return t}))};var Ec={toSet:void 0};const Nc=Ji;Ec.toSet=function(e){return Nc.consume(e,(e=>new Set(e)))},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(Ji,e),n(Hi,e),n(Yi,e),n(Xi,e),n(Qi,e),n(Zi,e),n(tc,e),n(rc,e),n(nc,e),n(oc,e),n(ac,e),n(sc,e),n(ic,e),n(cc,e),n(lc,e),n(fc,e),n(mc,e),n(pc,e),n(yc,e),n(vc,e),n($c,e),n(wc,e),n(Ec,e)}(Bi),function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(p,e),n(Bi,e)}(m),h.unwrap=void 0;const Sc=n,Tc=m;h.unwrap=function e(t,r){return Sc.flatMap(t,(t=>r(t)?Tc.toArray(Tc.flatten(Tc.map(t.childNodes,(t=>e(t,r))))):[t]))};var Pc={},Oc={},Ac={};Ac.traverseDescendantNodes=void 0,Ac.traverseDescendantNodes=function*e(t){for(const r of t.childNodes)yield r,yield*e(r)},Oc.findInDescendantNodes=void 0;const Cc=Ac,kc=m;Oc.findInDescendantNodes=function(e,t){return kc.find(Cc.traverseDescendantNodes(e),(e=>t(e)))},Pc.find=void 0;const Dc=Oc;Pc.find=function(e,t){return t(e)?e:Dc.findInDescendantNodes(e,t)};var Ic={};Ic.parse=void 0,Ic.parse=function(e){const t=document.createElement("div");return t.innerHTML=e,[...t.childNodes]};var Rc={};Rc.stringify=void 0,Rc.stringify=function(e){const t=document.createElement("div");return e.forEach((e=>t.append(e.cloneNode(!0)))),t.innerHTML};var xc={normalize:void 0};const jc=Ic,Uc=Rc;xc.normalize=function(e){return Uc.stringify(jc.parse(e))};var Mc={};Mc.removeAttributes=void 0,Mc.removeAttributes=function(e,t){if(e instanceof Element){const r=Array.from(e.attributes).map((e=>e.name));for(const n of r)t(n)&&e.removeAttribute(n)}};var qc={},Vc={},Fc={};!function(e){e.NodeType=void 0;const t="Node"in globalThis;var r;(r=e.NodeType||(e.NodeType={}))[r.ELEMENT_NODE=t?globalThis.Node.ELEMENT_NODE:1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=t?globalThis.Node.ATTRIBUTE_NODE:2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=t?globalThis.Node.TEXT_NODE:3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=t?globalThis.Node.CDATA_SECTION_NODE:4]="CDATA_SECTION_NODE",r[r.ENTITY_REFERENCE_NODE=t?globalThis.Node.ENTITY_REFERENCE_NODE:5]="ENTITY_REFERENCE_NODE",r[r.ENTITY_NODE=t?globalThis.Node.ENTITY_NODE:6]="ENTITY_NODE",r[r.PROCESSING_INSTRUCTION_NODE=t?globalThis.Node.PROCESSING_INSTRUCTION_NODE:7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=t?globalThis.Node.COMMENT_NODE:8]="COMMENT_NODE",r[r.DOCUMENT_NODE=t?globalThis.Node.DOCUMENT_NODE:9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=t?globalThis.Node.DOCUMENT_TYPE_NODE:10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=t?globalThis.Node.DOCUMENT_FRAGMENT_NODE:11]="DOCUMENT_FRAGMENT_NODE",r[r.NOTATION_NODE=t?globalThis.Node.NOTATION_NODE:12]="NOTATION_NODE"}(Fc),Vc.isDocument=void 0;const zc=Fc,Lc=j;Vc.isDocument=function(e){return"HTMLDocument"in globalThis&&e instanceof HTMLDocument||Lc.isObject(e)&&e.nodeType===zc.NodeType.DOCUMENT_NODE};var Kc={isElement:void 0};const Bc=Fc,Jc=j;Kc.isElement=function(e){return"HTMLElement"in globalThis&&e instanceof HTMLElement||Jc.isObject(e)&&e.nodeType===Bc.NodeType.ELEMENT_NODE},qc.getBySelector=void 0;const Hc=Vc,Gc=Kc;qc.getBySelector=function(e){const t=(Gc.isElement(this)||Hc.isDocument(this)?this:document).querySelector(e);if(t)return t;throw new Error(`Could not find any elements matching ${e}`)};var Yc={getAllBySelector:void 0};const Xc=Vc,Wc=Kc;Yc.getAllBySelector=function(e){const t=(Wc.isElement(this)||Xc.isDocument(this)?this:document).querySelectorAll(e);if(t.length)return Array.from(t);throw new Error(`Could not find any elements matching ${e}`)};var Qc={};Qc.traverseAncestorNodes=void 0,Qc.traverseAncestorNodes=function*e(t){const r=t.parentNode;r&&(yield r,yield*e(r))};var Zc={findInAncestorNodes:void 0};const eu=Qc,tu=m;Zc.findInAncestorNodes=function(e,t){return tu.find(eu.traverseAncestorNodes(e),(e=>t(e)))};var ru={};ru.findInFollowingSiblingNodes=void 0,ru.findInFollowingSiblingNodes=function e(t,r){const n=t.nextSibling;if(n)return r(n)?n:e(n,r)};var nu={};nu.findInPrecedingSiblingNodes=void 0,nu.findInPrecedingSiblingNodes=function e(t,r){const n=t.previousSibling;if(n)return r(n)?n:e(n,r)};var ou={parentNode:void 0};const au=$;function su(e,t){const r=e.parentNode;if(r)return 1===t?r:su(r,t-1)}ou.parentNode=function(e,t=1){return au.assert(Number.isInteger(t),"parameter distance must be an integer"),au.assert(t>=1,"parameter distance must be greater than or equal to 1"),su(e,t)};var iu={nextSibling:void 0};const cu=$;function uu(e,t){const r=e.nextSibling;if(r)return 1===t?r:uu(r,t-1)}iu.nextSibling=function(e,t=1){return cu.assert(Number.isInteger(t),"parameter distance must be an integer"),cu.assert(t>=1,"parameter distance must be greater than or equal to 1"),uu(e,t)};var lu={previousSibling:void 0};const du=$;function fu(e,t=1){const r=e.previousSibling;if(r)return 1===t?r:fu(r,t-1)}lu.previousSibling=function(e,t=1){return du.assert(Number.isInteger(t),"parameter distance must be an integer"),du.assert(t>=1,"parameter distance must be greater than or equal to 1"),fu(e,t)};var hu={nextElementSibling:void 0};const mu=Kc,pu=$;function yu(e,t){const r=e.nextSibling;if(r)return mu.isElement(r)?1===t?r:yu(r,t-1):yu(r,t)}hu.nextElementSibling=function(e,t=1){return pu.assert(Number.isInteger(t),"parameter distance must be an integer"),pu.assert(t>=1,"parameter distance must be greater than or equal to 1"),yu(e,t)};var vu={previousElementSibling:void 0};const gu=Kc,$u=$;function bu(e,t=1){const r=e.previousSibling;if(r)return gu.isElement(r)?1===t?r:bu(r,t-1):bu(r,t)}vu.previousElementSibling=function(e,t=1){return $u.assert(Number.isInteger(t),"parameter distance must be an integer"),$u.assert(t>=1,"parameter distance must be greater than or equal to 1"),bu(e,t)};var wu={isntDocument:void 0};const _u=Vc;wu.isntDocument=function(e){return!_u.isDocument(e)};var Eu={isntElement:void 0};const Nu=Kc;Eu.isntElement=function(e){return!Nu.isElement(e)};var Su={isNode:void 0};const Tu=j;Su.isNode=function(e){return"Node"in globalThis&&e instanceof Node||Tu.isObject(e)&&"nodeType"in e};var Pu={isntNode:void 0};const Ou=Su;Pu.isntNode=function(e){return!Ou.isNode(e)};var Au={isTextNode:void 0};const Cu=Fc,ku=j;Au.isTextNode=function(e){return"Text"in globalThis&&e instanceof Text||ku.isObject(e)&&e.nodeType===Cu.NodeType.TEXT_NODE};var Du={isntTextNode:void 0};const Iu=Au;Du.isntTextNode=function(e){return!Iu.isTextNode(e)};var Ru={isParentNode:void 0};const xu=Su;Ru.isParentNode=function(e){return xu.isNode(e)&&"children"in e};var ju={isntParentNode:void 0};const Uu=Ru;ju.isntParentNode=function(e){return!Uu.isParentNode(e)};var Mu={};!function(e){e.XPathResultType=void 0;const t="XPathResult"in globalThis;var r;(r=e.XPathResultType||(e.XPathResultType={}))[r.ANY_TYPE=t?globalThis.XPathResult.ANY_TYPE:0]="ANY_TYPE",r[r.NUMBER_TYPE=t?globalThis.XPathResult.NUMBER_TYPE:1]="NUMBER_TYPE",r[r.STRING_TYPE=t?globalThis.XPathResult.STRING_TYPE:2]="STRING_TYPE",r[r.BOOLEAN_TYPE=t?globalThis.XPathResult.BOOLEAN_TYPE:3]="BOOLEAN_TYPE",r[r.UNORDERED_NODE_ITERATOR_TYPE=t?globalThis.XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4]="UNORDERED_NODE_ITERATOR_TYPE",r[r.ORDERED_NODE_ITERATOR_TYPE=t?globalThis.XPathResult.ORDERED_NODE_ITERATOR_TYPE:5]="ORDERED_NODE_ITERATOR_TYPE",r[r.UNORDERED_NODE_SNAPSHOT_TYPE=t?globalThis.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:6]="UNORDERED_NODE_SNAPSHOT_TYPE",r[r.ORDERED_NODE_SNAPSHOT_TYPE=t?globalThis.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:7]="ORDERED_NODE_SNAPSHOT_TYPE",r[r.ANY_UNORDERED_NODE_TYPE=t?globalThis.XPathResult.ANY_UNORDERED_NODE_TYPE:8]="ANY_UNORDERED_NODE_TYPE",r[r.FIRST_ORDERED_NODE_TYPE=t?globalThis.XPathResult.FIRST_ORDERED_NODE_TYPE:9]="FIRST_ORDERED_NODE_TYPE"}(Mu);var qu={replaceBrWithNewline:void 0};const Vu=u;qu.replaceBrWithNewline=function(e){return Vu.map(e,(e=>"BR"===e.nodeName?document.createTextNode("\n"):e))};var Fu={};Fu.isBefore=void 0,Fu.isBefore=function(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)};var zu={};function Lu(e,t,...r){if(0===r.length)return!0;if(!t)return!1;const[n,...o]=r,a=Reflect.apply(n,e,[t]);if(j.isBoolean(a)){if(a){const r=e.next(t);return Lu(e,r,...o)}return!1}if(j.isNumber(a)){const r=a,n=e.next(t,r);return Lu(e,n,...o)}if(j.isIterable(a)){for(const r of a){const n=e.next(t,r);if(Lu(e,n,...o))return!0}return!1}throw new Error("Unknown return value")}function Ku(e,t=1){return 0===t?e:r.nextSibling(e,t)}function Bu(e,t=1){return 0===t?e:r.nextElementSibling(e,t)}function Ju(e,t){for(const[r,n]of Object.entries(t))e[r]?Array.isArray(e[r])?Array.isArray(n)?e[r]=[...e[r],...n]:e[r]=[...e[r],n]:Array.isArray(n)?e[r]=[e[r],...n]:e[r]=[e[r],n]:e[r]=n}function Hu(e,t){const r=[];for(let n=0,o=t.length;n<o;n++)r.push(e[n]),r.push(t[n]);return r.push(e[e.length-1]),r}zu.isAfter=void 0,zu.isAfter=function(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};o(n,e),o(u,e),o(d,e),o(h,e),o(Pc,e),o(Ic,e),o(Rc,e),o(xc,e),o(s,e),o(Mc,e),o(qc,e),o(Yc,e),o(Qc,e),o(Zc,e),o(Ac,e),o(Oc,e),o(ru,e),o(nu,e),o(ou,e),o(iu,e),o(lu,e),o(hu,e),o(vu,e),o(Vc,e),o(wu,e),o(Kc,e),o(Eu,e),o(Su,e),o(Pu,e),o(Au,e),o(Du,e),o(Ru,e),o(ju,e),o(Fc,e),o(Mu,e),o(qu,e),o(Fu,e),o(zu,e)}(r);var Gu={},Yu={};Yu.of=void 0,Yu.of=function*(e){yield e};var Xu={repeat:void 0};const Wu=$;Xu.repeat=function(e,t=1/0){return Wu.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),function*(){for(;t-- >0;)yield e}()};var Qu={};Qu.countdown=void 0,Qu.countdown=function*(e,t){if(!(e<t))for(let r=e;r>=t;r--)yield r};var Zu={};Zu.countup=void 0,Zu.countup=function*(e,t){if(!(e>t))for(let r=e;r<=t;r++)yield r};var el={range:void 0};const tl=$;el.range=function(e,t,r=1){return tl.assert(r>0,"step parameter must be greater than 0"),function*(e,t,r){if(e<t)for(let n=e;n<t;n+=r)yield n;else for(let n=e;n>t;n-=r)yield n}(e,t,r)};var rl={};rl.stringifyJSONStream=void 0,rl.stringifyJSONStream=function*(e){const t=e[Symbol.iterator](),r=t.next();for(yield"[",r.done||(yield JSON.stringify(r.value));;){const e=t.next();if(e.done)break;yield","+JSON.stringify(e.value)}yield"]"};var nl={};nl.stringifyJSONStreamAsync=void 0,nl.stringifyJSONStreamAsync=async function*(e){const t=e[Symbol.asyncIterator](),r=await t.next();for(yield"[",r.done||(yield JSON.stringify(r.value));;){const e=await t.next();if(e.done)break;yield","+JSON.stringify(e.value)}yield"]"};var ol={};ol.stringifyNDJSONStream=void 0,ol.stringifyNDJSONStream=function*(e){const t=e[Symbol.iterator](),r=t.next();for(r.done||(yield JSON.stringify(r.value));;){const e=t.next();if(e.done)break;yield"\n"+JSON.stringify(e.value)}};var al={};al.stringifyNDJSONStreamAsync=void 0,al.stringifyNDJSONStreamAsync=async function*(e){const t=e[Symbol.asyncIterator](),r=await t.next();for(r.done||(yield JSON.stringify(r.value));;){const e=await t.next();if(e.done)break;yield"\n"+JSON.stringify(e.value)}};var sl,il={};function cl(e,t,r){let n=e;for(const e of Gu.countup(1,t)){if(!n)return e-1;if(!r.call(this,n))return e-1;n=this.next(n)}return t}function ul([e,t],r,n={greedy:!0}){return $.assert(Number.isInteger(e),"parameter min must be an integer"),$.assert(Number.isInteger(t)||t===1/0,"parameter max must be an integer or Infinity"),$.assert(e>=0,"parameter min must be greater than or equal to 0"),$.assert(e<=t,"parameter max must be greater than or equal to min"),function*(o){if(n.greedy){let n=t;for(;;){const t=cl.call(this,o,n,r);if(t<e)break;if(yield t,n=t-1,n<e)break}}else for(const n of Gu.countup(e,t)){const e=cl.call(this,o,n,r);if(e<n)break;e===n&&(yield n)}}}il.sse=void 0,il.sse=function*(e){e.event&&(yield`event: ${e.event}\n`);for(const t of e.data.split("\n"))yield`data: ${t}\n`;e.id&&(yield`id: ${e.id}\n`),e.retry&&(yield`retry: ${e.retry}\n`),yield"\n"},function(e){var r=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=t&&t.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(Yu,e),n(Xu,e),n(Qu,e),n(Zu,e),n(el,e),n(rl,e),n(nl,e),n(ol,e),n(al,e),n(il,e)}(Gu),function(e){e[e.Min=0]="Min",e[e.Max=1]="Max"}(sl||(sl={}));const ll="XPathResult"in globalThis?XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4;e.anyOf=function(...e){return function(t){return e.some((e=>e.call(this,t)))}},e.childNodes=function(...e){return function(t){if(0===e.length)return 0===t.childNodes.length;if(0===t.childNodes.length)return!1;const r=Object.assign(Object.assign({},this),{collection:{},next:Ku}),n=Lu(r,t.childNodes[0],...e);return n&&Ju(this.collection,r.collection),n}},e.children=function(...e){return function(t){if(0===e.length)return 0===t.children.length;if(0===t.children.length)return!1;const r=Object.assign(Object.assign({},this),{collection:{},next:Bu}),n=Lu(r,t.children[0],...e);return n&&Ju(this.collection,r.collection),n}},e.css=function e(...t){if(j.isString(t[0])){const[e]=t;return t=>t.matches(e)}{const[r,...n]=t;return e(Hu(r,n).join(""))}},e.element=function e(...t){if(Array.isArray(t[0])){const[r,...n]=t,o=Hu(r,n).join("");return(...t)=>e(o,...t)}if(j.isString(t[0])){const[r,...n]=t;return function(t){const o=e(...n).call(this,t);return o&&Ju(this.collection,{[r]:t}),o}}const[...n]=t;return function(e){return!r.isntElement(e)&&(0===n.length||n.every((t=>t.call(this,e))))}},e.match=function(e,...t){const n={document:r.isDocument(this)?this:globalThis.document,collection:{},next:Ku};return Lu(n,e,...t)?n.collection:null},e.matchElement=function(e,...t){const n={document:r.isDocument(this)?this:globalThis.document,collection:{},next:Bu};return Lu(n,e,...t)?n.collection:null},e.multiple=ul,e.node=function e(...t){if(Array.isArray(t[0])){const[r,...n]=t,o=Hu(r,n).join("");return(...t)=>e(o,...t)}if(j.isString(t[0])){const[r,...n]=t;return function(t){const o=e(...n).call(this,t);return o&&Ju(this.collection,{[r]:t}),o}}const[...r]=t;return function(e){return 0===r.length||r.every((t=>t.call(this,e)))}},e.optional=function(e){return ul([0,1],e,{greedy:!0})},e.repeat=function(e,t){return $.assert(Number.isInteger(e),"parameter times must be an integer"),$.assert(e>=0,"parameter number must be greater than or equal to 0"),function(r){return cl.call(this,r,e,t)===e&&e}},e.tap=function(e,t){return function(r){const n=e.call(this,r);return t(n),n}},e.textContentEquals=function(e,{caseSensitive:t=!0,trim:r=!1}={}){return n=>{if(j.isNull(n.textContent))return!1;let o=n.textContent;return t||(o=o.toLowerCase(),e=e.toLowerCase()),r&&(o=o.trim()),o===e}},e.textContentIncludes=function(e,{caseSensitive:t=!0,trim:r=!1}={}){return n=>{if(j.isNull(n.textContent))return!1;let o=n.textContent;return t||(o=o.toLowerCase(),e=e.toLowerCase()),r&&(o=o.trim()),o.includes(e)}},e.textContentMatches=function(e,{trim:t=!1}={}){return r=>{if(j.isNull(r.textContent))return!1;let n=r.textContent;return t&&(n=n.trim()),e.test(n)}},e.textNode=function e(...t){if(Array.isArray(t[0])){const[r,...n]=t,o=Hu(r,n).join("");return(...t)=>e(o,...t)}if(j.isString(t[0])){const[r,...n]=t;return function(t){const o=e(...n).call(this,t);return o&&Ju(this.collection,{[r]:t}),o}}const[...n]=t;return function(e){return!r.isntTextNode(e)&&(0===n.length||n.every((t=>t.call(this,e))))}},e.xpath=function e(...t){if(j.isString(t[0])){const[e]=t;return $.assert(e.startsWith("//*"),'XPath expressions must start with "//*"'),function(t){return function(e,t,r){const n=e.evaluate(t,r,null,ll,null);let o;for(;null!==(o=n.iterateNext());)if(o===r)return!0;return!1}(this.document,e,t)}}{const[r,...n]=t;return e(Hu(r,n).join(""))}},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).Match={})}(this,(function(t){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={},r={},o={};function i(t){return t.cloneNode(!0)}o.copyNodesToChildNodes=o.cloneNodes=o.clone=void 0,o.clone=i,o.cloneNodes=function(t){return t.map((t=>i(t)))},o.copyNodesToChildNodes=function(t,n){t.forEach((t=>n.appendChild(t)))};var s={};s.removeAllChildren=void 0,s.removeAllChildren=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},r.flatMap=void 0;const a=o,c=s;r.flatMap=function t(n,e){return(0,a.cloneNodes)(e((0,a.clone)(n))).map((n=>{const r=[];for(const o of n.childNodes)r.push(...(0,a.cloneNodes)(t(o,e)));return(0,c.removeAllChildren)(n),(0,a.copyNodesToChildNodes)(r,n),n}))};var u={map:void 0};const l=o;u.map=function t(n,e){const r=(0,l.clone)(e((0,l.clone)(n)));for(const n of r.childNodes)r.replaceChild(t(n,e),n);return r};var f={filter:void 0};const d=r;f.filter=function(t,n){const e=(0,d.flatMap)(t,(t=>n(t)?[t]:[]));if(1===e.length)return e[0]};var y={},v={},p={},m={},h={},b={};b.go=void 0,b.go=function(t){return t()},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]});(n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(b,t)}(h);var g={},N={CustomError:void 0};class E extends Error{get name(){return this.constructor.name}}N.CustomError=E;var T={ExpectedError:void 0};const O=N;class A extends O.CustomError{}T.ExpectedError=A;var w={AssertionError:void 0};const _=N;class S extends _.CustomError{}w.AssertionError=S;var R={};R.normalize=void 0,R.normalize=function(t){var n;return{name:t.name,message:t.message,stack:null!==(n=t.stack)&&void 0!==n?n:null}};var I={refute:void 0};const D=T;I.refute=function(t,n){if(t)throw new D.ExpectedError(n)};var P={assert:void 0};const x=w;P.assert=function(t,n){if(!t)throw new x.AssertionError(n)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(N,t),r(T,t),r(w,t),r(R,t),r(I,t),r(P,t)}(g),m.chunkAsync=void 0;const j=h,C=g;m.chunkAsync=function(t,n){return(0,C.assert)(Number.isInteger(n),"The parameter size must be an integer"),(0,C.assert)(n>0,"The parameter size must be greater than 0"),(0,j.go)((async function*(){let e=[];for await(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var B={},U={},J={};function M(t){return Array.isArray(t)}J.isntEmptyArray=J.isEmptyArray=J.isntArray=J.isArray=void 0,J.isArray=M,J.isntArray=function(t){return!M(t)},J.isEmptyArray=function(t){return 0===t.length},J.isntEmptyArray=function(t){return 0!==t.length};var Y={},q={};function k(t){return null===t}q.isntNull=q.isNull=void 0,q.isNull=k,q.isntNull=function(t){return!k(t)};var F={};function L(t){return void 0===t}F.isntUndefined=F.isUndefined=void 0,F.isUndefined=L,F.isntUndefined=function(t){return!L(t)},Y.isntAsyncIterable=Y.isAsyncIterable=void 0;const X=q,z=F;function G(t){return(0,X.isntNull)(t)&&(0,z.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Y.isAsyncIterable=G,Y.isntAsyncIterable=function(t){return!G(t)};var H={};function $(t){return"bigint"==typeof t}H.isntBigInt=H.isBigInt=void 0,H.isBigInt=$,H.isntBigInt=function(t){return!$(t)};var W={};function V(t){return"boolean"==typeof t}W.isntBoolean=W.isBoolean=void 0,W.isBoolean=V,W.isntBoolean=function(t){return!V(t)};var K={},Q={};function Z(t){return"string"==typeof t}Q.isntString=Q.isString=void 0,Q.isString=Z,Q.isntString=function(t){return!Z(t)},K.isntChar=K.isChar=void 0;const tt=Q;function nt(t){return(0,tt.isString)(t)&&1===t.length}K.isChar=nt,K.isntChar=function(t){return!nt(t)};var et={};function rt(t){return t instanceof Date}et.isntDate=et.isDate=void 0,et.isDate=rt,et.isntDate=function(t){return!rt(t)};var ot={};ot.inEnum=void 0,ot.inEnum=function(t,n){return Object.values(n).includes(t)};var it={};function st(t){return t instanceof Error}it.isntError=it.isError=void 0,it.isError=st,it.isntError=function(t){return!st(t)};var at={};function ct(t){return!t}at.isntFalsy=at.isFalsy=void 0,at.isFalsy=ct,at.isntFalsy=function(t){return!ct(t)};var ut={};function lt(t){return"function"==typeof t}ut.isntFunction=ut.isFunction=void 0,ut.isFunction=lt,ut.isntFunction=function(t){return!lt(t)};var ft={};ft.isntIterable=ft.isIterable=void 0;const dt=q,yt=F;function vt(t){return(0,dt.isntNull)(t)&&(0,yt.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}ft.isIterable=vt,ft.isntIterable=function(t){return!vt(t)};var pt={},mt={};function ht(t){return null!==t&&"object"==typeof t}mt.isntEmptyObject=mt.isEmptyObject=mt.isRecord=mt.isntObject=mt.isObject=void 0,mt.isObject=ht,mt.isntObject=function(t){return!ht(t)},mt.isRecord=function(t){return ht(t)},mt.isEmptyObject=function(t){return 0===Object.keys(t).length},mt.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var bt={};function gt(t){return"number"==typeof t}bt.isntNumber=bt.isNumber=void 0,bt.isNumber=gt,bt.isntNumber=function(t){return!gt(t)},pt.isntJsonRpcError=pt.isJsonRpcError=pt.isntJsonRpcSuccess=pt.isJsonRpcSuccess=pt.isntJsonRpcRequest=pt.isJsonRpcRequest=pt.isntJsonRpcNotification=pt.isJsonRpcNotification=void 0;const Nt=J,Et=mt,Tt=Q,Ot=bt,At=F;function wt(t){return(0,Tt.isString)(t)||(0,Ot.isNumber)(t)}function _t(t){return(0,Nt.isArray)(t)||(0,Et.isObject)(t)}function St(t){return(0,Et.isRecord)(t)&&(0,Tt.isString)(t.jsonrpc)&&(0,Tt.isString)(t.method)&&(0,At.isUndefined)(t.id)&&_t(t.params)}function Rt(t){return(0,Et.isRecord)(t)&&(0,Tt.isString)(t.jsonrpc)&&(0,Tt.isString)(t.method)&&wt(t.id)&&_t(t.params)}function It(t){return(0,Et.isRecord)(t)&&(0,Tt.isString)(t.jsonrpc)&&(0,Tt.isString)(t.id)&&(0,At.isntUndefined)(t.result)}function Dt(t){return(0,Et.isRecord)(t)&&(0,Tt.isString)(t.jsonrpc)&&wt(t.id)&&function(t){return(0,Et.isRecord)(t)&&(0,Ot.isNumber)(t.code)&&(0,Tt.isString)(t.message)&&((0,At.isUndefined)(t.data)||(0,Et.isObject)(t.data))}(t.error)}pt.isJsonRpcNotification=St,pt.isntJsonRpcNotification=function(t){return!St(t)},pt.isJsonRpcRequest=Rt,pt.isntJsonRpcRequest=function(t){return!Rt(t)},pt.isJsonRpcSuccess=It,pt.isntJsonRpcSuccess=function(t){return!It(t)},pt.isJsonRpcError=Dt,pt.isntJsonRpcError=function(t){return!Dt(t)};var Pt={};Pt.isntJson=Pt.isJson=void 0,Pt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Pt.isntJson=function t(n){return!t()};var xt={};xt.isAbsoluteURL=void 0,xt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(J,t),r(Y,t),r(H,t),r(W,t),r(K,t),r(et,t),r(ot,t),r(it,t),r(at,t),r(ut,t),r(ft,t),r(pt,t),r(Pt,t),r(q,t),r(bt,t),r(mt,t),r(Q,t),r(F,t),r(xt,t)}(U),B.chunkByAsync=void 0;const jt=U;B.chunkByAsync=function(t,n){return(0,jt.isAsyncIterable)(t)?async function*(t){let e=[],r=0;for await(const o of t)e.push(o),await n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t):async function*(t){let e=[],r=0;for(const o of t)e.push(o),await n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t)};var Ct={};Ct.chunkBy=void 0,Ct.chunkBy=function*(t,n){let e=[],r=0;for(const o of t)e.push(o),n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)};var Bt={chunk:void 0};const Ut=h,Jt=g;Bt.chunk=function(t,n){return(0,Jt.assert)(Number.isInteger(n),"The parameter size must be an integer"),(0,Jt.assert)(n>0,"The parameter size must be greater than 0"),(0,Ut.go)((function*(){let e=[];for(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var Mt={concatAsync:void 0};const Yt=U,qt=h;Mt.concatAsync=function(t,...n){return(0,qt.go)((async function*(){for(const e of[t,...n])if((0,Yt.isAsyncIterable)(e))for await(const t of e)yield t;else for(const t of e)yield t}))};var kt={concat:void 0};const Ft=h;kt.concat=function(t,...n){return(0,Ft.go)((function*(){for(const e of[t,...n])yield*e}))};var Lt={},Xt={};Xt.copyIterable=Xt.copyAsyncIterable=void 0,Xt.copyAsyncIterable=async function*(t){for await(const n of t)yield n},Xt.copyIterable=function*(t){for(const n of t)yield n},Lt.dropAsync=void 0;const zt=h,Gt=Xt,Ht=g;Lt.dropAsync=function(t,n){return(0,Ht.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Ht.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,Gt.copyAsyncIterable)(t):(0,zt.go)((async function*(){var e;const r=t[Symbol.asyncIterator]();let o;try{let t;for(;!(({value:t,done:o}=await r.next()),o||n<=0);)n--;for(;!o;)yield t,({value:t,done:o}=await r.next())}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var $t={dropRightAsync:void 0};const Wt=h,Vt=Xt,Kt=g;$t.dropRightAsync=function(t,n){return(0,Kt.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Kt.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,Vt.copyAsyncIterable)(t):(0,Wt.go)((async function*(){const e=(await async function(t){const n=[];for await(const e of t)n.push(e);return n}(t)).slice(0,-n);for(const t of e)yield t}))};var Qt={dropRight:void 0};const Zt=h,tn=Xt,nn=g;Qt.dropRight=function(t,n){return(0,nn.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,nn.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,tn.copyIterable)(t):(0,Zt.go)((function*(){const e=Array.from(t);yield*e.slice(0,-n)}))};var en={dropUntilAsync:void 0};const rn=U;en.dropUntilAsync=function(t,n){return(0,rn.isAsyncIterable)(t)?async function*(t){var e;const r=t[Symbol.asyncIterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=await r.next()),o||await n(t,i++)););for(;!o;)yield t,({value:t,done:o}=await r.next())}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}(t):async function*(t){var e;const r=t[Symbol.iterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=r.next()),o||await n(t,i++)););for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}(t)};var on={};on.dropUntil=void 0,on.dropUntil=function*(t,n){var e;const r=t[Symbol.iterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=r.next()),o||n(t,i++)););for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}};var sn={drop:void 0};const an=h,cn=Xt,un=g;sn.drop=function(t,n){return(0,un.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,un.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,cn.copyIterable)(t):(0,an.go)((function*(){var e;const r=t[Symbol.iterator]();let o;try{let t;for(;!(({value:t,done:o}=r.next()),o||n<=0);)n--;for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}))};var ln={filterAsync:void 0};const fn=U;ln.filterAsync=function(t,n){return(0,fn.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)await n(r,e)&&(yield r),e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e)&&(yield r),e++}(t)};var dn={};dn.filter=void 0,dn.filter=function*(t,n){let e=0;for(const r of t)n(r,e)&&(yield r),e++};var yn={},vn={},pn={flattenByAsync:void 0};const mn=U;function hn(t){return(0,mn.isIterable)(t)&&(0,mn.isntChar)(t)}pn.flattenByAsync=function(t,n){return(0,mn.isAsyncIterable)(t)?async function*(t){const r=1;for await(const o of t)hn(o)&&await n(o,r)?yield*e(o,r+1):yield o}(t):function(t){return e(t,1)}(t);async function*e(t,r){for(const o of t)hn(o)&&await n(o,r)?yield*e(o,r+1):yield o}},vn.flattenDeepAsync=void 0;const bn=pn,gn=g;vn.flattenDeepAsync=function(t,n=1/0){return(0,gn.assert)(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),(0,gn.assert)(n>=0,"The parameter depth must be greater than or equal to 0"),(0,bn.flattenByAsync)(t,((t,e)=>e<=n))},yn.flattenAsync=void 0;const Nn=vn;yn.flattenAsync=function(t){return(0,Nn.flattenDeepAsync)(t,1)};var En={flattenBy:void 0};const Tn=U;En.flattenBy=function(t,n){return function*t(e,r){for(const i of e)(0,Tn.isIterable)(o=i)&&(0,Tn.isntChar)(o)&&n(i,r)?yield*t(i,r+1):yield i;var o}(t,1)};var On={flattenDeep:void 0};const An=En,wn=g;On.flattenDeep=function(t,n=1/0){return(0,wn.assert)(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),(0,wn.assert)(n>=0,"The parameter depth must be greater than or equal to 0"),(0,An.flattenBy)(t,((t,e)=>e<=n))};var _n={flatten:void 0};const Sn=On;_n.flatten=function(t){return(0,Sn.flattenDeep)(t,1)};var Rn={mapAsync:void 0};const In=U;Rn.mapAsync=function(t,n){return(0,In.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)yield await n(r,e),e++}(t):async function*(t){let e=0;for(const r of t)yield await n(r,e),e++}(t)};var Dn={};Dn.map=void 0,Dn.map=function*(t,n){let e=0;for(const r of t)yield n(r,e),e++};var Pn={repeatAsync:void 0};const xn=h,jn=g;Pn.repeatAsync=function(t,n){return(0,jn.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,jn.assert)(n>=0,"The parameter times must be greater than or equal to 0"),n===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,xn.go)((async function*(){const e=[];if(n>0){for await(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Cn={repeat:void 0};const Bn=h,Un=g;Cn.repeat=function(t,n){return(0,Un.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,Un.assert)(n>=0,"The parameter times must be greater than or equal to 0"),n===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,Bn.go)((function*(){const e=[];if(n>0){for(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Jn={sliceAsync:void 0};const Mn=h,Yn=g;Jn.sliceAsync=function(t,n,e=1/0){return(0,Yn.assert)(Number.isInteger(n),"The parameter start must be an integer"),(0,Yn.assert)(n>=0,"The parameter start must be greater than or equal to 0"),(0,Yn.assert)(Number.isInteger(e),"The parameter end must be an integer"),(0,Yn.assert)(e>=n,"The parameter end must be greater than or equal to start"),(0,Mn.go)((async function*(){let r=0;for await(const o of t){if(r>=e)break;r>=n&&(yield o),r++}}))};var qn={slice:void 0};const kn=h,Fn=g;qn.slice=function(t,n,e=1/0){return(0,Fn.assert)(Number.isInteger(n),"The parameter start must be an integer"),(0,Fn.assert)(n>=0,"The parameter start must be greater than or equal to 0"),(0,Fn.assert)(Number.isInteger(e),"The parameter end must be an integer"),(0,Fn.assert)(e>=n,"The parameter end must be greater than or equal to start"),(0,kn.go)((function*(){let r=0;for(const o of t){if(r>=e)break;r>=n&&(yield o),r++}}))};var Ln={};Ln.splitAsync=void 0,Ln.splitAsync=async function*(t,n){let e=[];for await(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var Xn={splitByAsync:void 0};const zn=U;Xn.splitByAsync=function(t,n){return(0,zn.isAsyncIterable)(t)?async function*(t){let e=[],r=0;for await(const o of t)await n(o,r)?(yield e,e=[]):e.push(o),r++;yield e}(t):async function*(t){let e=[],r=0;for(const o of t)await n(o,r)?(yield e,e=[]):e.push(o),r++;yield e}(t)};var Gn={};Gn.splitBy=void 0,Gn.splitBy=function*(t,n){let e=[],r=0;for(const o of t)n(o,r)?(yield e,e=[]):e.push(o),r++;yield e};var Hn={};Hn.split=void 0,Hn.split=function*(t,n){let e=[];for(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var $n={takeAsync:void 0};const Wn=h,Vn=g;$n.takeAsync=function(t,n){return(0,Vn.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Vn.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,Wn.go)((async function*(){if(0!==n)for await(const e of t)if(yield e,0===--n)break}))};var Kn={takeRightAsync:void 0};const Qn=h,Zn=g;Kn.takeRightAsync=function(t,n){return(0,Zn.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Zn.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,Qn.go)((async function*(){var e;const r=t[Symbol.asyncIterator]();let o;try{const t=[];let i;for(;({value:i,done:o}=await r.next()),!o;)t.push(i),t.length>n&&t.shift();yield*t}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var te={takeRight:void 0};const ne=h,ee=g;te.takeRight=function(t,n){return(0,ee.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,ee.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,ne.go)((function*(){var e;const r=t[Symbol.iterator]();let o;try{const t=[];let i;for(;({value:i,done:o}=r.next()),!o;)t.push(i),t.length>n&&t.shift();yield*t}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}))};var re={takeUntilAsync:void 0};const oe=U;re.takeUntilAsync=function(t,n){return(0,oe.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t){if(await n(r,e))break;yield r,e++}}(t):async function*(t){let e=0;for(const r of t){if(await n(r,e))break;yield r,e++}}(t)};var ie={};ie.takeUntil=void 0,ie.takeUntil=function*(t,n){let e=0;for(const r of t){if(n(r,e))break;yield r,e++}};var se={take:void 0};const ae=h,ce=g;se.take=function(t,n){return(0,ce.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,ce.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,ae.go)((function*(){if(0!==n)for(const e of t)if(yield e,0===--n)break}))};var ue={tapAsync:void 0};const le=U;ue.tapAsync=function(t,n){return(0,le.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)await n(r,e),yield r,e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e),yield r,e++}(t)};var fe={};fe.tap=void 0,fe.tap=function*(t,n){let e=0;for(const r of t)n(r,e),yield r,e++};var de={};de.toAsyncIterable=void 0,de.toAsyncIterable=async function*(t){for(const n of t)yield n};var ye={};ye.transformAsync=void 0,ye.transformAsync=async function*(t,n){yield*n(t)};var ve={};ve.transform=void 0,ve.transform=function*(t,n){yield*n(t)};var pe={};pe.uniqAsync=void 0,pe.uniqAsync=async function*(t){const n=new Set;for await(const e of t)n.has(e)||(yield e,n.add(e))};var me={uniqByAsync:void 0};const he=U;me.uniqByAsync=function(t,n){return(0,he.isAsyncIterable)(t)?async function*(t){const e=new Set;let r=0;for await(const o of t){const t=await n(o,r);e.has(t)||(yield o,e.add(t)),r++}}(t):async function*(t){const e=new Set;let r=0;for(const o of t){const t=await n(o,r);e.has(t)||(yield o,e.add(t)),r++}}(t)};var be={};be.uniqBy=void 0,be.uniqBy=function*(t,n){const e=new Set;let r=0;for(const o of t){const t=n(o,r);e.has(t)||(yield o,e.add(t)),r++}};var ge={};ge.uniq=void 0,ge.uniq=function*(t){const n=new Set;for(const e of t)n.has(e)||(yield e,n.add(e))};var Ne={zipAsync:void 0};const Ee=U;var Te;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Te||(Te={})),Ne.zipAsync=function(t,...n){return async function*(...t){var n,e,r,o;const i=t.length,s=t.map((t=>(0,Ee.isAsyncIterable)(t)?[Te.Async,t[Symbol.asyncIterator]()]:[Te.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(i);for(let n=0;n<i;n++){const[e,r]=s[n];let o;if(o=e===Te.Async?await r.next():r.next(),o.done)return void(a[n]=!0);t[n]=o.value}yield t}}finally{const t=s.filter(((t,n)=>!a[n]));for(const[i,s]of t)i===Te.Async?await(null===(e=(n=s).return)||void 0===e?void 0:e.call(n)):null===(o=(r=s).return)||void 0===o||o.call(r)}}(t,...n)};var Oe={};Oe.zip=void 0,Oe.zip=function(t,...n){return function*(...t){const n=t.length,e=t.map((t=>t[Symbol.iterator]())),r=e.map((()=>!1));try{for(;;){const t=new Array(n);for(let o=0;o<n;o++){const{value:n,done:i}=e[o].next();if(i)return void(r[o]=!0);t[o]=n}yield t}}finally{e.filter(((t,n)=>!r[n])).forEach((t=>{var n;return null===(n=t.return)||void 0===n?void 0:n.call(t)}))}}(t,...n)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(m,t),r(B,t),r(Ct,t),r(Bt,t),r(Mt,t),r(kt,t),r(Lt,t),r($t,t),r(Qt,t),r(en,t),r(on,t),r(sn,t),r(ln,t),r(dn,t),r(yn,t),r(pn,t),r(En,t),r(vn,t),r(On,t),r(_n,t),r(Rn,t),r(Dn,t),r(Pn,t),r(Cn,t),r(Jn,t),r(qn,t),r(Ln,t),r(Xn,t),r(Gn,t),r(Hn,t),r($n,t),r(Kn,t),r(te,t),r(re,t),r(ie,t),r(se,t),r(ue,t),r(fe,t),r(de,t),r(ye,t),r(ve,t),r(pe,t),r(me,t),r(be,t),r(ge,t),r(Ne,t),r(Oe,t)}(p);var Ae={},we={};we.consume=void 0,we.consume=function(t,n){return n(t)};var _e={eachAsync:void 0};const Se=U;_e.eachAsync=function(t,n){return(0,Se.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t)await n(r,e),e++}(t):async function(t){let e=0;for(const r of t)await n(r,e),e++}(t)};var Re={};Re.each=void 0,Re.each=function(t,n){let e=0;for(const r of t)n(r,e),e++};var Ie={everyAsync:void 0};const De=U;Ie.everyAsync=function(t,n){return(0,De.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(!await n(r,e))return!1;e++}return!0}(t):async function(t){let e=0;for(const r of t){if(!await n(r,e))return!1;e++}return!0}(t)};var Pe={};Pe.every=void 0,Pe.every=function(t,n){let e=0;for(const r of t){if(!n(r,e))return!1;e++}return!0};var xe={findAsync:void 0};const je=U;xe.findAsync=function(t,n){return(0,je.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return r;e++}return}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return r;e++}return}(t)};var Ce={};Ce.find=void 0,Ce.find=function(t,n){let e=0;for(const r of t){if(n(r,e))return r;e++}};var Be={};Be.firstAsync=void 0,Be.firstAsync=async function(t){for await(const n of t)return n};var Ue={};Ue.first=void 0,Ue.first=function(t){for(const n of t)return n};var Je={};Je.includesAsync=void 0,Je.includesAsync=async function(t,n){for await(const e of t)if(e===n)return!0;return!1};var Me={};Me.includes=void 0,Me.includes=function(t,n){for(const e of t)if(e===n)return!0;return!1};var Ye={};Ye.matchAsync=void 0,Ye.matchAsync=async function(t,n){const e=n.length;let r=0;for await(const o of t)if(o===n[r]&&r++,r===e)return!0;return!1};var qe={};qe.match=void 0,qe.match=function(t,n){const e=n.length;let r=0;for(const o of t)if(o===n[r]&&r++,r===e)return!0;return!1};var ke={reduceAsync:void 0};const Fe=U;ke.reduceAsync=function(t,n,e){return(0,Fe.isUndefined)(e)?function(t,n){return(0,Fe.isAsyncIterable)(t)?e(t):r(t);async function e(t){var e;const r=t[Symbol.asyncIterator]();let o;try{let t,s=await i(r),a=1;for(;({value:t,done:o}=await r.next()),!o;)s=await n(s,t,a++);return s}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}async function i(t){const n=await t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}async function r(t){var e;const r=t[Symbol.iterator]();let o;try{let t,s=i(r),a=1;for(;({value:t,done:o}=r.next()),!o;)s=await n(s,t,a++);return s}finally{o||null===(e=r.return)||void 0===e||e.call(r)}function i(t){const n=t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}}(t,n):function(t,n,e){return(0,Fe.isAsyncIterable)(t)?o(t):r(t);async function r(t){let r=e,o=0;for(const e of t)r=await n(r,e,o++);return r}async function o(t){let r=e,o=0;for await(const e of t)r=await n(r,e,o++);return r}}(t,n,e)};var Le={reduce:void 0};const Xe=U;Le.reduce=function(t,n,e){return(0,Xe.isUndefined)(e)?function(t,n){var e;const r=t[Symbol.iterator]();let o;try{let t,s=i(r),a=1;for(;({value:t,done:o}=r.next()),!o;)s=n(s,t,a++);return s}finally{o||null===(e=r.return)||void 0===e||e.call(r)}function i(t){const n=t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}(t,n):function(t,n,e){let r=e,o=0;for(const e of t)r=n(r,e,o++);return r}(t,n,e)};var ze={someAsync:void 0};const Ge=U;ze.someAsync=function(t,n){return(0,Ge.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return!0;e++}return!1}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return!0;e++}return!1}(t)};var He={};He.some=void 0,He.some=function(t,n){let e=0;for(const r of t){if(n(r,e))return!0;e++}return!1};var $e={};$e.lastAsync=void 0,$e.lastAsync=async function(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t,o;for(;({value:t,done:r}=await e.next()),!r;)o=t;return o}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var We={};We.last=void 0,We.last=function(t){var n;const e=t[Symbol.iterator]();let r;try{let t,o;for(;({value:t,done:r}=e.next()),!r;)o=t;return o}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var Ve={toArrayAsync:void 0};const Ke=we;Ve.toArrayAsync=function(t){return(0,Ke.consume)(t,(async t=>{const n=[];for await(const e of t)n.push(e);return n}))};var Qe={toArray:void 0};const Ze=we;Qe.toArray=function(t){return(0,Ze.consume)(t,(t=>Array.from(t)))};var tr={toSetAsync:void 0};const nr=we;tr.toSetAsync=function(t){return(0,nr.consume)(t,(async t=>{const n=new Set;for await(const e of t)n.add(e);return n}))};var er={toSet:void 0};const rr=we;er.toSet=function(t){return(0,rr.consume)(t,(t=>new Set(t)))},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(we,t),r(_e,t),r(Re,t),r(Ie,t),r(Pe,t),r(xe,t),r(Ce,t),r(Be,t),r(Ue,t),r(Je,t),r(Me,t),r(Ye,t),r(qe,t),r(ke,t),r(Le,t),r(ze,t),r(He,t),r($e,t),r(We,t),r(Ve,t),r(Qe,t),r(tr,t),r(er,t)}(Ae),function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(p,t),r(Ae,t)}(v),y.unwrap=void 0;const or=r,ir=v;y.unwrap=function t(n,e){return(0,or.flatMap)(n,(n=>e(n)?(0,ir.toArray)((0,ir.flatten)((0,ir.map)(n.childNodes,(n=>t(n,e))))):[n]))};var sr={},ar={},cr={};cr.traverseDescendantNodes=void 0,cr.traverseDescendantNodes=function*t(n){for(const e of n.childNodes)yield e,yield*t(e)},ar.findInDescendantNodes=void 0;const ur=cr,lr=v;ar.findInDescendantNodes=function(t,n){return(0,lr.find)((0,ur.traverseDescendantNodes)(t),(t=>n(t)))},sr.find=void 0;const fr=ar;sr.find=function(t,n){return n(t)?t:(0,fr.findInDescendantNodes)(t,n)};var dr={};dr.parse=void 0,dr.parse=function(t){const n=document.createElement("div");return n.innerHTML=t,[...n.childNodes]};var yr={};yr.stringify=void 0,yr.stringify=function(t){const n=document.createElement("div");return t.forEach((t=>n.append(t.cloneNode(!0)))),n.innerHTML};var vr={normalize:void 0};const pr=dr,mr=yr;vr.normalize=function(t){return(0,mr.stringify)((0,pr.parse)(t))};var hr={};hr.removeAttributes=void 0,hr.removeAttributes=function(t,n){if(t instanceof Element){const e=Array.from(t.attributes).map((t=>t.name));for(const r of e)n(r)&&t.removeAttribute(r)}};var br={},gr={},Nr={};!function(t){t.NodeType=void 0;const n="Node"in globalThis;var e;(e=t.NodeType||(t.NodeType={}))[e.ELEMENT_NODE=n?globalThis.Node.ELEMENT_NODE:1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=n?globalThis.Node.ATTRIBUTE_NODE:2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=n?globalThis.Node.TEXT_NODE:3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=n?globalThis.Node.CDATA_SECTION_NODE:4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=n?globalThis.Node.ENTITY_REFERENCE_NODE:5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=n?globalThis.Node.ENTITY_NODE:6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=n?globalThis.Node.PROCESSING_INSTRUCTION_NODE:7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=n?globalThis.Node.COMMENT_NODE:8]="COMMENT_NODE",e[e.DOCUMENT_NODE=n?globalThis.Node.DOCUMENT_NODE:9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=n?globalThis.Node.DOCUMENT_TYPE_NODE:10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=n?globalThis.Node.DOCUMENT_FRAGMENT_NODE:11]="DOCUMENT_FRAGMENT_NODE",e[e.NOTATION_NODE=n?globalThis.Node.NOTATION_NODE:12]="NOTATION_NODE"}(Nr);var Er={},Tr={};function Or(t){return Array.isArray(t)}Tr.isntEmptyArray=Tr.isEmptyArray=Tr.isntArray=Tr.isArray=void 0,Tr.isArray=Or,Tr.isntArray=function(t){return!Or(t)},Tr.isEmptyArray=function(t){return 0===t.length},Tr.isntEmptyArray=function(t){return 0!==t.length};var Ar={},wr={};function _r(t){return null===t}wr.isntNull=wr.isNull=void 0,wr.isNull=_r,wr.isntNull=function(t){return!_r(t)};var Sr={};function Rr(t){return void 0===t}Sr.isntUndefined=Sr.isUndefined=void 0,Sr.isUndefined=Rr,Sr.isntUndefined=function(t){return!Rr(t)},Ar.isntAsyncIterable=Ar.isAsyncIterable=void 0;const Ir=wr,Dr=Sr;function Pr(t){return(0,Ir.isntNull)(t)&&(0,Dr.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Ar.isAsyncIterable=Pr,Ar.isntAsyncIterable=function(t){return!Pr(t)};var xr={};function jr(t){return"bigint"==typeof t}xr.isntBigInt=xr.isBigInt=void 0,xr.isBigInt=jr,xr.isntBigInt=function(t){return!jr(t)};var Cr={};function Br(t){return"boolean"==typeof t}Cr.isntBoolean=Cr.isBoolean=void 0,Cr.isBoolean=Br,Cr.isntBoolean=function(t){return!Br(t)};var Ur={},Jr={};function Mr(t){return"string"==typeof t}Jr.isntString=Jr.isString=void 0,Jr.isString=Mr,Jr.isntString=function(t){return!Mr(t)},Ur.isntChar=Ur.isChar=void 0;const Yr=Jr;function qr(t){return(0,Yr.isString)(t)&&1===t.length}Ur.isChar=qr,Ur.isntChar=function(t){return!qr(t)};var kr={};function Fr(t){return t instanceof Date}kr.isntDate=kr.isDate=void 0,kr.isDate=Fr,kr.isntDate=function(t){return!Fr(t)};var Lr={};Lr.inEnum=void 0,Lr.inEnum=function(t,n){return Object.values(n).includes(t)};var Xr={};function zr(t){return t instanceof Error}Xr.isntError=Xr.isError=void 0,Xr.isError=zr,Xr.isntError=function(t){return!zr(t)};var Gr={};function Hr(t){return!t}Gr.isntFalsy=Gr.isFalsy=void 0,Gr.isFalsy=Hr,Gr.isntFalsy=function(t){return!Hr(t)};var $r={};function Wr(t){return"function"==typeof t}$r.isntFunction=$r.isFunction=void 0,$r.isFunction=Wr,$r.isntFunction=function(t){return!Wr(t)};var Vr={};Vr.isntIterable=Vr.isIterable=void 0;const Kr=wr,Qr=Sr;function Zr(t){return(0,Kr.isntNull)(t)&&(0,Qr.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Vr.isIterable=Zr,Vr.isntIterable=function(t){return!Zr(t)};var to={},no={};function eo(t){return null!==t&&"object"==typeof t}no.isntEmptyObject=no.isEmptyObject=no.isRecord=no.isntObject=no.isObject=void 0,no.isObject=eo,no.isntObject=function(t){return!eo(t)},no.isRecord=function(t){return eo(t)},no.isEmptyObject=function(t){return 0===Object.keys(t).length},no.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var ro={};function oo(t){return"number"==typeof t}ro.isntNumber=ro.isNumber=void 0,ro.isNumber=oo,ro.isntNumber=function(t){return!oo(t)},to.isntJsonRpcError=to.isJsonRpcError=to.isntJsonRpcSuccess=to.isJsonRpcSuccess=to.isntJsonRpcRequest=to.isJsonRpcRequest=to.isntJsonRpcNotification=to.isJsonRpcNotification=void 0;const io=Tr,so=no,ao=Jr,co=ro,uo=Sr;function lo(t){return(0,ao.isString)(t)||(0,co.isNumber)(t)}function fo(t){return(0,io.isArray)(t)||(0,so.isObject)(t)}function yo(t){return(0,so.isRecord)(t)&&(0,ao.isString)(t.jsonrpc)&&(0,ao.isString)(t.method)&&(0,uo.isUndefined)(t.id)&&fo(t.params)}function vo(t){return(0,so.isRecord)(t)&&(0,ao.isString)(t.jsonrpc)&&(0,ao.isString)(t.method)&&lo(t.id)&&fo(t.params)}function po(t){return(0,so.isRecord)(t)&&(0,ao.isString)(t.jsonrpc)&&(0,ao.isString)(t.id)&&"result"in t}function mo(t){return(0,so.isRecord)(t)&&(0,ao.isString)(t.jsonrpc)&&lo(t.id)&&function(t){return(0,so.isRecord)(t)&&(0,co.isNumber)(t.code)&&(0,ao.isString)(t.message)&&((0,uo.isUndefined)(t.data)||(0,so.isObject)(t.data))}(t.error)}to.isJsonRpcNotification=yo,to.isntJsonRpcNotification=function(t){return!yo(t)},to.isJsonRpcRequest=vo,to.isntJsonRpcRequest=function(t){return!vo(t)},to.isJsonRpcSuccess=po,to.isntJsonRpcSuccess=function(t){return!po(t)},to.isJsonRpcError=mo,to.isntJsonRpcError=function(t){return!mo(t)};var ho={};ho.isntJson=ho.isJson=void 0,ho.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},ho.isntJson=function t(n){return!t()};var bo={};bo.isAbsoluteURL=void 0,bo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Tr,t),r(Ar,t),r(xr,t),r(Cr,t),r(Ur,t),r(kr,t),r(Lr,t),r(Xr,t),r(Gr,t),r($r,t),r(Vr,t),r(to,t),r(ho,t),r(wr,t),r(ro,t),r(no,t),r(Jr,t),r(Sr,t),r(bo,t)}(Er),gr.isDocument=void 0;const go=Nr,No=Er;gr.isDocument=function(t){return"HTMLDocument"in globalThis&&t instanceof HTMLDocument||(0,No.isRecord)(t)&&t.nodeType===go.NodeType.DOCUMENT_NODE};var Eo={isElement:void 0};const To=Nr,Oo=Er;Eo.isElement=function(t){return"HTMLElement"in globalThis&&t instanceof HTMLElement||(0,Oo.isRecord)(t)&&t.nodeType===To.NodeType.ELEMENT_NODE},br.getBySelector=void 0;const Ao=gr,wo=Eo;br.getBySelector=function(t){const n=((0,wo.isElement)(this)||(0,Ao.isDocument)(this)?this:document).querySelector(t);if(n)return n;throw new Error(`Could not find any elements matching ${t}`)};var _o={getAllBySelector:void 0};const So=gr,Ro=Eo;_o.getAllBySelector=function(t){const n=((0,Ro.isElement)(this)||(0,So.isDocument)(this)?this:document).querySelectorAll(t);if(n.length)return Array.from(n);throw new Error(`Could not find any elements matching ${t}`)};var Io={};Io.traverseAncestorNodes=void 0,Io.traverseAncestorNodes=function*t(n){const e=n.parentNode;e&&(yield e,yield*t(e))};var Do={findInAncestorNodes:void 0};const Po=Io,xo=v;Do.findInAncestorNodes=function(t,n){return(0,xo.find)((0,Po.traverseAncestorNodes)(t),(t=>n(t)))};var jo={};jo.findInFollowingSiblingNodes=void 0,jo.findInFollowingSiblingNodes=function t(n,e){const r=n.nextSibling;if(r)return e(r)?r:t(r,e)};var Co={};Co.findInPrecedingSiblingNodes=void 0,Co.findInPrecedingSiblingNodes=function t(n,e){const r=n.previousSibling;if(r)return e(r)?r:t(r,e)};var Bo={parentNode:void 0};const Uo=g;function Jo(t,n){const e=t.parentNode;if(e)return 1===n?e:Jo(e,n-1)}Bo.parentNode=function(t,n=1){return(0,Uo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Uo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),Jo(t,n)};var Mo={nextSibling:void 0};const Yo=g;function qo(t,n){const e=t.nextSibling;if(e)return 1===n?e:qo(e,n-1)}Mo.nextSibling=function(t,n=1){return(0,Yo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Yo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),qo(t,n)};var ko={previousSibling:void 0};const Fo=g;ko.previousSibling=function(t,n=1){return(0,Fo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Fo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),function t(n,e=1){const r=n.previousSibling;if(!r)return;return 1===e?r:t(r,e-1)}(t,n)};var Lo={nextElementSibling:void 0};const Xo=Eo,zo=g;function Go(t,n){const e=t.nextSibling;if(e)return(0,Xo.isElement)(e)?1===n?e:Go(e,n-1):Go(e,n)}Lo.nextElementSibling=function(t,n=1){return(0,zo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,zo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),Go(t,n)};var Ho={previousElementSibling:void 0};const $o=Eo,Wo=g;Ho.previousElementSibling=function(t,n=1){return(0,Wo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Wo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),function t(n,e=1){const r=n.previousSibling;if(!r)return;return(0,$o.isElement)(r)?1===e?r:t(r,e-1):t(r,e)}(t,n)};var Vo={isntDocument:void 0};const Ko=gr;Vo.isntDocument=function(t){return!(0,Ko.isDocument)(t)};var Qo={isntElement:void 0};const Zo=Eo;Qo.isntElement=function(t){return!(0,Zo.isElement)(t)};var ti={isNode:void 0};const ni=Er;ti.isNode=function(t){return"Node"in globalThis&&t instanceof Node||(0,ni.isObject)(t)&&"nodeType"in t};var ei={isntNode:void 0};const ri=ti;ei.isntNode=function(t){return!(0,ri.isNode)(t)};var oi={isTextNode:void 0};const ii=Nr,si=Er;oi.isTextNode=function(t){return"Text"in globalThis&&t instanceof Text||(0,si.isRecord)(t)&&t.nodeType===ii.NodeType.TEXT_NODE};var ai={isntTextNode:void 0};const ci=oi;ai.isntTextNode=function(t){return!(0,ci.isTextNode)(t)};var ui={isParentNode:void 0};const li=ti;ui.isParentNode=function(t){return(0,li.isNode)(t)&&"children"in t};var fi={isntParentNode:void 0};const di=ui;fi.isntParentNode=function(t){return!(0,di.isParentNode)(t)};var yi={};!function(t){t.XPathResultType=void 0;const n="XPathResult"in globalThis;var e;(e=t.XPathResultType||(t.XPathResultType={}))[e.ANY_TYPE=n?globalThis.XPathResult.ANY_TYPE:0]="ANY_TYPE",e[e.NUMBER_TYPE=n?globalThis.XPathResult.NUMBER_TYPE:1]="NUMBER_TYPE",e[e.STRING_TYPE=n?globalThis.XPathResult.STRING_TYPE:2]="STRING_TYPE",e[e.BOOLEAN_TYPE=n?globalThis.XPathResult.BOOLEAN_TYPE:3]="BOOLEAN_TYPE",e[e.UNORDERED_NODE_ITERATOR_TYPE=n?globalThis.XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4]="UNORDERED_NODE_ITERATOR_TYPE",e[e.ORDERED_NODE_ITERATOR_TYPE=n?globalThis.XPathResult.ORDERED_NODE_ITERATOR_TYPE:5]="ORDERED_NODE_ITERATOR_TYPE",e[e.UNORDERED_NODE_SNAPSHOT_TYPE=n?globalThis.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:6]="UNORDERED_NODE_SNAPSHOT_TYPE",e[e.ORDERED_NODE_SNAPSHOT_TYPE=n?globalThis.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:7]="ORDERED_NODE_SNAPSHOT_TYPE",e[e.ANY_UNORDERED_NODE_TYPE=n?globalThis.XPathResult.ANY_UNORDERED_NODE_TYPE:8]="ANY_UNORDERED_NODE_TYPE",e[e.FIRST_ORDERED_NODE_TYPE=n?globalThis.XPathResult.FIRST_ORDERED_NODE_TYPE:9]="FIRST_ORDERED_NODE_TYPE"}(yi);var vi={replaceBrWithNewline:void 0};const pi=u;vi.replaceBrWithNewline=function(t){return(0,pi.map)(t,(t=>"BR"===t.nodeName?document.createTextNode("\n"):t))};var mi={};mi.isBefore=void 0,mi.isBefore=function(t,n){return!!(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)};var hi={};function bi(t,n,...e){if(0===e.length)return!0;if(!n)return!1;const[r,...o]=e,i=Reflect.apply(r,t,[n]);if(Er.isBoolean(i)){if(i){const e=t.next(n);return bi(t,e,...o)}return!1}if(Er.isNumber(i)){const e=i,r=t.next(n,e);return bi(t,r,...o)}if(Er.isIterable(i)){for(const e of i){const r=t.next(n,e);if(bi(t,r,...o))return!0}return!1}throw new Error("Unknown return value")}function gi(t,n=1){return 0===n?t:e.nextSibling(t,n)}function Ni(t,n=1){return 0===n?t:e.nextElementSibling(t,n)}function Ei(t,n){for(const[e,r]of Object.entries(n))t[e]?Er.isArray(t[e])?Er.isArray(r)?t[e]=[...t[e],...r]:t[e]=[...t[e],r]:Er.isArray(r)?t[e]=[t[e],...r]:t[e]=[t[e],r]:t[e]=r}function Ti(t,n){const e=[];for(let r=0,o=n.length;r<o;r++)e.push(t[r]),e.push(n[r]);return e.push(t[t.length-1]),e}hi.isAfter=void 0,hi.isAfter=function(t,n){return!!(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),o=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};o(r,t),o(u,t),o(f,t),o(y,t),o(sr,t),o(dr,t),o(yr,t),o(vr,t),o(s,t),o(hr,t),o(br,t),o(_o,t),o(Io,t),o(Do,t),o(cr,t),o(ar,t),o(jo,t),o(Co,t),o(Bo,t),o(Mo,t),o(ko,t),o(Lo,t),o(Ho,t),o(gr,t),o(Vo,t),o(Eo,t),o(Qo,t),o(ti,t),o(ei,t),o(oi,t),o(ai,t),o(ui,t),o(fi,t),o(Nr,t),o(yi,t),o(vi,t),o(mi,t),o(hi,t)}(e);var Oi={},Ai={};Ai.of=void 0,Ai.of=function*(t){yield t};var wi={},_i={},Si={};Si.go=void 0,Si.go=function(t){return t()},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]});(n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(Si,t)}(_i),wi.repeat=void 0;const Ri=g,Ii=_i;wi.repeat=function(t,n=1/0){return(0,Ri.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,Ii.go)((function*(){for(;n-- >0;)yield t}))};var Di={};Di.countdown=void 0,Di.countdown=function*(t,n){if(!(t<n))for(let e=t;e>=n;e--)yield e};var Pi={};Pi.countup=void 0,Pi.countup=function*(t,n){if(!(t>n))for(let e=t;e<=n;e++)yield e};var xi={range:void 0};const ji=g;xi.range=function(t,n,e=1){return(0,ji.assert)(e>0,"step parameter must be greater than 0"),function*(t,n,e){if(t<n)for(let r=t;r<n;r+=e)yield r;else for(let r=t;r>n;r-=e)yield r}(t,n,e)};var Ci={};Ci.stringifyJSONStream=void 0,Ci.stringifyJSONStream=function*(t){var n;const e=t[Symbol.iterator]();let r;try{let t;for(({value:t,done:r}=e.next()),yield"[",r||(yield JSON.stringify(t));({value:t,done:r}=e.next()),!r;)yield","+JSON.stringify(t);yield"]"}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var Bi={};Bi.stringifyJSONStreamAsync=void 0,Bi.stringifyJSONStreamAsync=async function*(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t;for(({value:t,done:r}=await e.next()),yield"[",r||(yield JSON.stringify(t));({value:t,done:r}=await e.next()),!r;)yield","+JSON.stringify(t);yield"]"}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var Ui={};Ui.stringifyNDJSONStream=void 0,Ui.stringifyNDJSONStream=function*(t){var n;const e=t[Symbol.iterator]();let r;try{let t;for(({value:t,done:r}=e.next()),r||(yield JSON.stringify(t));({value:t,done:r}=e.next()),!r;)yield"\n"+JSON.stringify(t)}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var Ji={};Ji.stringifyNDJSONStreamAsync=void 0,Ji.stringifyNDJSONStreamAsync=async function*(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t;for(({value:t,done:r}=await e.next()),r||(yield JSON.stringify(t));({value:t,done:r}=await e.next()),!r;)yield"\n"+JSON.stringify(t)}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var Mi={};Mi.sse=void 0,Mi.sse=function*(t){t.event&&(yield`event: ${t.event}\n`);for(const n of t.data.split("\n"))yield`data: ${n}\n`;t.id&&(yield`id: ${t.id}\n`),t.retry&&(yield`retry: ${t.retry}\n`),yield"\n"};var Yi={},qi={},ki={},Fi=1/0,Li=17976931348623157e292,Xi=NaN,zi="[object Symbol]",Gi=/^\s+|\s+$/g,Hi=/^[-+]0x[0-9a-f]+$/i,$i=/^0b[01]+$/i,Wi=/^0o[0-7]+$/i,Vi=parseInt,Ki=Object.prototype.toString;function Qi(t,n){var e;if("function"!=typeof n)throw new TypeError("Expected a function");return t=function(t){var n=function(t){if(!t)return 0===t?t:0;if((t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&Ki.call(t)==zi}(t))return Xi;if(Zi(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Zi(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Gi,"");var e=$i.test(t);return e||Wi.test(t)?Vi(t.slice(2),e?2:8):Hi.test(t)?Xi:+t}(t))===Fi||t===-1/0){return(t<0?-1:1)*Li}return t==t?t:0}(t),e=n%1;return n==n?e?n-e:n:0}(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=void 0),e}}function Zi(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var ts=function(t){return Qi(2,t)},ns=n&&n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};ki.lazy=void 0;const es=ns(ts);ki.lazy=function(t){return(0,es.default)(t)};var rs={lazyFunction:void 0};const os=ki;rs.lazyFunction=function(t){const n=(0,os.lazy)(t);return(...t)=>n()(...t)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(ki,t),r(rs,t)}(qi);var is,ss=n&&n.__classPrivateFieldGet||function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)},as=n&&n.__classPrivateFieldSet||function(t,n,e,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,e):o?o.value=e:n.set(t,e),e};Yi.ReusableIterable=void 0;const cs=qi;class us{constructor(t){is.set(this,void 0),this.getIterator=(0,cs.lazy)((()=>t[Symbol.iterator]()))}get done(){return ss(this,is,"f")}close(){var t,n;this.done||(as(this,is,!0,"f"),null===(n=(t=this.getIterator()).return)||void 0===n||n.call(t))}[(is=new WeakMap,Symbol.iterator)](){return{next:()=>{if(ss(this,is,"f"))return{done:!0,value:void 0};const{value:t,done:n}=this.getIterator().next();return n&&as(this,is,!0,"f"),{value:t,done:n}}}}}Yi.ReusableIterable=us;var ls,fs={},ds=n&&n.__classPrivateFieldGet||function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)},ys=n&&n.__classPrivateFieldSet||function(t,n,e,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,e):o?o.value=e:n.set(t,e),e};fs.ReusableAsyncIterable=void 0;const vs=qi;class ps{constructor(t){ls.set(this,void 0),this.getIterator=(0,vs.lazy)((()=>t[Symbol.asyncIterator]()))}get done(){return ds(this,ls,"f")}async close(){var t,n;this.done||(ys(this,ls,!0,"f"),await(null===(n=(t=this.getIterator()).return)||void 0===n?void 0:n.call(t)))}[(ls=new WeakMap,Symbol.asyncIterator)](){return{next:async()=>{if(ds(this,ls,"f"))return{done:!0,value:void 0};const{value:t,done:n}=await this.getIterator().next();return n&&ys(this,ls,!0,"f"),{value:t,done:n}}}}}fs.ReusableAsyncIterable=ps;var ms,hs={};function bs(t,n,e){let r=t;for(const t of Oi.countup(1,n)){if(!r)return t-1;if(!e.call(this,r))return t-1;r=this.next(r)}return n}function gs([t,n],e,r={greedy:!0}){return g.assert(Number.isInteger(t),"parameter min must be an integer"),g.assert(Number.isInteger(n)||n===1/0,"parameter max must be an integer or Infinity"),g.assert(t>=0,"parameter min must be greater than or equal to 0"),g.assert(t<=n,"parameter max must be greater than or equal to min"),function*(o){if(r.greedy){let r=n;for(;;){const n=bs.call(this,o,r,e);if(n<t)break;if(yield n,r=n-1,r<t)break}}else for(const r of Oi.countup(t,n)){const t=bs.call(this,o,r,e);if(t<r)break;t===r&&(yield r)}}}hs.timestampBasedId=void 0,hs.timestampBasedId=function*(){const t=Date.now();yield[t,0];let n=t,e=0;for(;;){const t=Date.now();t===n?yield[n,++e]:(e=0,n=t,yield[n,e])}},function(t){var e=n&&n.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Ai,t),r(wi,t),r(Di,t),r(Pi,t),r(xi,t),r(Ci,t),r(Bi,t),r(Ui,t),r(Ji,t),r(Mi,t),r(Yi,t),r(fs,t),r(hs,t)}(Oi),function(t){t[t.Min=0]="Min",t[t.Max=1]="Max"}(ms||(ms={}));const Ns="XPathResult"in globalThis?XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4;t.anyOf=function(...t){return function(n){return t.some((t=>t.call(this,n)))}},t.childNodes=function(...t){return function(n){if(0===t.length)return 0===n.childNodes.length;if(0===n.childNodes.length)return!1;const e=Object.assign(Object.assign({},this),{collection:{},next:gi}),r=bi(e,n.childNodes[0],...t);return r&&Ei(this.collection,e.collection),r}},t.children=function(...t){return function(n){if(0===t.length)return 0===n.children.length;if(0===n.children.length)return!1;const e=Object.assign(Object.assign({},this),{collection:{},next:Ni}),r=bi(e,n.children[0],...t);return r&&Ei(this.collection,e.collection),r}},t.css=function t(...n){if(Er.isString(n[0])){const[t]=n;return n=>n.matches(t)}{const[e,...r]=n;return t(Ti(e,r).join(""))}},t.element=function t(...n){if(Er.isArray(n[0])){const[e,...r]=n,o=Ti(e,r).join("");return(...n)=>t(o,...n)}if(Er.isString(n[0])){const[e,...r]=n;return function(n){const o=t(...r).call(this,n);return o&&Ei(this.collection,{[e]:n}),o}}const[...r]=n;return function(t){return!e.isntElement(t)&&(0===r.length||r.every((n=>n.call(this,t))))}},t.match=function(t,...n){const r={document:e.isDocument(this)?this:globalThis.document,collection:{},next:gi};return bi(r,t,...n)?r.collection:null},t.matchElement=function(t,...n){const r={document:e.isDocument(this)?this:globalThis.document,collection:{},next:Ni};return bi(r,t,...n)?r.collection:null},t.multiple=gs,t.node=function t(...n){if(Er.isArray(n[0])){const[e,...r]=n,o=Ti(e,r).join("");return(...n)=>t(o,...n)}if(Er.isString(n[0])){const[e,...r]=n;return function(n){const o=t(...r).call(this,n);return o&&Ei(this.collection,{[e]:n}),o}}const[...e]=n;return function(t){return 0===e.length||e.every((n=>n.call(this,t)))}},t.optional=function(t){return gs([0,1],t,{greedy:!0})},t.repeat=function(t,n){return g.assert(Number.isInteger(t),"parameter times must be an integer"),g.assert(t>=0,"parameter number must be greater than or equal to 0"),function(e){return bs.call(this,e,t,n)===t&&t}},t.tap=function(t,n){return function(e){const r=t.call(this,e);return n(r),r}},t.textContentEquals=function(t,{caseSensitive:n=!0,trim:e=!1}={}){return r=>{if(Er.isNull(r.textContent))return!1;let o=r.textContent;return n||(o=o.toLowerCase(),t=t.toLowerCase()),e&&(o=o.trim()),o===t}},t.textContentIncludes=function(t,{caseSensitive:n=!0,trim:e=!1}={}){return r=>{if(Er.isNull(r.textContent))return!1;let o=r.textContent;return n||(o=o.toLowerCase(),t=t.toLowerCase()),e&&(o=o.trim()),o.includes(t)}},t.textContentMatches=function(t,{trim:n=!1}={}){return e=>{if(Er.isNull(e.textContent))return!1;let r=e.textContent;return n&&(r=r.trim()),t.test(r)}},t.textNode=function t(...n){if(Er.isArray(n[0])){const[e,...r]=n,o=Ti(e,r).join("");return(...n)=>t(o,...n)}if(Er.isString(n[0])){const[e,...r]=n;return function(n){const o=t(...r).call(this,n);return o&&Ei(this.collection,{[e]:n}),o}}const[...r]=n;return function(t){return!e.isntTextNode(t)&&(0===r.length||r.every((n=>n.call(this,t))))}},t.xpath=function t(...n){if(Er.isString(n[0])){const[t]=n;return g.assert(t.startsWith("//*"),'XPath expressions must start with "//*"'),function(n){return function(t,n,e){const r=t.evaluate(n,e,null,Ns,null);let o;for(;null!==(o=r.iterateNext());)if(o===e)return!0;return!1}(this.document,t,n)}}{const[e,...r]=n;return t(Ti(e,r).join(""))}},Object.defineProperty(t,"__esModule",{value:!0})}));
9
2
  //# sourceMappingURL=index.umd.min.js.map