nfets 0.0.49 → 0.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-K6AWXRHY.mjs +20 -0
- package/dist/{chunk-Q47VIRPG.mjs → chunk-YQCBUAAQ.mjs} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +58 -58
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +59 -59
- package/dist/nfe/index.d.cts +20 -9
- package/dist/nfe/index.d.ts +20 -9
- package/dist/nfe/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-WR63ZGBX.mjs +0 -20
|
@@ -102,7 +102,7 @@ Actual: `+N.attribValue);else{var Se=N.tag,Ce=N.tags[N.tags.length-1]||N;Se.ns==
|
|
|
102
102
|
`+a.map(qF).join(`
|
|
103
103
|
`):" "+qF(a[0]):"as no adapter specified";throw new et("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}o(Khe,"getAdapter");var eb={getAdapter:Khe,adapters:ID};function _D(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new fi(null,r)}o(_D,"throwIfCancellationRequested");function tb(r){return _D(r),r.headers=Yr.from(r.headers),r.data=bv.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),eb.getAdapter(r.adapter||Sd.adapter,r)(r).then(o(function(n){return _D(r),n.data=bv.call(r,r.transformResponse,n),n.headers=Yr.from(n.headers),n},"onAdapterResolution"),o(function(n){return Av(n)||(_D(r),n&&n.response&&(n.response.data=bv.call(r,r.transformResponse,n.response),n.response.headers=Yr.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(tb,"dispatchRequest");var rb={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{rb[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var HF={};rb.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+gf+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new et(s(a," has been removed"+(t?" in "+t:"")),et.ERR_DEPRECATED);return t&&!HF[a]&&(HF[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");rb.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function $he(r,e,t){if(typeof r!="object")throw new et("options must be an object",et.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],c=u===void 0||a(u,i,r);if(c!==!0)throw new et("option "+i+" must be "+c,et.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new et("Unknown option "+i,et.ERR_BAD_OPTION)}}o($he,"assertOptions");var Tv={assertOptions:$he,validators:rb};var uo=Tv.validators,nb=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new hD,response:new hD}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
104
104
|
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ma(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&Tv.assertOptions(n,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),s!=null&&(ie.isFunction(s)?t.paramsSerializer={serialize:s}:Tv.assertOptions(s,{encode:uo.function,serialize:uo.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Tv.assertOptions(t,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ie.merge(i.common,i[t.method]);i&&ie.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),t.headers=Yr.concat(a,i);let u=[],c=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(c=c&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(S){l.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!c){let v=[tb.bind(this),void 0];for(v.unshift(...u),v.push(...l),g=v.length,h=Promise.resolve(t);m<g;)h=h.then(v[m++],v[m++]);return h}g=u.length;let y=t;for(;m<g;){let v=u[m++],S=u[m++];try{y=v(y)}catch(w){S.call(this,w);break}}try{h=tb.call(this,y)}catch(v){return Promise.reject(v)}for(m=0,g=l.length;m<g;)h=h.then(l[m++],l[m++]);return h}getUri(e){e=ma(this.defaults,e);let t=mf(e.baseURL,e.url,e.allowAbsoluteUrls);return df(t,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],o(function(e){nb.prototype[e]=function(t,n){return this.request(ma(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ie.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(ma(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),nb.prototype[e]=t(),nb.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var Iv=nb;var Ghe=class KF{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new fi(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new KF(o(function(s){e=s},"executor")),cancel:e}}},$F=Ghe;function DD(r){return o(function(t){return r.apply(null,t)},"wrap")}o(DD,"spread");function BD(r){return ie.isObject(r)&&r.isAxiosError===!0}o(BD,"isAxiosError");var RD={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(RD).forEach(([r,e])=>{RD[e]=r});var GF=RD;function XF(r){let e=new Iv(r),t=yv(Iv.prototype.request,e);return ie.extend(t,Iv.prototype,e,{allOwnKeys:!0}),ie.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return XF(ma(r,s))},"create"),t}o(XF,"createInstance");var En=XF(Sd);En.Axios=Iv;En.CanceledError=fi;En.CancelToken=$F;En.isCancel=Av;En.VERSION=gf;En.toFormData=xc;En.AxiosError=et;En.Cancel=En.CanceledError;En.all=o(function(e){return Promise.all(e)},"all");En.spread=DD;En.isAxiosError=BD;En.mergeConfig=ma;En.AxiosHeaders=Yr;En.formToJSON=r=>WE(ie.isHTMLForm(r)?new FormData(r):r);En.getAdapter=eb.getAdapter;En.HttpStatusCode=GF;En.default=En;var sb=En;var{Axios:CNe,AxiosError:NNe,CanceledError:TNe,isCancel:INe,CancelToken:_Ne,VERSION:DNe,all:BNe,Cancel:RNe,isAxiosError:ONe,spread:PNe,toFormData:kNe,AxiosHeaders:LNe,HttpStatusCode:VNe,formToJSON:UNe,getAdapter:jNe,mergeConfig:FNe}=sb;import Zhe from"os";import{arch as Jhe,platform as Yhe}from"os";import{join as _v,dirname as OD,resolve as Qhe}from"path";import{existsSync as ib}from"fs";import{resolve as zF}from"path";import{createRequire as WF}from"module";import{fileURLToPath as Xhe,pathToFileURL as Whe}from"url";var zhe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Ad,JF=o(()=>{if(Ad!==void 0)return Ad;if(zhe){Ad=void 0;return}try{Ad=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Ad=void 0}return Ad},"getImportMetaUrl"),YF=o(()=>{if(typeof Je<"u")return Je;let r=JF();if(r)return WF(r);let e=Whe(zF(process.cwd(),"package.json")).href;return WF(e)},"getRequireFn"),QF=o(()=>{if(typeof __filename<"u")return __filename;let r=JF();return r?Xhe(r):zF(process.cwd())},"getCurrentFile");var Dv=o(r=>YF()(r),"exportRequireModule"),ab=o(r=>{r=`${r}.node`;let e=`${Yhe()}-${Jhe()}`;if(process.env.NFETS_ADDONS_DIR)return Dv(_v(process.env.NFETS_ADDONS_DIR,r));let t=QF(),n=Qhe(t,"../../../../"),s=_v(n,"build","addons",e,r);if(ib(s))return Dv(s);let i=t;for(let a=0;a<5;a++){let u=_v(i,"build","addons",e,r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=_v(i,"node_modules","nfets","build","addons",e,r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=_v(i,"build","Release",r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var ob=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(Zhe.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
105
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=ab("winhttp_ssl_client"),{CN:i}=new Cd().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var ZF=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:tpe.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PD({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new PD({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new PD({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=sb.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(epe.platform()==="win32")try{return this.certificate?ob.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,eM.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Ii(c)}catch(t){return Zl(t)}}};var rpe=ab("xml_validator"),tM=rpe;var Q0e=Hl(A9(),1);import Y0e from"crypto";var C9="application/xml";var qt;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(qt||(qt={}));function npe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(npe,"SelectNodesEx");function spe(r,e){let t=Nd("xpath").select;return t(e,r)}o(spe,"SelectNodesNode");var N9=typeof self<"u"?npe:spe;function Hi(r){r=r.replace(/\r\n/g,`
|
|
105
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=ab("winhttp_ssl_client"),{CN:i}=new Cd().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var ZF=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:tpe.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PD({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new PD({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new PD({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=sb.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(epe.platform()==="win32")try{return this.certificate?ob.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,eM.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Ii(c)}catch(t){return Zl(t)}}};var rpe=ab("xml_validator"),tM=rpe;var Q0e=Hl(A9(),1);import Y0e from"crypto";var C9="application/xml";var qt;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(qt||(qt={}));function npe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(npe,"SelectNodesEx");function spe(r,e){let t=Nd("xpath").select;return t(e,r)}o(spe,"SelectNodesNode");var N9=typeof self<"u"?npe:spe;function Hi(r){r=r.replace(/\r\n/g,`
|
|
106
106
|
`).replace(/\r/g,`
|
|
107
107
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Nd("DOMParser"),new e().parseFromString(r,C9)}o(Hi,"Parse");function lo(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Nd("XMLSerializer"),new e().serializeToString(r)}o(lo,"Stringify");function Ab(r,e){let t=N9(r,e);return t&&t.length>0?t[0]:null}o(Ab,"SelectSingleNode");function T9(r,e){return r&&r.nodeType===e}o(T9,"isNodeType");function pi(r){return T9(r,qt.Element)}o(pi,"isElement");function xf(r){return T9(r,qt.Document)}o(xf,"isDocument");var I9=new Map;function _9(r){for(let e in r)I9.set(e,r[e])}o(_9,"setNodeDependencies");function Nd(r){let e=I9.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Nd,"getNodeDependency");var Ov="element",Pv="attribute",Cb="content";var ipe=1e9;function $D(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o($D,"assign");function Ht(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=$D({},t.items)),t.target=e}}o(Ht,"XmlElement");function Jt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=$D({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||ipe,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Ov},B9(e,s,r)}}o(Jt,"XmlChildElement");function Ur(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=$D({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=Pv,B9(e,s,r)}}o(Ur,"XmlAttribute");function B9(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(B9,"defineProperty");var Ac=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function ape(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(ape,"printf");function ope(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(ope,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=ape(yn[e],...t);this.message=`${this.prefix}${ope(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},De;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(De||(De={}));var yn={};yn[De.NONE]="No description";yn[De.NULL_REFERENCE]="Null reference";yn[De.NULL_PARAM]="'%1' has empty '%2' object";yn[De.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";yn[De.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";yn[De.METHOD_NOT_IMPLEMENTED]="Method is not implemented";yn[De.METHOD_NOT_SUPPORTED]="Method is not supported";yn[De.PARAM_REQUIRED]="Required parameter is missing '%1'";yn[De.CONVERTER_UNSUPPORTED]="Converter is not supported";yn[De.ELEMENT_MALFORMED]="Malformed element '%1'";yn[De.ELEMENT_MISSING]="Element '%1' is missing in '%2'";yn[De.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";yn[De.CONTENT_MISSING]="Content is missing in '%1'";yn[De.CRYPTOGRAPHIC]="Cryptographic error: %1";yn[De.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";yn[De.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";yn[De.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";yn[De.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";yn[De.XML_EXCEPTION]="XML exception: %1";yn[De.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var br=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(De.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Ki={get:o(r=>{if(r)return br.ToBase64(r)},"get"),set:o(r=>br.FromBase64(r),"set")},kv={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var upe="xml_root",Ws=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new $e(De.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new $e(De.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return xf(e)&&(n=e.getElementById(t)),n==null&&(n=Ab(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=Ab(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=Ab(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=upe,t=null,n=null){if(n&&!t)throw new $e(De.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Hi(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=xf(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];pi(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=xf(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(pi(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(pi(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new $e(De.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let c=t[u],l=i.items[u];switch(l.type){case Cb:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.CONTENT_MISSING,a);(h.defaultValue!==c||h.required)&&(s.textContent=m);break}case Pv:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==c||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case Ov:{let h=l,m=null;if(h.parser){if(h.required&&!c||h.minOccurs&&!c.Count){let g=c?.localName||h.localName;throw new $e(De.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(h.required||c.Count)))}else{let g=h.converter?h.converter.get(c):c;if(h.required&&g===void 0)throw new $e(De.ELEMENT_MISSING,h.localName,a);if(c!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let y of g){let v=y instanceof r?y.GetXml(!0):y;v!==null&&m&&m.appendChild(v)}else if(g instanceof r){let y=g.GetXml(!0);y&&m&&m.appendChild(y)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let w=m.childNodes.item(S);pi(w)&&g.push(w)}let y=h.minOccurs||0,v=h.maxOccurs||1/0;if(g.length<y||g.length>v)throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Hi(e).documentElement:t=e,!t)throw new $e(De.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new $e(De.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case Cb:{let c=u;if(c.required&&!t.textContent)throw new $e(De.CONTENT_MISSING,i);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case Pv:{let c=u,l,h;if(!c.localName)throw new $e(De.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),h=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),h=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(De.ATTRIBUTE_MISSING,c.localName,i);if(!l())n[a]=c.defaultValue;else{let m=h(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case Ov:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let h=new c.parser;if(!(h instanceof Td))throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new $e(De.COLLECTION_LIMIT,c.parser.localName,i);n[a]=h;continue}let l=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!pi(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(De.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,i);if(c.parser){if(l){let h=new c.parser;h.localName=c.localName,h.namespaceURI=c.namespaceURI,n[a]=h,h.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let h=l.textContent||"",m=c.converter?c.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?lo(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(De.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Td=class extends Ws{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new Ac(this.GetIterator().map(e))}Filter(e){return new Ac(this.GetIterator().filter(e))}Sort(e){return new Ac(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(De.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(pi(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Id=class extends Ac{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var cpe="[object ArrayBuffer]",vt=class WD{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===cpe}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=WD.toUint8Array(e),s=WD.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},XD="string",lpe=/^[0-9a-f\s]+$/i,fpe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,hpe=/^[a-zA-Z0-9-_]+$/,R9=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=vt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},fo=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=vt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Nt=class _d{static{o(this,"Convert")}static isHex(e){return typeof e===XD&&lpe.test(e)}static isBase64(e){return typeof e===XD&&fpe.test(e)}static isBase64Url(e){return typeof e===XD&&hpe.test(e)}static ToString(e,t="utf8"){let n=vt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return fo.toString(n,!0);case"utf16":case"utf16be":return fo.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return fo.fromString(e,!0);case"utf16":case"utf16be":return fo.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=vt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=_d.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return R9.fromString(e);case"utf16":case"utf16be":return fo.fromString(e);case"utf16le":case"usc2":return fo.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=_d.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return R9.toString(e);case"utf16":case"utf16be":return fo.toString(e);case"utf16le":case"usc2":return fo.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=vt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=vt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return fo.toString(e,t)}static FromUtf16String(e,t=!1){return fo.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Nt.DEFAULT_UTF8_ENCODING="utf8";function O(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(O,"getParametersValue");function Nb(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(Nb,"bufferToHexCodes");function Yo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(Yo,"utilFromBase");function ga(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);l[i-h-1]=Math.floor(s/m),s-=l[i-h-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(ga,"utilToBase");function wf(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(wf,"utilConcatBuf");function Tb(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(Tb,"utilConcatView");function zD(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=Yo(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,Yo(i,8)-n}o(zD,"utilDecodeTC");function P9(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=ga(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let s=ga(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let c=0;c<a.byteLength;c++)i[c+1]=u[c];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(P9,"utilEncodeTC");function Cc(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Cc,"isEqualBuffer");function zs(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(zs,"padNumber");var k9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",L9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function Ib(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",c=e?L9:k9;if(n){let l=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){l=h;break}r=r.slice(l)}for(;s<r.length;){let l=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=l>>2,y=(l&3)<<4|h>>4,v=(h&15)<<2|m>>6,S=m&63;i===1?v=S=64:a===1&&(S=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(y)}`:S===64?u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(S)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(S)}`}return u}o(Ib,"toBase64");function Dd(r,e=!1,t=!1){let n=e?L9:k9;function s(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(s,"indexOf");function i(c){return c===64?0:c}o(i,"test");let a=0,u="";for(;a<r.length;){let c=s(r.charAt(a++)),l=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(c)<<2|i(l)>>4,y=(i(l)&15)<<4|i(h)>>2,v=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(y)),m!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,l=-1;for(let h=c-1;h>=0;h--)if(u.charCodeAt(h)!==0){l=h;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(Dd,"fromBase64");function Lv(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(Lv,"arrayBufferToString");function Sf(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Sf,"stringToArrayBuffer");var ppe=Math.log(2);function V9(r){let e=Math.log(r)/ppe,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(V9,"nearestPowerOf2");function ke(r,e){for(let t of e)delete r[t]}o(ke,"clearProps");function _b(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(_b,"assertBigInt");function ZD(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(ZD,"concat");function Qo(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(Qo,"checkBufferParams");var eB=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ZD(this.items)}},Vv=[new Uint8Array([1])],j9="0123456789",JD="name",F9="valueHexView",dpe="isHexOnly",mpe="idBlock",gpe="tagClass",vpe="tagNumber",ype="isConstructed",xpe="fromBER",wpe="toBER",Spe="local",Js="",va=new ArrayBuffer(0),Db=new Uint8Array(0),jv="EndOfContent",q9="OCTET STRING",H9="BIT STRING";function Zo(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?vt.toUint8Array(i.valueHex):Db}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Qo(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",va)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Nt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(Zo,"HexBlock");var Ef=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Js,warnings:n=[],valueBeforeDecode:s=Db}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=vt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Nt.ToHex(this.valueBeforeDecodeView)}}};Ef.NAME="baseBlock";var Ys=class extends Ef{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ys.NAME="valueBlock";var K9=class extends Zo(Ef){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?vt.toUint8Array(e.valueHex):Db,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",va}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=ga(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=i[c]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),h=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let g=new Uint8Array(h);for(let y=0;y<l.length;y++)g[y]=l[y];l=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,l[c-1]=i[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(m),this.blockLength<=9?this.tagNumber=Yo(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};K9.NAME="identificationBlock";var $9=class extends Ef{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=s.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Yo(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=ga(this.length,8);if(s.byteLength>127)return this.error="Too big length",va;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};$9.NAME="lengthBlock";var ht={},Is=class extends Ef{static{o(this,"BaseBlock")}constructor({name:e=Js,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new K9(s),this.lenBlock=new $9(s),this.valueBlock=i?new i(s):new Ys(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new eB;t||G9(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?va:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Nt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Nt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Cc(t,n)}};Is.NAME="BaseBlock";function G9(r){var e;if(r instanceof ht.Constructed)for(let t of r.valueBlock.value)G9(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(G9,"prepareIndefiniteForm");var X9=class extends Is{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Js,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};X9.NAME="BaseStringBlock";var W9=class extends Zo(Ys){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};W9.NAME="PrimitiveValueBlock";var z9,xt=class extends Is{static{o(this,"Primitive")}constructor(e={}){super(e,W9),this.idBlock.isConstructed=!1}};z9=xt;ht.Primitive=z9;xt.NAME="PRIMITIVE";function Epe(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(Epe,"localChangeType");function Fv(r,e=0,t=r.length){let n=e,s=new Is({},Ys),i=new Ef;if(!Qo(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let c=Is;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};c=ht.EndOfContent;break;case 1:c=ht.Boolean;break;case 2:c=ht.Integer;break;case 3:c=ht.BitString;break;case 4:c=ht.OctetString;break;case 5:c=ht.Null;break;case 6:c=ht.ObjectIdentifier;break;case 10:c=ht.Enumerated;break;case 12:c=ht.Utf8String;break;case 13:c=ht.RelativeObjectIdentifier;break;case 14:c=ht.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:c=ht.Sequence;break;case 17:c=ht.Set;break;case 18:c=ht.NumericString;break;case 19:c=ht.PrintableString;break;case 20:c=ht.TeletexString;break;case 21:c=ht.VideotexString;break;case 22:c=ht.IA5String;break;case 23:c=ht.UTCTime;break;case 24:c=ht.GeneralizedTime;break;case 25:c=ht.GraphicString;break;case 26:c=ht.VisibleString;break;case 27:c=ht.GeneralString;break;case 28:c=ht.UniversalString;break;case 29:c=ht.CharacterString;break;case 30:c=ht.BmpString;break;case 31:c=ht.DATE;break;case 32:c=ht.TimeOfDay;break;case 33:c=ht.DateTime;break;case 34:c=ht.Duration;break;default:{let l=s.idBlock.isConstructed?new ht.Constructed:new ht.Primitive;l.idBlock=s.idBlock,l.lenBlock=s.lenBlock,l.warnings=s.warnings,s=l}}break;case 2:case 3:case 4:default:c=s.idBlock.isConstructed?ht.Constructed:ht.Primitive}return s=Epe(s,c),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(Fv,"localFromBER");function Qr(r){if(!r.byteLength){let e=new Is({},Ys);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Fv(vt.toUint8Array(r).slice(),0,r.byteLength)}o(Qr,"fromBER");function bpe(r,e){return r?1:e}o(bpe,"checkLen");var Nc=class extends Ys{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;bpe(this.isIndefiniteForm,n)>0;){let a=Fv(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===jv)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===jv?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new eB;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?va:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Nc.NAME="ConstructedValueBlock";var J9,fe=class extends Is{static{o(this,"Constructed")}constructor(e={}){super(e,Nc),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
108
108
|
`).map(s=>` ${s}`).join(`
|
package/dist/core/index.cjs
CHANGED
|
@@ -102,7 +102,7 @@ Actual: `+N.attribValue);else{var Se=N.tag,Ce=N.tags[N.tags.length-1]||N;Se.ns==
|
|
|
102
102
|
`+a.map(s7).join(`
|
|
103
103
|
`):" "+s7(a[0]):"as no adapter specified";throw new Ze("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}o(Jge,"getAdapter");var Qb={getAdapter:Jge,adapters:ER};function bR(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new xi(null,r)}o(bR,"throwIfCancellationRequested");function Zb(r){return bR(r),r.headers=nn.from(r.headers),r.data=iv.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Qb.getAdapter(r.adapter||Kd.adapter,r)(r).then(o(function(n){return bR(r),n.data=iv.call(r,r.transformResponse,n),n.headers=nn.from(n.headers),n},"onAdapterResolution"),o(function(n){return av(n)||(bR(r),n&&n.response&&(n.response.data=iv.call(r,r.transformResponse,n.response),n.response.headers=nn.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(Zb,"dispatchRequest");var eA={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{eA[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var i7={};eA.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+Lf+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new Ze(s(a," has been removed"+(t?" in "+t:"")),Ze.ERR_DEPRECATED);return t&&!i7[a]&&(i7[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");eA.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function Yge(r,e,t){if(typeof r!="object")throw new Ze("options must be an object",Ze.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],c=u===void 0||a(u,i,r);if(c!==!0)throw new Ze("option "+i+" must be "+c,Ze.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ze("Unknown option "+i,Ze.ERR_BAD_OPTION)}}o(Yge,"assertOptions");var cv={assertOptions:Yge,validators:eA};var wo=cv.validators,tA=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new sR,response:new sR}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
104
104
|
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Aa(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&cv.assertOptions(n,{silentJSONParsing:wo.transitional(wo.boolean),forcedJSONParsing:wo.transitional(wo.boolean),clarifyTimeoutError:wo.transitional(wo.boolean)},!1),s!=null&&(ie.isFunction(s)?t.paramsSerializer={serialize:s}:cv.assertOptions(s,{encode:wo.function,serialize:wo.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cv.assertOptions(t,{baseUrl:wo.spelling("baseURL"),withXsrfToken:wo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ie.merge(i.common,i[t.method]);i&&ie.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=nn.concat(a,i);let u=[],c=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(c=c&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(S){l.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!c){let y=[Zb.bind(this),void 0];for(y.unshift(...u),y.push(...l),g=y.length,h=Promise.resolve(t);m<g;)h=h.then(y[m++],y[m++]);return h}g=u.length;let v=t;for(;m<g;){let y=u[m++],S=u[m++];try{v=y(v)}catch(w){S.call(this,w);break}}try{h=Zb.call(this,v)}catch(y){return Promise.reject(y)}for(m=0,g=l.length;m<g;)h=h.then(l[m++],l[m++]);return h}getUri(e){e=Aa(this.defaults,e);let t=kf(e.baseURL,e.url,e.allowAbsoluteUrls);return Pf(t,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],o(function(e){tA.prototype[e]=function(t,n){return this.request(Aa(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ie.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(Aa(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),tA.prototype[e]=t(),tA.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var lv=tA;var Qge=class a7{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new xi(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new a7(o(function(s){e=s},"executor")),cancel:e}}},o7=Qge;function AR(r){return o(function(t){return r.apply(null,t)},"wrap")}o(AR,"spread");function CR(r){return ie.isObject(r)&&r.isAxiosError===!0}o(CR,"isAxiosError");var NR={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(NR).forEach(([r,e])=>{NR[e]=r});var u7=NR;function c7(r){let e=new lv(r),t=ev(lv.prototype.request,e);return ie.extend(t,lv.prototype,e,{allOwnKeys:!0}),ie.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return c7(Aa(r,s))},"create"),t}o(c7,"createInstance");var Tn=c7(Kd);Tn.Axios=lv;Tn.CanceledError=xi;Tn.CancelToken=o7;Tn.isCancel=av;Tn.VERSION=Lf;Tn.toFormData=Fc;Tn.AxiosError=Ze;Tn.Cancel=Tn.CanceledError;Tn.all=o(function(e){return Promise.all(e)},"all");Tn.spread=AR;Tn.isAxiosError=CR;Tn.mergeConfig=Aa;Tn.AxiosHeaders=nn;Tn.formToJSON=r=>Gb(ie.isHTMLForm(r)?new FormData(r):r);Tn.getAdapter=Qb.getAdapter;Tn.HttpStatusCode=u7;Tn.default=Tn;var rA=Tn;var{Axios:ZRe,AxiosError:eOe,CanceledError:tOe,isCancel:rOe,CancelToken:nOe,VERSION:sOe,all:iOe,Cancel:aOe,isAxiosError:oOe,spread:uOe,toFormData:cOe,AxiosHeaders:lOe,HttpStatusCode:fOe,formToJSON:hOe,getAdapter:pOe,mergeConfig:dOe}=rA;var p7=cr(require("os"),1);var sA=require("os"),Yi=require("path"),hv=require("fs");var IR=require("path"),TR=require("module"),nA=require("url");var Zge=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Xd,l7=o(()=>{if(Xd!==void 0)return Xd;if(Zge){Xd=void 0;return}try{Xd=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Xd=void 0}return Xd},"getImportMetaUrl"),f7=o(()=>{if(typeof require<"u")return require;let r=l7();if(r)return(0,TR.createRequire)(r);let e=(0,nA.pathToFileURL)((0,IR.resolve)(process.cwd(),"package.json")).href;return(0,TR.createRequire)(e)},"getRequireFn"),h7=o(()=>{if(typeof __filename<"u")return __filename;let r=l7();return r?(0,nA.fileURLToPath)(r):(0,IR.resolve)(process.cwd())},"getCurrentFile");var fv=o(r=>f7()(r),"exportRequireModule"),iA=o(r=>{r=`${r}.node`;let e=`${(0,sA.platform)()}-${(0,sA.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return fv((0,Yi.join)(process.env.NFETS_ADDONS_DIR,r));let t=h7(),n=(0,Yi.resolve)(t,"../../../../"),s=(0,Yi.join)(n,"build","addons",e,r);if((0,hv.existsSync)(s))return fv(s);let i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"build","addons",e,r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"node_modules","nfets","build","addons",e,r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"build","Release",r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var aA=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(p7.default.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
105
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=iA("winhttp_ssl_client"),{CN:i}=new xf().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var _R=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:m7.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new oA.Agent({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new oA.Agent({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new oA.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=rA.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(d7.default.platform()==="win32")try{return this.certificate?aA.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,g7.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Li(c)}catch(t){return vf(t)}}};var eye=iA("xml_validator"),y7=eye;var _X=cr(require("crypto"),1),zxe=cr(jK(),1);var MK="application/xml";var Ht;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ht||(Ht={}));function tye(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(tye,"SelectNodesEx");function rye(r,e){let t=Wd("xpath").select;return t(e,r)}o(rye,"SelectNodesNode");var qK=typeof self<"u"?tye:rye;function Qi(r){r=r.replace(/\r\n/g,`
|
|
105
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=iA("winhttp_ssl_client"),{CN:i}=new xf().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var _R=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:m7.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new oA.Agent({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new oA.Agent({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new oA.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=rA.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(d7.default.platform()==="win32")try{return this.certificate?aA.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,g7.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Li(c)}catch(t){return vf(t)}}};var eye=iA("xml_validator"),y7=eye;var _X=cr(require("crypto"),1),zxe=cr(jK(),1);var MK="application/xml";var Ht;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ht||(Ht={}));function tye(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(tye,"SelectNodesEx");function rye(r,e){let t=Wd("xpath").select;return t(e,r)}o(rye,"SelectNodesNode");var qK=typeof self<"u"?tye:rye;function Qi(r){r=r.replace(/\r\n/g,`
|
|
106
106
|
`).replace(/\r/g,`
|
|
107
107
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Wd("DOMParser"),new e().parseFromString(r,MK)}o(Qi,"Parse");function Eo(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Wd("XMLSerializer"),new e().serializeToString(r)}o(Eo,"Stringify");function AA(r,e){let t=qK(r,e);return t&&t.length>0?t[0]:null}o(AA,"SelectSingleNode");function HK(r,e){return r&&r.nodeType===e}o(HK,"isNodeType");function Si(r){return HK(r,Ht.Element)}o(Si,"isElement");function Ff(r){return HK(r,Ht.Document)}o(Ff,"isDocument");var KK=new Map;function $K(r){for(let e in r)KK.set(e,r[e])}o($K,"setNodeDependencies");function Wd(r){let e=KK.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Wd,"getNodeDependency");var mv="element",gv="attribute",CA="content";var nye=1e9;function jR(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(jR,"assign");function Kt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=jR({},t.items)),t.target=e}}o(Kt,"XmlElement");function Yt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=jR({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||nye,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:mv},XK(e,s,r)}}o(Yt,"XmlChildElement");function Mr(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=jR({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=gv,XK(e,s,r)}}o(Mr,"XmlAttribute");function XK(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(XK,"defineProperty");var qc=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function sye(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(sye,"printf");function iye(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(iye,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=sye(bn[e],...t);this.message=`${this.prefix}${iye(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},De;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(De||(De={}));var bn={};bn[De.NONE]="No description";bn[De.NULL_REFERENCE]="Null reference";bn[De.NULL_PARAM]="'%1' has empty '%2' object";bn[De.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";bn[De.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";bn[De.METHOD_NOT_IMPLEMENTED]="Method is not implemented";bn[De.METHOD_NOT_SUPPORTED]="Method is not supported";bn[De.PARAM_REQUIRED]="Required parameter is missing '%1'";bn[De.CONVERTER_UNSUPPORTED]="Converter is not supported";bn[De.ELEMENT_MALFORMED]="Malformed element '%1'";bn[De.ELEMENT_MISSING]="Element '%1' is missing in '%2'";bn[De.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";bn[De.CONTENT_MISSING]="Content is missing in '%1'";bn[De.CRYPTOGRAPHIC]="Cryptographic error: %1";bn[De.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";bn[De.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";bn[De.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";bn[De.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";bn[De.XML_EXCEPTION]="XML exception: %1";bn[De.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var Tr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(De.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Zi={get:o(r=>{if(r)return Tr.ToBase64(r)},"get"),set:o(r=>Tr.FromBase64(r),"set")},yv={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var aye="xml_root",ti=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new $e(De.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new $e(De.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Ff(e)&&(n=e.getElementById(t)),n==null&&(n=AA(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=AA(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=AA(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=aye,t=null,n=null){if(n&&!t)throw new $e(De.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Qi(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Ff(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];Si(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=Ff(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(Si(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(Si(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new $e(De.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let c=t[u],l=i.items[u];switch(l.type){case CA:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.CONTENT_MISSING,a);(h.defaultValue!==c||h.required)&&(s.textContent=m);break}case gv:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==c||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case mv:{let h=l,m=null;if(h.parser){if(h.required&&!c||h.minOccurs&&!c.Count){let g=c?.localName||h.localName;throw new $e(De.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(h.required||c.Count)))}else{let g=h.converter?h.converter.get(c):c;if(h.required&&g===void 0)throw new $e(De.ELEMENT_MISSING,h.localName,a);if(c!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let v of g){let y=v instanceof r?v.GetXml(!0):v;y!==null&&m&&m.appendChild(y)}else if(g instanceof r){let v=g.GetXml(!0);v&&m&&m.appendChild(v)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let w=m.childNodes.item(S);Si(w)&&g.push(w)}let v=h.minOccurs||0,y=h.maxOccurs||1/0;if(g.length<v||g.length>y)throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Qi(e).documentElement:t=e,!t)throw new $e(De.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new $e(De.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case CA:{let c=u;if(c.required&&!t.textContent)throw new $e(De.CONTENT_MISSING,i);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case gv:{let c=u,l,h;if(!c.localName)throw new $e(De.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),h=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),h=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(De.ATTRIBUTE_MISSING,c.localName,i);if(!l())n[a]=c.defaultValue;else{let m=h(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case mv:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let h=new c.parser;if(!(h instanceof zd))throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new $e(De.COLLECTION_LIMIT,c.parser.localName,i);n[a]=h;continue}let l=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!Si(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(De.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,i);if(c.parser){if(l){let h=new c.parser;h.localName=c.localName,h.namespaceURI=c.namespaceURI,n[a]=h,h.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let h=l.textContent||"",m=c.converter?c.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Eo(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(De.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var zd=class extends ti{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new qc(this.GetIterator().map(e))}Filter(e){return new qc(this.GetIterator().filter(e))}Sort(e){return new qc(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(De.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(Si(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Jd=class extends qc{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var oye="[object ArrayBuffer]",gt=class HR{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===oye}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=HR.toUint8Array(e),s=HR.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},qR="string",uye=/^[0-9a-f\s]+$/i,cye=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,lye=/^[a-zA-Z0-9-_]+$/,WK=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=gt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},bo=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=gt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Nt=class Yd{static{o(this,"Convert")}static isHex(e){return typeof e===qR&&uye.test(e)}static isBase64(e){return typeof e===qR&&cye.test(e)}static isBase64Url(e){return typeof e===qR&&lye.test(e)}static ToString(e,t="utf8"){let n=gt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return bo.toString(n,!0);case"utf16":case"utf16be":return bo.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return bo.fromString(e,!0);case"utf16":case"utf16be":return bo.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=gt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=Yd.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return WK.fromString(e);case"utf16":case"utf16be":return bo.fromString(e);case"utf16le":case"usc2":return bo.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Yd.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return WK.toString(e);case"utf16":case"utf16be":return bo.toString(e);case"utf16le":case"usc2":return bo.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=gt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=gt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return bo.toString(e,t)}static FromUtf16String(e,t=!1){return bo.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Nt.DEFAULT_UTF8_ENCODING="utf8";function O(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(O,"getParametersValue");function NA(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(NA,"bufferToHexCodes");function hu(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(hu,"utilFromBase");function Ca(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);l[i-h-1]=Math.floor(s/m),s-=l[i-h-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Ca,"utilToBase");function jf(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(jf,"utilConcatBuf");function TA(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(TA,"utilConcatView");function KR(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=hu(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,hu(i,8)-n}o(KR,"utilDecodeTC");function JK(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Ca(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let s=Ca(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let c=0;c<a.byteLength;c++)i[c+1]=u[c];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(JK,"utilEncodeTC");function Hc(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Hc,"isEqualBuffer");function ri(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(ri,"padNumber");var YK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",QK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function IA(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",c=e?QK:YK;if(n){let l=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){l=h;break}r=r.slice(l)}for(;s<r.length;){let l=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=l>>2,v=(l&3)<<4|h>>4,y=(h&15)<<2|m>>6,S=m&63;i===1?y=S=64:a===1&&(S=64),t?y===64?u+=`${c.charAt(g)}${c.charAt(v)}`:S===64?u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}`:u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}${c.charAt(S)}`:u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}${c.charAt(S)}`}return u}o(IA,"toBase64");function Qd(r,e=!1,t=!1){let n=e?QK:YK;function s(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(s,"indexOf");function i(c){return c===64?0:c}o(i,"test");let a=0,u="";for(;a<r.length;){let c=s(r.charAt(a++)),l=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(c)<<2|i(l)>>4,v=(i(l)&15)<<4|i(h)>>2,y=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(v)),m!==64&&(u+=String.fromCharCode(y))}if(t){let c=u.length,l=-1;for(let h=c-1;h>=0;h--)if(u.charCodeAt(h)!==0){l=h;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(Qd,"fromBase64");function vv(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(vv,"arrayBufferToString");function Mf(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Mf,"stringToArrayBuffer");var fye=Math.log(2);function ZK(r){let e=Math.log(r)/fye,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(ZK,"nearestPowerOf2");function ke(r,e){for(let t of e)delete r[t]}o(ke,"clearProps");function _A(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(_A,"assertBigInt");function WR(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(WR,"concat");function pu(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(pu,"checkBufferParams");var zR=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return WR(this.items)}},xv=[new Uint8Array([1])],t$="0123456789",$R="name",r$="valueHexView",hye="isHexOnly",pye="idBlock",dye="tagClass",mye="tagNumber",gye="isConstructed",yye="fromBER",vye="toBER",xye="local",ni="",Na=new ArrayBuffer(0),DA=new Uint8Array(0),Sv="EndOfContent",s$="OCTET STRING",i$="BIT STRING";function du(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?gt.toUint8Array(i.valueHex):DA}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!pu(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Na)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Nt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(du,"HexBlock");var qf=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=ni,warnings:n=[],valueBeforeDecode:s=DA}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=gt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Nt.ToHex(this.valueBeforeDecodeView)}}};qf.NAME="baseBlock";var si=class extends qf{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};si.NAME="valueBlock";var a$=class extends du(qf){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?gt.toUint8Array(e.valueHex):DA,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Na}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=Ca(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=i[c]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),h=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let g=new Uint8Array(h);for(let v=0;v<l.length;v++)g[v]=l[v];l=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,l[c-1]=i[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(m),this.blockLength<=9?this.tagNumber=hu(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};a$.NAME="identificationBlock";var o$=class extends qf{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=s.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hu(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=Ca(this.length,8);if(s.byteLength>127)return this.error="Too big length",Na;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};o$.NAME="lengthBlock";var ft={},ks=class extends qf{static{o(this,"BaseBlock")}constructor({name:e=ni,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new a$(s),this.lenBlock=new o$(s),this.valueBlock=i?new i(s):new si(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new zR;t||u$(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?Na:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Nt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Nt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Hc(t,n)}};ks.NAME="BaseBlock";function u$(r){var e;if(r instanceof ft.Constructed)for(let t of r.valueBlock.value)u$(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(u$,"prepareIndefiniteForm");var c$=class extends ks{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=ni,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};c$.NAME="BaseStringBlock";var l$=class extends du(si){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};l$.NAME="PrimitiveValueBlock";var f$,vt=class extends ks{static{o(this,"Primitive")}constructor(e={}){super(e,l$),this.idBlock.isConstructed=!1}};f$=vt;ft.Primitive=f$;vt.NAME="PRIMITIVE";function wye(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(wye,"localChangeType");function Ev(r,e=0,t=r.length){let n=e,s=new ks({},si),i=new qf;if(!pu(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let c=ks;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};c=ft.EndOfContent;break;case 1:c=ft.Boolean;break;case 2:c=ft.Integer;break;case 3:c=ft.BitString;break;case 4:c=ft.OctetString;break;case 5:c=ft.Null;break;case 6:c=ft.ObjectIdentifier;break;case 10:c=ft.Enumerated;break;case 12:c=ft.Utf8String;break;case 13:c=ft.RelativeObjectIdentifier;break;case 14:c=ft.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:c=ft.Sequence;break;case 17:c=ft.Set;break;case 18:c=ft.NumericString;break;case 19:c=ft.PrintableString;break;case 20:c=ft.TeletexString;break;case 21:c=ft.VideotexString;break;case 22:c=ft.IA5String;break;case 23:c=ft.UTCTime;break;case 24:c=ft.GeneralizedTime;break;case 25:c=ft.GraphicString;break;case 26:c=ft.VisibleString;break;case 27:c=ft.GeneralString;break;case 28:c=ft.UniversalString;break;case 29:c=ft.CharacterString;break;case 30:c=ft.BmpString;break;case 31:c=ft.DATE;break;case 32:c=ft.TimeOfDay;break;case 33:c=ft.DateTime;break;case 34:c=ft.Duration;break;default:{let l=s.idBlock.isConstructed?new ft.Constructed:new ft.Primitive;l.idBlock=s.idBlock,l.lenBlock=s.lenBlock,l.warnings=s.warnings,s=l}}break;case 2:case 3:case 4:default:c=s.idBlock.isConstructed?ft.Constructed:ft.Primitive}return s=wye(s,c),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(Ev,"localFromBER");function sn(r){if(!r.byteLength){let e=new ks({},si);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Ev(gt.toUint8Array(r).slice(),0,r.byteLength)}o(sn,"fromBER");function Sye(r,e){return r?1:e}o(Sye,"checkLen");var Kc=class extends si{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;Sye(this.isIndefiniteForm,n)>0;){let a=Ev(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Sv)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Sv?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new zR;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Na:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Kc.NAME="ConstructedValueBlock";var h$,fe=class extends ks{static{o(this,"Constructed")}constructor(e={}){super(e,Kc),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
108
108
|
`).map(s=>` ${s}`).join(`
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"../chunk-23RWB4QQ.mjs";import{$ as T,A as w,C as x,D as y,G as z,H as A,I as B,J as C,K as D,M as E,N as F,O as G,P as H,Q as I,R as J,S as K,T as L,U as M,V as N,W as O,X as P,Y as Q,Z as R,_ as S,a,aa as U,b,ba as V,c,ca as W,d,da as X,e,ea as Y,f,fa as Z,g,ga as _,h,ha as $,ia as aa,j as i,ja as ba,k as j,ka as ca,la as da,m as k,ma as ea,p as l,q as m,r as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"../chunk-
|
|
2
|
+
import"../chunk-23RWB4QQ.mjs";import{$ as T,A as w,C as x,D as y,G as z,H as A,I as B,J as C,K as D,M as E,N as F,O as G,P as H,Q as I,R as J,S as K,T as L,U as M,V as N,W as O,X as P,Y as Q,Z as R,_ as S,a,aa as U,b,ba as V,c,ca as W,d,da as X,e,ea as Y,f,fa as Z,g,ga as _,h,ha as $,ia as aa,j as i,ja as ba,k as j,ka as ca,la as da,m as k,ma as ea,p as l,q as m,r as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"../chunk-YQCBUAAQ.mjs";import"../chunk-W6MRGYXP.mjs";export{ea as ASN1,b as CanonicalizationMethod,C as Choice,v as Decimal,e as DigestAlgorithm,l as EntitySigner,h as Environment,B as IsDecimal,w as MemoryCacheAdapter,i as NFeTsError,y as NativeCertificateRepository,x as NullCacheAdapter,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,k as Signer,p as SkipAllValidations,o as SkipValidation,n as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,g as StateAcronyms,F as StateCodeAcValidator,G as StateCodeAlValidator,H as StateCodeAmValidator,I as StateCodeApValidator,J as StateCodeBaValidator,K as StateCodeCeValidator,L as StateCodeDfValidator,M as StateCodeEsValidator,N as StateCodeGoValidator,O as StateCodeMaValidator,P as StateCodeMgValidator,Q as StateCodeMsValidator,R as StateCodeMtValidator,S as StateCodePaValidator,T as StateCodePbValidator,U as StateCodePeValidator,V as StateCodePiValidator,W as StateCodePrValidator,X as StateCodeRjValidator,Y as StateCodeRnValidator,Z as StateCodeRoValidator,_ as StateCodeRrValidator,$ as StateCodeRsValidator,aa as StateCodeScValidator,ba as StateCodeSeValidator,ca as StateCodeSpValidator,da as StateCodeToValidator,f as StateCodes,E as TransformDateString,D as TransformDecimal,s as ValidateErrorsMetadata,u as Validates,j as ValidationError,A as Xml2JsToolkit,m as XmlSigner,q as clearEmptyValues,t as mapConstraintsToErrors,r as plainToInstance};
|