nfets 0.0.27 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -86,7 +86,7 @@ Actual: `+L.attribValue);else{var Ge=L.tag,Ue=L.tags[L.tags.length-1]||L;Ge.ns==
86
86
 
87
87
  \r Response Body: `+m.data))},a,u)):(bX("Reading file: %s",r),Gxe.readFile(r,"utf8",(l,p)=>{l?i(l):(c=new oT(p,r,n),s[r]=c,c.WSDL_CACHE=s,c.onReady(i))})),c}o(EX,"open_wsdl")});var NX=Z(AX=>{"use strict";Object.defineProperty(AX,"__esModule",{value:!0})});var DX=Z(er=>{"use strict";var IX=er&&er.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ebe=er&&er.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tbe=er&&er.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&IX(t,e,n[i]);return ebe(t,e),t}})(),rbe=er&&er.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&IX(e,r,t)};Object.defineProperty(er,"__esModule",{value:!0});er.WSDL=er.passwordDigest=er.Server=er.WSSecurityCertWithToken=er.WSSecurityPlusCert=er.WSSecurityCert=er.WSSecurity=er.NTLMSecurity=er.ClientSSLSecurityPFX=er.ClientSSLSecurity=er.BearerSecurity=er.BasicAuthSecurity=er.HttpClient=er.Client=er.security=void 0;er.createClient=RX;er.createClientAsync=dbe;er.listen=mbe;var nbe=U3(),ibe=tbe(bL()),sbe=wL(),abe=oh(),TX=jL();er.security=ibe;var obe=U3();Object.defineProperty(er,"Client",{enumerable:!0,get:o(function(){return obe.Client},"get")});var ube=NI();Object.defineProperty(er,"HttpClient",{enumerable:!0,get:o(function(){return ube.HttpClient},"get")});var sf=bL();Object.defineProperty(er,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return sf.BasicAuthSecurity},"get")});Object.defineProperty(er,"BearerSecurity",{enumerable:!0,get:o(function(){return sf.BearerSecurity},"get")});Object.defineProperty(er,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return sf.ClientSSLSecurity},"get")});Object.defineProperty(er,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return sf.ClientSSLSecurityPFX},"get")});Object.defineProperty(er,"NTLMSecurity",{enumerable:!0,get:o(function(){return sf.NTLMSecurity},"get")});Object.defineProperty(er,"WSSecurity",{enumerable:!0,get:o(function(){return sf.WSSecurity},"get")});Object.defineProperty(er,"WSSecurityCert",{enumerable:!0,get:o(function(){return sf.WSSecurityCert},"get")});Object.defineProperty(er,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return sf.WSSecurityPlusCert},"get")});Object.defineProperty(er,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return sf.WSSecurityCertWithToken},"get")});var cbe=wL();Object.defineProperty(er,"Server",{enumerable:!0,get:o(function(){return cbe.Server},"get")});var lbe=oh();Object.defineProperty(er,"passwordDigest",{enumerable:!0,get:o(function(){return lbe.passwordDigest},"get")});rbe(NX(),er);var fbe=jL();Object.defineProperty(er,"WSDL",{enumerable:!0,get:o(function(){return fbe.WSDL},"get")});function pbe(r,e,t,n){e.has(r)?process.nextTick(()=>{n(null,e.get(r))}):t((i,s)=>{if(i)return n(i);e.set(r,s),n(null,s)})}o(pbe,"getFromCache");function hbe(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(i=>{(0,TX.open_wsdl)(r,e,i)},"openWsdl");if(e.disableCache===!0)n(t);else{let i;e.wsdlCache?i=e.wsdlCache:i=abe.wsdlCacheSingleton,pbe(r,i,n,t)}}o(hbe,"_requestWSDL");function RX(r,e,t,n){let i=n,s,a;typeof e=="function"?(s=e,i=t,a={}):typeof t=="function"&&(a=e,s=t,i=n),i=a.endpoint||i,hbe(r,a,(u,c)=>{s(u,c&&new nbe.Client(c,i,a))})}o(RX,"createClient");function dbe(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,i)=>{RX(r,e,(s,a)=>{s&&i(s),n(a)},t)})}o(dbe,"createClientAsync");function mbe(r,e,t,n,i){let s,a,u="";typeof e=="object"&&!(e instanceof RegExp)?(s=e,a=s.path,t=s.services,n=s.xml,u=s.uri):(a=e,s={path:e,services:t,callback:i});let c=new TX.WSDL(n||t,u,s);return new sbe.Server(r,a,t,c,s)}o(mbe,"listen")});var lT=Z(HL=>{"use strict";(function(){HL.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
88
88
  `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(HL)});var Yc=Z((VX,gh)=>{"use strict";(function(){var r,e,t,n,i,s,a,u=[].slice,c={}.hasOwnProperty;r=o(function(){var l,p,m,g,y,v;if(v=arguments[0],y=2<=arguments.length?u.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,m=y.length;l<m;l++)if(g=y[l],g!=null)for(p in g)c.call(g,p)&&(v[p]=g[p]);return v},"assign"),i=o(function(l){return!!l&&Object.prototype.toString.call(l)==="[object Function]"},"isFunction"),s=o(function(l){var p;return!!l&&((p=typeof l)=="function"||p==="object")},"isObject"),t=o(function(l){return i(Array.isArray)?Array.isArray(l):Object.prototype.toString.call(l)==="[object Array]"},"isArray"),n=o(function(l){var p;if(t(l))return!l.length;for(p in l)if(c.call(l,p))return!1;return!0},"isEmpty"),a=o(function(l){var p,m;return s(l)&&(m=Object.getPrototypeOf(l))&&(p=m.constructor)&&typeof p=="function"&&p instanceof p&&Function.prototype.toString.call(p)===Function.prototype.toString.call(Object)},"isPlainObject"),e=o(function(l){return i(l.valueOf)?l.valueOf():l},"getValue"),gh.exports.assign=r,gh.exports.isFunction=i,gh.exports.isObject=s,gh.exports.isArray=t,gh.exports.isEmpty=n,gh.exports.isPlainObject=a,gh.exports.getValue=e}).call(VX)});var zL=Z((jX,UX)=>{"use strict";(function(){var r;UX.exports=r=(function(){function e(){}return o(e,"XMLDOMImplementation"),e.prototype.hasFeature=function(t,n){return!0},e.prototype.createDocumentType=function(t,n,i){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(t,n,i){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(jX)});var HX=Z((MX,qX)=>{"use strict";(function(){var r;qX.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(MX)});var $X=Z((zX,KX)=>{"use strict";(function(){var r;KX.exports=r=(function(){function e(t){this.arr=t||[]}return o(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.arr.length},"get")}),e.prototype.item=function(t){return this.arr[t]||null},e.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},e})()}).call(zX)});var WX=Z((GX,XX)=>{"use strict";(function(){var r,e,t;e=HX(),t=$X(),XX.exports=r=(function(){function n(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=Object.create(this.defaultParams)}return o(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:o(function(){return new t(Object.keys(this.defaultParams))},"get")}),n.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},n.prototype.canSetParameter=function(i,s){return!0},n.prototype.setParameter=function(i,s){return s!=null?this.params[i]=s:delete this.params[i]},n})()}).call(GX)});var Si=Z((JX,QX)=>{"use strict";(function(){QX.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(JX)});var KL=Z((YX,ZX)=>{"use strict";(function(){var r,e,t;r=Si(),t=mo(),ZX.exports=e=(function(){function n(i,s,a){if(this.parent=i,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),s==null)throw new Error("Missing attribute name. "+this.debugInfo(s));this.name=this.stringify.name(s),this.value=this.stringify.attValue(a),this.type=r.Attribute,this.isId=!1,this.schemaTypeInfo=null}return o(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:o(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(i){return this.value=i||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:o(function(){return!0},"get")}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(i){return this.options.writer.attribute(this,this.options.writer.filterOptions(i))},n.prototype.debugInfo=function(i){return i=i||this.name,i==null?"parent: <"+this.parent.name+">":"attribute: {"+i+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(i){return!(i.namespaceURI!==this.namespaceURI||i.prefix!==this.prefix||i.localName!==this.localName||i.value!==this.value)},n})()}).call(YX)});var fT=Z((eW,tW)=>{"use strict";(function(){var r;tW.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:o(function(){return Object.keys(this.nodes).length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(t){return this.nodes[t]},e.prototype.setNamedItem=function(t){var n;return n=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,n||null},e.prototype.removeNamedItem=function(t){var n;return n=this.nodes[t],delete this.nodes[t],n||null},e.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},e.prototype.getNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(eW)});var pT=Z((rW,nW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l=o(function(m,g){for(var y in g)p.call(g,y)&&(m[y]=g[y]);function v(){this.constructor=m}return o(v,"ctor"),v.prototype=g.prototype,m.prototype=new v,m.__super__=g.prototype,m},"extend"),p={}.hasOwnProperty;c=Yc(),u=c.isObject,a=c.isFunction,s=c.getValue,i=mo(),r=Si(),e=KL(),n=fT(),nW.exports=t=(function(m){l(g,m);function g(y,v,b){var x,E,N,w;if(g.__super__.constructor.call(this,y),v==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(v),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,b!=null&&this.attribute(b),y.type===r.Document&&(this.isRoot=!0,this.documentObject=y,y.rootObject=this,y.children)){for(w=y.children,E=0,N=w.length;E<N;E++)if(x=w[E],x.type===r.DocType){x.name=this.name;break}}}return o(g,"XMLElement"),Object.defineProperty(g.prototype,"tagName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"id",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"className",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"classList",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"attributes",{get:o(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),g.prototype.clone=function(){var y,v,b,x;b=Object.create(this),b.isRoot&&(b.documentObject=null),b.attribs={},x=this.attribs;for(v in x)p.call(x,v)&&(y=x[v],b.attribs[v]=y.clone());return b.children=[],this.children.forEach(function(E){var N;return N=E.clone(),N.parent=b,b.children.push(N)}),b},g.prototype.attribute=function(y,v){var b,x;if(y!=null&&(y=s(y)),u(y))for(b in y)p.call(y,b)&&(x=y[b],this.attribute(b,x));else a(v)&&(v=v.apply()),this.options.keepNullAttributes&&v==null?this.attribs[y]=new e(this,y,""):v!=null&&(this.attribs[y]=new e(this,y,v));return this},g.prototype.removeAttribute=function(y){var v,b,x;if(y==null)throw new Error("Missing attribute name. "+this.debugInfo());if(y=s(y),Array.isArray(y))for(b=0,x=y.length;b<x;b++)v=y[b],delete this.attribs[v];else delete this.attribs[y];return this},g.prototype.toString=function(y){return this.options.writer.element(this,this.options.writer.filterOptions(y))},g.prototype.att=function(y,v){return this.attribute(y,v)},g.prototype.a=function(y,v){return this.attribute(y,v)},g.prototype.getAttribute=function(y){return this.attribs.hasOwnProperty(y)?this.attribs[y].value:null},g.prototype.setAttribute=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(y){return this.attribs.hasOwnProperty(y)?this.attribs[y]:null},g.prototype.setAttributeNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(y,v,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(y){return this.attribs.hasOwnProperty(y)},g.prototype.hasAttributeNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(y,v){return this.attribs.hasOwnProperty(y)?this.attribs[y].isId:v},g.prototype.setIdAttributeNS=function(y,v,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(y){var v,b,x;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(y)||y.namespaceURI!==this.namespaceURI||y.prefix!==this.prefix||y.localName!==this.localName||y.attribs.length!==this.attribs.length)return!1;for(v=b=0,x=this.attribs.length-1;0<=x?b<=x:b>=x;v=0<=x?++b:--b)if(!this.attribs[v].isEqualNode(y.attribs[v]))return!1;return!0},g})(i)}).call(rW)});var Wb=Z((iW,sW)=>{"use strict";(function(){var r,e,t=o(function(i,s){for(var a in s)n.call(s,a)&&(i[a]=s[a]);function u(){this.constructor=i}return o(u,"ctor"),u.prototype=s.prototype,i.prototype=new u,i.__super__=s.prototype,i},"extend"),n={}.hasOwnProperty;e=mo(),sW.exports=r=(function(i){t(s,i);function s(a){s.__super__.constructor.call(this,a),this.value=""}return o(s,"XMLCharacterData"),Object.defineProperty(s.prototype,"data",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),Object.defineProperty(s.prototype,"length",{get:o(function(){return this.value.length},"get")}),Object.defineProperty(s.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),s.prototype.clone=function(){return Object.create(this)},s.prototype.substringData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(a,u,c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(a){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.data!==this.data)},s})(e)}).call(iW)});var hT=Z((aW,oW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;r=Si(),t=Wb(),oW.exports=e=(function(s){n(a,s);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=r.CData,this.value=this.stringify.cdata(c)}return o(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.cdata(this,this.options.writer.filterOptions(u))},a})(t)}).call(aW)});var dT=Z((uW,cW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;r=Si(),e=Wb(),cW.exports=t=(function(s){n(a,s);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(c)}return o(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.comment(this,this.options.writer.filterOptions(u))},a})(e)}).call(uW)});var mT=Z((lW,fW)=>{"use strict";(function(){var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;n=Yc().isObject,t=mo(),r=Si(),fW.exports=e=(function(a){i(u,a);function u(c,l,p,m){var g;u.__super__.constructor.call(this,c),n(l)&&(g=l,l=g.version,p=g.encoding,m=g.standalone),l||(l="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(l),p!=null&&(this.encoding=this.stringify.xmlEncoding(p)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return o(u,"XMLDeclaration"),u.prototype.toString=function(c){return this.options.writer.declaration(this,this.options.writer.filterOptions(c))},u})(t)}).call(lW)});var gT=Z((pW,hW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;t=mo(),r=Si(),hW.exports=e=(function(s){n(a,s);function a(u,c,l,p,m,g){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(l==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(c));if(!p)throw new Error("Missing DTD attribute type. "+this.debugInfo(c));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(c));if(m.indexOf("#")!==0&&(m="#"+m),!m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(c));if(g&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(c));this.elementName=this.stringify.name(c),this.type=r.AttributeDeclaration,this.attributeName=this.stringify.name(l),this.attributeType=this.stringify.dtdAttType(p),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=m}return o(a,"XMLDTDAttList"),a.prototype.toString=function(u){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(u))},a})(t)}).call(pW)});var vT=Z((dW,mW)=>{"use strict";(function(){var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;n=Yc().isObject,t=mo(),r=Si(),mW.exports=e=(function(a){i(u,a);function u(c,l,p,m){if(u.__super__.constructor.call(this,c),p==null)throw new Error("Missing DTD entity name. "+this.debugInfo(p));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(p));if(this.pe=!!l,this.name=this.stringify.name(p),this.type=r.EntityDeclaration,!n(m))this.value=this.stringify.dtdEntityValue(m),this.internal=!0;else{if(!m.pubID&&!m.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(p));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(p));if(this.internal=!1,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID)),m.nData!=null&&(this.nData=this.stringify.dtdNData(m.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(p))}}return o(u,"XMLDTDEntity"),Object.defineProperty(u.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(u.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(u.prototype,"notationName",{get:o(function(){return this.nData||null},"get")}),Object.defineProperty(u.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlVersion",{get:o(function(){return null},"get")}),u.prototype.toString=function(c){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(c))},u})(t)}).call(dW)});var yT=Z((gW,vW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;t=mo(),r=Si(),vW.exports=e=(function(s){n(a,s);function a(u,c,l){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.name(c),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(l)}return o(a,"XMLDTDElement"),a.prototype.toString=function(u){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(u))},a})(t)}).call(gW)});var ST=Z((yW,SW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;t=mo(),r=Si(),SW.exports=e=(function(s){n(a,s);function a(u,c,l){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD notation name. "+this.debugInfo(c));if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(c));this.name=this.stringify.name(c),this.type=r.NotationDeclaration,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return o(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),a.prototype.toString=function(u){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(u))},a})(t)}).call(yW)});var xT=Z((xW,bW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l=o(function(m,g){for(var y in g)p.call(g,y)&&(m[y]=g[y]);function v(){this.constructor=m}return o(v,"ctor"),v.prototype=g.prototype,m.prototype=new v,m.__super__=g.prototype,m},"extend"),p={}.hasOwnProperty;c=Yc().isObject,u=mo(),r=Si(),e=gT(),n=vT(),t=yT(),i=ST(),a=fT(),bW.exports=s=(function(m){l(g,m);function g(y,v,b){var x,E,N,w,C,A;if(g.__super__.constructor.call(this,y),this.type=r.DocType,y.children){for(w=y.children,E=0,N=w.length;E<N;E++)if(x=w[E],x.type===r.Element){this.name=x.name;break}}this.documentObject=y,c(v)&&(C=v,v=C.pubID,b=C.sysID),b==null&&(A=[v,b],b=A[0],v=A[1]),v!=null&&(this.pubID=this.stringify.dtdPubID(v)),b!=null&&(this.sysID=this.stringify.dtdSysID(b))}return o(g,"XMLDocType"),Object.defineProperty(g.prototype,"entities",{get:o(function(){var y,v,b,x,E;for(x={},E=this.children,v=0,b=E.length;v<b;v++)y=E[v],y.type===r.EntityDeclaration&&!y.pe&&(x[y.name]=y);return new a(x)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var y,v,b,x,E;for(x={},E=this.children,v=0,b=E.length;v<b;v++)y=E[v],y.type===r.NotationDeclaration&&(x[y.name]=y);return new a(x)},"get")}),Object.defineProperty(g.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(g.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(g.prototype,"internalSubset",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),g.prototype.element=function(y,v){var b;return b=new t(this,y,v),this.children.push(b),this},g.prototype.attList=function(y,v,b,x,E){var N;return N=new e(this,y,v,b,x,E),this.children.push(N),this},g.prototype.entity=function(y,v){var b;return b=new n(this,!1,y,v),this.children.push(b),this},g.prototype.pEntity=function(y,v){var b;return b=new n(this,!0,y,v),this.children.push(b),this},g.prototype.notation=function(y,v){var b;return b=new i(this,y,v),this.children.push(b),this},g.prototype.toString=function(y){return this.options.writer.docType(this,this.options.writer.filterOptions(y))},g.prototype.ele=function(y,v){return this.element(y,v)},g.prototype.att=function(y,v,b,x,E){return this.attList(y,v,b,x,E)},g.prototype.ent=function(y,v){return this.entity(y,v)},g.prototype.pent=function(y,v){return this.pEntity(y,v)},g.prototype.not=function(y,v){return this.notation(y,v)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(y){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(y)||y.name!==this.name||y.publicId!==this.publicId||y.systemId!==this.systemId)},g})(u)}).call(xW)});var bT=Z((wW,CW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;r=Si(),e=mo(),CW.exports=t=(function(s){n(a,s);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(c)}return o(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.raw(this,this.options.writer.filterOptions(u))},a})(e)}).call(wW)});var wT=Z((EW,AW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;r=Si(),e=Wb(),AW.exports=t=(function(s){n(a,s);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(c)}return o(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:o(function(){var u,c,l;for(l="",c=this.previousSibling;c;)l=c.data+l,c=c.previousSibling;for(l+=this.data,u=this.nextSibling;u;)l=l+u.data,u=u.nextSibling;return l},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.text(this,this.options.writer.filterOptions(u))},a.prototype.splitText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(EW)});var CT=Z((NW,IW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;r=Si(),e=Wb(),IW.exports=t=(function(s){n(a,s);function a(u,c,l){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(c),this.name=this.target,l&&(this.value=this.stringify.insValue(l))}return o(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(u))},a.prototype.isEqualNode=function(u){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.target!==this.target)},a})(e)}).call(NW)});var $L=Z((TW,RW)=>{"use strict";(function(){var r,e,t,n=o(function(s,a){for(var u in a)i.call(a,u)&&(s[u]=a[u]);function c(){this.constructor=s}return o(c,"ctor"),c.prototype=a.prototype,s.prototype=new c,s.__super__=a.prototype,s},"extend"),i={}.hasOwnProperty;t=mo(),r=Si(),RW.exports=e=(function(s){n(a,s);function a(u){a.__super__.constructor.call(this,u),this.type=r.Dummy}return o(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return""},a})(t)}).call(TW)});var OW=Z((DW,_W)=>{"use strict";(function(){var r;_W.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.nodes.length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(t){return this.nodes[t]||null},e})()}).call(DW)});var LW=Z((PW,BW)=>{"use strict";(function(){BW.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(PW)});var mo=Z((FW,kW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,y,v,b,x,E,N,w={}.hasOwnProperty;N=Yc(),E=N.isObject,x=N.isFunction,b=N.isEmpty,v=N.getValue,u=null,t=null,n=null,i=null,s=null,g=null,y=null,m=null,a=null,e=null,p=null,c=null,r=null,kW.exports=l=(function(){function C(A){this.parent=A,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=pT(),t=hT(),n=dT(),i=mT(),s=xT(),g=bT(),y=wT(),m=CT(),a=$L(),e=Si(),p=OW(),c=fT(),r=LW())}return o(C,"XMLNode"),Object.defineProperty(C.prototype,"nodeName",{get:o(function(){return this.name},"get")}),Object.defineProperty(C.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(C.prototype,"nodeValue",{get:o(function(){return this.value},"get")}),Object.defineProperty(C.prototype,"parentNode",{get:o(function(){return this.parent},"get")}),Object.defineProperty(C.prototype,"childNodes",{get:o(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new p(this.children)),this.childNodeList},"get")}),Object.defineProperty(C.prototype,"firstChild",{get:o(function(){return this.children[0]||null},"get")}),Object.defineProperty(C.prototype,"lastChild",{get:o(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(C.prototype,"previousSibling",{get:o(function(){var A;return A=this.parent.children.indexOf(this),this.parent.children[A-1]||null},"get")}),Object.defineProperty(C.prototype,"nextSibling",{get:o(function(){var A;return A=this.parent.children.indexOf(this),this.parent.children[A+1]||null},"get")}),Object.defineProperty(C.prototype,"ownerDocument",{get:o(function(){return this.document()||null},"get")}),Object.defineProperty(C.prototype,"textContent",{get:o(function(){var A,R,M,_,H;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(H="",_=this.children,R=0,M=_.length;R<M;R++)A=_[R],A.textContent&&(H+=A.textContent);return H}else return null},"get"),set:o(function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),C.prototype.setParent=function(A){var R,M,_,H,z;for(this.parent=A,A&&(this.options=A.options,this.stringify=A.stringify),H=this.children,z=[],M=0,_=H.length;M<_;M++)R=H[M],z.push(R.setParent(this));return z},C.prototype.element=function(A,R,M){var _,H,z,K,X,ye,fe,ce,ee,pe,Ce;if(ye=null,R===null&&M==null&&(ee=[{},null],R=ee[0],M=ee[1]),R==null&&(R={}),R=v(R),E(R)||(pe=[R,M],M=pe[0],R=pe[1]),A!=null&&(A=v(A)),Array.isArray(A))for(z=0,fe=A.length;z<fe;z++)H=A[z],ye=this.element(H);else if(x(A))ye=this.element(A.apply());else if(E(A)){for(X in A)if(w.call(A,X))if(Ce=A[X],x(Ce)&&(Ce=Ce.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&X.indexOf(this.stringify.convertAttKey)===0)ye=this.attribute(X.substr(this.stringify.convertAttKey.length),Ce);else if(!this.options.separateArrayItems&&Array.isArray(Ce)&&b(Ce))ye=this.dummy();else if(E(Ce)&&b(Ce))ye=this.element(X);else if(!this.options.keepNullNodes&&Ce==null)ye=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Ce))for(K=0,ce=Ce.length;K<ce;K++)H=Ce[K],_={},_[X]=H,ye=this.element(_);else E(Ce)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&X.indexOf(this.stringify.convertTextKey)===0?ye=this.element(Ce):(ye=this.element(X),ye.element(Ce)):ye=this.element(X,Ce)}else!this.options.keepNullNodes&&M===null?ye=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&A.indexOf(this.stringify.convertTextKey)===0?ye=this.text(M):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&A.indexOf(this.stringify.convertCDataKey)===0?ye=this.cdata(M):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&A.indexOf(this.stringify.convertCommentKey)===0?ye=this.comment(M):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&A.indexOf(this.stringify.convertRawKey)===0?ye=this.raw(M):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&A.indexOf(this.stringify.convertPIKey)===0?ye=this.instruction(A.substr(this.stringify.convertPIKey.length),M):ye=this.node(A,R,M);if(ye==null)throw new Error("Could not create any elements with: "+A+". "+this.debugInfo());return ye},C.prototype.insertBefore=function(A,R,M){var _,H,z,K,X;if(A?.type)return z=A,K=R,z.setParent(this),K?(H=children.indexOf(K),X=children.splice(H),children.push(z),Array.prototype.push.apply(children,X)):children.push(z),z;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(A));return H=this.parent.children.indexOf(this),X=this.parent.children.splice(H),_=this.parent.element(A,R,M),Array.prototype.push.apply(this.parent.children,X),_},C.prototype.insertAfter=function(A,R,M){var _,H,z;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(A));return H=this.parent.children.indexOf(this),z=this.parent.children.splice(H+1),_=this.parent.element(A,R,M),Array.prototype.push.apply(this.parent.children,z),_},C.prototype.remove=function(){var A,R;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return A=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[A,A-A+1].concat(R=[])),this.parent},C.prototype.node=function(A,R,M){var _,H;return A!=null&&(A=v(A)),R||(R={}),R=v(R),E(R)||(H=[R,M],M=H[0],R=H[1]),_=new u(this,A,R),M!=null&&_.text(M),this.children.push(_),_},C.prototype.text=function(A){var R;return E(A)&&this.element(A),R=new y(this,A),this.children.push(R),this},C.prototype.cdata=function(A){var R;return R=new t(this,A),this.children.push(R),this},C.prototype.comment=function(A){var R;return R=new n(this,A),this.children.push(R),this},C.prototype.commentBefore=function(A){var R,M,_;return M=this.parent.children.indexOf(this),_=this.parent.children.splice(M),R=this.parent.comment(A),Array.prototype.push.apply(this.parent.children,_),this},C.prototype.commentAfter=function(A){var R,M,_;return M=this.parent.children.indexOf(this),_=this.parent.children.splice(M+1),R=this.parent.comment(A),Array.prototype.push.apply(this.parent.children,_),this},C.prototype.raw=function(A){var R;return R=new g(this,A),this.children.push(R),this},C.prototype.dummy=function(){var A;return A=new a(this),A},C.prototype.instruction=function(A,R){var M,_,H,z,K;if(A!=null&&(A=v(A)),R!=null&&(R=v(R)),Array.isArray(A))for(z=0,K=A.length;z<K;z++)M=A[z],this.instruction(M);else if(E(A))for(M in A)w.call(A,M)&&(_=A[M],this.instruction(M,_));else x(R)&&(R=R.apply()),H=new m(this,A,R),this.children.push(H);return this},C.prototype.instructionBefore=function(A,R){var M,_,H;return _=this.parent.children.indexOf(this),H=this.parent.children.splice(_),M=this.parent.instruction(A,R),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.instructionAfter=function(A,R){var M,_,H;return _=this.parent.children.indexOf(this),H=this.parent.children.splice(_+1),M=this.parent.instruction(A,R),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.declaration=function(A,R,M){var _,H;return _=this.document(),H=new i(_,A,R,M),_.children.length===0?_.children.unshift(H):_.children[0].type===e.Declaration?_.children[0]=H:_.children.unshift(H),_.root()||_},C.prototype.dtd=function(A,R){var M,_,H,z,K,X,ye,fe,ce,ee;for(_=this.document(),H=new s(_,A,R),ce=_.children,z=K=0,ye=ce.length;K<ye;z=++K)if(M=ce[z],M.type===e.DocType)return _.children[z]=H,H;for(ee=_.children,z=X=0,fe=ee.length;X<fe;z=++X)if(M=ee[z],M.isRoot)return _.children.splice(z,0,H),H;return _.children.push(H),H},C.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},C.prototype.root=function(){var A;for(A=this;A;){if(A.type===e.Document)return A.rootObject;if(A.isRoot)return A;A=A.parent}},C.prototype.document=function(){var A;for(A=this;A;){if(A.type===e.Document)return A;A=A.parent}},C.prototype.end=function(A){return this.document().end(A)},C.prototype.prev=function(){var A;if(A=this.parent.children.indexOf(this),A<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[A-1]},C.prototype.next=function(){var A;if(A=this.parent.children.indexOf(this),A===-1||A===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[A+1]},C.prototype.importDocument=function(A){var R;return R=A.root().clone(),R.parent=this,R.isRoot=!1,this.children.push(R),this},C.prototype.debugInfo=function(A){var R,M;return A=A||this.name,A==null&&!((R=this.parent)!=null&&R.name)?"":A==null?"parent: <"+this.parent.name+">":(M=this.parent)!=null&&M.name?"node: <"+A+">, parent: <"+this.parent.name+">":"node: <"+A+">"},C.prototype.ele=function(A,R,M){return this.element(A,R,M)},C.prototype.nod=function(A,R,M){return this.node(A,R,M)},C.prototype.txt=function(A){return this.text(A)},C.prototype.dat=function(A){return this.cdata(A)},C.prototype.com=function(A){return this.comment(A)},C.prototype.ins=function(A,R){return this.instruction(A,R)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(A,R,M){return this.declaration(A,R,M)},C.prototype.e=function(A,R,M){return this.element(A,R,M)},C.prototype.n=function(A,R,M){return this.node(A,R,M)},C.prototype.t=function(A){return this.text(A)},C.prototype.d=function(A){return this.cdata(A)},C.prototype.c=function(A){return this.comment(A)},C.prototype.r=function(A){return this.raw(A)},C.prototype.i=function(A,R){return this.instruction(A,R)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(A){return this.importDocument(A)},C.prototype.replaceChild=function(A,R){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(A,R){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(A){var R,M;return R=this,R===A?0:this.document()!==A.document()?(M=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?M|=r.Preceding:M|=r.Following,M):R.isAncestor(A)?r.Contains|r.Preceding:R.isDescendant(A)?r.Contains|r.Following:R.isPreceding(A)?r.Preceding:r.Following},C.prototype.isSameNode=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(A){var R,M,_;if(A.nodeType!==this.nodeType||A.children.length!==this.children.length)return!1;for(R=M=0,_=this.children.length-1;0<=_?M<=_:M>=_;R=0<=_?++M:--M)if(!this.children[R].isEqualNode(A.children[R]))return!1;return!0},C.prototype.getFeature=function(A,R){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(A,R,M){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(A){return A?A===this||this.isDescendant(A):!1},C.prototype.isDescendant=function(A){var R,M,_,H,z;for(z=this.children,_=0,H=z.length;_<H;_++)if(R=z[_],A===R||(M=R.isDescendant(A),M))return!0;return!1},C.prototype.isAncestor=function(A){return A.isDescendant(this)},C.prototype.isPreceding=function(A){var R,M;return R=this.treePosition(A),M=this.treePosition(this),R===-1||M===-1?!1:R<M},C.prototype.isFollowing=function(A){var R,M;return R=this.treePosition(A),M=this.treePosition(this),R===-1||M===-1?!1:R>M},C.prototype.treePosition=function(A){var R,M;return M=0,R=!1,this.foreachTreeNode(this.document(),function(_){if(M++,!R&&_===A)return R=!0}),R?M:-1},C.prototype.foreachTreeNode=function(A,R){var M,_,H,z,K;for(A||(A=this.document()),z=A.children,_=0,H=z.length;_<H;_++){if(M=z[_],K=R(M))return K;if(K=this.foreachTreeNode(M,R),K)return K}},C})()}).call(FW)});var GL=Z((VW,jW)=>{"use strict";(function(){var r,e=o(function(n,i){return function(){return n.apply(i,arguments)}},"bind"),t={}.hasOwnProperty;jW.exports=r=(function(){function n(i){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var s,a,u;i||(i={}),this.options=i,this.options.version||(this.options.version="1.0"),a=i.stringify||{};for(s in a)t.call(a,s)&&(u=a[s],this[s]=u)}return o(n,"XMLStringifier"),n.prototype.name=function(i){return this.options.noValidation?i:this.assertLegalName(""+i||"")},n.prototype.text=function(i){return this.options.noValidation?i:this.assertLegalChar(this.textEscape(""+i||""))},n.prototype.cdata=function(i){return this.options.noValidation?i:(i=""+i||"",i=i.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(i))},n.prototype.comment=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+i);return this.assertLegalChar(i)},n.prototype.raw=function(i){return this.options.noValidation?i:""+i||""},n.prototype.attValue=function(i){return this.options.noValidation?i:this.assertLegalChar(this.attEscape(i=""+i||""))},n.prototype.insTarget=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.insValue=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/\?>/))throw new Error("Invalid processing instruction value: "+i);return this.assertLegalChar(i)},n.prototype.xmlVersion=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+i);return i},n.prototype.xmlEncoding=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+i);return this.assertLegalChar(i)},n.prototype.xmlStandalone=function(i){return this.options.noValidation?i:i?"yes":"no"},n.prototype.dtdPubID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdSysID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdElementValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdAttType=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdAttDefault=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdEntityValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdNData=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(i){var s,a;if(this.options.noValidation)return i;if(s="",this.options.version==="1.0"){if(s=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=i.match(s))throw new Error("Invalid character in string: "+i+" at index "+a.index)}else if(this.options.version==="1.1"&&(s=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=i.match(s)))throw new Error("Invalid character in string: "+i+" at index "+a.index);return i},n.prototype.assertLegalName=function(i){var s;if(this.options.noValidation)return i;if(this.assertLegalChar(i),s=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!i.match(s))throw new Error("Invalid character in name");return i},n.prototype.textEscape=function(i){var s;return this.options.noValidation?i:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(s,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},n.prototype.attEscape=function(i){var s;return this.options.noValidation?i:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(s,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},n})()}).call(VW)});var Jb=Z((UW,MW)=>{"use strict";(function(){MW.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(UW)});var XL=Z((qW,HW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,y,v,b,x,E={}.hasOwnProperty;x=Yc().assign,r=Si(),c=mT(),l=xT(),t=hT(),n=dT(),m=pT(),y=bT(),v=wT(),g=CT(),p=$L(),i=gT(),s=yT(),a=vT(),u=ST(),e=Jb(),HW.exports=b=(function(){function N(w){var C,A,R;w||(w={}),this.options=w,A=w.writer||{};for(C in A)E.call(A,C)&&(R=A[C],this["_"+C]=this[C],this[C]=R)}return o(N,"XMLWriterBase"),N.prototype.filterOptions=function(w){var C,A,R,M,_,H,z,K;return w||(w={}),w=x({},this.options,w),C={writer:this},C.pretty=w.pretty||!1,C.allowEmpty=w.allowEmpty||!1,C.indent=(A=w.indent)!=null?A:" ",C.newline=(R=w.newline)!=null?R:`
89
- `,C.offset=(M=w.offset)!=null?M:0,C.dontPrettyTextNodes=(_=(H=w.dontPrettyTextNodes)!=null?H:w.dontprettytextnodes)!=null?_:0,C.spaceBeforeSlash=(z=(K=w.spaceBeforeSlash)!=null?K:w.spacebeforeslash)!=null?z:"",C.spaceBeforeSlash===!0&&(C.spaceBeforeSlash=" "),C.suppressPrettyCount=0,C.user={},C.state=e.None,C},N.prototype.indent=function(w,C,A){var R;return!C.pretty||C.suppressPrettyCount?"":C.pretty&&(R=(A||0)+C.offset+1,R>0)?new Array(R).join(C.indent):""},N.prototype.endline=function(w,C,A){return!C.pretty||C.suppressPrettyCount?"":C.newline},N.prototype.attribute=function(w,C,A){var R;return this.openAttribute(w,C,A),R=" "+w.name+'="'+w.value+'"',this.closeAttribute(w,C,A),R},N.prototype.cdata=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<![CDATA[",C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+="]]>"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.comment=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!-- ",C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=" -->"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.declaration=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<?xml",C.state=e.InsideTag,R+=' version="'+w.version+'"',w.encoding!=null&&(R+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(R+=' standalone="'+w.standalone+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+"?>",R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.docType=function(w,C,A){var R,M,_,H,z;if(A||(A=0),this.openNode(w,C,A),C.state=e.OpenTag,H=this.indent(w,C,A),H+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?H+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(H+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(H+=" [",H+=this.endline(w,C,A),C.state=e.InsideTag,z=w.children,M=0,_=z.length;M<_;M++)R=z[M],H+=this.writeChildNode(R,C,A+1);C.state=e.CloseTag,H+="]"}return C.state=e.CloseTag,H+=C.spaceBeforeSlash+">",H+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),H},N.prototype.element=function(w,C,A){var R,M,_,H,z,K,X,ye,fe,ce,ee,pe,Ce,Ye;A||(A=0),ce=!1,ee="",this.openNode(w,C,A),C.state=e.OpenTag,ee+=this.indent(w,C,A)+"<"+w.name,pe=w.attribs;for(fe in pe)E.call(pe,fe)&&(R=pe[fe],ee+=this.attribute(R,C,A));if(_=w.children.length,H=_===0?null:w.children[0],_===0||w.children.every(function(xe){return(xe.type===r.Text||xe.type===r.Raw)&&xe.value===""}))C.allowEmpty?(ee+=">",C.state=e.CloseTag,ee+="</"+w.name+">"+this.endline(w,C,A)):(C.state=e.CloseTag,ee+=C.spaceBeforeSlash+"/>"+this.endline(w,C,A));else if(C.pretty&&_===1&&(H.type===r.Text||H.type===r.Raw)&&H.value!=null)ee+=">",C.state=e.InsideTag,C.suppressPrettyCount++,ce=!0,ee+=this.writeChildNode(H,C,A+1),C.suppressPrettyCount--,ce=!1,C.state=e.CloseTag,ee+="</"+w.name+">"+this.endline(w,C,A);else{if(C.dontPrettyTextNodes){for(Ce=w.children,z=0,X=Ce.length;z<X;z++)if(M=Ce[z],(M.type===r.Text||M.type===r.Raw)&&M.value!=null){C.suppressPrettyCount++,ce=!0;break}}for(ee+=">"+this.endline(w,C,A),C.state=e.InsideTag,Ye=w.children,K=0,ye=Ye.length;K<ye;K++)M=Ye[K],ee+=this.writeChildNode(M,C,A+1);C.state=e.CloseTag,ee+=this.indent(w,C,A)+"</"+w.name+">",ce&&C.suppressPrettyCount--,ee+=this.endline(w,C,A),C.state=e.None}return this.closeNode(w,C,A),ee},N.prototype.writeChildNode=function(w,C,A){switch(w.type){case r.CData:return this.cdata(w,C,A);case r.Comment:return this.comment(w,C,A);case r.Element:return this.element(w,C,A);case r.Raw:return this.raw(w,C,A);case r.Text:return this.text(w,C,A);case r.ProcessingInstruction:return this.processingInstruction(w,C,A);case r.Dummy:return"";case r.Declaration:return this.declaration(w,C,A);case r.DocType:return this.docType(w,C,A);case r.AttributeDeclaration:return this.dtdAttList(w,C,A);case r.ElementDeclaration:return this.dtdElement(w,C,A);case r.EntityDeclaration:return this.dtdEntity(w,C,A);case r.NotationDeclaration:return this.dtdNotation(w,C,A);default:throw new Error("Unknown XML node type: "+w.constructor.name)}},N.prototype.processingInstruction=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<?",C.state=e.InsideTag,R+=w.target,w.value&&(R+=" "+w.value),C.state=e.CloseTag,R+=C.spaceBeforeSlash+"?>",R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.raw=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A),C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.text=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A),C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdAttList=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ATTLIST",C.state=e.InsideTag,R+=" "+w.elementName+" "+w.attributeName+" "+w.attributeType,w.defaultValueType!=="#DEFAULT"&&(R+=" "+w.defaultValueType),w.defaultValue&&(R+=' "'+w.defaultValue+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdElement=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ELEMENT",C.state=e.InsideTag,R+=" "+w.name+" "+w.value,C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdEntity=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ENTITY",C.state=e.InsideTag,w.pe&&(R+=" %"),R+=" "+w.name,w.value?R+=' "'+w.value+'"':(w.pubID&&w.sysID?R+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(R+=' SYSTEM "'+w.sysID+'"'),w.nData&&(R+=" NDATA "+w.nData)),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdNotation=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!NOTATION",C.state=e.InsideTag,R+=" "+w.name,w.pubID&&w.sysID?R+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.pubID?R+=' PUBLIC "'+w.pubID+'"':w.sysID&&(R+=' SYSTEM "'+w.sysID+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.openNode=function(w,C,A){},N.prototype.closeNode=function(w,C,A){},N.prototype.openAttribute=function(w,C,A){},N.prototype.closeAttribute=function(w,C,A){},N})()}).call(qW)});var ET=Z((zW,KW)=>{"use strict";(function(){var r,e,t=o(function(i,s){for(var a in s)n.call(s,a)&&(i[a]=s[a]);function u(){this.constructor=i}return o(u,"ctor"),u.prototype=s.prototype,i.prototype=new u,i.__super__=s.prototype,i},"extend"),n={}.hasOwnProperty;e=XL(),KW.exports=r=(function(i){t(s,i);function s(a){s.__super__.constructor.call(this,a)}return o(s,"XMLStringWriter"),s.prototype.document=function(a,u){var c,l,p,m,g;for(u=this.filterOptions(u),m="",g=a.children,l=0,p=g.length;l<p;l++)c=g[l],m+=this.writeChildNode(c,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},s})(e)}).call(zW)});var WL=Z(($W,GW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c=o(function(p,m){for(var g in m)l.call(m,g)&&(p[g]=m[g]);function y(){this.constructor=p}return o(y,"ctor"),y.prototype=m.prototype,p.prototype=new y,p.__super__=m.prototype,p},"extend"),l={}.hasOwnProperty;u=Yc().isPlainObject,t=zL(),e=WX(),i=mo(),r=Si(),a=GL(),s=ET(),GW.exports=n=(function(p){c(m,p);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new s),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,y,v,b;for(b=this.children,y=0,v=b.length;y<v;y++)if(g=b[y],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var y;return y={},g?u(g)&&(y=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(y))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(i)}).call($W)});var JW=Z((XW,WW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,y,v,b,x,E,N,w,C,A,R,M,_={}.hasOwnProperty;M=Yc(),A=M.isObject,C=M.isFunction,R=M.isPlainObject,w=M.getValue,r=Si(),m=WL(),y=pT(),n=hT(),i=dT(),b=bT(),N=wT(),v=CT(),l=mT(),p=xT(),s=gT(),u=vT(),a=yT(),c=ST(),t=KL(),E=GL(),x=ET(),e=Jb(),WW.exports=g=(function(){function H(z,K,X){var ye;this.name="?xml",this.type=r.Document,z||(z={}),ye={},z.writer?R(z.writer)&&(ye=z.writer,z.writer=new x):z.writer=new x,this.options=z,this.writer=z.writer,this.writerOptions=this.writer.filterOptions(ye),this.stringify=new E(z),this.onDataCallback=K||function(){},this.onEndCallback=X||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(H,"XMLDocumentCB"),H.prototype.createChildNode=function(z){var K,X,ye,fe,ce,ee,pe,Ce;switch(z.type){case r.CData:this.cdata(z.value);break;case r.Comment:this.comment(z.value);break;case r.Element:ye={},pe=z.attribs;for(X in pe)_.call(pe,X)&&(K=pe[X],ye[X]=K.value);this.node(z.name,ye);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(z.value);break;case r.Text:this.text(z.value);break;case r.ProcessingInstruction:this.instruction(z.target,z.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+z.constructor.name)}for(Ce=z.children,ce=0,ee=Ce.length;ce<ee;ce++)fe=Ce[ce],this.createChildNode(fe),fe.type===r.Element&&this.up();return this},H.prototype.dummy=function(){return this},H.prototype.node=function(z,K,X){var ye;if(z==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(z));return this.openCurrent(),z=w(z),K==null&&(K={}),K=w(K),A(K)||(ye=[K,X],X=ye[0],K=ye[1]),this.currentNode=new y(this,z,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,X!=null&&this.text(X),this},H.prototype.element=function(z,K,X){var ye,fe,ce,ee,pe,Ce;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(z)||A(z)||C(z))for(ee=this.options.noValidation,this.options.noValidation=!0,Ce=new m(this.options).element("TEMP_ROOT"),Ce.element(z),this.options.noValidation=ee,pe=Ce.children,fe=0,ce=pe.length;fe<ce;fe++)ye=pe[fe],this.createChildNode(ye),ye.type===r.Element&&this.up();else this.node(z,K,X);return this},H.prototype.attribute=function(z,K){var X,ye;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(z));if(z!=null&&(z=w(z)),A(z))for(X in z)_.call(z,X)&&(ye=z[X],this.attribute(X,ye));else C(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[z]=new t(this,z,""):K!=null&&(this.currentNode.attribs[z]=new t(this,z,K));return this},H.prototype.text=function(z){var K;return this.openCurrent(),K=new N(this,z),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.cdata=function(z){var K;return this.openCurrent(),K=new n(this,z),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.comment=function(z){var K;return this.openCurrent(),K=new i(this,z),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.raw=function(z){var K;return this.openCurrent(),K=new b(this,z),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.instruction=function(z,K){var X,ye,fe,ce,ee;if(this.openCurrent(),z!=null&&(z=w(z)),K!=null&&(K=w(K)),Array.isArray(z))for(X=0,ce=z.length;X<ce;X++)ye=z[X],this.instruction(ye);else if(A(z))for(ye in z)_.call(z,ye)&&(fe=z[ye],this.instruction(ye,fe));else C(K)&&(K=K.apply()),ee=new v(this,z,K),this.onData(this.writer.processingInstruction(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},H.prototype.declaration=function(z,K,X){var ye;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return ye=new l(this,z,K,X),this.onData(this.writer.declaration(ye,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.doctype=function(z,K,X){if(this.openCurrent(),z==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new p(this,K,X),this.currentNode.rootNodeName=z,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},H.prototype.dtdElement=function(z,K){var X;return this.openCurrent(),X=new a(this,z,K),this.onData(this.writer.dtdElement(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.attList=function(z,K,X,ye,fe){var ce;return this.openCurrent(),ce=new s(this,z,K,X,ye,fe),this.onData(this.writer.dtdAttList(ce,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.entity=function(z,K){var X;return this.openCurrent(),X=new u(this,!1,z,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.pEntity=function(z,K){var X;return this.openCurrent(),X=new u(this,!0,z,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.notation=function(z,K){var X;return this.openCurrent(),X=new c(this,z,K),this.onData(this.writer.dtdNotation(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},H.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},H.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},H.prototype.openNode=function(z){var K,X,ye,fe;if(!z.isOpen){if(!this.root&&this.currentLevel===0&&z.type===r.Element&&(this.root=z),X="",z.type===r.Element){this.writerOptions.state=e.OpenTag,X=this.writer.indent(z,this.writerOptions,this.currentLevel)+"<"+z.name,fe=z.attribs;for(ye in fe)_.call(fe,ye)&&(K=fe[ye],X+=this.writer.attribute(K,this.writerOptions,this.currentLevel));X+=(z.children?">":"/>")+this.writer.endline(z,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,X=this.writer.indent(z,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+z.rootNodeName,z.pubID&&z.sysID?X+=' PUBLIC "'+z.pubID+'" "'+z.sysID+'"':z.sysID&&(X+=' SYSTEM "'+z.sysID+'"'),z.children?(X+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,X+=">"),X+=this.writer.endline(z,this.writerOptions,this.currentLevel);return this.onData(X,this.currentLevel),z.isOpen=!0}},H.prototype.closeNode=function(z){var K;if(!z.isClosed)return K="",this.writerOptions.state=e.CloseTag,z.type===r.Element?K=this.writer.indent(z,this.writerOptions,this.currentLevel)+"</"+z.name+">"+this.writer.endline(z,this.writerOptions,this.currentLevel):K=this.writer.indent(z,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(z,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),z.isClosed=!0},H.prototype.onData=function(z,K){return this.documentStarted=!0,this.onDataCallback(z,K+1)},H.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},H.prototype.debugInfo=function(z){return z==null?"":"node: <"+z+">"},H.prototype.ele=function(){return this.element.apply(this,arguments)},H.prototype.nod=function(z,K,X){return this.node(z,K,X)},H.prototype.txt=function(z){return this.text(z)},H.prototype.dat=function(z){return this.cdata(z)},H.prototype.com=function(z){return this.comment(z)},H.prototype.ins=function(z,K){return this.instruction(z,K)},H.prototype.dec=function(z,K,X){return this.declaration(z,K,X)},H.prototype.dtd=function(z,K,X){return this.doctype(z,K,X)},H.prototype.e=function(z,K,X){return this.element(z,K,X)},H.prototype.n=function(z,K,X){return this.node(z,K,X)},H.prototype.t=function(z){return this.text(z)},H.prototype.d=function(z){return this.cdata(z)},H.prototype.c=function(z){return this.comment(z)},H.prototype.r=function(z){return this.raw(z)},H.prototype.i=function(z,K){return this.instruction(z,K)},H.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.ent=function(z,K){return this.entity(z,K)},H.prototype.pent=function(z,K){return this.pEntity(z,K)},H.prototype.not=function(z,K){return this.notation(z,K)},H})()}).call(XW)});var ZW=Z((QW,YW)=>{"use strict";(function(){var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;r=Si(),n=XL(),e=Jb(),YW.exports=t=(function(a){i(u,a);function u(c,l){this.stream=c,u.__super__.constructor.call(this,l)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(c,l,p){return c.isLastRootNode&&l.state===e.CloseTag?"":u.__super__.endline.call(this,c,l,p)},u.prototype.document=function(c,l){var p,m,g,y,v,b,x,E,N;for(x=c.children,m=g=0,v=x.length;g<v;m=++g)p=x[m],p.isLastRootNode=m===c.children.length-1;for(l=this.filterOptions(l),E=c.children,N=[],y=0,b=E.length;y<b;y++)p=E[y],N.push(this.writeChildNode(p,l,0));return N},u.prototype.attribute=function(c,l,p){return this.stream.write(u.__super__.attribute.call(this,c,l,p))},u.prototype.cdata=function(c,l,p){return this.stream.write(u.__super__.cdata.call(this,c,l,p))},u.prototype.comment=function(c,l,p){return this.stream.write(u.__super__.comment.call(this,c,l,p))},u.prototype.declaration=function(c,l,p){return this.stream.write(u.__super__.declaration.call(this,c,l,p))},u.prototype.docType=function(c,l,p){var m,g,y,v;if(p||(p=0),this.openNode(c,l,p),l.state=e.OpenTag,this.stream.write(this.indent(c,l,p)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,l,p)),l.state=e.InsideTag,v=c.children,g=0,y=v.length;g<y;g++)m=v[g],this.writeChildNode(m,l,p+1);l.state=e.CloseTag,this.stream.write("]")}return l.state=e.CloseTag,this.stream.write(l.spaceBeforeSlash+">"),this.stream.write(this.endline(c,l,p)),l.state=e.None,this.closeNode(c,l,p)},u.prototype.element=function(c,l,p){var m,g,y,v,b,x,E,N,w,C;p||(p=0),this.openNode(c,l,p),l.state=e.OpenTag,this.stream.write(this.indent(c,l,p)+"<"+c.name),w=c.attribs;for(E in w)s.call(w,E)&&(m=w[E],this.attribute(m,l,p));if(y=c.children.length,v=y===0?null:c.children[0],y===0||c.children.every(function(A){return(A.type===r.Text||A.type===r.Raw)&&A.value===""}))l.allowEmpty?(this.stream.write(">"),l.state=e.CloseTag,this.stream.write("</"+c.name+">")):(l.state=e.CloseTag,this.stream.write(l.spaceBeforeSlash+"/>"));else if(l.pretty&&y===1&&(v.type===r.Text||v.type===r.Raw)&&v.value!=null)this.stream.write(">"),l.state=e.InsideTag,l.suppressPrettyCount++,N=!0,this.writeChildNode(v,l,p+1),l.suppressPrettyCount--,N=!1,l.state=e.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,l,p)),l.state=e.InsideTag,C=c.children,b=0,x=C.length;b<x;b++)g=C[b],this.writeChildNode(g,l,p+1);l.state=e.CloseTag,this.stream.write(this.indent(c,l,p)+"</"+c.name+">")}return this.stream.write(this.endline(c,l,p)),l.state=e.None,this.closeNode(c,l,p)},u.prototype.processingInstruction=function(c,l,p){return this.stream.write(u.__super__.processingInstruction.call(this,c,l,p))},u.prototype.raw=function(c,l,p){return this.stream.write(u.__super__.raw.call(this,c,l,p))},u.prototype.text=function(c,l,p){return this.stream.write(u.__super__.text.call(this,c,l,p))},u.prototype.dtdAttList=function(c,l,p){return this.stream.write(u.__super__.dtdAttList.call(this,c,l,p))},u.prototype.dtdElement=function(c,l,p){return this.stream.write(u.__super__.dtdElement.call(this,c,l,p))},u.prototype.dtdEntity=function(c,l,p){return this.stream.write(u.__super__.dtdEntity.call(this,c,l,p))},u.prototype.dtdNotation=function(c,l,p){return this.stream.write(u.__super__.dtdNotation.call(this,c,l,p))},u})(n)}).call(QW)});var tJ=Z((eJ,vh)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l;l=Yc(),u=l.assign,c=l.isFunction,t=zL(),n=WL(),i=JW(),a=ET(),s=ZW(),r=Si(),e=Jb(),vh.exports.create=function(p,m,g,y){var v,b;if(p==null)throw new Error("Root element needs a name.");return y=u({},m,g,y),v=new n(y),b=v.element(p),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.dtd(y)),b},vh.exports.begin=function(p,m,g){var y;return c(p)&&(y=[p,m],m=y[0],g=y[1],p={}),m?new i(p,m,g):new n(p)},vh.exports.stringWriter=function(p){return new a(p)},vh.exports.streamWriter=function(p,m){return new s(p,m)},vh.exports.implementation=new t,vh.exports.nodeType=r,vh.exports.writerState=e}).call(eJ)});var rJ=Z(JL=>{"use strict";(function(){"use strict";var r,e,t,n,i,s={}.hasOwnProperty;r=tJ(),e=lT().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),i=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),JL.Builder=(function(){function a(u){var c,l,p;this.options={},l=e["0.2"];for(c in l)s.call(l,c)&&(p=l[c],this.options[c]=p);for(c in u)s.call(u,c)&&(p=u[c],this.options[c]=p)}return o(a,"Builder"),a.prototype.buildObject=function(u){var c,l,p,m,g;return c=this.options.attrkey,l=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,p=(function(y){return function(v,b){var x,E,N,w,C,A;if(typeof b!="object")y.options.cdata&&n(b)?v.raw(i(b)):v.txt(b);else if(Array.isArray(b)){for(w in b)if(s.call(b,w)){E=b[w];for(C in E)N=E[C],v=p(v.ele(C),N).up()}}else for(C in b)if(s.call(b,C))if(E=b[C],C===c){if(typeof E=="object")for(x in E)A=E[x],v=v.att(x,A)}else if(C===l)y.options.cdata&&n(E)?v=v.raw(i(E)):v=v.txt(E);else if(Array.isArray(E))for(w in E)s.call(E,w)&&(N=E[w],typeof N=="string"?y.options.cdata&&n(N)?v=v.ele(C).raw(i(N)).up():v=v.ele(C,N).up():v=p(v.ele(C),N).up());else typeof E=="object"?v=p(v.ele(C),E).up():typeof E=="string"&&y.options.cdata&&n(E)?v=v.ele(C).raw(i(E)).up():(E==null&&(E=""),v=v.ele(C,E.toString()).up());return v}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),p(m,u).end(this.options.renderOpts)},a})()}).call(JL)});var nJ=Z(QL=>{"use strict";(function(){"use strict";QL.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(QL)});var YL=Z(Cm=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),Cm.normalize=function(e){return e.toLowerCase()},Cm.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Cm.stripPrefix=function(e){return e.replace(r,"")},Cm.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},Cm.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(Cm)});var iJ=Z(af=>{"use strict";(function(){"use strict";var r,e,t,n,i,s,a,u,c,l=o(function(g,y){return function(){return g.apply(y,arguments)}},"bind"),p=o(function(g,y){for(var v in y)m.call(y,v)&&(g[v]=y[v]);function b(){this.constructor=g}return o(b,"ctor"),b.prototype=y.prototype,g.prototype=new b,g.__super__=y.prototype,g},"extend"),m={}.hasOwnProperty;u=CL(),n=require("events"),r=nJ(),a=YL(),c=require("timers").setImmediate,e=lT().defaults,i=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),s=o(function(g,y,v){var b,x,E;for(b=0,x=g.length;b<x;b++)E=g[b],y=E(y,v);return y},"processItem"),t=o(function(g,y,v){var b;return b=Object.create(null),b.value=v,b.writable=!0,b.enumerable=!0,b.configurable=!0,Object.defineProperty(g,y,b)},"defineProperty"),af.Parser=(function(g){p(y,g);function y(v){this.parseStringPromise=l(this.parseStringPromise,this),this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var b,x,E;if(!(this instanceof af.Parser))return new af.Parser(v);this.options={},x=e["0.2"];for(b in x)m.call(x,b)&&(E=x[b],this.options[b]=E);for(b in v)m.call(v,b)&&(E=v[b],this.options[b]=E);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(y,"Parser"),y.prototype.processAsync=function(){var v,b;try{return this.remaining.length<=this.options.chunkSize?(v=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(v),this.saxParser.close()):(v=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(v),c(this.processAsync))}catch(x){if(b=x,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(b)}},y.prototype.assignOrPush=function(v,b,x){return b in v?(v[b]instanceof Array||t(v,b,[v[b]]),v[b].push(x)):this.options.explicitArray?t(v,b,[x]):t(v,b,x)},y.prototype.reset=function(){var v,b,x,E;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(N){return function(w){if(N.saxParser.resume(),!N.saxParser.errThrown)return N.saxParser.errThrown=!0,N.emit("error",w)}})(this),this.saxParser.onend=(function(N){return function(){if(!N.saxParser.ended)return N.saxParser.ended=!0,N.emit("end",N.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,E=[],v=this.options.attrkey,b=this.options.charkey,this.saxParser.onopentag=(function(N){return function(w){var C,A,R,M,_;if(R={},R[b]="",!N.options.ignoreAttrs){_=w.attributes;for(C in _)m.call(_,C)&&(!(v in R)&&!N.options.mergeAttrs&&(R[v]={}),A=N.options.attrValueProcessors?s(N.options.attrValueProcessors,w.attributes[C],C):w.attributes[C],M=N.options.attrNameProcessors?s(N.options.attrNameProcessors,C):C,N.options.mergeAttrs?N.assignOrPush(R,M,A):t(R[v],M,A))}return R["#name"]=N.options.tagNameProcessors?s(N.options.tagNameProcessors,w.name):w.name,N.options.xmlns&&(R[N.options.xmlnskey]={uri:w.uri,local:w.local}),E.push(R)}})(this),this.saxParser.onclosetag=(function(N){return function(){var w,C,A,R,M,_,H,z,K,X;if(_=E.pop(),M=_["#name"],(!N.options.explicitChildren||!N.options.preserveChildrenOrder)&&delete _["#name"],_.cdata===!0&&(w=_.cdata,delete _.cdata),K=E[E.length-1],_[b].match(/^\s*$/)&&!w?(C=_[b],delete _[b]):(N.options.trim&&(_[b]=_[b].trim()),N.options.normalize&&(_[b]=_[b].replace(/\s{2,}/g," ").trim()),_[b]=N.options.valueProcessors?s(N.options.valueProcessors,_[b],M):_[b],Object.keys(_).length===1&&b in _&&!N.EXPLICIT_CHARKEY&&(_=_[b])),i(_)&&(typeof N.options.emptyTag=="function"?_=N.options.emptyTag():_=N.options.emptyTag!==""?N.options.emptyTag:C),N.options.validator!=null&&(X="/"+(function(){var ye,fe,ce;for(ce=[],ye=0,fe=E.length;ye<fe;ye++)R=E[ye],ce.push(R["#name"]);return ce})().concat(M).join("/"),(function(){var ye;try{return _=N.options.validator(X,K&&K[M],_)}catch(fe){return ye=fe,N.emit("error",ye)}})()),N.options.explicitChildren&&!N.options.mergeAttrs&&typeof _=="object"){if(!N.options.preserveChildrenOrder)R={},N.options.attrkey in _&&(R[N.options.attrkey]=_[N.options.attrkey],delete _[N.options.attrkey]),!N.options.charsAsChildren&&N.options.charkey in _&&(R[N.options.charkey]=_[N.options.charkey],delete _[N.options.charkey]),Object.getOwnPropertyNames(_).length>0&&(R[N.options.childkey]=_),_=R;else if(K){K[N.options.childkey]=K[N.options.childkey]||[],H={};for(A in _)m.call(_,A)&&t(H,A,_[A]);K[N.options.childkey].push(H),delete _["#name"],Object.keys(_).length===1&&b in _&&!N.EXPLICIT_CHARKEY&&(_=_[b])}}return E.length>0?N.assignOrPush(K,M,_):(N.options.explicitRoot&&(z=_,_={},t(_,M,z)),N.resultObject=_,N.saxParser.ended=!0,N.emit("end",N.resultObject))}})(this),x=(function(N){return function(w){var C,A;if(A=E[E.length-1],A)return A[b]+=w,N.options.explicitChildren&&N.options.preserveChildrenOrder&&N.options.charsAsChildren&&(N.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(A[N.options.childkey]=A[N.options.childkey]||[],C={"#name":"__text__"},C[b]=w,N.options.normalize&&(C[b]=C[b].replace(/\s{2,}/g," ").trim()),A[N.options.childkey].push(C)),A}})(this),this.saxParser.ontext=x,this.saxParser.oncdata=(function(N){return function(w){var C;if(C=x(w),C)return C.cdata=!0}})(this)},y.prototype.parseString=function(v,b){var x;b!=null&&typeof b=="function"&&(this.on("end",function(E){return this.reset(),b(null,E)}),this.on("error",function(E){return this.reset(),b(E)}));try{return v=v.toString(),v.trim()===""?(this.emit("end",null),!0):(v=r.stripBOM(v),this.options.async?(this.remaining=v,c(this.processAsync),this.saxParser):this.saxParser.write(v).close())}catch(E){if(x=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw x}else return this.emit("error",x),this.saxParser.errThrown=!0}},y.prototype.parseStringPromise=function(v){return new Promise((function(b){return function(x,E){return b.parseString(v,function(N,w){return N?E(N):x(w)})}})(this))},y})(n),af.parseString=function(g,y,v){var b,x,E;return v!=null?(typeof v=="function"&&(b=v),typeof y=="object"&&(x=y)):(typeof y=="function"&&(b=y),x={}),E=new af.Parser(x),E.parseString(g,b)},af.parseStringPromise=function(g,y){var v,b;return typeof y=="object"&&(v=y),b=new af.Parser(v),b.parseStringPromise(g)}}).call(af)});var sJ=Z(of=>{"use strict";(function(){"use strict";var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;e=lT(),r=rJ(),t=iJ(),n=YL(),of.defaults=e.defaults,of.processors=n,of.ValidationError=(function(a){i(u,a);function u(c){this.message=c}return o(u,"ValidationError"),u})(Error),of.Builder=r.Builder,of.Parser=t.Parser,of.parseString=t.parseString,of.parseStringPromise=t.parseStringPromise}).call(of)});var DZ=Z((rze,RZ)=>{"use strict";var EA;RZ.exports=function(){if(!EA){try{EA=lm()("follow-redirects")}catch{}typeof EA!="function"&&(EA=o(function(){},"debug"))}EA.apply(null,arguments)}});var LZ=Z((ize,T8)=>{"use strict";var NA=require("url"),AA=NA.URL,vNe=require("http"),yNe=require("https"),b8=require("stream").Writable,w8=require("assert"),_Z=DZ();o((function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=dg(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")}),"detectUnsupportedEnvironment")();var C8=!1;try{w8(new AA(""))}catch(r){C8=r.code==="ERR_INVALID_URL"}var SNe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],E8=["abort","aborted","connect","error","socket","timeout"],A8=Object.create(null);E8.forEach(function(r){A8[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var y8=IA("ERR_INVALID_URL","Invalid URL",TypeError),S8=IA("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),xNe=IA("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",S8),bNe=IA("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wNe=IA("ERR_STREAM_WRITE_AFTER_END","write after end"),CNe=b8.prototype.destroy||PZ;function Wa(r,e){b8.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof S8?i:new S8({cause:i}))}},this._performRequest()}o(Wa,"RedirectableRequest");Wa.prototype=Object.create(b8.prototype);Wa.prototype.abort=function(){I8(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wa.prototype.destroy=function(r){return I8(this._currentRequest,r),CNe.call(this,r),this};Wa.prototype.write=function(r,e,t){if(this._ending)throw new wNe;if(!hg(r)&&!NNe(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(dg(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new bNe),this.abort())};Wa.prototype.end=function(r,e,t){if(dg(r)?(t=r,r=e=null):dg(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Wa.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Wa.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Wa.prototype.setTimeout=function(r,e){var t=this;function n(a){a.setTimeout(r),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}o(n,"destroyOnTimeout");function i(a){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(a)}o(i,"startTimer");function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return o(s,"clearTimer"),e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Wa.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Wa.prototype,r,{get:o(function(){return this._currentRequest[r]},"get")})});Wa.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Wa.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of E8)n.on(i,A8[i]);if(this._currentUrl=/^\//.test(this._options.path)?NA.format(this._options):this._options.path,this._isRedirect){var s=0,a=this,u=this._requestBodyBuffers;o((function c(l){if(n===a._currentRequest)if(l)a.emit("error",l);else if(s<u.length){var p=u[s++];n.finished||n.write(p.data,p.encoding,c)}else a._ended&&n.end()}),"writeNext")()}};Wa.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(I8(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new xNe;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],v8(/^content-/i,this._options.headers));var a=v8(/^host$/i,this._options.headers),u=N8(this._currentUrl),c=a||u.host,l=/^\w+:/.test(t)?this._currentUrl:NA.format(Object.assign(u,{host:c})),p=ENe(t,l);if(_Z("redirecting to",p.href),this._isRedirect=!0,x8(p,this._options),(p.protocol!==u.protocol&&p.protocol!=="https:"||p.host!==c&&!ANe(p.host,c))&&v8(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),dg(i)){var m={headers:r.headers,statusCode:e},g={url:l,method:s,headers:n};i(this._options,m,g),this._sanitizeOptions(this._options)}this._performRequest()};function OZ(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],a=e[n]=Object.create(s);function u(l,p,m){return INe(l)?l=x8(l):hg(l)?l=x8(N8(l)):(m=p,p=BZ(l),l={protocol:i}),dg(p)&&(m=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,p),p.nativeProtocols=t,!hg(p.host)&&!hg(p.hostname)&&(p.hostname="::1"),w8.equal(p.protocol,i,"protocol mismatch"),_Z("options",p),new Wa(p,m)}o(u,"request");function c(l,p,m){var g=a.request(l,p,m);return g.end(),g}o(c,"get"),Object.defineProperties(a,{request:{value:u,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}o(OZ,"wrap");function PZ(){}o(PZ,"noop");function N8(r){var e;if(C8)e=new AA(r);else if(e=BZ(NA.parse(r)),!hg(e.protocol))throw new y8({input:r});return e}o(N8,"parseUrl");function ENe(r,e){return C8?new AA(r,e):N8(NA.resolve(e,r))}o(ENe,"resolveUrl");function BZ(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new y8({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new y8({input:r.href||r});return r}o(BZ,"validateUrl");function x8(r,e){var t=e||{};for(var n of SNe)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}o(x8,"spreadUrlObject");function v8(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}o(v8,"removeMatchingHeaders");function IA(r,e,t){function n(i){dg(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return o(n,"CustomError"),n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}o(IA,"createErrorType");function I8(r,e){for(var t of E8)r.removeListener(t,A8[t]);r.on("error",PZ),r.destroy(e)}o(I8,"destroyRequest");function ANe(r,e){w8(hg(r)&&hg(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}o(ANe,"isSubdomain");function hg(r){return typeof r=="string"||r instanceof String}o(hg,"isString");function dg(r){return typeof r=="function"}o(dg,"isFunction");function NNe(r){return typeof r=="object"&&"length"in r}o(NNe,"isBuffer");function INe(r){return AA&&r instanceof AA}o(INe,"isURL");T8.exports=OZ({http:vNe,https:yNe});T8.exports.wrap=OZ});var m2e={};MN(m2e,{ASN1:()=>Yx,AccessKeyBuilder:()=>dA,CanonicalizationMethod:()=>EP,Choice:()=>Qr,Decimal:()=>gs,DefaultDetBuilderAggregator:()=>mA,DefaultTotalBuilderAggregator:()=>gA,DigestAlgorithm:()=>zN,EntitySigner:()=>Dx,Environment:()=>Me,IsDecimal:()=>TV,Left:()=>KN,MemoryCacheAdapter:()=>Bx,NFCeDto:()=>yu,NFeDto:()=>gc,NFeTsError:()=>ln,NativeCertificateRepository:()=>Qx,NfceQrcode:()=>Sj,NfceRemoteTransmitter:()=>uO,NfceXmlBuilder:()=>xj,NfeAuthorizerPipeline:()=>mj,NfeDetXmlBuilder:()=>ks,NfeRemoteTransmitter:()=>eo,NfeXmlBuilder:()=>Xn,NullCacheAdapter:()=>Jx,Right:()=>Rx,SignatureAlgorithm:()=>Nu,SignatureMethod:()=>HN,SignatureNamespace:()=>qN,Signer:()=>Qd,SkipAllValidations:()=>pue,SkipValidation:()=>fue,SkipValidationMetadata:()=>Qg,SoapRemoteTransmissionRepository:()=>$b,StateAcronyms:()=>AP,StateCodeAcValidator:()=>DV,StateCodeAlValidator:()=>_V,StateCodeAmValidator:()=>OV,StateCodeApValidator:()=>PV,StateCodeBaValidator:()=>BV,StateCodeCeValidator:()=>LV,StateCodeDfValidator:()=>FV,StateCodeEsValidator:()=>kV,StateCodeGoValidator:()=>VV,StateCodeMaValidator:()=>jV,StateCodeMgValidator:()=>UV,StateCodeMsValidator:()=>MV,StateCodeMtValidator:()=>qV,StateCodePaValidator:()=>HV,StateCodePbValidator:()=>zV,StateCodePeValidator:()=>KV,StateCodePiValidator:()=>$V,StateCodePrValidator:()=>GV,StateCodeRjValidator:()=>XV,StateCodeRnValidator:()=>WV,StateCodeRoValidator:()=>JV,StateCodeRrValidator:()=>QV,StateCodeRsValidator:()=>YV,StateCodeScValidator:()=>ZV,StateCodeSeValidator:()=>e8,StateCodeSpValidator:()=>t8,StateCodeToValidator:()=>r8,StateCodes:()=>le,TpEmis:()=>Ga,TransformDateString:()=>jf,TransformDecimal:()=>Se,ValidateErrorsMetadata:()=>co,Validates:()=>Yt,ValidationError:()=>NP,Xml2JsToolkit:()=>hA,XmlSigner:()=>IP,clearEmptyValues:()=>_x,directory:()=>n8,left:()=>Ai,leftFromError:()=>Jl,mapConstraintsToErrors:()=>TP,plainToInstance:()=>Ox,right:()=>Fn,unreachable:()=>Rp});module.exports=lue(m2e);var qN="http://www.w3.org/2000/09/xmldsig#",EP="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",HN=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Nu=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),zN=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var le={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},AP=Object.keys(le);var Me={Production:"1",Homolog:"2"};var b2e={[le.AC]:"America/Rio_Branco",[le.AL]:"America/Maceio",[le.AM]:"America/Manaus",[le.AP]:"America/Belem",[le.BA]:"America/Bahia",[le.CE]:"America/Fortaleza",[le.DF]:"America/Sao_Paulo",[le.ES]:"America/Sao_Paulo",[le.GO]:"America/Sao_Paulo",[le.MA]:"America/Fortaleza",[le.MG]:"America/Sao_Paulo",[le.MS]:"America/Campo_Grande",[le.MT]:"America/Cuiaba",[le.PA]:"America/Belem",[le.PB]:"America/Fortaleza",[le.PE]:"America/Recife",[le.PI]:"America/Fortaleza",[le.PR]:"America/Sao_Paulo",[le.RJ]:"America/Sao_Paulo",[le.RN]:"America/Fortaleza",[le.RO]:"America/Porto_Velho",[le.RR]:"America/Boa_Vista",[le.RS]:"America/Sao_Paulo",[le.SC]:"America/Sao_Paulo",[le.SE]:"America/Maceio",[le.SP]:"America/Sao_Paulo",[le.TO]:"America/Araguaina"};var ln=class extends Error{static{o(this,"NFeTsError")}};var NP=class extends ln{static{o(this,"ValidationError")}};var Tx={includeComments:!1,exclusive:!0};var Rp=o(r=>{throw new ln("Didn't expect to get here")},"unreachable");var Qd=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Nu.SHA1,i=Tx){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=i}assemble(e,t,n){let i=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:qN},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:i}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:EP}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:qN},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Nu.SHA256:return zN.SHA256;case Nu.SHA1:return zN.SHA1;default:return Rp(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Nu.SHA256:return HN.RSA_SHA256;case Nu.SHA1:return HN.RSA_SHA1;default:return Rp(this.algorithm)}}};var KN=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},Rx=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Ai=o(r=>new KN(r),"left"),Fn=o(r=>r===void 0?new Rx(void 0):new Rx(r),"right");var Dx=class extends Qd{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{privateKey:a,certificate:u}=n;if(!e[i])return Ai(new ln(`Node ${String(i)} not found`));let c=await this.toolkit.build(this.ns(e,i),{headless:!0,rootName:String(i),renderOpts:{pretty:!1}}),l=this.signedInfo(c,s),p=await this.signOrLeft(l,a);if(p.isLeft())return p;let m=e;return m.Signature=this.assemble(l,p.value,u),Fn(m)}ns(e,t){let n=e.$?.xmlns,{$:i,...s}=e[t],{xmlns:a,...u}=i??{};return{$:{xmlns:n,...u},...s}}};var IP=class extends Qd{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{privateKey:a,certificate:u}=n,c=this.toolkit.getNode(e,i);if(!c)return Ai(new ln(`Node ${i} not found`));let l=this.signedInfo(c,s),p=await this.signOrLeft(l,a);if(p.isLeft())return p;let m=await this.toolkit.build(this.assemble(l,p.value,u),{rootName:"Signature"});return Fn(this.toolkit.appendNode(e,m))}};var dIe=require("reflect-metadata"),XU=require("class-validator");var cIe=require("reflect-metadata");var Qg="__SkipValidation__",fue=o(()=>(r,e)=>{Reflect.defineMetadata(Qg,!0,r,e.toString())},"SkipValidation"),pue=o(()=>r=>{Reflect.defineMetadata(Qg,!0,r)},"SkipAllValidations");var GU=require("class-transformer");var _x=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&_x(t)},"clearEmptyValues"),Ox=o((r,e,t={})=>{let n=(0,GU.plainToInstance)(e,r);return t.clearEmptyValues&&_x(n),n},"plainToInstance");var co="__ValidateErrors__",TP=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(TP(n.children,e?`${e}.${n.property}`:n.property));let i=Object.values(n.constraints??{}).map(s=>e?`${e}.${s}`:s).join(", ");return i?t.concat(i):t},[]),"mapConstraintsToErrors"),Yt=o(r=>(e,t,n)=>{let i=n.value;n.value=function(...s){let a=Reflect.getMetadata(Qg,this.constructor);if(Reflect.getMetadata(Qg,this.constructor.prototype,t.toString())===!0||a===!0)return i?.apply(this,s);let[c,...l]=s,p=Ox(c,r),m=(0,XU.validateSync)(p,{whitelist:!0});if(_x(p),m.length){let g=Reflect.getMetadata(co,this)??[];Reflect.defineMetadata(co,g.concat(TP(m,i?.name)),this)}return i?.apply(this,[p,...l])}},"Validates");var $Me=require("reflect-metadata");var Yg=9e15,Pp=1e9,RP="0123456789abcdef",XN="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",WN="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",DP={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Yg,maxE:Yg,crypto:!1},YU,Kl,Gt=!0,QN="[DecimalError] ",Op=QN+"Invalid argument: ",ZU=QN+"Precision limit exceeded",eM=QN+"crypto unavailable",tM="[object Decimal]",Hs=Math.floor,Li=Math.pow,hue=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,due=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,mue=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rM=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Iu=1e7,Bt=7,gue=9007199254740991,vue=XN.length-1,_P=WN.length-1,qe={toStringTag:tM};qe.absoluteValue=qe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),It(r)};qe.ceil=function(){return It(new this.constructor(this),this.e+1,2)};qe.clampedTo=qe.clamp=function(r,e){var t,n=this,i=n.constructor;if(r=new i(r),e=new i(e),!r.s||!e.s)return new i(NaN);if(r.gt(e))throw Error(Op+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new i(n)};qe.comparedTo=qe.cmp=function(r){var e,t,n,i,s=this,a=s.d,u=(r=new s.constructor(r)).d,c=s.s,l=r.s;if(!a||!u)return!c||!l?NaN:c!==l?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!==l)return c;if(s.e!==r.e)return s.e>r.e^c<0?1:-1;for(n=a.length,i=u.length,e=0,t=n<i?n:i;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};qe.cosine=qe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Bt,n.rounding=1,t=yue(n,oM(n,t)),n.precision=r,n.rounding=e,It(Kl==2||Kl==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};qe.cubeRoot=qe.cbrt=function(){var r,e,t,n,i,s,a,u,c,l,p=this,m=p.constructor;if(!p.isFinite()||p.isZero())return new m(p);for(Gt=!1,s=p.s*Li(p.s*p,1/3),!s||Math.abs(s)==1/0?(t=ms(p.d),r=p.e,(s=(r-t.length+1)%3)&&(t+=s==1||s==-2?"0":"00"),s=Li(t,1/3),r=Hs((r+1)/3)-(r%3==(r<0?-1:2)),s==1/0?t="5e"+r:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=p.s):n=new m(s.toString()),a=(r=m.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(p),n=pn(l.plus(p).times(u),l.plus(c),a+2,1),ms(u.d).slice(0,a)===(t=ms(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!i&&t=="4999"){if(!i&&(It(u,r+1,0),u.times(u).times(u).eq(p))){n=u;break}a+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(It(n,r+1,1),e=!n.times(n).times(n).eq(p));break}return Gt=!0,It(n,r,m.rounding,e)};qe.decimalPlaces=qe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-Hs(this.e/Bt))*Bt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};qe.dividedBy=qe.div=function(r){return pn(this,new this.constructor(r))};qe.dividedToIntegerBy=qe.divToInt=function(r){var e=this,t=e.constructor;return It(pn(e,new t(r),0,1,1),t.precision,t.rounding)};qe.equals=qe.eq=function(r){return this.cmp(r)===0};qe.floor=function(){return It(new this.constructor(this),this.e+1,3)};qe.greaterThan=qe.gt=function(r){return this.cmp(r)>0};qe.greaterThanOrEqualTo=qe.gte=function(r){var e=this.cmp(r);return e==1||e===0};qe.hyperbolicCosine=qe.cosh=function(){var r,e,t,n,i,s=this,a=s.constructor,u=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(r=Math.ceil(i/3),e=(1/ZN(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),s=Zg(a,1,s.times(e),new a(1),!0);for(var c,l=r,p=new a(8);l--;)c=s.times(s),s=u.minus(c.times(p.minus(c.times(p))));return It(s,a.precision=t,a.rounding=n,!0)};qe.hyperbolicSine=qe.sinh=function(){var r,e,t,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,t=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Zg(s,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/ZN(5,r)),i=Zg(s,2,i,i,!0);for(var a,u=new s(5),c=new s(16),l=new s(20);r--;)a=i.times(i),i=i.times(u.plus(a.times(c.times(a).plus(l))))}return s.precision=e,s.rounding=t,It(i,e,t,!0)};qe.hyperbolicTangent=qe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,pn(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};qe.inverseCosine=qe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,i=e.rounding;return t!==-1?t===0?r.isNeg()?Ac(e,n,i):new e(0):new e(NaN):r.isZero()?Ac(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,r.times(2))};qe.inverseHyperbolicCosine=qe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Gt=!1,t=t.times(t).minus(1).sqrt().plus(t),Gt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};qe.inverseHyperbolicSine=qe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Gt=!1,t=t.times(t).plus(1).sqrt().plus(t),Gt=!0,n.precision=r,n.rounding=e,t.ln())};qe.inverseHyperbolicTangent=qe.atanh=function(){var r,e,t,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=s.precision,e=s.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?It(new s(i),r,e,!0):(s.precision=t=n-i.e,i=pn(i.plus(1),new s(1).minus(i),t+r,1),s.precision=r+4,s.rounding=1,i=i.ln(),s.precision=r,s.rounding=e,i.times(.5))):new s(NaN)};qe.inverseSine=qe.asin=function(){var r,e,t,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),t=s.precision,n=s.rounding,e!==-1?e===0?(r=Ac(s,t+4,n).times(.5),r.s=i.s,r):new s(NaN):(s.precision=t+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=t,s.rounding=n,i.times(2)))};qe.inverseTangent=qe.atan=function(){var r,e,t,n,i,s,a,u,c,l=this,p=l.constructor,m=p.precision,g=p.rounding;if(l.isFinite()){if(l.isZero())return new p(l);if(l.abs().eq(1)&&m+4<=_P)return a=Ac(p,m+4,g).times(.25),a.s=l.s,a}else{if(!l.s)return new p(NaN);if(m+4<=_P)return a=Ac(p,m+4,g).times(.5),a.s=l.s,a}for(p.precision=u=m+10,p.rounding=1,t=Math.min(28,u/Bt+2|0),r=t;r;--r)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Gt=!1,e=Math.ceil(u/Bt),n=1,c=l.times(l),a=new p(l),i=l;r!==-1;)if(i=i.times(c),s=a.minus(i.div(n+=2)),i=i.times(c),a=s.plus(i.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===s.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Gt=!0,It(a,p.precision=m,p.rounding=g,!0)};qe.isFinite=function(){return!!this.d};qe.isInteger=qe.isInt=function(){return!!this.d&&Hs(this.e/Bt)>this.d.length-2};qe.isNaN=function(){return!this.s};qe.isNegative=qe.isNeg=function(){return this.s<0};qe.isPositive=qe.isPos=function(){return this.s>0};qe.isZero=function(){return!!this.d&&this.d[0]===0};qe.lessThan=qe.lt=function(r){return this.cmp(r)<0};qe.lessThanOrEqualTo=qe.lte=function(r){return this.cmp(r)<1};qe.logarithm=qe.log=function(r){var e,t,n,i,s,a,u,c,l=this,p=l.constructor,m=p.precision,g=p.rounding,y=5;if(r==null)r=new p(10),e=!0;else{if(r=new p(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new p(NaN);e=r.eq(10)}if(t=l.d,l.s<0||!t||!t[0]||l.eq(1))return new p(t&&!t[0]?-1/0:l.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)s=!0;else{for(i=t[0];i%10===0;)i/=10;s=i!==1}if(Gt=!1,u=m+y,a=_p(l,u),n=e?JN(p,u+10):_p(r,u),c=pn(a,n,u,1),Px(c.d,i=m,g))do if(u+=10,a=_p(l,u),n=e?JN(p,u+10):_p(r,u),c=pn(a,n,u,1),!s){+ms(c.d).slice(i+1,i+15)+1==1e14&&(c=It(c,m+1,0));break}while(Px(c.d,i+=10,g));return Gt=!0,It(c,m,g)};qe.minus=qe.sub=function(r){var e,t,n,i,s,a,u,c,l,p,m,g,y=this,v=y.constructor;if(r=new v(r),!y.d||!r.d)return!y.s||!r.s?r=new v(NaN):y.d?r.s=-r.s:r=new v(r.d||y.s!==r.s?y:NaN),r;if(y.s!=r.s)return r.s=-r.s,y.plus(r);if(l=y.d,g=r.d,u=v.precision,c=v.rounding,!l[0]||!g[0]){if(g[0])r.s=-r.s;else if(l[0])r=new v(y);else return new v(c===3?-0:0);return Gt?It(r,u,c):r}if(t=Hs(r.e/Bt),p=Hs(y.e/Bt),l=l.slice(),s=p-t,s){for(m=s<0,m?(e=l,s=-s,a=g.length):(e=g,t=p,a=l.length),n=Math.max(Math.ceil(u/Bt),a)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(l[n]!=g[n]){m=l[n]<g[n];break}s=0}for(m&&(e=l,l=g,g=e,r.s=-r.s),a=l.length,n=g.length-a;n>0;--n)l[a++]=0;for(n=g.length;n>s;){if(l[--n]<g[n]){for(i=n;i&&l[--i]===0;)l[i]=Iu-1;--l[i],l[n]+=Iu}l[n]-=g[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--t;return l[0]?(r.d=l,r.e=YN(l,t),Gt?It(r,u,c):r):new v(c===3?-0:0)};qe.modulo=qe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?It(new n(t),n.precision,n.rounding):(Gt=!1,n.modulo==9?(e=pn(t,r.abs(),0,3,1),e.s*=r.s):e=pn(t,r,0,n.modulo,1),e=e.times(r),Gt=!0,t.minus(e))};qe.naturalExponential=qe.exp=function(){return OP(this)};qe.naturalLogarithm=qe.ln=function(){return _p(this)};qe.negated=qe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,It(r)};qe.plus=qe.add=function(r){var e,t,n,i,s,a,u,c,l,p,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(l=m.d,p=r.d,u=g.precision,c=g.rounding,!l[0]||!p[0])return p[0]||(r=new g(m)),Gt?It(r,u,c):r;if(s=Hs(m.e/Bt),n=Hs(r.e/Bt),l=l.slice(),i=s-n,i){for(i<0?(t=l,i=-i,a=p.length):(t=p,n=s,a=l.length),s=Math.ceil(u/Bt),a=s>a?s+1:a+1,i>a&&(i=a,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(a=l.length,i=p.length,a-i<0&&(i=a,t=p,p=l,l=t),e=0;i;)e=(l[--i]=l[i]+p[i]+e)/Iu|0,l[i]%=Iu;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=YN(l,n),Gt?It(r,u,c):r};qe.precision=qe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(Op+r);return t.d?(e=nM(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};qe.round=function(){var r=this,e=r.constructor;return It(new e(r),r.e+1,e.rounding)};qe.sine=qe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Bt,n.rounding=1,t=xue(n,oM(n,t)),n.precision=r,n.rounding=e,It(Kl>2?t.neg():t,r,e,!0)):new n(NaN)};qe.squareRoot=qe.sqrt=function(){var r,e,t,n,i,s,a=this,u=a.d,c=a.e,l=a.s,p=a.constructor;if(l!==1||!u||!u[0])return new p(!l||l<0&&(!u||u[0])?NaN:u?a:1/0);for(Gt=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=ms(u),(e.length+c)%2==0&&(e+="0"),l=Math.sqrt(e),c=Hs((c+1)/2)-(c<0||c%2),l==1/0?e="5e"+c:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new p(e)):n=new p(l.toString()),t=(c=p.precision)+3;;)if(s=n,n=s.plus(pn(a,s,t+2,1)).times(.5),ms(s.d).slice(0,t)===(e=ms(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(It(s,c+1,0),s.times(s).eq(a))){n=s;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(It(n,c+1,1),r=!n.times(n).eq(a));break}return Gt=!0,It(n,c,p.rounding,r)};qe.tangent=qe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=pn(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,It(Kl==2||Kl==4?t.neg():t,r,e,!0)):new n(NaN)};qe.times=qe.mul=function(r){var e,t,n,i,s,a,u,c,l,p=this,m=p.constructor,g=p.d,y=(r=new m(r)).d;if(r.s*=p.s,!g||!g[0]||!y||!y[0])return new m(!r.s||g&&!g[0]&&!y||y&&!y[0]&&!g?NaN:!g||!y?r.s/0:r.s*0);for(t=Hs(p.e/Bt)+Hs(r.e/Bt),c=g.length,l=y.length,c<l&&(s=g,g=y,y=s,a=c,c=l,l=a),s=[],a=c+l,n=a;n--;)s.push(0);for(n=l;--n>=0;){for(e=0,i=c+n;i>n;)u=s[i]+y[n]*g[i-n-1]+e,s[i--]=u%Iu|0,e=u/Iu|0;s[i]=(s[i]+e)%Iu|0}for(;!s[--a];)s.pop();return e?++t:s.shift(),r.d=s,r.e=YN(s,t),Gt?It(r,m.precision,m.rounding):r};qe.toBinary=function(r,e){return PP(this,2,r,e)};qe.toDecimalPlaces=qe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ta(r,0,Pp),e===void 0?e=n.rounding:Ta(e,0,8),It(t,r+t.e+1,e))};qe.toExponential=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=Nc(n,!0):(Ta(r,0,Pp),e===void 0?e=i.rounding:Ta(e,0,8),n=It(new i(n),r+1,e),t=Nc(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};qe.toFixed=function(r,e){var t,n,i=this,s=i.constructor;return r===void 0?t=Nc(i):(Ta(r,0,Pp),e===void 0?e=s.rounding:Ta(e,0,8),n=It(new s(i),r+i.e+1,e),t=Nc(n,!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};qe.toFraction=function(r){var e,t,n,i,s,a,u,c,l,p,m,g,y=this,v=y.d,b=y.constructor;if(!v)return new b(y);if(l=t=new b(1),n=c=new b(0),e=new b(n),s=e.e=nM(v)-y.e-1,a=s%Bt,e.d[0]=Li(10,a<0?Bt+a:a),r==null)r=s>0?e:l;else{if(u=new b(r),!u.isInt()||u.lt(l))throw Error(Op+u);r=u.gt(e)?s>0?e:l:u}for(Gt=!1,u=new b(ms(v)),p=b.precision,b.precision=s=v.length*Bt*2;m=pn(u,e,0,1,1),i=t.plus(m.times(n)),i.cmp(r)!=1;)t=n,n=i,i=l,l=c.plus(m.times(i)),c=i,i=e,e=u.minus(m.times(i)),u=i;return i=pn(r.minus(t),n,0,1,1),c=c.plus(i.times(l)),t=t.plus(i.times(n)),c.s=l.s=y.s,g=pn(l,n,s,1).minus(y).abs().cmp(pn(c,t,s,1).minus(y).abs())<1?[l,n]:[c,t],b.precision=p,Gt=!0,g};qe.toHexadecimal=qe.toHex=function(r,e){return PP(this,16,r,e)};qe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ta(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Gt=!1,t=pn(t,r,0,e,1).times(r),Gt=!0,It(t)):(r.s=t.s,t=r),t};qe.toNumber=function(){return+this};qe.toOctal=function(r,e){return PP(this,8,r,e)};qe.toPower=qe.pow=function(r){var e,t,n,i,s,a,u=this,c=u.constructor,l=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Li(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,s=c.rounding,r.eq(1))return It(u,n,s);if(e=Hs(r.e/Bt),e>=r.d.length-1&&(t=l<0?-l:l)<=gue)return i=iM(c,u,t,n),r.s<0?new c(1).div(i):It(i,n,s);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Li(+u,l),e=t==0||!isFinite(t)?Hs(l*(Math.log("0."+ms(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(Gt=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),i=OP(r.times(_p(u,n+t)),n),i.d&&(i=It(i,n+5,1),Px(i.d,n,s)&&(e=n+10,i=It(OP(r.times(_p(u,e+t)),e),e+5,1),+ms(i.d).slice(n+1,n+15)+1==1e14&&(i=It(i,n+1,0)))),i.s=a,Gt=!0,c.rounding=s,It(i,n,s))};qe.toPrecision=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=Nc(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ta(r,1,Pp),e===void 0?e=i.rounding:Ta(e,0,8),n=It(new i(n),r,e),t=Nc(n,r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};qe.toSignificantDigits=qe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ta(r,1,Pp),e===void 0?e=n.rounding:Ta(e,0,8)),It(new n(t),r,e)};qe.toString=function(){var r=this,e=r.constructor,t=Nc(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};qe.truncated=qe.trunc=function(){return It(new this.constructor(this),this.e+1,1)};qe.valueOf=qe.toJSON=function(){var r=this,e=r.constructor,t=Nc(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function ms(r){var e,t,n,i=r.length-1,s="",a=r[0];if(i>0){for(s+=a,e=1;e<i;e++)n=r[e]+"",t=Bt-n.length,t&&(s+=Dp(t)),s+=n;a=r[e],n=a+"",t=Bt-n.length,t&&(s+=Dp(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}o(ms,"digitsToString");function Ta(r,e,t){if(r!==~~r||r<e||r>t)throw Error(Op+r)}o(Ta,"checkInt32");function Px(r,e,t,n){var i,s,a,u;for(s=r[0];s>=10;s/=10)--e;return--e<0?(e+=Bt,i=0):(i=Math.ceil((e+1)/Bt),e%=Bt),s=Li(10,Bt-e),u=r[i]%s|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==s||t>3&&u+1==s/2)&&(r[i+1]/s/100|0)==Li(10,e-2)-1||(u==s/2||u==0)&&(r[i+1]/s/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==s||!n&&t>3&&u+1==s/2)&&(r[i+1]/s/1e3|0)==Li(10,e-3)-1,a}o(Px,"checkRoundingDigits");function $N(r,e,t){for(var n,i=[0],s,a=0,u=r.length;a<u;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=RP.indexOf(r.charAt(a++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}o($N,"convertBase");function yue(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/ZN(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Zg(r,1,e.times(i),new r(1));for(var s=t;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(yue,"cosine");var pn=(function(){function r(n,i,s){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+u,n[c]=a%s|0,u=a/s|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,i,s,a){var u,c;if(s!=a)c=s>a?1:-1;else for(u=c=0;u<s;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}o(e,"compare");function t(n,i,s,a){for(var u=0;s--;)n[s]-=u,u=n[s]<i[s]?1:0,n[s]=u*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,i,s,a,u,c){var l,p,m,g,y,v,b,x,E,N,w,C,A,R,M,_,H,z,K,X,ye=n.constructor,fe=n.s==i.s?1:-1,ce=n.d,ee=i.d;if(!ce||!ce[0]||!ee||!ee[0])return new ye(!n.s||!i.s||(ce?ee&&ce[0]==ee[0]:!ee)?NaN:ce&&ce[0]==0||!ee?fe*0:fe/0);for(c?(y=1,p=n.e-i.e):(c=Iu,y=Bt,p=Hs(n.e/y)-Hs(i.e/y)),K=ee.length,H=ce.length,E=new ye(fe),N=E.d=[],m=0;ee[m]==(ce[m]||0);m++);if(ee[m]>(ce[m]||0)&&p--,s==null?(R=s=ye.precision,a=ye.rounding):u?R=s+(n.e-i.e)+1:R=s,R<0)N.push(1),v=!0;else{if(R=R/y+2|0,m=0,K==1){for(g=0,ee=ee[0],R++;(m<H||g)&&R--;m++)M=g*c+(ce[m]||0),N[m]=M/ee|0,g=M%ee|0;v=g||m<H}else{for(g=c/(ee[0]+1)|0,g>1&&(ee=r(ee,g,c),ce=r(ce,g,c),K=ee.length,H=ce.length),_=K,w=ce.slice(0,K),C=w.length;C<K;)w[C++]=0;X=ee.slice(),X.unshift(0),z=ee[0],ee[1]>=c/2&&++z;do g=0,l=e(ee,w,K,C),l<0?(A=w[0],K!=C&&(A=A*c+(w[1]||0)),g=A/z|0,g>1?(g>=c&&(g=c-1),b=r(ee,g,c),x=b.length,C=w.length,l=e(b,w,x,C),l==1&&(g--,t(b,K<x?X:ee,x,c))):(g==0&&(l=g=1),b=ee.slice()),x=b.length,x<C&&b.unshift(0),t(w,b,C,c),l==-1&&(C=w.length,l=e(ee,w,K,C),l<1&&(g++,t(w,K<C?X:ee,C,c))),C=w.length):l===0&&(g++,w=[0]),N[m++]=g,l&&w[0]?w[C++]=ce[_]||0:(w=[ce[_]],C=1);while((_++<H||w[0]!==void 0)&&R--);v=w[0]!==void 0}N[0]||N.shift()}if(y==1)E.e=p,YU=v;else{for(m=1,g=N[0];g>=10;g/=10)m++;E.e=m+p*y-1,It(E,u?s+E.e+1:s,a,v)}return E}})();function It(r,e,t,n){var i,s,a,u,c,l,p,m,g,y=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(i=1,u=m[0];u>=10;u/=10)i++;if(s=e-i,s<0)s+=Bt,a=e,p=m[g=0],c=p/Li(10,i-a-1)%10|0;else if(g=Math.ceil((s+1)/Bt),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);p=c=0,i=1,s%=Bt,a=s-Bt+1}else break e;else{for(p=u=m[g],i=1;u>=10;u/=10)i++;s%=Bt,a=s-Bt+i,c=a<0?0:p/Li(10,i-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?p:p%Li(10,i-a-1)),l=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(s>0?a>0?p/Li(10,i-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,l?(e-=r.e+1,m[0]=Li(10,(Bt-e%Bt)%Bt),r.e=-e||0):m[0]=r.e=0,r;if(s==0?(m.length=g,u=1,g--):(m.length=g+1,u=Li(10,Bt-s),m[g]=a>0?(p/Li(10,i-a)%Li(10,a)|0)*u:0),l)for(;;)if(g==0){for(s=1,a=m[0];a>=10;a/=10)s++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;s!=u&&(r.e++,m[0]==Iu&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Iu)break;m[g--]=0,u=1}for(s=m.length;m[--s]===0;)m.pop()}return Gt&&(r.e>y.maxE?(r.d=null,r.e=NaN):r.e<y.minE&&(r.e=0,r.d=[0])),r}o(It,"finalise");function Nc(r,e,t){if(!r.isFinite())return aM(r);var n,i=r.e,s=ms(r.d),a=s.length;return e?(t&&(n=t-a)>0?s=s.charAt(0)+"."+s.slice(1)+Dp(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(r.e<0?"e":"e+")+r.e):i<0?(s="0."+Dp(-i-1)+s,t&&(n=t-a)>0&&(s+=Dp(n))):i>=a?(s+=Dp(i+1-a),t&&(n=t-i-1)>0&&(s=s+"."+Dp(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),t&&(n=t-a)>0&&(i+1===a&&(s+="."),s+=Dp(n))),s}o(Nc,"finiteToString");function YN(r,e){var t=r[0];for(e*=Bt;t>=10;t/=10)e++;return e}o(YN,"getBase10Exponent");function JN(r,e,t){if(e>vue)throw Gt=!0,t&&(r.precision=t),Error(ZU);return It(new r(XN),e,1,!0)}o(JN,"getLn10");function Ac(r,e,t){if(e>_P)throw Error(ZU);return It(new r(WN),e,t,!0)}o(Ac,"getPi");function nM(r){var e=r.length-1,t=e*Bt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(nM,"getPrecision");function Dp(r){for(var e="";r--;)e+="0";return e}o(Dp,"getZeroString");function iM(r,e,t,n){var i,s=new r(1),a=Math.ceil(n/Bt+4);for(Gt=!1;;){if(t%2&&(s=s.times(e),JU(s.d,a)&&(i=!0)),t=Hs(t/2),t===0){t=s.d.length-1,i&&s.d[t]===0&&++s.d[t];break}e=e.times(e),JU(e.d,a)}return Gt=!0,s}o(iM,"intPow");function WU(r){return r.d[r.d.length-1]&1}o(WU,"isOdd");function sM(r,e,t){for(var n,i,s=new r(e[0]),a=0;++a<e.length;){if(i=new r(e[a]),!i.s){s=i;break}n=s.cmp(i),(n===t||n===0&&s.s===t)&&(s=i)}return s}o(sM,"maxOrMin");function OP(r,e){var t,n,i,s,a,u,c,l=0,p=0,m=0,g=r.constructor,y=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Gt=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(Li(2,m))/Math.LN10*2+5|0,c+=n,t=s=a=new g(1),g.precision=c;;){if(s=It(s.times(r),c,1),t=t.times(++p),u=a.plus(pn(s,t,c,1)),ms(u.d).slice(0,c)===ms(a.d).slice(0,c)){for(i=m;i--;)a=It(a.times(a),c,1);if(e==null)if(l<3&&Px(a.d,c-n,y,l))g.precision=c+=10,t=s=u=new g(1),p=0,l++;else return It(a,g.precision=v,y,Gt=!0);else return g.precision=v,a}a=u}}o(OP,"naturalExponential");function _p(r,e){var t,n,i,s,a,u,c,l,p,m,g,y=1,v=10,b=r,x=b.d,E=b.constructor,N=E.rounding,w=E.precision;if(b.s<0||!x||!x[0]||!b.e&&x[0]==1&&x.length==1)return new E(x&&!x[0]?-1/0:b.s!=1?NaN:x?0:b);if(e==null?(Gt=!1,p=w):p=e,E.precision=p+=v,t=ms(x),n=t.charAt(0),Math.abs(s=b.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)b=b.times(r),t=ms(b.d),n=t.charAt(0),y++;s=b.e,n>1?(b=new E("0."+t),s++):b=new E(n+"."+t.slice(1))}else return l=JN(E,p+2,w).times(s+""),b=_p(new E(n+"."+t.slice(1)),p-v).plus(l),E.precision=w,e==null?It(b,w,N,Gt=!0):b;for(m=b,c=a=b=pn(b.minus(1),b.plus(1),p,1),g=It(b.times(b),p,1),i=3;;){if(a=It(a.times(g),p,1),l=c.plus(pn(a,new E(i),p,1)),ms(l.d).slice(0,p)===ms(c.d).slice(0,p))if(c=c.times(2),s!==0&&(c=c.plus(JN(E,p+2,w).times(s+""))),c=pn(c,new E(y),p,1),e==null)if(Px(c.d,p-v,N,u))E.precision=p+=v,l=a=b=pn(m.minus(1),m.plus(1),p,1),g=It(b.times(b),p,1),i=u=1;else return It(c,E.precision=w,N,Gt=!0);else return E.precision=w,c;c=l,i+=2}}o(_p,"naturalLogarithm");function aM(r){return String(r.s*r.s/0)}o(aM,"nonFiniteToString");function GN(r,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%Bt,t<0&&(n+=Bt),n<i){for(n&&r.d.push(+e.slice(0,n)),i-=Bt;n<i;)r.d.push(+e.slice(n,n+=Bt));e=e.slice(n),n=Bt-e.length}else n-=i;for(;n--;)e+="0";r.d.push(+e),Gt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(GN,"parseDecimal");function Sue(r,e){var t,n,i,s,a,u,c,l,p;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),rM.test(e))return GN(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(due.test(e))t=16,e=e.toLowerCase();else if(hue.test(e))t=2;else if(mue.test(e))t=8;else throw Error(Op+e);for(s=e.search(/p/i),s>0?(c=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),a=s>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,s=u-s,i=iM(n,new n(t),s,s*2)),l=$N(e,t,Iu),p=l.length-1,s=p;l[s]===0;--s)l.pop();return s<0?new n(r.s*0):(r.e=YN(l,p),r.d=l,Gt=!1,a&&(r=pn(r,i,u*4)),c&&(r=r.times(Math.abs(c)<54?Li(2,c):ev.pow(2,c))),Gt=!0,r)}o(Sue,"parseOther");function xue(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Zg(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/ZN(5,t)),e=Zg(r,2,e,e);for(var i,s=new r(5),a=new r(16),u=new r(20);t--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(u))));return e}o(xue,"sine");function Zg(r,e,t,n,i){var s,a,u,c,l=1,p=r.precision,m=Math.ceil(p/Bt);for(Gt=!1,c=t.times(t),u=new r(n);;){if(a=pn(u.times(c),new r(e++*e++),p,1),u=i?n.plus(a):n.minus(a),n=pn(a.times(c),new r(e++*e++),p,1),a=u.plus(n),a.d[m]!==void 0){for(s=m;a.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=n,n=a,a=s,l++}return Gt=!0,a.d.length=m+1,a}o(Zg,"taylorSeries");function ZN(r,e){for(var t=r;--e;)t*=r;return t}o(ZN,"tinyPow");function oM(r,e){var t,n=e.s<0,i=Ac(r,r.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return Kl=n?4:1,e;if(t=e.divToInt(i),t.isZero())Kl=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(s))return Kl=WU(t)?n?2:3:n?4:1,e;Kl=WU(t)?n?1:4:n?3:2}return e.minus(i).abs()}o(oM,"toLessThanHalfPi");function PP(r,e,t,n){var i,s,a,u,c,l,p,m,g,y=r.constructor,v=t!==void 0;if(v?(Ta(t,1,Pp),n===void 0?n=y.rounding:Ta(n,0,8)):(t=y.precision,n=y.rounding),!r.isFinite())p=aM(r);else{for(p=Nc(r),a=p.indexOf("."),v?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,a>=0&&(p=p.replace(".",""),g=new y(1),g.e=p.length-a,g.d=$N(Nc(g),10,i),g.e=g.d.length),m=$N(p,10,i),s=c=m.length;m[--c]==0;)m.pop();if(!m[0])p=v?"0p+0":"0";else{if(a<0?s--:(r=new y(r),r.d=m,r.e=s,r=pn(r,g,t,n,0,i),m=r.d,s=r.e,l=YU),a=m[t],u=i/2,l=l||m[t+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||l||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,l)for(;++m[--t]>i-1;)m[t]=0,t||(++s,m.unshift(1));for(c=m.length;!m[c-1];--c);for(a=0,p="";a<c;a++)p+=RP.charAt(m[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)p+="0";for(m=$N(p,i,e),c=m.length;!m[c-1];--c);for(a=1,p="1.";a<c;a++)p+=RP.charAt(m[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)p="0"+p;p="0."+p}else if(++s>c)for(s-=c;s--;)p+="0";else s<c&&(p=p.slice(0,s)+"."+p.slice(s))}p=(e==16?"0x":e==2?"0b":e==8?"0o":"")+p}return r.s<0?"-"+p:p}o(PP,"toStringBinary");function JU(r,e){if(r.length>e)return r.length=e,!0}o(JU,"truncate");function bue(r){return new this(r).abs()}o(bue,"abs");function wue(r){return new this(r).acos()}o(wue,"acos");function Cue(r){return new this(r).acosh()}o(Cue,"acosh");function Eue(r,e){return new this(r).plus(e)}o(Eue,"add");function Aue(r){return new this(r).asin()}o(Aue,"asin");function Nue(r){return new this(r).asinh()}o(Nue,"asinh");function Iue(r){return new this(r).atan()}o(Iue,"atan");function Tue(r){return new this(r).atanh()}o(Tue,"atanh");function Rue(r,e){r=new this(r),e=new this(e);var t,n=this.precision,i=this.rounding,s=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=Ac(this,s,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?Ac(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=Ac(this,s,1).times(.5),t.s=r.s):e.s<0?(this.precision=s,this.rounding=1,t=this.atan(pn(r,e,s,1)),e=Ac(this,s,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(pn(r,e,s,1)),t}o(Rue,"atan2");function Due(r){return new this(r).cbrt()}o(Due,"cbrt");function _ue(r){return It(r=new this(r),r.e+1,2)}o(_ue,"ceil");function Oue(r,e,t){return new this(r).clamp(e,t)}o(Oue,"clamp");function Pue(r){if(!r||typeof r!="object")throw Error(QN+"Object expected");var e,t,n,i=r.defaults===!0,s=["precision",1,Pp,"rounding",0,8,"toExpNeg",-Yg,0,"toExpPos",0,Yg,"maxE",0,Yg,"minE",-Yg,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],i&&(this[t]=DP[t]),(n=r[t])!==void 0)if(Hs(n)===n&&n>=s[e+1]&&n<=s[e+2])this[t]=n;else throw Error(Op+t+": "+n);if(t="crypto",i&&(this[t]=DP[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(eM);else this[t]=!1;else throw Error(Op+t+": "+n);return this}o(Pue,"config");function Bue(r){return new this(r).cos()}o(Bue,"cos");function Lue(r){return new this(r).cosh()}o(Lue,"cosh");function uM(r){var e,t,n;function i(s){var a,u,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,QU(s)){l.s=s.s,Gt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(a=0,u=s;u>=10;u/=10)a++;Gt?a>i.maxE?(l.e=NaN,l.d=null):a<i.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[s]):(l.e=a,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return GN(l,s.toString())}if(c==="string")return(u=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(u===43&&(s=s.slice(1)),l.s=1),rM.test(s)?GN(l,s):Sue(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,GN(l,s.toString());throw Error(Op+s)}if(o(i,"Decimal"),i.prototype=qe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Pue,i.clone=uM,i.isDecimal=QU,i.abs=bue,i.acos=wue,i.acosh=Cue,i.add=Eue,i.asin=Aue,i.asinh=Nue,i.atan=Iue,i.atanh=Tue,i.atan2=Rue,i.cbrt=Due,i.ceil=_ue,i.clamp=Oue,i.cos=Bue,i.cosh=Lue,i.div=Fue,i.exp=kue,i.floor=Vue,i.hypot=jue,i.ln=Uue,i.log=Mue,i.log10=Hue,i.log2=que,i.max=zue,i.min=Kue,i.mod=$ue,i.mul=Gue,i.pow=Xue,i.random=Wue,i.round=Jue,i.sign=Que,i.sin=Yue,i.sinh=Zue,i.sqrt=ece,i.sub=tce,i.sum=rce,i.tan=nce,i.tanh=ice,i.trunc=sce,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return i.config(r),i}o(uM,"clone");function Fue(r,e){return new this(r).div(e)}o(Fue,"div");function kue(r){return new this(r).exp()}o(kue,"exp");function Vue(r){return It(r=new this(r),r.e+1,3)}o(Vue,"floor");function jue(){var r,e,t=new this(0);for(Gt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Gt=!0,new this(1/0);t=e}return Gt=!0,t.sqrt()}o(jue,"hypot");function QU(r){return r instanceof ev||r&&r.toStringTag===tM||!1}o(QU,"isDecimalInstance");function Uue(r){return new this(r).ln()}o(Uue,"ln");function Mue(r,e){return new this(r).log(e)}o(Mue,"log");function que(r){return new this(r).log(2)}o(que,"log2");function Hue(r){return new this(r).log(10)}o(Hue,"log10");function zue(){return sM(this,arguments,-1)}o(zue,"max");function Kue(){return sM(this,arguments,1)}o(Kue,"min");function $ue(r,e){return new this(r).mod(e)}o($ue,"mod");function Gue(r,e){return new this(r).mul(e)}o(Gue,"mul");function Xue(r,e){return new this(r).pow(e)}o(Xue,"pow");function Wue(r){var e,t,n,i,s=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ta(r,1,Pp),n=Math.ceil(r/Bt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(i%1e7),s+=4);s=n/4}else throw Error(eM);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],r%=Bt,n&&r&&(i=Li(10,Bt-r),u[s]=(n/i|0)*i);u[s]===0;s--)u.pop();if(s<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Bt)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Bt&&(t-=Bt-n)}return a.e=t,a.d=u,a}o(Wue,"random");function Jue(r){return It(r=new this(r),r.e+1,this.rounding)}o(Jue,"round");function Que(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(Que,"sign");function Yue(r){return new this(r).sin()}o(Yue,"sin");function Zue(r){return new this(r).sinh()}o(Zue,"sinh");function ece(r){return new this(r).sqrt()}o(ece,"sqrt");function tce(r,e){return new this(r).sub(e)}o(tce,"sub");function rce(){var r=0,e=arguments,t=new this(e[r]);for(Gt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Gt=!0,It(t,this.precision,this.rounding)}o(rce,"sum");function nce(r){return new this(r).tan()}o(nce,"tan");function ice(r){return new this(r).tanh()}o(ice,"tanh");function sce(r){return It(r=new this(r),r.e+1,1)}o(sce,"trunc");qe[Symbol.for("nodejs.util.inspect.custom")]=qe.toString;qe[Symbol.toStringTag]="Decimal";var ev=qe.constructor=uM(DP);XN=new ev(XN);WN=new ev(WN);var gs=class r extends ev{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var Bx=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var kB=Dr(require("fs"),1),Aq=Dr(require("path"),1),om=Dr(require("crypto"),1),um=Dr(Eq(),1);var qpe=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),Jl=o(r=>typeof r=="string"?Ai(new ln(r)):r instanceof Error?Ai(new ln(r.message,{cause:r.cause})):qpe(r)?Ai(new ln(r.message)):Ai(new ln("unexpected error")),"leftFromError");var Jx=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var Qx=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new Jx){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let i=um.default.asn1.fromDer(n.value.toString("binary")),s=um.default.pkcs12.pkcs12FromAsn1(i,t),{certBag:a,pkcs8ShroudedKeyBag:u}=um.default.pki.oids,c=s.getBags({bagType:a}),l=s.getBags({bagType:u}),p=c[a];if(!p?.length)return Ai(new ln("Cannot read certificate"));let[{cert:m},...g]=p;if(!m)return Ai(new ln("Issuer Certificate not found"));let y=l[u]?.[0].key;if(!y)return Ai(new ln("Certificate Private Key not found"));let v=g.reduce((w,{cert:C})=>(C&&w.push(new om.default.X509Certificate(um.default.pki.certificateToPem(C))),w),[]),b=um.default.pki.privateKeyToPem(y),x=um.default.pki.certificateToPem(m),E=om.default.createPrivateKey(b),N=new om.default.X509Certificate(x);return Fn({ca:v,password:t,privateKey:E,certificate:N})}catch(t){return Jl(t)}}async sign(e,t,n=Nu.SHA1){try{let s=om.default.sign(n,Buffer.from(e),{key:t,padding:om.default.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(Fn(s))}catch(i){return Promise.resolve(Jl(i))}}getCertificateInfo(e){return new Yx().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new ln("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,i=this.getCacheKey(t,n),s=await this.cache.get(i);if(s)return Fn(s);if(Aq.default.isAbsolute(t)||kB.default.existsSync(t))return this.hitBufferOnCache(i,kB.default.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(i,Buffer.from(a.data))}catch(a){return Jl(a)}return this.hitBufferOnCache(i,Buffer.from(t,"base64"))}getCacheKey(e,t){return om.default.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Fn(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var _X=require("crypto"),UL=require("https"),OX=Dr(DX(),1);var $b=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:_X.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new UL.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return new UL.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,OX.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{httpsAgent:t});return Fn(c)}catch(t){return Jl(t)}}};var cT=require("os"),Qo=require("path"),Xb=require("fs");var qL=require("path"),ML=require("module"),uT=require("url");var gbe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jv,PX=o(()=>{if(Jv!==void 0)return Jv;if(gbe){Jv=void 0;return}try{Jv=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jv=void 0}return Jv},"getImportMetaUrl"),BX=o(()=>{if(typeof require<"u")return require;let r=PX();if(r)return(0,ML.createRequire)(r);let e=(0,uT.pathToFileURL)((0,qL.resolve)(process.cwd(),"package.json")).href;return(0,ML.createRequire)(e)},"getRequireFn"),LX=o(()=>{if(typeof __filename<"u")return __filename;let r=PX();return r?(0,uT.fileURLToPath)(r):(0,qL.resolve)(process.cwd())},"getCurrentFile");var Gb=o(r=>BX()(r),"exportRequireModule"),FX=o(r=>{if(r=`${r}-${(0,cT.platform)()}-${(0,cT.arch)()}.node`,process.env.NFETS_ADDONS_DIR)return Gb((0,Qo.join)(process.env.NFETS_ADDONS_DIR,r));let e=LX(),t=(0,Qo.resolve)(e,"../../../../"),n=(0,Qo.join)(t,"build","addons",r);if((0,Xb.existsSync)(n))return Gb(n);let i=e;for(let s=0;s<5;s++){let a=(0,Qo.join)(i,"build","addons",r);if((0,Xb.existsSync)(a))return Gb(a);let u=(0,Qo.dirname)(i);if(u===i)break;i=u}i=e;for(let s=0;s<5;s++){let a=(0,Qo.join)(i,"build","Release",r);if((0,Xb.existsSync)(a))return Gb(a);let u=(0,Qo.dirname)(i);if(u===i)break;i=u}i=e;for(let s=0;s<5;s++){let a=(0,Qo.join)(i,"node_modules","nfets","build","addons",r);if((0,Xb.existsSync)(a))return Gb(a);let u=(0,Qo.dirname)(i);if(u===i)break;i=u}throw new Error(`Addon ${r} not found`)},"addon");var vbe=FX("xml_validator"),kX=vbe;var XY=Dr(require("crypto"),1),pAe=Dr(sJ(),1);var aJ="application/xml";var ir;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ir||(ir={}));function ybe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(ybe,"SelectNodesEx");function Sbe(r,e){let t=Qv("xpath").select;return t(e,r)}o(Sbe,"SelectNodesNode");var oJ=typeof self<"u"?ybe:Sbe;function Yo(r){r=r.replace(/\r\n/g,`
89
+ `,C.offset=(M=w.offset)!=null?M:0,C.dontPrettyTextNodes=(_=(H=w.dontPrettyTextNodes)!=null?H:w.dontprettytextnodes)!=null?_:0,C.spaceBeforeSlash=(z=(K=w.spaceBeforeSlash)!=null?K:w.spacebeforeslash)!=null?z:"",C.spaceBeforeSlash===!0&&(C.spaceBeforeSlash=" "),C.suppressPrettyCount=0,C.user={},C.state=e.None,C},N.prototype.indent=function(w,C,A){var R;return!C.pretty||C.suppressPrettyCount?"":C.pretty&&(R=(A||0)+C.offset+1,R>0)?new Array(R).join(C.indent):""},N.prototype.endline=function(w,C,A){return!C.pretty||C.suppressPrettyCount?"":C.newline},N.prototype.attribute=function(w,C,A){var R;return this.openAttribute(w,C,A),R=" "+w.name+'="'+w.value+'"',this.closeAttribute(w,C,A),R},N.prototype.cdata=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<![CDATA[",C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+="]]>"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.comment=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!-- ",C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=" -->"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.declaration=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<?xml",C.state=e.InsideTag,R+=' version="'+w.version+'"',w.encoding!=null&&(R+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(R+=' standalone="'+w.standalone+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+"?>",R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.docType=function(w,C,A){var R,M,_,H,z;if(A||(A=0),this.openNode(w,C,A),C.state=e.OpenTag,H=this.indent(w,C,A),H+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?H+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(H+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(H+=" [",H+=this.endline(w,C,A),C.state=e.InsideTag,z=w.children,M=0,_=z.length;M<_;M++)R=z[M],H+=this.writeChildNode(R,C,A+1);C.state=e.CloseTag,H+="]"}return C.state=e.CloseTag,H+=C.spaceBeforeSlash+">",H+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),H},N.prototype.element=function(w,C,A){var R,M,_,H,z,K,X,ye,fe,ce,ee,pe,Ce,Ye;A||(A=0),ce=!1,ee="",this.openNode(w,C,A),C.state=e.OpenTag,ee+=this.indent(w,C,A)+"<"+w.name,pe=w.attribs;for(fe in pe)E.call(pe,fe)&&(R=pe[fe],ee+=this.attribute(R,C,A));if(_=w.children.length,H=_===0?null:w.children[0],_===0||w.children.every(function(xe){return(xe.type===r.Text||xe.type===r.Raw)&&xe.value===""}))C.allowEmpty?(ee+=">",C.state=e.CloseTag,ee+="</"+w.name+">"+this.endline(w,C,A)):(C.state=e.CloseTag,ee+=C.spaceBeforeSlash+"/>"+this.endline(w,C,A));else if(C.pretty&&_===1&&(H.type===r.Text||H.type===r.Raw)&&H.value!=null)ee+=">",C.state=e.InsideTag,C.suppressPrettyCount++,ce=!0,ee+=this.writeChildNode(H,C,A+1),C.suppressPrettyCount--,ce=!1,C.state=e.CloseTag,ee+="</"+w.name+">"+this.endline(w,C,A);else{if(C.dontPrettyTextNodes){for(Ce=w.children,z=0,X=Ce.length;z<X;z++)if(M=Ce[z],(M.type===r.Text||M.type===r.Raw)&&M.value!=null){C.suppressPrettyCount++,ce=!0;break}}for(ee+=">"+this.endline(w,C,A),C.state=e.InsideTag,Ye=w.children,K=0,ye=Ye.length;K<ye;K++)M=Ye[K],ee+=this.writeChildNode(M,C,A+1);C.state=e.CloseTag,ee+=this.indent(w,C,A)+"</"+w.name+">",ce&&C.suppressPrettyCount--,ee+=this.endline(w,C,A),C.state=e.None}return this.closeNode(w,C,A),ee},N.prototype.writeChildNode=function(w,C,A){switch(w.type){case r.CData:return this.cdata(w,C,A);case r.Comment:return this.comment(w,C,A);case r.Element:return this.element(w,C,A);case r.Raw:return this.raw(w,C,A);case r.Text:return this.text(w,C,A);case r.ProcessingInstruction:return this.processingInstruction(w,C,A);case r.Dummy:return"";case r.Declaration:return this.declaration(w,C,A);case r.DocType:return this.docType(w,C,A);case r.AttributeDeclaration:return this.dtdAttList(w,C,A);case r.ElementDeclaration:return this.dtdElement(w,C,A);case r.EntityDeclaration:return this.dtdEntity(w,C,A);case r.NotationDeclaration:return this.dtdNotation(w,C,A);default:throw new Error("Unknown XML node type: "+w.constructor.name)}},N.prototype.processingInstruction=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<?",C.state=e.InsideTag,R+=w.target,w.value&&(R+=" "+w.value),C.state=e.CloseTag,R+=C.spaceBeforeSlash+"?>",R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.raw=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A),C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.text=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A),C.state=e.InsideTag,R+=w.value,C.state=e.CloseTag,R+=this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdAttList=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ATTLIST",C.state=e.InsideTag,R+=" "+w.elementName+" "+w.attributeName+" "+w.attributeType,w.defaultValueType!=="#DEFAULT"&&(R+=" "+w.defaultValueType),w.defaultValue&&(R+=' "'+w.defaultValue+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdElement=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ELEMENT",C.state=e.InsideTag,R+=" "+w.name+" "+w.value,C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdEntity=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!ENTITY",C.state=e.InsideTag,w.pe&&(R+=" %"),R+=" "+w.name,w.value?R+=' "'+w.value+'"':(w.pubID&&w.sysID?R+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(R+=' SYSTEM "'+w.sysID+'"'),w.nData&&(R+=" NDATA "+w.nData)),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.dtdNotation=function(w,C,A){var R;return this.openNode(w,C,A),C.state=e.OpenTag,R=this.indent(w,C,A)+"<!NOTATION",C.state=e.InsideTag,R+=" "+w.name,w.pubID&&w.sysID?R+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.pubID?R+=' PUBLIC "'+w.pubID+'"':w.sysID&&(R+=' SYSTEM "'+w.sysID+'"'),C.state=e.CloseTag,R+=C.spaceBeforeSlash+">"+this.endline(w,C,A),C.state=e.None,this.closeNode(w,C,A),R},N.prototype.openNode=function(w,C,A){},N.prototype.closeNode=function(w,C,A){},N.prototype.openAttribute=function(w,C,A){},N.prototype.closeAttribute=function(w,C,A){},N})()}).call(qW)});var ET=Z((zW,KW)=>{"use strict";(function(){var r,e,t=o(function(i,s){for(var a in s)n.call(s,a)&&(i[a]=s[a]);function u(){this.constructor=i}return o(u,"ctor"),u.prototype=s.prototype,i.prototype=new u,i.__super__=s.prototype,i},"extend"),n={}.hasOwnProperty;e=XL(),KW.exports=r=(function(i){t(s,i);function s(a){s.__super__.constructor.call(this,a)}return o(s,"XMLStringWriter"),s.prototype.document=function(a,u){var c,l,p,m,g;for(u=this.filterOptions(u),m="",g=a.children,l=0,p=g.length;l<p;l++)c=g[l],m+=this.writeChildNode(c,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},s})(e)}).call(zW)});var WL=Z(($W,GW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c=o(function(p,m){for(var g in m)l.call(m,g)&&(p[g]=m[g]);function y(){this.constructor=p}return o(y,"ctor"),y.prototype=m.prototype,p.prototype=new y,p.__super__=m.prototype,p},"extend"),l={}.hasOwnProperty;u=Yc().isPlainObject,t=zL(),e=WX(),i=mo(),r=Si(),a=GL(),s=ET(),GW.exports=n=(function(p){c(m,p);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new s),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,y,v,b;for(b=this.children,y=0,v=b.length;y<v;y++)if(g=b[y],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var y;return y={},g?u(g)&&(y=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(y))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,y,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(i)}).call($W)});var JW=Z((XW,WW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,y,v,b,x,E,N,w,C,A,R,M,_={}.hasOwnProperty;M=Yc(),A=M.isObject,C=M.isFunction,R=M.isPlainObject,w=M.getValue,r=Si(),m=WL(),y=pT(),n=hT(),i=dT(),b=bT(),N=wT(),v=CT(),l=mT(),p=xT(),s=gT(),u=vT(),a=yT(),c=ST(),t=KL(),E=GL(),x=ET(),e=Jb(),WW.exports=g=(function(){function H(z,K,X){var ye;this.name="?xml",this.type=r.Document,z||(z={}),ye={},z.writer?R(z.writer)&&(ye=z.writer,z.writer=new x):z.writer=new x,this.options=z,this.writer=z.writer,this.writerOptions=this.writer.filterOptions(ye),this.stringify=new E(z),this.onDataCallback=K||function(){},this.onEndCallback=X||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(H,"XMLDocumentCB"),H.prototype.createChildNode=function(z){var K,X,ye,fe,ce,ee,pe,Ce;switch(z.type){case r.CData:this.cdata(z.value);break;case r.Comment:this.comment(z.value);break;case r.Element:ye={},pe=z.attribs;for(X in pe)_.call(pe,X)&&(K=pe[X],ye[X]=K.value);this.node(z.name,ye);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(z.value);break;case r.Text:this.text(z.value);break;case r.ProcessingInstruction:this.instruction(z.target,z.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+z.constructor.name)}for(Ce=z.children,ce=0,ee=Ce.length;ce<ee;ce++)fe=Ce[ce],this.createChildNode(fe),fe.type===r.Element&&this.up();return this},H.prototype.dummy=function(){return this},H.prototype.node=function(z,K,X){var ye;if(z==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(z));return this.openCurrent(),z=w(z),K==null&&(K={}),K=w(K),A(K)||(ye=[K,X],X=ye[0],K=ye[1]),this.currentNode=new y(this,z,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,X!=null&&this.text(X),this},H.prototype.element=function(z,K,X){var ye,fe,ce,ee,pe,Ce;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(z)||A(z)||C(z))for(ee=this.options.noValidation,this.options.noValidation=!0,Ce=new m(this.options).element("TEMP_ROOT"),Ce.element(z),this.options.noValidation=ee,pe=Ce.children,fe=0,ce=pe.length;fe<ce;fe++)ye=pe[fe],this.createChildNode(ye),ye.type===r.Element&&this.up();else this.node(z,K,X);return this},H.prototype.attribute=function(z,K){var X,ye;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(z));if(z!=null&&(z=w(z)),A(z))for(X in z)_.call(z,X)&&(ye=z[X],this.attribute(X,ye));else C(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[z]=new t(this,z,""):K!=null&&(this.currentNode.attribs[z]=new t(this,z,K));return this},H.prototype.text=function(z){var K;return this.openCurrent(),K=new N(this,z),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.cdata=function(z){var K;return this.openCurrent(),K=new n(this,z),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.comment=function(z){var K;return this.openCurrent(),K=new i(this,z),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.raw=function(z){var K;return this.openCurrent(),K=new b(this,z),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.instruction=function(z,K){var X,ye,fe,ce,ee;if(this.openCurrent(),z!=null&&(z=w(z)),K!=null&&(K=w(K)),Array.isArray(z))for(X=0,ce=z.length;X<ce;X++)ye=z[X],this.instruction(ye);else if(A(z))for(ye in z)_.call(z,ye)&&(fe=z[ye],this.instruction(ye,fe));else C(K)&&(K=K.apply()),ee=new v(this,z,K),this.onData(this.writer.processingInstruction(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},H.prototype.declaration=function(z,K,X){var ye;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return ye=new l(this,z,K,X),this.onData(this.writer.declaration(ye,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.doctype=function(z,K,X){if(this.openCurrent(),z==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new p(this,K,X),this.currentNode.rootNodeName=z,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},H.prototype.dtdElement=function(z,K){var X;return this.openCurrent(),X=new a(this,z,K),this.onData(this.writer.dtdElement(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.attList=function(z,K,X,ye,fe){var ce;return this.openCurrent(),ce=new s(this,z,K,X,ye,fe),this.onData(this.writer.dtdAttList(ce,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.entity=function(z,K){var X;return this.openCurrent(),X=new u(this,!1,z,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.pEntity=function(z,K){var X;return this.openCurrent(),X=new u(this,!0,z,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.notation=function(z,K){var X;return this.openCurrent(),X=new c(this,z,K),this.onData(this.writer.dtdNotation(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},H.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},H.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},H.prototype.openNode=function(z){var K,X,ye,fe;if(!z.isOpen){if(!this.root&&this.currentLevel===0&&z.type===r.Element&&(this.root=z),X="",z.type===r.Element){this.writerOptions.state=e.OpenTag,X=this.writer.indent(z,this.writerOptions,this.currentLevel)+"<"+z.name,fe=z.attribs;for(ye in fe)_.call(fe,ye)&&(K=fe[ye],X+=this.writer.attribute(K,this.writerOptions,this.currentLevel));X+=(z.children?">":"/>")+this.writer.endline(z,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,X=this.writer.indent(z,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+z.rootNodeName,z.pubID&&z.sysID?X+=' PUBLIC "'+z.pubID+'" "'+z.sysID+'"':z.sysID&&(X+=' SYSTEM "'+z.sysID+'"'),z.children?(X+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,X+=">"),X+=this.writer.endline(z,this.writerOptions,this.currentLevel);return this.onData(X,this.currentLevel),z.isOpen=!0}},H.prototype.closeNode=function(z){var K;if(!z.isClosed)return K="",this.writerOptions.state=e.CloseTag,z.type===r.Element?K=this.writer.indent(z,this.writerOptions,this.currentLevel)+"</"+z.name+">"+this.writer.endline(z,this.writerOptions,this.currentLevel):K=this.writer.indent(z,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(z,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),z.isClosed=!0},H.prototype.onData=function(z,K){return this.documentStarted=!0,this.onDataCallback(z,K+1)},H.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},H.prototype.debugInfo=function(z){return z==null?"":"node: <"+z+">"},H.prototype.ele=function(){return this.element.apply(this,arguments)},H.prototype.nod=function(z,K,X){return this.node(z,K,X)},H.prototype.txt=function(z){return this.text(z)},H.prototype.dat=function(z){return this.cdata(z)},H.prototype.com=function(z){return this.comment(z)},H.prototype.ins=function(z,K){return this.instruction(z,K)},H.prototype.dec=function(z,K,X){return this.declaration(z,K,X)},H.prototype.dtd=function(z,K,X){return this.doctype(z,K,X)},H.prototype.e=function(z,K,X){return this.element(z,K,X)},H.prototype.n=function(z,K,X){return this.node(z,K,X)},H.prototype.t=function(z){return this.text(z)},H.prototype.d=function(z){return this.cdata(z)},H.prototype.c=function(z){return this.comment(z)},H.prototype.r=function(z){return this.raw(z)},H.prototype.i=function(z,K){return this.instruction(z,K)},H.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.ent=function(z,K){return this.entity(z,K)},H.prototype.pent=function(z,K){return this.pEntity(z,K)},H.prototype.not=function(z,K){return this.notation(z,K)},H})()}).call(XW)});var ZW=Z((QW,YW)=>{"use strict";(function(){var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;r=Si(),n=XL(),e=Jb(),YW.exports=t=(function(a){i(u,a);function u(c,l){this.stream=c,u.__super__.constructor.call(this,l)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(c,l,p){return c.isLastRootNode&&l.state===e.CloseTag?"":u.__super__.endline.call(this,c,l,p)},u.prototype.document=function(c,l){var p,m,g,y,v,b,x,E,N;for(x=c.children,m=g=0,v=x.length;g<v;m=++g)p=x[m],p.isLastRootNode=m===c.children.length-1;for(l=this.filterOptions(l),E=c.children,N=[],y=0,b=E.length;y<b;y++)p=E[y],N.push(this.writeChildNode(p,l,0));return N},u.prototype.attribute=function(c,l,p){return this.stream.write(u.__super__.attribute.call(this,c,l,p))},u.prototype.cdata=function(c,l,p){return this.stream.write(u.__super__.cdata.call(this,c,l,p))},u.prototype.comment=function(c,l,p){return this.stream.write(u.__super__.comment.call(this,c,l,p))},u.prototype.declaration=function(c,l,p){return this.stream.write(u.__super__.declaration.call(this,c,l,p))},u.prototype.docType=function(c,l,p){var m,g,y,v;if(p||(p=0),this.openNode(c,l,p),l.state=e.OpenTag,this.stream.write(this.indent(c,l,p)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,l,p)),l.state=e.InsideTag,v=c.children,g=0,y=v.length;g<y;g++)m=v[g],this.writeChildNode(m,l,p+1);l.state=e.CloseTag,this.stream.write("]")}return l.state=e.CloseTag,this.stream.write(l.spaceBeforeSlash+">"),this.stream.write(this.endline(c,l,p)),l.state=e.None,this.closeNode(c,l,p)},u.prototype.element=function(c,l,p){var m,g,y,v,b,x,E,N,w,C;p||(p=0),this.openNode(c,l,p),l.state=e.OpenTag,this.stream.write(this.indent(c,l,p)+"<"+c.name),w=c.attribs;for(E in w)s.call(w,E)&&(m=w[E],this.attribute(m,l,p));if(y=c.children.length,v=y===0?null:c.children[0],y===0||c.children.every(function(A){return(A.type===r.Text||A.type===r.Raw)&&A.value===""}))l.allowEmpty?(this.stream.write(">"),l.state=e.CloseTag,this.stream.write("</"+c.name+">")):(l.state=e.CloseTag,this.stream.write(l.spaceBeforeSlash+"/>"));else if(l.pretty&&y===1&&(v.type===r.Text||v.type===r.Raw)&&v.value!=null)this.stream.write(">"),l.state=e.InsideTag,l.suppressPrettyCount++,N=!0,this.writeChildNode(v,l,p+1),l.suppressPrettyCount--,N=!1,l.state=e.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,l,p)),l.state=e.InsideTag,C=c.children,b=0,x=C.length;b<x;b++)g=C[b],this.writeChildNode(g,l,p+1);l.state=e.CloseTag,this.stream.write(this.indent(c,l,p)+"</"+c.name+">")}return this.stream.write(this.endline(c,l,p)),l.state=e.None,this.closeNode(c,l,p)},u.prototype.processingInstruction=function(c,l,p){return this.stream.write(u.__super__.processingInstruction.call(this,c,l,p))},u.prototype.raw=function(c,l,p){return this.stream.write(u.__super__.raw.call(this,c,l,p))},u.prototype.text=function(c,l,p){return this.stream.write(u.__super__.text.call(this,c,l,p))},u.prototype.dtdAttList=function(c,l,p){return this.stream.write(u.__super__.dtdAttList.call(this,c,l,p))},u.prototype.dtdElement=function(c,l,p){return this.stream.write(u.__super__.dtdElement.call(this,c,l,p))},u.prototype.dtdEntity=function(c,l,p){return this.stream.write(u.__super__.dtdEntity.call(this,c,l,p))},u.prototype.dtdNotation=function(c,l,p){return this.stream.write(u.__super__.dtdNotation.call(this,c,l,p))},u})(n)}).call(QW)});var tJ=Z((eJ,vh)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l;l=Yc(),u=l.assign,c=l.isFunction,t=zL(),n=WL(),i=JW(),a=ET(),s=ZW(),r=Si(),e=Jb(),vh.exports.create=function(p,m,g,y){var v,b;if(p==null)throw new Error("Root element needs a name.");return y=u({},m,g,y),v=new n(y),b=v.element(p),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.dtd(y)),b},vh.exports.begin=function(p,m,g){var y;return c(p)&&(y=[p,m],m=y[0],g=y[1],p={}),m?new i(p,m,g):new n(p)},vh.exports.stringWriter=function(p){return new a(p)},vh.exports.streamWriter=function(p,m){return new s(p,m)},vh.exports.implementation=new t,vh.exports.nodeType=r,vh.exports.writerState=e}).call(eJ)});var rJ=Z(JL=>{"use strict";(function(){"use strict";var r,e,t,n,i,s={}.hasOwnProperty;r=tJ(),e=lT().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),i=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),JL.Builder=(function(){function a(u){var c,l,p;this.options={},l=e["0.2"];for(c in l)s.call(l,c)&&(p=l[c],this.options[c]=p);for(c in u)s.call(u,c)&&(p=u[c],this.options[c]=p)}return o(a,"Builder"),a.prototype.buildObject=function(u){var c,l,p,m,g;return c=this.options.attrkey,l=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,p=(function(y){return function(v,b){var x,E,N,w,C,A;if(typeof b!="object")y.options.cdata&&n(b)?v.raw(i(b)):v.txt(b);else if(Array.isArray(b)){for(w in b)if(s.call(b,w)){E=b[w];for(C in E)N=E[C],v=p(v.ele(C),N).up()}}else for(C in b)if(s.call(b,C))if(E=b[C],C===c){if(typeof E=="object")for(x in E)A=E[x],v=v.att(x,A)}else if(C===l)y.options.cdata&&n(E)?v=v.raw(i(E)):v=v.txt(E);else if(Array.isArray(E))for(w in E)s.call(E,w)&&(N=E[w],typeof N=="string"?y.options.cdata&&n(N)?v=v.ele(C).raw(i(N)).up():v=v.ele(C,N).up():v=p(v.ele(C),N).up());else typeof E=="object"?v=p(v.ele(C),E).up():typeof E=="string"&&y.options.cdata&&n(E)?v=v.ele(C).raw(i(E)).up():(E==null&&(E=""),v=v.ele(C,E.toString()).up());return v}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),p(m,u).end(this.options.renderOpts)},a})()}).call(JL)});var nJ=Z(QL=>{"use strict";(function(){"use strict";QL.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(QL)});var YL=Z(Cm=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),Cm.normalize=function(e){return e.toLowerCase()},Cm.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Cm.stripPrefix=function(e){return e.replace(r,"")},Cm.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},Cm.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(Cm)});var iJ=Z(af=>{"use strict";(function(){"use strict";var r,e,t,n,i,s,a,u,c,l=o(function(g,y){return function(){return g.apply(y,arguments)}},"bind"),p=o(function(g,y){for(var v in y)m.call(y,v)&&(g[v]=y[v]);function b(){this.constructor=g}return o(b,"ctor"),b.prototype=y.prototype,g.prototype=new b,g.__super__=y.prototype,g},"extend"),m={}.hasOwnProperty;u=CL(),n=require("events"),r=nJ(),a=YL(),c=require("timers").setImmediate,e=lT().defaults,i=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),s=o(function(g,y,v){var b,x,E;for(b=0,x=g.length;b<x;b++)E=g[b],y=E(y,v);return y},"processItem"),t=o(function(g,y,v){var b;return b=Object.create(null),b.value=v,b.writable=!0,b.enumerable=!0,b.configurable=!0,Object.defineProperty(g,y,b)},"defineProperty"),af.Parser=(function(g){p(y,g);function y(v){this.parseStringPromise=l(this.parseStringPromise,this),this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var b,x,E;if(!(this instanceof af.Parser))return new af.Parser(v);this.options={},x=e["0.2"];for(b in x)m.call(x,b)&&(E=x[b],this.options[b]=E);for(b in v)m.call(v,b)&&(E=v[b],this.options[b]=E);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(y,"Parser"),y.prototype.processAsync=function(){var v,b;try{return this.remaining.length<=this.options.chunkSize?(v=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(v),this.saxParser.close()):(v=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(v),c(this.processAsync))}catch(x){if(b=x,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(b)}},y.prototype.assignOrPush=function(v,b,x){return b in v?(v[b]instanceof Array||t(v,b,[v[b]]),v[b].push(x)):this.options.explicitArray?t(v,b,[x]):t(v,b,x)},y.prototype.reset=function(){var v,b,x,E;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(N){return function(w){if(N.saxParser.resume(),!N.saxParser.errThrown)return N.saxParser.errThrown=!0,N.emit("error",w)}})(this),this.saxParser.onend=(function(N){return function(){if(!N.saxParser.ended)return N.saxParser.ended=!0,N.emit("end",N.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,E=[],v=this.options.attrkey,b=this.options.charkey,this.saxParser.onopentag=(function(N){return function(w){var C,A,R,M,_;if(R={},R[b]="",!N.options.ignoreAttrs){_=w.attributes;for(C in _)m.call(_,C)&&(!(v in R)&&!N.options.mergeAttrs&&(R[v]={}),A=N.options.attrValueProcessors?s(N.options.attrValueProcessors,w.attributes[C],C):w.attributes[C],M=N.options.attrNameProcessors?s(N.options.attrNameProcessors,C):C,N.options.mergeAttrs?N.assignOrPush(R,M,A):t(R[v],M,A))}return R["#name"]=N.options.tagNameProcessors?s(N.options.tagNameProcessors,w.name):w.name,N.options.xmlns&&(R[N.options.xmlnskey]={uri:w.uri,local:w.local}),E.push(R)}})(this),this.saxParser.onclosetag=(function(N){return function(){var w,C,A,R,M,_,H,z,K,X;if(_=E.pop(),M=_["#name"],(!N.options.explicitChildren||!N.options.preserveChildrenOrder)&&delete _["#name"],_.cdata===!0&&(w=_.cdata,delete _.cdata),K=E[E.length-1],_[b].match(/^\s*$/)&&!w?(C=_[b],delete _[b]):(N.options.trim&&(_[b]=_[b].trim()),N.options.normalize&&(_[b]=_[b].replace(/\s{2,}/g," ").trim()),_[b]=N.options.valueProcessors?s(N.options.valueProcessors,_[b],M):_[b],Object.keys(_).length===1&&b in _&&!N.EXPLICIT_CHARKEY&&(_=_[b])),i(_)&&(typeof N.options.emptyTag=="function"?_=N.options.emptyTag():_=N.options.emptyTag!==""?N.options.emptyTag:C),N.options.validator!=null&&(X="/"+(function(){var ye,fe,ce;for(ce=[],ye=0,fe=E.length;ye<fe;ye++)R=E[ye],ce.push(R["#name"]);return ce})().concat(M).join("/"),(function(){var ye;try{return _=N.options.validator(X,K&&K[M],_)}catch(fe){return ye=fe,N.emit("error",ye)}})()),N.options.explicitChildren&&!N.options.mergeAttrs&&typeof _=="object"){if(!N.options.preserveChildrenOrder)R={},N.options.attrkey in _&&(R[N.options.attrkey]=_[N.options.attrkey],delete _[N.options.attrkey]),!N.options.charsAsChildren&&N.options.charkey in _&&(R[N.options.charkey]=_[N.options.charkey],delete _[N.options.charkey]),Object.getOwnPropertyNames(_).length>0&&(R[N.options.childkey]=_),_=R;else if(K){K[N.options.childkey]=K[N.options.childkey]||[],H={};for(A in _)m.call(_,A)&&t(H,A,_[A]);K[N.options.childkey].push(H),delete _["#name"],Object.keys(_).length===1&&b in _&&!N.EXPLICIT_CHARKEY&&(_=_[b])}}return E.length>0?N.assignOrPush(K,M,_):(N.options.explicitRoot&&(z=_,_={},t(_,M,z)),N.resultObject=_,N.saxParser.ended=!0,N.emit("end",N.resultObject))}})(this),x=(function(N){return function(w){var C,A;if(A=E[E.length-1],A)return A[b]+=w,N.options.explicitChildren&&N.options.preserveChildrenOrder&&N.options.charsAsChildren&&(N.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(A[N.options.childkey]=A[N.options.childkey]||[],C={"#name":"__text__"},C[b]=w,N.options.normalize&&(C[b]=C[b].replace(/\s{2,}/g," ").trim()),A[N.options.childkey].push(C)),A}})(this),this.saxParser.ontext=x,this.saxParser.oncdata=(function(N){return function(w){var C;if(C=x(w),C)return C.cdata=!0}})(this)},y.prototype.parseString=function(v,b){var x;b!=null&&typeof b=="function"&&(this.on("end",function(E){return this.reset(),b(null,E)}),this.on("error",function(E){return this.reset(),b(E)}));try{return v=v.toString(),v.trim()===""?(this.emit("end",null),!0):(v=r.stripBOM(v),this.options.async?(this.remaining=v,c(this.processAsync),this.saxParser):this.saxParser.write(v).close())}catch(E){if(x=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw x}else return this.emit("error",x),this.saxParser.errThrown=!0}},y.prototype.parseStringPromise=function(v){return new Promise((function(b){return function(x,E){return b.parseString(v,function(N,w){return N?E(N):x(w)})}})(this))},y})(n),af.parseString=function(g,y,v){var b,x,E;return v!=null?(typeof v=="function"&&(b=v),typeof y=="object"&&(x=y)):(typeof y=="function"&&(b=y),x={}),E=new af.Parser(x),E.parseString(g,b)},af.parseStringPromise=function(g,y){var v,b;return typeof y=="object"&&(v=y),b=new af.Parser(v),b.parseStringPromise(g)}}).call(af)});var sJ=Z(of=>{"use strict";(function(){"use strict";var r,e,t,n,i=o(function(a,u){for(var c in u)s.call(u,c)&&(a[c]=u[c]);function l(){this.constructor=a}return o(l,"ctor"),l.prototype=u.prototype,a.prototype=new l,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;e=lT(),r=rJ(),t=iJ(),n=YL(),of.defaults=e.defaults,of.processors=n,of.ValidationError=(function(a){i(u,a);function u(c){this.message=c}return o(u,"ValidationError"),u})(Error),of.Builder=r.Builder,of.Parser=t.Parser,of.parseString=t.parseString,of.parseStringPromise=t.parseStringPromise}).call(of)});var DZ=Z((rze,RZ)=>{"use strict";var EA;RZ.exports=function(){if(!EA){try{EA=lm()("follow-redirects")}catch{}typeof EA!="function"&&(EA=o(function(){},"debug"))}EA.apply(null,arguments)}});var LZ=Z((ize,T8)=>{"use strict";var NA=require("url"),AA=NA.URL,vNe=require("http"),yNe=require("https"),b8=require("stream").Writable,w8=require("assert"),_Z=DZ();o((function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=dg(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")}),"detectUnsupportedEnvironment")();var C8=!1;try{w8(new AA(""))}catch(r){C8=r.code==="ERR_INVALID_URL"}var SNe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],E8=["abort","aborted","connect","error","socket","timeout"],A8=Object.create(null);E8.forEach(function(r){A8[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var y8=IA("ERR_INVALID_URL","Invalid URL",TypeError),S8=IA("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),xNe=IA("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",S8),bNe=IA("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wNe=IA("ERR_STREAM_WRITE_AFTER_END","write after end"),CNe=b8.prototype.destroy||PZ;function Wa(r,e){b8.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof S8?i:new S8({cause:i}))}},this._performRequest()}o(Wa,"RedirectableRequest");Wa.prototype=Object.create(b8.prototype);Wa.prototype.abort=function(){I8(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wa.prototype.destroy=function(r){return I8(this._currentRequest,r),CNe.call(this,r),this};Wa.prototype.write=function(r,e,t){if(this._ending)throw new wNe;if(!hg(r)&&!NNe(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(dg(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new bNe),this.abort())};Wa.prototype.end=function(r,e,t){if(dg(r)?(t=r,r=e=null):dg(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Wa.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Wa.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Wa.prototype.setTimeout=function(r,e){var t=this;function n(a){a.setTimeout(r),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}o(n,"destroyOnTimeout");function i(a){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(a)}o(i,"startTimer");function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return o(s,"clearTimer"),e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Wa.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Wa.prototype,r,{get:o(function(){return this._currentRequest[r]},"get")})});Wa.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Wa.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of E8)n.on(i,A8[i]);if(this._currentUrl=/^\//.test(this._options.path)?NA.format(this._options):this._options.path,this._isRedirect){var s=0,a=this,u=this._requestBodyBuffers;o((function c(l){if(n===a._currentRequest)if(l)a.emit("error",l);else if(s<u.length){var p=u[s++];n.finished||n.write(p.data,p.encoding,c)}else a._ended&&n.end()}),"writeNext")()}};Wa.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(I8(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new xNe;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],v8(/^content-/i,this._options.headers));var a=v8(/^host$/i,this._options.headers),u=N8(this._currentUrl),c=a||u.host,l=/^\w+:/.test(t)?this._currentUrl:NA.format(Object.assign(u,{host:c})),p=ENe(t,l);if(_Z("redirecting to",p.href),this._isRedirect=!0,x8(p,this._options),(p.protocol!==u.protocol&&p.protocol!=="https:"||p.host!==c&&!ANe(p.host,c))&&v8(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),dg(i)){var m={headers:r.headers,statusCode:e},g={url:l,method:s,headers:n};i(this._options,m,g),this._sanitizeOptions(this._options)}this._performRequest()};function OZ(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],a=e[n]=Object.create(s);function u(l,p,m){return INe(l)?l=x8(l):hg(l)?l=x8(N8(l)):(m=p,p=BZ(l),l={protocol:i}),dg(p)&&(m=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,p),p.nativeProtocols=t,!hg(p.host)&&!hg(p.hostname)&&(p.hostname="::1"),w8.equal(p.protocol,i,"protocol mismatch"),_Z("options",p),new Wa(p,m)}o(u,"request");function c(l,p,m){var g=a.request(l,p,m);return g.end(),g}o(c,"get"),Object.defineProperties(a,{request:{value:u,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}o(OZ,"wrap");function PZ(){}o(PZ,"noop");function N8(r){var e;if(C8)e=new AA(r);else if(e=BZ(NA.parse(r)),!hg(e.protocol))throw new y8({input:r});return e}o(N8,"parseUrl");function ENe(r,e){return C8?new AA(r,e):N8(NA.resolve(e,r))}o(ENe,"resolveUrl");function BZ(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new y8({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new y8({input:r.href||r});return r}o(BZ,"validateUrl");function x8(r,e){var t=e||{};for(var n of SNe)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}o(x8,"spreadUrlObject");function v8(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}o(v8,"removeMatchingHeaders");function IA(r,e,t){function n(i){dg(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return o(n,"CustomError"),n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}o(IA,"createErrorType");function I8(r,e){for(var t of E8)r.removeListener(t,A8[t]);r.on("error",PZ),r.destroy(e)}o(I8,"destroyRequest");function ANe(r,e){w8(hg(r)&&hg(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}o(ANe,"isSubdomain");function hg(r){return typeof r=="string"||r instanceof String}o(hg,"isString");function dg(r){return typeof r=="function"}o(dg,"isFunction");function NNe(r){return typeof r=="object"&&"length"in r}o(NNe,"isBuffer");function INe(r){return AA&&r instanceof AA}o(INe,"isURL");T8.exports=OZ({http:vNe,https:yNe});T8.exports.wrap=OZ});var m2e={};MN(m2e,{ASN1:()=>Yx,AccessKeyBuilder:()=>dA,CanonicalizationMethod:()=>EP,Choice:()=>Qr,Decimal:()=>gs,DefaultDetBuilderAggregator:()=>mA,DefaultTotalBuilderAggregator:()=>gA,DigestAlgorithm:()=>zN,EntitySigner:()=>Dx,Environment:()=>Me,IsDecimal:()=>TV,Left:()=>KN,MemoryCacheAdapter:()=>Bx,NFCeDto:()=>yu,NFeDto:()=>gc,NFeTsError:()=>ln,NativeCertificateRepository:()=>Qx,NfceQrcode:()=>Sj,NfceRemoteTransmitter:()=>uO,NfceXmlBuilder:()=>xj,NfeAuthorizerPipeline:()=>mj,NfeDetXmlBuilder:()=>ks,NfeRemoteTransmitter:()=>eo,NfeXmlBuilder:()=>Xn,NullCacheAdapter:()=>Jx,Right:()=>Rx,SignatureAlgorithm:()=>Nu,SignatureMethod:()=>HN,SignatureNamespace:()=>qN,Signer:()=>Qd,SkipAllValidations:()=>pue,SkipValidation:()=>fue,SkipValidationMetadata:()=>Qg,SoapRemoteTransmissionRepository:()=>$b,StateAcronyms:()=>AP,StateCodeAcValidator:()=>DV,StateCodeAlValidator:()=>_V,StateCodeAmValidator:()=>OV,StateCodeApValidator:()=>PV,StateCodeBaValidator:()=>BV,StateCodeCeValidator:()=>LV,StateCodeDfValidator:()=>FV,StateCodeEsValidator:()=>kV,StateCodeGoValidator:()=>VV,StateCodeMaValidator:()=>jV,StateCodeMgValidator:()=>UV,StateCodeMsValidator:()=>MV,StateCodeMtValidator:()=>qV,StateCodePaValidator:()=>HV,StateCodePbValidator:()=>zV,StateCodePeValidator:()=>KV,StateCodePiValidator:()=>$V,StateCodePrValidator:()=>GV,StateCodeRjValidator:()=>XV,StateCodeRnValidator:()=>WV,StateCodeRoValidator:()=>JV,StateCodeRrValidator:()=>QV,StateCodeRsValidator:()=>YV,StateCodeScValidator:()=>ZV,StateCodeSeValidator:()=>e8,StateCodeSpValidator:()=>t8,StateCodeToValidator:()=>r8,StateCodes:()=>le,TpEmis:()=>Ga,TransformDateString:()=>jf,TransformDecimal:()=>Se,ValidateErrorsMetadata:()=>co,Validates:()=>Yt,ValidationError:()=>NP,Xml2JsToolkit:()=>hA,XmlSigner:()=>IP,clearEmptyValues:()=>_x,directory:()=>n8,left:()=>Ai,leftFromError:()=>Jl,mapConstraintsToErrors:()=>TP,plainToInstance:()=>Ox,right:()=>Fn,unreachable:()=>Rp});module.exports=lue(m2e);var qN="http://www.w3.org/2000/09/xmldsig#",EP="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",HN=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Nu=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),zN=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var le={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},AP=Object.keys(le);var Me={Production:"1",Homolog:"2"};var b2e={[le.AC]:"America/Rio_Branco",[le.AL]:"America/Maceio",[le.AM]:"America/Manaus",[le.AP]:"America/Belem",[le.BA]:"America/Bahia",[le.CE]:"America/Fortaleza",[le.DF]:"America/Sao_Paulo",[le.ES]:"America/Sao_Paulo",[le.GO]:"America/Sao_Paulo",[le.MA]:"America/Fortaleza",[le.MG]:"America/Sao_Paulo",[le.MS]:"America/Campo_Grande",[le.MT]:"America/Cuiaba",[le.PA]:"America/Belem",[le.PB]:"America/Fortaleza",[le.PE]:"America/Recife",[le.PI]:"America/Fortaleza",[le.PR]:"America/Sao_Paulo",[le.RJ]:"America/Sao_Paulo",[le.RN]:"America/Fortaleza",[le.RO]:"America/Porto_Velho",[le.RR]:"America/Boa_Vista",[le.RS]:"America/Sao_Paulo",[le.SC]:"America/Sao_Paulo",[le.SE]:"America/Maceio",[le.SP]:"America/Sao_Paulo",[le.TO]:"America/Araguaina"};var ln=class extends Error{static{o(this,"NFeTsError")}};var NP=class extends ln{static{o(this,"ValidationError")}};var Tx={includeComments:!1,exclusive:!0};var Rp=o(r=>{throw new ln("Didn't expect to get here")},"unreachable");var Qd=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Nu.SHA1,i=Tx){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=i}assemble(e,t,n){let i=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:qN},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:i}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:EP}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:qN},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Nu.SHA256:return zN.SHA256;case Nu.SHA1:return zN.SHA1;default:return Rp(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Nu.SHA256:return HN.RSA_SHA256;case Nu.SHA1:return HN.RSA_SHA1;default:return Rp(this.algorithm)}}};var KN=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},Rx=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Ai=o(r=>new KN(r),"left"),Fn=o(r=>r===void 0?new Rx(void 0):new Rx(r),"right");var Dx=class extends Qd{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{privateKey:a,certificate:u}=n;if(!e[i])return Ai(new ln(`Node ${String(i)} not found`));let c=await this.toolkit.build(this.ns(e,i),{headless:!0,rootName:String(i),renderOpts:{pretty:!1}}),l=this.signedInfo(c,s),p=await this.signOrLeft(l,a);if(p.isLeft())return p;let m=e;return m.Signature=this.assemble(l,p.value,u),Fn(m)}ns(e,t){let n=e.$?.xmlns,{$:i,...s}=e[t],{xmlns:a,...u}=i??{};return{$:{xmlns:n,...u},...s}}};var IP=class extends Qd{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{privateKey:a,certificate:u}=n,c=this.toolkit.getNode(e,i);if(!c)return Ai(new ln(`Node ${i} not found`));let l=this.signedInfo(c,s),p=await this.signOrLeft(l,a);if(p.isLeft())return p;let m=await this.toolkit.build(this.assemble(l,p.value,u),{rootName:"Signature"});return Fn(this.toolkit.appendNode(e,m))}};var dIe=require("reflect-metadata"),XU=require("class-validator");var cIe=require("reflect-metadata");var Qg="__SkipValidation__",fue=o(()=>(r,e)=>{Reflect.defineMetadata(Qg,!0,r,e.toString())},"SkipValidation"),pue=o(()=>r=>{Reflect.defineMetadata(Qg,!0,r)},"SkipAllValidations");var GU=require("class-transformer");var _x=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&_x(t)},"clearEmptyValues"),Ox=o((r,e,t={})=>{let n=(0,GU.plainToInstance)(e,r);return t.clearEmptyValues&&_x(n),n},"plainToInstance");var co="__ValidateErrors__",TP=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(TP(n.children,e?`${e}.${n.property}`:n.property));let i=Object.values(n.constraints??{}).map(s=>e?`${e}.${s}`:s).join(", ");return i?t.concat(i):t},[]),"mapConstraintsToErrors"),Yt=o(r=>(e,t,n)=>{let i=n.value;n.value=function(...s){let a=Reflect.getMetadata(Qg,this.constructor);if(Reflect.getMetadata(Qg,this.constructor.prototype,t.toString())===!0||a===!0)return i?.apply(this,s);let[c,...l]=s,p=Ox(c,r),m=(0,XU.validateSync)(p,{whitelist:!0});if(_x(p),m.length){let g=Reflect.getMetadata(co,this)??[];Reflect.defineMetadata(co,g.concat(TP(m,i?.name)),this)}return i?.apply(this,[p,...l])}},"Validates");var $Me=require("reflect-metadata");var Yg=9e15,Pp=1e9,RP="0123456789abcdef",XN="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",WN="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",DP={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Yg,maxE:Yg,crypto:!1},YU,Kl,Gt=!0,QN="[DecimalError] ",Op=QN+"Invalid argument: ",ZU=QN+"Precision limit exceeded",eM=QN+"crypto unavailable",tM="[object Decimal]",Hs=Math.floor,Li=Math.pow,hue=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,due=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,mue=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rM=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Iu=1e7,Bt=7,gue=9007199254740991,vue=XN.length-1,_P=WN.length-1,qe={toStringTag:tM};qe.absoluteValue=qe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),It(r)};qe.ceil=function(){return It(new this.constructor(this),this.e+1,2)};qe.clampedTo=qe.clamp=function(r,e){var t,n=this,i=n.constructor;if(r=new i(r),e=new i(e),!r.s||!e.s)return new i(NaN);if(r.gt(e))throw Error(Op+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new i(n)};qe.comparedTo=qe.cmp=function(r){var e,t,n,i,s=this,a=s.d,u=(r=new s.constructor(r)).d,c=s.s,l=r.s;if(!a||!u)return!c||!l?NaN:c!==l?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!==l)return c;if(s.e!==r.e)return s.e>r.e^c<0?1:-1;for(n=a.length,i=u.length,e=0,t=n<i?n:i;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};qe.cosine=qe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Bt,n.rounding=1,t=yue(n,oM(n,t)),n.precision=r,n.rounding=e,It(Kl==2||Kl==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};qe.cubeRoot=qe.cbrt=function(){var r,e,t,n,i,s,a,u,c,l,p=this,m=p.constructor;if(!p.isFinite()||p.isZero())return new m(p);for(Gt=!1,s=p.s*Li(p.s*p,1/3),!s||Math.abs(s)==1/0?(t=ms(p.d),r=p.e,(s=(r-t.length+1)%3)&&(t+=s==1||s==-2?"0":"00"),s=Li(t,1/3),r=Hs((r+1)/3)-(r%3==(r<0?-1:2)),s==1/0?t="5e"+r:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=p.s):n=new m(s.toString()),a=(r=m.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(p),n=pn(l.plus(p).times(u),l.plus(c),a+2,1),ms(u.d).slice(0,a)===(t=ms(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!i&&t=="4999"){if(!i&&(It(u,r+1,0),u.times(u).times(u).eq(p))){n=u;break}a+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(It(n,r+1,1),e=!n.times(n).times(n).eq(p));break}return Gt=!0,It(n,r,m.rounding,e)};qe.decimalPlaces=qe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-Hs(this.e/Bt))*Bt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};qe.dividedBy=qe.div=function(r){return pn(this,new this.constructor(r))};qe.dividedToIntegerBy=qe.divToInt=function(r){var e=this,t=e.constructor;return It(pn(e,new t(r),0,1,1),t.precision,t.rounding)};qe.equals=qe.eq=function(r){return this.cmp(r)===0};qe.floor=function(){return It(new this.constructor(this),this.e+1,3)};qe.greaterThan=qe.gt=function(r){return this.cmp(r)>0};qe.greaterThanOrEqualTo=qe.gte=function(r){var e=this.cmp(r);return e==1||e===0};qe.hyperbolicCosine=qe.cosh=function(){var r,e,t,n,i,s=this,a=s.constructor,u=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(r=Math.ceil(i/3),e=(1/ZN(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),s=Zg(a,1,s.times(e),new a(1),!0);for(var c,l=r,p=new a(8);l--;)c=s.times(s),s=u.minus(c.times(p.minus(c.times(p))));return It(s,a.precision=t,a.rounding=n,!0)};qe.hyperbolicSine=qe.sinh=function(){var r,e,t,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,t=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Zg(s,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/ZN(5,r)),i=Zg(s,2,i,i,!0);for(var a,u=new s(5),c=new s(16),l=new s(20);r--;)a=i.times(i),i=i.times(u.plus(a.times(c.times(a).plus(l))))}return s.precision=e,s.rounding=t,It(i,e,t,!0)};qe.hyperbolicTangent=qe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,pn(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};qe.inverseCosine=qe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,i=e.rounding;return t!==-1?t===0?r.isNeg()?Ac(e,n,i):new e(0):new e(NaN):r.isZero()?Ac(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,r.times(2))};qe.inverseHyperbolicCosine=qe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Gt=!1,t=t.times(t).minus(1).sqrt().plus(t),Gt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};qe.inverseHyperbolicSine=qe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Gt=!1,t=t.times(t).plus(1).sqrt().plus(t),Gt=!0,n.precision=r,n.rounding=e,t.ln())};qe.inverseHyperbolicTangent=qe.atanh=function(){var r,e,t,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=s.precision,e=s.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?It(new s(i),r,e,!0):(s.precision=t=n-i.e,i=pn(i.plus(1),new s(1).minus(i),t+r,1),s.precision=r+4,s.rounding=1,i=i.ln(),s.precision=r,s.rounding=e,i.times(.5))):new s(NaN)};qe.inverseSine=qe.asin=function(){var r,e,t,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),t=s.precision,n=s.rounding,e!==-1?e===0?(r=Ac(s,t+4,n).times(.5),r.s=i.s,r):new s(NaN):(s.precision=t+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=t,s.rounding=n,i.times(2)))};qe.inverseTangent=qe.atan=function(){var r,e,t,n,i,s,a,u,c,l=this,p=l.constructor,m=p.precision,g=p.rounding;if(l.isFinite()){if(l.isZero())return new p(l);if(l.abs().eq(1)&&m+4<=_P)return a=Ac(p,m+4,g).times(.25),a.s=l.s,a}else{if(!l.s)return new p(NaN);if(m+4<=_P)return a=Ac(p,m+4,g).times(.5),a.s=l.s,a}for(p.precision=u=m+10,p.rounding=1,t=Math.min(28,u/Bt+2|0),r=t;r;--r)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Gt=!1,e=Math.ceil(u/Bt),n=1,c=l.times(l),a=new p(l),i=l;r!==-1;)if(i=i.times(c),s=a.minus(i.div(n+=2)),i=i.times(c),a=s.plus(i.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===s.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Gt=!0,It(a,p.precision=m,p.rounding=g,!0)};qe.isFinite=function(){return!!this.d};qe.isInteger=qe.isInt=function(){return!!this.d&&Hs(this.e/Bt)>this.d.length-2};qe.isNaN=function(){return!this.s};qe.isNegative=qe.isNeg=function(){return this.s<0};qe.isPositive=qe.isPos=function(){return this.s>0};qe.isZero=function(){return!!this.d&&this.d[0]===0};qe.lessThan=qe.lt=function(r){return this.cmp(r)<0};qe.lessThanOrEqualTo=qe.lte=function(r){return this.cmp(r)<1};qe.logarithm=qe.log=function(r){var e,t,n,i,s,a,u,c,l=this,p=l.constructor,m=p.precision,g=p.rounding,y=5;if(r==null)r=new p(10),e=!0;else{if(r=new p(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new p(NaN);e=r.eq(10)}if(t=l.d,l.s<0||!t||!t[0]||l.eq(1))return new p(t&&!t[0]?-1/0:l.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)s=!0;else{for(i=t[0];i%10===0;)i/=10;s=i!==1}if(Gt=!1,u=m+y,a=_p(l,u),n=e?JN(p,u+10):_p(r,u),c=pn(a,n,u,1),Px(c.d,i=m,g))do if(u+=10,a=_p(l,u),n=e?JN(p,u+10):_p(r,u),c=pn(a,n,u,1),!s){+ms(c.d).slice(i+1,i+15)+1==1e14&&(c=It(c,m+1,0));break}while(Px(c.d,i+=10,g));return Gt=!0,It(c,m,g)};qe.minus=qe.sub=function(r){var e,t,n,i,s,a,u,c,l,p,m,g,y=this,v=y.constructor;if(r=new v(r),!y.d||!r.d)return!y.s||!r.s?r=new v(NaN):y.d?r.s=-r.s:r=new v(r.d||y.s!==r.s?y:NaN),r;if(y.s!=r.s)return r.s=-r.s,y.plus(r);if(l=y.d,g=r.d,u=v.precision,c=v.rounding,!l[0]||!g[0]){if(g[0])r.s=-r.s;else if(l[0])r=new v(y);else return new v(c===3?-0:0);return Gt?It(r,u,c):r}if(t=Hs(r.e/Bt),p=Hs(y.e/Bt),l=l.slice(),s=p-t,s){for(m=s<0,m?(e=l,s=-s,a=g.length):(e=g,t=p,a=l.length),n=Math.max(Math.ceil(u/Bt),a)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(l[n]!=g[n]){m=l[n]<g[n];break}s=0}for(m&&(e=l,l=g,g=e,r.s=-r.s),a=l.length,n=g.length-a;n>0;--n)l[a++]=0;for(n=g.length;n>s;){if(l[--n]<g[n]){for(i=n;i&&l[--i]===0;)l[i]=Iu-1;--l[i],l[n]+=Iu}l[n]-=g[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--t;return l[0]?(r.d=l,r.e=YN(l,t),Gt?It(r,u,c):r):new v(c===3?-0:0)};qe.modulo=qe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?It(new n(t),n.precision,n.rounding):(Gt=!1,n.modulo==9?(e=pn(t,r.abs(),0,3,1),e.s*=r.s):e=pn(t,r,0,n.modulo,1),e=e.times(r),Gt=!0,t.minus(e))};qe.naturalExponential=qe.exp=function(){return OP(this)};qe.naturalLogarithm=qe.ln=function(){return _p(this)};qe.negated=qe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,It(r)};qe.plus=qe.add=function(r){var e,t,n,i,s,a,u,c,l,p,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(l=m.d,p=r.d,u=g.precision,c=g.rounding,!l[0]||!p[0])return p[0]||(r=new g(m)),Gt?It(r,u,c):r;if(s=Hs(m.e/Bt),n=Hs(r.e/Bt),l=l.slice(),i=s-n,i){for(i<0?(t=l,i=-i,a=p.length):(t=p,n=s,a=l.length),s=Math.ceil(u/Bt),a=s>a?s+1:a+1,i>a&&(i=a,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(a=l.length,i=p.length,a-i<0&&(i=a,t=p,p=l,l=t),e=0;i;)e=(l[--i]=l[i]+p[i]+e)/Iu|0,l[i]%=Iu;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=YN(l,n),Gt?It(r,u,c):r};qe.precision=qe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(Op+r);return t.d?(e=nM(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};qe.round=function(){var r=this,e=r.constructor;return It(new e(r),r.e+1,e.rounding)};qe.sine=qe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Bt,n.rounding=1,t=xue(n,oM(n,t)),n.precision=r,n.rounding=e,It(Kl>2?t.neg():t,r,e,!0)):new n(NaN)};qe.squareRoot=qe.sqrt=function(){var r,e,t,n,i,s,a=this,u=a.d,c=a.e,l=a.s,p=a.constructor;if(l!==1||!u||!u[0])return new p(!l||l<0&&(!u||u[0])?NaN:u?a:1/0);for(Gt=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=ms(u),(e.length+c)%2==0&&(e+="0"),l=Math.sqrt(e),c=Hs((c+1)/2)-(c<0||c%2),l==1/0?e="5e"+c:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new p(e)):n=new p(l.toString()),t=(c=p.precision)+3;;)if(s=n,n=s.plus(pn(a,s,t+2,1)).times(.5),ms(s.d).slice(0,t)===(e=ms(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(It(s,c+1,0),s.times(s).eq(a))){n=s;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(It(n,c+1,1),r=!n.times(n).eq(a));break}return Gt=!0,It(n,c,p.rounding,r)};qe.tangent=qe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=pn(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,It(Kl==2||Kl==4?t.neg():t,r,e,!0)):new n(NaN)};qe.times=qe.mul=function(r){var e,t,n,i,s,a,u,c,l,p=this,m=p.constructor,g=p.d,y=(r=new m(r)).d;if(r.s*=p.s,!g||!g[0]||!y||!y[0])return new m(!r.s||g&&!g[0]&&!y||y&&!y[0]&&!g?NaN:!g||!y?r.s/0:r.s*0);for(t=Hs(p.e/Bt)+Hs(r.e/Bt),c=g.length,l=y.length,c<l&&(s=g,g=y,y=s,a=c,c=l,l=a),s=[],a=c+l,n=a;n--;)s.push(0);for(n=l;--n>=0;){for(e=0,i=c+n;i>n;)u=s[i]+y[n]*g[i-n-1]+e,s[i--]=u%Iu|0,e=u/Iu|0;s[i]=(s[i]+e)%Iu|0}for(;!s[--a];)s.pop();return e?++t:s.shift(),r.d=s,r.e=YN(s,t),Gt?It(r,m.precision,m.rounding):r};qe.toBinary=function(r,e){return PP(this,2,r,e)};qe.toDecimalPlaces=qe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ta(r,0,Pp),e===void 0?e=n.rounding:Ta(e,0,8),It(t,r+t.e+1,e))};qe.toExponential=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=Nc(n,!0):(Ta(r,0,Pp),e===void 0?e=i.rounding:Ta(e,0,8),n=It(new i(n),r+1,e),t=Nc(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};qe.toFixed=function(r,e){var t,n,i=this,s=i.constructor;return r===void 0?t=Nc(i):(Ta(r,0,Pp),e===void 0?e=s.rounding:Ta(e,0,8),n=It(new s(i),r+i.e+1,e),t=Nc(n,!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};qe.toFraction=function(r){var e,t,n,i,s,a,u,c,l,p,m,g,y=this,v=y.d,b=y.constructor;if(!v)return new b(y);if(l=t=new b(1),n=c=new b(0),e=new b(n),s=e.e=nM(v)-y.e-1,a=s%Bt,e.d[0]=Li(10,a<0?Bt+a:a),r==null)r=s>0?e:l;else{if(u=new b(r),!u.isInt()||u.lt(l))throw Error(Op+u);r=u.gt(e)?s>0?e:l:u}for(Gt=!1,u=new b(ms(v)),p=b.precision,b.precision=s=v.length*Bt*2;m=pn(u,e,0,1,1),i=t.plus(m.times(n)),i.cmp(r)!=1;)t=n,n=i,i=l,l=c.plus(m.times(i)),c=i,i=e,e=u.minus(m.times(i)),u=i;return i=pn(r.minus(t),n,0,1,1),c=c.plus(i.times(l)),t=t.plus(i.times(n)),c.s=l.s=y.s,g=pn(l,n,s,1).minus(y).abs().cmp(pn(c,t,s,1).minus(y).abs())<1?[l,n]:[c,t],b.precision=p,Gt=!0,g};qe.toHexadecimal=qe.toHex=function(r,e){return PP(this,16,r,e)};qe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ta(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Gt=!1,t=pn(t,r,0,e,1).times(r),Gt=!0,It(t)):(r.s=t.s,t=r),t};qe.toNumber=function(){return+this};qe.toOctal=function(r,e){return PP(this,8,r,e)};qe.toPower=qe.pow=function(r){var e,t,n,i,s,a,u=this,c=u.constructor,l=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Li(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,s=c.rounding,r.eq(1))return It(u,n,s);if(e=Hs(r.e/Bt),e>=r.d.length-1&&(t=l<0?-l:l)<=gue)return i=iM(c,u,t,n),r.s<0?new c(1).div(i):It(i,n,s);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Li(+u,l),e=t==0||!isFinite(t)?Hs(l*(Math.log("0."+ms(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(Gt=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),i=OP(r.times(_p(u,n+t)),n),i.d&&(i=It(i,n+5,1),Px(i.d,n,s)&&(e=n+10,i=It(OP(r.times(_p(u,e+t)),e),e+5,1),+ms(i.d).slice(n+1,n+15)+1==1e14&&(i=It(i,n+1,0)))),i.s=a,Gt=!0,c.rounding=s,It(i,n,s))};qe.toPrecision=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=Nc(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ta(r,1,Pp),e===void 0?e=i.rounding:Ta(e,0,8),n=It(new i(n),r,e),t=Nc(n,r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};qe.toSignificantDigits=qe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ta(r,1,Pp),e===void 0?e=n.rounding:Ta(e,0,8)),It(new n(t),r,e)};qe.toString=function(){var r=this,e=r.constructor,t=Nc(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};qe.truncated=qe.trunc=function(){return It(new this.constructor(this),this.e+1,1)};qe.valueOf=qe.toJSON=function(){var r=this,e=r.constructor,t=Nc(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function ms(r){var e,t,n,i=r.length-1,s="",a=r[0];if(i>0){for(s+=a,e=1;e<i;e++)n=r[e]+"",t=Bt-n.length,t&&(s+=Dp(t)),s+=n;a=r[e],n=a+"",t=Bt-n.length,t&&(s+=Dp(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}o(ms,"digitsToString");function Ta(r,e,t){if(r!==~~r||r<e||r>t)throw Error(Op+r)}o(Ta,"checkInt32");function Px(r,e,t,n){var i,s,a,u;for(s=r[0];s>=10;s/=10)--e;return--e<0?(e+=Bt,i=0):(i=Math.ceil((e+1)/Bt),e%=Bt),s=Li(10,Bt-e),u=r[i]%s|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==s||t>3&&u+1==s/2)&&(r[i+1]/s/100|0)==Li(10,e-2)-1||(u==s/2||u==0)&&(r[i+1]/s/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==s||!n&&t>3&&u+1==s/2)&&(r[i+1]/s/1e3|0)==Li(10,e-3)-1,a}o(Px,"checkRoundingDigits");function $N(r,e,t){for(var n,i=[0],s,a=0,u=r.length;a<u;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=RP.indexOf(r.charAt(a++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}o($N,"convertBase");function yue(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/ZN(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Zg(r,1,e.times(i),new r(1));for(var s=t;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(yue,"cosine");var pn=(function(){function r(n,i,s){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+u,n[c]=a%s|0,u=a/s|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,i,s,a){var u,c;if(s!=a)c=s>a?1:-1;else for(u=c=0;u<s;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}o(e,"compare");function t(n,i,s,a){for(var u=0;s--;)n[s]-=u,u=n[s]<i[s]?1:0,n[s]=u*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,i,s,a,u,c){var l,p,m,g,y,v,b,x,E,N,w,C,A,R,M,_,H,z,K,X,ye=n.constructor,fe=n.s==i.s?1:-1,ce=n.d,ee=i.d;if(!ce||!ce[0]||!ee||!ee[0])return new ye(!n.s||!i.s||(ce?ee&&ce[0]==ee[0]:!ee)?NaN:ce&&ce[0]==0||!ee?fe*0:fe/0);for(c?(y=1,p=n.e-i.e):(c=Iu,y=Bt,p=Hs(n.e/y)-Hs(i.e/y)),K=ee.length,H=ce.length,E=new ye(fe),N=E.d=[],m=0;ee[m]==(ce[m]||0);m++);if(ee[m]>(ce[m]||0)&&p--,s==null?(R=s=ye.precision,a=ye.rounding):u?R=s+(n.e-i.e)+1:R=s,R<0)N.push(1),v=!0;else{if(R=R/y+2|0,m=0,K==1){for(g=0,ee=ee[0],R++;(m<H||g)&&R--;m++)M=g*c+(ce[m]||0),N[m]=M/ee|0,g=M%ee|0;v=g||m<H}else{for(g=c/(ee[0]+1)|0,g>1&&(ee=r(ee,g,c),ce=r(ce,g,c),K=ee.length,H=ce.length),_=K,w=ce.slice(0,K),C=w.length;C<K;)w[C++]=0;X=ee.slice(),X.unshift(0),z=ee[0],ee[1]>=c/2&&++z;do g=0,l=e(ee,w,K,C),l<0?(A=w[0],K!=C&&(A=A*c+(w[1]||0)),g=A/z|0,g>1?(g>=c&&(g=c-1),b=r(ee,g,c),x=b.length,C=w.length,l=e(b,w,x,C),l==1&&(g--,t(b,K<x?X:ee,x,c))):(g==0&&(l=g=1),b=ee.slice()),x=b.length,x<C&&b.unshift(0),t(w,b,C,c),l==-1&&(C=w.length,l=e(ee,w,K,C),l<1&&(g++,t(w,K<C?X:ee,C,c))),C=w.length):l===0&&(g++,w=[0]),N[m++]=g,l&&w[0]?w[C++]=ce[_]||0:(w=[ce[_]],C=1);while((_++<H||w[0]!==void 0)&&R--);v=w[0]!==void 0}N[0]||N.shift()}if(y==1)E.e=p,YU=v;else{for(m=1,g=N[0];g>=10;g/=10)m++;E.e=m+p*y-1,It(E,u?s+E.e+1:s,a,v)}return E}})();function It(r,e,t,n){var i,s,a,u,c,l,p,m,g,y=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(i=1,u=m[0];u>=10;u/=10)i++;if(s=e-i,s<0)s+=Bt,a=e,p=m[g=0],c=p/Li(10,i-a-1)%10|0;else if(g=Math.ceil((s+1)/Bt),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);p=c=0,i=1,s%=Bt,a=s-Bt+1}else break e;else{for(p=u=m[g],i=1;u>=10;u/=10)i++;s%=Bt,a=s-Bt+i,c=a<0?0:p/Li(10,i-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?p:p%Li(10,i-a-1)),l=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(s>0?a>0?p/Li(10,i-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,l?(e-=r.e+1,m[0]=Li(10,(Bt-e%Bt)%Bt),r.e=-e||0):m[0]=r.e=0,r;if(s==0?(m.length=g,u=1,g--):(m.length=g+1,u=Li(10,Bt-s),m[g]=a>0?(p/Li(10,i-a)%Li(10,a)|0)*u:0),l)for(;;)if(g==0){for(s=1,a=m[0];a>=10;a/=10)s++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;s!=u&&(r.e++,m[0]==Iu&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Iu)break;m[g--]=0,u=1}for(s=m.length;m[--s]===0;)m.pop()}return Gt&&(r.e>y.maxE?(r.d=null,r.e=NaN):r.e<y.minE&&(r.e=0,r.d=[0])),r}o(It,"finalise");function Nc(r,e,t){if(!r.isFinite())return aM(r);var n,i=r.e,s=ms(r.d),a=s.length;return e?(t&&(n=t-a)>0?s=s.charAt(0)+"."+s.slice(1)+Dp(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(r.e<0?"e":"e+")+r.e):i<0?(s="0."+Dp(-i-1)+s,t&&(n=t-a)>0&&(s+=Dp(n))):i>=a?(s+=Dp(i+1-a),t&&(n=t-i-1)>0&&(s=s+"."+Dp(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),t&&(n=t-a)>0&&(i+1===a&&(s+="."),s+=Dp(n))),s}o(Nc,"finiteToString");function YN(r,e){var t=r[0];for(e*=Bt;t>=10;t/=10)e++;return e}o(YN,"getBase10Exponent");function JN(r,e,t){if(e>vue)throw Gt=!0,t&&(r.precision=t),Error(ZU);return It(new r(XN),e,1,!0)}o(JN,"getLn10");function Ac(r,e,t){if(e>_P)throw Error(ZU);return It(new r(WN),e,t,!0)}o(Ac,"getPi");function nM(r){var e=r.length-1,t=e*Bt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(nM,"getPrecision");function Dp(r){for(var e="";r--;)e+="0";return e}o(Dp,"getZeroString");function iM(r,e,t,n){var i,s=new r(1),a=Math.ceil(n/Bt+4);for(Gt=!1;;){if(t%2&&(s=s.times(e),JU(s.d,a)&&(i=!0)),t=Hs(t/2),t===0){t=s.d.length-1,i&&s.d[t]===0&&++s.d[t];break}e=e.times(e),JU(e.d,a)}return Gt=!0,s}o(iM,"intPow");function WU(r){return r.d[r.d.length-1]&1}o(WU,"isOdd");function sM(r,e,t){for(var n,i,s=new r(e[0]),a=0;++a<e.length;){if(i=new r(e[a]),!i.s){s=i;break}n=s.cmp(i),(n===t||n===0&&s.s===t)&&(s=i)}return s}o(sM,"maxOrMin");function OP(r,e){var t,n,i,s,a,u,c,l=0,p=0,m=0,g=r.constructor,y=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Gt=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(Li(2,m))/Math.LN10*2+5|0,c+=n,t=s=a=new g(1),g.precision=c;;){if(s=It(s.times(r),c,1),t=t.times(++p),u=a.plus(pn(s,t,c,1)),ms(u.d).slice(0,c)===ms(a.d).slice(0,c)){for(i=m;i--;)a=It(a.times(a),c,1);if(e==null)if(l<3&&Px(a.d,c-n,y,l))g.precision=c+=10,t=s=u=new g(1),p=0,l++;else return It(a,g.precision=v,y,Gt=!0);else return g.precision=v,a}a=u}}o(OP,"naturalExponential");function _p(r,e){var t,n,i,s,a,u,c,l,p,m,g,y=1,v=10,b=r,x=b.d,E=b.constructor,N=E.rounding,w=E.precision;if(b.s<0||!x||!x[0]||!b.e&&x[0]==1&&x.length==1)return new E(x&&!x[0]?-1/0:b.s!=1?NaN:x?0:b);if(e==null?(Gt=!1,p=w):p=e,E.precision=p+=v,t=ms(x),n=t.charAt(0),Math.abs(s=b.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)b=b.times(r),t=ms(b.d),n=t.charAt(0),y++;s=b.e,n>1?(b=new E("0."+t),s++):b=new E(n+"."+t.slice(1))}else return l=JN(E,p+2,w).times(s+""),b=_p(new E(n+"."+t.slice(1)),p-v).plus(l),E.precision=w,e==null?It(b,w,N,Gt=!0):b;for(m=b,c=a=b=pn(b.minus(1),b.plus(1),p,1),g=It(b.times(b),p,1),i=3;;){if(a=It(a.times(g),p,1),l=c.plus(pn(a,new E(i),p,1)),ms(l.d).slice(0,p)===ms(c.d).slice(0,p))if(c=c.times(2),s!==0&&(c=c.plus(JN(E,p+2,w).times(s+""))),c=pn(c,new E(y),p,1),e==null)if(Px(c.d,p-v,N,u))E.precision=p+=v,l=a=b=pn(m.minus(1),m.plus(1),p,1),g=It(b.times(b),p,1),i=u=1;else return It(c,E.precision=w,N,Gt=!0);else return E.precision=w,c;c=l,i+=2}}o(_p,"naturalLogarithm");function aM(r){return String(r.s*r.s/0)}o(aM,"nonFiniteToString");function GN(r,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%Bt,t<0&&(n+=Bt),n<i){for(n&&r.d.push(+e.slice(0,n)),i-=Bt;n<i;)r.d.push(+e.slice(n,n+=Bt));e=e.slice(n),n=Bt-e.length}else n-=i;for(;n--;)e+="0";r.d.push(+e),Gt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(GN,"parseDecimal");function Sue(r,e){var t,n,i,s,a,u,c,l,p;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),rM.test(e))return GN(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(due.test(e))t=16,e=e.toLowerCase();else if(hue.test(e))t=2;else if(mue.test(e))t=8;else throw Error(Op+e);for(s=e.search(/p/i),s>0?(c=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),a=s>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,s=u-s,i=iM(n,new n(t),s,s*2)),l=$N(e,t,Iu),p=l.length-1,s=p;l[s]===0;--s)l.pop();return s<0?new n(r.s*0):(r.e=YN(l,p),r.d=l,Gt=!1,a&&(r=pn(r,i,u*4)),c&&(r=r.times(Math.abs(c)<54?Li(2,c):ev.pow(2,c))),Gt=!0,r)}o(Sue,"parseOther");function xue(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Zg(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/ZN(5,t)),e=Zg(r,2,e,e);for(var i,s=new r(5),a=new r(16),u=new r(20);t--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(u))));return e}o(xue,"sine");function Zg(r,e,t,n,i){var s,a,u,c,l=1,p=r.precision,m=Math.ceil(p/Bt);for(Gt=!1,c=t.times(t),u=new r(n);;){if(a=pn(u.times(c),new r(e++*e++),p,1),u=i?n.plus(a):n.minus(a),n=pn(a.times(c),new r(e++*e++),p,1),a=u.plus(n),a.d[m]!==void 0){for(s=m;a.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=n,n=a,a=s,l++}return Gt=!0,a.d.length=m+1,a}o(Zg,"taylorSeries");function ZN(r,e){for(var t=r;--e;)t*=r;return t}o(ZN,"tinyPow");function oM(r,e){var t,n=e.s<0,i=Ac(r,r.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return Kl=n?4:1,e;if(t=e.divToInt(i),t.isZero())Kl=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(s))return Kl=WU(t)?n?2:3:n?4:1,e;Kl=WU(t)?n?1:4:n?3:2}return e.minus(i).abs()}o(oM,"toLessThanHalfPi");function PP(r,e,t,n){var i,s,a,u,c,l,p,m,g,y=r.constructor,v=t!==void 0;if(v?(Ta(t,1,Pp),n===void 0?n=y.rounding:Ta(n,0,8)):(t=y.precision,n=y.rounding),!r.isFinite())p=aM(r);else{for(p=Nc(r),a=p.indexOf("."),v?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,a>=0&&(p=p.replace(".",""),g=new y(1),g.e=p.length-a,g.d=$N(Nc(g),10,i),g.e=g.d.length),m=$N(p,10,i),s=c=m.length;m[--c]==0;)m.pop();if(!m[0])p=v?"0p+0":"0";else{if(a<0?s--:(r=new y(r),r.d=m,r.e=s,r=pn(r,g,t,n,0,i),m=r.d,s=r.e,l=YU),a=m[t],u=i/2,l=l||m[t+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||l||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,l)for(;++m[--t]>i-1;)m[t]=0,t||(++s,m.unshift(1));for(c=m.length;!m[c-1];--c);for(a=0,p="";a<c;a++)p+=RP.charAt(m[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)p+="0";for(m=$N(p,i,e),c=m.length;!m[c-1];--c);for(a=1,p="1.";a<c;a++)p+=RP.charAt(m[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)p="0"+p;p="0."+p}else if(++s>c)for(s-=c;s--;)p+="0";else s<c&&(p=p.slice(0,s)+"."+p.slice(s))}p=(e==16?"0x":e==2?"0b":e==8?"0o":"")+p}return r.s<0?"-"+p:p}o(PP,"toStringBinary");function JU(r,e){if(r.length>e)return r.length=e,!0}o(JU,"truncate");function bue(r){return new this(r).abs()}o(bue,"abs");function wue(r){return new this(r).acos()}o(wue,"acos");function Cue(r){return new this(r).acosh()}o(Cue,"acosh");function Eue(r,e){return new this(r).plus(e)}o(Eue,"add");function Aue(r){return new this(r).asin()}o(Aue,"asin");function Nue(r){return new this(r).asinh()}o(Nue,"asinh");function Iue(r){return new this(r).atan()}o(Iue,"atan");function Tue(r){return new this(r).atanh()}o(Tue,"atanh");function Rue(r,e){r=new this(r),e=new this(e);var t,n=this.precision,i=this.rounding,s=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=Ac(this,s,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?Ac(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=Ac(this,s,1).times(.5),t.s=r.s):e.s<0?(this.precision=s,this.rounding=1,t=this.atan(pn(r,e,s,1)),e=Ac(this,s,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(pn(r,e,s,1)),t}o(Rue,"atan2");function Due(r){return new this(r).cbrt()}o(Due,"cbrt");function _ue(r){return It(r=new this(r),r.e+1,2)}o(_ue,"ceil");function Oue(r,e,t){return new this(r).clamp(e,t)}o(Oue,"clamp");function Pue(r){if(!r||typeof r!="object")throw Error(QN+"Object expected");var e,t,n,i=r.defaults===!0,s=["precision",1,Pp,"rounding",0,8,"toExpNeg",-Yg,0,"toExpPos",0,Yg,"maxE",0,Yg,"minE",-Yg,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],i&&(this[t]=DP[t]),(n=r[t])!==void 0)if(Hs(n)===n&&n>=s[e+1]&&n<=s[e+2])this[t]=n;else throw Error(Op+t+": "+n);if(t="crypto",i&&(this[t]=DP[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(eM);else this[t]=!1;else throw Error(Op+t+": "+n);return this}o(Pue,"config");function Bue(r){return new this(r).cos()}o(Bue,"cos");function Lue(r){return new this(r).cosh()}o(Lue,"cosh");function uM(r){var e,t,n;function i(s){var a,u,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,QU(s)){l.s=s.s,Gt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(a=0,u=s;u>=10;u/=10)a++;Gt?a>i.maxE?(l.e=NaN,l.d=null):a<i.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[s]):(l.e=a,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return GN(l,s.toString())}if(c==="string")return(u=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(u===43&&(s=s.slice(1)),l.s=1),rM.test(s)?GN(l,s):Sue(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,GN(l,s.toString());throw Error(Op+s)}if(o(i,"Decimal"),i.prototype=qe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Pue,i.clone=uM,i.isDecimal=QU,i.abs=bue,i.acos=wue,i.acosh=Cue,i.add=Eue,i.asin=Aue,i.asinh=Nue,i.atan=Iue,i.atanh=Tue,i.atan2=Rue,i.cbrt=Due,i.ceil=_ue,i.clamp=Oue,i.cos=Bue,i.cosh=Lue,i.div=Fue,i.exp=kue,i.floor=Vue,i.hypot=jue,i.ln=Uue,i.log=Mue,i.log10=Hue,i.log2=que,i.max=zue,i.min=Kue,i.mod=$ue,i.mul=Gue,i.pow=Xue,i.random=Wue,i.round=Jue,i.sign=Que,i.sin=Yue,i.sinh=Zue,i.sqrt=ece,i.sub=tce,i.sum=rce,i.tan=nce,i.tanh=ice,i.trunc=sce,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return i.config(r),i}o(uM,"clone");function Fue(r,e){return new this(r).div(e)}o(Fue,"div");function kue(r){return new this(r).exp()}o(kue,"exp");function Vue(r){return It(r=new this(r),r.e+1,3)}o(Vue,"floor");function jue(){var r,e,t=new this(0);for(Gt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Gt=!0,new this(1/0);t=e}return Gt=!0,t.sqrt()}o(jue,"hypot");function QU(r){return r instanceof ev||r&&r.toStringTag===tM||!1}o(QU,"isDecimalInstance");function Uue(r){return new this(r).ln()}o(Uue,"ln");function Mue(r,e){return new this(r).log(e)}o(Mue,"log");function que(r){return new this(r).log(2)}o(que,"log2");function Hue(r){return new this(r).log(10)}o(Hue,"log10");function zue(){return sM(this,arguments,-1)}o(zue,"max");function Kue(){return sM(this,arguments,1)}o(Kue,"min");function $ue(r,e){return new this(r).mod(e)}o($ue,"mod");function Gue(r,e){return new this(r).mul(e)}o(Gue,"mul");function Xue(r,e){return new this(r).pow(e)}o(Xue,"pow");function Wue(r){var e,t,n,i,s=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ta(r,1,Pp),n=Math.ceil(r/Bt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(i%1e7),s+=4);s=n/4}else throw Error(eM);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],r%=Bt,n&&r&&(i=Li(10,Bt-r),u[s]=(n/i|0)*i);u[s]===0;s--)u.pop();if(s<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Bt)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Bt&&(t-=Bt-n)}return a.e=t,a.d=u,a}o(Wue,"random");function Jue(r){return It(r=new this(r),r.e+1,this.rounding)}o(Jue,"round");function Que(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(Que,"sign");function Yue(r){return new this(r).sin()}o(Yue,"sin");function Zue(r){return new this(r).sinh()}o(Zue,"sinh");function ece(r){return new this(r).sqrt()}o(ece,"sqrt");function tce(r,e){return new this(r).sub(e)}o(tce,"sub");function rce(){var r=0,e=arguments,t=new this(e[r]);for(Gt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Gt=!0,It(t,this.precision,this.rounding)}o(rce,"sum");function nce(r){return new this(r).tan()}o(nce,"tan");function ice(r){return new this(r).tanh()}o(ice,"tanh");function sce(r){return It(r=new this(r),r.e+1,1)}o(sce,"trunc");qe[Symbol.for("nodejs.util.inspect.custom")]=qe.toString;qe[Symbol.toStringTag]="Decimal";var ev=qe.constructor=uM(DP);XN=new ev(XN);WN=new ev(WN);var gs=class r extends ev{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var Bx=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var kB=Dr(require("fs"),1),Aq=Dr(require("path"),1),om=Dr(require("crypto"),1),um=Dr(Eq(),1);var qpe=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),Jl=o(r=>typeof r=="string"?Ai(new ln(r)):r instanceof Error?Ai(new ln(r.message,{cause:r.cause})):qpe(r)?Ai(new ln(r.message)):Ai(new ln("unexpected error")),"leftFromError");var Jx=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var Qx=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new Jx){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let i=um.default.asn1.fromDer(n.value.toString("binary")),s=um.default.pkcs12.pkcs12FromAsn1(i,t),{certBag:a,pkcs8ShroudedKeyBag:u}=um.default.pki.oids,c=s.getBags({bagType:a}),l=s.getBags({bagType:u}),p=c[a];if(!p?.length)return Ai(new ln("Cannot read certificate"));let[{cert:m},...g]=p;if(!m)return Ai(new ln("Issuer Certificate not found"));let y=l[u]?.[0].key;if(!y)return Ai(new ln("Certificate Private Key not found"));let v=g.reduce((w,{cert:C})=>(C&&w.push(new om.default.X509Certificate(um.default.pki.certificateToPem(C))),w),[]),b=um.default.pki.privateKeyToPem(y),x=um.default.pki.certificateToPem(m),E=om.default.createPrivateKey(b),N=new om.default.X509Certificate(x);return Fn({ca:v,password:t,privateKey:E,certificate:N})}catch(t){return Jl(t)}}async sign(e,t,n=Nu.SHA1){try{let s=om.default.sign(n,Buffer.from(e),{key:t,padding:om.default.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(Fn(s))}catch(i){return Promise.resolve(Jl(i))}}getCertificateInfo(e){return new Yx().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new ln("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,i=this.getCacheKey(t,n),s=await this.cache.get(i);if(s)return Fn(s);if(Aq.default.isAbsolute(t)||kB.default.existsSync(t))return this.hitBufferOnCache(i,kB.default.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(i,Buffer.from(a.data))}catch(a){return Jl(a)}return this.hitBufferOnCache(i,Buffer.from(t,"base64"))}getCacheKey(e,t){return om.default.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Fn(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var _X=require("crypto"),UL=require("https"),OX=Dr(DX(),1);var $b=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:_X.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new UL.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return new UL.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,OX.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{httpsAgent:t});return Fn(c)}catch(t){return Jl(t)}}};var cT=require("os"),Qo=require("path"),Xb=require("fs");var qL=require("path"),ML=require("module"),uT=require("url");var gbe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jv,PX=o(()=>{if(Jv!==void 0)return Jv;if(gbe){Jv=void 0;return}try{Jv=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jv=void 0}return Jv},"getImportMetaUrl"),BX=o(()=>{if(typeof require<"u")return require;let r=PX();if(r)return(0,ML.createRequire)(r);let e=(0,uT.pathToFileURL)((0,qL.resolve)(process.cwd(),"package.json")).href;return(0,ML.createRequire)(e)},"getRequireFn"),LX=o(()=>{if(typeof __filename<"u")return __filename;let r=PX();return r?(0,uT.fileURLToPath)(r):(0,qL.resolve)(process.cwd())},"getCurrentFile");var Gb=o(r=>BX()(r),"exportRequireModule"),FX=o(r=>{r=`${r}.node`;let e=`${(0,cT.platform)()}-${(0,cT.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return Gb((0,Qo.join)(process.env.NFETS_ADDONS_DIR,r));let t=LX(),n=(0,Qo.resolve)(t,"../../../../"),i=(0,Qo.join)(n,"build","addons",e,r);if((0,Xb.existsSync)(i))return Gb(i);let s=t;for(let a=0;a<5;a++){let u=(0,Qo.join)(s,"build","addons",e,r);if((0,Xb.existsSync)(u))return Gb(u);let c=(0,Qo.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,Qo.join)(s,"node_modules","nfets","build","addons",e,r);if((0,Xb.existsSync)(u))return Gb(u);let c=(0,Qo.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,Qo.join)(s,"build","Release",r);if((0,Xb.existsSync)(u))return Gb(u);let c=(0,Qo.dirname)(s);if(c===s)break;s=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var vbe=FX("xml_validator"),kX=vbe;var XY=Dr(require("crypto"),1),pAe=Dr(sJ(),1);var aJ="application/xml";var ir;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ir||(ir={}));function ybe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(ybe,"SelectNodesEx");function Sbe(r,e){let t=Qv("xpath").select;return t(e,r)}o(Sbe,"SelectNodesNode");var oJ=typeof self<"u"?ybe:Sbe;function Yo(r){r=r.replace(/\r\n/g,`
90
90
  `).replace(/\r/g,`
91
91
  `);let e;return typeof DOMParser<"u"?e=DOMParser:e=Qv("DOMParser"),new e().parseFromString(r,aJ)}o(Yo,"Parse");function Zc(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Qv("XMLSerializer"),new e().serializeToString(r)}o(Zc,"Stringify");function AT(r,e){let t=oJ(r,e);return t&&t.length>0?t[0]:null}o(AT,"SelectSingleNode");function uJ(r,e){return r&&r.nodeType===e}o(uJ,"isNodeType");function go(r){return uJ(r,ir.Element)}o(go,"isElement");function Em(r){return uJ(r,ir.Document)}o(Em,"isDocument");var cJ=new Map;function lJ(r){for(let e in r)cJ.set(e,r[e])}o(lJ,"setNodeDependencies");function Qv(r){let e=cJ.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Qv,"getNodeDependency");var Qb="element",Yb="attribute",NT="content";var xbe=1e9;function ZL(r,...e){let t=r;for(let n=0;n<e.length;n++){let i=e[n];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}o(ZL,"assign");function sr(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=ZL({},t.items)),t.target=e}}o(sr,"XmlElement");function hr(r={}){return(e,t)=>{let n=e.constructor,i=t;n.items||(n.items={}),n.target!==n&&(n.items=ZL({},n.items)),n.target=e;let s;r.parser?s={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||xbe,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:s={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||i;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[i]={...s,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Qb},pJ(e,i,r)}}o(hr,"XmlChildElement");function xn(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,i=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=ZL({},n.items)),n.target=e;let s=n.items;s[t]=r,s[t].type=Yb,pJ(e,i,r)}}o(xn,"XmlAttribute");function pJ(r,e,t){let n=`_${e}`,i={set:o(function(s){this[n]!==s&&(this.element=null,this[n]=s)},"set"),get:o(function(){if(this[n]===void 0){let s=t.defaultValue;t.parser&&(s=new t.parser,s.localName=t.localName),this[n]=s}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,i)}o(pJ,"defineProperty");var yh=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function bbe(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,i)=>{let s=parseInt(i,10)-1;return e[s]!==void 0?e[s]:""});return t=t.replace(/%%/g,"%"),t}o(bbe,"printf");function wbe(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(wbe,"padNum");var Qe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=bbe(xi[e],...t);this.message=`${this.prefix}${wbe(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Le;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Le||(Le={}));var xi={};xi[Le.NONE]="No description";xi[Le.NULL_REFERENCE]="Null reference";xi[Le.NULL_PARAM]="'%1' has empty '%2' object";xi[Le.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";xi[Le.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";xi[Le.METHOD_NOT_IMPLEMENTED]="Method is not implemented";xi[Le.METHOD_NOT_SUPPORTED]="Method is not supported";xi[Le.PARAM_REQUIRED]="Required parameter is missing '%1'";xi[Le.CONVERTER_UNSUPPORTED]="Converter is not supported";xi[Le.ELEMENT_MALFORMED]="Malformed element '%1'";xi[Le.ELEMENT_MISSING]="Element '%1' is missing in '%2'";xi[Le.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";xi[Le.CONTENT_MISSING]="Content is missing in '%1'";xi[Le.CRYPTOGRAPHIC]="Cryptographic error: %1";xi[Le.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";xi[Le.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";xi[Le.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";xi[Le.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";xi[Le.XML_EXCEPTION]="XML exception: %1";xi[Le.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var Jr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new Qe(Le.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new Qe(Le.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new Qe(Le.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new Qe(Le.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let i=0;i<e.length;i++){let s=e[i].toString(16);n.push(s.length===1?"0"+s:s)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let i=e.slice(n,n+2);t[n/2]=parseInt(i,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Zo={get:o(r=>{if(r)return Jr.ToBase64(r)},"get"),set:o(r=>Jr.FromBase64(r),"set")},Zb={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var Cbe="xml_root",Ua=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let i=e.getElementsByTagName(t);if(n&&i.length===0)throw new Qe(Le.ELEMENT_MISSING,t,e.localName);return i[0]||null}static GetAttribute(e,t,n,i=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(i)throw new Qe(Le.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Em(e)&&(n=e.getElementById(t)),n==null&&(n=AT(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=AT(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=AT(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=Cbe,t=null,n=null){if(n&&!t)throw new Qe(Le.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let i="",s="",a="";n&&(i=n+":",s=":"+n),t&&(a=` xmlns${s}="${t}"`);let u=`${i}${e}`;return Yo(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Em(e)?e.documentElement:e;let i=[];for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];go(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&i.push(a)}return i}static GetFirstChild(e,t,n){e=Em(e)?e.documentElement:e;for(let i=0;i<e.childNodes.length;i++){let s=e.childNodes[i];if(go(s)&&s.localName===t&&(s.namespaceURI===n||!n))return s}return null}static GetChild(e,t,n,i=!0){for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];if(go(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(i)throw new Qe(Le.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],i=this[t];if(n.parser&&i&&i.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),i=this.CreateElement(),s=this.GetStatic(),a=this.localName||"";if(s.items)for(let u in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,u))continue;let c=t[u],l=s.items[u];switch(l.type){case NT:{let p=l,m=p.converter?p.converter.get(c):c;if(p.required&&m==null)throw new Qe(Le.CONTENT_MISSING,a);(p.defaultValue!==c||p.required)&&(i.textContent=m);break}case Yb:{let p=l,m=p.converter?p.converter.get(c):c;if(p.required&&m==null)throw new Qe(Le.ATTRIBUTE_MISSING,p.localName,a);(p.defaultValue!==c||p.required)&&(p.namespaceURI?i.setAttributeNS(p.namespaceURI,p.localName||"",m):i.setAttribute(p.localName||"",m));break}case Qb:{let p=l,m=null;if(p.parser){if(p.required&&!c||p.minOccurs&&!c.Count){let g=c?.localName||p.localName;throw new Qe(Le.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(p.required||c.Count)))}else{let g=p.converter?p.converter.get(c):c;if(p.required&&g===void 0)throw new Qe(Le.ELEMENT_MISSING,p.localName,a);if(c!==p.defaultValue||p.required)if(p.namespaceURI?m=n.createElementNS(p.namespaceURI,`${p.prefix?p.prefix+":":""}${p.localName}`):m=n.createElement(`${p.prefix?p.prefix+":":""}${p.localName}`),Array.isArray(g))for(let y of g){let v=y instanceof r?y.GetXml(!0):y;v!==null&&m&&m.appendChild(v)}else if(g instanceof r){let y=g.GetXml(!0);y&&m&&m.appendChild(y)}else m&&(m.textContent=g)}if(m)if(p.noRoot){let g=[];for(let b=0;b<m.childNodes.length;b++){let x=m.childNodes.item(b);go(x)&&g.push(x)}let y=p.minOccurs||0,v=p.maxOccurs||1/0;if(g.length<y||g.length>v)throw new Qe(Le.COLLECTION_LIMIT,c.localName,s.localName);g.forEach(b=>i.appendChild(b.cloneNode(!0)))}else{if(m.childNodes.length<(p.minOccurs||0)||m.childNodes.length>(p.maxOccurs||1/0))throw new Qe(Le.COLLECTION_LIMIT,c.localName,s.localName);i.appendChild(m)}break}}}return this.OnGetXml(i),this.element=i,i}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Yo(e).documentElement:t=e,!t)throw new Qe(Le.PARAM_REQUIRED,"element");let i=this.GetStatic(),s=this.localName||"";if(!(t.localName===s&&t.namespaceURI==this.NamespaceURI))throw new Qe(Le.ELEMENT_MALFORMED,s);if(i.items)for(let a in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,a))continue;let u=i.items[a];switch(u.type){case NT:{let c=u;if(c.required&&!t.textContent)throw new Qe(Le.CONTENT_MISSING,s);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case Yb:{let c=u,l,p;if(!c.localName)throw new Qe(Le.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),p=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),p=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new Qe(Le.ATTRIBUTE_MISSING,c.localName,s);if(!l())n[a]=c.defaultValue;else{let m=p(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case Qb:{let c=u;if(c.noRoot){if(!c.parser)throw new Qe(Le.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let p=new c.parser;if(!(p instanceof Yv))throw new Qe(Le.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);p.OnLoadXml(t),delete p.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(p.Count<m||p.Count>g)throw new Qe(Le.COLLECTION_LIMIT,c.parser.localName,s);n[a]=p;continue}let l=null;for(let p=0;p<t.childNodes.length;p++){let m=t.childNodes.item(p);if(!go(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new Qe(Le.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,s);if(c.parser){if(l){let p=new c.parser;p.localName=c.localName,p.namespaceURI=c.namespaceURI,n[a]=p,p.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let p=l.textContent||"",m=c.converter?c.converter.set(p):p;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Zc(e):""}GetElement(e,t=!0){if(!this.element)throw new Qe(Le.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new Qe(Le.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new Qe(Le.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new Qe(Le.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new Qe(Le.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,i=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new Qe(Le.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,i=i||this.prefix;let s=(i?`${i}:`:"")+t,a=n&&e?e.createElementNS(n,s):e?.createElement(s);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Yv=class extends Ua{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new yh(this.GetIterator().map(e))}Filter(e){return new yh(this.GetIterator().filter(e))}Sort(e){return new yh(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new Qe(Le.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let i=e.childNodes.item(n);if(!(go(i)&&i.localName===t.parser.localName&&i.namespaceURI==t.namespaceURI))continue;let s=i,a=new t.parser;a.LoadXml(s),this.Add(a)}}};var Zv=class extends yh{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.prefix===e)return s}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.namespace===e)return s}return null}};var Ebe="[object ArrayBuffer]",At=class rF{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ebe}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=rF.toUint8Array(e),i=rF.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let i=new Uint8Array(n),s=0;for(let a of t){let u=this.toUint8Array(a);i.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},tF="string",Abe=/^[0-9a-f\s]+$/i,Nbe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Ibe=/^[a-zA-Z0-9-_]+$/,hJ=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=At.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},el=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=At.toArrayBuffer(e),i=new DataView(n),s="";for(let a=0;a<n.byteLength;a+=2){let u=i.getUint16(a,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),t);return n}},Ft=class ey{static{o(this,"Convert")}static isHex(e){return typeof e===tF&&Abe.test(e)}static isBase64(e){return typeof e===tF&&Nbe.test(e)}static isBase64Url(e){return typeof e===tF&&Ibe.test(e)}static ToString(e,t="utf8"){let n=At.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return el.toString(n,!0);case"utf16":case"utf16be":return el.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return el.fromString(e,!0);case"utf16":case"utf16be":return el.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=At.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ey.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ey.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=ey.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return hJ.fromString(e);case"utf16":case"utf16be":return el.fromString(e);case"utf16le":case"usc2":return el.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=ey.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return hJ.toString(e);case"utf16":case"utf16be":return el.toString(e);case"utf16le":case"usc2":return el.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=At.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=At.toUint8Array(e),n="",i=t.length;for(let s=0;s<i;s++){let a=t[s];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ey.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let s=t.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return el.toString(e,t)}static FromUtf16String(e,t=!1){return el.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Ft.DEFAULT_UTF8_ENCODING="utf8";function P(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(P,"getParametersValue");function IT(r,e=0,t=r.byteLength-e,n=!1){let i="";for(let s of new Uint8Array(r,e,t)){let a=s.toString(16).toUpperCase();a.length===1&&(i+="0"),i+=a,n&&(i+=" ")}return i.trim()}o(IT,"bufferToHexCodes");function uf(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(uf,"utilFromBase");function Lu(r,e,t=-1){let n=t,i=r,s=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),s=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let l=new Uint8Array(c);for(let p=u-1;p>=0;p--){let m=Math.pow(2,p*e);l[s-p-1]=Math.floor(i/m),i-=l[s-p-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Lu,"utilToBase");function Am(...r){let e=0,t=0;for(let s of r)e+=s.byteLength;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(new Uint8Array(s),t),t+=s.byteLength;return n}o(Am,"utilConcatBuf");function TT(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(s,t),t+=s.length;return i}o(TT,"utilConcatView");function nF(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=uf(t,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,uf(s,8)-n}o(nF,"utilDecodeTC");function mJ(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Lu(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let i=Lu(e,8,n),s=new Uint8Array(i);if(s[0]&128){let a=i.slice(0),u=new Uint8Array(a);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<a.byteLength;c++)s[c+1]=u[c];s[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(mJ,"utilEncodeTC");function Sh(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}o(Sh,"isEqualBuffer");function Ma(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let a=0;a<n;a++)i[a]="0";return i.join("").concat(t)}o(Ma,"padNumber");var gJ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",vJ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function RT(r,e=!1,t=!1,n=!1){let i=0,s=0,a=0,u="",c=e?vJ:gJ;if(n){let l=0;for(let p=0;p<r.length;p++)if(r.charCodeAt(p)!==0){l=p;break}r=r.slice(l)}for(;i<r.length;){let l=r.charCodeAt(i++);i>=r.length&&(s=1);let p=r.charCodeAt(i++);i>=r.length&&(a=1);let m=r.charCodeAt(i++),g=l>>2,y=(l&3)<<4|p>>4,v=(p&15)<<2|m>>6,b=m&63;s===1?v=b=64:a===1&&(b=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(y)}`:b===64?u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(b)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(b)}`}return u}o(RT,"toBase64");function ty(r,e=!1,t=!1){let n=e?vJ:gJ;function i(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(i,"indexOf");function s(c){return c===64?0:c}o(s,"test");let a=0,u="";for(;a<r.length;){let c=i(r.charAt(a++)),l=a>=r.length?0:i(r.charAt(a++)),p=a>=r.length?0:i(r.charAt(a++)),m=a>=r.length?0:i(r.charAt(a++)),g=s(c)<<2|s(l)>>4,y=(s(l)&15)<<4|s(p)>>2,v=(s(p)&3)<<6|s(m);u+=String.fromCharCode(g),p!==64&&(u+=String.fromCharCode(y)),m!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,l=-1;for(let p=c-1;p>=0;p--)if(u.charCodeAt(p)!==0){l=p;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(ty,"fromBase64");function ew(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(ew,"arrayBufferToString");function Nm(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let i=0;i<e;i++)n[i]=r.charCodeAt(i);return t}o(Nm,"stringToArrayBuffer");var Tbe=Math.log(2);function yJ(r){let e=Math.log(r)/Tbe,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(yJ,"nearestPowerOf2");function je(r,e){for(let t of e)delete r[t]}o(je,"clearProps");function DT(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(DT,"assertBigInt");function oF(r){let e=0,t=0;for(let i=0;i<r.length;i++){let s=r[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let s=r[i];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}o(oF,"concat");function cf(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(cf,"checkBufferParams");var uF=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return oF(this.items)}},tw=[new Uint8Array([1])],xJ="0123456789",iF="name",bJ="valueHexView",Rbe="isHexOnly",Dbe="idBlock",_be="tagClass",Obe="tagNumber",Pbe="isConstructed",Bbe="fromBER",Lbe="toBER",Fbe="local",qa="",Fu=new ArrayBuffer(0),_T=new Uint8Array(0),nw="EndOfContent",CJ="OCTET STRING",EJ="BIT STRING";function lf(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var i;super(...n);let s=n[0]||{};this.isHexOnly=(i=s.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=s.valueHex?At.toUint8Array(s.valueHex):_T}fromBER(n,i,s){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!cf(this,a,i,s))return-1;let u=i+s;return this.valueHexView=a.subarray(i,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Fu)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Ft.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(lf,"HexBlock");var Im=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=qa,warnings:n=[],valueBeforeDecode:i=_T}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=At.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Ft.ToHex(this.valueBeforeDecodeView)}}};Im.NAME="baseBlock";var Ha=class extends Im{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ha.NAME="valueBlock";var AJ=class extends lf(Im){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,i,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?At.toUint8Array(e.valueHex):_T,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Fu}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=Lu(this.tagNumber,7),s=new Uint8Array(i),a=i.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=s[c]|128;u[a]=s[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=At.toUint8Array(e);if(!cf(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),p=255;for(;s[c]&128;){if(l[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===p){p+=255;let g=new Uint8Array(p);for(let y=0;y<l.length;y++)g[y]=l[y];l=this.valueHexView=new Uint8Array(p)}}this.blockLength=c+1,l[c-1]=s[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(m),this.blockLength<=9?this.tagNumber=uf(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};AJ.NAME="identificationBlock";var NJ=class extends Im{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=At.toUint8Array(e);if(!cf(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=i.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=uf(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=Lu(this.length,8);if(i.byteLength>127)return this.error="Too big length",Fu;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let s=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let a=0;a<i.byteLength;a++)n[a+1]=s[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};NJ.NAME="lengthBlock";var yt={},ga=class extends Im{static{o(this,"BaseBlock")}constructor({name:e=qa,optional:t=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new AJ(i),this.lenBlock=new NJ(i),this.valueBlock=s?new s(i):new Ha(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new uF;t||IJ(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(s)}return t?Fu:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Ft.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Ft.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Sh(t,n)}};ga.NAME="BaseBlock";function IJ(r){var e;if(r instanceof yt.Constructed)for(let t of r.valueBlock.value)IJ(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(IJ,"prepareIndefiniteForm");var TJ=class extends ga{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=qa,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};TJ.NAME="BaseStringBlock";var RJ=class extends lf(Ha){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};RJ.NAME="PrimitiveValueBlock";var DJ,Tt=class extends ga{static{o(this,"Primitive")}constructor(e={}){super(e,RJ),this.idBlock.isConstructed=!1}};DJ=Tt;yt.Primitive=DJ;Tt.NAME="PRIMITIVE";function kbe(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(kbe,"localChangeType");function iw(r,e=0,t=r.length){let n=e,i=new ga({},Ha),s=new Im;if(!cf(s,r,e,t))return i.error=s.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let u=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),u===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=u,t-=i.idBlock.blockLength,u=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),u===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=u,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let c=ga;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};c=yt.EndOfContent;break;case 1:c=yt.Boolean;break;case 2:c=yt.Integer;break;case 3:c=yt.BitString;break;case 4:c=yt.OctetString;break;case 5:c=yt.Null;break;case 6:c=yt.ObjectIdentifier;break;case 10:c=yt.Enumerated;break;case 12:c=yt.Utf8String;break;case 13:c=yt.RelativeObjectIdentifier;break;case 14:c=yt.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=yt.Sequence;break;case 17:c=yt.Set;break;case 18:c=yt.NumericString;break;case 19:c=yt.PrintableString;break;case 20:c=yt.TeletexString;break;case 21:c=yt.VideotexString;break;case 22:c=yt.IA5String;break;case 23:c=yt.UTCTime;break;case 24:c=yt.GeneralizedTime;break;case 25:c=yt.GraphicString;break;case 26:c=yt.VisibleString;break;case 27:c=yt.GeneralString;break;case 28:c=yt.UniversalString;break;case 29:c=yt.CharacterString;break;case 30:c=yt.BmpString;break;case 31:c=yt.DATE;break;case 32:c=yt.TimeOfDay;break;case 33:c=yt.DateTime;break;case 34:c=yt.Duration;break;default:{let l=i.idBlock.isConstructed?new yt.Constructed:new yt.Primitive;l.idBlock=i.idBlock,l.lenBlock=i.lenBlock,l.warnings=i.warnings,i=l}}break;case 2:case 3:case 4:default:c=i.idBlock.isConstructed?yt.Constructed:yt.Primitive}return i=kbe(i,c),u=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:u,result:i}}o(iw,"localFromBER");function Qn(r){if(!r.byteLength){let e=new ga({},Ha);return e.error="Input buffer has zero length",{offset:-1,result:e}}return iw(At.toUint8Array(r).slice(),0,r.byteLength)}o(Qn,"fromBER");function Vbe(r,e){return r?1:e}o(Vbe,"checkLen");var xh=class extends Ha{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=At.toUint8Array(e);if(!cf(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;Vbe(this.isIndefiniteForm,n)>0;){let a=iw(i,s,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===nw)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===nw?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new uF;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?Fu:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};xh.NAME="ConstructedValueBlock";var _J,me=class extends ga{static{o(this,"Constructed")}constructor(e={}){super(e,xh),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
92
92
  `).map(i=>` ${i}`).join(`