nfets 0.0.119 → 0.0.121

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.
@@ -106,7 +106,7 @@ ${e.join(`
106
106
  `):this.result.push("-->"))}WriteTextNode(e){this.result.push(this.NormalizeString(e.nodeValue,e.nodeType))}WriteProcessingInstructionNode(e){let t=e.nodeName||e.tagName;t!=="xml"&&(this.state===Ks.AfterDocElement?this.result.push(`
107
107
  <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,xt.ProcessingInstruction))),this.state===Ks.BeforeDocElement?this.result.push(`?>
108
108
  `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===Ks.BeforeDocElement&&(this.state=Ks.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===Ks.BeforeDocElement&&(this.state=Ks.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!J_(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let f={prefix:a.prefix,namespace:a.namespaceURI};t.push(f),this.visibleNamespaces.Add(f),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let f={prefix:a.prefix,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}let u=null,c;(c=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=c[1]);let l=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let f=gH(e,u);if(f>1)l=!1;else if(f===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&l){let f={prefix:u,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(hhe);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];J_(s)||t.push(s)}t.sort(phe),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,xt.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===xt.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===xt.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===xt.Attribute?n.push("&quot;"):i===" "&&t===xt.Attribute?n.push("&#x9;"):i===`
109
- `&&t===xt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case xt.Text:case xt.CDATA:case xt.SignificantWhitespace:case xt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function hhe(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(hhe,"XmlDsigC14NTransformNamespacesComparer");function phe(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(phe,"XmlDsigC14NTransformAttributesComparer");function gH(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!J_(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===xt.Element){let a=gH(s,e,t);if(s.nodeType===xt.Element&&a)return++t+a}return t}o(gH,"IsNamespaceUsed");function J_(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===xt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(J_,"IsNamespaceNode");var VA=class extends mi{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==xt.Element||n.nodeName===fe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case fe.ElementNames.RSAPSSParams:s=$i;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};VA=Fe([Et({localName:"Other"})],VA);var Ia=class extends Br{static{o(this,"SignatureMethod")}};Fe([wr({localName:fe.AttributeNames.Algorithm,required:!0,defaultValue:""}),Ye("design:type",String)],Ia.prototype,"Algorithm",void 0);Fe([Dt({localName:fe.ElementNames.HMACOutputLength,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,converter:Yg}),Ye("design:type",Number)],Ia.prototype,"HMACOutputLength",void 0);Fe([Dt({parser:VA,noRoot:!0,minOccurs:0}),Ye("design:type",VA)],Ia.prototype,"Any",void 0);Ia=Fe([Et({localName:fe.ElementNames.SignatureMethod})],Ia);var Mm=class extends Br{static{o(this,"CanonicalizationMethod")}};Fe([wr({localName:fe.AttributeNames.Algorithm,required:!0,defaultValue:fe.DefaultCanonMethod}),Ye("design:type",String)],Mm.prototype,"Algorithm",void 0);Mm=Fe([Et({localName:fe.ElementNames.CanonicalizationMethod})],Mm);var jm=class extends Br{static{o(this,"DataObject")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],jm.prototype,"Id",void 0);Fe([wr({localName:fe.AttributeNames.MimeType,defaultValue:""}),Ye("design:type",String)],jm.prototype,"MimeType",void 0);Fe([wr({localName:fe.AttributeNames.Encoding,defaultValue:""}),Ye("design:type",String)],jm.prototype,"Encoding",void 0);jm=Fe([Et({localName:fe.ElementNames.Object})],jm);var ox=class extends mi{static{o(this,"DataObjects")}};ox=Fe([Et({localName:"xmldsig_objects",parser:jm})],ox);var zn=class extends Br{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new _e(we.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new _e(we.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Fe([wr({localName:fe.AttributeNames.Algorithm,defaultValue:""}),Ye("design:type",String)],zn.prototype,"Algorithm",void 0);Fe([Dt({localName:fe.ElementNames.XPath,defaultValue:""}),Ye("design:type",String)],zn.prototype,"XPath",void 0);zn=Fe([Et({localName:fe.ElementNames.Transform})],zn);var Oo=class extends zn{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=fe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return ir.FromString(this.innerXml.textContent||"","base64")}};var Da=class extends zn{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Ta(!1,!1)}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Ba=class extends Da{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Ta(!0,!1)}};var Po=class extends zn{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)Vs(e)&&e.localName===fe.ElementNames.Signature&&e.namespaceURI===fe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var Ra=class extends zn{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Ta(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},_a=class extends Ra{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Ta(!0,!0)}};function yH(r){return r.parentNode?yH(r.parentNode):r}o(yH,"lookupParentNode");var qm=class extends zn{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=fe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");this.Filter(yH(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Ap("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Ap("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(l=>i.lookupNamespaceURI(l),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Fe([Dt({localName:fe.ElementNames.XPath,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],qm.prototype,"XPath",void 0);var Hm=class extends mi{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return sh(t,Po);case fe.AlgorithmNamespaces.XmlDsigC14NTransform:return sh(t,Da);case fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return sh(t,Ba);case fe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return sh(t,Ra);case fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return sh(t,_a);case fe.AlgorithmNamespaces.XmlDsigBase64Transform:return sh(t,Oo);case fe.AlgorithmNamespaces.XmlDsigXPathTransform:return sh(t,qm);default:try{let n=ux.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new _e(we.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};Hm=Fe([Et({localName:fe.ElementNames.Transforms,parser:zn})],Hm);function sh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(sh,"ChangeTransform");var Oa=class extends Br{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new gi,e&&(this.Uri=e)}};Fe([wr({defaultValue:""}),Ye("design:type",String)],Oa.prototype,"Id",void 0);Fe([wr({localName:fe.AttributeNames.URI}),Ye("design:type",String)],Oa.prototype,"Uri",void 0);Fe([wr({localName:fe.AttributeNames.Type,defaultValue:""}),Ye("design:type",String)],Oa.prototype,"Type",void 0);Fe([Dt({parser:Hm}),Ye("design:type",Hm)],Oa.prototype,"Transforms",void 0);Fe([Dt({required:!0,parser:gi}),Ye("design:type",gi)],Oa.prototype,"DigestMethod",void 0);Fe([Dt({required:!0,localName:fe.ElementNames.DigestValue,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,converter:oi}),Ye("design:type",Uint8Array)],Oa.prototype,"DigestValue",void 0);Oa=Fe([Et({localName:fe.ElementNames.Reference}),Ye("design:paramtypes",[String])],Oa);var Km=class extends mi{static{o(this,"References")}};Km=Fe([Et({localName:"References",parser:Oa})],Km);var ko=class extends Br{static{o(this,"SignedInfo")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],ko.prototype,"Id",void 0);Fe([Dt({parser:Mm,required:!0}),Ye("design:type",Mm)],ko.prototype,"CanonicalizationMethod",void 0);Fe([Dt({parser:Ia,required:!0}),Ye("design:type",Ia)],ko.prototype,"SignatureMethod",void 0);Fe([Dt({parser:Km,minOccurs:1,noRoot:!0}),Ye("design:type",Km)],ko.prototype,"References",void 0);ko=Fe([Et({localName:fe.ElementNames.SignedInfo})],ko);var zm="http://www.w3.org/2001/04/xmldsig-more#",Wm="ecdsa",ih=class extends ws{static{o(this,"EcdsaPublicKey")}};Fe([Dt({localName:fe.ElementNames.X,namespaceURI:zm,prefix:Wm,required:!0,converter:oi}),Ye("design:type",Uint8Array)],ih.prototype,"X",void 0);Fe([Dt({localName:fe.ElementNames.Y,namespaceURI:zm,prefix:Wm,required:!0,converter:oi}),Ye("design:type",Uint8Array)],ih.prototype,"Y",void 0);ih=Fe([Et({localName:fe.ElementNames.PublicKey,namespaceURI:zm,prefix:Wm})],ih);var $m=class extends ws{static{o(this,"NamedCurve")}};Fe([wr({localName:fe.AttributeNames.URI,required:!0}),Ye("design:type",String)],$m.prototype,"Uri",void 0);$m=Fe([Et({localName:fe.ElementNames.NamedCurve,namespaceURI:zm,prefix:Wm})],$m);var Xm=class extends ws{static{o(this,"DomainParameters")}};Fe([Dt({parser:$m}),Ye("design:type",$m)],Xm.prototype,"NamedCurve",void 0);Xm=Fe([Et({localName:fe.ElementNames.DomainParameters,namespaceURI:zm,prefix:Wm})],Xm);var Gm=class extends Hs{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=fe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ro.toUpperCase()}get NamedCurve(){return xH(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new _e(we.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await rn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new ih,this.PublicKey.X=ir.FromString(t.x||"","base64url"),this.PublicKey.Y=ir.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new Xm),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new $m),this.DomainParameters.NamedCurve.Uri=xH(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=ir.ToBase64Url(this.PublicKey.X),n=ir.ToBase64Url(this.PublicKey.Y),s=dhe(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await rn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Fe([Dt({parser:Xm}),Ye("design:type",Xm)],Gm.prototype,"DomainParameters",void 0);Fe([Dt({parser:ih,required:!0}),Ye("design:type",ih)],Gm.prototype,"PublicKey",void 0);Gm=Fe([Et({localName:fe.ElementNames.ECDSAKeyValue,namespaceURI:zm,prefix:Wm})],Gm);function xH(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new _e(we.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(xH,"GetNamedCurveOid");function dhe(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new _e(we.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(dhe,"GetNamedCurveFromOid");var mhe=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},kc=new mhe;kc.set(fe.ElementNames.RSAKeyValue,Fm);kc.set(fe.ElementNames.ECDSAKeyValue,Gm);var MA=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=kc.get(e);if(!t)throw new _e(we.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var cx=class extends Hs{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of kc)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new _e(we.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new _e(we.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(Vs(n))try{let s=n.localName,i=MA.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new _e(we.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};cx=Fe([Et({localName:fe.ElementNames.KeyValue}),Ye("design:paramtypes",[Hs])],cx);var ghe={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},Jm=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return rn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===Ro){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=ghe[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Or(this.raw.buffer);this.simpl=new Gn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var jA=class extends Br{static{o(this,"X509IssuerSerial")}};Fe([Dt({localName:fe.ElementNames.X509IssuerName,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],jA.prototype,"X509IssuerName",void 0);Fe([Dt({localName:fe.ElementNames.X509SerialNumber,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],jA.prototype,"X509SerialNumber",void 0);jA=Fe([Et({localName:fe.ElementNames.X509IssuerSerial})],jA);var ah;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(ah||(ah={}));var Ym=class extends Hs{static{o(this,"KeyInfoX509Data")}constructor(e,t=ah.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new Jm(e));else if(e instanceof Jm)switch(t){case ah.None:case ah.EndCertOnly:this.AddCertificate(e);break;case ah.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case ah.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new _e(we.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new _e(we.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new _e(we.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new _e(we.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=ir.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509IssuerSerial),a=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SKI);i.textContent=ir.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509Certificate);i.textContent=ir.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509CRL);s.textContent=ir.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(fe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Br.GetChild(s,fe.ElementNames.X509IssuerName,fe.NamespaceURI,!0),a=Br.GetChild(s,fe.ElementNames.X509SerialNumber,fe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(fe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=ir.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(fe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(fe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=ir.FromBase64(s.textContent);this.AddCertificate(new Jm(i))}});let n=this.GetChild(fe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=ir.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};Ym=Fe([Et({localName:fe.ElementNames.X509Data}),Ye("design:paramtypes",[Object,Object])],Ym);var lx=class extends Hs{static{o(this,"SPKIData")}async importKey(e){let t=await rn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await rn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Fe([Dt({localName:fe.ElementNames.SPKIexp,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0,converter:oi}),Ye("design:type",Object)],lx.prototype,"SPKIexp",void 0);lx=Fe([Et({localName:fe.ElementNames.SPKIData})],lx);var oh=class extends mi{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==xt.Element)continue;let s=null;switch(n.localName){case fe.ElementNames.KeyValue:s=cx;break;case fe.ElementNames.X509Data:s=Ym;break;case fe.ElementNames.SPKIData:s=lx;break;case fe.ElementNames.KeyName:case fe.ElementNames.RetrievalMethod:case fe.ElementNames.PGPData:case fe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],oh.prototype,"Id",void 0);oh=Fe([Et({localName:fe.ElementNames.KeyInfo})],oh);var Lc=class extends Br{static{o(this,"Signature")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],Lc.prototype,"Id",void 0);Fe([Dt({parser:ko,required:!0}),Ye("design:type",ko)],Lc.prototype,"SignedInfo",void 0);Fe([Dt({localName:fe.ElementNames.SignatureValue,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0,converter:oi,defaultValue:null}),Ye("design:type",Object)],Lc.prototype,"SignatureValue",void 0);Fe([Dt({parser:oh}),Ye("design:type",oh)],Lc.prototype,"KeyInfo",void 0);Fe([Dt({parser:ox,noRoot:!0}),Ye("design:type",ox)],Lc.prototype,"ObjectList",void 0);Lc=Fe([Et({localName:fe.ElementNames.Signature})],Lc);var vhe=class extends Map{static{o(this,"AlgorithmRegistry")}},Lt=new vhe;Lt.set(DA,{type:"signature",algorithm:Om});Lt.set(BA,{type:"signature",algorithm:Pm});Lt.set(RA,{type:"signature",algorithm:km});Lt.set(_A,{type:"signature",algorithm:Lm});Lt.set(DA,{type:"signature",algorithm:Om});Lt.set(BA,{type:"signature",algorithm:Pm});Lt.set(RA,{type:"signature",algorithm:km});Lt.set(_A,{type:"signature",algorithm:Lm});Lt.set($_,{type:"signature",algorithm:PA});Lt.set(X_,{type:"signature",algorithm:kA});Lt.set(G_,{type:"signature",algorithm:LA});Lt.set(z_,{type:"signature",algorithm:FA});Lt.set(W_,{type:"signature",algorithm:UA});Lt.set(SA,{type:"signature",algorithm:Im});Lt.set(AA,{type:"signature",algorithm:Dm});Lt.set(CA,{type:"signature",algorithm:Bm});Lt.set(NA,{type:"signature",algorithm:Rm});Lt.set(SA.toUpperCase(),{type:"signature",algorithm:Im});Lt.set(AA.toUpperCase(),{type:"signature",algorithm:Dm});Lt.set(CA.toUpperCase(),{type:"signature",algorithm:Bm});Lt.set(NA.toUpperCase(),{type:"signature",algorithm:Rm});Lt.set(V_,{type:"signature",algorithm:nx});Lt.set(M_,{type:"signature",algorithm:sx});Lt.set(j_,{type:"signature",algorithm:ix});Lt.set(q_,{type:"signature",algorithm:ax});Lt.set(Am,{type:"hash",algorithm:EA});Lt.set(Cm,{type:"hash",algorithm:rx});Lt.set(Nm,{type:"hash",algorithm:wA});Lt.set(Tm,{type:"hash",algorithm:bA});var uh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Lt)if(n==="hash"&&t===e)return new s;throw new _e(we.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Lt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Lt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Lt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.name)}};var xhe=class extends Map{static{o(this,"TransformRegistry")}},Lo=new xhe;Lo.set(fe.AlgorithmNamespaces.XmlDsigBase64Transform,Oo);Lo.set(fe.AlgorithmNamespaces.XmlDsigC14NTransform,Da);Lo.set(fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Ba);Lo.set(fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Po);Lo.set(fe.AlgorithmNamespaces.XmlDsigExcC14NTransform,Ra);Lo.set(fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,_a);var ux=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new _e(we.PARAM_REQUIRED,"name");let t=Lo.get(e);if(t)return new t;let n;switch(e){case fe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Oo;break;case fe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new Da;break;case fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Ba;break;case fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Po;break;case fe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);case fe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);case fe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new Ra;break;case fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new _a;break;case fe.AlgorithmNamespaces.XmlDecryptionTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);default:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return uh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return uh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return uh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),uh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Ia;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Lt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Lt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){kc.set(e,t)}static RegisterTransform(e,t){Lo.set(e,t)}};var ph=Rt(IK(),1);var DK={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var BK={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var gO=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=hde){this.xml2js=e,U9({XMLSerializer:ph.default.XMLSerializer,DOMParser:ph.default.DOMParser,DOMImplementation:ph.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return nr(new Vt("Please provide a valid xml content"));if(!t||t.trim().length===0)return nr(new Vt("Please provide a valid existing xsd path"));try{return await lj.validate(e,t),Qr()}catch(n){return us(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...BK,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...DK,...t}).buildObject(e))}digest(e,t,n=E0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=E0){let n=new ph.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Ta(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new Vt(`No element found with tag "${t}" to insert before`);let u=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(u,a),this.clear(this.serializeXml(s))}hash(e,t){return RK.default.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new ph.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new Vt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new ph.default.XMLSerializer().serializeToString(e)}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
109
+ `&&t===xt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case xt.Text:case xt.CDATA:case xt.SignificantWhitespace:case xt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function hhe(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(hhe,"XmlDsigC14NTransformNamespacesComparer");function phe(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(phe,"XmlDsigC14NTransformAttributesComparer");function gH(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!J_(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===xt.Element){let a=gH(s,e,t);if(s.nodeType===xt.Element&&a)return++t+a}return t}o(gH,"IsNamespaceUsed");function J_(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===xt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(J_,"IsNamespaceNode");var VA=class extends mi{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==xt.Element||n.nodeName===fe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case fe.ElementNames.RSAPSSParams:s=$i;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};VA=Fe([Et({localName:"Other"})],VA);var Ia=class extends Br{static{o(this,"SignatureMethod")}};Fe([wr({localName:fe.AttributeNames.Algorithm,required:!0,defaultValue:""}),Ye("design:type",String)],Ia.prototype,"Algorithm",void 0);Fe([Dt({localName:fe.ElementNames.HMACOutputLength,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,converter:Yg}),Ye("design:type",Number)],Ia.prototype,"HMACOutputLength",void 0);Fe([Dt({parser:VA,noRoot:!0,minOccurs:0}),Ye("design:type",VA)],Ia.prototype,"Any",void 0);Ia=Fe([Et({localName:fe.ElementNames.SignatureMethod})],Ia);var Mm=class extends Br{static{o(this,"CanonicalizationMethod")}};Fe([wr({localName:fe.AttributeNames.Algorithm,required:!0,defaultValue:fe.DefaultCanonMethod}),Ye("design:type",String)],Mm.prototype,"Algorithm",void 0);Mm=Fe([Et({localName:fe.ElementNames.CanonicalizationMethod})],Mm);var jm=class extends Br{static{o(this,"DataObject")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],jm.prototype,"Id",void 0);Fe([wr({localName:fe.AttributeNames.MimeType,defaultValue:""}),Ye("design:type",String)],jm.prototype,"MimeType",void 0);Fe([wr({localName:fe.AttributeNames.Encoding,defaultValue:""}),Ye("design:type",String)],jm.prototype,"Encoding",void 0);jm=Fe([Et({localName:fe.ElementNames.Object})],jm);var ox=class extends mi{static{o(this,"DataObjects")}};ox=Fe([Et({localName:"xmldsig_objects",parser:jm})],ox);var zn=class extends Br{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new _e(we.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new _e(we.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Fe([wr({localName:fe.AttributeNames.Algorithm,defaultValue:""}),Ye("design:type",String)],zn.prototype,"Algorithm",void 0);Fe([Dt({localName:fe.ElementNames.XPath,defaultValue:""}),Ye("design:type",String)],zn.prototype,"XPath",void 0);zn=Fe([Et({localName:fe.ElementNames.Transform})],zn);var Oo=class extends zn{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=fe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return ir.FromString(this.innerXml.textContent||"","base64")}};var Da=class extends zn{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Ta(!1,!1)}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Ba=class extends Da{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Ta(!0,!1)}};var Po=class extends zn{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)Vs(e)&&e.localName===fe.ElementNames.Signature&&e.namespaceURI===fe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var Ra=class extends zn{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Ta(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},_a=class extends Ra{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Ta(!0,!0)}};function yH(r){return r.parentNode?yH(r.parentNode):r}o(yH,"lookupParentNode");var qm=class extends zn{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=fe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new _e(we.PARAM_REQUIRED,"innerXml");this.Filter(yH(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Ap("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Ap("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(l=>i.lookupNamespaceURI(l),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Fe([Dt({localName:fe.ElementNames.XPath,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],qm.prototype,"XPath",void 0);var Hm=class extends mi{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return sh(t,Po);case fe.AlgorithmNamespaces.XmlDsigC14NTransform:return sh(t,Da);case fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return sh(t,Ba);case fe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return sh(t,Ra);case fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return sh(t,_a);case fe.AlgorithmNamespaces.XmlDsigBase64Transform:return sh(t,Oo);case fe.AlgorithmNamespaces.XmlDsigXPathTransform:return sh(t,qm);default:try{let n=ux.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new _e(we.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};Hm=Fe([Et({localName:fe.ElementNames.Transforms,parser:zn})],Hm);function sh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(sh,"ChangeTransform");var Oa=class extends Br{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new gi,e&&(this.Uri=e)}};Fe([wr({defaultValue:""}),Ye("design:type",String)],Oa.prototype,"Id",void 0);Fe([wr({localName:fe.AttributeNames.URI}),Ye("design:type",String)],Oa.prototype,"Uri",void 0);Fe([wr({localName:fe.AttributeNames.Type,defaultValue:""}),Ye("design:type",String)],Oa.prototype,"Type",void 0);Fe([Dt({parser:Hm}),Ye("design:type",Hm)],Oa.prototype,"Transforms",void 0);Fe([Dt({required:!0,parser:gi}),Ye("design:type",gi)],Oa.prototype,"DigestMethod",void 0);Fe([Dt({required:!0,localName:fe.ElementNames.DigestValue,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,converter:oi}),Ye("design:type",Uint8Array)],Oa.prototype,"DigestValue",void 0);Oa=Fe([Et({localName:fe.ElementNames.Reference}),Ye("design:paramtypes",[String])],Oa);var Km=class extends mi{static{o(this,"References")}};Km=Fe([Et({localName:"References",parser:Oa})],Km);var ko=class extends Br{static{o(this,"SignedInfo")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],ko.prototype,"Id",void 0);Fe([Dt({parser:Mm,required:!0}),Ye("design:type",Mm)],ko.prototype,"CanonicalizationMethod",void 0);Fe([Dt({parser:Ia,required:!0}),Ye("design:type",Ia)],ko.prototype,"SignatureMethod",void 0);Fe([Dt({parser:Km,minOccurs:1,noRoot:!0}),Ye("design:type",Km)],ko.prototype,"References",void 0);ko=Fe([Et({localName:fe.ElementNames.SignedInfo})],ko);var zm="http://www.w3.org/2001/04/xmldsig-more#",Wm="ecdsa",ih=class extends ws{static{o(this,"EcdsaPublicKey")}};Fe([Dt({localName:fe.ElementNames.X,namespaceURI:zm,prefix:Wm,required:!0,converter:oi}),Ye("design:type",Uint8Array)],ih.prototype,"X",void 0);Fe([Dt({localName:fe.ElementNames.Y,namespaceURI:zm,prefix:Wm,required:!0,converter:oi}),Ye("design:type",Uint8Array)],ih.prototype,"Y",void 0);ih=Fe([Et({localName:fe.ElementNames.PublicKey,namespaceURI:zm,prefix:Wm})],ih);var $m=class extends ws{static{o(this,"NamedCurve")}};Fe([wr({localName:fe.AttributeNames.URI,required:!0}),Ye("design:type",String)],$m.prototype,"Uri",void 0);$m=Fe([Et({localName:fe.ElementNames.NamedCurve,namespaceURI:zm,prefix:Wm})],$m);var Xm=class extends ws{static{o(this,"DomainParameters")}};Fe([Dt({parser:$m}),Ye("design:type",$m)],Xm.prototype,"NamedCurve",void 0);Xm=Fe([Et({localName:fe.ElementNames.DomainParameters,namespaceURI:zm,prefix:Wm})],Xm);var Gm=class extends Hs{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=fe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ro.toUpperCase()}get NamedCurve(){return xH(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new _e(we.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await rn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new ih,this.PublicKey.X=ir.FromString(t.x||"","base64url"),this.PublicKey.Y=ir.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new Xm),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new $m),this.DomainParameters.NamedCurve.Uri=xH(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=ir.ToBase64Url(this.PublicKey.X),n=ir.ToBase64Url(this.PublicKey.Y),s=dhe(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await rn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Fe([Dt({parser:Xm}),Ye("design:type",Xm)],Gm.prototype,"DomainParameters",void 0);Fe([Dt({parser:ih,required:!0}),Ye("design:type",ih)],Gm.prototype,"PublicKey",void 0);Gm=Fe([Et({localName:fe.ElementNames.ECDSAKeyValue,namespaceURI:zm,prefix:Wm})],Gm);function xH(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new _e(we.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(xH,"GetNamedCurveOid");function dhe(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new _e(we.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(dhe,"GetNamedCurveFromOid");var mhe=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},kc=new mhe;kc.set(fe.ElementNames.RSAKeyValue,Fm);kc.set(fe.ElementNames.ECDSAKeyValue,Gm);var MA=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=kc.get(e);if(!t)throw new _e(we.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var cx=class extends Hs{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of kc)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new _e(we.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new _e(we.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(Vs(n))try{let s=n.localName,i=MA.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new _e(we.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};cx=Fe([Et({localName:fe.ElementNames.KeyValue}),Ye("design:paramtypes",[Hs])],cx);var ghe={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},Jm=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return rn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===Ro){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=ghe[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Or(this.raw.buffer);this.simpl=new Gn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var jA=class extends Br{static{o(this,"X509IssuerSerial")}};Fe([Dt({localName:fe.ElementNames.X509IssuerName,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],jA.prototype,"X509IssuerName",void 0);Fe([Dt({localName:fe.ElementNames.X509SerialNumber,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0}),Ye("design:type",String)],jA.prototype,"X509SerialNumber",void 0);jA=Fe([Et({localName:fe.ElementNames.X509IssuerSerial})],jA);var ah;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(ah||(ah={}));var Ym=class extends Hs{static{o(this,"KeyInfoX509Data")}constructor(e,t=ah.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new Jm(e));else if(e instanceof Jm)switch(t){case ah.None:case ah.EndCertOnly:this.AddCertificate(e);break;case ah.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case ah.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new _e(we.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new _e(we.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new _e(we.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new _e(we.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=ir.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509IssuerSerial),a=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SKI);i.textContent=ir.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509Certificate);i.textContent=ir.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(fe.NamespaceURI,n+fe.ElementNames.X509CRL);s.textContent=ir.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(fe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Br.GetChild(s,fe.ElementNames.X509IssuerName,fe.NamespaceURI,!0),a=Br.GetChild(s,fe.ElementNames.X509SerialNumber,fe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(fe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=ir.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(fe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(fe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=ir.FromBase64(s.textContent);this.AddCertificate(new Jm(i))}});let n=this.GetChild(fe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=ir.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};Ym=Fe([Et({localName:fe.ElementNames.X509Data}),Ye("design:paramtypes",[Object,Object])],Ym);var lx=class extends Hs{static{o(this,"SPKIData")}async importKey(e){let t=await rn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await rn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Fe([Dt({localName:fe.ElementNames.SPKIexp,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0,converter:oi}),Ye("design:type",Object)],lx.prototype,"SPKIexp",void 0);lx=Fe([Et({localName:fe.ElementNames.SPKIData})],lx);var oh=class extends mi{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==xt.Element)continue;let s=null;switch(n.localName){case fe.ElementNames.KeyValue:s=cx;break;case fe.ElementNames.X509Data:s=Ym;break;case fe.ElementNames.SPKIData:s=lx;break;case fe.ElementNames.KeyName:case fe.ElementNames.RetrievalMethod:case fe.ElementNames.PGPData:case fe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],oh.prototype,"Id",void 0);oh=Fe([Et({localName:fe.ElementNames.KeyInfo})],oh);var Lc=class extends Br{static{o(this,"Signature")}};Fe([wr({localName:fe.AttributeNames.Id,defaultValue:""}),Ye("design:type",String)],Lc.prototype,"Id",void 0);Fe([Dt({parser:ko,required:!0}),Ye("design:type",ko)],Lc.prototype,"SignedInfo",void 0);Fe([Dt({localName:fe.ElementNames.SignatureValue,namespaceURI:fe.NamespaceURI,prefix:fe.DefaultPrefix,required:!0,converter:oi,defaultValue:null}),Ye("design:type",Object)],Lc.prototype,"SignatureValue",void 0);Fe([Dt({parser:oh}),Ye("design:type",oh)],Lc.prototype,"KeyInfo",void 0);Fe([Dt({parser:ox,noRoot:!0}),Ye("design:type",ox)],Lc.prototype,"ObjectList",void 0);Lc=Fe([Et({localName:fe.ElementNames.Signature})],Lc);var vhe=class extends Map{static{o(this,"AlgorithmRegistry")}},Lt=new vhe;Lt.set(DA,{type:"signature",algorithm:Om});Lt.set(BA,{type:"signature",algorithm:Pm});Lt.set(RA,{type:"signature",algorithm:km});Lt.set(_A,{type:"signature",algorithm:Lm});Lt.set(DA,{type:"signature",algorithm:Om});Lt.set(BA,{type:"signature",algorithm:Pm});Lt.set(RA,{type:"signature",algorithm:km});Lt.set(_A,{type:"signature",algorithm:Lm});Lt.set($_,{type:"signature",algorithm:PA});Lt.set(X_,{type:"signature",algorithm:kA});Lt.set(G_,{type:"signature",algorithm:LA});Lt.set(z_,{type:"signature",algorithm:FA});Lt.set(W_,{type:"signature",algorithm:UA});Lt.set(SA,{type:"signature",algorithm:Im});Lt.set(AA,{type:"signature",algorithm:Dm});Lt.set(CA,{type:"signature",algorithm:Bm});Lt.set(NA,{type:"signature",algorithm:Rm});Lt.set(SA.toUpperCase(),{type:"signature",algorithm:Im});Lt.set(AA.toUpperCase(),{type:"signature",algorithm:Dm});Lt.set(CA.toUpperCase(),{type:"signature",algorithm:Bm});Lt.set(NA.toUpperCase(),{type:"signature",algorithm:Rm});Lt.set(V_,{type:"signature",algorithm:nx});Lt.set(M_,{type:"signature",algorithm:sx});Lt.set(j_,{type:"signature",algorithm:ix});Lt.set(q_,{type:"signature",algorithm:ax});Lt.set(Am,{type:"hash",algorithm:EA});Lt.set(Cm,{type:"hash",algorithm:rx});Lt.set(Nm,{type:"hash",algorithm:wA});Lt.set(Tm,{type:"hash",algorithm:bA});var uh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Lt)if(n==="hash"&&t===e)return new s;throw new _e(we.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Lt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Lt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Lt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new _e(we.ALGORITHM_NOT_SUPPORTED,e.name)}};var xhe=class extends Map{static{o(this,"TransformRegistry")}},Lo=new xhe;Lo.set(fe.AlgorithmNamespaces.XmlDsigBase64Transform,Oo);Lo.set(fe.AlgorithmNamespaces.XmlDsigC14NTransform,Da);Lo.set(fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Ba);Lo.set(fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Po);Lo.set(fe.AlgorithmNamespaces.XmlDsigExcC14NTransform,Ra);Lo.set(fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,_a);var ux=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new _e(we.PARAM_REQUIRED,"name");let t=Lo.get(e);if(t)return new t;let n;switch(e){case fe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Oo;break;case fe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new Da;break;case fe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Ba;break;case fe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Po;break;case fe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);case fe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);case fe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new Ra;break;case fe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new _a;break;case fe.AlgorithmNamespaces.XmlDecryptionTransform:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e);default:throw new _e(we.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return uh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return uh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return uh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),uh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Ia;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Lt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Lt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){kc.set(e,t)}static RegisterTransform(e,t){Lo.set(e,t)}};var ph=Rt(IK(),1);var DK={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var BK={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var gO=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=hde){this.xml2js=e,U9({XMLSerializer:ph.default.XMLSerializer,DOMParser:ph.default.DOMParser,DOMImplementation:ph.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return nr(new Vt("Please provide a valid xml content"));if(!t||t.trim().length===0)return nr(new Vt("Please provide a valid existing xsd path"));try{return await lj.validate(e,t),Qr()}catch(n){return us(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...BK,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...DK,...t}).buildObject(e))}digest(e,t,n=E0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=E0){let n=new ph.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Ta(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getNodeValue(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getElementsByTagName(t).item(0)?.textContent?.trim()??null}getNodes(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t),a=[];for(let u=0;;u++){let c=i.item(u);if(!c)break;a.push(this.clear(this.serializeXml(c)))}return a}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new Vt(`No element found with tag "${t}" to insert before`);let u=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(u,a),this.clear(this.serializeXml(s))}hash(e,t){return RK.default.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new ph.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new Vt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new ph.default.XMLSerializer().serializeToString(e)}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
110
110
  `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};var _K=require("class-validator");var yO=o(r=>(e,t)=>{(0,_K.registerDecorator)({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Kc?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");var Wke=require("reflect-metadata"),vO=require("class-validator");var g0=Symbol("choice"),y0=o(r=>r==null||r==="","isEmpty"),pde=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(g0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(g0,i,e);for(let u of t)(0,vO.registerDecorator)({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,l){let f=l.object,h=l.property,d=Reflect.getMetadata(g0,e);if(!d)return!0;let g=d.find(m=>m.properties.includes(h));if(!g||y0(c))return!0;for(let m of g.properties){if(m===h)continue;let v=f[m];if(!y0(v))return!1}for(let m of d)if(m!==g)for(let v of m.properties){let y=f[v];if(!y0(y))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(g0,e);if(!l)return`${c.property} validation error`;let f=l.find(d=>d.properties.includes(c.property));if(!f)return`${c.property} validation error`;let h=c.object;for(let d of f.properties){let g=h[d];if(!y0(g)&&d!==c.property)return`${c.property} cannot be set because ${d} is already set. Only one property from this choice group is allowed.`}for(let d of l)if(d!==f)for(let g of d.properties){let m=h[g];if(!y0(m))return`${c.property} cannot be set because ${g} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)(0,vO.registerDecorator)({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,l){let f=l.object,h=Reflect.getMetadata(g0,e);if(!h)return!0;let d=h.find(g=>g.properties.includes(l.property));if(!d?.required)return!0;for(let g of d.properties){let m=f[g];if(!y0(m))return!0}return l.property!==d.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(g0,e);if(!l)return"At least one property from a choice group must be provided";let f=l.find(h=>h.properties.includes(c.property));return f?`You must provide a value for one of the following properties: ${f.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");var Qke=require("reflect-metadata");var OK=require("class-transformer");var dde=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{yO(e)(t,n),(0,OK.Transform)(({value:s})=>Kc.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");var PK=require("class-transformer"),kK=require("class-validator");var mde=o((r={})=>(e,t)=>{(0,PK.Transform)(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?tl(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),(0,kK.IsDateString)()(e,t)},"TransformDateString");var xO=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((m,v,y)=>m+v*a[y],0)%11,l=c===0||c===1?0:11-c,f=[5,4,3,2,9,8,7,6,5,4,3,2],d=[...n,l].reduce((m,v,y)=>m+v*f[y],0)%11,g=d===0||d===1?0:11-d;return s===l&&i===g}};var EO=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var wO=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var bO=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let h=0;h<8;h++)c+=parseInt(t[h],10)*u[h];let f=11-c%11;return f===10?f=0:f===11&&(f=a),f===parseInt(t[8],10)}};var SO=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(v=>parseInt(v,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let v=0;v<i.length;v++)a+=n[v]*i[v];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let f=(t.slice(0,t.length-2)+c.toString()).split("").map(v=>parseInt(v,10)),h=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],d=0;for(let v=0;v<h.length;v++)d+=f[v]*h[v];let g=d%s,m=s-g;return(s===11&&g<=1||s===10&&g===0)&&(m=0),m===n[t.length-2]&&c===n[t.length-1]}};var AO=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var CO=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let h=10,d=0;h>=0;h--,d=(d+1)%i.length)a+=n[h]*i[d];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),l=0;for(let h=11,d=0;h>=0;h--,d=(d+1)%i.length)l+=c[h]*i[d];let f=11-l%11;return(f===10||f===11)&&(f=0),u===s[0]&&f===s[1]}};var NO=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var TO=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var IO=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var DO=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let g=0;g<12;g++){let m=g%2===0?1:2,v=(parseInt(s[g])*m).toString();i+=v.split("").reduce((y,w)=>y+parseInt(w),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),l=[3,2,11,10,9,8,7,6,5,4,3,2],f=0;for(let g=0;g<12;g++)f+=parseInt(c[g])*l[g];let h=f%11,d=h<2?0:11-h;return parseInt(t[11])===u&&parseInt(t[12])===d}};var BO=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var RO=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var _O=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var OO=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var PO=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let g=0;g<7;g++)i+=n[g]*s[g];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],l=[9,8,7,6,5,4,3,2],f=0;for(let g=0;g<8;g++)f+=c[g]*l[g];let h=f%11,d=h===0||h===1?0:11-h;return u===parseInt(t[7])&&d===parseInt(t[8])}};var kO=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var LO=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let h=0;h<8;h++)a+=n[h]*s[h];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],l=0;for(let h=0;h<9;h++)l+=c[h]*i[h];let f=11-l%11;return f>=10&&(f=0),u===parseInt(t[8])&&f===parseInt(t[9])}};var FO=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var UO=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let l=0;l<n.length;l++)i+=s[l]*n[l];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var VO=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var MO=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var jO=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var qO=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var HO=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var KO=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let f=0;f<8;f++)i+=n[f]*s[f];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let f=0;f<11;f++)c+=n[f]*u[f];let l=c%11%10;return a===n[8]&&l===n[11]}};var $O=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let l=0;l<i.length;l++)a+=s[l]*i[l];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};0&&(module.exports={ASN1,CanonicalizationMethod,Choice,Decimal,DigestAlgorithm,EntitySigner,Environment,IsDecimal,Left,MemoryCacheAdapter,NFeTsError,NativeCertificateRepository,NullCacheAdapter,PdfkitPdfBuilder,Right,SignatureAlgorithm,SignatureMethod,SignatureNamespace,Signer,SkipAllValidations,SkipValidation,SkipValidationMetadata,SoapRemoteTransmissionRepository,StateAcronyms,StateCodeAcValidator,StateCodeAlValidator,StateCodeAmValidator,StateCodeApValidator,StateCodeBaValidator,StateCodeCeValidator,StateCodeDfValidator,StateCodeEsValidator,StateCodeGoValidator,StateCodeMaValidator,StateCodeMgValidator,StateCodeMsValidator,StateCodeMtValidator,StateCodePaValidator,StateCodePbValidator,StateCodePeValidator,StateCodePiValidator,StateCodePrValidator,StateCodeRjValidator,StateCodeRnValidator,StateCodeRoValidator,StateCodeRrValidator,StateCodeRsValidator,StateCodeScValidator,StateCodeSeValidator,StateCodeSpValidator,StateCodeToValidator,StateCodes,TransformDateString,TransformDecimal,TransmissionError,TransmissionHostNotFoundError,TransmissionTimeoutError,ValidateErrorsMetadata,Validates,ValidationError,Xml2JsToolkit,XmlSigner,clearEmptyValues,dateToolkit,fixUtf8Mojibake,left,leftFromError,leftFromTransmissionError,mapConstraintsToErrors,mapTransmissionError,normalizeTransmissionStrings,plainToInstance,right,search,timezones,unreachable});
111
111
  /*! Bundled license information:
112
112
 
@@ -1,5 +1,5 @@
1
- import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-BvZKQyK3.cjs';
2
- export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-BvZKQyK3.cjs';
1
+ import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-BlTnVW8U.cjs';
2
+ export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-BlTnVW8U.cjs';
3
3
  import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
4
4
  import { X509Certificate, KeyObject } from 'node:crypto';
5
5
  export { default as dateToolkit } from 'dayjs';
@@ -326,6 +326,8 @@ declare class Xml2JsToolkit implements XmlToolkit {
326
326
  digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
327
327
  canonicalize(xml: string, options?: CanonicalizeOptions): string;
328
328
  getNode(xml: string, tag: string): string | null;
329
+ getNodeValue(xml: string, tag: string): string | null;
330
+ getNodes(xml: string, tag: string): string[];
329
331
  getFirstNode(xml: string): string | null;
330
332
  getAttribute(xml: string, tag: string): string | null;
331
333
  appendNode(xml: string, node: string): string;
@@ -1,5 +1,5 @@
1
- import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-BvZKQyK3.js';
2
- export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-BvZKQyK3.js';
1
+ import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-BlTnVW8U.js';
2
+ export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-BlTnVW8U.js';
3
3
  import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
4
4
  import { X509Certificate, KeyObject } from 'node:crypto';
5
5
  export { default as dateToolkit } from 'dayjs';
@@ -326,6 +326,8 @@ declare class Xml2JsToolkit implements XmlToolkit {
326
326
  digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
327
327
  canonicalize(xml: string, options?: CanonicalizeOptions): string;
328
328
  getNode(xml: string, tag: string): string | null;
329
+ getNodeValue(xml: string, tag: string): string | null;
330
+ getNodes(xml: string, tag: string): string[];
329
331
  getFirstNode(xml: string): string | null;
330
332
  getAttribute(xml: string, tag: string): string | null;
331
333
  appendNode(xml: string, node: string): string;
@@ -92,7 +92,7 @@ ${e.join(`
92
92
  `):this.result.push("-->"))}WriteTextNode(e){this.result.push(this.NormalizeString(e.nodeValue,e.nodeType))}WriteProcessingInstructionNode(e){let t=e.nodeName||e.tagName;t!=="xml"&&(this.state===vs.AfterDocElement?this.result.push(`
93
93
  <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,gt.ProcessingInstruction))),this.state===vs.BeforeDocElement?this.result.push(`?>
94
94
  `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===vs.BeforeDocElement&&(this.state=vs.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===vs.BeforeDocElement&&(this.state=vs.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!GT(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let f={prefix:a.prefix,namespace:a.namespaceURI};t.push(f),this.visibleNamespaces.Add(f),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let f={prefix:a.prefix,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}let o=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(o=l[1]);let c=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,o)){let f=S5(e,o);if(f>1)c=!1;else if(f===0)continue}if(!this.IsNamespaceRendered(o,a.nodeValue)&&c){let f={prefix:o,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(EJ);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];GT(s)||t.push(s)}t.sort(wJ),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,gt.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===gt.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===gt.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===gt.Attribute?n.push("&quot;"):i===" "&&t===gt.Attribute?n.push("&#x9;"):i===`
95
- `&&t===gt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case gt.Text:case gt.CDATA:case gt.SignificantWhitespace:case gt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function EJ(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}u(EJ,"XmlDsigC14NTransformNamespacesComparer");function wJ(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}u(wJ,"XmlDsigC14NTransformAttributesComparer");function S5(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!GT(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===gt.Element){let a=S5(s,e,t);if(s.nodeType===gt.Element&&a)return++t+a}return t}u(S5,"IsNamespaceUsed");function GT(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===gt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}u(GT,"IsNamespaceNode");var jS=class extends Ms{static{u(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element||n.nodeName===oe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case oe.ElementNames.RSAPSSParams:s=pi;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};jS=Oe([yt({localName:"Other"})],jS);var Gi=class extends Sr{static{u(this,"SignatureMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:""}),ze("design:type",String)],Gi.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.HMACOutputLength,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Wd}),ze("design:type",Number)],Gi.prototype,"HMACOutputLength",void 0);Oe([Nt({parser:jS,noRoot:!0,minOccurs:0}),ze("design:type",jS)],Gi.prototype,"Any",void 0);Gi=Oe([yt({localName:oe.ElementNames.SignatureMethod})],Gi);var g0=class extends Sr{static{u(this,"CanonicalizationMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultCanonMethod}),ze("design:type",String)],g0.prototype,"Algorithm",void 0);g0=Oe([yt({localName:oe.ElementNames.CanonicalizationMethod})],g0);var y0=class extends Sr{static{u(this,"DataObject")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],y0.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.MimeType,defaultValue:""}),ze("design:type",String)],y0.prototype,"MimeType",void 0);Oe([pr({localName:oe.AttributeNames.Encoding,defaultValue:""}),ze("design:type",String)],y0.prototype,"Encoding",void 0);y0=Oe([yt({localName:oe.ElementNames.Object})],y0);var sy=class extends Ms{static{u(this,"DataObjects")}};sy=Oe([yt({localName:"xmldsig_objects",parser:y0})],sy);var Bn=class extends Sr{static{u(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new De(ye.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new De(ye.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:""}),ze("design:type",String)],Bn.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.XPath,defaultValue:""}),ze("design:type",String)],Bn.prototype,"XPath",void 0);Bn=Oe([yt({localName:oe.ElementNames.Transform})],Bn);var Xa=class extends Bn{static{u(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return zt.FromString(this.innerXml.textContent||"","base64")}};var $i=class extends Bn{static{u(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Xi(!1,!1)}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Wi=class extends $i{static{u(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Xi(!0,!1)}};var Ga=class extends Bn{static{u(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)ps(e)&&e.localName===oe.ElementNames.Signature&&e.namespaceURI===oe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var zi=class extends Bn{static{u(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Xi(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Ji=class extends zi{static{u(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Xi(!0,!0)}};function A5(r){return r.parentNode?A5(r.parentNode):r}u(A5,"lookupParentNode");var v0=class extends Bn{static{u(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");this.Filter(A5(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:eh("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,o=typeof self>"u"?eh("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:u(c=>i.lookupNamespaceURI(c),"lookupNamespaceURI")},o.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Oe([Nt({localName:oe.ElementNames.XPath,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],v0.prototype,"XPath",void 0);var E0=class extends Ms{static{u(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return zc(t,Ga);case oe.AlgorithmNamespaces.XmlDsigC14NTransform:return zc(t,$i);case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return zc(t,Wi);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return zc(t,zi);case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return zc(t,Ji);case oe.AlgorithmNamespaces.XmlDsigBase64Transform:return zc(t,Xa);case oe.AlgorithmNamespaces.XmlDsigXPathTransform:return zc(t,v0);default:try{let n=iy.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new De(ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};E0=Oe([yt({localName:oe.ElementNames.Transforms,parser:Bn})],E0);function zc(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}u(zc,"ChangeTransform");var Yi=class extends Sr{static{u(this,"Reference")}constructor(e){super(),this.DigestMethod=new js,e&&(this.Uri=e)}};Oe([pr({defaultValue:""}),ze("design:type",String)],Yi.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.URI}),ze("design:type",String)],Yi.prototype,"Uri",void 0);Oe([pr({localName:oe.AttributeNames.Type,defaultValue:""}),ze("design:type",String)],Yi.prototype,"Type",void 0);Oe([Nt({parser:E0}),ze("design:type",E0)],Yi.prototype,"Transforms",void 0);Oe([Nt({required:!0,parser:js}),ze("design:type",js)],Yi.prototype,"DigestMethod",void 0);Oe([Nt({required:!0,localName:oe.ElementNames.DigestValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Os}),ze("design:type",Uint8Array)],Yi.prototype,"DigestValue",void 0);Yi=Oe([yt({localName:oe.ElementNames.Reference}),ze("design:paramtypes",[String])],Yi);var w0=class extends Ms{static{u(this,"References")}};w0=Oe([yt({localName:"References",parser:Yi})],w0);var $a=class extends Sr{static{u(this,"SignedInfo")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],$a.prototype,"Id",void 0);Oe([Nt({parser:g0,required:!0}),ze("design:type",g0)],$a.prototype,"CanonicalizationMethod",void 0);Oe([Nt({parser:Gi,required:!0}),ze("design:type",Gi)],$a.prototype,"SignatureMethod",void 0);Oe([Nt({parser:w0,minOccurs:1,noRoot:!0}),ze("design:type",w0)],$a.prototype,"References",void 0);$a=Oe([yt({localName:oe.ElementNames.SignedInfo})],$a);var x0="http://www.w3.org/2001/04/xmldsig-more#",b0="ecdsa",Jc=class extends Yn{static{u(this,"EcdsaPublicKey")}};Oe([Nt({localName:oe.ElementNames.X,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"X",void 0);Oe([Nt({localName:oe.ElementNames.Y,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"Y",void 0);Jc=Oe([yt({localName:oe.ElementNames.PublicKey,namespaceURI:x0,prefix:b0})],Jc);var S0=class extends Yn{static{u(this,"NamedCurve")}};Oe([pr({localName:oe.AttributeNames.URI,required:!0}),ze("design:type",String)],S0.prototype,"Uri",void 0);S0=Oe([yt({localName:oe.ElementNames.NamedCurve,namespaceURI:x0,prefix:b0})],S0);var A0=class extends Yn{static{u(this,"DomainParameters")}};Oe([Nt({parser:S0}),ze("design:type",S0)],A0.prototype,"NamedCurve",void 0);A0=Oe([yt({localName:oe.ElementNames.DomainParameters,namespaceURI:x0,prefix:b0})],A0);var C0=class extends ys{static{u(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=oe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ha.toUpperCase()}get NamedCurve(){return x5(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await qr.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Jc,this.PublicKey.X=zt.FromString(t.x||"","base64url"),this.PublicKey.Y=zt.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new A0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new S0),this.DomainParameters.NamedCurve.Uri=x5(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=zt.ToBase64Url(this.PublicKey.X),n=zt.ToBase64Url(this.PublicKey.Y),s=SJ(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await qr.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Oe([Nt({parser:A0}),ze("design:type",A0)],C0.prototype,"DomainParameters",void 0);Oe([Nt({parser:Jc,required:!0}),ze("design:type",Jc)],C0.prototype,"PublicKey",void 0);C0=Oe([yt({localName:oe.ElementNames.ECDSAKeyValue,namespaceURI:x0,prefix:b0})],C0);function x5(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve")}u(x5,"GetNamedCurveOid");function SJ(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}u(SJ,"GetNamedCurveFromOid");var AJ=class extends Map{static{u(this,"KeyInfoClauseRegistry")}},ju=new AJ;ju.set(oe.ElementNames.RSAKeyValue,p0);ju.set(oe.ElementNames.ECDSAKeyValue,C0);var qS=class{static{u(this,"KeyInfoClauseFactory")}static create(e){let t=ju.get(e);if(!t)throw new De(ye.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ay=class extends ys{static{u(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of ju)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new De(ye.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new De(ye.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(ps(n))try{let s=n.localName,i=qS.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new De(ye.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ay=Oe([yt({localName:oe.ElementNames.KeyValue}),ze("design:paramtypes",[ys])],ay);var CJ={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},N0=class{static{u(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return qr.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===Ha){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=CJ[i.toString()],o=a?a.short:null;n.push(`${o||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Ar(this.raw.buffer);this.simpl=new Dn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var HS=class extends Sr{static{u(this,"X509IssuerSerial")}};Oe([Nt({localName:oe.ElementNames.X509IssuerName,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509IssuerName",void 0);Oe([Nt({localName:oe.ElementNames.X509SerialNumber,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509SerialNumber",void 0);HS=Oe([yt({localName:oe.ElementNames.X509IssuerSerial})],HS);var Yc;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Yc||(Yc={}));var T0=class extends ys{static{u(this,"KeyInfoX509Data")}constructor(e,t=Yc.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new N0(e));else if(e instanceof N0)switch(t){case Yc.None:case Yc.EndCertOnly:this.AddCertificate(e);break;case Yc.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Yc.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new De(ye.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new De(ye.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new De(ye.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new De(ye.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=zt.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerSerial),a=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let o=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SerialNumber);o.textContent=s.serialNumber,i.appendChild(o),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SKI);i.textContent=zt.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509Certificate);i.textContent=zt.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509CRL);s.textContent=zt.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(oe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Sr.GetChild(s,oe.ElementNames.X509IssuerName,oe.NamespaceURI,!0),a=Sr.GetChild(s,oe.ElementNames.X509SerialNumber,oe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(oe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(oe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(oe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddCertificate(new N0(i))}});let n=this.GetChild(oe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=zt.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};T0=Oe([yt({localName:oe.ElementNames.X509Data}),ze("design:paramtypes",[Object,Object])],T0);var oy=class extends ys{static{u(this,"SPKIData")}async importKey(e){let t=await qr.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await qr.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Oe([Nt({localName:oe.ElementNames.SPKIexp,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os}),ze("design:type",Object)],oy.prototype,"SPKIexp",void 0);oy=Oe([yt({localName:oe.ElementNames.SPKIData})],oy);var Qc=class extends Ms{static{u(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element)continue;let s=null;switch(n.localName){case oe.ElementNames.KeyValue:s=ay;break;case oe.ElementNames.X509Data:s=T0;break;case oe.ElementNames.SPKIData:s=oy;break;case oe.ElementNames.KeyName:case oe.ElementNames.RetrievalMethod:case oe.ElementNames.PGPData:case oe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],Qc.prototype,"Id",void 0);Qc=Oe([yt({localName:oe.ElementNames.KeyInfo})],Qc);var qu=class extends Sr{static{u(this,"Signature")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],qu.prototype,"Id",void 0);Oe([Nt({parser:$a,required:!0}),ze("design:type",$a)],qu.prototype,"SignedInfo",void 0);Oe([Nt({localName:oe.ElementNames.SignatureValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os,defaultValue:null}),ze("design:type",Object)],qu.prototype,"SignatureValue",void 0);Oe([Nt({parser:Qc}),ze("design:type",Qc)],qu.prototype,"KeyInfo",void 0);Oe([Nt({parser:sy,noRoot:!0}),ze("design:type",sy)],qu.prototype,"ObjectList",void 0);qu=Oe([yt({localName:oe.ElementNames.Signature})],qu);var bJ=class extends Map{static{u(this,"AlgorithmRegistry")}},Rt=new bJ;Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(jT,{type:"signature",algorithm:LS});Rt.set(qT,{type:"signature",algorithm:VS});Rt.set(HT,{type:"signature",algorithm:FS});Rt.set(KT,{type:"signature",algorithm:US});Rt.set(XT,{type:"signature",algorithm:MS});Rt.set(bS,{type:"signature",algorithm:s0});Rt.set(NS,{type:"signature",algorithm:i0});Rt.set(TS,{type:"signature",algorithm:a0});Rt.set(IS,{type:"signature",algorithm:o0});Rt.set(bS.toUpperCase(),{type:"signature",algorithm:s0});Rt.set(NS.toUpperCase(),{type:"signature",algorithm:i0});Rt.set(TS.toUpperCase(),{type:"signature",algorithm:a0});Rt.set(IS.toUpperCase(),{type:"signature",algorithm:o0});Rt.set(kT,{type:"signature",algorithm:ey});Rt.set(LT,{type:"signature",algorithm:ty});Rt.set(VT,{type:"signature",algorithm:ry});Rt.set(FT,{type:"signature",algorithm:ny});Rt.set(e0,{type:"hash",algorithm:AS});Rt.set(t0,{type:"hash",algorithm:Z1});Rt.set(r0,{type:"hash",algorithm:CS});Rt.set(n0,{type:"hash",algorithm:xS});var Zc=class{static{u(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="hash"&&t===e)return new s;throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}};var NJ=class extends Map{static{u(this,"TransformRegistry")}},Wa=new NJ;Wa.set(oe.AlgorithmNamespaces.XmlDsigBase64Transform,Xa);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NTransform,$i);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Wi);Wa.set(oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Ga);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NTransform,zi);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Ji);var iy=class{static{u(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new De(ye.PARAM_REQUIRED,"name");let t=Wa.get(e);if(t)return new t;let n;switch(e){case oe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Xa;break;case oe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new $i;break;case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Wi;break;case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Ga;break;case oe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new zi;break;case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Ji;break;case oe.AlgorithmNamespaces.XmlDecryptionTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Zc.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Zc.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Zc.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),Zc.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Gi;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Rt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Rt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ju.set(e,t)}static RegisterTransform(e,t){Wa.set(e,t)}};var sf=Ty(_L(),1);var PL={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var kL={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var LL=class{static{u(this,"Xml2JsToolkit")}xml2js;constructor(e=wQ){this.xml2js=e,H4({XMLSerializer:sf.default.XMLSerializer,DOMParser:sf.default.DOMParser,DOMImplementation:sf.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return Zt(new kt("Please provide a valid xml content"));if(!t||t.trim().length===0)return Zt(new kt("Please provide a valid existing xsd path"));try{return await mP.validate(e,t),Hr()}catch(n){return cs(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...kL,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...PL,...t}).buildObject(e))}digest(e,t,n=z0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=z0){let n=new sf.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Xi(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new kt(`No element found with tag "${t}" to insert before`);let o=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(o,a),this.clear(this.serializeXml(s))}hash(e,t){return EQ.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new sf.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new kt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new sf.default.XMLSerializer().serializeToString(e)}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
95
+ `&&t===gt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case gt.Text:case gt.CDATA:case gt.SignificantWhitespace:case gt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function EJ(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}u(EJ,"XmlDsigC14NTransformNamespacesComparer");function wJ(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}u(wJ,"XmlDsigC14NTransformAttributesComparer");function S5(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!GT(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===gt.Element){let a=S5(s,e,t);if(s.nodeType===gt.Element&&a)return++t+a}return t}u(S5,"IsNamespaceUsed");function GT(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===gt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}u(GT,"IsNamespaceNode");var jS=class extends Ms{static{u(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element||n.nodeName===oe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case oe.ElementNames.RSAPSSParams:s=pi;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};jS=Oe([yt({localName:"Other"})],jS);var Gi=class extends Sr{static{u(this,"SignatureMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:""}),ze("design:type",String)],Gi.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.HMACOutputLength,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Wd}),ze("design:type",Number)],Gi.prototype,"HMACOutputLength",void 0);Oe([Nt({parser:jS,noRoot:!0,minOccurs:0}),ze("design:type",jS)],Gi.prototype,"Any",void 0);Gi=Oe([yt({localName:oe.ElementNames.SignatureMethod})],Gi);var g0=class extends Sr{static{u(this,"CanonicalizationMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultCanonMethod}),ze("design:type",String)],g0.prototype,"Algorithm",void 0);g0=Oe([yt({localName:oe.ElementNames.CanonicalizationMethod})],g0);var y0=class extends Sr{static{u(this,"DataObject")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],y0.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.MimeType,defaultValue:""}),ze("design:type",String)],y0.prototype,"MimeType",void 0);Oe([pr({localName:oe.AttributeNames.Encoding,defaultValue:""}),ze("design:type",String)],y0.prototype,"Encoding",void 0);y0=Oe([yt({localName:oe.ElementNames.Object})],y0);var sy=class extends Ms{static{u(this,"DataObjects")}};sy=Oe([yt({localName:"xmldsig_objects",parser:y0})],sy);var Bn=class extends Sr{static{u(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new De(ye.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new De(ye.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:""}),ze("design:type",String)],Bn.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.XPath,defaultValue:""}),ze("design:type",String)],Bn.prototype,"XPath",void 0);Bn=Oe([yt({localName:oe.ElementNames.Transform})],Bn);var Xa=class extends Bn{static{u(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return zt.FromString(this.innerXml.textContent||"","base64")}};var $i=class extends Bn{static{u(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Xi(!1,!1)}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Wi=class extends $i{static{u(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Xi(!0,!1)}};var Ga=class extends Bn{static{u(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)ps(e)&&e.localName===oe.ElementNames.Signature&&e.namespaceURI===oe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var zi=class extends Bn{static{u(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Xi(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Ji=class extends zi{static{u(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Xi(!0,!0)}};function A5(r){return r.parentNode?A5(r.parentNode):r}u(A5,"lookupParentNode");var v0=class extends Bn{static{u(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");this.Filter(A5(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:eh("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,o=typeof self>"u"?eh("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:u(c=>i.lookupNamespaceURI(c),"lookupNamespaceURI")},o.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Oe([Nt({localName:oe.ElementNames.XPath,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],v0.prototype,"XPath",void 0);var E0=class extends Ms{static{u(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return zc(t,Ga);case oe.AlgorithmNamespaces.XmlDsigC14NTransform:return zc(t,$i);case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return zc(t,Wi);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return zc(t,zi);case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return zc(t,Ji);case oe.AlgorithmNamespaces.XmlDsigBase64Transform:return zc(t,Xa);case oe.AlgorithmNamespaces.XmlDsigXPathTransform:return zc(t,v0);default:try{let n=iy.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new De(ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};E0=Oe([yt({localName:oe.ElementNames.Transforms,parser:Bn})],E0);function zc(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}u(zc,"ChangeTransform");var Yi=class extends Sr{static{u(this,"Reference")}constructor(e){super(),this.DigestMethod=new js,e&&(this.Uri=e)}};Oe([pr({defaultValue:""}),ze("design:type",String)],Yi.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.URI}),ze("design:type",String)],Yi.prototype,"Uri",void 0);Oe([pr({localName:oe.AttributeNames.Type,defaultValue:""}),ze("design:type",String)],Yi.prototype,"Type",void 0);Oe([Nt({parser:E0}),ze("design:type",E0)],Yi.prototype,"Transforms",void 0);Oe([Nt({required:!0,parser:js}),ze("design:type",js)],Yi.prototype,"DigestMethod",void 0);Oe([Nt({required:!0,localName:oe.ElementNames.DigestValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Os}),ze("design:type",Uint8Array)],Yi.prototype,"DigestValue",void 0);Yi=Oe([yt({localName:oe.ElementNames.Reference}),ze("design:paramtypes",[String])],Yi);var w0=class extends Ms{static{u(this,"References")}};w0=Oe([yt({localName:"References",parser:Yi})],w0);var $a=class extends Sr{static{u(this,"SignedInfo")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],$a.prototype,"Id",void 0);Oe([Nt({parser:g0,required:!0}),ze("design:type",g0)],$a.prototype,"CanonicalizationMethod",void 0);Oe([Nt({parser:Gi,required:!0}),ze("design:type",Gi)],$a.prototype,"SignatureMethod",void 0);Oe([Nt({parser:w0,minOccurs:1,noRoot:!0}),ze("design:type",w0)],$a.prototype,"References",void 0);$a=Oe([yt({localName:oe.ElementNames.SignedInfo})],$a);var x0="http://www.w3.org/2001/04/xmldsig-more#",b0="ecdsa",Jc=class extends Yn{static{u(this,"EcdsaPublicKey")}};Oe([Nt({localName:oe.ElementNames.X,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"X",void 0);Oe([Nt({localName:oe.ElementNames.Y,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"Y",void 0);Jc=Oe([yt({localName:oe.ElementNames.PublicKey,namespaceURI:x0,prefix:b0})],Jc);var S0=class extends Yn{static{u(this,"NamedCurve")}};Oe([pr({localName:oe.AttributeNames.URI,required:!0}),ze("design:type",String)],S0.prototype,"Uri",void 0);S0=Oe([yt({localName:oe.ElementNames.NamedCurve,namespaceURI:x0,prefix:b0})],S0);var A0=class extends Yn{static{u(this,"DomainParameters")}};Oe([Nt({parser:S0}),ze("design:type",S0)],A0.prototype,"NamedCurve",void 0);A0=Oe([yt({localName:oe.ElementNames.DomainParameters,namespaceURI:x0,prefix:b0})],A0);var C0=class extends ys{static{u(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=oe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ha.toUpperCase()}get NamedCurve(){return x5(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await qr.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Jc,this.PublicKey.X=zt.FromString(t.x||"","base64url"),this.PublicKey.Y=zt.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new A0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new S0),this.DomainParameters.NamedCurve.Uri=x5(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=zt.ToBase64Url(this.PublicKey.X),n=zt.ToBase64Url(this.PublicKey.Y),s=SJ(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await qr.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Oe([Nt({parser:A0}),ze("design:type",A0)],C0.prototype,"DomainParameters",void 0);Oe([Nt({parser:Jc,required:!0}),ze("design:type",Jc)],C0.prototype,"PublicKey",void 0);C0=Oe([yt({localName:oe.ElementNames.ECDSAKeyValue,namespaceURI:x0,prefix:b0})],C0);function x5(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve")}u(x5,"GetNamedCurveOid");function SJ(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}u(SJ,"GetNamedCurveFromOid");var AJ=class extends Map{static{u(this,"KeyInfoClauseRegistry")}},ju=new AJ;ju.set(oe.ElementNames.RSAKeyValue,p0);ju.set(oe.ElementNames.ECDSAKeyValue,C0);var qS=class{static{u(this,"KeyInfoClauseFactory")}static create(e){let t=ju.get(e);if(!t)throw new De(ye.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ay=class extends ys{static{u(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of ju)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new De(ye.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new De(ye.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(ps(n))try{let s=n.localName,i=qS.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new De(ye.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ay=Oe([yt({localName:oe.ElementNames.KeyValue}),ze("design:paramtypes",[ys])],ay);var CJ={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},N0=class{static{u(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return qr.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===Ha){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=CJ[i.toString()],o=a?a.short:null;n.push(`${o||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Ar(this.raw.buffer);this.simpl=new Dn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var HS=class extends Sr{static{u(this,"X509IssuerSerial")}};Oe([Nt({localName:oe.ElementNames.X509IssuerName,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509IssuerName",void 0);Oe([Nt({localName:oe.ElementNames.X509SerialNumber,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509SerialNumber",void 0);HS=Oe([yt({localName:oe.ElementNames.X509IssuerSerial})],HS);var Yc;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Yc||(Yc={}));var T0=class extends ys{static{u(this,"KeyInfoX509Data")}constructor(e,t=Yc.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new N0(e));else if(e instanceof N0)switch(t){case Yc.None:case Yc.EndCertOnly:this.AddCertificate(e);break;case Yc.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Yc.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new De(ye.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new De(ye.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new De(ye.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new De(ye.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=zt.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerSerial),a=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let o=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SerialNumber);o.textContent=s.serialNumber,i.appendChild(o),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SKI);i.textContent=zt.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509Certificate);i.textContent=zt.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509CRL);s.textContent=zt.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(oe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Sr.GetChild(s,oe.ElementNames.X509IssuerName,oe.NamespaceURI,!0),a=Sr.GetChild(s,oe.ElementNames.X509SerialNumber,oe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(oe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(oe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(oe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddCertificate(new N0(i))}});let n=this.GetChild(oe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=zt.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};T0=Oe([yt({localName:oe.ElementNames.X509Data}),ze("design:paramtypes",[Object,Object])],T0);var oy=class extends ys{static{u(this,"SPKIData")}async importKey(e){let t=await qr.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await qr.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Oe([Nt({localName:oe.ElementNames.SPKIexp,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os}),ze("design:type",Object)],oy.prototype,"SPKIexp",void 0);oy=Oe([yt({localName:oe.ElementNames.SPKIData})],oy);var Qc=class extends Ms{static{u(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element)continue;let s=null;switch(n.localName){case oe.ElementNames.KeyValue:s=ay;break;case oe.ElementNames.X509Data:s=T0;break;case oe.ElementNames.SPKIData:s=oy;break;case oe.ElementNames.KeyName:case oe.ElementNames.RetrievalMethod:case oe.ElementNames.PGPData:case oe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],Qc.prototype,"Id",void 0);Qc=Oe([yt({localName:oe.ElementNames.KeyInfo})],Qc);var qu=class extends Sr{static{u(this,"Signature")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],qu.prototype,"Id",void 0);Oe([Nt({parser:$a,required:!0}),ze("design:type",$a)],qu.prototype,"SignedInfo",void 0);Oe([Nt({localName:oe.ElementNames.SignatureValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os,defaultValue:null}),ze("design:type",Object)],qu.prototype,"SignatureValue",void 0);Oe([Nt({parser:Qc}),ze("design:type",Qc)],qu.prototype,"KeyInfo",void 0);Oe([Nt({parser:sy,noRoot:!0}),ze("design:type",sy)],qu.prototype,"ObjectList",void 0);qu=Oe([yt({localName:oe.ElementNames.Signature})],qu);var bJ=class extends Map{static{u(this,"AlgorithmRegistry")}},Rt=new bJ;Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(jT,{type:"signature",algorithm:LS});Rt.set(qT,{type:"signature",algorithm:VS});Rt.set(HT,{type:"signature",algorithm:FS});Rt.set(KT,{type:"signature",algorithm:US});Rt.set(XT,{type:"signature",algorithm:MS});Rt.set(bS,{type:"signature",algorithm:s0});Rt.set(NS,{type:"signature",algorithm:i0});Rt.set(TS,{type:"signature",algorithm:a0});Rt.set(IS,{type:"signature",algorithm:o0});Rt.set(bS.toUpperCase(),{type:"signature",algorithm:s0});Rt.set(NS.toUpperCase(),{type:"signature",algorithm:i0});Rt.set(TS.toUpperCase(),{type:"signature",algorithm:a0});Rt.set(IS.toUpperCase(),{type:"signature",algorithm:o0});Rt.set(kT,{type:"signature",algorithm:ey});Rt.set(LT,{type:"signature",algorithm:ty});Rt.set(VT,{type:"signature",algorithm:ry});Rt.set(FT,{type:"signature",algorithm:ny});Rt.set(e0,{type:"hash",algorithm:AS});Rt.set(t0,{type:"hash",algorithm:Z1});Rt.set(r0,{type:"hash",algorithm:CS});Rt.set(n0,{type:"hash",algorithm:xS});var Zc=class{static{u(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="hash"&&t===e)return new s;throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}};var NJ=class extends Map{static{u(this,"TransformRegistry")}},Wa=new NJ;Wa.set(oe.AlgorithmNamespaces.XmlDsigBase64Transform,Xa);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NTransform,$i);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Wi);Wa.set(oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Ga);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NTransform,zi);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Ji);var iy=class{static{u(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new De(ye.PARAM_REQUIRED,"name");let t=Wa.get(e);if(t)return new t;let n;switch(e){case oe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Xa;break;case oe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new $i;break;case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Wi;break;case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Ga;break;case oe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new zi;break;case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Ji;break;case oe.AlgorithmNamespaces.XmlDecryptionTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Zc.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Zc.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Zc.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),Zc.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Gi;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Rt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Rt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ju.set(e,t)}static RegisterTransform(e,t){Wa.set(e,t)}};var sf=Ty(_L(),1);var PL={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var kL={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var LL=class{static{u(this,"Xml2JsToolkit")}xml2js;constructor(e=wQ){this.xml2js=e,H4({XMLSerializer:sf.default.XMLSerializer,DOMParser:sf.default.DOMParser,DOMImplementation:sf.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return Zt(new kt("Please provide a valid xml content"));if(!t||t.trim().length===0)return Zt(new kt("Please provide a valid existing xsd path"));try{return await mP.validate(e,t),Hr()}catch(n){return cs(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...kL,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...PL,...t}).buildObject(e))}digest(e,t,n=z0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=z0){let n=new sf.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Xi(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getNodeValue(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getElementsByTagName(t).item(0)?.textContent?.trim()??null}getNodes(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t),a=[];for(let o=0;;o++){let l=i.item(o);if(!l)break;a.push(this.clear(this.serializeXml(l)))}return a}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new kt(`No element found with tag "${t}" to insert before`);let o=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(o,a),this.clear(this.serializeXml(s))}hash(e,t){return EQ.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new sf.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new kt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new sf.default.XMLSerializer().serializeToString(e)}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
96
96
  `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as SQ}from"class-validator";var VL=u(r=>(e,t)=>{SQ({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof pf?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as FL}from"class-validator";var G0=Symbol("choice"),$0=u(r=>r==null||r==="","isEmpty"),Cme=u(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(G0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(G0,i,e);for(let o of t)FL({name:"choice",target:e,propertyName:o,options:s,validator:{validate(l,c){let f=c.object,p=c.property,d=Reflect.getMetadata(G0,e);if(!d)return!0;let g=d.find(m=>m.properties.includes(p));if(!g||$0(l))return!0;for(let m of g.properties){if(m===p)continue;let v=f[m];if(!$0(v))return!1}for(let m of d)if(m!==g)for(let v of m.properties){let y=f[v];if(!$0(y))return!1}return!0},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return`${l.property} validation error`;let f=c.find(d=>d.properties.includes(l.property));if(!f)return`${l.property} validation error`;let p=l.object;for(let d of f.properties){let g=p[d];if(!$0(g)&&d!==l.property)return`${l.property} cannot be set because ${d} is already set. Only one property from this choice group is allowed.`}for(let d of c)if(d!==f)for(let g of d.properties){let m=p[g];if(!$0(m))return`${l.property} cannot be set because ${g} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let o of t)FL({name:"choiceGroupRequired",target:e,propertyName:o,options:{...s,always:!0},validator:{validate(l,c){let f=c.object,p=Reflect.getMetadata(G0,e);if(!p)return!0;let d=p.find(g=>g.properties.includes(c.property));if(!d?.required)return!0;for(let g of d.properties){let m=f[g];if(!$0(m))return!0}return c.property!==d.properties[0]},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return"At least one property from a choice group must be provided";let f=c.find(p=>p.properties.includes(l.property));return f?`You must provide a value for one of the following properties: ${f.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as AQ}from"class-transformer";var Bme=u(({fixed:r,...e}={fixed:2})=>(t,n)=>{VL(e)(t,n),AQ(({value:s})=>pf.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as CQ}from"class-transformer";import{IsDateString as xQ}from"class-validator";var Lme=u((r={})=>(e,t)=>{CQ(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?Of(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),xQ()(e,t)},"TransformDateString");var UL=class{static{u(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],l=n.reduce((m,v,y)=>m+v*a[y],0)%11,c=l===0||l===1?0:11-l,f=[5,4,3,2,9,8,7,6,5,4,3,2],d=[...n,c].reduce((m,v,y)=>m+v*f[y],0)%11,g=d===0||d===1?0:11-d;return s===c&&i===g}};var ML=class{static{u(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var jL=class{static{u(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var qL=class{static{u(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let o=[9,8,7,6,5,4,3,2],l=i;for(let p=0;p<8;p++)l+=parseInt(t[p],10)*o[p];let f=11-l%11;return f===10?f=0:f===11&&(f=a),f===parseInt(t[8],10)}};var HL=class{static{u(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(v=>parseInt(v,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let v=0;v<i.length;v++)a+=n[v]*i[v];let o=a%s,l=s-o;(s===11&&o<=1||s===10&&o===0)&&(l=0);let f=(t.slice(0,t.length-2)+l.toString()).split("").map(v=>parseInt(v,10)),p=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],d=0;for(let v=0;v<p.length;v++)d+=f[v]*p[v];let g=d%s,m=s-g;return(s===11&&g<=1||s===10&&g===0)&&(m=0),m===n[t.length-2]&&l===n[t.length-1]}};var KL=class{static{u(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var XL=class{static{u(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let p=10,d=0;p>=0;p--,d=(d+1)%i.length)a+=n[p]*i[d];let o=11-a%11;(o===10||o===11)&&(o=0);let l=n.concat([o]),c=0;for(let p=11,d=0;p>=0;p--,d=(d+1)%i.length)c+=l[p]*i[d];let f=11-c%11;return(f===10||f===11)&&(f=0),o===s[0]&&f===s[1]}};var GL=class{static{u(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var $L=class{static{u(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let l=0;l<8;l++)i+=parseInt(t[l],10)*s[l];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var WL=class{static{u(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var zL=class{static{u(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let g=0;g<12;g++){let m=g%2===0?1:2,v=(parseInt(s[g])*m).toString();i+=v.split("").reduce((y,S)=>y+parseInt(S),0)}let o=Math.ceil(i/10)*10-i,l=n+o.toString(),c=[3,2,11,10,9,8,7,6,5,4,3,2],f=0;for(let g=0;g<12;g++)f+=parseInt(l[g])*c[g];let p=f%11,d=p<2?0:11-p;return parseInt(t[11])===o&&parseInt(t[12])===d}};var JL=class{static{u(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var YL=class{static{u(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let o=0;o<10;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var QL=class{static{u(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o])*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var ZL=class{static{u(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var eV=class{static{u(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let g=0;g<7;g++)i+=n[g]*s[g];let a=i%11,o=a===0||a===1?0:11-a,l=[...n,o],c=[9,8,7,6,5,4,3,2],f=0;for(let g=0;g<8;g++)f+=l[g]*c[g];let p=f%11,d=p===0||p===1?0:11-p;return o===parseInt(t[7])&&d===parseInt(t[8])}};var tV=class{static{u(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var rV=class{static{u(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let p=0;p<8;p++)a+=n[p]*s[p];let o=11-a%11;o>=10&&(o=0);let l=[...n,o],c=0;for(let p=0;p<9;p++)c+=l[p]*i[p];let f=11-c%11;return f>=10&&(f=0),o===parseInt(t[8])&&f===parseInt(t[9])}};var nV=class{static{u(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let o=0;o<7;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var sV=class{static{u(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let c=0;c<n.length;c++)i+=s[c]*n[c];let o=i*10%11;return(o===10?0:o)===parseInt(t[t.length-1])}};var iV=class{static{u(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let l=0;l<s.length;l++)i+=n[l]*s[l];let o=11-i%11;return(o===10||o===11)&&(o-=10),o===parseInt(t[t.length-1])}};var aV=class{static{u(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var oV=class{static{u(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var uV=class{static{u(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var lV=class{static{u(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var cV=class{static{u(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let f=0;f<8;f++)i+=n[f]*s[f];let a=i%11%10,o=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let f=0;f<11;f++)l+=n[f]*o[f];let c=l%11%10;return a===n[8]&&c===n[11]}};var fV=class{static{u(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let c=0;c<i.length;c++)a+=s[c]*i[c];let o=a%11;return(o<2?0:11-o)===parseInt(t[10])}};export{yo as ASN1,gI as CanonicalizationMethod,Cme as Choice,pf as Decimal,fA as DigestAlgorithm,vI as EntitySigner,IQ as Environment,VL as IsDecimal,pA as Left,FI as MemoryCacheAdapter,kt as NFeTsError,cR as NativeCertificateRepository,vv as NullCacheAdapter,VI as PdfkitPdfBuilder,By as Right,eo as SignatureAlgorithm,cA as SignatureMethod,lA as SignatureNamespace,lf as Signer,bZ as SkipAllValidations,xZ as SkipValidation,J0 as SkipValidationMetadata,pP as SoapRemoteTransmissionRepository,NQ as StateAcronyms,UL as StateCodeAcValidator,ML as StateCodeAlValidator,jL as StateCodeAmValidator,qL as StateCodeApValidator,HL as StateCodeBaValidator,KL as StateCodeCeValidator,XL as StateCodeDfValidator,GL as StateCodeEsValidator,$L as StateCodeGoValidator,WL as StateCodeMaValidator,zL as StateCodeMgValidator,JL as StateCodeMsValidator,YL as StateCodeMtValidator,QL as StateCodePaValidator,ZL as StateCodePbValidator,eV as StateCodePeValidator,tV as StateCodePiValidator,rV as StateCodePrValidator,nV as StateCodeRjValidator,sV as StateCodeRnValidator,iV as StateCodeRoValidator,aV as StateCodeRrValidator,oV as StateCodeRsValidator,uV as StateCodeScValidator,lV as StateCodeSeValidator,cV as StateCodeSpValidator,fV as StateCodeToValidator,Qt as StateCodes,Lme as TransformDateString,Bme as TransformDecimal,Dy as TransmissionError,W0 as TransmissionHostNotFoundError,uf as TransmissionTimeoutError,SI as ValidateErrorsMetadata,kZ as Validates,yI as ValidationError,LL as Xml2JsToolkit,EI as XmlSigner,Ry as clearEmptyValues,Of as dateToolkit,DG as fixUtf8Mojibake,Zt as left,cs as leftFromError,fP as leftFromTransmissionError,AI as mapConstraintsToErrors,TG as mapTransmissionError,hP as normalizeTransmissionStrings,wI as plainToInstance,Hr as right,SC as search,SV as timezones,hA as unreachable};
97
97
  /*! Bundled license information:
98
98
 
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- export { B as BuilderOptions, W as CacheAdapter, b as CanonicalizationMethod, s as CanonicalizeOptions, J as CellOptions, C as CertificateInfo, Y as CertificateRepository, m as Client, A as ColorValue, D as DecimalValue, ag as DeepPartial, e as DigestAlgorithm, y as DocumentOptions, ab as Either, a9 as EntitySigner, E as Environment, j as EnvironmentCode, o as ExtractReturnType, Z as HeaderValue, a3 as HttpClient, $ as HttpClientHeaders, a2 as HttpResponse, I as ImageOptions, K as KnownKeys, ac as Left, x as NFeTsError, N as Namespaced, L as PDFTableObject, P as ParserOptions, V as PdfBuilder, R as ReadCertificateRequest, a as ReadCertificateResponse, a4 as RemoteTransmissionRepository, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, ad as Right, U as RowBuilderFunction, O as RowBuilderOptions, Q as RowOptions, F as RuleValue, n as SendTransmissionPayload, l as Signature, d as SignatureAlgorithm, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, a7 as SignerRepository, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, H as TableOptionsWithData, z as TextOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, M as TupleOfLength, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, w as XmlToolkit, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from './types-BvZKQyK3.cjs';
1
+ export { B as BuilderOptions, W as CacheAdapter, b as CanonicalizationMethod, s as CanonicalizeOptions, J as CellOptions, C as CertificateInfo, Y as CertificateRepository, m as Client, A as ColorValue, D as DecimalValue, ag as DeepPartial, e as DigestAlgorithm, y as DocumentOptions, ab as Either, a9 as EntitySigner, E as Environment, j as EnvironmentCode, o as ExtractReturnType, Z as HeaderValue, a3 as HttpClient, $ as HttpClientHeaders, a2 as HttpResponse, I as ImageOptions, K as KnownKeys, ac as Left, x as NFeTsError, N as Namespaced, L as PDFTableObject, P as ParserOptions, V as PdfBuilder, R as ReadCertificateRequest, a as ReadCertificateResponse, a4 as RemoteTransmissionRepository, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, ad as Right, U as RowBuilderFunction, O as RowBuilderOptions, Q as RowOptions, F as RuleValue, n as SendTransmissionPayload, l as Signature, d as SignatureAlgorithm, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, a7 as SignerRepository, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, H as TableOptionsWithData, z as TextOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, M as TupleOfLength, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, w as XmlToolkit, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from './types-BlTnVW8U.cjs';
2
2
  export { ASN1, Choice, ChoiceOptions, Decimal, IsDecimal, MemoryCacheAdapter, NativeCertificateRepository, NullCacheAdapter, PdfkitPdfBuilder, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, StrategyPattern, TransformDateString, TransformDecimal, TransformDecimalArgs, TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, clearEmptyValues, fixUtf8Mojibake, leftFromError, leftFromTransmissionError, mapConstraintsToErrors, mapTransmissionError, normalizeTransmissionStrings, plainToInstance, search, timezones, unreachable } from './core/index.cjs';
3
3
  export { default as dateToolkit } from 'dayjs';
4
- export { AccessKey, AccessKeyBuilder, AssembleDetXmlBuilder, AssembleNfeBuilder, AsynchronousAutorizacaoResponse, AutXMLBuilder, AutorizacaoPayload, AutorizacaoRequest, AutorizacaoResponse, AvulsaBuilder, Builder, CanaBuilder, CobrBuilder, CofinsBuilder, CofinsStBuilder, CompraBuilder, ConsultStatusPayload, ConsultStatusRequest, ConsultStatusResponse, ConsultaCadastroPayload, ConsultaCadastroRequest, ConsultaCadastroResponse, ConsultaProtocoloPayload, ConsultaProtocoloRequest, ConsultaProtocoloResponse, ContingencyOptions, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, DefaultDetBuilderAggregator, DefaultTotalBuilderAggregator, DestBuilder, DetBuilder, DetBuilderAggregator, DetEventoCancelamento, DetGroupBuilder, EmitBuilder, EntregaBuilder, EventoCancelamento, EventoItem, EventoItemAttributes, EventoLotePayload, EventoLoteResponse, EventoPayload, EventoRequest, EventoResponse, ExportaBuilder, ICMS, ICMS00, ICMS02, ICMS10, ICMS15, ICMS20, ICMS30, ICMS40, ICMS51, ICMS53, ICMS60, ICMS61, ICMS70, ICMS90, ICMSPart, ICMSSN, ICMSSN101, ICMSSN102, ICMSSN201, ICMSSN202, ICMSSN500, ICMSSN900, ICMSST, ICMSStandard, IIBuilder, INfeDetXmlBuilder, INfeXmlBuilder, IbscbsBuilder, IcmsBuilder, IcmsIpiBuilder, IcmsOrIssQnBuilder, IcmsufdestBuilder, IdeBuilder, ImpostoBuilder, InfAdicBuilder, InfEvento, InfEventoAttributes, InfIntermedBuilder, InfInut, InfInutAttributes, InfNFeBuilder, InfRespTecBuilder, InfSolicNFFBuilder, InutNFeAttributes, InutilizacaoPayload, InutilizacaoRequest, InutilizacaoResponse, IssIpiBuilder, IssQnBuilder, NFCe, NFCeDto, NFCeProc, NFe, NFeAttributes, NFeDto, NFeProc, NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, NfceQrcodeOptions, NfceQrcodeOptions200, NfceQrcodeOptions300, NfceQrcodeOptionsBase, NfceRemoteClient, NfceRemoteTransmitter, NfceTransmitter, NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, NfeRemoteClient, NfeRemoteTransmitter, NfeTransmitter, NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, OptionalSharedImpostoBuilder, PagBuilder, PipelineAuthorizerResponse, PisBuilder, PisStBuilder, ProcEventoNFe, ProdBuilder, RetAutorizacaoPayload, RetAutorizacaoRequest, RetAutorizacaoResponse, RetCancNFe, RetEvento, RetEventoItem, RetiradaBuilder, Schema, SynchronousAutorizacaoResponse, TotalBuilder, TotalBuilderAggregator, TpEmis, TpEvent, TranspBuilder, VerifiedAccessKey, VoidRangePayload, XmlValidationError, schemas, vItemBuilder } from './nfe/index.cjs';
4
+ export { AccessKey, AccessKeyBuilder, AssembleDetXmlBuilder, AssembleNfeBuilder, AsynchronousAutorizacaoResponse, AutXMLBuilder, AutorizacaoPayload, AutorizacaoRequest, AutorizacaoResponse, AvulsaBuilder, Builder, CanaBuilder, CobrBuilder, CofinsBuilder, CofinsStBuilder, CompraBuilder, ConsultStatusPayload, ConsultStatusRequest, ConsultStatusResponse, ConsultaCadastroPayload, ConsultaCadastroRequest, ConsultaCadastroResponse, ConsultaProtocoloPayload, ConsultaProtocoloRequest, ConsultaProtocoloResponse, ContingencyOptions, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, DefaultDetBuilderAggregator, DefaultTotalBuilderAggregator, DestBuilder, DetBuilder, DetBuilderAggregator, DetEventoCancelamento, DetGroupBuilder, EmitBuilder, EntregaBuilder, EventoCancelamento, EventoCstatToCancelRegister, EventoCstatToProtocol, EventoItem, EventoItemAttributes, EventoLotePayload, EventoLoteResponse, EventoPayload, EventoRequest, EventoResponse, ExportaBuilder, ICMS, ICMS00, ICMS02, ICMS10, ICMS15, ICMS20, ICMS30, ICMS40, ICMS51, ICMS53, ICMS60, ICMS61, ICMS70, ICMS90, ICMSPart, ICMSSN, ICMSSN101, ICMSSN102, ICMSSN201, ICMSSN202, ICMSSN500, ICMSSN900, ICMSST, ICMSStandard, IIBuilder, INfeDetXmlBuilder, INfeXmlBuilder, IbscbsBuilder, IcmsBuilder, IcmsIpiBuilder, IcmsOrIssQnBuilder, IcmsufdestBuilder, IdeBuilder, ImpostoBuilder, InfAdicBuilder, InfEvento, InfEventoAttributes, InfIntermedBuilder, InfInut, InfInutAttributes, InfNFeBuilder, InfRespTecBuilder, InfSolicNFFBuilder, InutNFeAttributes, InutilizacaoPayload, InutilizacaoRequest, InutilizacaoResponse, IssIpiBuilder, IssQnBuilder, NFCe, NFCeDto, NFCeProc, NFe, NFeAttributes, NFeDto, NFeProc, NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, NfceQrcodeOptions, NfceQrcodeOptions200, NfceQrcodeOptions300, NfceQrcodeOptionsBase, NfceRemoteClient, NfceRemoteTransmitter, NfceTransmitter, NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeComplements, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, NfeRemoteClient, NfeRemoteTransmitter, NfeTransmitter, NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, OptionalSharedImpostoBuilder, PagBuilder, PipelineAuthorizerResponse, PipelineEventResponse, PisBuilder, PisStBuilder, ProcEventoNFe, ProdBuilder, RetAutorizacaoPayload, RetAutorizacaoRequest, RetAutorizacaoResponse, RetCancNFe, RetEvento, RetEventoItem, RetiradaBuilder, Schema, SynchronousAutorizacaoResponse, TotalBuilder, TotalBuilderAggregator, TpEmis, TpEvent, TranspBuilder, VerifiedAccessKey, VoidRangePayload, XmlValidationError, schemas, vItemBuilder } from './nfe/index.cjs';
5
5
  import 'node:stream';
6
6
  import 'node:crypto';
7
7
  import 'class-validator';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { B as BuilderOptions, W as CacheAdapter, b as CanonicalizationMethod, s as CanonicalizeOptions, J as CellOptions, C as CertificateInfo, Y as CertificateRepository, m as Client, A as ColorValue, D as DecimalValue, ag as DeepPartial, e as DigestAlgorithm, y as DocumentOptions, ab as Either, a9 as EntitySigner, E as Environment, j as EnvironmentCode, o as ExtractReturnType, Z as HeaderValue, a3 as HttpClient, $ as HttpClientHeaders, a2 as HttpResponse, I as ImageOptions, K as KnownKeys, ac as Left, x as NFeTsError, N as Namespaced, L as PDFTableObject, P as ParserOptions, V as PdfBuilder, R as ReadCertificateRequest, a as ReadCertificateResponse, a4 as RemoteTransmissionRepository, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, ad as Right, U as RowBuilderFunction, O as RowBuilderOptions, Q as RowOptions, F as RuleValue, n as SendTransmissionPayload, l as Signature, d as SignatureAlgorithm, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, a7 as SignerRepository, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, H as TableOptionsWithData, z as TextOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, M as TupleOfLength, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, w as XmlToolkit, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from './types-BvZKQyK3.js';
1
+ export { B as BuilderOptions, W as CacheAdapter, b as CanonicalizationMethod, s as CanonicalizeOptions, J as CellOptions, C as CertificateInfo, Y as CertificateRepository, m as Client, A as ColorValue, D as DecimalValue, ag as DeepPartial, e as DigestAlgorithm, y as DocumentOptions, ab as Either, a9 as EntitySigner, E as Environment, j as EnvironmentCode, o as ExtractReturnType, Z as HeaderValue, a3 as HttpClient, $ as HttpClientHeaders, a2 as HttpResponse, I as ImageOptions, K as KnownKeys, ac as Left, x as NFeTsError, N as Namespaced, L as PDFTableObject, P as ParserOptions, V as PdfBuilder, R as ReadCertificateRequest, a as ReadCertificateResponse, a4 as RemoteTransmissionRepository, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, ad as Right, U as RowBuilderFunction, O as RowBuilderOptions, Q as RowOptions, F as RuleValue, n as SendTransmissionPayload, l as Signature, d as SignatureAlgorithm, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, a7 as SignerRepository, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, H as TableOptionsWithData, z as TextOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, M as TupleOfLength, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, w as XmlToolkit, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from './types-BlTnVW8U.js';
2
2
  export { ASN1, Choice, ChoiceOptions, Decimal, IsDecimal, MemoryCacheAdapter, NativeCertificateRepository, NullCacheAdapter, PdfkitPdfBuilder, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, StrategyPattern, TransformDateString, TransformDecimal, TransformDecimalArgs, TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, clearEmptyValues, fixUtf8Mojibake, leftFromError, leftFromTransmissionError, mapConstraintsToErrors, mapTransmissionError, normalizeTransmissionStrings, plainToInstance, search, timezones, unreachable } from './core/index.js';
3
3
  export { default as dateToolkit } from 'dayjs';
4
- export { AccessKey, AccessKeyBuilder, AssembleDetXmlBuilder, AssembleNfeBuilder, AsynchronousAutorizacaoResponse, AutXMLBuilder, AutorizacaoPayload, AutorizacaoRequest, AutorizacaoResponse, AvulsaBuilder, Builder, CanaBuilder, CobrBuilder, CofinsBuilder, CofinsStBuilder, CompraBuilder, ConsultStatusPayload, ConsultStatusRequest, ConsultStatusResponse, ConsultaCadastroPayload, ConsultaCadastroRequest, ConsultaCadastroResponse, ConsultaProtocoloPayload, ConsultaProtocoloRequest, ConsultaProtocoloResponse, ContingencyOptions, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, DefaultDetBuilderAggregator, DefaultTotalBuilderAggregator, DestBuilder, DetBuilder, DetBuilderAggregator, DetEventoCancelamento, DetGroupBuilder, EmitBuilder, EntregaBuilder, EventoCancelamento, EventoItem, EventoItemAttributes, EventoLotePayload, EventoLoteResponse, EventoPayload, EventoRequest, EventoResponse, ExportaBuilder, ICMS, ICMS00, ICMS02, ICMS10, ICMS15, ICMS20, ICMS30, ICMS40, ICMS51, ICMS53, ICMS60, ICMS61, ICMS70, ICMS90, ICMSPart, ICMSSN, ICMSSN101, ICMSSN102, ICMSSN201, ICMSSN202, ICMSSN500, ICMSSN900, ICMSST, ICMSStandard, IIBuilder, INfeDetXmlBuilder, INfeXmlBuilder, IbscbsBuilder, IcmsBuilder, IcmsIpiBuilder, IcmsOrIssQnBuilder, IcmsufdestBuilder, IdeBuilder, ImpostoBuilder, InfAdicBuilder, InfEvento, InfEventoAttributes, InfIntermedBuilder, InfInut, InfInutAttributes, InfNFeBuilder, InfRespTecBuilder, InfSolicNFFBuilder, InutNFeAttributes, InutilizacaoPayload, InutilizacaoRequest, InutilizacaoResponse, IssIpiBuilder, IssQnBuilder, NFCe, NFCeDto, NFCeProc, NFe, NFeAttributes, NFeDto, NFeProc, NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, NfceQrcodeOptions, NfceQrcodeOptions200, NfceQrcodeOptions300, NfceQrcodeOptionsBase, NfceRemoteClient, NfceRemoteTransmitter, NfceTransmitter, NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, NfeRemoteClient, NfeRemoteTransmitter, NfeTransmitter, NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, OptionalSharedImpostoBuilder, PagBuilder, PipelineAuthorizerResponse, PisBuilder, PisStBuilder, ProcEventoNFe, ProdBuilder, RetAutorizacaoPayload, RetAutorizacaoRequest, RetAutorizacaoResponse, RetCancNFe, RetEvento, RetEventoItem, RetiradaBuilder, Schema, SynchronousAutorizacaoResponse, TotalBuilder, TotalBuilderAggregator, TpEmis, TpEvent, TranspBuilder, VerifiedAccessKey, VoidRangePayload, XmlValidationError, schemas, vItemBuilder } from './nfe/index.js';
4
+ export { AccessKey, AccessKeyBuilder, AssembleDetXmlBuilder, AssembleNfeBuilder, AsynchronousAutorizacaoResponse, AutXMLBuilder, AutorizacaoPayload, AutorizacaoRequest, AutorizacaoResponse, AvulsaBuilder, Builder, CanaBuilder, CobrBuilder, CofinsBuilder, CofinsStBuilder, CompraBuilder, ConsultStatusPayload, ConsultStatusRequest, ConsultStatusResponse, ConsultaCadastroPayload, ConsultaCadastroRequest, ConsultaCadastroResponse, ConsultaProtocoloPayload, ConsultaProtocoloRequest, ConsultaProtocoloResponse, ContingencyOptions, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, DefaultDetBuilderAggregator, DefaultTotalBuilderAggregator, DestBuilder, DetBuilder, DetBuilderAggregator, DetEventoCancelamento, DetGroupBuilder, EmitBuilder, EntregaBuilder, EventoCancelamento, EventoCstatToCancelRegister, EventoCstatToProtocol, EventoItem, EventoItemAttributes, EventoLotePayload, EventoLoteResponse, EventoPayload, EventoRequest, EventoResponse, ExportaBuilder, ICMS, ICMS00, ICMS02, ICMS10, ICMS15, ICMS20, ICMS30, ICMS40, ICMS51, ICMS53, ICMS60, ICMS61, ICMS70, ICMS90, ICMSPart, ICMSSN, ICMSSN101, ICMSSN102, ICMSSN201, ICMSSN202, ICMSSN500, ICMSSN900, ICMSST, ICMSStandard, IIBuilder, INfeDetXmlBuilder, INfeXmlBuilder, IbscbsBuilder, IcmsBuilder, IcmsIpiBuilder, IcmsOrIssQnBuilder, IcmsufdestBuilder, IdeBuilder, ImpostoBuilder, InfAdicBuilder, InfEvento, InfEventoAttributes, InfIntermedBuilder, InfInut, InfInutAttributes, InfNFeBuilder, InfRespTecBuilder, InfSolicNFFBuilder, InutNFeAttributes, InutilizacaoPayload, InutilizacaoRequest, InutilizacaoResponse, IssIpiBuilder, IssQnBuilder, NFCe, NFCeDto, NFCeProc, NFe, NFeAttributes, NFeDto, NFeProc, NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, NfceQrcodeOptions, NfceQrcodeOptions200, NfceQrcodeOptions300, NfceQrcodeOptionsBase, NfceRemoteClient, NfceRemoteTransmitter, NfceTransmitter, NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeComplements, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, NfeRemoteClient, NfeRemoteTransmitter, NfeTransmitter, NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, OptionalSharedImpostoBuilder, PagBuilder, PipelineAuthorizerResponse, PipelineEventResponse, PisBuilder, PisStBuilder, ProcEventoNFe, ProdBuilder, RetAutorizacaoPayload, RetAutorizacaoRequest, RetAutorizacaoResponse, RetCancNFe, RetEvento, RetEventoItem, RetiradaBuilder, Schema, SynchronousAutorizacaoResponse, TotalBuilder, TotalBuilderAggregator, TpEmis, TpEvent, TranspBuilder, VerifiedAccessKey, VoidRangePayload, XmlValidationError, schemas, vItemBuilder } from './nfe/index.js';
5
5
  import 'node:stream';
6
6
  import 'node:crypto';
7
7
  import 'class-validator';