nfets 0.0.67 → 0.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"./chunk-23RWB4QQ.mjs";import{a as po,b as to,c as xo,d as ao,e as bo,f as co,g as go,h as ho,i as io,j as jo,k as ko,l as lo,m as no,n as qo,o as so,p as uo,q as vo,r as wo,s as yo,t as zo,u as Ao,v as Bo,w as Co,x as Do,y as Eo}from"./chunk-CVR2V26Q.mjs";import{$ as T,A as v,C as w,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 as o,aa as U,b as r,ba as V,c as e,ca as W,d as f,da as X,e as m,ea as Y,f as p,fa as Z,g as t,ga as _,h as x,ha as $,ia as oo,j as a,ja as ro,k as b,ka as eo,la as fo,m as c,ma as mo,p as d,q as g,r as h,s as i,t as j,u as k,v as l,w as n,x as q,y as s,z as u}from"./chunk-5546UMJT.mjs";import"./chunk-W6MRGYXP.mjs";export{mo as ASN1,ao as AccessKeyBuilder,r as CanonicalizationMethod,C as Choice,Do as DanfceDefaultPdfDocument,Eo as DanfceReducedPdfDocument,u as Decimal,bo as DefaultDetBuilderAggregator,co as DefaultTotalBuilderAggregator,m as DigestAlgorithm,d as EntitySigner,x as Environment,B as IsDecimal,v as MemoryCacheAdapter,Ao as NFCeDto,vo as NFeDto,a as NFeTsError,y as NativeCertificateRepository,ko as NfceAuthorizerPipeline,no as NfceConsultStatusPipeline,jo as NfceQrcode,io as NfceRemoteTransmitter,Bo as NfceXmlBuilder,Co as NfceXmlBuilderPipeline,qo as NfeAuthorizationResponsePipeline,ho as NfeAuthorizerPipeline,lo as NfeConsultStatusPipeline,wo as NfeDetXmlBuilder,so as NfeNfceCancelPipeline,uo as NfeNfceVoidRangePipeline,go as NfeRemoteTransmitter,yo as NfeXmlBuilder,zo as NfeXmlBuilderPipeline,w as NullCacheAdapter,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,c as Signer,j as SkipAllValidations,i as SkipValidation,h as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,t 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,oo as StateCodeScValidator,ro as StateCodeSeValidator,eo as StateCodeSpValidator,fo as StateCodeToValidator,p as StateCodes,po as TpEmis,to as TpEvent,E as TransformDateString,D as TransformDecimal,n as ValidateErrorsMetadata,s as Validates,b as ValidationError,A as Xml2JsToolkit,g as XmlSigner,k as clearEmptyValues,q as mapConstraintsToErrors,l as plainToInstance,xo as schemas};
2
+ import"./chunk-23RWB4QQ.mjs";import{a as po,b as to,c as xo,d as ao,e as bo,f as co,g as go,h as ho,i as io,j as jo,k as ko,l as lo,m as no,n as qo,o as so,p as uo,q as vo,r as wo,s as yo,t as zo,u as Ao,v as Bo,w as Co,x as Do,y as Eo}from"./chunk-KAMB2EUD.mjs";import{$ as T,A as v,C as w,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 as o,aa as U,b as r,ba as V,c as e,ca as W,d as f,da as X,e as m,ea as Y,f as p,fa as Z,g as t,ga as _,h as x,ha as $,ia as oo,j as a,ja as ro,k as b,ka as eo,la as fo,m as c,ma as mo,p as d,q as g,r as h,s as i,t as j,u as k,v as l,w as n,x as q,y as s,z as u}from"./chunk-5546UMJT.mjs";import"./chunk-W6MRGYXP.mjs";export{mo as ASN1,ao as AccessKeyBuilder,r as CanonicalizationMethod,C as Choice,Do as DanfceDefaultPdfDocument,Eo as DanfceReducedPdfDocument,u as Decimal,bo as DefaultDetBuilderAggregator,co as DefaultTotalBuilderAggregator,m as DigestAlgorithm,d as EntitySigner,x as Environment,B as IsDecimal,v as MemoryCacheAdapter,Ao as NFCeDto,vo as NFeDto,a as NFeTsError,y as NativeCertificateRepository,ko as NfceAuthorizerPipeline,no as NfceConsultStatusPipeline,jo as NfceQrcode,io as NfceRemoteTransmitter,Bo as NfceXmlBuilder,Co as NfceXmlBuilderPipeline,qo as NfeAuthorizationResponsePipeline,ho as NfeAuthorizerPipeline,lo as NfeConsultStatusPipeline,wo as NfeDetXmlBuilder,so as NfeNfceCancelPipeline,uo as NfeNfceVoidRangePipeline,go as NfeRemoteTransmitter,yo as NfeXmlBuilder,zo as NfeXmlBuilderPipeline,w as NullCacheAdapter,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,c as Signer,j as SkipAllValidations,i as SkipValidation,h as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,t 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,oo as StateCodeScValidator,ro as StateCodeSeValidator,eo as StateCodeSpValidator,fo as StateCodeToValidator,p as StateCodes,po as TpEmis,to as TpEvent,E as TransformDateString,D as TransformDecimal,n as ValidateErrorsMetadata,s as Validates,b as ValidationError,A as Xml2JsToolkit,g as XmlSigner,k as clearEmptyValues,q as mapConstraintsToErrors,l as plainToInstance,xo as schemas};
@@ -109,7 +109,7 @@ Minimum version required to store current data is: `+s+`.
109
109
  `}return u+=c+`
110
110
  `,typeof t=="function"&&t(null,u),u}});var Aae=Q(Eae=>{"use strict";var S_e="\x1B[47m",b_e="\x1B[40m",VU="\x1B[37m",jU="\x1B[30m",iy="\x1B[0m",x_e=S_e+jU,w_e=b_e+VU,C_e=o(function(r,e,t){return{"00":iy+" "+r,"01":iy+e+"\u2584"+r,"02":iy+t+"\u2584"+r,10:iy+e+"\u2580"+r,11:" ",12:"\u2584",20:iy+t+"\u2580"+r,21:"\u2580",22:"\u2588"}},"createPalette"),wae=o(function(r,e,t,n){let i=e+1;if(t>=i||n>=i||n<-1||t<-1)return"0";if(t>=e||n>=e||n<0||t<0)return"1";let s=n*e+t;return r[s]?"2":"1"},"mkCodePixel"),Cae=o(function(r,e,t,n){return wae(r,e,t,n)+wae(r,e,t,n+1)},"mkCode");Eae.render=function(r,e,t){let n=r.modules.size,i=r.modules.data,s=!!(e&&e.inverse),a=e&&e.inverse?w_e:x_e,l=C_e(a,s?jU:VU,s?VU:jU),p=iy+`
111
111
  `+a,d=a;for(let g=-1;g<n+1;g+=2){for(let y=-1;y<n;y++)d+=l[Cae(i,n,y,g)];d+=l[Cae(i,n,n,g)]+p}return d+=iy,typeof t=="function"&&t(null,d),d}});var Iae=Q(Nae=>{"use strict";var E_e=xae(),A_e=Aae();Nae.render=function(r,e,t){return e&&e.small?A_e.render(r,e,t):E_e.render(r,e,t)}});var UU=Q(Rae=>{"use strict";var N_e=fI();function Tae(r,e){let t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}o(Tae,"getColorAttrib");function MU(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}o(MU,"svgCmd");function I_e(r,e,t){let n="",i=0,s=!1,a=0;for(let u=0;u<r.length;u++){let c=Math.floor(u%e),l=Math.floor(u/e);!c&&!s&&(s=!0),r[u]?(a++,u>0&&c>0&&r[u-1]||(n+=s?MU("M",c+t,.5+l+t):MU("m",i,0),i=0,s=!1),c+1<e&&r[u+1]||(n+=MU("h",a),a=0)):i++}return n}o(I_e,"qrToPath");Rae.render=o(function(e,t,n){let i=N_e.getOptions(t),s=e.modules.size,a=e.modules.data,u=s+i.margin*2,c=i.color.light.a?"<path "+Tae(i.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",l="<path "+Tae(i.color.dark,"stroke")+' d="'+I_e(a,s,i.margin)+'"/>',p='viewBox="0 0 '+u+" "+u+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+p+' shape-rendering="crispEdges">'+c+l+`</svg>
112
- `;return typeof n=="function"&&n(null,g),g},"render")});var Dae=Q($_=>{"use strict";var T_e=UU();$_.render=T_e.render;$_.renderToFile=o(function(e,t,n,i){typeof i>"u"&&(i=n,n=void 0);let s=require("fs"),u='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+$_.render(t,n);s.writeFile(e,u,i)},"renderToFile")});var Oae=Q(Z_=>{"use strict";var qU=fI();function R_e(r,e,t){r.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=t,e.width=t,e.style.height=t+"px",e.style.width=t+"px"}o(R_e,"clearCanvas");function D_e(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}o(D_e,"getCanvasElement");Z_.render=o(function(e,t,n){let i=n,s=t;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),t||(s=D_e()),i=qU.getOptions(i);let a=qU.getImageWidth(e.modules.size,i),u=s.getContext("2d"),c=u.createImageData(a,a);return qU.qrToImageData(c.data,e,i),R_e(u,s,a),u.putImageData(c,0,0),s},"render");Z_.renderToDataURL=o(function(e,t,n){let i=n;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),i||(i={});let s=Z_.render(e,t,i),a=i.type||"image/png",u=i.rendererOpts||{};return s.toDataURL(a,u.quality)},"renderToDataURL")});var Pae=Q(pI=>{"use strict";var O_e=rU(),HU=xU(),Bae=Oae(),B_e=UU();function zU(r,e,t,n,i){let s=[].slice.call(arguments,1),a=s.length,u=typeof s[a-1]=="function";if(!u&&!O_e())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(i=t,t=e,e=n=void 0):a===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(t=e,e=n=void 0):a===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(c,l){try{let p=HU.create(t,n);c(r(p,e,n))}catch(p){l(p)}})}try{let c=HU.create(t,n);i(null,r(c,e,n))}catch(c){i(c)}}o(zU,"renderCanvas");pI.create=HU.create;pI.toCanvas=zU.bind(null,Bae.render);pI.toDataURL=zU.bind(null,Bae.renderToDataURL);pI.toString=zU.bind(null,function(r,e,t){return B_e.render(r,t)})});var kae=Q(c0=>{"use strict";var _ae=rU(),KU=xU(),P_e=yae(),Lae=Sae(),__e=Iae(),Fae=Dae();function hI(r,e,t){if(typeof r>"u")throw new Error("String required as first argument");if(typeof t>"u"&&(t=e,e={}),typeof t!="function")if(_ae())e=t||{},t=null;else throw new Error("Callback required as last argument");return{opts:e,cb:t}}o(hI,"checkParams");function L_e(r){return r.slice((r.lastIndexOf(".")-1>>>0)+2).toLowerCase()}o(L_e,"getTypeFromFilename");function e4(r){switch(r){case"svg":return Fae;case"txt":case"utf8":return Lae;case"png":case"image/png":default:return P_e}}o(e4,"getRendererFromType");function F_e(r){switch(r){case"svg":return Fae;case"terminal":return __e;case"utf8":default:return Lae}}o(F_e,"getStringRendererFromType");function dI(r,e,t){if(!t.cb)return new Promise(function(n,i){try{let s=KU.create(e,t.opts);return r(s,t.opts,function(a,u){return a?i(a):n(u)})}catch(s){i(s)}});try{let n=KU.create(e,t.opts);return r(n,t.opts,t.cb)}catch(n){t.cb(n)}}o(dI,"render");c0.create=KU.create;c0.toCanvas=Pae().toCanvas;c0.toString=o(function(e,t,n){let i=hI(e,t,n),s=i.opts?i.opts.type:void 0,a=F_e(s);return dI(a.render,e,i)},"toString");c0.toDataURL=o(function(e,t,n){let i=hI(e,t,n),s=e4(i.opts.type);return dI(s.renderToDataURL,e,i)},"toDataURL");c0.toBuffer=o(function(e,t,n){let i=hI(e,t,n),s=e4(i.opts.type);return dI(s.renderToBuffer,e,i)},"toBuffer");c0.toFile=o(function(e,t,n,i){if(typeof e!="string"||!(typeof t=="string"||typeof t=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!_ae())throw new Error("Too few arguments provided");let s=hI(t,n,i),a=s.opts.type||L_e(e),c=e4(a).renderToFile.bind(null,e);return dI(c,t,s)},"toFile");c0.toFileStream=o(function(e,t,n){if(arguments.length<2)throw new Error("Too few arguments provided");let i=hI(t,n,e.emit.bind(e,"error")),a=e4("png").renderToFileStream.bind(null,e);dI(a,t,i)},"toFileStream")});var jae=Q((Uft,Vae)=>{"use strict";Vae.exports=kae()});var V_e={};iT(V_e,{AccessKeyBuilder:()=>Iw,DanfceDefaultPdfDocument:()=>XU,DanfceReducedPdfDocument:()=>WU,DefaultDetBuilderAggregator:()=>v2,DefaultTotalBuilderAggregator:()=>y2,NFCeDto:()=>Af,NFeDto:()=>Sh,NfceAuthorizerPipeline:()=>mM,NfceConsultStatusPipeline:()=>gM,NfceQrcode:()=>kv,NfceRemoteTransmitter:()=>Bm,NfceXmlBuilder:()=>rI,NfceXmlBuilderPipeline:()=>tU,NfeAuthorizationResponsePipeline:()=>vM,NfeAuthorizerPipeline:()=>w2,NfeConsultStatusPipeline:()=>E2,NfeDetXmlBuilder:()=>Is,NfeNfceCancelPipeline:()=>SM,NfeNfceVoidRangePipeline:()=>d_,NfeRemoteTransmitter:()=>go,NfeXmlBuilder:()=>Ln,NfeXmlBuilderPipeline:()=>tI,TpEmis:()=>ia,TpEvent:()=>kf,schemas:()=>Nw});module.exports=ude(V_e);var ia=(function(r){return r.Normal="1",r.EPEC="4",r.SVCAN="6",r.SVCRS="7",r.OFFLINE="9",r})({});var kf=(function(r){return r.Cancelamento="110111",r})({});var ou=require("path"),xy=require("fs");var C3=require("path"),w3=require("module"),sT=require("url");var cde=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,by,xq=o(()=>{if(by!==void 0)return by;if(cde){by=void 0;return}try{by=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{by=void 0}return by},"getImportMetaUrl"),wq=o(()=>{if(typeof require<"u")return require;let r=xq();if(r)return(0,w3.createRequire)(r);let e=(0,sT.pathToFileURL)((0,C3.resolve)(process.cwd(),"package.json")).href;return(0,w3.createRequire)(e)},"getRequireFn"),Cq=o(()=>{if(typeof __filename<"u")return __filename;let r=xq();return r?(0,sT.fileURLToPath)(r):(0,C3.resolve)(process.cwd())},"getCurrentFile");var Eq=o(()=>typeof process<"u"&&typeof process.versions<"u"&&"electron"in process.versions,"isElectron"),lde=o(()=>{if(!Eq())return null;try{let e=require("electron").app;if(e?.getAppPath&&typeof e.getAppPath=="function")return{getAppPath:e.getAppPath}}catch{}return null},"getElectronApp"),fde=o(()=>{if(!Eq())return null;let r=process;if(r.resourcesPath)return r.resourcesPath;let e=lde();if(e)try{let t=e.getAppPath();if(typeof t=="string")return(0,ou.dirname)(t.replace(/\.asar$/,""))}catch{}return null},"getElectronResourcesPath"),wy=o((r,{onFound:e,onNotFound:t})=>{let n=fde();if(n){let l=(0,ou.resolve)(n,"node_modules","nfets",r);if((0,xy.existsSync)(l))return e(l)}let i=Cq(),s=i.includes(".asar")?process.cwd():i,a=(0,ou.resolve)(s,"../../../../"),u=(0,ou.resolve)(a,r);if((0,xy.existsSync)(u))return e(u);let c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,r);if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,"node_modules","nfets",r);if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,r.replace(/^build\//,"Release/"));if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}return t()},"search");var pde={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21",PL_010_V1_30:"PL_010_V1.30"},Nw=o(()=>{if(process.env.NFETS_NFE_SCHEMAS_DIR)return process.env.NFETS_NFE_SCHEMAS_DIR;try{return wy("node_modules/nfets/packages/nfe/schemas",{onFound:o(r=>r,"onFound"),onNotFound:o(()=>{throw new Error("Schemas not found on node_modules/nfets/packages/nfe/schemas")},"onNotFound")})}catch{return wy("nfe/schemas",{onFound:o(r=>r,"onFound"),onNotFound:o(()=>{throw new Error("Schemas not found on nfe/schemas")},"onNotFound")})}},"schemas"),Vf=pde;var Iw=class{static{o(this,"AccessKeyBuilder")}compile(e){let t=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),s=(e.identification??"").padStart(14,"0"),a=e.mod.toString().padStart(2,"0"),u=e.serie.toString().padStart(3,"0"),c=e.nNF.toString().padStart(9,"0"),l=e.tpEmis.toString().padStart(1,"0"),p=(e.cNF??this.code()).toString().padStart(8,"0"),d=`${t}${n}${i}${s}${a}${u}${c}${l}${p}`;return`${d}${this.verifyingDigit(d)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,s,a,u,c,l,p,d,g,y,v]=n;return{cUF:s,year:a,month:u,identification:c,mod:l,serie:p,nNF:d,tpEmis:g,cNF:y,vd:v}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let t=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let a=0;a<8&&n>=0;a++){let u=parseInt(e[n]);i+=u*t[a],n--}let s=11-i%11;return s>9?0:s}};var Cy=9e15,Lh=1e9,E3="0123456789abcdef",uT="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",cT="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",A3={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Cy,maxE:Cy,crypto:!1},Tq,jf,Yt=!0,fT="[DecimalError] ",_h=fT+"Invalid argument: ",Rq=fT+"Precision limit exceeded",Dq=fT+"crypto unavailable",Oq="[object Decimal]",sa=Math.floor,Ji=Math.pow,hde=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,dde=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,mde=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Bq=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tc=1e7,Lt=7,gde=9007199254740991,vde=uT.length-1,N3=cT.length-1,ze={toStringTag:Oq};ze.absoluteValue=ze.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),It(r)};ze.ceil=function(){return It(new this.constructor(this),this.e+1,2)};ze.clampedTo=ze.clamp=function(r,e){var t,n=this,i=n.constructor;if(r=new i(r),e=new i(e),!r.s||!e.s)return new i(NaN);if(r.gt(e))throw Error(_h+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new i(n)};ze.comparedTo=ze.cmp=function(r){var e,t,n,i,s=this,a=s.d,u=(r=new s.constructor(r)).d,c=s.s,l=r.s;if(!a||!u)return!c||!l?NaN:c!==l?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!==l)return c;if(s.e!==r.e)return s.e>r.e^c<0?1:-1;for(n=a.length,i=u.length,e=0,t=n<i?n:i;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ze.cosine=ze.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Lt,n.rounding=1,t=yde(n,kq(n,t)),n.precision=r,n.rounding=e,It(jf==2||jf==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};ze.cubeRoot=ze.cbrt=function(){var r,e,t,n,i,s,a,u,c,l,p=this,d=p.constructor;if(!p.isFinite()||p.isZero())return new d(p);for(Yt=!1,s=p.s*Ji(p.s*p,1/3),!s||Math.abs(s)==1/0?(t=Bs(p.d),r=p.e,(s=(r-t.length+1)%3)&&(t+=s==1||s==-2?"0":"00"),s=Ji(t,1/3),r=sa((r+1)/3)-(r%3==(r<0?-1:2)),s==1/0?t="5e"+r:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new d(t),n.s=p.s):n=new d(s.toString()),a=(r=d.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(p),n=yn(l.plus(p).times(u),l.plus(c),a+2,1),Bs(u.d).slice(0,a)===(t=Bs(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!i&&t=="4999"){if(!i&&(It(u,r+1,0),u.times(u).times(u).eq(p))){n=u;break}a+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(It(n,r+1,1),e=!n.times(n).times(n).eq(p));break}return Yt=!0,It(n,r,d.rounding,e)};ze.decimalPlaces=ze.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-sa(this.e/Lt))*Lt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};ze.dividedBy=ze.div=function(r){return yn(this,new this.constructor(r))};ze.dividedToIntegerBy=ze.divToInt=function(r){var e=this,t=e.constructor;return It(yn(e,new t(r),0,1,1),t.precision,t.rounding)};ze.equals=ze.eq=function(r){return this.cmp(r)===0};ze.floor=function(){return It(new this.constructor(this),this.e+1,3)};ze.greaterThan=ze.gt=function(r){return this.cmp(r)>0};ze.greaterThanOrEqualTo=ze.gte=function(r){var e=this.cmp(r);return e==1||e===0};ze.hyperbolicCosine=ze.cosh=function(){var r,e,t,n,i,s=this,a=s.constructor,u=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(r=Math.ceil(i/3),e=(1/hT(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),s=Ey(a,1,s.times(e),new a(1),!0);for(var c,l=r,p=new a(8);l--;)c=s.times(s),s=u.minus(c.times(p.minus(c.times(p))));return It(s,a.precision=t,a.rounding=n,!0)};ze.hyperbolicSine=ze.sinh=function(){var r,e,t,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,t=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Ey(s,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/hT(5,r)),i=Ey(s,2,i,i,!0);for(var a,u=new s(5),c=new s(16),l=new s(20);r--;)a=i.times(i),i=i.times(u.plus(a.times(c.times(a).plus(l))))}return s.precision=e,s.rounding=t,It(i,e,t,!0)};ze.hyperbolicTangent=ze.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,yn(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};ze.inverseCosine=ze.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,i=e.rounding;return t!==-1?t===0?r.isNeg()?sl(e,n,i):new e(0):new e(NaN):r.isZero()?sl(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,r.times(2))};ze.inverseHyperbolicCosine=ze.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Yt=!1,t=t.times(t).minus(1).sqrt().plus(t),Yt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};ze.inverseHyperbolicSine=ze.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Yt=!1,t=t.times(t).plus(1).sqrt().plus(t),Yt=!0,n.precision=r,n.rounding=e,t.ln())};ze.inverseHyperbolicTangent=ze.atanh=function(){var r,e,t,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=s.precision,e=s.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?It(new s(i),r,e,!0):(s.precision=t=n-i.e,i=yn(i.plus(1),new s(1).minus(i),t+r,1),s.precision=r+4,s.rounding=1,i=i.ln(),s.precision=r,s.rounding=e,i.times(.5))):new s(NaN)};ze.inverseSine=ze.asin=function(){var r,e,t,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),t=s.precision,n=s.rounding,e!==-1?e===0?(r=sl(s,t+4,n).times(.5),r.s=i.s,r):new s(NaN):(s.precision=t+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=t,s.rounding=n,i.times(2)))};ze.inverseTangent=ze.atan=function(){var r,e,t,n,i,s,a,u,c,l=this,p=l.constructor,d=p.precision,g=p.rounding;if(l.isFinite()){if(l.isZero())return new p(l);if(l.abs().eq(1)&&d+4<=N3)return a=sl(p,d+4,g).times(.25),a.s=l.s,a}else{if(!l.s)return new p(NaN);if(d+4<=N3)return a=sl(p,d+4,g).times(.5),a.s=l.s,a}for(p.precision=u=d+10,p.rounding=1,t=Math.min(28,u/Lt+2|0),r=t;r;--r)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Yt=!1,e=Math.ceil(u/Lt),n=1,c=l.times(l),a=new p(l),i=l;r!==-1;)if(i=i.times(c),s=a.minus(i.div(n+=2)),i=i.times(c),a=s.plus(i.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===s.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Yt=!0,It(a,p.precision=d,p.rounding=g,!0)};ze.isFinite=function(){return!!this.d};ze.isInteger=ze.isInt=function(){return!!this.d&&sa(this.e/Lt)>this.d.length-2};ze.isNaN=function(){return!this.s};ze.isNegative=ze.isNeg=function(){return this.s<0};ze.isPositive=ze.isPos=function(){return this.s>0};ze.isZero=function(){return!!this.d&&this.d[0]===0};ze.lessThan=ze.lt=function(r){return this.cmp(r)<0};ze.lessThanOrEqualTo=ze.lte=function(r){return this.cmp(r)<1};ze.logarithm=ze.log=function(r){var e,t,n,i,s,a,u,c,l=this,p=l.constructor,d=p.precision,g=p.rounding,y=5;if(r==null)r=new p(10),e=!0;else{if(r=new p(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new p(NaN);e=r.eq(10)}if(t=l.d,l.s<0||!t||!t[0]||l.eq(1))return new p(t&&!t[0]?-1/0:l.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)s=!0;else{for(i=t[0];i%10===0;)i/=10;s=i!==1}if(Yt=!1,u=d+y,a=Ph(l,u),n=e?lT(p,u+10):Ph(r,u),c=yn(a,n,u,1),Tw(c.d,i=d,g))do if(u+=10,a=Ph(l,u),n=e?lT(p,u+10):Ph(r,u),c=yn(a,n,u,1),!s){+Bs(c.d).slice(i+1,i+15)+1==1e14&&(c=It(c,d+1,0));break}while(Tw(c.d,i+=10,g));return Yt=!0,It(c,d,g)};ze.minus=ze.sub=function(r){var e,t,n,i,s,a,u,c,l,p,d,g,y=this,v=y.constructor;if(r=new v(r),!y.d||!r.d)return!y.s||!r.s?r=new v(NaN):y.d?r.s=-r.s:r=new v(r.d||y.s!==r.s?y:NaN),r;if(y.s!=r.s)return r.s=-r.s,y.plus(r);if(l=y.d,g=r.d,u=v.precision,c=v.rounding,!l[0]||!g[0]){if(g[0])r.s=-r.s;else if(l[0])r=new v(y);else return new v(c===3?-0:0);return Yt?It(r,u,c):r}if(t=sa(r.e/Lt),p=sa(y.e/Lt),l=l.slice(),s=p-t,s){for(d=s<0,d?(e=l,s=-s,a=g.length):(e=g,t=p,a=l.length),n=Math.max(Math.ceil(u/Lt),a)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=g.length,d=n<a,d&&(a=n),n=0;n<a;n++)if(l[n]!=g[n]){d=l[n]<g[n];break}s=0}for(d&&(e=l,l=g,g=e,r.s=-r.s),a=l.length,n=g.length-a;n>0;--n)l[a++]=0;for(n=g.length;n>s;){if(l[--n]<g[n]){for(i=n;i&&l[--i]===0;)l[i]=tc-1;--l[i],l[n]+=tc}l[n]-=g[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--t;return l[0]?(r.d=l,r.e=pT(l,t),Yt?It(r,u,c):r):new v(c===3?-0:0)};ze.modulo=ze.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?It(new n(t),n.precision,n.rounding):(Yt=!1,n.modulo==9?(e=yn(t,r.abs(),0,3,1),e.s*=r.s):e=yn(t,r,0,n.modulo,1),e=e.times(r),Yt=!0,t.minus(e))};ze.naturalExponential=ze.exp=function(){return I3(this)};ze.naturalLogarithm=ze.ln=function(){return Ph(this)};ze.negated=ze.neg=function(){var r=new this.constructor(this);return r.s=-r.s,It(r)};ze.plus=ze.add=function(r){var e,t,n,i,s,a,u,c,l,p,d=this,g=d.constructor;if(r=new g(r),!d.d||!r.d)return!d.s||!r.s?r=new g(NaN):d.d||(r=new g(r.d||d.s===r.s?d:NaN)),r;if(d.s!=r.s)return r.s=-r.s,d.minus(r);if(l=d.d,p=r.d,u=g.precision,c=g.rounding,!l[0]||!p[0])return p[0]||(r=new g(d)),Yt?It(r,u,c):r;if(s=sa(d.e/Lt),n=sa(r.e/Lt),l=l.slice(),i=s-n,i){for(i<0?(t=l,i=-i,a=p.length):(t=p,n=s,a=l.length),s=Math.ceil(u/Lt),a=s>a?s+1:a+1,i>a&&(i=a,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(a=l.length,i=p.length,a-i<0&&(i=a,t=p,p=l,l=t),e=0;i;)e=(l[--i]=l[i]+p[i]+e)/tc|0,l[i]%=tc;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=pT(l,n),Yt?It(r,u,c):r};ze.precision=ze.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(_h+r);return t.d?(e=Pq(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};ze.round=function(){var r=this,e=r.constructor;return It(new e(r),r.e+1,e.rounding)};ze.sine=ze.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Lt,n.rounding=1,t=bde(n,kq(n,t)),n.precision=r,n.rounding=e,It(jf>2?t.neg():t,r,e,!0)):new n(NaN)};ze.squareRoot=ze.sqrt=function(){var r,e,t,n,i,s,a=this,u=a.d,c=a.e,l=a.s,p=a.constructor;if(l!==1||!u||!u[0])return new p(!l||l<0&&(!u||u[0])?NaN:u?a:1/0);for(Yt=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=Bs(u),(e.length+c)%2==0&&(e+="0"),l=Math.sqrt(e),c=sa((c+1)/2)-(c<0||c%2),l==1/0?e="5e"+c:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new p(e)):n=new p(l.toString()),t=(c=p.precision)+3;;)if(s=n,n=s.plus(yn(a,s,t+2,1)).times(.5),Bs(s.d).slice(0,t)===(e=Bs(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(It(s,c+1,0),s.times(s).eq(a))){n=s;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(It(n,c+1,1),r=!n.times(n).eq(a));break}return Yt=!0,It(n,c,p.rounding,r)};ze.tangent=ze.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=yn(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,It(jf==2||jf==4?t.neg():t,r,e,!0)):new n(NaN)};ze.times=ze.mul=function(r){var e,t,n,i,s,a,u,c,l,p=this,d=p.constructor,g=p.d,y=(r=new d(r)).d;if(r.s*=p.s,!g||!g[0]||!y||!y[0])return new d(!r.s||g&&!g[0]&&!y||y&&!y[0]&&!g?NaN:!g||!y?r.s/0:r.s*0);for(t=sa(p.e/Lt)+sa(r.e/Lt),c=g.length,l=y.length,c<l&&(s=g,g=y,y=s,a=c,c=l,l=a),s=[],a=c+l,n=a;n--;)s.push(0);for(n=l;--n>=0;){for(e=0,i=c+n;i>n;)u=s[i]+y[n]*g[i-n-1]+e,s[i--]=u%tc|0,e=u/tc|0;s[i]=(s[i]+e)%tc|0}for(;!s[--a];)s.pop();return e?++t:s.shift(),r.d=s,r.e=pT(s,t),Yt?It(r,d.precision,d.rounding):r};ze.toBinary=function(r,e){return T3(this,2,r,e)};ze.toDecimalPlaces=ze.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ja(r,0,Lh),e===void 0?e=n.rounding:Ja(e,0,8),It(t,r+t.e+1,e))};ze.toExponential=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=al(n,!0):(Ja(r,0,Lh),e===void 0?e=i.rounding:Ja(e,0,8),n=It(new i(n),r+1,e),t=al(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};ze.toFixed=function(r,e){var t,n,i=this,s=i.constructor;return r===void 0?t=al(i):(Ja(r,0,Lh),e===void 0?e=s.rounding:Ja(e,0,8),n=It(new s(i),r+i.e+1,e),t=al(n,!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};ze.toFraction=function(r){var e,t,n,i,s,a,u,c,l,p,d,g,y=this,v=y.d,x=y.constructor;if(!v)return new x(y);if(l=t=new x(1),n=c=new x(0),e=new x(n),s=e.e=Pq(v)-y.e-1,a=s%Lt,e.d[0]=Ji(10,a<0?Lt+a:a),r==null)r=s>0?e:l;else{if(u=new x(r),!u.isInt()||u.lt(l))throw Error(_h+u);r=u.gt(e)?s>0?e:l:u}for(Yt=!1,u=new x(Bs(v)),p=x.precision,x.precision=s=v.length*Lt*2;d=yn(u,e,0,1,1),i=t.plus(d.times(n)),i.cmp(r)!=1;)t=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=e,e=u.minus(d.times(i)),u=i;return i=yn(r.minus(t),n,0,1,1),c=c.plus(i.times(l)),t=t.plus(i.times(n)),c.s=l.s=y.s,g=yn(l,n,s,1).minus(y).abs().cmp(yn(c,t,s,1).minus(y).abs())<1?[l,n]:[c,t],x.precision=p,Yt=!0,g};ze.toHexadecimal=ze.toHex=function(r,e){return T3(this,16,r,e)};ze.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ja(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Yt=!1,t=yn(t,r,0,e,1).times(r),Yt=!0,It(t)):(r.s=t.s,t=r),t};ze.toNumber=function(){return+this};ze.toOctal=function(r,e){return T3(this,8,r,e)};ze.toPower=ze.pow=function(r){var e,t,n,i,s,a,u=this,c=u.constructor,l=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Ji(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,s=c.rounding,r.eq(1))return It(u,n,s);if(e=sa(r.e/Lt),e>=r.d.length-1&&(t=l<0?-l:l)<=gde)return i=_q(c,u,t,n),r.s<0?new c(1).div(i):It(i,n,s);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Ji(+u,l),e=t==0||!isFinite(t)?sa(l*(Math.log("0."+Bs(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(Yt=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),i=I3(r.times(Ph(u,n+t)),n),i.d&&(i=It(i,n+5,1),Tw(i.d,n,s)&&(e=n+10,i=It(I3(r.times(Ph(u,e+t)),e),e+5,1),+Bs(i.d).slice(n+1,n+15)+1==1e14&&(i=It(i,n+1,0)))),i.s=a,Yt=!0,c.rounding=s,It(i,n,s))};ze.toPrecision=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=al(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ja(r,1,Lh),e===void 0?e=i.rounding:Ja(e,0,8),n=It(new i(n),r,e),t=al(n,r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};ze.toSignificantDigits=ze.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ja(r,1,Lh),e===void 0?e=n.rounding:Ja(e,0,8)),It(new n(t),r,e)};ze.toString=function(){var r=this,e=r.constructor,t=al(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};ze.truncated=ze.trunc=function(){return It(new this.constructor(this),this.e+1,1)};ze.valueOf=ze.toJSON=function(){var r=this,e=r.constructor,t=al(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Bs(r){var e,t,n,i=r.length-1,s="",a=r[0];if(i>0){for(s+=a,e=1;e<i;e++)n=r[e]+"",t=Lt-n.length,t&&(s+=Bh(t)),s+=n;a=r[e],n=a+"",t=Lt-n.length,t&&(s+=Bh(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}o(Bs,"digitsToString");function Ja(r,e,t){if(r!==~~r||r<e||r>t)throw Error(_h+r)}o(Ja,"checkInt32");function Tw(r,e,t,n){var i,s,a,u;for(s=r[0];s>=10;s/=10)--e;return--e<0?(e+=Lt,i=0):(i=Math.ceil((e+1)/Lt),e%=Lt),s=Ji(10,Lt-e),u=r[i]%s|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==s||t>3&&u+1==s/2)&&(r[i+1]/s/100|0)==Ji(10,e-2)-1||(u==s/2||u==0)&&(r[i+1]/s/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==s||!n&&t>3&&u+1==s/2)&&(r[i+1]/s/1e3|0)==Ji(10,e-3)-1,a}o(Tw,"checkRoundingDigits");function aT(r,e,t){for(var n,i=[0],s,a=0,u=r.length;a<u;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=E3.indexOf(r.charAt(a++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}o(aT,"convertBase");function yde(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/hT(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Ey(r,1,e.times(i),new r(1));for(var s=t;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(yde,"cosine");var yn=(function(){function r(n,i,s){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+u,n[c]=a%s|0,u=a/s|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,i,s,a){var u,c;if(s!=a)c=s>a?1:-1;else for(u=c=0;u<s;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}o(e,"compare");function t(n,i,s,a){for(var u=0;s--;)n[s]-=u,u=n[s]<i[s]?1:0,n[s]=u*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,i,s,a,u,c){var l,p,d,g,y,v,x,S,A,D,C,E,I,B,q,R,z,K,H,J,ge=n.constructor,ve=n.s==i.s?1:-1,le=n.d,Z=i.d;if(!le||!le[0]||!Z||!Z[0])return new ge(!n.s||!i.s||(le?Z&&le[0]==Z[0]:!Z)?NaN:le&&le[0]==0||!Z?ve*0:ve/0);for(c?(y=1,p=n.e-i.e):(c=tc,y=Lt,p=sa(n.e/y)-sa(i.e/y)),H=Z.length,z=le.length,A=new ge(ve),D=A.d=[],d=0;Z[d]==(le[d]||0);d++);if(Z[d]>(le[d]||0)&&p--,s==null?(B=s=ge.precision,a=ge.rounding):u?B=s+(n.e-i.e)+1:B=s,B<0)D.push(1),v=!0;else{if(B=B/y+2|0,d=0,H==1){for(g=0,Z=Z[0],B++;(d<z||g)&&B--;d++)q=g*c+(le[d]||0),D[d]=q/Z|0,g=q%Z|0;v=g||d<z}else{for(g=c/(Z[0]+1)|0,g>1&&(Z=r(Z,g,c),le=r(le,g,c),H=Z.length,z=le.length),R=H,C=le.slice(0,H),E=C.length;E<H;)C[E++]=0;J=Z.slice(),J.unshift(0),K=Z[0],Z[1]>=c/2&&++K;do g=0,l=e(Z,C,H,E),l<0?(I=C[0],H!=E&&(I=I*c+(C[1]||0)),g=I/K|0,g>1?(g>=c&&(g=c-1),x=r(Z,g,c),S=x.length,E=C.length,l=e(x,C,S,E),l==1&&(g--,t(x,H<S?J:Z,S,c))):(g==0&&(l=g=1),x=Z.slice()),S=x.length,S<E&&x.unshift(0),t(C,x,E,c),l==-1&&(E=C.length,l=e(Z,C,H,E),l<1&&(g++,t(C,H<E?J:Z,E,c))),E=C.length):l===0&&(g++,C=[0]),D[d++]=g,l&&C[0]?C[E++]=le[R]||0:(C=[le[R]],E=1);while((R++<z||C[0]!==void 0)&&B--);v=C[0]!==void 0}D[0]||D.shift()}if(y==1)A.e=p,Tq=v;else{for(d=1,g=D[0];g>=10;g/=10)d++;A.e=d+p*y-1,It(A,u?s+A.e+1:s,a,v)}return A}})();function It(r,e,t,n){var i,s,a,u,c,l,p,d,g,y=r.constructor;e:if(e!=null){if(d=r.d,!d)return r;for(i=1,u=d[0];u>=10;u/=10)i++;if(s=e-i,s<0)s+=Lt,a=e,p=d[g=0],c=p/Ji(10,i-a-1)%10|0;else if(g=Math.ceil((s+1)/Lt),u=d.length,g>=u)if(n){for(;u++<=g;)d.push(0);p=c=0,i=1,s%=Lt,a=s-Lt+1}else break e;else{for(p=u=d[g],i=1;u>=10;u/=10)i++;s%=Lt,a=s-Lt+i,c=a<0?0:p/Ji(10,i-a-1)%10|0}if(n=n||e<0||d[g+1]!==void 0||(a<0?p:p%Ji(10,i-a-1)),l=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(s>0?a>0?p/Ji(10,i-a):0:d[g-1])%10&1||t==(r.s<0?8:7)),e<1||!d[0])return d.length=0,l?(e-=r.e+1,d[0]=Ji(10,(Lt-e%Lt)%Lt),r.e=-e||0):d[0]=r.e=0,r;if(s==0?(d.length=g,u=1,g--):(d.length=g+1,u=Ji(10,Lt-s),d[g]=a>0?(p/Ji(10,i-a)%Ji(10,a)|0)*u:0),l)for(;;)if(g==0){for(s=1,a=d[0];a>=10;a/=10)s++;for(a=d[0]+=u,u=1;a>=10;a/=10)u++;s!=u&&(r.e++,d[0]==tc&&(d[0]=1));break}else{if(d[g]+=u,d[g]!=tc)break;d[g--]=0,u=1}for(s=d.length;d[--s]===0;)d.pop()}return Yt&&(r.e>y.maxE?(r.d=null,r.e=NaN):r.e<y.minE&&(r.e=0,r.d=[0])),r}o(It,"finalise");function al(r,e,t){if(!r.isFinite())return Fq(r);var n,i=r.e,s=Bs(r.d),a=s.length;return e?(t&&(n=t-a)>0?s=s.charAt(0)+"."+s.slice(1)+Bh(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(r.e<0?"e":"e+")+r.e):i<0?(s="0."+Bh(-i-1)+s,t&&(n=t-a)>0&&(s+=Bh(n))):i>=a?(s+=Bh(i+1-a),t&&(n=t-i-1)>0&&(s=s+"."+Bh(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),t&&(n=t-a)>0&&(i+1===a&&(s+="."),s+=Bh(n))),s}o(al,"finiteToString");function pT(r,e){var t=r[0];for(e*=Lt;t>=10;t/=10)e++;return e}o(pT,"getBase10Exponent");function lT(r,e,t){if(e>vde)throw Yt=!0,t&&(r.precision=t),Error(Rq);return It(new r(uT),e,1,!0)}o(lT,"getLn10");function sl(r,e,t){if(e>N3)throw Error(Rq);return It(new r(cT),e,t,!0)}o(sl,"getPi");function Pq(r){var e=r.length-1,t=e*Lt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(Pq,"getPrecision");function Bh(r){for(var e="";r--;)e+="0";return e}o(Bh,"getZeroString");function _q(r,e,t,n){var i,s=new r(1),a=Math.ceil(n/Lt+4);for(Yt=!1;;){if(t%2&&(s=s.times(e),Nq(s.d,a)&&(i=!0)),t=sa(t/2),t===0){t=s.d.length-1,i&&s.d[t]===0&&++s.d[t];break}e=e.times(e),Nq(e.d,a)}return Yt=!0,s}o(_q,"intPow");function Aq(r){return r.d[r.d.length-1]&1}o(Aq,"isOdd");function Lq(r,e,t){for(var n,i,s=new r(e[0]),a=0;++a<e.length;){if(i=new r(e[a]),!i.s){s=i;break}n=s.cmp(i),(n===t||n===0&&s.s===t)&&(s=i)}return s}o(Lq,"maxOrMin");function I3(r,e){var t,n,i,s,a,u,c,l=0,p=0,d=0,g=r.constructor,y=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Yt=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),d+=5;for(n=Math.log(Ji(2,d))/Math.LN10*2+5|0,c+=n,t=s=a=new g(1),g.precision=c;;){if(s=It(s.times(r),c,1),t=t.times(++p),u=a.plus(yn(s,t,c,1)),Bs(u.d).slice(0,c)===Bs(a.d).slice(0,c)){for(i=d;i--;)a=It(a.times(a),c,1);if(e==null)if(l<3&&Tw(a.d,c-n,y,l))g.precision=c+=10,t=s=u=new g(1),p=0,l++;else return It(a,g.precision=v,y,Yt=!0);else return g.precision=v,a}a=u}}o(I3,"naturalExponential");function Ph(r,e){var t,n,i,s,a,u,c,l,p,d,g,y=1,v=10,x=r,S=x.d,A=x.constructor,D=A.rounding,C=A.precision;if(x.s<0||!S||!S[0]||!x.e&&S[0]==1&&S.length==1)return new A(S&&!S[0]?-1/0:x.s!=1?NaN:S?0:x);if(e==null?(Yt=!1,p=C):p=e,A.precision=p+=v,t=Bs(S),n=t.charAt(0),Math.abs(s=x.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)x=x.times(r),t=Bs(x.d),n=t.charAt(0),y++;s=x.e,n>1?(x=new A("0."+t),s++):x=new A(n+"."+t.slice(1))}else return l=lT(A,p+2,C).times(s+""),x=Ph(new A(n+"."+t.slice(1)),p-v).plus(l),A.precision=C,e==null?It(x,C,D,Yt=!0):x;for(d=x,c=a=x=yn(x.minus(1),x.plus(1),p,1),g=It(x.times(x),p,1),i=3;;){if(a=It(a.times(g),p,1),l=c.plus(yn(a,new A(i),p,1)),Bs(l.d).slice(0,p)===Bs(c.d).slice(0,p))if(c=c.times(2),s!==0&&(c=c.plus(lT(A,p+2,C).times(s+""))),c=yn(c,new A(y),p,1),e==null)if(Tw(c.d,p-v,D,u))A.precision=p+=v,l=a=x=yn(d.minus(1),d.plus(1),p,1),g=It(x.times(x),p,1),i=u=1;else return It(c,A.precision=C,D,Yt=!0);else return A.precision=C,c;c=l,i+=2}}o(Ph,"naturalLogarithm");function Fq(r){return String(r.s*r.s/0)}o(Fq,"nonFiniteToString");function oT(r,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%Lt,t<0&&(n+=Lt),n<i){for(n&&r.d.push(+e.slice(0,n)),i-=Lt;n<i;)r.d.push(+e.slice(n,n+=Lt));e=e.slice(n),n=Lt-e.length}else n-=i;for(;n--;)e+="0";r.d.push(+e),Yt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(oT,"parseDecimal");function Sde(r,e){var t,n,i,s,a,u,c,l,p;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Bq.test(e))return oT(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(dde.test(e))t=16,e=e.toLowerCase();else if(hde.test(e))t=2;else if(mde.test(e))t=8;else throw Error(_h+e);for(s=e.search(/p/i),s>0?(c=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),a=s>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,s=u-s,i=_q(n,new n(t),s,s*2)),l=aT(e,t,tc),p=l.length-1,s=p;l[s]===0;--s)l.pop();return s<0?new n(r.s*0):(r.e=pT(l,p),r.d=l,Yt=!1,a&&(r=yn(r,i,u*4)),c&&(r=r.times(Math.abs(c)<54?Ji(2,c):Ay.pow(2,c))),Yt=!0,r)}o(Sde,"parseOther");function bde(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Ey(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/hT(5,t)),e=Ey(r,2,e,e);for(var i,s=new r(5),a=new r(16),u=new r(20);t--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(u))));return e}o(bde,"sine");function Ey(r,e,t,n,i){var s,a,u,c,l=1,p=r.precision,d=Math.ceil(p/Lt);for(Yt=!1,c=t.times(t),u=new r(n);;){if(a=yn(u.times(c),new r(e++*e++),p,1),u=i?n.plus(a):n.minus(a),n=yn(a.times(c),new r(e++*e++),p,1),a=u.plus(n),a.d[d]!==void 0){for(s=d;a.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=n,n=a,a=s,l++}return Yt=!0,a.d.length=d+1,a}o(Ey,"taylorSeries");function hT(r,e){for(var t=r;--e;)t*=r;return t}o(hT,"tinyPow");function kq(r,e){var t,n=e.s<0,i=sl(r,r.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return jf=n?4:1,e;if(t=e.divToInt(i),t.isZero())jf=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(s))return jf=Aq(t)?n?2:3:n?4:1,e;jf=Aq(t)?n?1:4:n?3:2}return e.minus(i).abs()}o(kq,"toLessThanHalfPi");function T3(r,e,t,n){var i,s,a,u,c,l,p,d,g,y=r.constructor,v=t!==void 0;if(v?(Ja(t,1,Lh),n===void 0?n=y.rounding:Ja(n,0,8)):(t=y.precision,n=y.rounding),!r.isFinite())p=Fq(r);else{for(p=al(r),a=p.indexOf("."),v?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,a>=0&&(p=p.replace(".",""),g=new y(1),g.e=p.length-a,g.d=aT(al(g),10,i),g.e=g.d.length),d=aT(p,10,i),s=c=d.length;d[--c]==0;)d.pop();if(!d[0])p=v?"0p+0":"0";else{if(a<0?s--:(r=new y(r),r.d=d,r.e=s,r=yn(r,g,t,n,0,i),d=r.d,s=r.e,l=Tq),a=d[t],u=i/2,l=l||d[t+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||l||n===6&&d[t-1]&1||n===(r.s<0?8:7)),d.length=t,l)for(;++d[--t]>i-1;)d[t]=0,t||(++s,d.unshift(1));for(c=d.length;!d[c-1];--c);for(a=0,p="";a<c;a++)p+=E3.charAt(d[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)p+="0";for(d=aT(p,i,e),c=d.length;!d[c-1];--c);for(a=1,p="1.";a<c;a++)p+=E3.charAt(d[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)p="0"+p;p="0."+p}else if(++s>c)for(s-=c;s--;)p+="0";else s<c&&(p=p.slice(0,s)+"."+p.slice(s))}p=(e==16?"0x":e==2?"0b":e==8?"0o":"")+p}return r.s<0?"-"+p:p}o(T3,"toStringBinary");function Nq(r,e){if(r.length>e)return r.length=e,!0}o(Nq,"truncate");function xde(r){return new this(r).abs()}o(xde,"abs");function wde(r){return new this(r).acos()}o(wde,"acos");function Cde(r){return new this(r).acosh()}o(Cde,"acosh");function Ede(r,e){return new this(r).plus(e)}o(Ede,"add");function Ade(r){return new this(r).asin()}o(Ade,"asin");function Nde(r){return new this(r).asinh()}o(Nde,"asinh");function Ide(r){return new this(r).atan()}o(Ide,"atan");function Tde(r){return new this(r).atanh()}o(Tde,"atanh");function Rde(r,e){r=new this(r),e=new this(e);var t,n=this.precision,i=this.rounding,s=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=sl(this,s,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?sl(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=sl(this,s,1).times(.5),t.s=r.s):e.s<0?(this.precision=s,this.rounding=1,t=this.atan(yn(r,e,s,1)),e=sl(this,s,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(yn(r,e,s,1)),t}o(Rde,"atan2");function Dde(r){return new this(r).cbrt()}o(Dde,"cbrt");function Ode(r){return It(r=new this(r),r.e+1,2)}o(Ode,"ceil");function Bde(r,e,t){return new this(r).clamp(e,t)}o(Bde,"clamp");function Pde(r){if(!r||typeof r!="object")throw Error(fT+"Object expected");var e,t,n,i=r.defaults===!0,s=["precision",1,Lh,"rounding",0,8,"toExpNeg",-Cy,0,"toExpPos",0,Cy,"maxE",0,Cy,"minE",-Cy,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],i&&(this[t]=A3[t]),(n=r[t])!==void 0)if(sa(n)===n&&n>=s[e+1]&&n<=s[e+2])this[t]=n;else throw Error(_h+t+": "+n);if(t="crypto",i&&(this[t]=A3[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Dq);else this[t]=!1;else throw Error(_h+t+": "+n);return this}o(Pde,"config");function _de(r){return new this(r).cos()}o(_de,"cos");function Lde(r){return new this(r).cosh()}o(Lde,"cosh");function Vq(r){var e,t,n;function i(s){var a,u,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,Iq(s)){l.s=s.s,Yt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(a=0,u=s;u>=10;u/=10)a++;Yt?a>i.maxE?(l.e=NaN,l.d=null):a<i.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[s]):(l.e=a,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return oT(l,s.toString())}if(c==="string")return(u=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(u===43&&(s=s.slice(1)),l.s=1),Bq.test(s)?oT(l,s):Sde(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,oT(l,s.toString());throw Error(_h+s)}if(o(i,"Decimal"),i.prototype=ze,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Pde,i.clone=Vq,i.isDecimal=Iq,i.abs=xde,i.acos=wde,i.acosh=Cde,i.add=Ede,i.asin=Ade,i.asinh=Nde,i.atan=Ide,i.atanh=Tde,i.atan2=Rde,i.cbrt=Dde,i.ceil=Ode,i.clamp=Bde,i.cos=_de,i.cosh=Lde,i.div=Fde,i.exp=kde,i.floor=Vde,i.hypot=jde,i.ln=Mde,i.log=Ude,i.log10=Hde,i.log2=qde,i.max=zde,i.min=Kde,i.mod=Gde,i.mul=Xde,i.pow=Wde,i.random=Jde,i.round=Yde,i.sign=Qde,i.sin=$de,i.sinh=Zde,i.sqrt=eme,i.sub=tme,i.sum=rme,i.tan=nme,i.tanh=ime,i.trunc=sme,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return i.config(r),i}o(Vq,"clone");function Fde(r,e){return new this(r).div(e)}o(Fde,"div");function kde(r){return new this(r).exp()}o(kde,"exp");function Vde(r){return It(r=new this(r),r.e+1,3)}o(Vde,"floor");function jde(){var r,e,t=new this(0);for(Yt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Yt=!0,new this(1/0);t=e}return Yt=!0,t.sqrt()}o(jde,"hypot");function Iq(r){return r instanceof Ay||r&&r.toStringTag===Oq||!1}o(Iq,"isDecimalInstance");function Mde(r){return new this(r).ln()}o(Mde,"ln");function Ude(r,e){return new this(r).log(e)}o(Ude,"log");function qde(r){return new this(r).log(2)}o(qde,"log2");function Hde(r){return new this(r).log(10)}o(Hde,"log10");function zde(){return Lq(this,arguments,-1)}o(zde,"max");function Kde(){return Lq(this,arguments,1)}o(Kde,"min");function Gde(r,e){return new this(r).mod(e)}o(Gde,"mod");function Xde(r,e){return new this(r).mul(e)}o(Xde,"mul");function Wde(r,e){return new this(r).pow(e)}o(Wde,"pow");function Jde(r){var e,t,n,i,s=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ja(r,1,Lh),n=Math.ceil(r/Lt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(i%1e7),s+=4);s=n/4}else throw Error(Dq);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],r%=Lt,n&&r&&(i=Ji(10,Lt-r),u[s]=(n/i|0)*i);u[s]===0;s--)u.pop();if(s<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Lt)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Lt&&(t-=Lt-n)}return a.e=t,a.d=u,a}o(Jde,"random");function Yde(r){return It(r=new this(r),r.e+1,this.rounding)}o(Yde,"round");function Qde(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(Qde,"sign");function $de(r){return new this(r).sin()}o($de,"sin");function Zde(r){return new this(r).sinh()}o(Zde,"sinh");function eme(r){return new this(r).sqrt()}o(eme,"sqrt");function tme(r,e){return new this(r).sub(e)}o(tme,"sub");function rme(){var r=0,e=arguments,t=new this(e[r]);for(Yt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Yt=!0,It(t,this.precision,this.rounding)}o(rme,"sum");function nme(r){return new this(r).tan()}o(nme,"tan");function ime(r){return new this(r).tanh()}o(ime,"tanh");function sme(r){return It(r=new this(r),r.e+1,1)}o(sme,"trunc");ze[Symbol.for("nodejs.util.inspect.custom")]=ze.toString;ze[Symbol.toStringTag]="Decimal";var Ay=ze.constructor=Vq(A3);uT=new Ay(uT);cT=new Ay(cT);var Li=class r extends Ay{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var dT=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var VL=lr(require("fs"),1),pz=lr(require("path"),1),Gw=lr(require("crypto"),1),Wh=lr(ez(),1);var Ir=class extends Error{static{o(this,"NFeTsError")}};var BL=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},XT=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Qr=o(r=>new BL(r),"left"),gr=o(r=>r===void 0?new XT(void 0):new XT(r),"right");var qve=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),zf=o(r=>typeof r=="string"?Qr(new Ir(r)):r instanceof Error?Qr(new Ir(r.message,{cause:r.cause})):qve(r)?Qr(new Ir(r.message)):Qr(new Ir("unexpected error")),"leftFromError");var WT=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var PL="http://www.w3.org/2000/09/xmldsig#",tz="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",_L=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),vl=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),LL=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var zw={includeComments:!1,exclusive:!0};var R0=o(r=>{throw new Ir("Didn't expect to get here")},"unreachable");var Uy=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=vl.SHA1,i=zw){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=i}assemble(e,t,n){let i=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:PL},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:i}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:tz}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:PL},...e},{rootName:"SignedInfo"}),this.canonical);return this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case vl.SHA256:return LL.SHA256;case vl.SHA1:return LL.SHA1;default:return R0(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case vl.SHA256:return _L.RSA_SHA256;case vl.SHA1:return _L.RSA_SHA1;default:return R0(this.algorithm)}}};var JT=class extends Uy{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{certificate:a}=n;if(!e[i])return Qr(new Ir(`Node ${String(i)} not found`));let u=await this.toolkit.build(this.ns(e,i),{headless:!0,rootName:String(i),renderOpts:{pretty:!1}}),c=this.signedInfo(u,s),l=await this.signOrLeft(c,n);if(l.isLeft())return l;let p=e;return p.Signature=this.assemble(c,l.value,a),gr(p)}ns(e,t){let n=e.$?.xmlns,{$:i,...s}=e[t],{xmlns:a,...u}=i??{};return{$:{xmlns:n,...u},...s}}};var YT=class extends Uy{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{certificate:a}=n,u=this.toolkit.getNode(e,i);if(!u)return Qr(new Ir(`Node ${i} not found`));let c=this.signedInfo(u,s),l=await this.signOrLeft(c,n);if(l.isLeft())return l;let p=await this.toolkit.build(this.assemble(c,l.value,a),{rootName:"Signature"});return gr(this.toolkit.appendNode(e,p))}};var fLe=require("reflect-metadata"),nz=require("class-validator");var aLe=require("reflect-metadata");var FL="__SkipValidation__";var rz=require("class-transformer");var QT=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&QT(t)},"clearEmptyValues"),$T=o((r,e,t={})=>{let n=(0,rz.plainToInstance)(e,r);return t.clearEmptyValues&&QT(n),n},"plainToInstance");var du="__ValidateErrors__",iz=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(iz(n.children,e?`${e}.${n.property}`:n.property));let i=Object.values(n.constraints??{}).map(s=>e?`${e}.${s}`:s).join(", ");return i?t.concat(i):t},[]),"mapConstraintsToErrors"),Ht=o(r=>(e,t,n)=>{let i=n.value;n.value=function(...s){let a=Reflect.getMetadata(FL,this.constructor);if(Reflect.getMetadata(FL,this.constructor.prototype,t.toString())===!0||a===!0)return i?.apply(this,s);let[c,...l]=s,p=$T(c,r),d=(0,nz.validateSync)(p,{whitelist:!0});if(QT(p),d.length){let g=Reflect.getMetadata(du,this)??[];Reflect.defineMetadata(du,g.concat(iz(d,i?.name)),this)}return i?.apply(this,[p,...l])}},"Validates");var gLe=require("reflect-metadata");var sz=require("class-validator");var az=o(r=>(e,t)=>{(0,sz.registerDecorator)({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Li?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");var bLe=require("reflect-metadata"),kL=require("class-validator");var qy=Symbol("choice"),Hy=o(r=>r==null||r==="","isEmpty"),an=o(r=>e=>{let{properties:t,required:n=!1,...i}=r,s=Reflect.getMetadata(qy,e)??[],a={properties:t,required:n};s.push(a),Reflect.defineMetadata(qy,s,e);for(let u of t)(0,kL.registerDecorator)({name:"choice",target:e,propertyName:u,options:i,validator:{validate(c,l){let p=l.object,d=l.property,g=Reflect.getMetadata(qy,e);if(!g)return!0;let y=g.find(v=>v.properties.includes(d));if(!y||Hy(c))return!0;for(let v of y.properties){if(v===d)continue;let x=p[v];if(!Hy(x))return!1}for(let v of g)if(v!==y)for(let x of v.properties){let S=p[x];if(!Hy(S))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(qy,e);if(!l)return`${c.property} validation error`;let p=l.find(g=>g.properties.includes(c.property));if(!p)return`${c.property} validation error`;let d=c.object;for(let g of p.properties){let y=d[g];if(!Hy(y)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of l)if(g!==p)for(let y of g.properties){let v=d[y];if(!Hy(v))return`${c.property} cannot be set because ${y} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)(0,kL.registerDecorator)({name:"choiceGroupRequired",target:e,propertyName:u,options:{...i,always:!0},validator:{validate(c,l){let p=l.object,d=Reflect.getMetadata(qy,e);if(!d)return!0;let g=d.find(y=>y.properties.includes(l.property));if(!g?.required)return!0;for(let y of g.properties){let v=p[y];if(!Hy(v))return!0}return l.property!==g.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(qy,e);if(!l)return"At least one property from a choice group must be provided";let p=l.find(d=>d.properties.includes(c.property));return p?`You must provide a value for one of the following properties: ${p.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");var CLe=require("reflect-metadata");var oz=require("class-transformer");var ae=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{az(e)(t,n),(0,oz.Transform)(({value:i})=>Li.newOrUndefined(i)?.toFixed(r))(t,n)},"TransformDecimal");var lz=require("class-transformer"),fz=require("class-validator");var ZT=lr(require("dayjs"),1),uz=lr(require("dayjs/plugin/utc"),1),cz=lr(require("dayjs/plugin/timezone"),1);ZT.default.extend(uz.default);ZT.default.extend(cz.default);var Kw=ZT.default;var Xh=o((r={})=>(e,t)=>{(0,lz.Transform)(({value:n})=>{let i=n instanceof Date?n.toISOString():n;return i?Kw(i).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),(0,fz.IsDateString)()(e,t)},"TransformDateString");var zy=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
112
+ `;return typeof n=="function"&&n(null,g),g},"render")});var Dae=Q($_=>{"use strict";var T_e=UU();$_.render=T_e.render;$_.renderToFile=o(function(e,t,n,i){typeof i>"u"&&(i=n,n=void 0);let s=require("fs"),u='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+$_.render(t,n);s.writeFile(e,u,i)},"renderToFile")});var Oae=Q(Z_=>{"use strict";var qU=fI();function R_e(r,e,t){r.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=t,e.width=t,e.style.height=t+"px",e.style.width=t+"px"}o(R_e,"clearCanvas");function D_e(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}o(D_e,"getCanvasElement");Z_.render=o(function(e,t,n){let i=n,s=t;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),t||(s=D_e()),i=qU.getOptions(i);let a=qU.getImageWidth(e.modules.size,i),u=s.getContext("2d"),c=u.createImageData(a,a);return qU.qrToImageData(c.data,e,i),R_e(u,s,a),u.putImageData(c,0,0),s},"render");Z_.renderToDataURL=o(function(e,t,n){let i=n;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),i||(i={});let s=Z_.render(e,t,i),a=i.type||"image/png",u=i.rendererOpts||{};return s.toDataURL(a,u.quality)},"renderToDataURL")});var Pae=Q(pI=>{"use strict";var O_e=rU(),HU=xU(),Bae=Oae(),B_e=UU();function zU(r,e,t,n,i){let s=[].slice.call(arguments,1),a=s.length,u=typeof s[a-1]=="function";if(!u&&!O_e())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(i=t,t=e,e=n=void 0):a===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(t=e,e=n=void 0):a===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(c,l){try{let p=HU.create(t,n);c(r(p,e,n))}catch(p){l(p)}})}try{let c=HU.create(t,n);i(null,r(c,e,n))}catch(c){i(c)}}o(zU,"renderCanvas");pI.create=HU.create;pI.toCanvas=zU.bind(null,Bae.render);pI.toDataURL=zU.bind(null,Bae.renderToDataURL);pI.toString=zU.bind(null,function(r,e,t){return B_e.render(r,t)})});var kae=Q(c0=>{"use strict";var _ae=rU(),KU=xU(),P_e=yae(),Lae=Sae(),__e=Iae(),Fae=Dae();function hI(r,e,t){if(typeof r>"u")throw new Error("String required as first argument");if(typeof t>"u"&&(t=e,e={}),typeof t!="function")if(_ae())e=t||{},t=null;else throw new Error("Callback required as last argument");return{opts:e,cb:t}}o(hI,"checkParams");function L_e(r){return r.slice((r.lastIndexOf(".")-1>>>0)+2).toLowerCase()}o(L_e,"getTypeFromFilename");function e4(r){switch(r){case"svg":return Fae;case"txt":case"utf8":return Lae;case"png":case"image/png":default:return P_e}}o(e4,"getRendererFromType");function F_e(r){switch(r){case"svg":return Fae;case"terminal":return __e;case"utf8":default:return Lae}}o(F_e,"getStringRendererFromType");function dI(r,e,t){if(!t.cb)return new Promise(function(n,i){try{let s=KU.create(e,t.opts);return r(s,t.opts,function(a,u){return a?i(a):n(u)})}catch(s){i(s)}});try{let n=KU.create(e,t.opts);return r(n,t.opts,t.cb)}catch(n){t.cb(n)}}o(dI,"render");c0.create=KU.create;c0.toCanvas=Pae().toCanvas;c0.toString=o(function(e,t,n){let i=hI(e,t,n),s=i.opts?i.opts.type:void 0,a=F_e(s);return dI(a.render,e,i)},"toString");c0.toDataURL=o(function(e,t,n){let i=hI(e,t,n),s=e4(i.opts.type);return dI(s.renderToDataURL,e,i)},"toDataURL");c0.toBuffer=o(function(e,t,n){let i=hI(e,t,n),s=e4(i.opts.type);return dI(s.renderToBuffer,e,i)},"toBuffer");c0.toFile=o(function(e,t,n,i){if(typeof e!="string"||!(typeof t=="string"||typeof t=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!_ae())throw new Error("Too few arguments provided");let s=hI(t,n,i),a=s.opts.type||L_e(e),c=e4(a).renderToFile.bind(null,e);return dI(c,t,s)},"toFile");c0.toFileStream=o(function(e,t,n){if(arguments.length<2)throw new Error("Too few arguments provided");let i=hI(t,n,e.emit.bind(e,"error")),a=e4("png").renderToFileStream.bind(null,e);dI(a,t,i)},"toFileStream")});var jae=Q((Uft,Vae)=>{"use strict";Vae.exports=kae()});var V_e={};iT(V_e,{AccessKeyBuilder:()=>Iw,DanfceDefaultPdfDocument:()=>XU,DanfceReducedPdfDocument:()=>WU,DefaultDetBuilderAggregator:()=>v2,DefaultTotalBuilderAggregator:()=>y2,NFCeDto:()=>Af,NFeDto:()=>Sh,NfceAuthorizerPipeline:()=>mM,NfceConsultStatusPipeline:()=>gM,NfceQrcode:()=>kv,NfceRemoteTransmitter:()=>Bm,NfceXmlBuilder:()=>rI,NfceXmlBuilderPipeline:()=>tU,NfeAuthorizationResponsePipeline:()=>vM,NfeAuthorizerPipeline:()=>w2,NfeConsultStatusPipeline:()=>E2,NfeDetXmlBuilder:()=>Is,NfeNfceCancelPipeline:()=>SM,NfeNfceVoidRangePipeline:()=>d_,NfeRemoteTransmitter:()=>go,NfeXmlBuilder:()=>Ln,NfeXmlBuilderPipeline:()=>tI,TpEmis:()=>ia,TpEvent:()=>kf,schemas:()=>Nw});module.exports=ude(V_e);var ia=(function(r){return r.Normal="1",r.EPEC="4",r.SVCAN="6",r.SVCRS="7",r.OFFLINE="9",r})({});var kf=(function(r){return r.Cancelamento="110111",r})({});var ou=require("path"),xy=require("fs");var C3=require("path"),w3=require("module"),sT=require("url");var cde=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,by,xq=o(()=>{if(by!==void 0)return by;if(cde){by=void 0;return}try{by=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{by=void 0}return by},"getImportMetaUrl"),wq=o(()=>{if(typeof require<"u")return require;let r=xq();if(r)return(0,w3.createRequire)(r);let e=(0,sT.pathToFileURL)((0,C3.resolve)(process.cwd(),"package.json")).href;return(0,w3.createRequire)(e)},"getRequireFn"),Cq=o(()=>{if(typeof __filename<"u")return __filename;let r=xq();return r?(0,sT.fileURLToPath)(r):(0,C3.resolve)(process.cwd())},"getCurrentFile");var Eq=o(()=>typeof process<"u"&&typeof process.versions<"u"&&"electron"in process.versions,"isElectron"),lde=o(()=>{if(!Eq())return null;try{let e=require("electron").app;if(e?.getAppPath&&typeof e.getAppPath=="function")return{getAppPath:e.getAppPath}}catch{}return null},"getElectronApp"),fde=o(()=>{if(!Eq())return null;let r=process;if(r.resourcesPath)return r.resourcesPath;let e=lde();if(e)try{let t=e.getAppPath();if(typeof t=="string")return(0,ou.dirname)(t.replace(/\.asar$/,""))}catch{}return null},"getElectronResourcesPath"),wy=o((r,{onFound:e,onNotFound:t})=>{let n=fde();if(n){let l=(0,ou.resolve)(n,"node_modules","nfets",r);if((0,xy.existsSync)(l))return e(l)}let i=Cq(),s=i.includes(".asar")?process.cwd():i,a=(0,ou.resolve)(s,"../../../../"),u=(0,ou.resolve)(a,r);if((0,xy.existsSync)(u))return e(u);let c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,r);if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,"node_modules","nfets",r);if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}c=s;for(let l=0;l<5;l++){let p=(0,ou.resolve)(c,r.replace(/^build\//,"Release/"));if((0,xy.existsSync)(p))return e(p);let d=(0,ou.dirname)(c);if(d===c)break;c=d}return t()},"search");var pde={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21",PL_010_V1_30:"PL_010_V1.30"},Nw=o(()=>{if(process.env.NFETS_NFE_SCHEMAS_DIR)return process.env.NFETS_NFE_SCHEMAS_DIR;try{return wy("packages/nfe/schemas",{onFound:o(r=>r,"onFound"),onNotFound:o(()=>{throw new Error("Schemas not found on packages/nfe/schemas")},"onNotFound")})}catch{return wy("nfe/schemas",{onFound:o(r=>r,"onFound"),onNotFound:o(()=>{throw new Error("Schemas not found on nfe/schemas")},"onNotFound")})}},"schemas"),Vf=pde;var Iw=class{static{o(this,"AccessKeyBuilder")}compile(e){let t=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),s=(e.identification??"").padStart(14,"0"),a=e.mod.toString().padStart(2,"0"),u=e.serie.toString().padStart(3,"0"),c=e.nNF.toString().padStart(9,"0"),l=e.tpEmis.toString().padStart(1,"0"),p=(e.cNF??this.code()).toString().padStart(8,"0"),d=`${t}${n}${i}${s}${a}${u}${c}${l}${p}`;return`${d}${this.verifyingDigit(d)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,s,a,u,c,l,p,d,g,y,v]=n;return{cUF:s,year:a,month:u,identification:c,mod:l,serie:p,nNF:d,tpEmis:g,cNF:y,vd:v}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let t=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let a=0;a<8&&n>=0;a++){let u=parseInt(e[n]);i+=u*t[a],n--}let s=11-i%11;return s>9?0:s}};var Cy=9e15,Lh=1e9,E3="0123456789abcdef",uT="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",cT="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",A3={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Cy,maxE:Cy,crypto:!1},Tq,jf,Yt=!0,fT="[DecimalError] ",_h=fT+"Invalid argument: ",Rq=fT+"Precision limit exceeded",Dq=fT+"crypto unavailable",Oq="[object Decimal]",sa=Math.floor,Ji=Math.pow,hde=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,dde=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,mde=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Bq=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tc=1e7,Lt=7,gde=9007199254740991,vde=uT.length-1,N3=cT.length-1,ze={toStringTag:Oq};ze.absoluteValue=ze.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),It(r)};ze.ceil=function(){return It(new this.constructor(this),this.e+1,2)};ze.clampedTo=ze.clamp=function(r,e){var t,n=this,i=n.constructor;if(r=new i(r),e=new i(e),!r.s||!e.s)return new i(NaN);if(r.gt(e))throw Error(_h+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new i(n)};ze.comparedTo=ze.cmp=function(r){var e,t,n,i,s=this,a=s.d,u=(r=new s.constructor(r)).d,c=s.s,l=r.s;if(!a||!u)return!c||!l?NaN:c!==l?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!==l)return c;if(s.e!==r.e)return s.e>r.e^c<0?1:-1;for(n=a.length,i=u.length,e=0,t=n<i?n:i;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ze.cosine=ze.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Lt,n.rounding=1,t=yde(n,kq(n,t)),n.precision=r,n.rounding=e,It(jf==2||jf==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};ze.cubeRoot=ze.cbrt=function(){var r,e,t,n,i,s,a,u,c,l,p=this,d=p.constructor;if(!p.isFinite()||p.isZero())return new d(p);for(Yt=!1,s=p.s*Ji(p.s*p,1/3),!s||Math.abs(s)==1/0?(t=Bs(p.d),r=p.e,(s=(r-t.length+1)%3)&&(t+=s==1||s==-2?"0":"00"),s=Ji(t,1/3),r=sa((r+1)/3)-(r%3==(r<0?-1:2)),s==1/0?t="5e"+r:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new d(t),n.s=p.s):n=new d(s.toString()),a=(r=d.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(p),n=yn(l.plus(p).times(u),l.plus(c),a+2,1),Bs(u.d).slice(0,a)===(t=Bs(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!i&&t=="4999"){if(!i&&(It(u,r+1,0),u.times(u).times(u).eq(p))){n=u;break}a+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(It(n,r+1,1),e=!n.times(n).times(n).eq(p));break}return Yt=!0,It(n,r,d.rounding,e)};ze.decimalPlaces=ze.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-sa(this.e/Lt))*Lt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};ze.dividedBy=ze.div=function(r){return yn(this,new this.constructor(r))};ze.dividedToIntegerBy=ze.divToInt=function(r){var e=this,t=e.constructor;return It(yn(e,new t(r),0,1,1),t.precision,t.rounding)};ze.equals=ze.eq=function(r){return this.cmp(r)===0};ze.floor=function(){return It(new this.constructor(this),this.e+1,3)};ze.greaterThan=ze.gt=function(r){return this.cmp(r)>0};ze.greaterThanOrEqualTo=ze.gte=function(r){var e=this.cmp(r);return e==1||e===0};ze.hyperbolicCosine=ze.cosh=function(){var r,e,t,n,i,s=this,a=s.constructor,u=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(r=Math.ceil(i/3),e=(1/hT(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),s=Ey(a,1,s.times(e),new a(1),!0);for(var c,l=r,p=new a(8);l--;)c=s.times(s),s=u.minus(c.times(p.minus(c.times(p))));return It(s,a.precision=t,a.rounding=n,!0)};ze.hyperbolicSine=ze.sinh=function(){var r,e,t,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,t=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Ey(s,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/hT(5,r)),i=Ey(s,2,i,i,!0);for(var a,u=new s(5),c=new s(16),l=new s(20);r--;)a=i.times(i),i=i.times(u.plus(a.times(c.times(a).plus(l))))}return s.precision=e,s.rounding=t,It(i,e,t,!0)};ze.hyperbolicTangent=ze.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,yn(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};ze.inverseCosine=ze.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,i=e.rounding;return t!==-1?t===0?r.isNeg()?sl(e,n,i):new e(0):new e(NaN):r.isZero()?sl(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,r.times(2))};ze.inverseHyperbolicCosine=ze.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Yt=!1,t=t.times(t).minus(1).sqrt().plus(t),Yt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};ze.inverseHyperbolicSine=ze.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Yt=!1,t=t.times(t).plus(1).sqrt().plus(t),Yt=!0,n.precision=r,n.rounding=e,t.ln())};ze.inverseHyperbolicTangent=ze.atanh=function(){var r,e,t,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=s.precision,e=s.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?It(new s(i),r,e,!0):(s.precision=t=n-i.e,i=yn(i.plus(1),new s(1).minus(i),t+r,1),s.precision=r+4,s.rounding=1,i=i.ln(),s.precision=r,s.rounding=e,i.times(.5))):new s(NaN)};ze.inverseSine=ze.asin=function(){var r,e,t,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),t=s.precision,n=s.rounding,e!==-1?e===0?(r=sl(s,t+4,n).times(.5),r.s=i.s,r):new s(NaN):(s.precision=t+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=t,s.rounding=n,i.times(2)))};ze.inverseTangent=ze.atan=function(){var r,e,t,n,i,s,a,u,c,l=this,p=l.constructor,d=p.precision,g=p.rounding;if(l.isFinite()){if(l.isZero())return new p(l);if(l.abs().eq(1)&&d+4<=N3)return a=sl(p,d+4,g).times(.25),a.s=l.s,a}else{if(!l.s)return new p(NaN);if(d+4<=N3)return a=sl(p,d+4,g).times(.5),a.s=l.s,a}for(p.precision=u=d+10,p.rounding=1,t=Math.min(28,u/Lt+2|0),r=t;r;--r)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Yt=!1,e=Math.ceil(u/Lt),n=1,c=l.times(l),a=new p(l),i=l;r!==-1;)if(i=i.times(c),s=a.minus(i.div(n+=2)),i=i.times(c),a=s.plus(i.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===s.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Yt=!0,It(a,p.precision=d,p.rounding=g,!0)};ze.isFinite=function(){return!!this.d};ze.isInteger=ze.isInt=function(){return!!this.d&&sa(this.e/Lt)>this.d.length-2};ze.isNaN=function(){return!this.s};ze.isNegative=ze.isNeg=function(){return this.s<0};ze.isPositive=ze.isPos=function(){return this.s>0};ze.isZero=function(){return!!this.d&&this.d[0]===0};ze.lessThan=ze.lt=function(r){return this.cmp(r)<0};ze.lessThanOrEqualTo=ze.lte=function(r){return this.cmp(r)<1};ze.logarithm=ze.log=function(r){var e,t,n,i,s,a,u,c,l=this,p=l.constructor,d=p.precision,g=p.rounding,y=5;if(r==null)r=new p(10),e=!0;else{if(r=new p(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new p(NaN);e=r.eq(10)}if(t=l.d,l.s<0||!t||!t[0]||l.eq(1))return new p(t&&!t[0]?-1/0:l.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)s=!0;else{for(i=t[0];i%10===0;)i/=10;s=i!==1}if(Yt=!1,u=d+y,a=Ph(l,u),n=e?lT(p,u+10):Ph(r,u),c=yn(a,n,u,1),Tw(c.d,i=d,g))do if(u+=10,a=Ph(l,u),n=e?lT(p,u+10):Ph(r,u),c=yn(a,n,u,1),!s){+Bs(c.d).slice(i+1,i+15)+1==1e14&&(c=It(c,d+1,0));break}while(Tw(c.d,i+=10,g));return Yt=!0,It(c,d,g)};ze.minus=ze.sub=function(r){var e,t,n,i,s,a,u,c,l,p,d,g,y=this,v=y.constructor;if(r=new v(r),!y.d||!r.d)return!y.s||!r.s?r=new v(NaN):y.d?r.s=-r.s:r=new v(r.d||y.s!==r.s?y:NaN),r;if(y.s!=r.s)return r.s=-r.s,y.plus(r);if(l=y.d,g=r.d,u=v.precision,c=v.rounding,!l[0]||!g[0]){if(g[0])r.s=-r.s;else if(l[0])r=new v(y);else return new v(c===3?-0:0);return Yt?It(r,u,c):r}if(t=sa(r.e/Lt),p=sa(y.e/Lt),l=l.slice(),s=p-t,s){for(d=s<0,d?(e=l,s=-s,a=g.length):(e=g,t=p,a=l.length),n=Math.max(Math.ceil(u/Lt),a)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=g.length,d=n<a,d&&(a=n),n=0;n<a;n++)if(l[n]!=g[n]){d=l[n]<g[n];break}s=0}for(d&&(e=l,l=g,g=e,r.s=-r.s),a=l.length,n=g.length-a;n>0;--n)l[a++]=0;for(n=g.length;n>s;){if(l[--n]<g[n]){for(i=n;i&&l[--i]===0;)l[i]=tc-1;--l[i],l[n]+=tc}l[n]-=g[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--t;return l[0]?(r.d=l,r.e=pT(l,t),Yt?It(r,u,c):r):new v(c===3?-0:0)};ze.modulo=ze.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?It(new n(t),n.precision,n.rounding):(Yt=!1,n.modulo==9?(e=yn(t,r.abs(),0,3,1),e.s*=r.s):e=yn(t,r,0,n.modulo,1),e=e.times(r),Yt=!0,t.minus(e))};ze.naturalExponential=ze.exp=function(){return I3(this)};ze.naturalLogarithm=ze.ln=function(){return Ph(this)};ze.negated=ze.neg=function(){var r=new this.constructor(this);return r.s=-r.s,It(r)};ze.plus=ze.add=function(r){var e,t,n,i,s,a,u,c,l,p,d=this,g=d.constructor;if(r=new g(r),!d.d||!r.d)return!d.s||!r.s?r=new g(NaN):d.d||(r=new g(r.d||d.s===r.s?d:NaN)),r;if(d.s!=r.s)return r.s=-r.s,d.minus(r);if(l=d.d,p=r.d,u=g.precision,c=g.rounding,!l[0]||!p[0])return p[0]||(r=new g(d)),Yt?It(r,u,c):r;if(s=sa(d.e/Lt),n=sa(r.e/Lt),l=l.slice(),i=s-n,i){for(i<0?(t=l,i=-i,a=p.length):(t=p,n=s,a=l.length),s=Math.ceil(u/Lt),a=s>a?s+1:a+1,i>a&&(i=a,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(a=l.length,i=p.length,a-i<0&&(i=a,t=p,p=l,l=t),e=0;i;)e=(l[--i]=l[i]+p[i]+e)/tc|0,l[i]%=tc;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=pT(l,n),Yt?It(r,u,c):r};ze.precision=ze.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(_h+r);return t.d?(e=Pq(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};ze.round=function(){var r=this,e=r.constructor;return It(new e(r),r.e+1,e.rounding)};ze.sine=ze.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+Lt,n.rounding=1,t=bde(n,kq(n,t)),n.precision=r,n.rounding=e,It(jf>2?t.neg():t,r,e,!0)):new n(NaN)};ze.squareRoot=ze.sqrt=function(){var r,e,t,n,i,s,a=this,u=a.d,c=a.e,l=a.s,p=a.constructor;if(l!==1||!u||!u[0])return new p(!l||l<0&&(!u||u[0])?NaN:u?a:1/0);for(Yt=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=Bs(u),(e.length+c)%2==0&&(e+="0"),l=Math.sqrt(e),c=sa((c+1)/2)-(c<0||c%2),l==1/0?e="5e"+c:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new p(e)):n=new p(l.toString()),t=(c=p.precision)+3;;)if(s=n,n=s.plus(yn(a,s,t+2,1)).times(.5),Bs(s.d).slice(0,t)===(e=Bs(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(It(s,c+1,0),s.times(s).eq(a))){n=s;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(It(n,c+1,1),r=!n.times(n).eq(a));break}return Yt=!0,It(n,c,p.rounding,r)};ze.tangent=ze.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=yn(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,It(jf==2||jf==4?t.neg():t,r,e,!0)):new n(NaN)};ze.times=ze.mul=function(r){var e,t,n,i,s,a,u,c,l,p=this,d=p.constructor,g=p.d,y=(r=new d(r)).d;if(r.s*=p.s,!g||!g[0]||!y||!y[0])return new d(!r.s||g&&!g[0]&&!y||y&&!y[0]&&!g?NaN:!g||!y?r.s/0:r.s*0);for(t=sa(p.e/Lt)+sa(r.e/Lt),c=g.length,l=y.length,c<l&&(s=g,g=y,y=s,a=c,c=l,l=a),s=[],a=c+l,n=a;n--;)s.push(0);for(n=l;--n>=0;){for(e=0,i=c+n;i>n;)u=s[i]+y[n]*g[i-n-1]+e,s[i--]=u%tc|0,e=u/tc|0;s[i]=(s[i]+e)%tc|0}for(;!s[--a];)s.pop();return e?++t:s.shift(),r.d=s,r.e=pT(s,t),Yt?It(r,d.precision,d.rounding):r};ze.toBinary=function(r,e){return T3(this,2,r,e)};ze.toDecimalPlaces=ze.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ja(r,0,Lh),e===void 0?e=n.rounding:Ja(e,0,8),It(t,r+t.e+1,e))};ze.toExponential=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=al(n,!0):(Ja(r,0,Lh),e===void 0?e=i.rounding:Ja(e,0,8),n=It(new i(n),r+1,e),t=al(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};ze.toFixed=function(r,e){var t,n,i=this,s=i.constructor;return r===void 0?t=al(i):(Ja(r,0,Lh),e===void 0?e=s.rounding:Ja(e,0,8),n=It(new s(i),r+i.e+1,e),t=al(n,!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};ze.toFraction=function(r){var e,t,n,i,s,a,u,c,l,p,d,g,y=this,v=y.d,x=y.constructor;if(!v)return new x(y);if(l=t=new x(1),n=c=new x(0),e=new x(n),s=e.e=Pq(v)-y.e-1,a=s%Lt,e.d[0]=Ji(10,a<0?Lt+a:a),r==null)r=s>0?e:l;else{if(u=new x(r),!u.isInt()||u.lt(l))throw Error(_h+u);r=u.gt(e)?s>0?e:l:u}for(Yt=!1,u=new x(Bs(v)),p=x.precision,x.precision=s=v.length*Lt*2;d=yn(u,e,0,1,1),i=t.plus(d.times(n)),i.cmp(r)!=1;)t=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=e,e=u.minus(d.times(i)),u=i;return i=yn(r.minus(t),n,0,1,1),c=c.plus(i.times(l)),t=t.plus(i.times(n)),c.s=l.s=y.s,g=yn(l,n,s,1).minus(y).abs().cmp(yn(c,t,s,1).minus(y).abs())<1?[l,n]:[c,t],x.precision=p,Yt=!0,g};ze.toHexadecimal=ze.toHex=function(r,e){return T3(this,16,r,e)};ze.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ja(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Yt=!1,t=yn(t,r,0,e,1).times(r),Yt=!0,It(t)):(r.s=t.s,t=r),t};ze.toNumber=function(){return+this};ze.toOctal=function(r,e){return T3(this,8,r,e)};ze.toPower=ze.pow=function(r){var e,t,n,i,s,a,u=this,c=u.constructor,l=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Ji(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,s=c.rounding,r.eq(1))return It(u,n,s);if(e=sa(r.e/Lt),e>=r.d.length-1&&(t=l<0?-l:l)<=gde)return i=_q(c,u,t,n),r.s<0?new c(1).div(i):It(i,n,s);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Ji(+u,l),e=t==0||!isFinite(t)?sa(l*(Math.log("0."+Bs(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(Yt=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),i=I3(r.times(Ph(u,n+t)),n),i.d&&(i=It(i,n+5,1),Tw(i.d,n,s)&&(e=n+10,i=It(I3(r.times(Ph(u,e+t)),e),e+5,1),+Bs(i.d).slice(n+1,n+15)+1==1e14&&(i=It(i,n+1,0)))),i.s=a,Yt=!0,c.rounding=s,It(i,n,s))};ze.toPrecision=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=al(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ja(r,1,Lh),e===void 0?e=i.rounding:Ja(e,0,8),n=It(new i(n),r,e),t=al(n,r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};ze.toSignificantDigits=ze.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ja(r,1,Lh),e===void 0?e=n.rounding:Ja(e,0,8)),It(new n(t),r,e)};ze.toString=function(){var r=this,e=r.constructor,t=al(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};ze.truncated=ze.trunc=function(){return It(new this.constructor(this),this.e+1,1)};ze.valueOf=ze.toJSON=function(){var r=this,e=r.constructor,t=al(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Bs(r){var e,t,n,i=r.length-1,s="",a=r[0];if(i>0){for(s+=a,e=1;e<i;e++)n=r[e]+"",t=Lt-n.length,t&&(s+=Bh(t)),s+=n;a=r[e],n=a+"",t=Lt-n.length,t&&(s+=Bh(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}o(Bs,"digitsToString");function Ja(r,e,t){if(r!==~~r||r<e||r>t)throw Error(_h+r)}o(Ja,"checkInt32");function Tw(r,e,t,n){var i,s,a,u;for(s=r[0];s>=10;s/=10)--e;return--e<0?(e+=Lt,i=0):(i=Math.ceil((e+1)/Lt),e%=Lt),s=Ji(10,Lt-e),u=r[i]%s|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==s||t>3&&u+1==s/2)&&(r[i+1]/s/100|0)==Ji(10,e-2)-1||(u==s/2||u==0)&&(r[i+1]/s/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==s||!n&&t>3&&u+1==s/2)&&(r[i+1]/s/1e3|0)==Ji(10,e-3)-1,a}o(Tw,"checkRoundingDigits");function aT(r,e,t){for(var n,i=[0],s,a=0,u=r.length;a<u;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=E3.indexOf(r.charAt(a++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}o(aT,"convertBase");function yde(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/hT(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Ey(r,1,e.times(i),new r(1));for(var s=t;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(yde,"cosine");var yn=(function(){function r(n,i,s){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+u,n[c]=a%s|0,u=a/s|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,i,s,a){var u,c;if(s!=a)c=s>a?1:-1;else for(u=c=0;u<s;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}o(e,"compare");function t(n,i,s,a){for(var u=0;s--;)n[s]-=u,u=n[s]<i[s]?1:0,n[s]=u*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,i,s,a,u,c){var l,p,d,g,y,v,x,S,A,D,C,E,I,B,q,R,z,K,H,J,ge=n.constructor,ve=n.s==i.s?1:-1,le=n.d,Z=i.d;if(!le||!le[0]||!Z||!Z[0])return new ge(!n.s||!i.s||(le?Z&&le[0]==Z[0]:!Z)?NaN:le&&le[0]==0||!Z?ve*0:ve/0);for(c?(y=1,p=n.e-i.e):(c=tc,y=Lt,p=sa(n.e/y)-sa(i.e/y)),H=Z.length,z=le.length,A=new ge(ve),D=A.d=[],d=0;Z[d]==(le[d]||0);d++);if(Z[d]>(le[d]||0)&&p--,s==null?(B=s=ge.precision,a=ge.rounding):u?B=s+(n.e-i.e)+1:B=s,B<0)D.push(1),v=!0;else{if(B=B/y+2|0,d=0,H==1){for(g=0,Z=Z[0],B++;(d<z||g)&&B--;d++)q=g*c+(le[d]||0),D[d]=q/Z|0,g=q%Z|0;v=g||d<z}else{for(g=c/(Z[0]+1)|0,g>1&&(Z=r(Z,g,c),le=r(le,g,c),H=Z.length,z=le.length),R=H,C=le.slice(0,H),E=C.length;E<H;)C[E++]=0;J=Z.slice(),J.unshift(0),K=Z[0],Z[1]>=c/2&&++K;do g=0,l=e(Z,C,H,E),l<0?(I=C[0],H!=E&&(I=I*c+(C[1]||0)),g=I/K|0,g>1?(g>=c&&(g=c-1),x=r(Z,g,c),S=x.length,E=C.length,l=e(x,C,S,E),l==1&&(g--,t(x,H<S?J:Z,S,c))):(g==0&&(l=g=1),x=Z.slice()),S=x.length,S<E&&x.unshift(0),t(C,x,E,c),l==-1&&(E=C.length,l=e(Z,C,H,E),l<1&&(g++,t(C,H<E?J:Z,E,c))),E=C.length):l===0&&(g++,C=[0]),D[d++]=g,l&&C[0]?C[E++]=le[R]||0:(C=[le[R]],E=1);while((R++<z||C[0]!==void 0)&&B--);v=C[0]!==void 0}D[0]||D.shift()}if(y==1)A.e=p,Tq=v;else{for(d=1,g=D[0];g>=10;g/=10)d++;A.e=d+p*y-1,It(A,u?s+A.e+1:s,a,v)}return A}})();function It(r,e,t,n){var i,s,a,u,c,l,p,d,g,y=r.constructor;e:if(e!=null){if(d=r.d,!d)return r;for(i=1,u=d[0];u>=10;u/=10)i++;if(s=e-i,s<0)s+=Lt,a=e,p=d[g=0],c=p/Ji(10,i-a-1)%10|0;else if(g=Math.ceil((s+1)/Lt),u=d.length,g>=u)if(n){for(;u++<=g;)d.push(0);p=c=0,i=1,s%=Lt,a=s-Lt+1}else break e;else{for(p=u=d[g],i=1;u>=10;u/=10)i++;s%=Lt,a=s-Lt+i,c=a<0?0:p/Ji(10,i-a-1)%10|0}if(n=n||e<0||d[g+1]!==void 0||(a<0?p:p%Ji(10,i-a-1)),l=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(s>0?a>0?p/Ji(10,i-a):0:d[g-1])%10&1||t==(r.s<0?8:7)),e<1||!d[0])return d.length=0,l?(e-=r.e+1,d[0]=Ji(10,(Lt-e%Lt)%Lt),r.e=-e||0):d[0]=r.e=0,r;if(s==0?(d.length=g,u=1,g--):(d.length=g+1,u=Ji(10,Lt-s),d[g]=a>0?(p/Ji(10,i-a)%Ji(10,a)|0)*u:0),l)for(;;)if(g==0){for(s=1,a=d[0];a>=10;a/=10)s++;for(a=d[0]+=u,u=1;a>=10;a/=10)u++;s!=u&&(r.e++,d[0]==tc&&(d[0]=1));break}else{if(d[g]+=u,d[g]!=tc)break;d[g--]=0,u=1}for(s=d.length;d[--s]===0;)d.pop()}return Yt&&(r.e>y.maxE?(r.d=null,r.e=NaN):r.e<y.minE&&(r.e=0,r.d=[0])),r}o(It,"finalise");function al(r,e,t){if(!r.isFinite())return Fq(r);var n,i=r.e,s=Bs(r.d),a=s.length;return e?(t&&(n=t-a)>0?s=s.charAt(0)+"."+s.slice(1)+Bh(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(r.e<0?"e":"e+")+r.e):i<0?(s="0."+Bh(-i-1)+s,t&&(n=t-a)>0&&(s+=Bh(n))):i>=a?(s+=Bh(i+1-a),t&&(n=t-i-1)>0&&(s=s+"."+Bh(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),t&&(n=t-a)>0&&(i+1===a&&(s+="."),s+=Bh(n))),s}o(al,"finiteToString");function pT(r,e){var t=r[0];for(e*=Lt;t>=10;t/=10)e++;return e}o(pT,"getBase10Exponent");function lT(r,e,t){if(e>vde)throw Yt=!0,t&&(r.precision=t),Error(Rq);return It(new r(uT),e,1,!0)}o(lT,"getLn10");function sl(r,e,t){if(e>N3)throw Error(Rq);return It(new r(cT),e,t,!0)}o(sl,"getPi");function Pq(r){var e=r.length-1,t=e*Lt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(Pq,"getPrecision");function Bh(r){for(var e="";r--;)e+="0";return e}o(Bh,"getZeroString");function _q(r,e,t,n){var i,s=new r(1),a=Math.ceil(n/Lt+4);for(Yt=!1;;){if(t%2&&(s=s.times(e),Nq(s.d,a)&&(i=!0)),t=sa(t/2),t===0){t=s.d.length-1,i&&s.d[t]===0&&++s.d[t];break}e=e.times(e),Nq(e.d,a)}return Yt=!0,s}o(_q,"intPow");function Aq(r){return r.d[r.d.length-1]&1}o(Aq,"isOdd");function Lq(r,e,t){for(var n,i,s=new r(e[0]),a=0;++a<e.length;){if(i=new r(e[a]),!i.s){s=i;break}n=s.cmp(i),(n===t||n===0&&s.s===t)&&(s=i)}return s}o(Lq,"maxOrMin");function I3(r,e){var t,n,i,s,a,u,c,l=0,p=0,d=0,g=r.constructor,y=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Yt=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),d+=5;for(n=Math.log(Ji(2,d))/Math.LN10*2+5|0,c+=n,t=s=a=new g(1),g.precision=c;;){if(s=It(s.times(r),c,1),t=t.times(++p),u=a.plus(yn(s,t,c,1)),Bs(u.d).slice(0,c)===Bs(a.d).slice(0,c)){for(i=d;i--;)a=It(a.times(a),c,1);if(e==null)if(l<3&&Tw(a.d,c-n,y,l))g.precision=c+=10,t=s=u=new g(1),p=0,l++;else return It(a,g.precision=v,y,Yt=!0);else return g.precision=v,a}a=u}}o(I3,"naturalExponential");function Ph(r,e){var t,n,i,s,a,u,c,l,p,d,g,y=1,v=10,x=r,S=x.d,A=x.constructor,D=A.rounding,C=A.precision;if(x.s<0||!S||!S[0]||!x.e&&S[0]==1&&S.length==1)return new A(S&&!S[0]?-1/0:x.s!=1?NaN:S?0:x);if(e==null?(Yt=!1,p=C):p=e,A.precision=p+=v,t=Bs(S),n=t.charAt(0),Math.abs(s=x.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)x=x.times(r),t=Bs(x.d),n=t.charAt(0),y++;s=x.e,n>1?(x=new A("0."+t),s++):x=new A(n+"."+t.slice(1))}else return l=lT(A,p+2,C).times(s+""),x=Ph(new A(n+"."+t.slice(1)),p-v).plus(l),A.precision=C,e==null?It(x,C,D,Yt=!0):x;for(d=x,c=a=x=yn(x.minus(1),x.plus(1),p,1),g=It(x.times(x),p,1),i=3;;){if(a=It(a.times(g),p,1),l=c.plus(yn(a,new A(i),p,1)),Bs(l.d).slice(0,p)===Bs(c.d).slice(0,p))if(c=c.times(2),s!==0&&(c=c.plus(lT(A,p+2,C).times(s+""))),c=yn(c,new A(y),p,1),e==null)if(Tw(c.d,p-v,D,u))A.precision=p+=v,l=a=x=yn(d.minus(1),d.plus(1),p,1),g=It(x.times(x),p,1),i=u=1;else return It(c,A.precision=C,D,Yt=!0);else return A.precision=C,c;c=l,i+=2}}o(Ph,"naturalLogarithm");function Fq(r){return String(r.s*r.s/0)}o(Fq,"nonFiniteToString");function oT(r,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%Lt,t<0&&(n+=Lt),n<i){for(n&&r.d.push(+e.slice(0,n)),i-=Lt;n<i;)r.d.push(+e.slice(n,n+=Lt));e=e.slice(n),n=Lt-e.length}else n-=i;for(;n--;)e+="0";r.d.push(+e),Yt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(oT,"parseDecimal");function Sde(r,e){var t,n,i,s,a,u,c,l,p;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Bq.test(e))return oT(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(dde.test(e))t=16,e=e.toLowerCase();else if(hde.test(e))t=2;else if(mde.test(e))t=8;else throw Error(_h+e);for(s=e.search(/p/i),s>0?(c=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),a=s>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,s=u-s,i=_q(n,new n(t),s,s*2)),l=aT(e,t,tc),p=l.length-1,s=p;l[s]===0;--s)l.pop();return s<0?new n(r.s*0):(r.e=pT(l,p),r.d=l,Yt=!1,a&&(r=yn(r,i,u*4)),c&&(r=r.times(Math.abs(c)<54?Ji(2,c):Ay.pow(2,c))),Yt=!0,r)}o(Sde,"parseOther");function bde(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Ey(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/hT(5,t)),e=Ey(r,2,e,e);for(var i,s=new r(5),a=new r(16),u=new r(20);t--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(u))));return e}o(bde,"sine");function Ey(r,e,t,n,i){var s,a,u,c,l=1,p=r.precision,d=Math.ceil(p/Lt);for(Yt=!1,c=t.times(t),u=new r(n);;){if(a=yn(u.times(c),new r(e++*e++),p,1),u=i?n.plus(a):n.minus(a),n=yn(a.times(c),new r(e++*e++),p,1),a=u.plus(n),a.d[d]!==void 0){for(s=d;a.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=n,n=a,a=s,l++}return Yt=!0,a.d.length=d+1,a}o(Ey,"taylorSeries");function hT(r,e){for(var t=r;--e;)t*=r;return t}o(hT,"tinyPow");function kq(r,e){var t,n=e.s<0,i=sl(r,r.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return jf=n?4:1,e;if(t=e.divToInt(i),t.isZero())jf=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(s))return jf=Aq(t)?n?2:3:n?4:1,e;jf=Aq(t)?n?1:4:n?3:2}return e.minus(i).abs()}o(kq,"toLessThanHalfPi");function T3(r,e,t,n){var i,s,a,u,c,l,p,d,g,y=r.constructor,v=t!==void 0;if(v?(Ja(t,1,Lh),n===void 0?n=y.rounding:Ja(n,0,8)):(t=y.precision,n=y.rounding),!r.isFinite())p=Fq(r);else{for(p=al(r),a=p.indexOf("."),v?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,a>=0&&(p=p.replace(".",""),g=new y(1),g.e=p.length-a,g.d=aT(al(g),10,i),g.e=g.d.length),d=aT(p,10,i),s=c=d.length;d[--c]==0;)d.pop();if(!d[0])p=v?"0p+0":"0";else{if(a<0?s--:(r=new y(r),r.d=d,r.e=s,r=yn(r,g,t,n,0,i),d=r.d,s=r.e,l=Tq),a=d[t],u=i/2,l=l||d[t+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||l||n===6&&d[t-1]&1||n===(r.s<0?8:7)),d.length=t,l)for(;++d[--t]>i-1;)d[t]=0,t||(++s,d.unshift(1));for(c=d.length;!d[c-1];--c);for(a=0,p="";a<c;a++)p+=E3.charAt(d[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)p+="0";for(d=aT(p,i,e),c=d.length;!d[c-1];--c);for(a=1,p="1.";a<c;a++)p+=E3.charAt(d[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)p="0"+p;p="0."+p}else if(++s>c)for(s-=c;s--;)p+="0";else s<c&&(p=p.slice(0,s)+"."+p.slice(s))}p=(e==16?"0x":e==2?"0b":e==8?"0o":"")+p}return r.s<0?"-"+p:p}o(T3,"toStringBinary");function Nq(r,e){if(r.length>e)return r.length=e,!0}o(Nq,"truncate");function xde(r){return new this(r).abs()}o(xde,"abs");function wde(r){return new this(r).acos()}o(wde,"acos");function Cde(r){return new this(r).acosh()}o(Cde,"acosh");function Ede(r,e){return new this(r).plus(e)}o(Ede,"add");function Ade(r){return new this(r).asin()}o(Ade,"asin");function Nde(r){return new this(r).asinh()}o(Nde,"asinh");function Ide(r){return new this(r).atan()}o(Ide,"atan");function Tde(r){return new this(r).atanh()}o(Tde,"atanh");function Rde(r,e){r=new this(r),e=new this(e);var t,n=this.precision,i=this.rounding,s=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=sl(this,s,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?sl(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=sl(this,s,1).times(.5),t.s=r.s):e.s<0?(this.precision=s,this.rounding=1,t=this.atan(yn(r,e,s,1)),e=sl(this,s,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(yn(r,e,s,1)),t}o(Rde,"atan2");function Dde(r){return new this(r).cbrt()}o(Dde,"cbrt");function Ode(r){return It(r=new this(r),r.e+1,2)}o(Ode,"ceil");function Bde(r,e,t){return new this(r).clamp(e,t)}o(Bde,"clamp");function Pde(r){if(!r||typeof r!="object")throw Error(fT+"Object expected");var e,t,n,i=r.defaults===!0,s=["precision",1,Lh,"rounding",0,8,"toExpNeg",-Cy,0,"toExpPos",0,Cy,"maxE",0,Cy,"minE",-Cy,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(t=s[e],i&&(this[t]=A3[t]),(n=r[t])!==void 0)if(sa(n)===n&&n>=s[e+1]&&n<=s[e+2])this[t]=n;else throw Error(_h+t+": "+n);if(t="crypto",i&&(this[t]=A3[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Dq);else this[t]=!1;else throw Error(_h+t+": "+n);return this}o(Pde,"config");function _de(r){return new this(r).cos()}o(_de,"cos");function Lde(r){return new this(r).cosh()}o(Lde,"cosh");function Vq(r){var e,t,n;function i(s){var a,u,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,Iq(s)){l.s=s.s,Yt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(a=0,u=s;u>=10;u/=10)a++;Yt?a>i.maxE?(l.e=NaN,l.d=null):a<i.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[s]):(l.e=a,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return oT(l,s.toString())}if(c==="string")return(u=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(u===43&&(s=s.slice(1)),l.s=1),Bq.test(s)?oT(l,s):Sde(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,oT(l,s.toString());throw Error(_h+s)}if(o(i,"Decimal"),i.prototype=ze,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Pde,i.clone=Vq,i.isDecimal=Iq,i.abs=xde,i.acos=wde,i.acosh=Cde,i.add=Ede,i.asin=Ade,i.asinh=Nde,i.atan=Ide,i.atanh=Tde,i.atan2=Rde,i.cbrt=Dde,i.ceil=Ode,i.clamp=Bde,i.cos=_de,i.cosh=Lde,i.div=Fde,i.exp=kde,i.floor=Vde,i.hypot=jde,i.ln=Mde,i.log=Ude,i.log10=Hde,i.log2=qde,i.max=zde,i.min=Kde,i.mod=Gde,i.mul=Xde,i.pow=Wde,i.random=Jde,i.round=Yde,i.sign=Qde,i.sin=$de,i.sinh=Zde,i.sqrt=eme,i.sub=tme,i.sum=rme,i.tan=nme,i.tanh=ime,i.trunc=sme,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return i.config(r),i}o(Vq,"clone");function Fde(r,e){return new this(r).div(e)}o(Fde,"div");function kde(r){return new this(r).exp()}o(kde,"exp");function Vde(r){return It(r=new this(r),r.e+1,3)}o(Vde,"floor");function jde(){var r,e,t=new this(0);for(Yt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Yt=!0,new this(1/0);t=e}return Yt=!0,t.sqrt()}o(jde,"hypot");function Iq(r){return r instanceof Ay||r&&r.toStringTag===Oq||!1}o(Iq,"isDecimalInstance");function Mde(r){return new this(r).ln()}o(Mde,"ln");function Ude(r,e){return new this(r).log(e)}o(Ude,"log");function qde(r){return new this(r).log(2)}o(qde,"log2");function Hde(r){return new this(r).log(10)}o(Hde,"log10");function zde(){return Lq(this,arguments,-1)}o(zde,"max");function Kde(){return Lq(this,arguments,1)}o(Kde,"min");function Gde(r,e){return new this(r).mod(e)}o(Gde,"mod");function Xde(r,e){return new this(r).mul(e)}o(Xde,"mul");function Wde(r,e){return new this(r).pow(e)}o(Wde,"pow");function Jde(r){var e,t,n,i,s=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ja(r,1,Lh),n=Math.ceil(r/Lt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(i%1e7),s+=4);s=n/4}else throw Error(Dq);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],r%=Lt,n&&r&&(i=Ji(10,Lt-r),u[s]=(n/i|0)*i);u[s]===0;s--)u.pop();if(s<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Lt)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Lt&&(t-=Lt-n)}return a.e=t,a.d=u,a}o(Jde,"random");function Yde(r){return It(r=new this(r),r.e+1,this.rounding)}o(Yde,"round");function Qde(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(Qde,"sign");function $de(r){return new this(r).sin()}o($de,"sin");function Zde(r){return new this(r).sinh()}o(Zde,"sinh");function eme(r){return new this(r).sqrt()}o(eme,"sqrt");function tme(r,e){return new this(r).sub(e)}o(tme,"sub");function rme(){var r=0,e=arguments,t=new this(e[r]);for(Yt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Yt=!0,It(t,this.precision,this.rounding)}o(rme,"sum");function nme(r){return new this(r).tan()}o(nme,"tan");function ime(r){return new this(r).tanh()}o(ime,"tanh");function sme(r){return It(r=new this(r),r.e+1,1)}o(sme,"trunc");ze[Symbol.for("nodejs.util.inspect.custom")]=ze.toString;ze[Symbol.toStringTag]="Decimal";var Ay=ze.constructor=Vq(A3);uT=new Ay(uT);cT=new Ay(cT);var Li=class r extends Ay{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var dT=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var VL=lr(require("fs"),1),pz=lr(require("path"),1),Gw=lr(require("crypto"),1),Wh=lr(ez(),1);var Ir=class extends Error{static{o(this,"NFeTsError")}};var BL=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},XT=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Qr=o(r=>new BL(r),"left"),gr=o(r=>r===void 0?new XT(void 0):new XT(r),"right");var qve=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),zf=o(r=>typeof r=="string"?Qr(new Ir(r)):r instanceof Error?Qr(new Ir(r.message,{cause:r.cause})):qve(r)?Qr(new Ir(r.message)):Qr(new Ir("unexpected error")),"leftFromError");var WT=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var PL="http://www.w3.org/2000/09/xmldsig#",tz="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",_L=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),vl=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),LL=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var zw={includeComments:!1,exclusive:!0};var R0=o(r=>{throw new Ir("Didn't expect to get here")},"unreachable");var Uy=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=vl.SHA1,i=zw){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=i}assemble(e,t,n){let i=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:PL},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:i}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:tz}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:PL},...e},{rootName:"SignedInfo"}),this.canonical);return this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case vl.SHA256:return LL.SHA256;case vl.SHA1:return LL.SHA1;default:return R0(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case vl.SHA256:return _L.RSA_SHA256;case vl.SHA1:return _L.RSA_SHA1;default:return R0(this.algorithm)}}};var JT=class extends Uy{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{certificate:a}=n;if(!e[i])return Qr(new Ir(`Node ${String(i)} not found`));let u=await this.toolkit.build(this.ns(e,i),{headless:!0,rootName:String(i),renderOpts:{pretty:!1}}),c=this.signedInfo(u,s),l=await this.signOrLeft(c,n);if(l.isLeft())return l;let p=e;return p.Signature=this.assemble(c,l.value,a),gr(p)}ns(e,t){let n=e.$?.xmlns,{$:i,...s}=e[t],{xmlns:a,...u}=i??{};return{$:{xmlns:n,...u},...s}}};var YT=class extends Uy{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:i,mark:s}=t,{certificate:a}=n,u=this.toolkit.getNode(e,i);if(!u)return Qr(new Ir(`Node ${i} not found`));let c=this.signedInfo(u,s),l=await this.signOrLeft(c,n);if(l.isLeft())return l;let p=await this.toolkit.build(this.assemble(c,l.value,a),{rootName:"Signature"});return gr(this.toolkit.appendNode(e,p))}};var fLe=require("reflect-metadata"),nz=require("class-validator");var aLe=require("reflect-metadata");var FL="__SkipValidation__";var rz=require("class-transformer");var QT=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&QT(t)},"clearEmptyValues"),$T=o((r,e,t={})=>{let n=(0,rz.plainToInstance)(e,r);return t.clearEmptyValues&&QT(n),n},"plainToInstance");var du="__ValidateErrors__",iz=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(iz(n.children,e?`${e}.${n.property}`:n.property));let i=Object.values(n.constraints??{}).map(s=>e?`${e}.${s}`:s).join(", ");return i?t.concat(i):t},[]),"mapConstraintsToErrors"),Ht=o(r=>(e,t,n)=>{let i=n.value;n.value=function(...s){let a=Reflect.getMetadata(FL,this.constructor);if(Reflect.getMetadata(FL,this.constructor.prototype,t.toString())===!0||a===!0)return i?.apply(this,s);let[c,...l]=s,p=$T(c,r),d=(0,nz.validateSync)(p,{whitelist:!0});if(QT(p),d.length){let g=Reflect.getMetadata(du,this)??[];Reflect.defineMetadata(du,g.concat(iz(d,i?.name)),this)}return i?.apply(this,[p,...l])}},"Validates");var gLe=require("reflect-metadata");var sz=require("class-validator");var az=o(r=>(e,t)=>{(0,sz.registerDecorator)({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Li?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");var bLe=require("reflect-metadata"),kL=require("class-validator");var qy=Symbol("choice"),Hy=o(r=>r==null||r==="","isEmpty"),an=o(r=>e=>{let{properties:t,required:n=!1,...i}=r,s=Reflect.getMetadata(qy,e)??[],a={properties:t,required:n};s.push(a),Reflect.defineMetadata(qy,s,e);for(let u of t)(0,kL.registerDecorator)({name:"choice",target:e,propertyName:u,options:i,validator:{validate(c,l){let p=l.object,d=l.property,g=Reflect.getMetadata(qy,e);if(!g)return!0;let y=g.find(v=>v.properties.includes(d));if(!y||Hy(c))return!0;for(let v of y.properties){if(v===d)continue;let x=p[v];if(!Hy(x))return!1}for(let v of g)if(v!==y)for(let x of v.properties){let S=p[x];if(!Hy(S))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(qy,e);if(!l)return`${c.property} validation error`;let p=l.find(g=>g.properties.includes(c.property));if(!p)return`${c.property} validation error`;let d=c.object;for(let g of p.properties){let y=d[g];if(!Hy(y)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of l)if(g!==p)for(let y of g.properties){let v=d[y];if(!Hy(v))return`${c.property} cannot be set because ${y} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)(0,kL.registerDecorator)({name:"choiceGroupRequired",target:e,propertyName:u,options:{...i,always:!0},validator:{validate(c,l){let p=l.object,d=Reflect.getMetadata(qy,e);if(!d)return!0;let g=d.find(y=>y.properties.includes(l.property));if(!g?.required)return!0;for(let y of g.properties){let v=p[y];if(!Hy(v))return!0}return l.property!==g.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(qy,e);if(!l)return"At least one property from a choice group must be provided";let p=l.find(d=>d.properties.includes(c.property));return p?`You must provide a value for one of the following properties: ${p.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");var CLe=require("reflect-metadata");var oz=require("class-transformer");var ae=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{az(e)(t,n),(0,oz.Transform)(({value:i})=>Li.newOrUndefined(i)?.toFixed(r))(t,n)},"TransformDecimal");var lz=require("class-transformer"),fz=require("class-validator");var ZT=lr(require("dayjs"),1),uz=lr(require("dayjs/plugin/utc"),1),cz=lr(require("dayjs/plugin/timezone"),1);ZT.default.extend(uz.default);ZT.default.extend(cz.default);var Kw=ZT.default;var Xh=o((r={})=>(e,t)=>{(0,lz.Transform)(({value:n})=>{let i=n instanceof Date?n.toISOString():n;return i?Kw(i).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),(0,fz.IsDateString)()(e,t)},"TransformDateString");var zy=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
113
113
  `).reduce((s,a)=>{let[u,c]=a.split("=").map(l=>l.trim());return!u||!c?s:s.set(u,c)},new Map),i=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:i,CN:n.get("CN"),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),i=t.indexOf(n);if(i===-1)return;let s=[t.subarray(0,i),t.subarray(i)];if(s.length<=1)return;let u=s[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let l=Buffer.concat([c,n,s[1]]),p=this.length(l),d=n.length,g=l.subarray(2+d,2+d+p),y=g.length-c.length-2;if(y<=0||y>g.length)return;let x=g.subarray(-y).toString("utf8");return x.substring(Buffer.from(x).findIndex((S,A)=>x.charCodeAt(A)>=32&&x.charCodeAt(A)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((i,s)=>{let a=this.base128(i,Number.parseInt(s,10),!0);return i.length=0,i.push(...a),i},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let i=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,i.push(...a)}let s=t%128;return n?i.push(s):i.push(128|s),i}};var eR=class{static{o(this,"NativeCertificateRepository")}httpClient;signer;cache;constructor(e,t,n=new WT){this.httpClient=e,this.signer=t,this.cache=n}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let i=Wh.default.asn1.fromDer(n.value.toString("binary")),s=Wh.default.pkcs12.pkcs12FromAsn1(i,t),{certBag:a}=Wh.default.pki.oids,c=s.getBags({bagType:a})[a];if(!c?.length)return Qr(new Ir("Cannot read certificate"));let[{cert:l},...p]=c;if(!l)return Qr(new Ir("Issuer Certificate not found"));let d=p.reduce((y,{cert:v})=>(v&&y.push(new Gw.default.X509Certificate(Wh.default.pki.certificateToPem(v))),y),[]),g=new Gw.default.X509Certificate(Wh.default.pki.certificateToPem(l));return gr({ca:d,password:t,certificate:g,privateKey:this.getPrivateKey(s)})}catch(t){return zf(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=Wh.default.pki.oids,i=e.getBags({bagType:t})[t]?.[0]?.key;if(i)return Gw.default.createPrivateKey(Wh.default.pki.privateKeyToPem(i))}async sign(e,t,n=vl.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new zy().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new Ir("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,i=this.getCacheKey(t,n),s=await this.cache.get(i);if(s)return gr(s);if(pz.default.isAbsolute(t)||VL.default.existsSync(t))return this.hitBufferOnCache(i,VL.default.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(i,Buffer.from(a.data))}catch(a){return zf(a)}return this.hitBufferOnCache(i,Buffer.from(t,"base64"))}getCacheKey(e,t){return Gw.default.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),gr(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var IZ=lr(require("os"),1),TZ=require("crypto"),XD=require("https"),RZ=lr(d$(),1);function UC(r,e){return o(function(){return r.apply(e,arguments)},"wrap")}o(UC,"bind");var{toString:b2e}=Object.prototype,{getPrototypeOf:X8}=Object,{iterator:OD,toStringTag:g$}=Symbol,BD=(r=>e=>{let t=b2e.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),lc=o(r=>(r=r.toLowerCase(),e=>BD(e)===r),"kindOfTest"),PD=o(r=>e=>typeof e===r,"typeOfTest"),{isArray:I1}=Array,N1=PD("undefined");function qC(r){return r!==null&&!N1(r)&&r.constructor!==null&&!N1(r.constructor)&&oo(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}o(qC,"isBuffer");var v$=lc("ArrayBuffer");function x2e(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&v$(r.buffer),e}o(x2e,"isArrayBufferView");var w2e=PD("string"),oo=PD("function"),y$=PD("number"),HC=o(r=>r!==null&&typeof r=="object","isObject"),C2e=o(r=>r===!0||r===!1,"isBoolean"),DD=o(r=>{if(BD(r)!=="object")return!1;let e=X8(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(g$ in r)&&!(OD in r)},"isPlainObject"),E2e=o(r=>{if(!HC(r)||qC(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},"isEmptyObject"),A2e=lc("Date"),N2e=lc("File"),I2e=lc("Blob"),T2e=lc("FileList"),R2e=o(r=>HC(r)&&oo(r.pipe),"isStream"),D2e=o(r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||oo(r.append)&&((e=BD(r))==="formdata"||e==="object"&&oo(r.toString)&&r.toString()==="[object FormData]"))},"isFormData"),O2e=lc("URLSearchParams"),[B2e,P2e,_2e,L2e]=["ReadableStream","Request","Response","Headers"].map(lc),F2e=o(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function zC(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),I1(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{if(qC(r))return;let s=t?Object.getOwnPropertyNames(r):Object.keys(r),a=s.length,u;for(n=0;n<a;n++)u=s[n],e.call(null,r[u],u,r)}}o(zC,"forEach");function S$(r,e){if(qC(r))return null;e=e.toLowerCase();let t=Object.keys(r),n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}o(S$,"findKey");var H0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,b$=o(r=>!N1(r)&&r!==H0,"isContextDefined");function G8(){let{caseless:r,skipUndefined:e}=b$(this)&&this||{},t={},n=o((i,s)=>{let a=r&&S$(t,s)||s;DD(t[a])&&DD(i)?t[a]=G8(t[a],i):DD(i)?t[a]=G8({},i):I1(i)?t[a]=i.slice():(!e||!N1(i))&&(t[a]=i)},"assignValue");for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&zC(arguments[i],n);return t}o(G8,"merge");var k2e=o((r,e,t,{allOwnKeys:n}={})=>(zC(e,(i,s)=>{t&&oo(i)?Object.defineProperty(r,s,{value:UC(i,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),r),"extend"),V2e=o(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),j2e=o((r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),M2e=o((r,e,t,n)=>{let i,s,a,u={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)a=i[s],(!n||n(a,r,e))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=t!==!1&&X8(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),U2e=o((r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},"endsWith"),q2e=o(r=>{if(!r)return null;if(I1(r))return r;let e=r.length;if(!y$(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),H2e=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&X8(Uint8Array)),z2e=o((r,e)=>{let n=(r&&r[OD]).call(r),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(r,s[0],s[1])}},"forEachEntry"),K2e=o((r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},"matchAll"),G2e=lc("HTMLFormElement"),X2e=o(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function(t,n,i){return n.toUpperCase()+i},"replacer")),"toCamelCase"),m$=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),W2e=lc("RegExp"),x$=o((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};zC(t,(i,s)=>{let a;(a=e(i,s,r))!==!1&&(n[s]=a||i)}),Object.defineProperties(r,n)},"reduceDescriptors"),J2e=o(r=>{x$(r,(e,t)=>{if(oo(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(oo(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),Y2e=o((r,e)=>{let t={},n=o(i=>{i.forEach(s=>{t[s]=!0})},"define");return I1(r)?n(r):n(String(r).split(e)),t},"toObjectSet"),Q2e=o(()=>{},"noop"),$2e=o((r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,"toFiniteNumber");function Z2e(r){return!!(r&&oo(r.append)&&r[g$]==="FormData"&&r[OD])}o(Z2e,"isSpecCompliantForm");var eIe=o(r=>{let e=new Array(10),t=o((n,i)=>{if(HC(n)){if(e.indexOf(n)>=0)return;if(qC(n))return n;if(!("toJSON"in n)){e[i]=n;let s=I1(n)?[]:{};return zC(n,(a,u)=>{let c=t(a,i+1);!N1(c)&&(s[u]=c)}),e[i]=void 0,s}}return n},"visit");return t(r,0)},"toJSONObject"),tIe=lc("AsyncFunction"),rIe=o(r=>r&&(HC(r)||oo(r))&&oo(r.then)&&oo(r.catch),"isThenable"),w$=((r,e)=>r?setImmediate:e?((t,n)=>(H0.addEventListener("message",({source:i,data:s})=>{i===H0&&s===t&&n.length&&n.shift()()},!1),i=>{n.push(i),H0.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",oo(H0.postMessage)),nIe=typeof queueMicrotask<"u"?queueMicrotask.bind(H0):typeof process<"u"&&process.nextTick||w$,iIe=o(r=>r!=null&&oo(r[OD]),"isIterable"),oe={isArray:I1,isArrayBuffer:v$,isBuffer:qC,isFormData:D2e,isArrayBufferView:x2e,isString:w2e,isNumber:y$,isBoolean:C2e,isObject:HC,isPlainObject:DD,isEmptyObject:E2e,isReadableStream:B2e,isRequest:P2e,isResponse:_2e,isHeaders:L2e,isUndefined:N1,isDate:A2e,isFile:N2e,isBlob:I2e,isRegExp:W2e,isFunction:oo,isStream:R2e,isURLSearchParams:O2e,isTypedArray:H2e,isFileList:T2e,forEach:zC,merge:G8,extend:k2e,trim:F2e,stripBOM:V2e,inherits:j2e,toFlatObject:M2e,kindOf:BD,kindOfTest:lc,endsWith:U2e,toArray:q2e,forEachEntry:z2e,matchAll:K2e,isHTMLForm:G2e,hasOwnProperty:m$,hasOwnProp:m$,reduceDescriptors:x$,freezeMethods:J2e,toObjectSet:Y2e,toCamelCase:X2e,noop:Q2e,toFiniteNumber:$2e,findKey:S$,global:H0,isContextDefined:b$,isSpecCompliantForm:Z2e,toJSONObject:eIe,isAsyncFn:tIe,isThenable:rIe,setImmediate:w$,asap:nIe,isIterable:iIe};var Po=class C$ extends Error{static{o(this,"AxiosError")}static from(e,t,n,i,s,a){let u=new C$(e.message,t||e.code,n,i,s);return u.cause=e,u.name=e.name,a&&Object.assign(u,a),u}constructor(e,t,n,i,s){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}};Po.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Po.ERR_BAD_OPTION="ERR_BAD_OPTION";Po.ECONNABORTED="ECONNABORTED";Po.ETIMEDOUT="ETIMEDOUT";Po.ERR_NETWORK="ERR_NETWORK";Po.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Po.ERR_DEPRECATED="ERR_DEPRECATED";Po.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Po.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Po.ERR_CANCELED="ERR_CANCELED";Po.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Po.ERR_INVALID_URL="ERR_INVALID_URL";var st=Po;var T$=lr(I$(),1),_D=T$.default;function $8(r){return oe.isPlainObject(r)||oe.isArray(r)}o($8,"isVisitable");function D$(r){return oe.endsWith(r,"[]")?r.slice(0,-2):r}o(D$,"removeBrackets");function R$(r,e,t){return r?r.concat(e).map(o(function(i,s){return i=D$(i),!t&&s?"["+i+"]":i},"each")).join(t?".":""):e}o(R$,"renderKey");function dIe(r){return oe.isArray(r)&&!r.some($8)}o(dIe,"isFlatArray");var mIe=oe.toFlatObject(oe,{},null,o(function(e){return/^is[A-Z]/.test(e)},"filter"));function gIe(r,e,t){if(!oe.isObject(r))throw new TypeError("target must be an object");e=e||new(_D||FormData),t=oe.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,o(function(x,S){return!oe.isUndefined(S[x])},"defined"));let n=t.metaTokens,i=t.visitor||p,s=t.dots,a=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function l(v){if(v===null)return"";if(oe.isDate(v))return v.toISOString();if(oe.isBoolean(v))return v.toString();if(!c&&oe.isBlob(v))throw new st("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(v)||oe.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}o(l,"convertValue");function p(v,x,S){let A=v;if(v&&!S&&typeof v=="object"){if(oe.endsWith(x,"{}"))x=n?x:x.slice(0,-2),v=JSON.stringify(v);else if(oe.isArray(v)&&dIe(v)||(oe.isFileList(v)||oe.endsWith(x,"[]"))&&(A=oe.toArray(v)))return x=D$(x),A.forEach(o(function(C,E){!(oe.isUndefined(C)||C===null)&&e.append(a===!0?R$([x],E,s):a===null?x:x+"[]",l(C))},"each")),!1}return $8(v)?!0:(e.append(R$(S,x,s),l(v)),!1)}o(p,"defaultVisitor");let d=[],g=Object.assign(mIe,{defaultVisitor:p,convertValue:l,isVisitable:$8});function y(v,x){if(!oe.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(v),oe.forEach(v,o(function(A,D){(!(oe.isUndefined(A)||A===null)&&i.call(e,A,oe.isString(D)?D.trim():D,x,g))===!0&&y(A,x?x.concat(D):[D])},"each")),d.pop()}}if(o(y,"build"),!oe.isObject(r))throw new TypeError("data must be an object");return y(r),e}o(gIe,"toFormData");var bd=gIe;function O$(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,o(function(n){return e[n]},"replacer"))}o(O$,"encode");function B$(r,e){this._pairs=[],r&&bd(r,this,e)}o(B$,"AxiosURLSearchParams");var P$=B$.prototype;P$.append=o(function(e,t){this._pairs.push([e,t])},"append");P$.toString=o(function(e){let t=e?function(n){return e.call(this,n,O$)}:O$;return this._pairs.map(o(function(i){return t(i[0])+"="+t(i[1])},"each"),"").join("&")},"toString");var _$=B$;function vIe(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}o(vIe,"encode");function z0(r,e,t){if(!e)return r;let n=t&&t.encode||vIe,i=oe.isFunction(t)?{serialize:t}:t,s=i&&i.serialize,a;if(s?a=s(e,i):a=oe.isURLSearchParams(e)?e.toString():new _$(e,i).toString(n),a){let u=r.indexOf("#");u!==-1&&(r=r.slice(0,u)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}o(z0,"buildURL");var yIe=class{static{o(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,o(function(n){n!==null&&e(n)},"forEachHandler"))}},Z8=yIe;var T1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var V$=lr(require("crypto"),1);var L$=lr(require("url"),1),F$=L$.default.URLSearchParams;var eV="abcdefghijklmnopqrstuvwxyz",k$="0123456789",j$={DIGIT:k$,ALPHA:eV,ALPHA_DIGIT:eV+eV.toUpperCase()+k$},SIe=o((r=16,e=j$.ALPHA_DIGIT)=>{let t="",{length:n}=e,i=new Uint32Array(r);V$.default.randomFillSync(i);for(let s=0;s<r;s++)t+=e[i[s]%n];return t},"generateString"),M$={isNode:!0,classes:{URLSearchParams:F$,FormData:_D,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:j$,generateString:SIe,protocols:["http","https","file","data"]};var nV={};iT(nV,{hasBrowserEnv:()=>rV,hasStandardBrowserEnv:()=>bIe,hasStandardBrowserWebWorkerEnv:()=>xIe,navigator:()=>tV,origin:()=>wIe});var rV=typeof window<"u"&&typeof document<"u",tV=typeof navigator=="object"&&navigator||void 0,bIe=rV&&(!tV||["ReactNative","NativeScript","NS"].indexOf(tV.product)<0),xIe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wIe=rV&&window.location.href||"http://localhost";var Jr={...nV,...M$};function iV(r,e){return bd(r,new Jr.classes.URLSearchParams,{visitor:o(function(t,n,i,s){return Jr.isNode&&oe.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},"visitor"),...e})}o(iV,"toURLEncodedForm");function CIe(r){return oe.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}o(CIe,"parsePropPath");function EIe(r){let e={},t=Object.keys(r),n,i=t.length,s;for(n=0;n<i;n++)s=t[n],e[s]=r[s];return e}o(EIe,"arrayToObject");function AIe(r){function e(t,n,i,s){let a=t[s++];if(a==="__proto__")return!0;let u=Number.isFinite(+a),c=s>=t.length;return a=!a&&oe.isArray(i)?i.length:a,c?(oe.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!u):((!i[a]||!oe.isObject(i[a]))&&(i[a]=[]),e(t,n,i[a],s)&&oe.isArray(i[a])&&(i[a]=EIe(i[a])),!u)}if(o(e,"buildPath"),oe.isFormData(r)&&oe.isFunction(r.entries)){let t={};return oe.forEachEntry(r,(n,i)=>{e(CIe(n),i,t,0)}),t}return null}o(AIe,"formDataToJSON");var LD=AIe;function NIe(r,e,t){if(oe.isString(r))try{return(e||JSON.parse)(r),oe.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}o(NIe,"stringifySafely");var sV={transitional:T1,adapter:["xhr","http","fetch"],transformRequest:[o(function(e,t){let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=oe.isObject(e);if(s&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return i?JSON.stringify(LD(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return iV(e,this.formSerializer).toString();if((u=oe.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return bd(u?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),NIe(e)):e},"transformRequest")],transformResponse:[o(function(e){let t=this.transitional||sV.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(n&&!this.responseType||i)){let a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(u){if(a)throw u.name==="SyntaxError"?st.from(u,st.ERR_BAD_RESPONSE,this,null,this.response):u}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jr.classes.FormData,Blob:Jr.classes.Blob},validateStatus:o(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],r=>{sV.headers[r]={}});var R1=sV;var IIe=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),U$=o((r=>{let e={},t,n,i;return r&&r.split(`
114
114
  `).forEach(o(function(a){i=a.indexOf(":"),t=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!t||e[t]&&IIe[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)},"parser")),e}),"default");var q$=Symbol("internals");function KC(r){return r&&String(r).trim().toLowerCase()}o(KC,"normalizeHeader");function FD(r){return r===!1||r==null?r:oe.isArray(r)?r.map(FD):String(r)}o(FD,"normalizeValue");function TIe(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}o(TIe,"parseTokens");var RIe=o(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function aV(r,e,t,n,i){if(oe.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!oe.isString(e)){if(oe.isString(n))return e.indexOf(n)!==-1;if(oe.isRegExp(n))return n.test(e)}}o(aV,"matchHeaderValue");function DIe(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}o(DIe,"formatHeader");function OIe(r,e){let t=oe.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:o(function(i,s,a){return this[n].call(this,e,i,s,a)},"value"),configurable:!0})})}o(OIe,"buildAccessors");var kD=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,n){let i=this;function s(u,c,l){let p=KC(c);if(!p)throw new Error("header name must be a non-empty string");let d=oe.findKey(i,p);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=FD(u))}o(s,"setHeader");let a=o((u,c)=>oe.forEach(u,(l,p)=>s(l,p,c)),"setHeaders");if(oe.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(oe.isString(e)&&(e=e.trim())&&!RIe(e))a(U$(e),t);else if(oe.isObject(e)&&oe.isIterable(e)){let u={},c,l;for(let p of e){if(!oe.isArray(p))throw TypeError("Object iterator must return a key-value pair");u[l=p[0]]=(c=u[l])?oe.isArray(c)?[...c,p[1]]:[c,p[1]]:p[1]}a(u,t)}else e!=null&&s(t,e,n);return this}get(e,t){if(e=KC(e),e){let n=oe.findKey(this,e);if(n){let i=this[n];if(!t)return i;if(t===!0)return TIe(i);if(oe.isFunction(t))return t.call(this,i,n);if(oe.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=KC(e),e){let n=oe.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||aV(this,this[n],n,t)))}return!1}delete(e,t){let n=this,i=!1;function s(a){if(a=KC(a),a){let u=oe.findKey(n,a);u&&(!t||aV(n,n[u],u,t))&&(delete n[u],i=!0)}}return o(s,"deleteHeader"),oe.isArray(e)?e.forEach(s):s(e),i}clear(e){let t=Object.keys(this),n=t.length,i=!1;for(;n--;){let s=t[n];(!e||aV(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){let t=this,n={};return oe.forEach(this,(i,s)=>{let a=oe.findKey(n,s);if(a){t[a]=FD(i),delete t[s];return}let u=e?DIe(s):String(s).trim();u!==s&&delete t[s],t[u]=FD(i),n[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return oe.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&oe.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
115
115
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[q$]=this[q$]={accessors:{}}).accessors,i=this.prototype;function s(a){let u=KC(a);n[u]||(OIe(i,a),n[u]=!0)}return o(s,"defineAccessor"),oe.isArray(e)?e.forEach(s):s(e),this}};kD.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(kD.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:o(()=>r,"get"),set(n){this[t]=n}}});oe.freezeMethods(kD);var ai=kD;function GC(r,e){let t=this||R1,n=e||t,i=ai.from(n.headers),s=n.data;return oe.forEach(r,o(function(u){s=u.call(t,s,i.normalize(),e?e.status:void 0)},"transform")),i.normalize(),s}o(GC,"transformData");function XC(r){return!!(r&&r.__CANCEL__)}o(XC,"isCancel");var BIe=class extends st{static{o(this,"CanceledError")}constructor(e,t,n){super(e??"canceled",st.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}},_o=BIe;function Pl(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new st("Request failed with status code "+t.status,[st.ERR_BAD_REQUEST,st.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}o(Pl,"settle");function oV(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}o(oV,"isAbsoluteURL");function uV(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}o(uV,"combineURLs");function K0(r,e,t){let n=!oV(e);return r&&(n||t==!1)?uV(r,e):e}o(K0,"buildFullPath");var iZ=lr(hF(),1),sZ=lr(require("http"),1),aZ=lr(require("https"),1),hV=lr(require("http2"),1),dV=lr(require("util"),1),oZ=lr(NF(),1),tp=lr(require("zlib"),1);var G0="1.13.3";function WC(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}o(WC,"parseProtocol");var PIe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function cV(r,e,t){let n=t&&t.Blob||Jr.classes.Blob,i=WC(r);if(e===void 0&&n&&(e=!0),i==="data"){r=i.length?r.slice(i.length+1):r;let s=PIe.exec(r);if(!s)throw new st("Invalid URL",st.ERR_INVALID_URL);let a=s[1],u=s[2],c=s[3],l=Buffer.from(decodeURIComponent(c),u?"base64":"utf8");if(e){if(!n)throw new st("Blob is not supported",st.ERR_NOT_SUPPORT);return new n([l],{type:a})}return l}throw new st("Unsupported protocol "+i,st.ERR_NOT_SUPPORT)}o(cV,"fromDataURI");var ep=lr(require("stream"),1);var H$=lr(require("stream"),1);var lV=Symbol("internals"),_Ie=class extends H$.default.Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=oe.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!oe.isUndefined(i[n])),super({readableHighWaterMark:e.chunkSize});let t=this[lV]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){let t=this[lV];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let i=this[lV],s=i.maxRate,a=this.readableHighWaterMark,u=i.timeWindow,c=1e3/u,l=s/c,p=i.minChunkSize!==!1?Math.max(i.minChunkSize,l*.01):0,d=o((y,v)=>{let x=Buffer.byteLength(y);i.bytesSeen+=x,i.bytes+=x,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(y)?process.nextTick(v):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(v)}},"pushChunk"),g=o((y,v)=>{let x=Buffer.byteLength(y),S=null,A=a,D,C=0;if(s){let E=Date.now();(!i.ts||(C=E-i.ts)>=u)&&(i.ts=E,D=l-i.bytes,i.bytes=D<0?-D:0,C=0),D=l-i.bytes}if(s){if(D<=0)return setTimeout(()=>{v(null,y)},u-C);D<A&&(A=D)}A&&x>A&&x-A>p&&(S=y.subarray(A),y=y.subarray(0,A)),d(y,S?()=>{process.nextTick(v,null,S)}:v)},"transformChunk");g(e,o(function y(v,x){if(v)return n(v);x?g(x,y):n(null)},"transformNextChunk"))}},fV=_Ie;var uZ=require("events");var K$=lr(require("util"),1),G$=require("stream");var{asyncIterator:z$}=Symbol,LIe=o(async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[z$]?yield*r[z$]():yield r},"readBlob"),VD=LIe;var FIe=Jr.ALPHABET.ALPHA_DIGIT+"-_",JC=typeof TextEncoder=="function"?new TextEncoder:new K$.default.TextEncoder,X0=`\r
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"../chunk-CVR2V26Q.mjs";import"../chunk-5546UMJT.mjs";import"../chunk-W6MRGYXP.mjs";export{d as AccessKeyBuilder,x as DanfceDefaultPdfDocument,y as DanfceReducedPdfDocument,e as DefaultDetBuilderAggregator,f as DefaultTotalBuilderAggregator,u as NFCeDto,q as NFeDto,k as NfceAuthorizerPipeline,m as NfceConsultStatusPipeline,j as NfceQrcode,i as NfceRemoteTransmitter,v as NfceXmlBuilder,w as NfceXmlBuilderPipeline,n as NfeAuthorizationResponsePipeline,h as NfeAuthorizerPipeline,l as NfeConsultStatusPipeline,r as NfeDetXmlBuilder,o as NfeNfceCancelPipeline,p as NfeNfceVoidRangePipeline,g as NfeRemoteTransmitter,s as NfeXmlBuilder,t as NfeXmlBuilderPipeline,a as TpEmis,b as TpEvent,c as schemas};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"../chunk-KAMB2EUD.mjs";import"../chunk-5546UMJT.mjs";import"../chunk-W6MRGYXP.mjs";export{d as AccessKeyBuilder,x as DanfceDefaultPdfDocument,y as DanfceReducedPdfDocument,e as DefaultDetBuilderAggregator,f as DefaultTotalBuilderAggregator,u as NFCeDto,q as NFeDto,k as NfceAuthorizerPipeline,m as NfceConsultStatusPipeline,j as NfceQrcode,i as NfceRemoteTransmitter,v as NfceXmlBuilder,w as NfceXmlBuilderPipeline,n as NfeAuthorizationResponsePipeline,h as NfeAuthorizerPipeline,l as NfeConsultStatusPipeline,r as NfeDetXmlBuilder,o as NfeNfceCancelPipeline,p as NfeNfceVoidRangePipeline,g as NfeRemoteTransmitter,s as NfeXmlBuilder,t as NfeXmlBuilderPipeline,a as TpEmis,b as TpEvent,c as schemas};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nfets",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "description": "typescript libraries for Brazilian's SEFAZ standards",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",