UNPKG

@e-invoice-eu/core

Version:

Generate e-invoices (E-Rechnung in German) conforming to EN16931 (Factur-X/ZUGFeRD, UBL, CII, XRechnung aka X-Rechnung) from LibreOffice Calc/Excel data or JSON.

1 lines 1.85 MB
!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).eInvoiceEU={})}(this,(function(e){"use strict";class t{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+t.version}static addUnaryOp(e){return t.max_unop_len=Math.max(e.length,t.max_unop_len),t.unary_ops[e]=1,t}static addBinaryOp(e,r,n){return t.max_binop_len=Math.max(e.length,t.max_binop_len),t.binary_ops[e]=r,n?t.right_associative.add(e):t.right_associative.delete(e),t}static addIdentifierChar(e){return t.additional_identifier_chars.add(e),t}static addLiteral(e,r){return t.literals[e]=r,t}static removeUnaryOp(e){return delete t.unary_ops[e],e.length===t.max_unop_len&&(t.max_unop_len=t.getMaxKeyLen(t.unary_ops)),t}static removeAllUnaryOps(){return t.unary_ops={},t.max_unop_len=0,t}static removeIdentifierChar(e){return t.additional_identifier_chars.delete(e),t}static removeBinaryOp(e){return delete t.binary_ops[e],e.length===t.max_binop_len&&(t.max_binop_len=t.getMaxKeyLen(t.binary_ops)),t.right_associative.delete(e),t}static removeAllBinaryOps(){return t.binary_ops={},t.max_binop_len=0,t}static removeLiteral(e){return delete t.literals[e],t}static removeAllLiterals(){return t.literals={},t}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new t(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map((e=>e.length)))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return t.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!t.binary_ops[String.fromCharCode(e)]||t.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return t.isIdentifierStart(e)||t.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,r){if(t.hooks[e]){const n={context:this,node:r};return t.hooks.run(e,n),n.node}return r}searchHook(e){if(t.hooks[e]){const r={context:this};return t.hooks[e].find((function(e){return e.call(r.context,r),r.node})),r.node}}gobbleSpaces(){let e=this.code;for(;e===t.SPACE_CODE||e===t.TAB_CODE||e===t.LF_CODE||e===t.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),r=1===e.length?e[0]:{type:t.COMPOUND,body:e};return this.runHook("after-all",r)}gobbleExpressions(e){let r,n,i=[];for(;this.index<this.expr.length;)if(r=this.code,r===t.SEMCOL_CODE||r===t.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())i.push(n);else if(this.index<this.expr.length){if(r===e)break;this.throwError('Unexpected "'+this.char+'"')}return i}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,t.max_binop_len),r=e.length;for(;r>0;){if(t.binary_ops.hasOwnProperty(e)&&(!t.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!t.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=r,e;e=e.substr(0,--r)}return!1}gobbleBinaryExpression(){let e,r,n,i,o,a,s,c,l;if(a=this.gobbleToken(),!a)return a;if(r=this.gobbleBinaryOp(),!r)return a;for(o={value:r,prec:t.binaryPrecedence(r),right_a:t.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=t.binaryPrecedence(r),0===n){this.index-=r.length;break}o={value:r,prec:n,right_a:t.right_associative.has(r)},l=r;const c=e=>o.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),e={type:t.BINARY_EXP,operator:r,left:a,right:s},i.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),i.push(o,e)}for(c=i.length-1,e=i[c];c>1;)e={type:t.BINARY_EXP,operator:i[c-1].value,left:i[c-2],right:e},c-=2;return e}gobbleToken(){let e,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(e=this.code,t.isDecimalDigit(e)||e===t.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===t.SQUOTE_CODE||e===t.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(e===t.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,t.max_unop_len),n=r.length;n>0;){if(t.unary_ops.hasOwnProperty(r)&&(!t.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!t.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;const e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:t.UNARY_EXP,operator:r,argument:e,prefix:!0})}r=r.substr(0,--n)}t.isIdentifierStart(e)?(i=this.gobbleIdentifier(),t.literals.hasOwnProperty(i.name)?i={type:t.LITERAL,value:t.literals[i.name],raw:i.name}:i.name===t.this_str&&(i={type:t.THIS_EXP})):e===t.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let r=this.code;for(;r===t.PERIOD_CODE||r===t.OBRACK_CODE||r===t.OPAREN_CODE||r===t.QUMARK_CODE;){let n;if(r===t.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==t.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===t.OBRACK_CODE?((e={type:t.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==t.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===t.OPAREN_CODE?e={type:t.CALL_EXP,arguments:this.gobbleArguments(t.CPAREN_CODE),callee:e}:(r===t.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:t.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),r=this.code}return e}gobbleNumericLiteral(){let e,r,n="";for(;t.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===t.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);t.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(n+=this.expr.charAt(this.index++),e=this.char,"+"!==e&&"-"!==e||(n+=this.expr.charAt(this.index++));t.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);t.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return r=this.code,t.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(r===t.PERIOD_CODE||1===n.length&&n.charCodeAt(0)===t.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:t.LITERAL,value:parseFloat(n),raw:n}}gobbleStringLiteral(){let e="";const r=this.index,n=this.expr.charAt(this.index++);let i=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){i=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||this.throwError('Unclosed quote after "'+e+'"'),{type:t.LITERAL,value:e,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let e=this.code,r=this.index;for(t.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,t.isIdentifierPart(e));)this.index++;return{type:t.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(e){const r=[];let n=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===e){n=!0,this.index++,e===t.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(o===t.COMMA_CODE){if(this.index++,i++,i!==r.length)if(e===t.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===t.CBRACK_CODE)for(let e=r.length;e<i;e++)r.push(null)}else if(r.length!==i&&0!==i)this.throwError("Expected comma");else{const e=this.gobbleExpression();e&&e.type!==t.COMPOUND||this.throwError("Expected comma"),r.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),r}gobbleGroup(){this.index++;let e=this.gobbleExpressions(t.CPAREN_CODE);if(this.code===t.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:t.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:t.ARRAY_EXP,elements:this.gobbleArguments(t.CBRACK_CODE)}}}const r=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)}),this)}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}};Object.assign(t,{hooks:r,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach((e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)}))}}(t),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),t.max_unop_len=t.getMaxKeyLen(t.unary_ops),t.max_binop_len=t.getMaxKeyLen(t.binary_ops);const n=e=>new t(e).parse(),i=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(t).filter((e=>!i.includes(e)&&void 0===n[e])).forEach((e=>{n[e]=t[e]})),n.Jsep=t;var o={name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}}))}};n.plugins.register(o);var a={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const r=++this.index;let n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){const n=this.expr.slice(r,this.index);let i,o="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;o+=this.char}try{i=new RegExp(n,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:i,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}};const s={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){s.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach((e=>{e&&"object"==typeof e&&r(e)}))}s.assignmentOperators.forEach((t=>e.addBinaryOp(t,s.assignmentPrecedence,!0))),e.hooks.add("gobble-token",(function(e){const r=this.code;s.updateOperators.some((e=>e===r&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))})),e.hooks.add("after-token",(function(e){if(e.node){const r=this.code;s.updateOperators.some((e=>e===r&&e===this.expr.charCodeAt(this.index+1)))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}})),e.hooks.add("after-expression",(function(e){e.node&&r(e.node)}))}};n.plugins.register(a,s),n.addUnaryOp("typeof"),n.addLiteral("null",null),n.addLiteral("undefined",void 0);const c=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),l={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return l.evalBinaryExpression(e,t);case"Compound":return l.evalCompound(e,t);case"ConditionalExpression":return l.evalConditionalExpression(e,t);case"Identifier":return l.evalIdentifier(e,t);case"Literal":return l.evalLiteral(e,t);case"MemberExpression":return l.evalMemberExpression(e,t);case"UnaryExpression":return l.evalUnaryExpression(e,t);case"ArrayExpression":return l.evalArrayExpression(e,t);case"CallExpression":return l.evalCallExpression(e,t);case"AssignmentExpression":return l.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](l.evalAst(e.left,t),(()=>l.evalAst(e.right,t)))),evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){"Identifier"===e.body[n].type&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&"AssignmentExpression"===e.body[n+1].type&&(n+=1);const i=e.body[n];r=l.evalAst(i,t)}return r},evalConditionalExpression:(e,t)=>l.evalAst(e.test,t)?l.evalAst(e.consequent,t):l.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?l.evalAst(e.property):e.property.name),n=l.evalAst(e.object,t);if(null==n)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&c.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const i=n[r];return"function"==typeof i?i.bind(n):i},evalUnaryExpression:(e,t)=>({"-":e=>-l.evalAst(e,t),"!":e=>!l.evalAst(e,t),"~":e=>~l.evalAst(e,t),"+":e=>+l.evalAst(e,t),typeof:e=>typeof l.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map((e=>l.evalAst(e,t))),evalCallExpression(e,t){const r=e.arguments.map((e=>l.evalAst(e,t)));return l.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=l.evalAst(e.right,t);return t[r]=n,t[r]}};function u(e,t){return(e=e.slice()).push(t),e}function h(e,t){return(t=t.slice()).unshift(e),t}class d extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function f(e,t,r,n,i){if(!(this instanceof f))try{return new f(e,t,r,n,i)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(i=n,n=r,r=t,t=e,e=null);const o=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const n={path:o?e.path:t};o?"json"in e&&(n.json=e.json):n.json=r;const i=this.evaluate(n);if(!i||"object"!=typeof i)throw new d(i);return i}}f.prototype.evaluate=function(e,t,r,n){let i=this.parent,o=this.parentProperty,{flatten:a,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),a=Object.hasOwn(e,"flatten")?e.flatten:a,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,s=Object.hasOwn(e,"wrap")?e.wrap:s,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,"parent")?e.parent:i,o=Object.hasOwn(e,"parentProperty")?e.parentProperty:o,e=e.path}if(i=i||null,o=o||null,Array.isArray(e)&&(e=f.toPathString(e)),!e&&""!==e||!t)return;const c=f.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],i,o,r).filter((function(e){return e&&!e.isParentSelector}));return l.length?s||1!==l.length||l[0].hasArrExpr?l.reduce(((e,t)=>{const r=this._getPreferredOutput(t);return a&&Array.isArray(r)?e=e.concat(r):e.push(r),e}),[]):this._getPreferredOutput(l[0]):s?[]:void 0},f.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:f.toPathArray(e.path);return e.pointer=f.toPointer(t),e.path="string"==typeof e.path?e.path:f.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return f.toPathString(e[t]);case"pointer":return f.toPointer(e.path);default:throw new TypeError("Unknown result type")}},f.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:f.toPathString(e.path),t(n,r,e)}},f.prototype._trace=function(e,t,r,n,i,o,a,s){let c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(c,o,"value"),c;const l=e[0],d=e.slice(1),f=[];function p(e){Array.isArray(e)?e.forEach((e=>{f.push(e)})):f.push(e)}if(("string"!=typeof l||s)&&t&&Object.hasOwn(t,l))p(this._trace(d,t[l],u(r,l),t,l,o,a));else if("*"===l)this._walk(t,(e=>{p(this._trace(d,t[e],u(r,e),t,e,o,!0,!0))}));else if(".."===l)p(this._trace(d,t,r,n,i,o,a)),this._walk(t,(n=>{"object"==typeof t[n]&&p(this._trace(e.slice(),t[n],u(r,n),t,n,o,!0))}));else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if("~"===l)return c={path:u(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if("$"===l)p(this._trace(d,t,r,null,null,o,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))p(this._slice(l,d,t,r,n,i,o));else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),a=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);a?this._walk(t,(e=>{const s=[a[2]],c=a[1]?t[e][a[1]]:t[e];this._trace(s,c,r,n,i,o,!0).length>0&&p(this._trace(d,t[e],u(r,e),t,e,o,!0))})):this._walk(t,(a=>{this._eval(e,t[a],a,r,n,i)&&p(this._trace(d,t[a],u(r,a),t,a,o,!0))}))}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(h(this._eval(l,t,r.at(-1),r.slice(0,-1),n,i),d),t,r,n,i,o,a))}else if("@"===l[0]){let e=!1;const a=l.slice(1,-2);switch(a){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===a&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===a&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,n,i);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+a)}if(e)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if("`"===l[0]&&t&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1);p(this._trace(d,t[e],u(r,e),t,e,o,a,!0))}else if(l.includes(",")){const e=l.split(",");for(const a of e)p(this._trace(h(a,d),t,r,n,i,o,!0))}else!s&&t&&Object.hasOwn(t,l)&&p(this._trace(d,t[l],u(r,l),t,l,o,a,!0))}if(this._hasParentSelector)for(let e=0;e<f.length;e++){const r=f[e];if(r&&r.isParentSelector){const s=this._trace(r.expr,t,r.path,n,i,o,a);if(Array.isArray(s)){f[e]=s[0];const t=s.length;for(let r=1;r<t;r++)e++,f.splice(e,0,s[r])}else f[e]=s}}return f},f.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let e=0;e<r;e++)t(e)}else e&&"object"==typeof e&&Object.keys(e).forEach((e=>{t(e)}))},f.prototype._slice=function(e,t,r,n,i,o,a){if(!Array.isArray(r))return;const s=r.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let u=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),d=d<0?Math.max(0,d+s):Math.min(s,d);const f=[];for(let e=u;e<d;e+=l){this._trace(h(e,t),r,n,i,o,a,!0).forEach((e=>{f.push(e)}))}return f},f.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const a=e.includes("@path");a&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));const s=this.currEval+"Script:"+e;if(!f.cache[s]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(a&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)f.cache[s]=new this.safeVm.Script(t);else if("native"===this.currEval)f.cache[s]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;f.cache[s]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);f.cache[s]={runInNewContext:e=>this.currEval(t,e)}}}try{return f.cache[s].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},f.cache={},f.toPathString=function(e){const t=e,r=t.length;let n="$";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+=/^[0-9*]+$/u.test(t[e])?"["+t[e]+"]":"['"+t[e]+"']");return n},f.toPointer=function(e){const t=e,r=t.length;let n="";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+="/"+t[e].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},f.toPathArray=function(e){const{cache:t}=f;if(t[e])return t[e].concat();const r=[],n=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,(function(e,t){return"[#"+(r.push(t)-1)+"]"})).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,(function(e,t){return"['"+t.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"})).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,(function(e,t){return";"+t.split("").join(";")+";"})).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map((function(e){const t=e.match(/#(\d+)/u);return t&&t[1]?r[t[1]]:e}));return t[e]=n,t[e].concat()},f.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=n(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return l.evalAst(this.ast,t)}}};f.prototype.vm={Script:class{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const r=Object.keys(e),n=[];!function(e,t,r){const n=e.length;for(let i=0;i<n;i++)r(e[i])&&t.push(e.splice(i--,1)[0])}(r,n,(t=>"function"==typeof e[t]));const i=r.map((t=>e[t]));t=n.reduce(((t,r)=>{let n=e[r].toString();return/function/u.test(n)||(n="function "+n),"var "+r+"="+n+";"+t}),"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const o=t.lastIndexOf(";"),a=-1!==o?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return new Function(...r,a)(...i)}}};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var y,v={exports:{}};var b=(y||(y=1,function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=184)}([function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(240)),n(r(251)),n(r(175)),n(r(107)),n(r(29)),n(r(73)),n(r(106)),n(r(30)),n(r(252)),n(r(52)),n(r(97)),n(r(253)),n(r(37)),n(r(51)),n(r(173)),n(r(176)),n(r(172)),n(r(108)),n(r(254)),n(r(255)),n(r(256)),n(r(72)),n(r(177)),n(r(105)),n(r(17)),n(r(257)),n(r(12)),n(r(174))},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Before=0]="Before",e[e.Equal=1]="Equal",e[e.After=2]="After"}(t.BoundaryPosition||(t.BoundaryPosition={})),function(e){e[e.None=0]="None",e[e.Capturing=1]="Capturing",e[e.AtTarget=2]="AtTarget",e[e.Bubbling=3]="Bubbling"}(t.EventPhase||(t.EventPhase={})),function(e){e[e.Element=1]="Element",e[e.Attribute=2]="Attribute",e[e.Text=3]="Text",e[e.CData=4]="CData",e[e.EntityReference=5]="EntityReference",e[e.Entity=6]="Entity",e[e.ProcessingInstruction=7]="ProcessingInstruction",e[e.Comment=8]="Comment",e[e.Document=9]="Document",e[e.DocumentType=10]="DocumentType",e[e.DocumentFragment=11]="DocumentFragment",e[e.Notation=12]="Notation"}(t.NodeType||(t.NodeType={})),function(e){e[e.Disconnected=1]="Disconnected",e[e.Preceding=2]="Preceding",e[e.Following=4]="Following",e[e.Contains=8]="Contains",e[e.ContainedBy=16]="ContainedBy",e[e.ImplementationSpecific=32]="ImplementationSpecific"}(t.Position||(t.Position={})),function(e){e[e.Accept=1]="Accept",e[e.Reject=2]="Reject",e[e.Skip=3]="Skip"}(t.FilterResult||(t.FilterResult={})),function(e){e[e.All=4294967295]="All",e[e.Element=1]="Element",e[e.Attribute=2]="Attribute",e[e.Text=4]="Text",e[e.CDataSection=8]="CDataSection",e[e.EntityReference=16]="EntityReference",e[e.Entity=32]="Entity",e[e.ProcessingInstruction=64]="ProcessingInstruction",e[e.Comment=128]="Comment",e[e.Document=256]="Document",e[e.DocumentType=512]="DocumentType",e[e.DocumentFragment=1024]="DocumentFragment",e[e.Notation=2048]="Notation"}(t.WhatToShow||(t.WhatToShow={})),function(e){e[e.StartToStart=0]="StartToStart",e[e.StartToEnd=1]="StartToEnd",e[e.EndToEnd=2]="EndToEnd",e[e.EndToStart=3]="EndToStart"}(t.HowToCompare||(t.HowToCompare={}))},function(e,t,r){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=r(212);t.FixedSizeSet=i.FixedSizeSet;var o=r(213);t.ObjectCache=o.ObjectCache;var a=r(214);t.CompareCache=a.CompareCache;var s=r(215);t.Lazy=s.Lazy;var c=r(216);function l(e,t,r){if(m(e))e.forEach((function(e,n){return t.call(r,n,e)}));else for(var n in e)e.hasOwnProperty(n)&&t.call(r,n,e[n])}function u(e){var t,r;if(h(e))return e;if(f(e)){var i=[];try{for(var o=n(e),a=o.next();!a.done;a=o.next()){var s=a.value;i.push(u(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}if(d(e)){for(var c in i={},e)if(e.hasOwnProperty(c)){var l=e[c];i[c]=u(l)}return i}return e}function h(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)}function d(e){var t=typeof e;return!!e&&("function"===t||"object"===t)}function f(e){return Array.isArray(e)}function p(e){return e instanceof Set}function m(e){return e instanceof Map}function g(e){if(d(e)){var t=Object.getPrototypeOf(e),r=t.constructor;return t&&r&&"function"==typeof r&&r instanceof r&&Function.prototype.toString.call(r)===Function.prototype.toString.call(Object)}return!1}t.StringWalker=c.StringWalker,t.applyMixin=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];Object.getOwnPropertyNames(t.prototype).forEach((function(n){if("constructor"!==n){if(-1!==r.indexOf(n)){var i=Object.getOwnPropertyDescriptor(e.prototype,n);i&&Object.defineProperty(e.prototype,"_"+n,i)}var o=Object.getOwnPropertyDescriptor(t.prototype,n);o&&Object.defineProperty(e.prototype,n,o)}}))},t.applyDefaults=function e(t,r,n){void 0===n&&(n=!1);var i=u(t||{});return l(r,(function(t,r){g(r)?i[t]=e(i[t],r,n):(n||void 0===i[t])&&(i[t]=r)})),i},t.forEachArray=function(e,t,r){e.forEach(t,r)},t.forEachObject=l,t.arrayLength=function(e){return p(e)?e.size:e.length},t.objectLength=function(e){return m(e)?e.size:Object.keys(e).length},t.getObjectValue=function(e,t){return m(e)?e.get(t):e[t]},t.removeObjectValue=function(e,t){m(e)?e.delete(t):delete e[t]},t.clone=u,t.isBoolean=function(e){return"boolean"==typeof e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isFunction=h,t.isObject=d,t.isArray=f,t.isSet=p,t.isMap=m,t.isEmpty=function(e){if(f(e))return!e.length;if(p(e))return!e.size;if(m(e))return!e.size;if(d(e)){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},t.isPlainObject=g,t.isIterable=function(e){return e&&"function"==typeof e[Symbol.iterator]},t.getValue=function(e){return h(e.valueOf)?e.valueOf():e},t.utf8Encode=function(e){for(var t=new Uint8Array(4*e.length),r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)t[r++]=i;else{if(i<2048)t[r++]=i>>6|192;else{if(i>55295&&i<56320){if(++n>=e.length)throw new Error("Incomplete surrogate pair.");var o=e.charCodeAt(n);if(o<56320||o>57343)throw new Error("Invalid surrogate character.");i=65536+((1023&i)<<10)+(1023&o),t[r++]=i>>18|240,t[r++]=i>>12&63|128}else t[r++]=i>>12|224;t[r++]=i>>6&63|128}t[r++]=63&i|128}}return t.subarray(0,r)},t.utf8Decode=function(e){for(var t="",r=0;r<e.length;){var n=e[r++];if(n>127)if(n>191&&n<224){if(r>=e.length)throw new Error("Incomplete 2-byte sequence.");n=(31&n)<<6|63&e[r++]}else if(n>223&&n<240){if(r+1>=e.length)throw new Error("Incomplete 3-byte sequence.");n=(15&n)<<12|(63&e[r++])<<6|63&e[r++]}else{if(!(n>239&&n<248))throw new Error("Unknown multi-byte start.");if(r+2>=e.length)throw new Error("Incomplete 4-byte sequence.");n=(7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]}if(n<=65535)t+=String.fromCharCode(n);else{if(!(n<=1114111))throw new Error("Code point exceeds UTF-16 limit.");n-=65536,t+=String.fromCharCode(n>>10|55296),t+=String.fromCharCode(1023&n|56320)}}return t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(241);t.Cast=n.Cast;var i=r(150);t.Guard=i.Guard;var o=r(242);t.EmptySet=o.EmptySet},function(e,t,r){var n=r(11),i=r(55).f,o=r(21),a=r(25),s=r(80),c=r(119),l=r(123);e.exports=function(e,t){var r,u,h,d,f,p=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[p]||s(p,{}):(n[p]||{}).prototype)for(u in t){if(d=t[u],h=e.noTargetGet?(f=i(r,u))&&f.value:r[u],!l(m?u:p+(g?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;c(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),a(r,u,d,e)}}},function(e,t,r){var n=r(11),i=r(81),o=r(14),a=r(58),s=r(86),c=r(124),l=i("wks"),u=n.Symbol,h=c?u:u&&u.withoutSetter||a;e.exports=function(e){return o(l,e)||(s&&o(u,e)?l[e]=u[e]:l[e]=h("Symbol."+e)),l[e]}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(29),o=function(){function e(){this._features={mutationObservers:!0,customElements:!0,slots:!0,steps:!0},this._window=null,this._compareCache=new n.CompareCache,this._rangeList=new n.FixedSizeSet}return e.prototype.setFeatures=function(e){if(void 0===e&&(e=!0),n.isObject(e))for(var t in e)this._features[t]=e[t]||!1;else for(var t in this._features)this._features[t]=e},Object.defineProperty(e.prototype,"features",{get:function(){return this._features},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return null===this._window&&(this._window=i.create_window()),this._window},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"compareCache",{get:function(){return this._compareCache},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rangeList",{get:function(){return this._rangeList},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e),e._instance},enumerable:!0,configurable:!0}),e}();t.dom=o.instance},function(e,t,r){var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(228));t.base64=i;var o=n(r(146));t.byte=o;var a=n(r(147));t.byteSequence=a;var s=n(r(96));t.codePoint=s;var c=n(r(232));t.json=c;var l=n(r(233));t.list=l;var u=n(r(234));t.map=u;var h=n(r(235));t.namespace=h;var d=n(r(236));t.queue=d;var f=n(r(237));t.set=f;var p=n(r(238));t.stack=p;var m=n(r(239));t.string=m},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){void 0===r&&(r="");var n=e.call(this,r)||this;return n.name=t,n}return i(t,e),t}(Error);t.DOMException=o;var a=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"DOMStringSizeError",t)||this}return i(t,e),t}(o);t.DOMStringSizeError=a;var s=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"WrongDocumentError","The object is in the wrong document. "+t)||this}return i(t,e),t}(o);t.WrongDocumentError=s;var c=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NoDataAllowedError",t)||this}return i(t,e),t}(o);t.NoDataAllowedError=c;var l=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NoModificationAllowedError","The object can not be modified. "+t)||this}return i(t,e),t}(o);t.NoModificationAllowedError=l;var u=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotSupportedError","The operation is not supported. "+t)||this}return i(t,e),t}(o);t.NotSupportedError=u;var h=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InUseAttributeError",t)||this}return i(t,e),t}(o);t.InUseAttributeError=h;var d=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidStateError","The object is in an invalid state. "+t)||this}return i(t,e),t}(o);t.InvalidStateError=d;var f=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidModificationError","The object can not be modified in this way. "+t)||this}return i(t,e),t}(o);t.InvalidModificationError=f;var p=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NamespaceError","The operation is not allowed by Namespaces in XML. [XMLNS] "+t)||this}return i(t,e),t}(o);t.NamespaceError=p;var m=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidAccessError","The object does not support the operation or argument. "+t)||this}return i(t,e),t}(o);t.InvalidAccessError=m;var g=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"ValidationError",t)||this}return i(t,e),t}(o);t.ValidationError=g;var y=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"TypeMismatchError",t)||this}return i(t,e),t}(o);t.TypeMismatchError=y;var v=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"SecurityError","The operation is insecure. "+t)||this}return i(t,e),t}(o);t.SecurityError=v;var b=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NetworkError","A network error occurred. "+t)||this}return i(t,e),t}(o);t.NetworkError=b;var A=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"AbortError","The operation was aborted. "+t)||this}return i(t,e),t}(o);t.AbortError=A;var w=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"URLMismatchError","The given URL does not match another URL. "+t)||this}return i(t,e),t}(o);t.URLMismatchError=w;var x=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"QuotaExceededError","The quota has been exceeded. "+t)||this}return i(t,e),t}(o);t.QuotaExceededError=x;var E=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"TimeoutError","The operation timed out. "+t)||this}return i(t,e),t}(o);t.TimeoutError=E;var S=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidNodeTypeError","The supplied node is incorrect or has an incorrect ancestor for this operation. "+t)||this}return i(t,e),t}(o);t.InvalidNodeTypeError=S;var T=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"DataCloneError","The object can not be cloned. "+t)||this}return i(t,e),t}(o);t.DataCloneError=T;var C=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotImplementedError","The DOM method is not implemented by this module. "+t)||this}return i(t,e),t}(o);t.NotImplementedError=C;var _=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"HierarchyRequestError","The operation would yield an incorrect node tree. "+t)||this}return i(t,e),t}(o);t.HierarchyRequestError=_;var D=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotFoundError","The object can not be found here. "+t)||this}return i(t,e),t}(o);t.NotFoundError=D;var N=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"IndexSizeError","The index is not in the allowed range. "+t)||this}return i(t,e),t}(o);t.IndexSizeError=N;var k=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"SyntaxError","The string did not match the expected pattern. "+t)||this}return i(t,e),t}(o);t.SyntaxError=k;var I=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidCharacterError","The string contains invalid characters. "+t)||this}return i(t,e),t}(o);t.InvalidCharacterError=I},function(e,t,r){var n=r(53),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var r,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new n('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(r=t.styleAliases||null,a={},null!==r&&Object.keys(r).forEach((function(e){r[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new n('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")()}).call(this,r(78))},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.idl_defineConst=function(e,t,r){Object.defineProperty(e,t,{writable:!1,enumerable:!0,configurable:!1,value:r})}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(16),i=r(115),o=r(18),a=r(56),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(o(e),t=a(t,!0),o(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(8);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,r){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),o=r(1);function a(e,t,r){if(void 0===r&&(r=!1),r&&i.Guard.isElementNode(t)&&i.Guard.isShadowRoot(t.shadowRoot)&&t.shadowRoot._firstChild)return t.shadowRoot._firstChild;if(t._firstChild)return t._firstChild;if(t===e)return null;if(t._nextSibling)return t._nextSibling;for(var n=t._parent;n&&n!==e;){if(n._nextSibling)return n._nextSibling;n=n._parent}return null}function s(){var e;return(e={})[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:null}}}},e}function c(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);for(var i=t?e:a(e,e,r);i&&n&&!n(i);)i=a(e,i,r);return i}function l(e,t,r,n,i){void 0===n&&(n=!1);for(var o=a(e,t,n);o&&i&&!i(o);)o=a(e,o,n);return o}function u(e,t,r,n){var i;return void 0===t&&(t=!1),void 0===r&&(r=!1),t||0!==e._children.size?((i={})[Symbol.iterator]=function(){var i=t?e:a(e,e,r);return{next:function(){for(;i&&n&&!n(i);)i=a(e,i,r);if(null===i)return{done:!0,value:null};var t={done:!1,value:i};return i=a(e,i,r),t}}},i):s()}function h(e,t,r){void 0===t&&(t=!1);for(var n=t?e:e._parent;n&&r&&!r(n);)n=n._parent;return n}function d(e,t,r,n){for(var i=t._parent;i&&n&&!n(i);)i=i._parent;return i}function f(e){return i.Guard.isDocumentTypeNode(e)?0:i.Guard.isCharacterDataNode(e)?e._data.length:e._children.size}function p(e,t){if(void 0===t&&(t=!1),t){var r=p(e,!1);return i.Guard.isShadowRoot(r)?p(r._host,!0):r}return e._parent?p(e._parent):e}function m(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var o=r?e:n&&i.Guard.isShadowRoot(e)?e._host:e._parent;null!==o;){if(o===t)return!0;o=n&&i.Guard.isShadowRoot(o)?o._host:o._parent}return!1}function g(e){for(var t=p(e),r=0,n=c(t);null!==n;){if(r++,n===e)return r;n=l(t,n)}return-1}t.tree_getFirstDescendantNode=c,t.tree_getNextDescendantNode=l,t.tree_getDescendantNodes=u,t.tree_getDescendantElements=function(e,t,r,n){var o;return void 0===t&&(t=!1),void 0===r&&(r=!1),t||0!==e._children.size?((o={})[Symbol.iterator]=function(){var o=u(e,t,r,(function(e){return i.Guard.isElementNode(e)}))[Symbol.iterator](),a=o.next().value;return{next:function(){for(;a&&n&&!n(a);)a=o.next().value;if(null===a)return{done:!0,value:null};var e={done:!1,value:a};return a=o.next().value,e}}},o):s()},t.tree_getSiblingNodes=function(e,t,r){var n;return void 0===t&&(t=!1),e._parent&&0!==e._parent._children.size?((n={})[Symbol.iterator]=function(){var n=e._parent?e._parent._firstChild:null;return{next:function(){for(;n&&(r&&!r(n)||!t&&n===e);)n=n._nextSibling;if(null===n)return{done:!0,value:null};var i={done:!1,value:n};return n=n._nextSibling,i}}},n):s()},t.tree_getFirstAncestorNode=h,t.tree_getNextAncestorNode=d,t.tree_getAncestorNodes=function(e,t,r){var n;return void 0===t&&(t=!1),t||e._parent?((n={})[Symbol.iterator]=function(){var n=h(e,t,r);return{next:function(){if(null===n)return{done:!0,value:null};var e={done:!1,value:n};return n=d(0,n,t,r),e}}},n):s()},t.tree_getCommonAncestor=function(e,t){if(e===t)return e._parent;for(var r=[],n=[],i=h(e,!0);null!==i;)r.push(i),i=d(0,i);for(var o=h(t,!0);null!==o;)n.push(o),o=d(0,o);for(var a=r.length,s=n.length,c=null,l=Math.min(a,s);l>0;l--){var u=r[--a];if(u!==n[--s])break;c=u}return c},t.tree_getFollowingNode=function(e,t){if(t._firstChild)return t._firstChild;if(t._nextSibling)return t._nextSibling;for(;;){var r=t._parent;if(null===r||r===e)return null;if(r._nextSibling)return r._nextSibling;t=r}},t.tree_getPrecedingNode=function(e,t){return t===e?null:t._previousSibling?(t=t._previousSibling)._lastChild?t._lastChild:t:t._parent},t.tree_isConstrained=function e(t){var r,i,a,s,c,l;switch(t._nodeType){case o.NodeType.Document:var u=!1,h=!1;try{for(var d=n(t._children),f=d.next();!f.done;f=d.next())switch(f.value._nodeType){case o.NodeType.ProcessingInstruction:case o.NodeType.Comment:break;case o.NodeType.DocumentType:if(u||h)return!1;u=!0;break;case o.NodeType.Element:if(h)return!1;h=!0;break;default:return!1}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}break;case o.NodeType.DocumentFragment:case o.NodeType.Element:try{for(var p=n(t._children),m=p.next();!m.done;m=p.next())switch(m.value._nodeType){case o.NodeType.Element:case o.NodeType.Text:case o.NodeType.ProcessingInstruction:case o.NodeType.CData:case o.NodeType.Comment:break;default:return!1}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}break;case o.NodeType.DocumentType:case o.NodeType.Text:case o.NodeType.ProcessingInstruction:case o.NodeType.CData:case o.NodeType.Comment:return!t.hasChildNodes()}try{for(var g=n(t._children),y=g.next();!y.done;y=g.next())if(!e(y.value))return!1}catch(e){c={error:e}}finally{try{y&&!y.done&&(l=g.return)&&l.call(g)}finally{if(c)throw c.error}}return!0},t.tree_nodeLength=f,t.tree_isEmpty=function(e){return 0===f(e)},t.tree_rootNode=p,t.tree_isDescendantOf=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=c(e,r,n);null!==i;){if(i===t)return!0;i=l(e,i,r,n)}return!1},t.tree_isAncestorOf=m,t.tree_isHostIncludingAncestorOf=function e(t,r,n){if(void 0===n&&(n=!1),m(t,r,n))return!0;var o=p(t);return!(!i.Guard.isDocumentFragmentNode(o)||null===o._host||!e(o._host,r,n))},t.tree_isSiblingOf=function(e,t,r){return void 0===r&&(r=!1),e!==t?null!==e._parent&&e._parent===t._parent:!!r},t.tree_isPreceding=function(e,t){var r=g(e),n=g(t);return-1!==r&&-1!==n&&p(e)===p(t)&&n<r},t.tree_isFollowing=function(e,t){var r=g(e),n=g(t);return-1!==r&&-1!==n&&p(e)===p(t)&&n>r},t.tree_isParentOf=function(e,t){return e._parent===t},t.tree_isChildOf=function(e,t){return t._parent===e},t.tree_previousSibling=function(e){return e._previousSibling},t.tree_nextSibling=function(e){return e._nextSibling},t.tree_firstChild=function(e){return e._firstChild},t.tree_lastChild=function(e){return e._lastChild},t.tree_treePosition=g,t.tree_index=function(e){for(var t=0;null!==e._previousSibling;)t++,e=e._previousSibling;return t},t.tree_retarget=function(e,t){for(;;){if(!e||!i.Guard.isNode(e))return e;var r=p(e);if(!i.Guard.isShadowRoot(r))return e;if(t&&i.Guard.isNode(t)&&m(r,t,!0,!0))return e;e=r.host}}},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(24),i=r(130),o=r(49),a=r(43),s=r(88),c=a.set,l=a.getterFor("Array Iterator");e.exports=s(Array,"Array",(function(e,t){c(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target