nfets 0.0.27 → 0.0.35
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/build/addons/{xml_validator-darwin-arm64.node → darwin-arm64/xml_validator.node} +0 -0
- package/build/addons/linux-x64/libxml2.so.2 +0 -0
- package/build/addons/{xml_validator-linux-x64.node → linux-x64/xml_validator.node} +0 -0
- package/build/addons/win32-x64/libiconv-2.dll +0 -0
- package/build/addons/win32-x64/libxml2-2.dll +0 -0
- package/build/addons/{xml_validator-win32-x64.node → win32-x64/xml_validator.node} +0 -0
- package/build/addons/win32-x64/zlib1.dll +0 -0
- package/dist/{chunk-6IWM35VN.mjs → chunk-DQH2ISYK.mjs} +1 -1
- package/dist/{chunk-G42HFBUE.mjs → chunk-IURMCRIH.mjs} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +1 -1
- package/dist/nfe/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-I4KZJHBR.mjs";import{a as go,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo}from"./chunk-
|
|
2
|
+
import"./chunk-I4KZJHBR.mjs";import{a as go,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo}from"./chunk-DQH2ISYK.mjs";import{$ as Y,A,B,C,D,E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a as o,aa as Z,b as r,ba as _,c as e,ca as $,d as f,da as oo,e as m,ea as ro,f as p,fa as eo,g as t,ga as fo,h as x,ha as mo,i as a,ia as po,j as b,ja as to,k as c,ka as xo,l as d,la as ao,m as g,ma as bo,n as h,na as co,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunk-IURMCRIH.mjs";import"./chunk-W6MRGYXP.mjs";export{co as ASN1,io as AccessKeyBuilder,r as CanonicalizationMethod,I as Choice,A as Decimal,jo as DefaultDetBuilderAggregator,ko as DefaultTotalBuilderAggregator,m as DigestAlgorithm,k as EntitySigner,x as Environment,H as IsDecimal,g as Left,B as MemoryCacheAdapter,so as NFCeDto,lo as NFeDto,a as NFeTsError,E as NativeCertificateRepository,vo as NfceQrcode,uo as NfceRemoteTransmitter,zo as NfceXmlBuilder,qo as NfeAuthorizerPipeline,wo as NfeDetXmlBuilder,no as NfeRemoteTransmitter,yo as NfeXmlBuilder,D as NullCacheAdapter,h as Right,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,d as Signer,s as SkipAllValidations,q as SkipValidation,n as SkipValidationMetadata,F as SoapRemoteTransmissionRepository,t as StateAcronyms,L as StateCodeAcValidator,M as StateCodeAlValidator,N as StateCodeAmValidator,O as StateCodeApValidator,P as StateCodeBaValidator,Q as StateCodeCeValidator,R as StateCodeDfValidator,S as StateCodeEsValidator,T as StateCodeGoValidator,U as StateCodeMaValidator,V as StateCodeMgValidator,W as StateCodeMsValidator,X as StateCodeMtValidator,Y as StateCodePaValidator,Z as StateCodePbValidator,_ as StateCodePeValidator,$ as StateCodePiValidator,oo as StateCodePrValidator,ro as StateCodeRjValidator,eo as StateCodeRnValidator,fo as StateCodeRoValidator,mo as StateCodeRrValidator,po as StateCodeRsValidator,to as StateCodeScValidator,xo as StateCodeSeValidator,ao as StateCodeSpValidator,bo as StateCodeToValidator,p as StateCodes,go as TpEmis,K as TransformDateString,J as TransformDecimal,w as ValidateErrorsMetadata,z as Validates,b as ValidationError,G as Xml2JsToolkit,l as XmlSigner,u as clearEmptyValues,ho as directory,i as left,C as leftFromError,y as mapConstraintsToErrors,v as plainToInstance,j as right,c as unreachable};
|
package/dist/nfe/index.cjs
CHANGED
|
@@ -87,7 +87,7 @@ Actual: `+L.attribValue);else{var Ge=L.tag,Ue=L.tags[L.tags.length-1]||L;Ge.ns==
|
|
|
87
87
|
\r Response Body: `+m.data))},a,u)):(ZG("Reading file: %s",r),vxe.readFile(r,"utf8",(l,p)=>{l?i(l):(c=new tT(p,r,n),s[r]=c,c.WSDL_CACHE=s,c.onReady(i))})),c}o(rX,"open_wsdl")});var iX=Z(nX=>{"use strict";Object.defineProperty(nX,"__esModule",{value:!0})});var uX=Z(Zt=>{"use strict";var sX=Zt&&Zt.__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]}),Exe=Zt&&Zt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Axe=Zt&&Zt.__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"&&sX(t,e,n[i]);return Exe(t,e),t}})(),Nxe=Zt&&Zt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&sX(e,r,t)};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.WSDL=Zt.passwordDigest=Zt.Server=Zt.WSSecurityCertWithToken=Zt.WSSecurityPlusCert=Zt.WSSecurityCert=Zt.WSSecurity=Zt.NTLMSecurity=Zt.ClientSSLSecurityPFX=Zt.ClientSSLSecurity=Zt.BearerSecurity=Zt.BasicAuthSecurity=Zt.HttpClient=Zt.Client=Zt.security=void 0;Zt.createClient=oX;Zt.createClientAsync=Vxe;Zt.listen=jxe;var Ixe=k3(),Txe=Axe(yL()),Rxe=SL(),Dxe=ah(),aX=FL();Zt.security=Txe;var _xe=k3();Object.defineProperty(Zt,"Client",{enumerable:!0,get:o(function(){return _xe.Client},"get")});var Oxe=xI();Object.defineProperty(Zt,"HttpClient",{enumerable:!0,get:o(function(){return Oxe.HttpClient},"get")});var nf=yL();Object.defineProperty(Zt,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return nf.BasicAuthSecurity},"get")});Object.defineProperty(Zt,"BearerSecurity",{enumerable:!0,get:o(function(){return nf.BearerSecurity},"get")});Object.defineProperty(Zt,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return nf.ClientSSLSecurity},"get")});Object.defineProperty(Zt,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return nf.ClientSSLSecurityPFX},"get")});Object.defineProperty(Zt,"NTLMSecurity",{enumerable:!0,get:o(function(){return nf.NTLMSecurity},"get")});Object.defineProperty(Zt,"WSSecurity",{enumerable:!0,get:o(function(){return nf.WSSecurity},"get")});Object.defineProperty(Zt,"WSSecurityCert",{enumerable:!0,get:o(function(){return nf.WSSecurityCert},"get")});Object.defineProperty(Zt,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return nf.WSSecurityPlusCert},"get")});Object.defineProperty(Zt,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return nf.WSSecurityCertWithToken},"get")});var Pxe=SL();Object.defineProperty(Zt,"Server",{enumerable:!0,get:o(function(){return Pxe.Server},"get")});var Bxe=ah();Object.defineProperty(Zt,"passwordDigest",{enumerable:!0,get:o(function(){return Bxe.passwordDigest},"get")});Nxe(iX(),Zt);var Lxe=FL();Object.defineProperty(Zt,"WSDL",{enumerable:!0,get:o(function(){return Lxe.WSDL},"get")});function Fxe(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(Fxe,"getFromCache");function kxe(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(i=>{(0,aX.open_wsdl)(r,e,i)},"openWsdl");if(e.disableCache===!0)n(t);else{let i;e.wsdlCache?i=e.wsdlCache:i=Dxe.wsdlCacheSingleton,Fxe(r,i,n,t)}}o(kxe,"_requestWSDL");function oX(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,kxe(r,a,(u,c)=>{s(u,c&&new Ixe.Client(c,i,a))})}o(oX,"createClient");function Vxe(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,i)=>{oX(r,e,(s,a)=>{s&&i(s),n(a)},t)})}o(Vxe,"createClientAsync");function jxe(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 aX.WSDL(n||t,u,s);return new Rxe.Server(r,a,t,c,s)}o(jxe,"listen")});var sT=Z(UL=>{"use strict";(function(){UL.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(UL)});var Yc=Z((gX,mh)=>{"use strict";(function(){var r,e,t,n,i,s,a,u=[].slice,c={}.hasOwnProperty;r=o(function(){var l,p,m,g,S,v;if(v=arguments[0],S=2<=arguments.length?u.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,m=S.length;l<m;l++)if(g=S[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"),mh.exports.assign=r,mh.exports.isFunction=i,mh.exports.isObject=s,mh.exports.isArray=t,mh.exports.isEmpty=n,mh.exports.isPlainObject=a,mh.exports.getValue=e}).call(gX)});var ML=Z((vX,yX)=>{"use strict";(function(){var r;yX.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(vX)});var bX=Z((SX,xX)=>{"use strict";(function(){var r;xX.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(SX)});var EX=Z((wX,CX)=>{"use strict";(function(){var r;CX.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(wX)});var IX=Z((AX,NX)=>{"use strict";(function(){var r,e,t;e=bX(),t=EX(),NX.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(AX)});var Si=Z((TX,RX)=>{"use strict";(function(){RX.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(TX)});var qL=Z((DX,_X)=>{"use strict";(function(){var r,e,t;r=Si(),t=ho(),_X.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(DX)});var aT=Z((OX,PX)=>{"use strict";(function(){var r;PX.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(OX)});var oT=Z((BX,LX)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l=o(function(m,g){for(var S in g)p.call(g,S)&&(m[S]=g[S]);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=ho(),r=Si(),e=qL(),n=aT(),LX.exports=t=(function(m){l(g,m);function g(S,v,b){var x,E,N,w;if(g.__super__.constructor.call(this,S),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),S.type===r.Document&&(this.isRoot=!0,this.documentObject=S,S.rootObject=this,S.children)){for(w=S.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 S,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)&&(S=x[v],b.attribs[v]=S.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(S,v){var b,x;if(S!=null&&(S=s(S)),u(S))for(b in S)p.call(S,b)&&(x=S[b],this.attribute(b,x));else a(v)&&(v=v.apply()),this.options.keepNullAttributes&&v==null?this.attribs[S]=new e(this,S,""):v!=null&&(this.attribs[S]=new e(this,S,v));return this},g.prototype.removeAttribute=function(S){var v,b,x;if(S==null)throw new Error("Missing attribute name. "+this.debugInfo());if(S=s(S),Array.isArray(S))for(b=0,x=S.length;b<x;b++)v=S[b],delete this.attribs[v];else delete this.attribs[S];return this},g.prototype.toString=function(S){return this.options.writer.element(this,this.options.writer.filterOptions(S))},g.prototype.att=function(S,v){return this.attribute(S,v)},g.prototype.a=function(S,v){return this.attribute(S,v)},g.prototype.getAttribute=function(S){return this.attribs.hasOwnProperty(S)?this.attribs[S].value:null},g.prototype.setAttribute=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(S){return this.attribs.hasOwnProperty(S)?this.attribs[S]:null},g.prototype.setAttributeNode=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(S,v,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(S){return this.attribs.hasOwnProperty(S)},g.prototype.hasAttributeNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(S,v){return this.attribs.hasOwnProperty(S)?this.attribs[S].isId:v},g.prototype.setIdAttributeNS=function(S,v,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(S){var v,b,x;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(S)||S.namespaceURI!==this.namespaceURI||S.prefix!==this.prefix||S.localName!==this.localName||S.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(S.attribs[v]))return!1;return!0},g})(i)}).call(BX)});var Ub=Z((FX,kX)=>{"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=ho(),kX.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(FX)});var uT=Z((VX,jX)=>{"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=Ub(),jX.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(VX)});var cT=Z((UX,MX)=>{"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=Ub(),MX.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(UX)});var lT=Z((qX,HX)=>{"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=ho(),r=Si(),HX.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(qX)});var fT=Z((zX,KX)=>{"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=ho(),r=Si(),KX.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(zX)});var pT=Z(($X,GX)=>{"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=ho(),r=Si(),GX.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($X)});var hT=Z((XX,WX)=>{"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=ho(),r=Si(),WX.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(XX)});var dT=Z((JX,QX)=>{"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=ho(),r=Si(),QX.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(JX)});var mT=Z((YX,ZX)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l=o(function(m,g){for(var S in g)p.call(g,S)&&(m[S]=g[S]);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=ho(),r=Si(),e=fT(),n=pT(),t=hT(),i=dT(),a=aT(),ZX.exports=s=(function(m){l(g,m);function g(S,v,b){var x,E,N,w,C,A;if(g.__super__.constructor.call(this,S),this.type=r.DocType,S.children){for(w=S.children,E=0,N=w.length;E<N;E++)if(x=w[E],x.type===r.Element){this.name=x.name;break}}this.documentObject=S,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 S,v,b,x,E;for(x={},E=this.children,v=0,b=E.length;v<b;v++)S=E[v],S.type===r.EntityDeclaration&&!S.pe&&(x[S.name]=S);return new a(x)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var S,v,b,x,E;for(x={},E=this.children,v=0,b=E.length;v<b;v++)S=E[v],S.type===r.NotationDeclaration&&(x[S.name]=S);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(S,v){var b;return b=new t(this,S,v),this.children.push(b),this},g.prototype.attList=function(S,v,b,x,E){var N;return N=new e(this,S,v,b,x,E),this.children.push(N),this},g.prototype.entity=function(S,v){var b;return b=new n(this,!1,S,v),this.children.push(b),this},g.prototype.pEntity=function(S,v){var b;return b=new n(this,!0,S,v),this.children.push(b),this},g.prototype.notation=function(S,v){var b;return b=new i(this,S,v),this.children.push(b),this},g.prototype.toString=function(S){return this.options.writer.docType(this,this.options.writer.filterOptions(S))},g.prototype.ele=function(S,v){return this.element(S,v)},g.prototype.att=function(S,v,b,x,E){return this.attList(S,v,b,x,E)},g.prototype.ent=function(S,v){return this.entity(S,v)},g.prototype.pent=function(S,v){return this.pEntity(S,v)},g.prototype.not=function(S,v){return this.notation(S,v)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(S){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(S)||S.name!==this.name||S.publicId!==this.publicId||S.systemId!==this.systemId)},g})(u)}).call(YX)});var gT=Z((eW,tW)=>{"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=ho(),tW.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(eW)});var vT=Z((rW,nW)=>{"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=Ub(),nW.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(rW)});var yT=Z((iW,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;r=Si(),e=Ub(),sW.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(iW)});var HL=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;t=ho(),r=Si(),oW.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(aW)});var lW=Z((uW,cW)=>{"use strict";(function(){var r;cW.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(uW)});var hW=Z((fW,pW)=>{"use strict";(function(){pW.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(fW)});var ho=Z((dW,mW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,S,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,S=null,m=null,a=null,e=null,p=null,c=null,r=null,mW.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=oT(),t=uT(),n=cT(),i=lT(),s=mT(),g=gT(),S=vT(),m=yT(),a=HL(),e=Si(),p=lW(),c=aT(),r=hW())}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 S(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(dW)});var zL=Z((gW,vW)=>{"use strict";(function(){var r,e=o(function(n,i){return function(){return n.apply(i,arguments)}},"bind"),t={}.hasOwnProperty;vW.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,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},n.prototype.attEscape=function(i){var s;return this.options.noValidation?i:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(s,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},n})()}).call(gW)});var Mb=Z((yW,SW)=>{"use strict";(function(){SW.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(yW)});var KL=Z((xW,bW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,S,v,b,x,E={}.hasOwnProperty;x=Yc().assign,r=Si(),c=lT(),l=mT(),t=uT(),n=cT(),m=oT(),S=gT(),v=vT(),g=yT(),p=HL(),i=fT(),s=hT(),a=pT(),u=dT(),e=Mb(),bW.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
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(xW)});var ST=Z((wW,CW)=>{"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=KL(),CW.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(wW)});var $L=Z((EW,AW)=>{"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 S(){this.constructor=p}return o(S,"ctor"),S.prototype=m.prototype,p.prototype=new S,p.__super__=m.prototype,p},"extend"),l={}.hasOwnProperty;u=Yc().isPlainObject,t=ML(),e=IX(),i=ho(),r=Si(),a=zL(),s=ST(),AW.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,S,v,b;for(b=this.children,S=0,v=b.length;S<v;S++)if(g=b[S],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 S;return S={},g?u(g)&&(S=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(S))},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,S){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,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,S){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,S,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,S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,S,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(i)}).call(EW)});var TW=Z((NW,IW)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l,p,m,g,S,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=$L(),S=oT(),n=uT(),i=cT(),b=gT(),N=vT(),v=yT(),l=lT(),p=mT(),s=fT(),u=pT(),a=hT(),c=dT(),t=qL(),E=zL(),x=ST(),e=Mb(),IW.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 S(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(NW)});var _W=Z((RW,DW)=>{"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=KL(),e=Mb(),DW.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,S,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=[],S=0,b=E.length;S<b;S++)p=E[S],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,S,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,S=v.length;g<S;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,S,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(S=c.children.length,v=S===0?null:c.children[0],S===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&&S===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(RW)});var PW=Z((OW,gh)=>{"use strict";(function(){var r,e,t,n,i,s,a,u,c,l;l=Yc(),u=l.assign,c=l.isFunction,t=ML(),n=$L(),i=TW(),a=ST(),s=_W(),r=Si(),e=Mb(),gh.exports.create=function(p,m,g,S){var v,b;if(p==null)throw new Error("Root element needs a name.");return S=u({},m,g,S),v=new n(S),b=v.element(p),S.headless||(v.declaration(S),(S.pubID!=null||S.sysID!=null)&&v.dtd(S)),b},gh.exports.begin=function(p,m,g){var S;return c(p)&&(S=[p,m],m=S[0],g=S[1],p={}),m?new i(p,m,g):new n(p)},gh.exports.stringWriter=function(p){return new a(p)},gh.exports.streamWriter=function(p,m){return new s(p,m)},gh.exports.implementation=new t,gh.exports.nodeType=r,gh.exports.writerState=e}).call(OW)});var BW=Z(GL=>{"use strict";(function(){"use strict";var r,e,t,n,i,s={}.hasOwnProperty;r=PW(),e=sT().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"),GL.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(S){return function(v,b){var x,E,N,w,C,A;if(typeof b!="object")S.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)S.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"?S.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"&&S.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(GL)});var LW=Z(XL=>{"use strict";(function(){"use strict";XL.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(XL)});var WL=Z(wm=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),wm.normalize=function(e){return e.toLowerCase()},wm.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},wm.stripPrefix=function(e){return e.replace(r,"")},wm.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},wm.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(wm)});var FW=Z(sf=>{"use strict";(function(){"use strict";var r,e,t,n,i,s,a,u,c,l=o(function(g,S){return function(){return g.apply(S,arguments)}},"bind"),p=o(function(g,S){for(var v in S)m.call(S,v)&&(g[v]=S[v]);function b(){this.constructor=g}return o(b,"ctor"),b.prototype=S.prototype,g.prototype=new b,g.__super__=S.prototype,g},"extend"),m={}.hasOwnProperty;u=xL(),n=require("events"),r=LW(),a=WL(),c=require("timers").setImmediate,e=sT().defaults,i=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),s=o(function(g,S,v){var b,x,E;for(b=0,x=g.length;b<x;b++)E=g[b],S=E(S,v);return S},"processItem"),t=o(function(g,S,v){var b;return b=Object.create(null),b.value=v,b.writable=!0,b.enumerable=!0,b.configurable=!0,Object.defineProperty(g,S,b)},"defineProperty"),sf.Parser=(function(g){p(S,g);function S(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 sf.Parser))return new sf.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(S,"Parser"),S.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)}},S.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)},S.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)},S.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}},S.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))},S})(n),sf.parseString=function(g,S,v){var b,x,E;return v!=null?(typeof v=="function"&&(b=v),typeof S=="object"&&(x=S)):(typeof S=="function"&&(b=S),x={}),E=new sf.Parser(x),E.parseString(g,b)},sf.parseStringPromise=function(g,S){var v,b;return typeof S=="object"&&(v=S),b=new sf.Parser(v),b.parseStringPromise(g)}}).call(sf)});var kW=Z(af=>{"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=sT(),r=BW(),t=FW(),n=WL(),af.defaults=e.defaults,af.processors=n,af.ValidationError=(function(a){i(u,a);function u(c){this.message=c}return o(u,"ValidationError"),u})(Error),af.Builder=r.Builder,af.Parser=t.Parser,af.parseString=t.parseString,af.parseStringPromise=t.parseStringPromise}).call(af)});var eZ=Z((M9e,ZY)=>{"use strict";var hA;ZY.exports=function(){if(!hA){try{hA=cm()("follow-redirects")}catch{}typeof hA!="function"&&(hA=o(function(){},"debug"))}hA.apply(null,arguments)}});var sZ=Z((H9e,WV)=>{"use strict";var mA=require("url"),dA=mA.URL,UAe=require("http"),MAe=require("https"),qV=require("stream").Writable,HV=require("assert"),tZ=eZ();o((function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=hg(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")}),"detectUnsupportedEnvironment")();var zV=!1;try{HV(new dA(""))}catch(r){zV=r.code==="ERR_INVALID_URL"}var qAe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],KV=["abort","aborted","connect","error","socket","timeout"],$V=Object.create(null);KV.forEach(function(r){$V[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var jV=gA("ERR_INVALID_URL","Invalid URL",TypeError),UV=gA("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),HAe=gA("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",UV),zAe=gA("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),KAe=gA("ERR_STREAM_WRITE_AFTER_END","write after end"),$Ae=qV.prototype.destroy||nZ;function Wa(r,e){qV.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 UV?i:new UV({cause:i}))}},this._performRequest()}o(Wa,"RedirectableRequest");Wa.prototype=Object.create(qV.prototype);Wa.prototype.abort=function(){XV(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wa.prototype.destroy=function(r){return XV(this._currentRequest,r),$Ae.call(this,r),this};Wa.prototype.write=function(r,e,t){if(this._ending)throw new KAe;if(!pg(r)&&!WAe(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(hg(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 zAe),this.abort())};Wa.prototype.end=function(r,e,t){if(hg(r)?(t=r,r=e=null):hg(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 KV)n.on(i,$V[i]);if(this._currentUrl=/^\//.test(this._options.path)?mA.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(XV(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new HAe;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=[],VV(/^content-/i,this._options.headers));var a=VV(/^host$/i,this._options.headers),u=GV(this._currentUrl),c=a||u.host,l=/^\w+:/.test(t)?this._currentUrl:mA.format(Object.assign(u,{host:c})),p=GAe(t,l);if(tZ("redirecting to",p.href),this._isRedirect=!0,MV(p,this._options),(p.protocol!==u.protocol&&p.protocol!=="https:"||p.host!==c&&!XAe(p.host,c))&&VV(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),hg(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 rZ(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 JAe(l)?l=MV(l):pg(l)?l=MV(GV(l)):(m=p,p=iZ(l),l={protocol:i}),hg(p)&&(m=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,p),p.nativeProtocols=t,!pg(p.host)&&!pg(p.hostname)&&(p.hostname="::1"),HV.equal(p.protocol,i,"protocol mismatch"),tZ("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(rZ,"wrap");function nZ(){}o(nZ,"noop");function GV(r){var e;if(zV)e=new dA(r);else if(e=iZ(mA.parse(r)),!pg(e.protocol))throw new jV({input:r});return e}o(GV,"parseUrl");function GAe(r,e){return zV?new dA(r,e):GV(mA.resolve(e,r))}o(GAe,"resolveUrl");function iZ(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new jV({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new jV({input:r.href||r});return r}o(iZ,"validateUrl");function MV(r,e){var t=e||{};for(var n of qAe)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(MV,"spreadUrlObject");function VV(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(VV,"removeMatchingHeaders");function gA(r,e,t){function n(i){hg(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(gA,"createErrorType");function XV(r,e){for(var t of KV)r.removeListener(t,$V[t]);r.on("error",nZ),r.destroy(e)}o(XV,"destroyRequest");function XAe(r,e){HV(pg(r)&&pg(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}o(XAe,"isSubdomain");function pg(r){return typeof r=="string"||r instanceof String}o(pg,"isString");function hg(r){return typeof r=="function"}o(hg,"isFunction");function WAe(r){return typeof r=="object"&&"length"in r}o(WAe,"isBuffer");function JAe(r){return dA&&r instanceof dA}o(JAe,"isURL");WV.exports=rZ({http:UAe,https:MAe});WV.exports.wrap=rZ});var VNe={};DN(VNe,{AccessKeyBuilder:()=>Nx,DefaultDetBuilderAggregator:()=>iA,DefaultTotalBuilderAggregator:()=>sA,NFCeDto:()=>yu,NFeDto:()=>mc,NfceQrcode:()=>U8,NfceRemoteTransmitter:()=>nO,NfceXmlBuilder:()=>M8,NfeAuthorizerPipeline:()=>F8,NfeDetXmlBuilder:()=>Fs,NfeRemoteTransmitter:()=>eo,NfeXmlBuilder:()=>Gn,TpEmis:()=>Ta,directory:()=>SP});module.exports=Loe(VNe);var Ta=(function(r){return r.Normal="1",r.EPEC="4",r.SVCAN="6",r.SVCRS="7",r.OFFLINE="9",r})({});var Foe={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21"},SP=process.env.NFETS_NFE_SCHEMAS_DIR??"",dU=Foe;var Nx=class{static{o(this,"AccessKeyBuilder")}compile(e){let t=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),s=(e.identification??"").padStart(14,"0"),a=e.mod.toString().padStart(2,"0"),u=e.serie.toString().padStart(3,"0"),c=e.nNF.toString().padStart(9,"0"),l=e.tpEmis.toString().padStart(1,"0"),p=(e.cNF??this.code()).toString().padStart(8,"0"),m=`${t}${n}${i}${s}${a}${u}${c}${l}${p}`;return`${m}${this.verifyingDigit(m)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,s,a,u,c,l,p,m,g,S,v]=n;return{cUF:s,year:a,month:u,identification:c,mod:l,serie:p,nNF:m,tpEmis:g,cNF:S,vd:v}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let t=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let a=0;a<8&&n>=0;a++){let u=parseInt(e[n]);i+=u*t[a],n--}let s=11-i%11;return s>9?0:s}};var Jg=9e15,Dp=1e9,xP="0123456789abcdef",PN="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",BN="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bP={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Jg,maxE:Jg,crypto:!1},yU,Kl,Gt=!0,FN="[DecimalError] ",Rp=FN+"Invalid argument: ",SU=FN+"Precision limit exceeded",xU=FN+"crypto unavailable",bU="[object Decimal]",qs=Math.floor,Bi=Math.pow,koe=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Voe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,joe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wU=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Nu=1e7,Bt=7,Uoe=9007199254740991,Moe=PN.length-1,wP=BN.length-1,qe={toStringTag:bU};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(Rp+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=qoe(n,IU(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*Bi(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=Bi(t,1/3),r=qs((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=ln(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-qs(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 ln(this,new this.constructor(r))};qe.dividedToIntegerBy=qe.divToInt=function(r){var e=this,t=e.constructor;return It(ln(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/VN(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),s=Qg(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=Qg(s,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/VN(5,r)),i=Qg(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,ln(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()?Ec(e,n,i):new e(0):new e(NaN):r.isZero()?Ec(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=ln(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=Ec(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<=wP)return a=Ec(p,m+4,g).times(.25),a.s=l.s,a}else{if(!l.s)return new p(NaN);if(m+4<=wP)return a=Ec(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&&qs(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,S=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+S,a=Tp(l,u),n=e?LN(p,u+10):Tp(r,u),c=ln(a,n,u,1),Ix(c.d,i=m,g))do if(u+=10,a=Tp(l,u),n=e?LN(p,u+10):Tp(r,u),c=ln(a,n,u,1),!s){+ms(c.d).slice(i+1,i+15)+1==1e14&&(c=It(c,m+1,0));break}while(Ix(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,S=this,v=S.constructor;if(r=new v(r),!S.d||!r.d)return!S.s||!r.s?r=new v(NaN):S.d?r.s=-r.s:r=new v(r.d||S.s!==r.s?S:NaN),r;if(S.s!=r.s)return r.s=-r.s,S.plus(r);if(l=S.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(S);else return new v(c===3?-0:0);return Gt?It(r,u,c):r}if(t=qs(r.e/Bt),p=qs(S.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]=Nu-1;--l[i],l[n]+=Nu}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=kN(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=ln(t,r.abs(),0,3,1),e.s*=r.s):e=ln(t,r,0,n.modulo,1),e=e.times(r),Gt=!0,t.minus(e))};qe.naturalExponential=qe.exp=function(){return CP(this)};qe.naturalLogarithm=qe.ln=function(){return Tp(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=qs(m.e/Bt),n=qs(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)/Nu|0,l[i]%=Nu;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=kN(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(Rp+r);return t.d?(e=CU(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=zoe(n,IU(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=qs((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(ln(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=ln(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,S=(r=new m(r)).d;if(r.s*=p.s,!g||!g[0]||!S||!S[0])return new m(!r.s||g&&!g[0]&&!S||S&&!S[0]&&!g?NaN:!g||!S?r.s/0:r.s*0);for(t=qs(p.e/Bt)+qs(r.e/Bt),c=g.length,l=S.length,c<l&&(s=g,g=S,S=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]+S[n]*g[i-n-1]+e,s[i--]=u%Nu|0,e=u/Nu|0;s[i]=(s[i]+e)%Nu|0}for(;!s[--a];)s.pop();return e?++t:s.shift(),r.d=s,r.e=kN(s,t),Gt?It(r,m.precision,m.rounding):r};qe.toBinary=function(r,e){return EP(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:(Ra(r,0,Dp),e===void 0?e=n.rounding:Ra(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=Ac(n,!0):(Ra(r,0,Dp),e===void 0?e=i.rounding:Ra(e,0,8),n=It(new i(n),r+1,e),t=Ac(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=Ac(i):(Ra(r,0,Dp),e===void 0?e=s.rounding:Ra(e,0,8),n=It(new s(i),r+i.e+1,e),t=Ac(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,S=this,v=S.d,b=S.constructor;if(!v)return new b(S);if(l=t=new b(1),n=c=new b(0),e=new b(n),s=e.e=CU(v)-S.e-1,a=s%Bt,e.d[0]=Bi(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(Rp+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=ln(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=ln(r.minus(t),n,0,1,1),c=c.plus(i.times(l)),t=t.plus(i.times(n)),c.s=l.s=S.s,g=ln(l,n,s,1).minus(S).abs().cmp(ln(c,t,s,1).minus(S).abs())<1?[l,n]:[c,t],b.precision=p,Gt=!0,g};qe.toHexadecimal=qe.toHex=function(r,e){return EP(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:Ra(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=ln(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 EP(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(Bi(+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=qs(r.e/Bt),e>=r.d.length-1&&(t=l<0?-l:l)<=Uoe)return i=EU(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=Bi(+u,l),e=t==0||!isFinite(t)?qs(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=CP(r.times(Tp(u,n+t)),n),i.d&&(i=It(i,n+5,1),Ix(i.d,n,s)&&(e=n+10,i=It(CP(r.times(Tp(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=Ac(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ra(r,1,Dp),e===void 0?e=i.rounding:Ra(e,0,8),n=It(new i(n),r,e),t=Ac(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):(Ra(r,1,Dp),e===void 0?e=n.rounding:Ra(e,0,8)),It(new n(t),r,e)};qe.toString=function(){var r=this,e=r.constructor,t=Ac(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=Ac(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+=Ip(t)),s+=n;a=r[e],n=a+"",t=Bt-n.length,t&&(s+=Ip(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}o(ms,"digitsToString");function Ra(r,e,t){if(r!==~~r||r<e||r>t)throw Error(Rp+r)}o(Ra,"checkInt32");function Ix(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=Bi(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)==Bi(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)==Bi(10,e-3)-1,a}o(Ix,"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]+=xP.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 qoe(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/VN(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Qg(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(qoe,"cosine");var ln=(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,S,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?(S=1,p=n.e-i.e):(c=Nu,S=Bt,p=qs(n.e/S)-qs(i.e/S)),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/S+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(S==1)E.e=p,yU=v;else{for(m=1,g=N[0];g>=10;g/=10)m++;E.e=m+p*S-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,S=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/Bi(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/Bi(10,i-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?p:p%Bi(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/Bi(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]=Bi(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=Bi(10,Bt-s),m[g]=a>0?(p/Bi(10,i-a)%Bi(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]==Nu&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Nu)break;m[g--]=0,u=1}for(s=m.length;m[--s]===0;)m.pop()}return Gt&&(r.e>S.maxE?(r.d=null,r.e=NaN):r.e<S.minE&&(r.e=0,r.d=[0])),r}o(It,"finalise");function Ac(r,e,t){if(!r.isFinite())return NU(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)+Ip(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(r.e<0?"e":"e+")+r.e):i<0?(s="0."+Ip(-i-1)+s,t&&(n=t-a)>0&&(s+=Ip(n))):i>=a?(s+=Ip(i+1-a),t&&(n=t-i-1)>0&&(s=s+"."+Ip(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),t&&(n=t-a)>0&&(i+1===a&&(s+="."),s+=Ip(n))),s}o(Ac,"finiteToString");function kN(r,e){var t=r[0];for(e*=Bt;t>=10;t/=10)e++;return e}o(kN,"getBase10Exponent");function LN(r,e,t){if(e>Moe)throw Gt=!0,t&&(r.precision=t),Error(SU);return It(new r(PN),e,1,!0)}o(LN,"getLn10");function Ec(r,e,t){if(e>wP)throw Error(SU);return It(new r(BN),e,t,!0)}o(Ec,"getPi");function CU(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(CU,"getPrecision");function Ip(r){for(var e="";r--;)e+="0";return e}o(Ip,"getZeroString");function EU(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),gU(s.d,a)&&(i=!0)),t=qs(t/2),t===0){t=s.d.length-1,i&&s.d[t]===0&&++s.d[t];break}e=e.times(e),gU(e.d,a)}return Gt=!0,s}o(EU,"intPow");function mU(r){return r.d[r.d.length-1]&1}o(mU,"isOdd");function AU(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(AU,"maxOrMin");function CP(r,e){var t,n,i,s,a,u,c,l=0,p=0,m=0,g=r.constructor,S=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(Bi(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(ln(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&&Ix(a.d,c-n,S,l))g.precision=c+=10,t=s=u=new g(1),p=0,l++;else return It(a,g.precision=v,S,Gt=!0);else return g.precision=v,a}a=u}}o(CP,"naturalExponential");function Tp(r,e){var t,n,i,s,a,u,c,l,p,m,g,S=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),S++;s=b.e,n>1?(b=new E("0."+t),s++):b=new E(n+"."+t.slice(1))}else return l=LN(E,p+2,w).times(s+""),b=Tp(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=ln(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(ln(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(LN(E,p+2,w).times(s+""))),c=ln(c,new E(S),p,1),e==null)if(Ix(c.d,p-v,N,u))E.precision=p+=v,l=a=b=ln(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(Tp,"naturalLogarithm");function NU(r){return String(r.s*r.s/0)}o(NU,"nonFiniteToString");function ON(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(ON,"parseDecimal");function Hoe(r,e){var t,n,i,s,a,u,c,l,p;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),wU.test(e))return ON(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(Voe.test(e))t=16,e=e.toLowerCase();else if(koe.test(e))t=2;else if(joe.test(e))t=8;else throw Error(Rp+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=EU(n,new n(t),s,s*2)),l=_N(e,t,Nu),p=l.length-1,s=p;l[s]===0;--s)l.pop();return s<0?new n(r.s*0):(r.e=kN(l,p),r.d=l,Gt=!1,a&&(r=ln(r,i,u*4)),c&&(r=r.times(Math.abs(c)<54?Bi(2,c):Yg.pow(2,c))),Gt=!0,r)}o(Hoe,"parseOther");function zoe(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Qg(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/VN(5,t)),e=Qg(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(zoe,"sine");function Qg(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=ln(u.times(c),new r(e++*e++),p,1),u=i?n.plus(a):n.minus(a),n=ln(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(Qg,"taylorSeries");function VN(r,e){for(var t=r;--e;)t*=r;return t}o(VN,"tinyPow");function IU(r,e){var t,n=e.s<0,i=Ec(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=mU(t)?n?2:3:n?4:1,e;Kl=mU(t)?n?1:4:n?3:2}return e.minus(i).abs()}o(IU,"toLessThanHalfPi");function EP(r,e,t,n){var i,s,a,u,c,l,p,m,g,S=r.constructor,v=t!==void 0;if(v?(Ra(t,1,Dp),n===void 0?n=S.rounding:Ra(n,0,8)):(t=S.precision,n=S.rounding),!r.isFinite())p=NU(r);else{for(p=Ac(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 S(1),g.e=p.length-a,g.d=_N(Ac(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 S(r),r.d=m,r.e=s,r=ln(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+=xP.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+=xP.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(EP,"toStringBinary");function gU(r,e){if(r.length>e)return r.length=e,!0}o(gU,"truncate");function Koe(r){return new this(r).abs()}o(Koe,"abs");function $oe(r){return new this(r).acos()}o($oe,"acos");function Goe(r){return new this(r).acosh()}o(Goe,"acosh");function Xoe(r,e){return new this(r).plus(e)}o(Xoe,"add");function Woe(r){return new this(r).asin()}o(Woe,"asin");function Joe(r){return new this(r).asinh()}o(Joe,"asinh");function Qoe(r){return new this(r).atan()}o(Qoe,"atan");function Yoe(r){return new this(r).atanh()}o(Yoe,"atanh");function Zoe(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=Ec(this,s,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?Ec(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=Ec(this,s,1).times(.5),t.s=r.s):e.s<0?(this.precision=s,this.rounding=1,t=this.atan(ln(r,e,s,1)),e=Ec(this,s,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(ln(r,e,s,1)),t}o(Zoe,"atan2");function eue(r){return new this(r).cbrt()}o(eue,"cbrt");function tue(r){return It(r=new this(r),r.e+1,2)}o(tue,"ceil");function rue(r,e,t){return new this(r).clamp(e,t)}o(rue,"clamp");function nue(r){if(!r||typeof r!="object")throw Error(FN+"Object expected");var e,t,n,i=r.defaults===!0,s=["precision",1,Dp,"rounding",0,8,"toExpNeg",-Jg,0,"toExpPos",0,Jg,"maxE",0,Jg,"minE",-Jg,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],i&&(this[t]=bP[t]),(n=r[t])!==void 0)if(qs(n)===n&&n>=s[e+1]&&n<=s[e+2])this[t]=n;else throw Error(Rp+t+": "+n);if(t="crypto",i&&(this[t]=bP[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(xU);else this[t]=!1;else throw Error(Rp+t+": "+n);return this}o(nue,"config");function iue(r){return new this(r).cos()}o(iue,"cos");function sue(r){return new this(r).cosh()}o(sue,"cosh");function TU(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,vU(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 ON(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),wU.test(s)?ON(l,s):Hoe(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,ON(l,s.toString());throw Error(Rp+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=nue,i.clone=TU,i.isDecimal=vU,i.abs=Koe,i.acos=$oe,i.acosh=Goe,i.add=Xoe,i.asin=Woe,i.asinh=Joe,i.atan=Qoe,i.atanh=Yoe,i.atan2=Zoe,i.cbrt=eue,i.ceil=tue,i.clamp=rue,i.cos=iue,i.cosh=sue,i.div=aue,i.exp=oue,i.floor=uue,i.hypot=cue,i.ln=lue,i.log=fue,i.log10=hue,i.log2=pue,i.max=due,i.min=mue,i.mod=gue,i.mul=vue,i.pow=yue,i.random=Sue,i.round=xue,i.sign=bue,i.sin=wue,i.sinh=Cue,i.sqrt=Eue,i.sub=Aue,i.sum=Nue,i.tan=Iue,i.tanh=Tue,i.trunc=Rue,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(TU,"clone");function aue(r,e){return new this(r).div(e)}o(aue,"div");function oue(r){return new this(r).exp()}o(oue,"exp");function uue(r){return It(r=new this(r),r.e+1,3)}o(uue,"floor");function cue(){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(cue,"hypot");function vU(r){return r instanceof Yg||r&&r.toStringTag===bU||!1}o(vU,"isDecimalInstance");function lue(r){return new this(r).ln()}o(lue,"ln");function fue(r,e){return new this(r).log(e)}o(fue,"log");function pue(r){return new this(r).log(2)}o(pue,"log2");function hue(r){return new this(r).log(10)}o(hue,"log10");function due(){return AU(this,arguments,-1)}o(due,"max");function mue(){return AU(this,arguments,1)}o(mue,"min");function gue(r,e){return new this(r).mod(e)}o(gue,"mod");function vue(r,e){return new this(r).mul(e)}o(vue,"mul");function yue(r,e){return new this(r).pow(e)}o(yue,"pow");function Sue(r){var e,t,n,i,s=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ra(r,1,Dp),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(xU);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],r%=Bt,n&&r&&(i=Bi(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(Sue,"random");function xue(r){return It(r=new this(r),r.e+1,this.rounding)}o(xue,"round");function bue(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(bue,"sign");function wue(r){return new this(r).sin()}o(wue,"sin");function Cue(r){return new this(r).sinh()}o(Cue,"sinh");function Eue(r){return new this(r).sqrt()}o(Eue,"sqrt");function Aue(r,e){return new this(r).sub(e)}o(Aue,"sub");function Nue(){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(Nue,"sum");function Iue(r){return new this(r).tan()}o(Iue,"tan");function Tue(r){return new this(r).tanh()}o(Tue,"tanh");function Rue(r){return It(r=new this(r),r.e+1,1)}o(Rue,"trunc");qe[Symbol.for("nodejs.util.inspect.custom")]=qe.toString;qe[Symbol.toStringTag]="Decimal";var Yg=qe.constructor=TU(bP);PN=new Yg(PN);BN=new Yg(BN);var Hs=class r extends Yg{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 jN=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 BB=Dr(require("fs"),1),nq=Dr(require("path"),1),am=Dr(require("crypto"),1),om=Dr(z6(),1);var Fn=class extends Error{static{o(this,"NFeTsError")}};var TB=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},y2=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Wi=o(r=>new TB(r),"left"),ai=o(r=>r===void 0?new y2(void 0):new y2(r),"right");var ppe=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),qp=o(r=>typeof r=="string"?Wi(new Fn(r)):r instanceof Error?Wi(new Fn(r.message,{cause:r.cause})):ppe(r)?Wi(new Fn(r.message)):Wi(new Fn("unexpected error")),"leftFromError");var S2=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 RB="http://www.w3.org/2000/09/xmldsig#",K6="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",DB=(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})({}),Fc=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),_B=(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 Hx={includeComments:!1,exclusive:!0};var sm=o(r=>{throw new Fn("Didn't expect to get here")},"unreachable");var zx=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Fc.SHA1,i=Hx){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=i}assemble(e,t,n){let i=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:RB},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:i}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:K6}},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:RB},...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 Fc.SHA256:return _B.SHA256;case Fc.SHA1:return _B.SHA1;default:return sm(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Fc.SHA256:return DB.RSA_SHA256;case Fc.SHA1:return DB.RSA_SHA1;default:return sm(this.algorithm)}}};var x2=class extends zx{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{privateKey:a,certificate:u}=n;if(!e[i])return Wi(new Fn(`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),ai(m)}ns(e,t){let n=e.$?.xmlns,{$:i,...s}=e[t],{xmlns:a,...u}=i??{};return{$:{xmlns:n,...u},...s}}};var rTe=require("reflect-metadata"),G6=require("class-validator");var QIe=require("reflect-metadata");var OB="__SkipValidation__";var $6=require("class-transformer");var b2=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&b2(t)},"clearEmptyValues"),w2=o((r,e,t={})=>{let n=(0,$6.plainToInstance)(e,r);return t.clearEmptyValues&&b2(n),n},"plainToInstance");var qo="__ValidateErrors__",X6=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(X6(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"),nr=o(r=>(e,t,n)=>{let i=n.value;n.value=function(...s){let a=Reflect.getMetadata(OB,this.constructor);if(Reflect.getMetadata(OB,this.constructor.prototype,t.toString())===!0||a===!0)return i?.apply(this,s);let[c,...l]=s,p=w2(c,r),m=(0,G6.validateSync)(p,{whitelist:!0});if(b2(p),m.length){let g=Reflect.getMetadata(qo,this)??[];Reflect.defineMetadata(qo,g.concat(X6(m,i?.name)),this)}return i?.apply(this,[p,...l])}},"Validates");var oTe=require("reflect-metadata");var W6=require("class-validator");var J6=o(r=>(e,t)=>{(0,W6.registerDecorator)({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Hs?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");var fTe=require("reflect-metadata"),PB=require("class-validator");var dv=Symbol("choice"),mv=o(r=>r==null||r==="","isEmpty"),Zr=o(r=>e=>{let{properties:t,required:n=!1,...i}=r,s=Reflect.getMetadata(dv,e)??[],a={properties:t,required:n};s.push(a),Reflect.defineMetadata(dv,s,e);for(let u of t)(0,PB.registerDecorator)({name:"choice",target:e,propertyName:u,options:i,validator:{validate(c,l){let p=l.object,m=l.property,g=Reflect.getMetadata(dv,e);if(!g)return!0;let S=g.find(v=>v.properties.includes(m));if(!S||mv(c))return!0;for(let v of S.properties){if(v===m)continue;let b=p[v];if(!mv(b))return!1}for(let v of g)if(v!==S)for(let b of v.properties){let x=p[b];if(!mv(x))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(dv,e);if(!l)return`${c.property} validation error`;let p=l.find(g=>g.properties.includes(c.property));if(!p)return`${c.property} validation error`;let m=c.object;for(let g of p.properties){let S=m[g];if(!mv(S)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of l)if(g!==p)for(let S of g.properties){let v=m[S];if(!mv(v))return`${c.property} cannot be set because ${S} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)(0,PB.registerDecorator)({name:"choiceGroupRequired",target:e,propertyName:u,options:{...i,always:!0},validator:{validate(c,l){let p=l.object,m=Reflect.getMetadata(dv,e);if(!m)return!0;let g=m.find(S=>S.properties.includes(l.property));if(!g?.required)return!0;for(let S of g.properties){let v=p[S];if(!mv(v))return!0}return l.property!==g.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(dv,e);if(!l)return"At least one property from a choice group must be provided";let p=l.find(m=>m.properties.includes(c.property));return p?`You must provide a value for one of the following properties: ${p.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");var dTe=require("reflect-metadata");var Q6=require("class-transformer");var Se=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{J6(e)(t,n),(0,Q6.Transform)(({value:i})=>Hs.newOrUndefined(i)?.toFixed(r))(t,n)},"TransformDecimal");var tq=require("class-transformer"),rq=require("class-validator");var C2=Dr(require("dayjs"),1),Y6=Dr(require("dayjs/plugin/utc"),1),Z6=Dr(require("dayjs/plugin/timezone"),1);C2.default.extend(Y6.default);C2.default.extend(Z6.default);var eq=C2.default;var Hp=o((r={})=>(e,t)=>{(0,tq.Transform)(({value:n})=>{let i=n instanceof Date?n.toISOString():n;return i?eq(i).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),(0,rq.IsDateString)()(e,t)},"TransformDateString");var E2=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
|
|
90
|
-
`).reduce((s,a)=>{let[u,c]=a.split("=").map(l=>l.trim());return!u||!c?s:s.set(u,c)},new Map),i=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:i,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),i=t.indexOf(n);if(i===-1)return;let s=[t.subarray(0,i),t.subarray(i)];if(s.length<=1)return;let u=s[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let l=Buffer.concat([c,n,s[1]]),p=this.length(l),m=n.length,g=l.subarray(2+m,2+m+p),S=g.length-c.length-2;if(S<=0||S>g.length)return;let b=g.subarray(-S).toString("utf8");return b.substring(Buffer.from(b).findIndex((x,E)=>b.charCodeAt(E)>=32&&b.charCodeAt(E)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((i,s)=>{let a=this.base128(i,Number.parseInt(s,10),!0);return i.length=0,i.push(...a),i},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let i=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,i.push(...a)}let s=t%128;return n?i.push(s):i.push(128|s),i}};var A2=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new S2){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=om.default.asn1.fromDer(n.value.toString("binary")),s=om.default.pkcs12.pkcs12FromAsn1(i,t),{certBag:a,pkcs8ShroudedKeyBag:u}=om.default.pki.oids,c=s.getBags({bagType:a}),l=s.getBags({bagType:u}),p=c[a];if(!p?.length)return Wi(new Fn("Cannot read certificate"));let[{cert:m},...g]=p;if(!m)return Wi(new Fn("Issuer Certificate not found"));let S=l[u]?.[0].key;if(!S)return Wi(new Fn("Certificate Private Key not found"));let v=g.reduce((w,{cert:C})=>(C&&w.push(new am.default.X509Certificate(om.default.pki.certificateToPem(C))),w),[]),b=om.default.pki.privateKeyToPem(S),x=om.default.pki.certificateToPem(m),E=am.default.createPrivateKey(b),N=new am.default.X509Certificate(x);return ai({ca:v,password:t,privateKey:E,certificate:N})}catch(t){return qp(t)}}async sign(e,t,n=Fc.SHA1){try{let s=am.default.sign(n,Buffer.from(e),{key:t,padding:am.default.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(ai(s))}catch(i){return Promise.resolve(qp(i))}}getCertificateInfo(e){return new E2().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new Fn("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 ai(s);if(nq.default.isAbsolute(t)||BB.default.existsSync(t))return this.hitBufferOnCache(i,BB.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 qp(a)}return this.hitBufferOnCache(i,Buffer.from(t,"base64"))}getCacheKey(e,t){return am.default.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),ai(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var cX=require("crypto"),kL=require("https"),lX=Dr(uX(),1);var rT=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:cX.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new kL.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return new kL.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,lX.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 ai(c)}catch(t){return qp(t)}}};var iT=require("os"),Qo=require("path"),jb=require("fs");var jL=require("path"),VL=require("module"),nT=require("url");var Uxe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jv,fX=o(()=>{if(Jv!==void 0)return Jv;if(Uxe){Jv=void 0;return}try{Jv=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jv=void 0}return Jv},"getImportMetaUrl"),pX=o(()=>{if(typeof require<"u")return require;let r=fX();if(r)return(0,VL.createRequire)(r);let e=(0,nT.pathToFileURL)((0,jL.resolve)(process.cwd(),"package.json")).href;return(0,VL.createRequire)(e)},"getRequireFn"),hX=o(()=>{if(typeof __filename<"u")return __filename;let r=fX();return r?(0,nT.fileURLToPath)(r):(0,jL.resolve)(process.cwd())},"getCurrentFile");var Vb=o(r=>pX()(r),"exportRequireModule"),dX=o(r=>{
|
|
90
|
+
`).reduce((s,a)=>{let[u,c]=a.split("=").map(l=>l.trim());return!u||!c?s:s.set(u,c)},new Map),i=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:i,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),i=t.indexOf(n);if(i===-1)return;let s=[t.subarray(0,i),t.subarray(i)];if(s.length<=1)return;let u=s[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let l=Buffer.concat([c,n,s[1]]),p=this.length(l),m=n.length,g=l.subarray(2+m,2+m+p),S=g.length-c.length-2;if(S<=0||S>g.length)return;let b=g.subarray(-S).toString("utf8");return b.substring(Buffer.from(b).findIndex((x,E)=>b.charCodeAt(E)>=32&&b.charCodeAt(E)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((i,s)=>{let a=this.base128(i,Number.parseInt(s,10),!0);return i.length=0,i.push(...a),i},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let i=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,i.push(...a)}let s=t%128;return n?i.push(s):i.push(128|s),i}};var A2=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new S2){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=om.default.asn1.fromDer(n.value.toString("binary")),s=om.default.pkcs12.pkcs12FromAsn1(i,t),{certBag:a,pkcs8ShroudedKeyBag:u}=om.default.pki.oids,c=s.getBags({bagType:a}),l=s.getBags({bagType:u}),p=c[a];if(!p?.length)return Wi(new Fn("Cannot read certificate"));let[{cert:m},...g]=p;if(!m)return Wi(new Fn("Issuer Certificate not found"));let S=l[u]?.[0].key;if(!S)return Wi(new Fn("Certificate Private Key not found"));let v=g.reduce((w,{cert:C})=>(C&&w.push(new am.default.X509Certificate(om.default.pki.certificateToPem(C))),w),[]),b=om.default.pki.privateKeyToPem(S),x=om.default.pki.certificateToPem(m),E=am.default.createPrivateKey(b),N=new am.default.X509Certificate(x);return ai({ca:v,password:t,privateKey:E,certificate:N})}catch(t){return qp(t)}}async sign(e,t,n=Fc.SHA1){try{let s=am.default.sign(n,Buffer.from(e),{key:t,padding:am.default.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(ai(s))}catch(i){return Promise.resolve(qp(i))}}getCertificateInfo(e){return new E2().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new Fn("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 ai(s);if(nq.default.isAbsolute(t)||BB.default.existsSync(t))return this.hitBufferOnCache(i,BB.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 qp(a)}return this.hitBufferOnCache(i,Buffer.from(t,"base64"))}getCacheKey(e,t){return am.default.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),ai(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var cX=require("crypto"),kL=require("https"),lX=Dr(uX(),1);var rT=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:cX.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new kL.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return new kL.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,lX.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 ai(c)}catch(t){return qp(t)}}};var iT=require("os"),Qo=require("path"),jb=require("fs");var jL=require("path"),VL=require("module"),nT=require("url");var Uxe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jv,fX=o(()=>{if(Jv!==void 0)return Jv;if(Uxe){Jv=void 0;return}try{Jv=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jv=void 0}return Jv},"getImportMetaUrl"),pX=o(()=>{if(typeof require<"u")return require;let r=fX();if(r)return(0,VL.createRequire)(r);let e=(0,nT.pathToFileURL)((0,jL.resolve)(process.cwd(),"package.json")).href;return(0,VL.createRequire)(e)},"getRequireFn"),hX=o(()=>{if(typeof __filename<"u")return __filename;let r=fX();return r?(0,nT.fileURLToPath)(r):(0,jL.resolve)(process.cwd())},"getCurrentFile");var Vb=o(r=>pX()(r),"exportRequireModule"),dX=o(r=>{r=`${r}.node`;let e=`${(0,iT.platform)()}-${(0,iT.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return Vb((0,Qo.join)(process.env.NFETS_ADDONS_DIR,r));let t=hX(),n=(0,Qo.resolve)(t,"../../../../"),i=(0,Qo.join)(n,"build","addons",e,r);if((0,jb.existsSync)(i))return Vb(i);let s=t;for(let a=0;a<5;a++){let u=(0,Qo.join)(s,"build","addons",e,r);if((0,jb.existsSync)(u))return Vb(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,jb.existsSync)(u))return Vb(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,jb.existsSync)(u))return Vb(u);let c=(0,Qo.dirname)(s);if(c===s)break;s=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var Mxe=dX("xml_validator"),mX=Mxe;var NY=Dr(require("crypto"),1),FEe=Dr(kW(),1);var VW="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 qxe(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(qxe,"SelectNodesEx");function Hxe(r,e){let t=Qv("xpath").select;return t(e,r)}o(Hxe,"SelectNodesNode");var jW=typeof self<"u"?qxe:Hxe;function Yo(r){r=r.replace(/\r\n/g,`
|
|
91
91
|
`).replace(/\r/g,`
|
|
92
92
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Qv("DOMParser"),new e().parseFromString(r,VW)}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 xT(r,e){let t=jW(r,e);return t&&t.length>0?t[0]:null}o(xT,"SelectSingleNode");function UW(r,e){return r&&r.nodeType===e}o(UW,"isNodeType");function mo(r){return UW(r,ir.Element)}o(mo,"isElement");function Cm(r){return UW(r,ir.Document)}o(Cm,"isDocument");var MW=new Map;function qW(r){for(let e in r)MW.set(e,r[e])}o(qW,"setNodeDependencies");function Qv(r){let e=MW.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",Hb="attribute",bT="content";var zxe=1e9;function JL(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(JL,"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=JL({},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=JL({},n.items)),n.target=e;let s;r.parser?s={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||zxe,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},zW(e,i,r)}}o(hr,"XmlChildElement");function Sn(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=JL({},n.items)),n.target=e;let s=n.items;s[t]=r,s[t].type=Hb,zW(e,i,r)}}o(Sn,"XmlAttribute");function zW(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(zW,"defineProperty");var vh=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 Kxe(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(Kxe,"printf");function $xe(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o($xe,"padNum");var Qe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=Kxe(xi[e],...t);this.message=`${this.prefix}${$xe(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 Gxe="xml_root",Ma=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 Cm(e)&&(n=e.getElementById(t)),n==null&&(n=xT(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=xT(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=xT(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=Gxe,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=Cm(e)?e.documentElement:e;let i=[];for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];mo(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&i.push(a)}return i}static GetFirstChild(e,t,n){e=Cm(e)?e.documentElement:e;for(let i=0;i<e.childNodes.length;i++){let s=e.childNodes[i];if(mo(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(mo(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 bT:{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 Hb:{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 S of g){let v=S instanceof r?S.GetXml(!0):S;v!==null&&m&&m.appendChild(v)}else if(g instanceof r){let S=g.GetXml(!0);S&&m&&m.appendChild(S)}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);mo(x)&&g.push(x)}let S=p.minOccurs||0,v=p.maxOccurs||1/0;if(g.length<S||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 bT:{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 Hb:{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(!mo(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 Ma{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 vh(this.GetIterator().map(e))}Filter(e){return new vh(this.GetIterator().filter(e))}Sort(e){return new vh(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(!(mo(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 vh{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 Xxe="[object ArrayBuffer]",At=class ZL{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===Xxe}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=ZL.toUint8Array(e),i=ZL.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}},YL="string",Wxe=/^[0-9a-f\s]+$/i,Jxe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Qxe=/^[a-zA-Z0-9-_]+$/,KW=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===YL&&Wxe.test(e)}static isBase64(e){return typeof e===YL&&Jxe.test(e)}static isBase64Url(e){return typeof e===YL&&Qxe.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 KW.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 KW.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 wT(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(wT,"bufferToHexCodes");function of(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(of,"utilFromBase");function Bu(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(Bu,"utilToBase");function Em(...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(Em,"utilConcatBuf");function CT(...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(CT,"utilConcatView");function eF(){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=of(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,of(s,8)-n}o(eF,"utilDecodeTC");function GW(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=Bu(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let i=Bu(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(GW,"utilEncodeTC");function yh(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(yh,"isEqualBuffer");function qa(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(qa,"padNumber");var XW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",WW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function ET(r,e=!1,t=!1,n=!1){let i=0,s=0,a=0,u="",c=e?WW:XW;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,S=(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(S)}`:b===64?u+=`${c.charAt(g)}${c.charAt(S)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(S)}${c.charAt(v)}${c.charAt(b)}`:u+=`${c.charAt(g)}${c.charAt(S)}${c.charAt(v)}${c.charAt(b)}`}return u}o(ET,"toBase64");function ty(r,e=!1,t=!1){let n=e?WW:XW;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,S=(s(l)&15)<<4|s(p)>>2,v=(s(p)&3)<<6|s(m);u+=String.fromCharCode(g),p!==64&&(u+=String.fromCharCode(S)),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 Kb(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(Kb,"arrayBufferToString");function Am(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(Am,"stringToArrayBuffer");var Yxe=Math.log(2);function JW(r){let e=Math.log(r)/Yxe,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(JW,"nearestPowerOf2");function je(r,e){for(let t of e)delete r[t]}o(je,"clearProps");function AT(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(AT,"assertBigInt");function iF(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(iF,"concat");function uf(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(uf,"checkBufferParams");var sF=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return iF(this.items)}},$b=[new Uint8Array([1])],YW="0123456789",tF="name",ZW="valueHexView",Zxe="isHexOnly",ebe="idBlock",tbe="tagClass",rbe="tagNumber",nbe="isConstructed",ibe="fromBER",sbe="toBER",abe="local",Ha="",Lu=new ArrayBuffer(0),NT=new Uint8Array(0),Xb="EndOfContent",tJ="OCTET STRING",rJ="BIT STRING";function cf(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):NT}fromBER(n,i,s){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!uf(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",Lu)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Ft.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(cf,"HexBlock");var Nm=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=Ha,warnings:n=[],valueBeforeDecode:i=NT}={}){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)}}};Nm.NAME="baseBlock";var za=class extends Nm{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'")}};za.NAME="valueBlock";var nJ=class extends cf(Nm){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):NT,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",Lu}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=Bu(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(!uf(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 S=0;S<l.length;S++)g[S]=l[S];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=of(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}}};nJ.NAME="identificationBlock";var iJ=class extends Nm{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(!uf(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=of(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=Bu(this.length,8);if(i.byteLength>127)return this.error="Too big length",Lu;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}}};iJ.NAME="lengthBlock";var yt={},ga=class extends Nm{static{o(this,"BaseBlock")}constructor({name:e=Ha,optional:t=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new nJ(i),this.lenBlock=new iJ(i),this.valueBlock=s?new s(i):new za(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 sF;t||sJ(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?Lu: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 yh(t,n)}};ga.NAME="BaseBlock";function sJ(r){var e;if(r instanceof yt.Constructed)for(let t of r.valueBlock.value)sJ(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(sJ,"prepareIndefiniteForm");var aJ=class extends ga{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Ha,...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}'`}};aJ.NAME="BaseStringBlock";var oJ=class extends cf(za){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};oJ.NAME="PrimitiveValueBlock";var uJ,Tt=class extends ga{static{o(this,"Primitive")}constructor(e={}){super(e,oJ),this.idBlock.isConstructed=!1}};uJ=Tt;yt.Primitive=uJ;Tt.NAME="PRIMITIVE";function obe(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(obe,"localChangeType");function Wb(r,e=0,t=r.length){let n=e,i=new ga({},za),s=new Nm;if(!uf(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=obe(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(Wb,"localFromBER");function Jn(r){if(!r.byteLength){let e=new ga({},za);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Wb(At.toUint8Array(r).slice(),0,r.byteLength)}o(Jn,"fromBER");function ube(r,e){return r?1:e}o(ube,"checkLen");var Sh=class extends za{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(!uf(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(;ube(this.isIndefiniteForm,n)>0;){let a=Wb(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===Xb)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Xb?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new sF;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?Lu:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Sh.NAME="ConstructedValueBlock";var cJ,me=class extends ga{static{o(this,"Constructed")}constructor(e={}){super(e,Sh),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(`
|
|
93
93
|
`).map(i=>` ${i}`).join(`
|
package/dist/nfe/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-DQH2ISYK.mjs";import"../chunk-IURMCRIH.mjs";import"../chunk-W6MRGYXP.mjs";export{c as AccessKeyBuilder,d as DefaultDetBuilderAggregator,e as DefaultTotalBuilderAggregator,i as NFCeDto,f as NFeDto,k as NfceQrcode,j as NfceRemoteTransmitter,n as NfceXmlBuilder,h as NfeAuthorizerPipeline,l as NfeDetXmlBuilder,g as NfeRemoteTransmitter,m as NfeXmlBuilder,a as TpEmis,b as directory};
|