nfets 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CTG5M5GA.mjs → chunk-CQP3JLEA.mjs} +1 -1
- package/dist/{chunk-TVNW3GQ7.mjs → chunk-RBNELQ4L.mjs} +2 -2
- package/dist/core/index.cjs +20 -20
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +24 -24
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +5 -5
- package/dist/nfe/index.d.cts +9 -9
- package/dist/nfe/index.d.ts +9 -9
- package/dist/nfe/index.mjs +1 -1
- package/dist/{xml-signer-CA6BEgl1.d.cts → xml-signer-CCwIT1uC.d.cts} +34 -31
- package/dist/{xml-signer-CA6BEgl1.d.ts → xml-signer-CCwIT1uC.d.ts} +34 -31
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{A as Xp,B as Jp,C as _p,E as Wp,F as Kp,G as Vc,H as kp,I as cs,K as H,L as p,M as Hc,N as Vi,d as Up,f as d,g as Gp,h as y,i as Lc,j as _e,l as ss,n as We,o as G,p as qp,q as Zp,v as Yp,w as No,y as F,z as k}from"./chunk-
|
|
2
|
+
import{A as Xp,B as Jp,C as _p,E as Wp,F as Kp,G as Vc,H as kp,I as cs,K as H,L as p,M as Hc,N as Vi,d as Up,f as d,g as Gp,h as y,i as Lc,j as _e,l as ss,n as We,o as G,p as qp,q as Zp,v as Yp,w as No,y as F,z as k}from"./chunk-RBNELQ4L.mjs";import{a as s,b as Ie,d as C,f as Zm}from"./chunk-W6MRGYXP.mjs";var Kf=C((mx,Dl)=>{"use strict";Dl.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var gn=C(Xn=>{"use strict";var kf,mh=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Xn.getSymbolSize=s(function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},"getSymbolSize");Xn.getSymbolTotalCodewords=s(function(e){return mh[e]},"getSymbolTotalCodewords");Xn.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e};Xn.setToSJISFunction=s(function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');kf=e},"setToSJISFunction");Xn.isKanjiModeEnabled=function(){return typeof kf<"u"};Xn.toSJIS=s(function(e){return kf(e)},"toSJIS")});var yc=C(Gt=>{"use strict";Gt.L={bit:1};Gt.M={bit:0};Gt.Q={bit:3};Gt.H={bit:2};function gh(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return Gt.L;case"m":case"medium":return Gt.M;case"q":case"quartile":return Gt.Q;case"h":case"high":return Gt.H;default:throw new Error("Unknown EC Level: "+o)}}s(gh,"fromString");Gt.isValid=s(function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},"isValid");Gt.from=s(function(e,t){if(Gt.isValid(e))return e;try{return gh(e)}catch{return t}},"from")});var Tl=C((Sx,jl)=>{"use strict";function El(){this.buffer=[],this.length=0}s(El,"BitBuffer");El.prototype={get:s(function(o){let e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},"get"),put:s(function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},"put"),getLengthInBits:s(function(){return this.length},"getLengthInBits"),putBit:s(function(o){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++},"putBit")};jl.exports=El});var Ml=C((Cx,Bl)=>{"use strict";function _a(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}s(_a,"BitMatrix");_a.prototype.set=function(o,e,t,n){let r=o*this.size+e;this.data[r]=t,n&&(this.reservedBit[r]=!0)};_a.prototype.get=function(o,e){return this.data[o*this.size+e]};_a.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t};_a.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};Bl.exports=_a});var Ll=C(Sc=>{"use strict";var hh=gn().getSymbolSize;Sc.getRowColCoords=s(function(e){if(e===1)return[];let t=Math.floor(e/7)+2,n=hh(e),r=n===145?26:Math.ceil((n-13)/(2*t-2))*2,i=[n-7];for(let a=1;a<t-1;a++)i[a]=i[a-1]-r;return i.push(6),i.reverse()},"getRowColCoords");Sc.getPositions=s(function(e){let t=[],n=Sc.getRowColCoords(e),r=n.length;for(let i=0;i<r;i++)for(let a=0;a<r;a++)i===0&&a===0||i===0&&a===r-1||i===r-1&&a===0||t.push([n[i],n[a]]);return t},"getPositions")});var Ql=C(Hl=>{"use strict";var vh=gn().getSymbolSize,Vl=7;Hl.getPositions=s(function(e){let t=vh(e);return[[0,0],[t-Vl,0],[0,t-Vl]]},"getPositions")});var Ul=C(J=>{"use strict";J.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Jn={N1:3,N2:3,N3:40,N4:10};J.isValid=s(function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},"isValid");J.from=s(function(e){return J.isValid(e)?parseInt(e,10):void 0},"from");J.getPenaltyN1=s(function(e){let t=e.size,n=0,r=0,i=0,a=null,c=null;for(let f=0;f<t;f++){r=i=0,a=c=null;for(let l=0;l<t;l++){let g=e.get(f,l);g===a?r++:(r>=5&&(n+=Jn.N1+(r-5)),a=g,r=1),g=e.get(l,f),g===c?i++:(i>=5&&(n+=Jn.N1+(i-5)),c=g,i=1)}r>=5&&(n+=Jn.N1+(r-5)),i>=5&&(n+=Jn.N1+(i-5))}return n},"getPenaltyN1");J.getPenaltyN2=s(function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let a=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);(a===4||a===0)&&n++}return n*Jn.N2},"getPenaltyN2");J.getPenaltyN3=s(function(e){let t=e.size,n=0,r=0,i=0;for(let a=0;a<t;a++){r=i=0;for(let c=0;c<t;c++)r=r<<1&2047|e.get(a,c),c>=10&&(r===1488||r===93)&&n++,i=i<<1&2047|e.get(c,a),c>=10&&(i===1488||i===93)&&n++}return n*Jn.N3},"getPenaltyN3");J.getPenaltyN4=s(function(e){let t=0,n=e.data.length;for(let i=0;i<n;i++)t+=e.data[i];return Math.abs(Math.ceil(t*100/n/5)-10)*Jn.N4},"getPenaltyN4");function yh(o,e,t){switch(o){case J.Patterns.PATTERN000:return(e+t)%2===0;case J.Patterns.PATTERN001:return e%2===0;case J.Patterns.PATTERN010:return t%3===0;case J.Patterns.PATTERN011:return(e+t)%3===0;case J.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case J.Patterns.PATTERN101:return e*t%2+e*t%3===0;case J.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case J.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}s(yh,"getMaskAt");J.applyMask=s(function(e,t){let n=t.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)t.isReserved(i,r)||t.xor(i,r,yh(e,i,r))},"applyMask");J.getBestMask=s(function(e,t){let n=Object.keys(J.Patterns).length,r=0,i=1/0;for(let a=0;a<n;a++){t(a),J.applyMask(a,e);let c=J.getPenaltyN1(e)+J.getPenaltyN2(e)+J.getPenaltyN3(e)+J.getPenaltyN4(e);J.applyMask(a,e),c<i&&(i=c,r=a)}return r},"getBestMask")});var ep=C($f=>{"use strict";var hn=yc(),bc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Cc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];$f.getBlocksCount=s(function(e,t){switch(t){case hn.L:return bc[(e-1)*4+0];case hn.M:return bc[(e-1)*4+1];case hn.Q:return bc[(e-1)*4+2];case hn.H:return bc[(e-1)*4+3];default:return}},"getBlocksCount");$f.getTotalCodewordsCount=s(function(e,t){switch(t){case hn.L:return Cc[(e-1)*4+0];case hn.M:return Cc[(e-1)*4+1];case hn.Q:return Cc[(e-1)*4+2];case hn.H:return Cc[(e-1)*4+3];default:return}},"getTotalCodewordsCount")});var Gl=C(Rc=>{"use strict";var Wa=new Uint8Array(512),Nc=new Uint8Array(256);s((function(){let e=1;for(let t=0;t<255;t++)Wa[t]=e,Nc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Wa[t]=Wa[t-255]}),"initTables")();Rc.log=s(function(e){if(e<1)throw new Error("log("+e+")");return Nc[e]},"log");Rc.exp=s(function(e){return Wa[e]},"exp");Rc.mul=s(function(e,t){return e===0||t===0?0:Wa[Nc[e]+Nc[t]]},"mul")});var ql=C(Ka=>{"use strict";var tp=Gl();Ka.mul=s(function(e,t){let n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]^=tp.mul(e[r],t[i]);return n},"mul");Ka.mod=s(function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){let r=n[0];for(let a=0;a<t.length;a++)n[a]^=tp.mul(t[a],r);let i=0;for(;i<n.length&&n[i]===0;)i++;n=n.slice(i)}return n},"mod");Ka.generateECPolynomial=s(function(e){let t=new Uint8Array([1]);for(let n=0;n<e;n++)t=Ka.mul(t,new Uint8Array([1,tp.exp(n)]));return t},"generateECPolynomial")});var Xl=C((Tx,Yl)=>{"use strict";var Zl=ql();function op(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}s(op,"ReedSolomonEncoder");op.prototype.initialize=s(function(e){this.degree=e,this.genPoly=Zl.generateECPolynomial(this.degree)},"initialize");op.prototype.encode=s(function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let n=Zl.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){let i=new Uint8Array(this.degree);return i.set(n,r),i}return n},"encode");Yl.exports=op});var ip=C(Jl=>{"use strict";Jl.isValid=s(function(e){return!isNaN(e)&&e>=1&&e<=40},"isValid")});var np=C(Li=>{"use strict";var _l="[0-9]+",Sh="[A-Z $%*+\\-./:]+",ka="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ka=ka.replace(/u/g,"\\u");var bh="(?:(?![A-Z0-9 $%*+\\-./:]|"+ka+`)(?:.|[\r
|
|
3
3
|
]))+`;Li.KANJI=new RegExp(ka,"g");Li.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Li.BYTE=new RegExp(bh,"g");Li.NUMERIC=new RegExp(_l,"g");Li.ALPHANUMERIC=new RegExp(Sh,"g");var Ch=new RegExp("^"+ka+"$"),Nh=new RegExp("^"+_l+"$"),Rh=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Li.testKanji=s(function(e){return Ch.test(e)},"testKanji");Li.testNumeric=s(function(e){return Nh.test(e)},"testNumeric");Li.testAlphanumeric=s(function(e){return Rh.test(e)},"testAlphanumeric")});var vn=C(Re=>{"use strict";var Ih=ip(),rp=np();Re.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Re.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Re.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Re.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Re.MIXED={bit:-1};Re.getCharCountIndicator=s(function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Ih.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},"getCharCountIndicator");Re.getBestModeForData=s(function(e){return rp.testNumeric(e)?Re.NUMERIC:rp.testAlphanumeric(e)?Re.ALPHANUMERIC:rp.testKanji(e)?Re.KANJI:Re.BYTE},"getBestModeForData");Re.toString=s(function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},"toString");Re.isValid=s(function(e){return e&&e.bit&&e.ccBits},"isValid");function Fh(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return Re.NUMERIC;case"alphanumeric":return Re.ALPHANUMERIC;case"kanji":return Re.KANJI;case"byte":return Re.BYTE;default:throw new Error("Unknown mode: "+o)}}s(Fh,"fromString");Re.from=s(function(e,t){if(Re.isValid(e))return e;try{return Fh(e)}catch{return t}},"from")});var eu=C(_n=>{"use strict";var Ic=gn(),Oh=ep(),Wl=yc(),yn=vn(),ap=ip(),kl=7973,Kl=Ic.getBCHDigit(kl);function wh(o,e,t){for(let n=1;n<=40;n++)if(e<=_n.getCapacity(n,t,o))return n}s(wh,"getBestVersionForDataLength");function $l(o,e){return yn.getCharCountIndicator(o,e)+4}s($l,"getReservedBitsCount");function xh(o,e){let t=0;return o.forEach(function(n){let r=$l(n.mode,e);t+=r+n.getBitsLength()}),t}s(xh,"getTotalBitsFromDataArray");function zh(o,e){for(let t=1;t<=40;t++)if(xh(o,t)<=_n.getCapacity(t,e,yn.MIXED))return t}s(zh,"getBestVersionForMixedData");_n.from=s(function(e,t){return ap.isValid(e)?parseInt(e,10):t},"from");_n.getCapacity=s(function(e,t,n){if(!ap.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=yn.BYTE);let r=Ic.getSymbolTotalCodewords(e),i=Oh.getTotalCodewordsCount(e,t),a=(r-i)*8;if(n===yn.MIXED)return a;let c=a-$l(n,e);switch(n){case yn.NUMERIC:return Math.floor(c/10*3);case yn.ALPHANUMERIC:return Math.floor(c/11*2);case yn.KANJI:return Math.floor(c/13);case yn.BYTE:default:return Math.floor(c/8)}},"getCapacity");_n.getBestVersionForData=s(function(e,t){let n,r=Wl.from(t,Wl.M);if(Array.isArray(e)){if(e.length>1)return zh(e,r);if(e.length===0)return 1;n=e[0]}else n=e;return wh(n.mode,n.getLength(),r)},"getBestVersionForData");_n.getEncodedBits=s(function(e){if(!ap.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Ic.getBCHDigit(t)-Kl>=0;)t^=kl<<Ic.getBCHDigit(t)-Kl;return e<<12|t},"getEncodedBits")});var nu=C(iu=>{"use strict";var sp=gn(),ou=1335,Ah=21522,tu=sp.getBCHDigit(ou);iu.getEncodedBits=s(function(e,t){let n=e.bit<<3|t,r=n<<10;for(;sp.getBCHDigit(r)-tu>=0;)r^=ou<<sp.getBCHDigit(r)-tu;return(n<<10|r)^Ah},"getEncodedBits")});var au=C((Xx,ru)=>{"use strict";var Ph=vn();function ea(o){this.mode=Ph.NUMERIC,this.data=o.toString()}s(ea,"NumericData");ea.getBitsLength=s(function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},"getBitsLength");ea.prototype.getLength=s(function(){return this.data.length},"getLength");ea.prototype.getBitsLength=s(function(){return ea.getBitsLength(this.data.length)},"getBitsLength");ea.prototype.write=s(function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},"write");ru.exports=ea});var cu=C((_x,su)=>{"use strict";var Dh=vn(),cp=["0","1","2","3","4","5","6","7","8","9","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","Z"," ","$","%","*","+","-",".","/",":"];function ta(o){this.mode=Dh.ALPHANUMERIC,this.data=o}s(ta,"AlphanumericData");ta.getBitsLength=s(function(e){return 11*Math.floor(e/2)+6*(e%2)},"getBitsLength");ta.prototype.getLength=s(function(){return this.data.length},"getLength");ta.prototype.getBitsLength=s(function(){return ta.getBitsLength(this.data.length)},"getBitsLength");ta.prototype.write=s(function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=cp.indexOf(this.data[t])*45;n+=cp.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(cp.indexOf(this.data[t]),6)},"write");su.exports=ta});var pu=C((Kx,fu)=>{"use strict";var Eh=vn();function oa(o){this.mode=Eh.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}s(oa,"ByteData");oa.getBitsLength=s(function(e){return e*8},"getBitsLength");oa.prototype.getLength=s(function(){return this.data.length},"getLength");oa.prototype.getBitsLength=s(function(){return oa.getBitsLength(this.data.length)},"getBitsLength");oa.prototype.write=function(o){for(let e=0,t=this.data.length;e<t;e++)o.put(this.data[e],8)};fu.exports=oa});var lu=C(($x,du)=>{"use strict";var jh=vn(),Th=gn();function ia(o){this.mode=jh.KANJI,this.data=o}s(ia,"KanjiData");ia.getBitsLength=s(function(e){return e*13},"getBitsLength");ia.prototype.getLength=s(function(){return this.data.length},"getLength");ia.prototype.getBitsLength=s(function(){return ia.getBitsLength(this.data.length)},"getBitsLength");ia.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let t=Th.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
4
4
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),o.put(t,13)}};du.exports=ia});var uu=C((tz,fp)=>{"use strict";var $a={single_source_shortest_paths:s(function(o,e,t){var n={},r={};r[e]=0;var i=$a.PriorityQueue.make();i.push(e,0);for(var a,c,f,l,g,h,S,b,I;!i.empty();){a=i.pop(),c=a.value,l=a.cost,g=o[c]||{};for(f in g)g.hasOwnProperty(f)&&(h=g[f],S=l+h,b=r[f],I=typeof r[f]>"u",(I||b>S)&&(r[f]=S,i.push(f,S),n[f]=c))}if(typeof t<"u"&&typeof r[t]>"u"){var j=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(j)}return n},"single_source_shortest_paths"),extract_shortest_path_from_predecessor_list:s(function(o,e){for(var t=[],n=e,r;n;)t.push(n),r=o[n],n=o[n];return t.reverse(),t},"extract_shortest_path_from_predecessor_list"),find_path:s(function(o,e,t){var n=$a.single_source_shortest_paths(o,e,t);return $a.extract_shortest_path_from_predecessor_list(n,t)},"find_path"),PriorityQueue:{make:s(function(o){var e=$a.PriorityQueue,t={},n;o=o||{};for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t.queue=[],t.sorter=o.sorter||e.default_sorter,t},"make"),default_sorter:s(function(o,e){return o.cost-e.cost},"default_sorter"),push:s(function(o,e){var t={value:o,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},"push"),pop:s(function(){return this.queue.shift()},"pop"),empty:s(function(){return this.queue.length===0},"empty")}};typeof fp<"u"&&(fp.exports=$a)});var Cu=C(na=>{"use strict";var V=vn(),hu=au(),vu=cu(),yu=pu(),Su=lu(),es=np(),Fc=gn(),Bh=uu();function mu(o){return unescape(encodeURIComponent(o)).length}s(mu,"getStringByteLength");function ts(o,e,t){let n=[],r;for(;(r=o.exec(t))!==null;)n.push({data:r[0],index:r.index,mode:e,length:r[0].length});return n}s(ts,"getSegments");function bu(o){let e=ts(es.NUMERIC,V.NUMERIC,o),t=ts(es.ALPHANUMERIC,V.ALPHANUMERIC,o),n,r;return Fc.isKanjiModeEnabled()?(n=ts(es.BYTE,V.BYTE,o),r=ts(es.KANJI,V.KANJI,o)):(n=ts(es.BYTE_KANJI,V.BYTE,o),r=[]),e.concat(t,n,r).sort(function(a,c){return a.index-c.index}).map(function(a){return{data:a.data,mode:a.mode,length:a.length}})}s(bu,"getSegmentsFromString");function pp(o,e){switch(e){case V.NUMERIC:return hu.getBitsLength(o);case V.ALPHANUMERIC:return vu.getBitsLength(o);case V.KANJI:return Su.getBitsLength(o);case V.BYTE:return yu.getBitsLength(o)}}s(pp,"getSegmentBitsLength");function Mh(o){return o.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}s(Mh,"mergeSegments");function Lh(o){let e=[];for(let t=0;t<o.length;t++){let n=o[t];switch(n.mode){case V.NUMERIC:e.push([n,{data:n.data,mode:V.ALPHANUMERIC,length:n.length},{data:n.data,mode:V.BYTE,length:n.length}]);break;case V.ALPHANUMERIC:e.push([n,{data:n.data,mode:V.BYTE,length:n.length}]);break;case V.KANJI:e.push([n,{data:n.data,mode:V.BYTE,length:mu(n.data)}]);break;case V.BYTE:e.push([{data:n.data,mode:V.BYTE,length:mu(n.data)}])}}return e}s(Lh,"buildNodes");function Vh(o,e){let t={},n={start:{}},r=["start"];for(let i=0;i<o.length;i++){let a=o[i],c=[];for(let f=0;f<a.length;f++){let l=a[f],g=""+i+f;c.push(g),t[g]={node:l,lastCount:0},n[g]={};for(let h=0;h<r.length;h++){let S=r[h];t[S]&&t[S].node.mode===l.mode?(n[S][g]=pp(t[S].lastCount+l.length,l.mode)-pp(t[S].lastCount,l.mode),t[S].lastCount+=l.length):(t[S]&&(t[S].lastCount=l.length),n[S][g]=pp(l.length,l.mode)+4+V.getCharCountIndicator(l.mode,e))}}r=c}for(let i=0;i<r.length;i++)n[r[i]].end=0;return{map:n,table:t}}s(Vh,"buildGraph");function gu(o,e){let t,n=V.getBestModeForData(o);if(t=V.from(e,n),t!==V.BYTE&&t.bit<n.bit)throw new Error('"'+o+'" cannot be encoded with mode '+V.toString(t)+`.
|
|
5
5
|
Suggested mode is: `+V.toString(n));switch(t===V.KANJI&&!Fc.isKanjiModeEnabled()&&(t=V.BYTE),t){case V.NUMERIC:return new hu(o);case V.ALPHANUMERIC:return new vu(o);case V.KANJI:return new Su(o);case V.BYTE:return new yu(o)}}s(gu,"buildSingleSegment");na.fromArray=s(function(e){return e.reduce(function(t,n){return typeof n=="string"?t.push(gu(n,null)):n.data&&t.push(gu(n.data,n.mode)),t},[])},"fromArray");na.fromString=s(function(e,t){let n=bu(e,Fc.isKanjiModeEnabled()),r=Lh(n),i=Vh(r,t),a=Bh.find_path(i.map,"start","end"),c=[];for(let f=1;f<a.length-1;f++)c.push(i.table[a[f]].node);return na.fromArray(Mh(c))},"fromString");na.rawSplit=s(function(e){return na.fromArray(bu(e,Fc.isKanjiModeEnabled()))},"rawSplit")});var hp=C(Nu=>{"use strict";var wc=gn(),dp=yc(),Hh=Tl(),Qh=Ml(),Uh=Ll(),Gh=Ql(),mp=Ul(),gp=ep(),qh=Xl(),Oc=eu(),Zh=nu(),Yh=vn(),lp=Cu();function Xh(o,e){let t=o.size,n=Gh.getPositions(e);for(let r=0;r<n.length;r++){let i=n[r][0],a=n[r][1];for(let c=-1;c<=7;c++)if(!(i+c<=-1||t<=i+c))for(let f=-1;f<=7;f++)a+f<=-1||t<=a+f||(c>=0&&c<=6&&(f===0||f===6)||f>=0&&f<=6&&(c===0||c===6)||c>=2&&c<=4&&f>=2&&f<=4?o.set(i+c,a+f,!0,!0):o.set(i+c,a+f,!1,!0))}}s(Xh,"setupFinderPattern");function Jh(o){let e=o.size;for(let t=8;t<e-8;t++){let n=t%2===0;o.set(t,6,n,!0),o.set(6,t,n,!0)}}s(Jh,"setupTimingPattern");function _h(o,e){let t=Uh.getPositions(e);for(let n=0;n<t.length;n++){let r=t[n][0],i=t[n][1];for(let a=-2;a<=2;a++)for(let c=-2;c<=2;c++)a===-2||a===2||c===-2||c===2||a===0&&c===0?o.set(r+a,i+c,!0,!0):o.set(r+a,i+c,!1,!0)}}s(_h,"setupAlignmentPattern");function Wh(o,e){let t=o.size,n=Oc.getEncodedBits(e),r,i,a;for(let c=0;c<18;c++)r=Math.floor(c/3),i=c%3+t-8-3,a=(n>>c&1)===1,o.set(r,i,a,!0),o.set(i,r,a,!0)}s(Wh,"setupVersionInfo");function up(o,e,t){let n=o.size,r=Zh.getEncodedBits(e,t),i,a;for(i=0;i<15;i++)a=(r>>i&1)===1,i<6?o.set(i,8,a,!0):i<8?o.set(i+1,8,a,!0):o.set(n-15+i,8,a,!0),i<8?o.set(8,n-i-1,a,!0):i<9?o.set(8,15-i-1+1,a,!0):o.set(8,15-i-1,a,!0);o.set(n-8,8,1,!0)}s(up,"setupFormatInfo");function Kh(o,e){let t=o.size,n=-1,r=t-1,i=7,a=0;for(let c=t-1;c>0;c-=2)for(c===6&&c--;;){for(let f=0;f<2;f++)if(!o.isReserved(r,c-f)){let l=!1;a<e.length&&(l=(e[a]>>>i&1)===1),o.set(r,c-f,l),i--,i===-1&&(a++,i=7)}if(r+=n,r<0||t<=r){r-=n,n=-n;break}}}s(Kh,"setupData");function kh(o,e,t){let n=new Hh;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),Yh.getCharCountIndicator(f.mode,o)),f.write(n)});let r=wc.getSymbolTotalCodewords(o),i=gp.getTotalCodewordsCount(o,e),a=(r-i)*8;for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let c=(a-n.getLengthInBits())/8;for(let f=0;f<c;f++)n.put(f%2?17:236,8);return $h(n,o,e)}s(kh,"createData");function $h(o,e,t){let n=wc.getSymbolTotalCodewords(e),r=gp.getTotalCodewordsCount(e,t),i=n-r,a=gp.getBlocksCount(e,t),c=n%a,f=a-c,l=Math.floor(n/a),g=Math.floor(i/a),h=g+1,S=l-g,b=new qh(S),I=0,j=new Array(a),P=new Array(a),M=0,Nn=new Uint8Array(o.buffer);for(let $n=0;$n<a;$n++){let Mc=$n<f?g:h;j[$n]=Nn.slice(I,I+Mc),P[$n]=b.encode(j[$n]),I+=Mc,M=Math.max(M,Mc)}let Zo=new Uint8Array(n),Je=0,At,Yo;for(At=0;At<M;At++)for(Yo=0;Yo<a;Yo++)At<j[Yo].length&&(Zo[Je++]=j[Yo][At]);for(At=0;At<S;At++)for(Yo=0;Yo<a;Yo++)Zo[Je++]=P[Yo][At];return Zo}s($h,"createCodewords");function ev(o,e,t,n){let r;if(Array.isArray(o))r=lp.fromArray(o);else if(typeof o=="string"){let l=e;if(!l){let g=lp.rawSplit(o);l=Oc.getBestVersionForData(g,t)}r=lp.fromString(o,l||40)}else throw new Error("Invalid data");let i=Oc.getBestVersionForData(r,t);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=i;else if(e<i)throw new Error(`
|
|
@@ -115,8 +115,8 @@ ${e.join(`
|
|
|
115
115
|
<?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,qt.ProcessingInstruction))),this.state===wi.BeforeDocElement?this.result.push(`?>
|
|
116
116
|
`):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===wi.BeforeDocElement&&(this.state=wi.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===wi.BeforeDocElement&&(this.state=wi.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!_O(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,c;(c=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=c[1]);let l=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=xH(e,u);if(h>1)l=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&l){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(yge);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];_O(s)||t.push(s)}t.sort(xge),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,qt.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===qt.Attribute||this.IsTextNode(t))?n.push("<"):i===">"&&this.IsTextNode(t)?n.push(">"):i==="&"&&(t===qt.Attribute||this.IsTextNode(t))?n.push("&"):i==='"'&&t===qt.Attribute?n.push("""):i===" "&&t===qt.Attribute?n.push("	"):i===`
|
|
117
117
|
`&&t===qt.Attribute?n.push("
"):i==="\r"?n.push("
"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case qt.Text:case qt.CDATA:case qt.SignificantWhitespace:case qt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function yge(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(yge,"XmlDsigC14NTransformNamespacesComparer");function xge(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(xge,"XmlDsigC14NTransformAttributesComparer");function xH(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!_O(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===qt.Element){let a=xH(s,e,t);if(s.nodeType===qt.Element&&a)return++t+a}return t}o(xH,"IsNamespaceUsed");function _O(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===qt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(_O,"IsNamespaceNode");var p2=class extends ea{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==qt.Element||n.nodeName===ye.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case ye.ElementNames.RSAPSSParams:s=Da;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};p2=We([Ht({localName:"Other"})],p2);var bo=class extends zr{static{o(this,"SignatureMethod")}};We([jr({localName:ye.AttributeNames.Algorithm,required:!0,defaultValue:""}),dt("design:type",String)],bo.prototype,"Algorithm",void 0);We([Jt({localName:ye.ElementNames.HMACOutputLength,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,converter:Uv}),dt("design:type",Number)],bo.prototype,"HMACOutputLength",void 0);We([Jt({parser:p2,noRoot:!0,minOccurs:0}),dt("design:type",p2)],bo.prototype,"Any",void 0);bo=We([Ht({localName:ye.ElementNames.SignatureMethod})],bo);var $0=class extends zr{static{o(this,"CanonicalizationMethod")}};We([jr({localName:ye.AttributeNames.Algorithm,required:!0,defaultValue:ye.DefaultCanonMethod}),dt("design:type",String)],$0.prototype,"Algorithm",void 0);$0=We([Ht({localName:ye.ElementNames.CanonicalizationMethod})],$0);var G0=class extends zr{static{o(this,"DataObject")}};We([jr({localName:ye.AttributeNames.Id,defaultValue:""}),dt("design:type",String)],G0.prototype,"Id",void 0);We([jr({localName:ye.AttributeNames.MimeType,defaultValue:""}),dt("design:type",String)],G0.prototype,"MimeType",void 0);We([jr({localName:ye.AttributeNames.Encoding,defaultValue:""}),dt("design:type",String)],G0.prototype,"Encoding",void 0);G0=We([Ht({localName:ye.ElementNames.Object})],G0);var Wx=class extends ea{static{o(this,"DataObjects")}};Wx=We([Ht({localName:"xmldsig_objects",parser:G0})],Wx);var vs=class extends zr{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new $e(De.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new $e(De.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};We([jr({localName:ye.AttributeNames.Algorithm,defaultValue:""}),dt("design:type",String)],vs.prototype,"Algorithm",void 0);We([Jt({localName:ye.ElementNames.XPath,defaultValue:""}),dt("design:type",String)],vs.prototype,"XPath",void 0);vs=We([Ht({localName:ye.ElementNames.Transform})],vs);var Nu=class extends vs{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=ye.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new $e(De.PARAM_REQUIRED,"innerXml");return Ar.FromString(this.innerXml.textContent||"","base64")}};var Ao=class extends vs{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new So(!1,!1)}GetOutput(){if(!this.innerXml)throw new $e(De.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Co=class extends Ao{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new So(!0,!1)}};var Tu=class extends vs{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new $e(De.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)mi(e)&&e.localName===ye.ElementNames.Signature&&e.namespaceURI===ye.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var No=class extends vs{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new So(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new $e(De.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},To=class extends No{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new So(!0,!0)}};function wH(r){return r.parentNode?wH(r.parentNode):r}o(wH,"lookupParentNode");var X0=class extends vs{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=ye.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new $e(De.PARAM_REQUIRED,"innerXml");this.Filter(wH(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Dd("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Dd("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(l=>i.lookupNamespaceURI(l),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};We([Jt({localName:ye.ElementNames.XPath,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,required:!0}),dt("design:type",String)],X0.prototype,"XPath",void 0);var W0=class extends ea{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case ye.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return sp(t,Tu);case ye.AlgorithmNamespaces.XmlDsigC14NTransform:return sp(t,Ao);case ye.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return sp(t,Co);case ye.AlgorithmNamespaces.XmlDsigExcC14NTransform:return sp(t,No);case ye.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return sp(t,To);case ye.AlgorithmNamespaces.XmlDsigBase64Transform:return sp(t,Nu);case ye.AlgorithmNamespaces.XmlDsigXPathTransform:return sp(t,X0);default:try{let n=zx.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new $e(De.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};W0=We([Ht({localName:ye.ElementNames.Transforms,parser:vs})],W0);function sp(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(sp,"ChangeTransform");var Io=class extends zr{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new ta,e&&(this.Uri=e)}};We([jr({defaultValue:""}),dt("design:type",String)],Io.prototype,"Id",void 0);We([jr({localName:ye.AttributeNames.URI}),dt("design:type",String)],Io.prototype,"Uri",void 0);We([jr({localName:ye.AttributeNames.Type,defaultValue:""}),dt("design:type",String)],Io.prototype,"Type",void 0);We([Jt({parser:W0}),dt("design:type",W0)],Io.prototype,"Transforms",void 0);We([Jt({required:!0,parser:ta}),dt("design:type",ta)],Io.prototype,"DigestMethod",void 0);We([Jt({required:!0,localName:ye.ElementNames.DigestValue,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,converter:Gi}),dt("design:type",Uint8Array)],Io.prototype,"DigestValue",void 0);Io=We([Ht({localName:ye.ElementNames.Reference}),dt("design:paramtypes",[String])],Io);var z0=class extends ea{static{o(this,"References")}};z0=We([Ht({localName:"References",parser:Io})],z0);var Iu=class extends zr{static{o(this,"SignedInfo")}};We([jr({localName:ye.AttributeNames.Id,defaultValue:""}),dt("design:type",String)],Iu.prototype,"Id",void 0);We([Jt({parser:$0,required:!0}),dt("design:type",$0)],Iu.prototype,"CanonicalizationMethod",void 0);We([Jt({parser:bo,required:!0}),dt("design:type",bo)],Iu.prototype,"SignatureMethod",void 0);We([Jt({parser:z0,minOccurs:1,noRoot:!0}),dt("design:type",z0)],Iu.prototype,"References",void 0);Iu=We([Ht({localName:ye.ElementNames.SignedInfo})],Iu);var Z0="http://www.w3.org/2001/04/xmldsig-more#",eg="ecdsa",ip=class extends zs{static{o(this,"EcdsaPublicKey")}};We([Jt({localName:ye.ElementNames.X,namespaceURI:Z0,prefix:eg,required:!0,converter:Gi}),dt("design:type",Uint8Array)],ip.prototype,"X",void 0);We([Jt({localName:ye.ElementNames.Y,namespaceURI:Z0,prefix:eg,required:!0,converter:Gi}),dt("design:type",Uint8Array)],ip.prototype,"Y",void 0);ip=We([Ht({localName:ye.ElementNames.PublicKey,namespaceURI:Z0,prefix:eg})],ip);var J0=class extends zs{static{o(this,"NamedCurve")}};We([jr({localName:ye.AttributeNames.URI,required:!0}),dt("design:type",String)],J0.prototype,"Uri",void 0);J0=We([Ht({localName:ye.ElementNames.NamedCurve,namespaceURI:Z0,prefix:eg})],J0);var Y0=class extends zs{static{o(this,"DomainParameters")}};We([Jt({parser:J0}),dt("design:type",J0)],Y0.prototype,"NamedCurve",void 0);Y0=We([Ht({localName:ye.ElementNames.DomainParameters,namespaceURI:Z0,prefix:eg})],Y0);var Q0=class extends xi{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=ye.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Au.toUpperCase()}get NamedCurve(){return SH(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new $e(De.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await An.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new ip,this.PublicKey.X=Ar.FromString(t.x||"","base64url"),this.PublicKey.Y=Ar.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new Y0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new J0),this.DomainParameters.NamedCurve.Uri=SH(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=Ar.ToBase64Url(this.PublicKey.X),n=Ar.ToBase64Url(this.PublicKey.Y),s=wge(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await An.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};We([Jt({parser:Y0}),dt("design:type",Y0)],Q0.prototype,"DomainParameters",void 0);We([Jt({parser:ip,required:!0}),dt("design:type",ip)],Q0.prototype,"PublicKey",void 0);Q0=We([Ht({localName:ye.ElementNames.ECDSAKeyValue,namespaceURI:Z0,prefix:eg})],Q0);function SH(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new $e(De.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(SH,"GetNamedCurveOid");function wge(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new $e(De.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(wge,"GetNamedCurveFromOid");var Ege=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},Ol=new Ege;Ol.set(ye.ElementNames.RSAKeyValue,H0);Ol.set(ye.ElementNames.ECDSAKeyValue,Q0);var d2=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=Ol.get(e);if(!t)throw new $e(De.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var Jx=class extends xi{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of Ol)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new $e(De.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new $e(De.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new $e(De.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(mi(n))try{let s=n.localName,i=d2.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new $e(De.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};Jx=We([Ht({localName:ye.ElementNames.KeyValue}),dt("design:paramtypes",[xi])],Jx);var Sge={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},tg=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return An.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===Au){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=Sge[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Zr(this.raw.buffer);this.simpl=new gs({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var m2=class extends zr{static{o(this,"X509IssuerSerial")}};We([Jt({localName:ye.ElementNames.X509IssuerName,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,required:!0}),dt("design:type",String)],m2.prototype,"X509IssuerName",void 0);We([Jt({localName:ye.ElementNames.X509SerialNumber,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,required:!0}),dt("design:type",String)],m2.prototype,"X509SerialNumber",void 0);m2=We([Ht({localName:ye.ElementNames.X509IssuerSerial})],m2);var ap;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(ap||(ap={}));var rg=class extends xi{static{o(this,"KeyInfoX509Data")}constructor(e,t=ap.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new tg(e));else if(e instanceof tg)switch(t){case ap.None:case ap.EndCertOnly:this.AddCertificate(e);break;case ap.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case ap.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new $e(De.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new $e(De.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new $e(De.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new $e(De.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=Ar.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509IssuerSerial),a=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509SKI);i.textContent=Ar.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509Certificate);i.textContent=Ar.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(ye.NamespaceURI,n+ye.ElementNames.X509CRL);s.textContent=Ar.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(ye.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=zr.GetChild(s,ye.ElementNames.X509IssuerName,ye.NamespaceURI,!0),a=zr.GetChild(s,ye.ElementNames.X509SerialNumber,ye.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(ye.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=Ar.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(ye.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(ye.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=Ar.FromBase64(s.textContent);this.AddCertificate(new tg(i))}});let n=this.GetChild(ye.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=Ar.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};rg=We([Ht({localName:ye.ElementNames.X509Data}),dt("design:paramtypes",[Object,Object])],rg);var Yx=class extends xi{static{o(this,"SPKIData")}async importKey(e){let t=await An.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await An.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};We([Jt({localName:ye.ElementNames.SPKIexp,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,required:!0,converter:Gi}),dt("design:type",Object)],Yx.prototype,"SPKIexp",void 0);Yx=We([Ht({localName:ye.ElementNames.SPKIData})],Yx);var op=class extends ea{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==qt.Element)continue;let s=null;switch(n.localName){case ye.ElementNames.KeyValue:s=Jx;break;case ye.ElementNames.X509Data:s=rg;break;case ye.ElementNames.SPKIData:s=Yx;break;case ye.ElementNames.KeyName:case ye.ElementNames.RetrievalMethod:case ye.ElementNames.PGPData:case ye.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};We([jr({localName:ye.AttributeNames.Id,defaultValue:""}),dt("design:type",String)],op.prototype,"Id",void 0);op=We([Ht({localName:ye.ElementNames.KeyInfo})],op);var Pl=class extends zr{static{o(this,"Signature")}};We([jr({localName:ye.AttributeNames.Id,defaultValue:""}),dt("design:type",String)],Pl.prototype,"Id",void 0);We([Jt({parser:Iu,required:!0}),dt("design:type",Iu)],Pl.prototype,"SignedInfo",void 0);We([Jt({localName:ye.ElementNames.SignatureValue,namespaceURI:ye.NamespaceURI,prefix:ye.DefaultPrefix,required:!0,converter:Gi,defaultValue:null}),dt("design:type",Object)],Pl.prototype,"SignatureValue",void 0);We([Jt({parser:op}),dt("design:type",op)],Pl.prototype,"KeyInfo",void 0);We([Jt({parser:Wx,noRoot:!0}),dt("design:type",Wx)],Pl.prototype,"ObjectList",void 0);Pl=We([Ht({localName:ye.ElementNames.Signature})],Pl);var Age=class extends Map{static{o(this,"AlgorithmRegistry")}},vr=new Age;vr.set(o2,{type:"signature",algorithm:j0});vr.set(u2,{type:"signature",algorithm:F0});vr.set(c2,{type:"signature",algorithm:M0});vr.set(l2,{type:"signature",algorithm:q0});vr.set(o2,{type:"signature",algorithm:j0});vr.set(u2,{type:"signature",algorithm:F0});vr.set(c2,{type:"signature",algorithm:M0});vr.set(l2,{type:"signature",algorithm:q0});vr.set(IO,{type:"signature",algorithm:h2});vr.set(t2,{type:"signature",algorithm:P0});vr.set(r2,{type:"signature",algorithm:k0});vr.set(n2,{type:"signature",algorithm:L0});vr.set(s2,{type:"signature",algorithm:V0});vr.set(t2.toUpperCase(),{type:"signature",algorithm:P0});vr.set(r2.toUpperCase(),{type:"signature",algorithm:k0});vr.set(n2.toUpperCase(),{type:"signature",algorithm:L0});vr.set(s2.toUpperCase(),{type:"signature",algorithm:V0});vr.set(SO,{type:"signature",algorithm:Kx});vr.set(bO,{type:"signature",algorithm:$x});vr.set(AO,{type:"signature",algorithm:Gx});vr.set(CO,{type:"signature",algorithm:Xx});vr.set(D0,{type:"hash",algorithm:QC});vr.set(B0,{type:"hash",algorithm:Hx});vr.set(R0,{type:"hash",algorithm:ZC});vr.set(O0,{type:"hash",algorithm:e2});var up=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of vr)if(n==="hash"&&t===e)return new s;throw new $e(De.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of vr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new $e(De.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of vr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new $e(De.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of vr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new $e(De.ALGORITHM_NOT_SUPPORTED,e.name)}};var Cge=class extends Map{static{o(this,"TransformRegistry")}},_u=new Cge;_u.set(ye.AlgorithmNamespaces.XmlDsigBase64Transform,Nu);_u.set(ye.AlgorithmNamespaces.XmlDsigC14NTransform,Ao);_u.set(ye.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Co);_u.set(ye.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Tu);_u.set(ye.AlgorithmNamespaces.XmlDsigExcC14NTransform,No);_u.set(ye.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,To);var zx=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new $e(De.PARAM_REQUIRED,"name");let t=_u.get(e);if(t)return new t;let n;switch(e){case ye.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Nu;break;case ye.AlgorithmNamespaces.XmlDsigC14NTransform:n=new Ao;break;case ye.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Co;break;case ye.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Tu;break;case ye.AlgorithmNamespaces.XmlDsigXPathTransform:throw new $e(De.ALGORITHM_NOT_SUPPORTED,e);case ye.AlgorithmNamespaces.XmlDsigXsltTransform:throw new $e(De.ALGORITHM_NOT_SUPPORTED,e);case ye.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new No;break;case ye.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new To;break;case ye.AlgorithmNamespaces.XmlDecryptionTransform:throw new $e(De.ALGORITHM_NOT_SUPPORTED,e);default:throw new $e(De.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return up.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return up.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return up.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),up.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new bo;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){vr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){vr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){Ol.set(e,t)}static RegisterTransform(e,t){_u.set(e,t)}};var g2=Gl(H_(),1);var bH={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var AH={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var V4e={[Nr.AC]:"America/Rio_Branco",[Nr.AL]:"America/Maceio",[Nr.AM]:"America/Manaus",[Nr.AP]:"America/Belem",[Nr.BA]:"America/Bahia",[Nr.CE]:"America/Fortaleza",[Nr.DF]:"America/Sao_Paulo",[Nr.ES]:"America/Sao_Paulo",[Nr.GO]:"America/Sao_Paulo",[Nr.MA]:"America/Fortaleza",[Nr.MG]:"America/Sao_Paulo",[Nr.MS]:"America/Campo_Grande",[Nr.MT]:"America/Cuiaba",[Nr.PA]:"America/Belem",[Nr.PB]:"America/Fortaleza",[Nr.PE]:"America/Recife",[Nr.PI]:"America/Fortaleza",[Nr.PR]:"America/Sao_Paulo",[Nr.RJ]:"America/Sao_Paulo",[Nr.RN]:"America/Fortaleza",[Nr.RO]:"America/Porto_Velho",[Nr.RR]:"America/Boa_Vista",[Nr.RS]:"America/Sao_Paulo",[Nr.SC]:"America/Sao_Paulo",[Nr.SE]:"America/Maceio",[Nr.SP]:"America/Sao_Paulo",[Nr.TO]:"America/Araguaina"};var CH=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=Ige){this.xml2js=e,M9({XMLSerializer:g2.default.XMLSerializer,DOMParser:g2.default.DOMParser,DOMImplementation:g2.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return bs(new an("Please provide a valid xml content"));if(!t||t.trim().length===0)return bs(new an("Please provide a valid existing xsd path"));try{return await pM.validate(e,t),Di()}catch(n){return rf(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...AH,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...bH,...t}).buildObject(e))}digest(e,t,n=Sg){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=Sg){let n=$i(this.clear(e));return new So(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=$i(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(fo(s)):null}getFirstNode(e){let n=$i(e).documentElement.firstChild;return n?this.clear(fo(n)):null}getAttribute(e,t){return $i(e).documentElement.getAttribute(t)}appendNode(e,t){let n=$i(e),{documentElement:s}=$i(t);return n.documentElement.appendChild(s),this.clear(fo(n))}hash(e,t){return Tge.createHash(t).update(e,"utf8").digest().toString("base64")}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
|
|
118
|
-
`,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as _ge}from"class-validator";var NH=o(r=>(e,t)=>{_ge({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Ip?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as TH}from"class-validator";var ng=Symbol("choice"),sg=o(r=>r==null||r==="","isEmpty"),ALe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(ng,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(ng,i,e);for(let u of t)TH({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,l){let h=l.object,m=l.property,g=Reflect.getMetadata(ng,e);if(!g)return!0;let y=g.find(v=>v.properties.includes(m));if(!y||sg(c))return!0;for(let v of y.properties){if(v===m)continue;let E=h[v];if(!sg(E))return!1}for(let v of g)if(v!==y)for(let E of v.properties){let w=h[E];if(!sg(w))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(ng,e);if(!l)return`${c.property} validation error`;let h=l.find(g=>g.properties.includes(c.property));if(!h)return`${c.property} validation error`;let m=c.object;for(let g of h.properties){let y=m[g];if(!sg(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!==h)for(let y of g.properties){let v=m[y];if(!sg(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)TH({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,l){let h=l.object,m=Reflect.getMetadata(ng,e);if(!m)return!0;let g=m.find(y=>y.properties.includes(l.property));if(!g?.required)return!0;for(let y of g.properties){let v=h[y];if(!sg(v))return!0}return l.property!==g.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(ng,e);if(!l)return"At least one property from a choice group must be provided";let h=l.find(m=>m.properties.includes(c.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as Dge}from"class-transformer";var BLe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{NH(e)(t,n),Dge(({value:s})=>Ip.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as Oge}from"class-transformer";import{IsDateString as Pge}from"class-validator";import DO from"dayjs";import Bge from"dayjs/plugin/utc.js";import Rge from"dayjs/plugin/timezone.js";DO.extend(Bge);DO.extend(Rge);var IH=DO;var MLe=o((r={})=>(e,t)=>{Oge(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?IH(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),Pge()(e,t)},"TransformDateString");var _H=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((v,E,w)=>v+E*a[w],0)%11,l=c===0||c===1?0:11-c,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,l].reduce((v,E,w)=>v+E*h[w],0)%11,y=g===0||g===1?0:11-g;return s===l&&i===y}};var DH=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var BH=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var RH=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let m=0;m<8;m++)c+=parseInt(t[m],10)*u[m];let h=11-c%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var OH=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(E=>parseInt(E,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let E=0;E<i.length;E++)a+=n[E]*i[E];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let h=(t.slice(0,t.length-2)+c.toString()).split("").map(E=>parseInt(E,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let E=0;E<m.length;E++)g+=h[E]*m[E];let y=g%s,v=s-y;return(s===11&&y<=1||s===10&&y===0)&&(v=0),v===n[t.length-2]&&c===n[t.length-1]}};var PH=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var kH=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),l=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)l+=c[m]*i[g];let h=11-l%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var LH=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var VH=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var UH=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var jH=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let y=0;y<12;y++){let v=y%2===0?1:2,E=(parseInt(s[y])*v).toString();i+=E.split("").reduce((w,C)=>w+parseInt(C),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),l=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let y=0;y<12;y++)h+=parseInt(c[y])*l[y];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var FH=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var MH=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var qH=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var HH=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var KH=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let y=0;y<7;y++)i+=n[y]*s[y];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],l=[9,8,7,6,5,4,3,2],h=0;for(let y=0;y<8;y++)h+=c[y]*l[y];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var $H=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var GH=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],l=0;for(let m=0;m<9;m++)l+=c[m]*i[m];let h=11-l%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var XH=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var WH=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let l=0;l<n.length;l++)i+=s[l]*n[l];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var zH=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var JH=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var YH=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var QH=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var ZH=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var eK=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let h=0;h<11;h++)c+=n[h]*u[h];let l=c%11%10;return a===n[8]&&l===n[11]}};var tK=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let l=0;l<i.length;l++)a+=s[l]*i[l];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var _d=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
|
|
119
|
-
`).reduce((i,a)=>{let[u,c]=a.split("=").map(l=>l.trim());return!u||!c?i:i.set(u,c)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,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),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[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,i[1]]),h=this.length(l),m=n.length,g=l.subarray(2+m,2+m+h),y=g.length-c.length-2;if(y<=0||y>g.length)return;let E=g.subarray(-y).toString("utf8");return E.substring(Buffer.from(E).findIndex((w,C)=>E.charCodeAt(C)>=32&&E.charCodeAt(C)<=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((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var nK=class{static{o(this,"NativeCertificateRepository")}httpClient;signer;cache;constructor(e,t,n=new Yw){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 s=kl.default.asn1.fromDer(n.value.toString("binary")),i=kl.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a}=kl.default.pki.oids,c=i.getBags({bagType:a})[a];if(!c?.length)return bs(new an("Cannot read certificate"));let[{cert:l},...h]=c;if(!l)return bs(new an("Issuer Certificate not found"));let m=h.reduce((y,{cert:v})=>(v&&y.push(new v2.X509Certificate(kl.default.pki.certificateToPem(v))),y),[]),g=new v2.X509Certificate(kl.default.pki.certificateToPem(l));return Di({ca:m,password:t,certificate:g,privateKey:this.getPrivateKey(i)})}catch(t){return rf(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=kl.default.pki.oids,s=e.getBags({bagType:t})[t]?.[0]?.key;if(s)return v2.createPrivateKey(kl.default.pki.privateKeyToPem(s))}async sign(e,t,n=Fu.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new _d().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new an("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return Di(i);if(kge.isAbsolute(t)||rK.existsSync(t))return this.hitBufferOnCache(s,rK.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return rf(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return v2.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Di(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};export{ON as a,rk as b,PN as c,Fu as d,kN as e,Nr as f,Vge as g,jge as h,V4e as i,an as j,nk as k,LN as l,Ap as m,bs as n,Di as o,sk as p,ik as q,bg as r,dve as s,mve as t,qw as u,ak as v,ok as w,uk as x,Cve as y,Ip as z,bk as A,Ak as B,rf as C,Yw as D,nK as E,ab as F,qD as G,fM as H,CH as I,NH as J,
|
|
118
|
+
`,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as _ge}from"class-validator";var NH=o(r=>(e,t)=>{_ge({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof Ip?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as TH}from"class-validator";var ng=Symbol("choice"),sg=o(r=>r==null||r==="","isEmpty"),CLe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(ng,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(ng,i,e);for(let u of t)TH({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,l){let h=l.object,m=l.property,g=Reflect.getMetadata(ng,e);if(!g)return!0;let y=g.find(v=>v.properties.includes(m));if(!y||sg(c))return!0;for(let v of y.properties){if(v===m)continue;let E=h[v];if(!sg(E))return!1}for(let v of g)if(v!==y)for(let E of v.properties){let w=h[E];if(!sg(w))return!1}return!0},defaultMessage(c){let l=Reflect.getMetadata(ng,e);if(!l)return`${c.property} validation error`;let h=l.find(g=>g.properties.includes(c.property));if(!h)return`${c.property} validation error`;let m=c.object;for(let g of h.properties){let y=m[g];if(!sg(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!==h)for(let y of g.properties){let v=m[y];if(!sg(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)TH({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,l){let h=l.object,m=Reflect.getMetadata(ng,e);if(!m)return!0;let g=m.find(y=>y.properties.includes(l.property));if(!g?.required)return!0;for(let y of g.properties){let v=h[y];if(!sg(v))return!0}return l.property!==g.properties[0]},defaultMessage(c){let l=Reflect.getMetadata(ng,e);if(!l)return"At least one property from a choice group must be provided";let h=l.find(m=>m.properties.includes(c.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as Dge}from"class-transformer";var RLe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{NH(e)(t,n),Dge(({value:s})=>Ip.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as Oge}from"class-transformer";import{IsDateString as Pge}from"class-validator";import DO from"dayjs";import Bge from"dayjs/plugin/utc.js";import Rge from"dayjs/plugin/timezone.js";DO.extend(Bge);DO.extend(Rge);var IH=DO;var qLe=o((r={})=>(e,t)=>{Oge(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?IH(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),Pge()(e,t)},"TransformDateString");var _H=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((v,E,w)=>v+E*a[w],0)%11,l=c===0||c===1?0:11-c,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,l].reduce((v,E,w)=>v+E*h[w],0)%11,y=g===0||g===1?0:11-g;return s===l&&i===y}};var DH=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var BH=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var RH=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let m=0;m<8;m++)c+=parseInt(t[m],10)*u[m];let h=11-c%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var OH=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(E=>parseInt(E,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let E=0;E<i.length;E++)a+=n[E]*i[E];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let h=(t.slice(0,t.length-2)+c.toString()).split("").map(E=>parseInt(E,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let E=0;E<m.length;E++)g+=h[E]*m[E];let y=g%s,v=s-y;return(s===11&&y<=1||s===10&&y===0)&&(v=0),v===n[t.length-2]&&c===n[t.length-1]}};var PH=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var kH=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),l=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)l+=c[m]*i[g];let h=11-l%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var LH=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var VH=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var UH=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var jH=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let y=0;y<12;y++){let v=y%2===0?1:2,E=(parseInt(s[y])*v).toString();i+=E.split("").reduce((w,C)=>w+parseInt(C),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),l=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let y=0;y<12;y++)h+=parseInt(c[y])*l[y];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var FH=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var MH=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var qH=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var HH=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var KH=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let y=0;y<7;y++)i+=n[y]*s[y];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],l=[9,8,7,6,5,4,3,2],h=0;for(let y=0;y<8;y++)h+=c[y]*l[y];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var $H=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var GH=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],l=0;for(let m=0;m<9;m++)l+=c[m]*i[m];let h=11-l%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var XH=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var WH=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let l=0;l<n.length;l++)i+=s[l]*n[l];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var zH=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var JH=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var YH=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var QH=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var ZH=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var eK=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let h=0;h<11;h++)c+=n[h]*u[h];let l=c%11%10;return a===n[8]&&l===n[11]}};var tK=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let l=0;l<i.length;l++)a+=s[l]*i[l];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var _d=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
|
|
119
|
+
`).reduce((i,a)=>{let[u,c]=a.split("=").map(l=>l.trim());return!u||!c?i:i.set(u,c)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,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),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[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,i[1]]),h=this.length(l),m=n.length,g=l.subarray(2+m,2+m+h),y=g.length-c.length-2;if(y<=0||y>g.length)return;let E=g.subarray(-y).toString("utf8");return E.substring(Buffer.from(E).findIndex((w,C)=>E.charCodeAt(C)>=32&&E.charCodeAt(C)<=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((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var nK=class{static{o(this,"NativeCertificateRepository")}httpClient;signer;cache;constructor(e,t,n=new Yw){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 s=kl.default.asn1.fromDer(n.value.toString("binary")),i=kl.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a}=kl.default.pki.oids,c=i.getBags({bagType:a})[a];if(!c?.length)return bs(new an("Cannot read certificate"));let[{cert:l},...h]=c;if(!l)return bs(new an("Issuer Certificate not found"));let m=h.reduce((y,{cert:v})=>(v&&y.push(new v2.X509Certificate(kl.default.pki.certificateToPem(v))),y),[]),g=new v2.X509Certificate(kl.default.pki.certificateToPem(l));return Di({ca:m,password:t,certificate:g,privateKey:this.getPrivateKey(i)})}catch(t){return rf(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=kl.default.pki.oids,s=e.getBags({bagType:t})[t]?.[0]?.key;if(s)return v2.createPrivateKey(kl.default.pki.privateKeyToPem(s))}async sign(e,t,n=Fu.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new _d().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new an("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return Di(i);if(kge.isAbsolute(t)||rK.existsSync(t))return this.hitBufferOnCache(s,rK.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return rf(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return v2.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Di(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};export{ON as a,rk as b,PN as c,Fu as d,kN as e,Nr as f,Vge as g,jge as h,V4e as i,an as j,nk as k,LN as l,Ap as m,bs as n,Di as o,sk as p,ik as q,bg as r,dve as s,mve as t,qw as u,ak as v,ok as w,uk as x,Cve as y,Ip as z,bk as A,Ak as B,rf as C,Yw as D,nK as E,ab as F,qD as G,fM as H,CH as I,NH as J,CLe as K,RLe as L,IH as M,qLe as N,_H as O,DH as P,BH as Q,RH as R,OH as S,PH as T,kH as U,LH as V,VH as W,UH as X,jH as Y,FH as Z,MH as _,qH as $,HH as aa,KH as ba,$H as ca,GH as da,XH as ea,WH as fa,zH as ga,JH as ha,YH as ia,QH as ja,ZH as ka,eK as la,tK as ma,_d as na};
|
|
120
120
|
/*! Bundled license information:
|
|
121
121
|
|
|
122
122
|
lodash/lodash.js:
|