nfets 0.0.97 → 0.0.98
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-6Q55WART.mjs → chunk-4YDKSLI2.mjs} +1 -1
- package/dist/chunk-PCA4Z35I.mjs +259 -0
- package/dist/core/index.cjs +91 -110
- package/dist/core/index.d.cts +3 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +104 -123
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +104 -123
- package/dist/nfe/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-IJON6HO5.mjs +0 -278
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{A as kp,B as $p,C as ed,E as td,F as od,G as Uc,H as id,I as fs,K as Q,L as p,M as Gc,N as Hi,d as Xp,f as d,g as Jp,h as y,i as Hc,j as _e,l as cs,n as We,o as G,p as _p,q as Wp,v as Kp,w as Io,y as F,z as k}from"./chunk-
|
|
2
|
+
import{A as kp,B as $p,C as ed,E as td,F as od,G as Uc,H as id,I as fs,K as Q,L as p,M as Gc,N as Hi,d as Xp,f as d,g as Jp,h as y,i as Hc,j as _e,l as cs,n as We,o as G,p as _p,q as Wp,v as Kp,w as Io,y as F,z as k}from"./chunk-PCA4Z35I.mjs";import{a as s,b as Ie,d as C,f as Jm}from"./chunk-W6MRGYXP.mjs";var op=C((Lx,Tl)=>{"use strict";Tl.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var vn=C(Jn=>{"use strict";var ip,yh=[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];Jn.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");Jn.getSymbolTotalCodewords=s(function(e){return yh[e]},"getSymbolTotalCodewords");Jn.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e};Jn.setToSJISFunction=s(function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ip=e},"setToSJISFunction");Jn.isKanjiModeEnabled=function(){return typeof ip<"u"};Jn.toSJIS=s(function(e){return ip(e)},"toSJIS")});var Cc=C(Zt=>{"use strict";Zt.L={bit:1};Zt.M={bit:0};Zt.Q={bit:3};Zt.H={bit:2};function Sh(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return Zt.L;case"m":case"medium":return Zt.M;case"q":case"quartile":return Zt.Q;case"h":case"high":return Zt.H;default:throw new Error("Unknown EC Level: "+o)}}s(Sh,"fromString");Zt.isValid=s(function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},"isValid");Zt.from=s(function(e,t){if(Zt.isValid(e))return e;try{return Sh(e)}catch{return t}},"from")});var Ll=C((Gx,Ml)=>{"use strict";function Bl(){this.buffer=[],this.length=0}s(Bl,"BitBuffer");Bl.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")};Ml.exports=Bl});var Ql=C((Zx,Vl)=>{"use strict";function Wa(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(Wa,"BitMatrix");Wa.prototype.set=function(o,e,t,n){let r=o*this.size+e;this.data[r]=t,n&&(this.reservedBit[r]=!0)};Wa.prototype.get=function(o,e){return this.data[o*this.size+e]};Wa.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t};Wa.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};Vl.exports=Wa});var Hl=C(Nc=>{"use strict";var bh=vn().getSymbolSize;Nc.getRowColCoords=s(function(e){if(e===1)return[];let t=Math.floor(e/7)+2,n=bh(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");Nc.getPositions=s(function(e){let t=[],n=Nc.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(Gl=>{"use strict";var Ch=vn().getSymbolSize,Ul=7;Gl.getPositions=s(function(e){let t=Ch(e);return[[0,0],[t-Ul,0],[0,t-Ul]]},"getPositions")});var Zl=C(J=>{"use strict";J.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var _n={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+=_n.N1+(r-5)),a=g,r=1),g=e.get(l,f),g===c?i++:(i>=5&&(n+=_n.N1+(i-5)),c=g,i=1)}r>=5&&(n+=_n.N1+(r-5)),i>=5&&(n+=_n.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*_n.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*_n.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)*_n.N4},"getPenaltyN4");function Nh(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(Nh,"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,Nh(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 rp=C(np=>{"use strict";var yn=Cc(),Rc=[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],Ic=[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];np.getBlocksCount=s(function(e,t){switch(t){case yn.L:return Rc[(e-1)*4+0];case yn.M:return Rc[(e-1)*4+1];case yn.Q:return Rc[(e-1)*4+2];case yn.H:return Rc[(e-1)*4+3];default:return}},"getBlocksCount");np.getTotalCodewordsCount=s(function(e,t){switch(t){case yn.L:return Ic[(e-1)*4+0];case yn.M:return Ic[(e-1)*4+1];case yn.Q:return Ic[(e-1)*4+2];case yn.H:return Ic[(e-1)*4+3];default:return}},"getTotalCodewordsCount")});var Yl=C(Oc=>{"use strict";var Ka=new Uint8Array(512),Fc=new Uint8Array(256);s((function(){let e=1;for(let t=0;t<255;t++)Ka[t]=e,Fc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Ka[t]=Ka[t-255]}),"initTables")();Oc.log=s(function(e){if(e<1)throw new Error("log("+e+")");return Fc[e]},"log");Oc.exp=s(function(e){return Ka[e]},"exp");Oc.mul=s(function(e,t){return e===0||t===0?0:Ka[Fc[e]+Fc[t]]},"mul")});var Xl=C(ka=>{"use strict";var ap=Yl();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]^=ap.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]^=ap.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,ap.exp(n)]));return t},"generateECPolynomial")});var Wl=C((rz,_l)=>{"use strict";var Jl=Xl();function sp(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}s(sp,"ReedSolomonEncoder");sp.prototype.initialize=s(function(e){this.degree=e,this.genPoly=Jl.generateECPolynomial(this.degree)},"initialize");sp.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=Jl.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");_l.exports=sp});var cp=C(Kl=>{"use strict";Kl.isValid=s(function(e){return!isNaN(e)&&e>=1&&e<=40},"isValid")});var fp=C(Qi=>{"use strict";var kl="[0-9]+",Rh="[A-Z $%*+\\-./:]+",$a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";$a=$a.replace(/u/g,"\\u");var Ih="(?:(?![A-Z0-9 $%*+\\-./:]|"+$a+`)(?:.|[\r
|
|
3
3
|
]))+`;Qi.KANJI=new RegExp($a,"g");Qi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Qi.BYTE=new RegExp(Ih,"g");Qi.NUMERIC=new RegExp(kl,"g");Qi.ALPHANUMERIC=new RegExp(Rh,"g");var Fh=new RegExp("^"+$a+"$"),Oh=new RegExp("^"+kl+"$"),wh=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Qi.testKanji=s(function(e){return Fh.test(e)},"testKanji");Qi.testNumeric=s(function(e){return Oh.test(e)},"testNumeric");Qi.testAlphanumeric=s(function(e){return wh.test(e)},"testAlphanumeric")});var Sn=C(Re=>{"use strict";var xh=cp(),pp=fp();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(!xh.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 pp.testNumeric(e)?Re.NUMERIC:pp.testAlphanumeric(e)?Re.ALPHANUMERIC:pp.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 zh(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(zh,"fromString");Re.from=s(function(e,t){if(Re.isValid(e))return e;try{return zh(e)}catch{return t}},"from")});var iu=C(Wn=>{"use strict";var wc=vn(),Ah=rp(),$l=Cc(),bn=Sn(),dp=cp(),tu=7973,eu=wc.getBCHDigit(tu);function Ph(o,e,t){for(let n=1;n<=40;n++)if(e<=Wn.getCapacity(n,t,o))return n}s(Ph,"getBestVersionForDataLength");function ou(o,e){return bn.getCharCountIndicator(o,e)+4}s(ou,"getReservedBitsCount");function Dh(o,e){let t=0;return o.forEach(function(n){let r=ou(n.mode,e);t+=r+n.getBitsLength()}),t}s(Dh,"getTotalBitsFromDataArray");function Eh(o,e){for(let t=1;t<=40;t++)if(Dh(o,t)<=Wn.getCapacity(t,e,bn.MIXED))return t}s(Eh,"getBestVersionForMixedData");Wn.from=s(function(e,t){return dp.isValid(e)?parseInt(e,10):t},"from");Wn.getCapacity=s(function(e,t,n){if(!dp.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=bn.BYTE);let r=wc.getSymbolTotalCodewords(e),i=Ah.getTotalCodewordsCount(e,t),a=(r-i)*8;if(n===bn.MIXED)return a;let c=a-ou(n,e);switch(n){case bn.NUMERIC:return Math.floor(c/10*3);case bn.ALPHANUMERIC:return Math.floor(c/11*2);case bn.KANJI:return Math.floor(c/13);case bn.BYTE:default:return Math.floor(c/8)}},"getCapacity");Wn.getBestVersionForData=s(function(e,t){let n,r=$l.from(t,$l.M);if(Array.isArray(e)){if(e.length>1)return Eh(e,r);if(e.length===0)return 1;n=e[0]}else n=e;return Ph(n.mode,n.getLength(),r)},"getBestVersionForData");Wn.getEncodedBits=s(function(e){if(!dp.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;wc.getBCHDigit(t)-eu>=0;)t^=tu<<wc.getBCHDigit(t)-eu;return e<<12|t},"getEncodedBits")});var su=C(au=>{"use strict";var lp=vn(),ru=1335,jh=21522,nu=lp.getBCHDigit(ru);au.getEncodedBits=s(function(e,t){let n=e.bit<<3|t,r=n<<10;for(;lp.getBCHDigit(r)-nu>=0;)r^=ru<<lp.getBCHDigit(r)-nu;return(n<<10|r)^jh},"getEncodedBits")});var fu=C((vz,cu)=>{"use strict";var Th=Sn();function ea(o){this.mode=Th.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");cu.exports=ea});var du=C((Sz,pu)=>{"use strict";var Bh=Sn(),up=["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=Bh.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=up.indexOf(this.data[t])*45;n+=up.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(up.indexOf(this.data[t]),6)},"write");pu.exports=ta});var uu=C((Cz,lu)=>{"use strict";var Mh=Sn();function oa(o){this.mode=Mh.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)};lu.exports=oa});var gu=C((Rz,mu)=>{"use strict";var Lh=Sn(),Vh=vn();function ia(o){this.mode=Lh.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=Vh.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)}};mu.exports=ia});var hu=C((Fz,mp)=>{"use strict";var es={single_source_shortest_paths:s(function(o,e,t){var n={},r={};r[e]=0;var i=es.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=es.single_source_shortest_paths(o,e,t);return es.extract_shortest_path_from_predecessor_list(n,t)},"find_path"),PriorityQueue:{make:s(function(o){var e=es.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 mp<"u"&&(mp.exports=es)});var Iu=C(na=>{"use strict";var V=Sn(),Su=fu(),bu=du(),Cu=uu(),Nu=gu(),ts=fp(),xc=vn(),Qh=hu();function vu(o){return unescape(encodeURIComponent(o)).length}s(vu,"getStringByteLength");function os(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(os,"getSegments");function Ru(o){let e=os(ts.NUMERIC,V.NUMERIC,o),t=os(ts.ALPHANUMERIC,V.ALPHANUMERIC,o),n,r;return xc.isKanjiModeEnabled()?(n=os(ts.BYTE,V.BYTE,o),r=os(ts.KANJI,V.KANJI,o)):(n=os(ts.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(Ru,"getSegmentsFromString");function gp(o,e){switch(e){case V.NUMERIC:return Su.getBitsLength(o);case V.ALPHANUMERIC:return bu.getBitsLength(o);case V.KANJI:return Nu.getBitsLength(o);case V.BYTE:return Cu.getBitsLength(o)}}s(gp,"getSegmentBitsLength");function Hh(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(Hh,"mergeSegments");function Uh(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:vu(n.data)}]);break;case V.BYTE:e.push([{data:n.data,mode:V.BYTE,length:vu(n.data)}])}}return e}s(Uh,"buildNodes");function Gh(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]=gp(t[S].lastCount+l.length,l.mode)-gp(t[S].lastCount,l.mode),t[S].lastCount+=l.length):(t[S]&&(t[S].lastCount=l.length),n[S][g]=gp(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(Gh,"buildGraph");function yu(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&&!xc.isKanjiModeEnabled()&&(t=V.BYTE),t){case V.NUMERIC:return new Su(o);case V.ALPHANUMERIC:return new bu(o);case V.KANJI:return new Nu(o);case V.BYTE:return new Cu(o)}}s(yu,"buildSingleSegment");na.fromArray=s(function(e){return e.reduce(function(t,n){return typeof n=="string"?t.push(yu(n,null)):n.data&&t.push(yu(n.data,n.mode)),t},[])},"fromArray");na.fromString=s(function(e,t){let n=Ru(e,xc.isKanjiModeEnabled()),r=Uh(n),i=Gh(r,t),a=Qh.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(Hh(c))},"fromString");na.rawSplit=s(function(e){return na.fromArray(Ru(e,xc.isKanjiModeEnabled()))},"rawSplit")});var Cp=C(Fu=>{"use strict";var Ac=vn(),hp=Cc(),qh=Ll(),Zh=Ql(),Yh=Hl(),Xh=ql(),Sp=Zl(),bp=rp(),Jh=Wl(),zc=iu(),_h=su(),Wh=Sn(),vp=Iu();function Kh(o,e){let t=o.size,n=Xh.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(Kh,"setupFinderPattern");function kh(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(kh,"setupTimingPattern");function $h(o,e){let t=Yh.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 ev(o,e){let t=o.size,n=zc.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(ev,"setupVersionInfo");function yp(o,e,t){let n=o.size,r=_h.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(yp,"setupFormatInfo");function tv(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(tv,"setupData");function ov(o,e,t){let n=new qh;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),Wh.getCharCountIndicator(f.mode,o)),f.write(n)});let r=Ac.getSymbolTotalCodewords(o),i=bp.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 iv(n,o,e)}s(ov,"createData");function iv(o,e,t){let n=Ac.getSymbolTotalCodewords(e),r=bp.getTotalCodewordsCount(e,t),i=n-r,a=bp.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 Jh(S),I=0,j=new Array(a),P=new Array(a),M=0,In=new Uint8Array(o.buffer);for(let er=0;er<a;er++){let Qc=er<f?g:h;j[er]=In.slice(I,I+Qc),P[er]=b.encode(j[er]),I+=Qc,M=Math.max(M,Qc)}let Xo=new Uint8Array(n),Je=0,Et,Jo;for(Et=0;Et<M;Et++)for(Jo=0;Jo<a;Jo++)Et<j[Jo].length&&(Xo[Je++]=j[Jo][Et]);for(Et=0;Et<S;Et++)for(Jo=0;Jo<a;Jo++)Xo[Je++]=P[Jo][Et];return Xo}s(iv,"createCodewords");function nv(o,e,t,n){let r;if(Array.isArray(o))r=vp.fromArray(o);else if(typeof o=="string"){let l=e;if(!l){let g=vp.rawSplit(o);l=zc.getBestVersionForData(g,t)}r=vp.fromString(o,l||40)}else throw new Error("Invalid data");let i=zc.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(`
|