import{b as Pe}from"./canvas@2.11.2-CVRTzJty.js";import{g as Ce,l as Re,u as Ee}from"./js-binary-schema-parser@2.0.3-D0akQrQ7.js";var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={},Jt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QRMath=e.QRUtil=e.QRMaskPattern=e.QRErrorCorrectLevel=e.QRCodeModel=void 0;function u(n,t,a){var s=p(t),r=n-1,i=0;switch(a){case e.QRErrorCorrectLevel.L:i=B[r][0];break;case e.QRErrorCorrectLevel.M:i=B[r][1];break;case e.QRErrorCorrectLevel.Q:i=B[r][2];break;case e.QRErrorCorrectLevel.H:i=B[r][3];break}return s<=i}function o(n,t){for(var a=1,s=p(n),r=0,i=B.length;rB.length)throw new Error("Too long data");return a}function p(n){var t=encodeURI(n).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(n)?3:0)}var v=function(){function n(t){this.mode=c.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;for(var a=[],s=0,r=this.data.length;s65536?(i[0]=240|(f&1835008)>>>18,i[1]=128|(f&258048)>>>12,i[2]=128|(f&4032)>>>6,i[3]=128|f&63):f>2048?(i[0]=224|(f&61440)>>>12,i[1]=128|(f&4032)>>>6,i[2]=128|f&63):f>128?(i[0]=192|(f&1984)>>>6,i[1]=128|f&63):i[0]=f,a.push(i)}this.parsedData=Array.prototype.concat.apply([],a),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return n.prototype.getLength=function(){return this.parsedData.length},n.prototype.write=function(t){for(var a=0,s=this.parsedData.length;a40)throw new Error("Invalid QR version: "+this.typeNumber);if(!u(this.typeNumber,t,this.errorCorrectLevel))throw new Error("Data is too long for QR version: "+this.typeNumber)}var a=new v(t);this.dataList.push(a),this.dataCache=void 0},n.prototype.isDark=function(t,a){if(t<0||this.moduleCount<=t||a<0||this.moduleCount<=a)throw new Error(t+","+a);return this.modules[t][a]},n.prototype.getModuleCount=function(){return this.moduleCount},n.prototype.make=function(){this.makeImpl(!1,this.getBestMaskPattern())},n.prototype.makeImpl=function(t,a){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var s=0;s=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,a)},n.prototype.setupPositionProbePattern=function(t,a){for(var s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(var r=-1;r<=7;r++)a+r<=-1||this.moduleCount<=a+r||(0<=s&&s<=6&&(r==0||r==6)||0<=r&&r<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=r&&r<=4?this.modules[t+s][a+r]=!0:this.modules[t+s][a+r]=!1)},n.prototype.getBestMaskPattern=function(){if(Number.isInteger(this.maskPattern)&&Object.values(e.QRMaskPattern).includes(this.maskPattern))return this.maskPattern;for(var t=0,a=0,s=0;s<8;s++){this.makeImpl(!0,s);var r=P.getLostPoint(this);(s==0||t>r)&&(t=r,a=s)}return a},n.prototype.setupTimingPattern=function(){for(var t=8;t>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=r}for(var s=0;s<18;s++){var r=!t&&(a>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=r}},n.prototype.setupTypeInfo=function(t,a){for(var s=this.errorCorrectLevel<<3|a,r=P.getBCHTypeInfo(s),i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=f:i<8?this.modules[i+1][8]=f:this.modules[this.moduleCount-15+i][8]=f}for(var i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=f:i<9?this.modules[8][15-i-1+1]=f:this.modules[8][15-i-1]=f}this.modules[this.moduleCount-8][8]=!t},n.prototype.mapData=function(t,a){for(var s=-1,r=this.moduleCount-1,i=7,f=0,l=this.moduleCount-1;l>0;l-=2)for(l==6&&l--;;){for(var d=0;d<2;d++)if(this.modules[r][l-d]==null){var m=!1;f>>i&1)==1);var _=P.getMask(a,r,l-d);_&&(m=!m),this.modules[r][l-d]=m,i--,i==-1&&(f++,i=7)}if(r+=s,r<0||this.moduleCount<=r){r-=s,s=-s;break}}},n.createData=function(t,a,s){for(var r=T.getRSBlocks(t,a),i=new E,f=0;fd*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+d*8+")");for(i.getLengthInBits()+4<=d*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=d*8||(i.put(n.PAD0,8),i.getLengthInBits()>=d*8));)i.put(n.PAD1,8);return n.createBytes(i,r)},n.createBytes=function(t,a){for(var s=0,r=0,i=0,f=new Array(a.length),l=new Array(a.length),d=0;d=0?h.get(L):0}}for(var R=0,y=0;y=0;)a^=n.G15<=0;)a^=n.G18<>>=1;return a},n.getPatternPosition=function(t){return n.PATTERN_POSITION_TABLE[t-1]},n.getMask=function(t,a,s){switch(t){case e.QRMaskPattern.PATTERN000:return(a+s)%2==0;case e.QRMaskPattern.PATTERN001:return a%2==0;case e.QRMaskPattern.PATTERN010:return s%3==0;case e.QRMaskPattern.PATTERN011:return(a+s)%3==0;case e.QRMaskPattern.PATTERN100:return(Math.floor(a/2)+Math.floor(s/3))%2==0;case e.QRMaskPattern.PATTERN101:return a*s%2+a*s%3==0;case e.QRMaskPattern.PATTERN110:return(a*s%2+a*s%3)%2==0;case e.QRMaskPattern.PATTERN111:return(a*s%3+(a+s)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},n.getErrorCorrectPolynomial=function(t){for(var a=new w([1],0),s=0;s5&&(s+=3+f-5)}for(var r=0;r=256;)t-=255;return n.EXP_TABLE[t]},n.EXP_TABLE=new Array(256),n.LOG_TABLE=new Array(256),n._constructor=function(){for(var t=0;t<8;t++)n.EXP_TABLE[t]=1<>>7-t%8&1)==1},n.prototype.put=function(t,a){for(var s=0;s>>a-s-1&1)==1)},n.prototype.getLengthInBits=function(){return this.length},n.prototype.putBit=function(t){var a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),t&&(this.buffer[a]|=128>>>this.length%8),this.length++},n}(),B=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]})(Jt);var It={},pe={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.deinterlace=void 0;Ft.deinterlace=function(e,u){for(var o=new Array(e.length),p=e.length/u,v=function(T,E){var B=e.slice(E*u,(E+1)*u);o.splice.apply(o,[T*u,u].concat(B))},g=[0,4,2,1],c=[8,8,4,2],P=0,b=0;b<4;b++)for(var w=g[b];w>=w,d-=w,n>c||n==T)break;if(n==P){w=a+1,b=(1<P;)f[_++]=i[n],n=r[n];m=i[n]&255,f[_++]=m,c>Zt,Ae=Wt<>3,Xt=6,Le=1<>3);var r,i;for(r=0;r>=rt,o[r][1]>>=rt,o[r][2]>>=rt,o[r][3]=r}function w(r,i,f,l,d){o[i][0]-=r*(o[i][0]-f)/Tt,o[i][1]-=r*(o[i][1]-l)/Tt,o[i][2]-=r*(o[i][2]-d)/Tt}function T(r,i,f,l,d){for(var m=Math.abs(i-r),_=Math.min(i+r,Q),y=i+1,D=i-1,M=1,h,L;y<_||D>m;)L=c[M++],y<_&&(h=o[y++],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-d)/lt),D>m&&(h=o[D--],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-d)/lt)}function E(r,i,f){var l=2147483647,d=l,m=-1,_=m,y,D,M,h,L;for(y=0;y>me-rt),h>Zt,g[y]-=L,v[y]+=L<>1,i=_+1;i>1,i=_+1;i<256;i++)p[i]=le}function n(r,i,f){for(var l,d,m,_=1e3,y=-1,D=p[i],M=D-1;D=0;)D=_?D=Q:(D++,m<0&&(m=-m),l=d[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=d[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=d[3])))),M>=0&&(d=o[M],m=i-d[1],m>=_?M=-1:(M--,m<0&&(m=-m),l=d[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=d[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=d[3]))));return y}function t(){var r,i=e.length,f=30+(u-1)/3,l=i/(3*u),d=~~(l/Te),m=Tt,_=ke,y=_>>Xt;for(y<=1&&(y=0),r=0;r=i&&(A-=i),r++,d===0&&(d=1),r%d===0)for(m-=m/f,_-=_/Ie,y=_>>Xt,y<=1&&(y=0),R=0;R=254&&D(A)}function d(R){m(bt),E=a+2,n=!0,L(a,R)}function m(R){for(var A=0;A=0){Z=q-F,F===0&&(Z=1);do if((F-=Z)<0&&(F+=q),c[F]===C){j=P[F];continue t}while(c[F]>=0)}L(j,A),j=Y,E<1<0&&(R.writeByte(T),R.writeBytes(g,0,T),T=0)}function M(R){return(1<0?b|=R<=8;)l(b&255,A),b>>=8,w-=8;if((E>B||n)&&(n?(B=M(f=t),n=!1):(++f,f==Dt?B=1<0;)l(b&255,A),b>>=8,w-=8;D(A)}}this.encode=y}var Ge=Ne,Ue=Oe,He=Ge;function G(){this.page=-1,this.pages=[],this.newPage()}G.pageSize=4096;G.charMap={};for(var At=0;At<256;At++)G.charMap[At]=String.fromCharCode(At);G.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(G.pageSize),this.cursor=0};G.prototype.getData=function(){for(var e="",u=0;u=G.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=e};G.prototype.writeUTFBytes=function(e){for(var u=e.length,o=0;o=0&&(this.dispose=e)};I.prototype.setRepeat=function(e){this.repeat=e};I.prototype.setTransparent=function(e){this.transparent=e};I.prototype.addFrame=function(e){this.image=e,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),this.globalPalette===!0&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),!this.firstFrame&&!this.globalPalette&&this.writePalette(),this.writePixels(),this.firstFrame=!1};I.prototype.finish=function(){this.out.writeByte(59)};I.prototype.setQuality=function(e){e<1&&(e=1),this.sample=e};I.prototype.setDither=function(e){e===!0&&(e="FloydSteinberg"),this.dither=e};I.prototype.setGlobalPalette=function(e){this.globalPalette=e};I.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};I.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};I.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new Ue(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,this.transparent!==null&&(this.transIndex=this.findClosest(this.transparent,!0))};I.prototype.indexPixels=function(e){var u=this.pixels.length/3;this.indexedPixels=new Uint8Array(u);for(var o=0,p=0;p=0&&y+T=0&&D+w>16,(e&65280)>>8,e&255,u)};I.prototype.findClosestRGB=function(e,u,o,p){if(this.colorTab===null)return-1;if(this.neuQuant&&!p)return this.neuQuant.lookupRGB(e,u,o);for(var v=0,g=256*256*256,c=this.colorTab.length,P=0,b=0;P=0&&(u=this.dispose&7),u<<=2,this.out.writeByte(0|u|0|e),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};I.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)};I.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)};I.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)};I.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var e=3*256-this.colorTab.length,u=0;u>8&255)};I.prototype.writePixels=function(){var e=new He(this.width,this.height,this.indexedPixels,this.colorDepth);e.encode(this.out)};I.prototype.stream=function(){return this.out};var ze=I,kt=N&&N.__assign||function(){return kt=Object.assign||function(e){for(var u,o=1,p=arguments.length;o0&&g[g.length-1])&&(w[0]===6||w[0]===2)){o=0;continue}if(w[0]===3&&(!g||w[1]>g[0]&&w[1]1)throw new Error("dotScale should be in range (0, 1].");o.components.data.scale=o.dotScale,o.components.timing.scale=o.dotScale,o.components.alignment.scale=o.dotScale}this.options=o,this.canvas=J.createCanvas(u.size,u.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new Mt.QRCodeModel(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}return e.prototype.draw=function(){var u=this;return new Promise(function(o){return u._draw().then(o)})},e.prototype._clear=function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)},e._prepareRoundedCornerClip=function(u,o,p,v,g,c){u.beginPath(),u.moveTo(o,p),u.arcTo(o+v,p,o+v,p+g,c),u.arcTo(o+v,p+g,o,p+g,c),u.arcTo(o,p+g,o,p,c),u.arcTo(o,p,o+v,p,c),u.closePath()},e._getAverageRGB=function(u){var o=5,p={r:0,g:0,b:0},v,g,c=-4,P={r:0,g:0,b:0},b=0;g=u.naturalHeight||u.height,v=u.naturalWidth||u.width;var w=J.createCanvas(v,g),T=w.getContext("2d");if(!T)return p;T.drawImage(u,0,0);var E;try{E=T.getImageData(0,0,v,g)}catch{return p}for(;(c+=o*4)200||E.data[c+1]>200||E.data[c+2]>200||(++b,P.r+=E.data[c],P.g+=E.data[c+1],P.b+=E.data[c+2]);return P.r=~~(P.r/b),P.g=~~(P.g/b),P.b=~~(P.b/b),P},e._drawDot=function(u,o,p,v,g,c){g===void 0&&(g=0),c===void 0&&(c=1),u.fillRect((o+g)*v,(p+g)*v,c*v,c*v)},e._drawAlignProtector=function(u,o,p,v){u.clearRect((o-2)*v,(p-2)*v,5*v,5*v),u.fillRect((o-2)*v,(p-2)*v,5*v,5*v)},e._drawAlign=function(u,o,p,v,g,c,P,b){g===void 0&&(g=0),c===void 0&&(c=1);var w=u.fillStyle;u.fillStyle=P,new Array(4).fill(0).map(function(T,E){e._drawDot(u,o-2+E,p-2,v,g,c),e._drawDot(u,o+2,p-2+E,v,g,c),e._drawDot(u,o+2-E,p+2,v,g,c),e._drawDot(u,o-2,p+2-E,v,g,c)}),e._drawDot(u,o,p,v,g,c),b||(u.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map(function(T,E){e._drawDot(u,o-1+E,p-1,v,g,c),e._drawDot(u,o+1,p-1+E,v,g,c),e._drawDot(u,o+1-E,p+1,v,g,c),e._drawDot(u,o-1,p+1-E,v,g,c)})),u.fillStyle=w},e.prototype._draw=function(){var u,o,p,v,g,c,P,b,w,T,E,B,n,t,a,s,r,i,f;return je(this,void 0,void 0,function(){var l,d,m,_,y,D,M,h,L,R,A,C,Y,F,j,Z,q,K,ft,ut,ht,k,W,ct,yt,x,at,xt,O,S,Ot,nt,$t,X,k,St,Nt,Vt,U,Yt,k,$,H,z,_t,Gt,k,Ut,qt,Ht,te,k,$,H,z,ee,vt,tt,gt,et,dt,Pt,re,V,ot,pt,st,zt,Ct,ie,ae,jt,ne;return Ke(this,function(mt){switch(mt.label){case 0:if(l=(u=this.qrCode)===null||u===void 0?void 0:u.moduleCount,d=this.options.size,m=this.options.margin,(m<0||m*2>=d)&&(m=0),_=Math.ceil(m),y=d-2*m,D=this.options.whiteMargin,M=this.options.backgroundDimming,h=Math.ceil(y/l),L=h*l,R=L+2*_,A=J.createCanvas(R,R),C=A.getContext("2d"),this._clear(),C.save(),C.translate(_,_),Y=J.createCanvas(R,R),F=Y.getContext("2d"),j=null,Z=[],!this.options.gifBackground)return[3,1];if(q=ge.parseGIF(this.options.gifBackground),j=q,Z=ge.decompressFrames(q,!0),this.options.autoColor){for(K=0,ft=0,ut=0,ht=0,k=0;k200||W[1]>200||W[2]>200)&&(W[0]===0&&W[1]===0&&W[2]===0||(ht++,K+=W[0],ft+=W[1],ut+=W[2]));K=~~(K/ht),ft=~~(ft/ht),ut=~~(ut/ht),this.options.colorDark="rgb("+K+","+ft+","+ut+")"}return[3,4];case 1:return this.options.backgroundImage?[4,J.loadImage(this.options.backgroundImage)]:[3,3];case 2:return ct=mt.sent(),this.options.autoColor&&(yt=e._getAverageRGB(ct),this.options.colorDark="rgb("+yt.r+","+yt.g+","+yt.b+")"),F.drawImage(ct,0,0,ct.width,ct.height,0,0,R,R),F.rect(0,0,R,R),F.fillStyle=M,F.fill(),[3,4];case 3:F.rect(0,0,R,R),F.fillStyle=this.options.colorLight,F.fill(),mt.label=4;case 4:for(x=Mt.QRUtil.getPatternPosition(this.qrCode.typeNumber),at=((p=(o=this.options.components)===null||o===void 0?void 0:o.data)===null||p===void 0?void 0:p.scale)||Lt,xt=(1-at)*.5,O=0;O=l-8)||S>=l-8&&O<8,$t=O==6&&S>=8&&S<=l-8||S==6&&O>=8&&O<=l-8,X=nt||$t,k=1;k=x[k]-2&&O<=x[k]+2&&S>=x[k]-2&&S<=x[k]+2;St=S*h+(X?0:xt*h),Nt=O*h+(X?0:xt*h),C.strokeStyle=Ot?this.options.colorDark:this.options.colorLight,C.lineWidth=.5,C.fillStyle=Ot?this.options.colorDark:"rgba(255, 255, 255, 0.6)",x.length===0?X||C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h):(Vt=S=l-4-5&&O=l-4-5,!X&&!Vt&&C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h))}if(U=x[x.length-1],Yt="rgba(255, 255, 255, 0.6)",C.fillStyle=Yt,C.fillRect(0,0,8*h,8*h),C.fillRect(0,(l-8)*h,8*h,8*h),C.fillRect((l-8)*h,0,8*h,8*h),!((g=(v=this.options.components)===null||v===void 0?void 0:v.timing)===null||g===void 0)&&g.protectors&&(C.fillRect(8*h,6*h,(l-8-8)*h,h),C.fillRect(6*h,8*h,h,(l-8-8)*h)),!((P=(c=this.options.components)===null||c===void 0?void 0:c.cornerAlignment)===null||P===void 0)&&P.protectors&&e._drawAlignProtector(C,U,U,h),!((w=(b=this.options.components)===null||b===void 0?void 0:b.alignment)===null||w===void 0)&&w.protectors){for(k=0;k=1)&&(vt=.2),tt<0&&(tt=0),gt<0&&(gt=0),et=L*vt,dt=.5*(R-et),Pt=dt,C.restore(),C.fillStyle="#FFFFFF",C.save(),e._prepareRoundedCornerClip(C,dt-tt,Pt-tt,et+2*tt,et+2*tt,gt+tt),C.clip(),re=C.globalCompositeOperation,C.globalCompositeOperation="destination-out",C.fill(),C.globalCompositeOperation=re,C.restore(),C.save(),e._prepareRoundedCornerClip(C,dt,Pt,et,et,gt),C.clip(),C.drawImage(ee,dt,Pt,et,et),C.restore(),C.save(),C.translate(_,_),mt.label=6;case 6:if(j){if(Z.forEach(function(it){V||(V=new Je.default(d,d),V.setDelay(it.delay),V.setRepeat(0));var Rt=it.dims,Et=Rt.width,Bt=Rt.height;ot||(ot=J.createCanvas(Et,Bt),pt=ot.getContext("2d"),pt.rect(0,0,ot.width,ot.height),pt.fillStyle="#ffffff",pt.fill()),(!st||!Ct||Et!==st.width||Bt!==st.height)&&(st=J.createCanvas(Et,Bt),zt=st.getContext("2d"),Ct=zt.createImageData(Et,Bt)),Ct.data.set(it.patch),zt.putImageData(Ct,0,0),pt.drawImage(st,it.dims.left,it.dims.top);var oe=J.createCanvas(R,R),wt=oe.getContext("2d");wt.drawImage(ot,0,0,R,R),wt.rect(0,0,R,R),wt.fillStyle=M,wt.fill(),wt.drawImage(A,0,0,R,R);var Kt=J.createCanvas(d,d),se=Kt.getContext("2d");se.drawImage(oe,0,0,d,d),V.addFrame(se.getImageData(0,0,Kt.width,Kt.height).data)}),!V)throw new Error("No frames.");return V.finish(),de(this.canvas)?(ie=V.stream().toFlattenUint8Array(),ae=ie.reduce(function(it,Rt){return it+String.fromCharCode(Rt)},""),[2,Promise.resolve("data:image/gif;base64,"+window.btoa(ae))]):[2,Promise.resolve(Buffer.from(V.stream().toFlattenUint8Array()))]}else return F.drawImage(A,0,0,R,R),C.drawImage(Y,-_,-_,R,R),jt=J.createCanvas(d,d),ne=jt.getContext("2d"),ne.drawImage(A,0,0,d,d),this.canvas=jt,de(this.canvas)?[2,Promise.resolve(this.canvas.toDataURL())]:[2,Promise.resolve(this.canvas.toBuffer())]}})})},e.CorrectLevel=Mt.QRErrorCorrectLevel,e.defaultComponentOptions={data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}},e.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"#ffffff",correctLevel:Mt.QRErrorCorrectLevel.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:e.defaultComponentOptions,autoColor:!0},e}();It.AwesomeQR=We;function de(e){try{return e instanceof HTMLElement}catch{return typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}}(function(e){var u=N&&N.__createBinding||(Object.create?function(v,g,c,P){P===void 0&&(P=c),Object.defineProperty(v,P,{enumerable:!0,get:function(){return g[c]}})}:function(v,g,c,P){P===void 0&&(P=c),v[P]=g[c]}),o=N&&N.__exportStar||function(v,g){for(var c in v)c!=="default"&&!g.hasOwnProperty(c)&&u(g,v,c)};Object.defineProperty(e,"__esModule",{value:!0}),o(Jt,e);var p=It;Object.defineProperty(e,"AwesomeQR",{enumerable:!0,get:function(){return p.AwesomeQR}})})(Be);export{N as c,Ve as g,Be as l};