MCPcopy Create free account
hub / github.com/ChinaSiro/claude-code-sourcemap / QEK

Function QEK

package/cli.js:6122–6122  ·  view source on GitHub ↗
(q,K,_)

Source from the content-addressed store, hash-verified

6120 Suggested mode is: `+IA.toString(z));if(_===IA.KANJI&&!yF8.isKanjiModeEnabled())_=IA.BYTE;switch(_){case IA.NUMERIC:return new xEK(q);case IA.ALPHANUMERIC:return new IEK(q);case IA.KANJI:return new mEK(q);case IA.BYTE:return new uEK(q)}}sPY.fromArray=function(K){return K.reduce(function(_,z){if(typeof z==="string")_.push(bEK(z,null));else if(z.data)_.push(bEK(z.data,z.mode));return _},[])};sPY.fromString=function(K,_){let z=pEK(K,yF8.isKanjiModeEnabled()),Y=oPY(z),$=aPY(Y,_),A=iPY.find_path($.map,"start","end"),O=[];for(let w=1;w<A.length-1;w++)O.push($.table[A[w]].node);return sPY.fromArray(rPY(O))};sPY.rawSplit=function(K){return sPY.fromArray(pEK(K,yF8.isKanjiModeEnabled()))}});var kK7=m((WWY)=>{var LF8=V56(),fK7=TF8(),qWY=ayK(),KWY=tyK(),_WY=qEK(),zWY=KEK(),TK7=OEK(),vK7=KK7(),YWY=XEK(),EF8=GEK(),$WY=vEK(),AWY=y56(),ZK7=BEK();function OWY(q,K){let _=q.size,z=zWY.getPositions(K);for(let Y=0;Y<z.length;Y++){let $=z[Y][0],A=z[Y][1];for(let O=-1;O<=7;O++){if($+O<=-1||_<=$+O)continue;for(let w=-1;w<=7;w++){if(A+w<=-1||_<=A+w)continue;if(O>=0&&O<=6&&(w===0||w===6)||w>=0&&w<=6&&(O===0||O===6)||O>=2&&O<=4&&w>=2&&w<=4)q.set($+O,A+w,!0,!0);else q.set($+O,A+w,!1,!0)}}}}function wWY(q){let K=q.size;for(let _=8;_<K-8;_++){let z=_%2===0;q.set(_,6,z,!0),q.set(6,_,z,!0)}}function jWY(q,K){let _=_WY.getPositions(K);for(let z=0;z<_.length;z++){let Y=_[z][0],$=_[z][1];for(let A=-2;A<=2;A++)for(let O=-2;O<=2;O++)if(A===-2||A===2||O===-2||O===2||A===0&&O===0)q.set(Y+A,$+O,!0,!0);else q.set(Y+A,$+O,!1,!0)}}function HWY(q,K){let _=q.size,z=EF8.getEncodedBits(K),Y,$,A;for(let O=0;O<18;O++)Y=Math.floor(O/3),$=O%3+_-8-3,A=(z>>O&1)===1,q.set(Y,$,A,!0),q.set($,Y,A,!0)}function GK7(q,K,_){let z=q.size,Y=$WY.getEncodedBits(K,_),$,A;for($=0;$<15;$++){if(A=(Y>>$&1)===1,$<6)q.set($,8,A,!0);else if($<8)q.set($+1,8,A,!0);else q.set(z-15+$,8,A,!0);if($<8)q.set(8,z-$-1,A,!0);else if($<9)q.set(8,15-$-1+1,A,!0);else q.set(8,15-$-1,A,!0)}q.set(z-8,8,1,!0)}function JWY(q,K){let _=q.size,z=-1,Y=_-1,$=7,A=0;for(let O=_-1;O>0;O-=2){if(O===6)O--;while(!0){for(let w=0;w<2;w++)if(!q.isReserved(Y,O-w)){let j=!1;if(A<K.length)j=(K[A]>>>$&1)===1;if(q.set(Y,O-w,j),$--,$===-1)A++,$=7}if(Y+=z,Y<0||_<=Y){Y-=z,z=-z;break}}}}function MWY(q,K,_){let z=new qWY;_.forEach(function(w){z.put(w.mode.bit,4),z.put(w.getLength(),AWY.getCharCountIndicator(w.mode,q)),w.write(z)});let Y=LF8.getSymbolTotalCodewords(q),$=vK7.getTotalCodewordsCount(q,K),A=(Y-$)*8;if(z.getLengthInBits()+4<=A)z.put(0,4);while(z.getLengthInBits()%8!==0)z.putBit(0);let O=(A-z.getLengthInBits())/8;for(let w=0;w<O;w++)z.put(w%2?17:236,8);return XWY(z,q,K)}function XWY(q,K,_){let z=LF8.getSymbolTotalCodewords(K),Y=vK7.getTotalCodewordsCount(K,_),$=z-Y,A=vK7.getBlocksCount(K,_),O=z%A,w=A-O,j=Math.floor(z/A),H=Math.floor($/A),J=H+1,M=j-H,X=new YWY(M),P=0,W=Array(A),D=Array(A),f=0,G=new Uint8Array(q.buffer);for(let E=0;E<A;E++){let S=E<w?H:J;W[E]=G.slice(P,P+S),D[E]=X.encode(W[E]),P+=S,f=Math.max(f,S)}let Z=new Uint8Array(z),T=0,v,V;for(v=0;v<f;v++)for(V=0;V<A;V++)if(v<W[V].length)Z[T++]=W[V][v];for(v=0;v<M;v++)for(V=0;V<A;V++)Z[T++]=D[V][v];return Z}function PWY(q,K,_,z){let Y;if(Array.isArray(q))Y=ZK7.fromArray(q);else if(typeof q==="string"){let j=K;if(!j){let H=ZK7.rawSplit(q);j=EF8.getBestVersionForData(H,_)}Y=ZK7.fromString(q,j||40)}else throw Error("Invalid data");let $=EF8.getBestVersionForData(Y,_);if(!$)throw Error("The amount of data is too big to be stored in a QR Code");if(!K)K=$;else if(K<$)throw Error(`
6121The chosen QR Code version cannot contain this amount of data.
6122Minimum version required to store current data is: `+$+`.
6123`);let A=MWY(K,_,Y),O=LF8.getSymbolSize(K),w=new KWY(O);if(OWY(w,K),wWY(w),jWY(w,K),GK7(w,_,0),K>=7)HWY(w,K);if(JWY(w,A),isNaN(z))z=TK7.getBestMask(w,GK7.bind(null,w,_));return TK7.applyMask(z,w),GK7(w,_,z),{modules:w,version:K,errorCorrectionLevel:_,maskPattern:z,segments:Y}}WWY.create=function(K,_){if(typeof K>"u"||K==="")throw Error("No input text");let z=fK7.M,Y,$;if(typeof _<"u"){if(z=fK7.from(_.errorCorrectionLevel,fK7.M),Y=EF8.from(_.version),$=TK7.from(_.maskPattern),_.toSJISFunc)LF8.setToSJISFunction(_.toSJISFunc)}return PWY(K,Y,z,$)}});var VK7=m((CJ2,FEK)=>{var fWY=U6("util"),gEK=U6("stream"),kp=FEK.exports=function(){gEK.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};fWY.inherits(kp,gEK);kp.prototype.read=function(q,K){this._reads.push({length:Math.abs(q),allowLess:q<0,func:K}),process.nextTick(function(){if(this._process(),this._paused&&this._reads&&this._reads.length>0)this._paused=!1,this.emit("drain")}.bind(this))};kp.prototype.write=function(q,K){if(!this.writable)return this.emit("error",Error("Stream not writable")),!1;let _;if(Buffer.isBuffer(q))_=q;else _=Buffer.from(q,K||this._encoding);if(this._buffers.push(_),this._buffered+=_.length,this._process(),this._reads&&this._reads.length===0)this._paused=!0;return this.writable&&!this._paused};kp.prototype.end=function(q,K){if(q)this.write(q,K);if(this.writable=!1,!this._buffers)return;if(this._buffers.length===0)this._end();else this._buffers.push(null),this._process()};kp.prototype.destroySoon=kp.prototype.end;kp.prototype._end=function(){if(this._reads.length>0)this.emit("error",Error("Unexpected end of input"));this.destroy()};kp.prototype.destroy=function(){if(!this._buffers)return;this.writable=!1,this._reads=null,this._buffers=null,this.emit("close")};kp.prototype._processReadAllowingLess=function(q){this._reads.shift();let K=this._buffers[0];if(K.length>q.length)this._buffered-=q.length,this._buffers[0]=K.slice(q.length),q.func.call(this,K.slice(0,q.length));else this._buffered-=K.length,this._buffers.shift(),q.func.call(this,K)};kp.prototype._processRead=function(q){this._reads.shift();let K=0,_=0,z=Buffer.alloc(q.length);while(K<q.length){let Y=this._buffers[_++],$=Math.min(Y.length,q.length-K);if(Y.copy(z,K,0,$),K+=$,$!==Y.length)this._buffers[--_]=Y.slice($)}if(_>0)this._buffers.splice(0,_);this._buffered-=q.length,q.func.call(this,z)};kp.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let q=this._reads[0];if(q.allowLess)this._processReadAllowingLess(q);else if(this._buffered>=q.length)this._processRead(q);else break}if(this._buffers&&!this.writable)this._end()}catch(q){this.emit("error",q)}}});var NK7=m((ZWY)=>{var L56=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];ZWY.getImagePasses=function(q,K){let _=[],z=q%8,Y=K%8,$=(q-z)/8,A=(K-Y)/8;for(let O=0;O<L56.length;O++){let w=L56[O],j=$*w.x.length,H=A*w.y.length;for(let J=0;J<w.x.length;J++)if(w.x[J]<z)j++;else break;for(let J=0;J<w.y.length;J++)if(w.y[J]<Y)H++;else break;if(j>0&&H>0)_.push({width:j,height:H,index:O})}return _};ZWY.getInterlaceIterator=function(q){return function(K,_,z){let Y=K%L56[z].x.length,$=(K-Y)/L56[z].x.length*8+L56[z].x[Y],A=_%L56[z].y.length,O=(_-A)/L56[z].y.length*8+L56[z].y[A];return $*4+O*q*4}}});var yK7=m((xJ2,UEK)=>{UEK.exports=function(K,_,z){let Y=K+_-z,$=Math.abs(Y-K),A=Math.abs(Y-_),O=Math.abs(Y-z);if($<=A&&$<=O)return K;if(A<=O)return _;return z}});var EK7=m((IJ2,dEK)=>{var vWY=NK7(),kWY=yK7();function QEK(q,K,_){let z=q*K;if(_!==8)z=Math.ceil(z/(8/_));return z}var jS6=dEK.exports=function(q,K){let{width:_,height:z,interlace:Y,bpp:$,depth:A}=q;if(this.read=K.read,this.write=K.write,this.complete=K.complete,this._imageIndex=0,this._images=[],Y){let O=vWY.getImagePasses(_,z);for(let w=0;w<O.length;w++)this._images.push({byteWidth:QEK(O[w].width,$,A),height:O[w].height,lineIndex:0})}else this._images.push({byteWidth:QEK(_,$,A),height:z,lineIndex:0});if(A===8)this._xComparison=$;else if(A===16)this._xComparison=$*2;else this._xComparison=1};jS6.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};jS6.prototype._unFilterType1=function(q,K,_){let z=this._xComparison,Y=z-1;for(let $=0;$<_;$++){let A=q[1+$],O=$>Y?K[$-z]:0;K[$]=A+O}};jS6.prototype._unFilterType2=function(q,K,_){let z=this._lastLine;for(let Y=0;Y<_;Y++){let $=q[1+Y],A=z?z[Y]:0;K[Y]=$+A}};jS6.prototype._unFilterType3=function(q,K,_){let z=this._xComparison,Y=z-1,$=this._lastLine;for(let A=0;A<_;A++){let O=q[1+A],w=$?$[A]:0,j=A>Y?K[A-z]:0,H=Math.floor((j+w)/2);K[A]=O+H}};jS6.prototype._unFilterType4=function(q,K,_){let z=this._xComparison,Y=z-1,$=this._lastLine;for(let A=0;A<_;A++){let O=q[1+A],w=$?$[A]:0,j=A>Y?K[A-z]:0,H=A>Y&&$?$[A-z]:0,J=kWY(j,w,H);K[A]=O+J}};jS6.prototype._reverseFilterLine=function(q){let K=q[0],_,z=this._images[this._imageIndex],Y=z.byteWidth;if(K===0)_=q.slice(1,Y+1);else switch(_=Buffer.alloc(Y),K){case 1:this._unFilterType1(q,_,Y);break;case 2:this._unFilterType2(q,_,Y);break;case 3:this._unFilterType3(q,_,Y);break;case 4:this._unFilterType4(q,_,Y);break;default:throw Error("Unrecognised filter type - "+K)}if(this.write(_),z.lineIndex++,z.lineIndex>=z.height)this._lastLine=null,this._imageIndex++,z=this._images[this._imageIndex];else this._lastLine=_;if(z)this.read(z.byteWidth+1,this._reverseFilterLine.bind(this));else this._lastLine=null,this.complete()}});var nEK=m((uJ2,lEK)=>{var VWY=U6("util"),cEK=VK7(),NWY=EK7(),yWY=lEK.exports=function(q){cEK.call(this);let K=[],_=this;this._filter=new NWY(q,{read:this.read.bind(this),write:function(z){K.push(z)},complete:function(){_.emit("complete",Buffer.concat(K))}}),this._filter.start()};VWY.inherits(yWY,cEK)});var HS6=m((mJ2,iEK)=>{iEK.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var hK7=m((pJ2,rEK)=>{var LK7=[];(function(){for(let q=0;q<256;q++){let K=q;for(let _=0;_<8;_++)if(K&1)K=3988292384^K>>>1;else K=K>>>1;LK7[q]=K}})();var RK7=rEK.exports=function(){this._crc=-1};RK7.prototype.write=function(q){for(let K=0;K<q.length;K++)this._crc=LK7[(this._crc^q[K])&255]^this._crc>>>8;return!0};RK7.prototype.crc32=function(){return this._crc^-1};RK7.crc32=function(q){let K=-1;for(let _=0;_<q.length;_++)K=LK7[(K^q[_])&255]^K>>>8;return K^-1}});var SK7=m((BJ2,oEK)=>{var zW=HS6(),EWY=hK7(),nD=oEK.exports=function(q,K){this._options=q,q.checkCRC=q.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[zW.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[zW.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[zW.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[zW.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[zW.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[zW.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=K.read,this.error=K.error,this.metadata=K.metadata,this.gamma=K.gamma,this.transColor=K.transColor,this.palette=K.palette,this.parsed=K.parsed,this.inflateData=K.inflateData,this.finished=K.finished,this.simpleTransparency=K.simpleTransparency,this.headersFinished=K.headersFinished||function(){}};nD.prototype.start=function(){this.read(zW.PNG_SIGNATURE.length,this._parseSignature.bind(this))};nD.prototype._parseSignature=function(q){let K=zW.PNG_SIGNATURE;for(let _=0;_<K.length;_++)if(q[_]!==K[_]){this.error(Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};nD.prototype._parseChunkBegin=function(q){let K=q.readUInt32BE(0),_=q.readUInt32BE(4),z="";for(let $=4;$<8;$++)z+=String.fromCharCode(q[$]);let Y=Boolean(q[4]&32);if(!this._hasIHDR&&_!==zW.TYPE_IHDR){this.error(Error("Expected IHDR on beggining"));return}if(this._crc=new EWY,this._crc.write(Buffer.from(z)),this._chunks[_])return this._chunks[_](K);if(!Y){this.error(Error("Unsupported critical chunk type "+z));return}this.read(K+4,this._skipChunk.bind(this))};nD.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};nD.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};nD.prototype._parseChunkEnd=function(q){let K=q.readInt32BE(0),_=this._crc.crc32();if(this._options.checkCRC&&_!==K){this.error(Error("Crc error - "+K+" - "+_));return}if(!this._hasIEND)this.read(8,this._parseChunkBegin.bind(this))};nD.prototype._handleIHDR=function(q){this.read(q,this._parseIHDR.bind(this))};nD.prototype._parseIHDR=function(q){this._crc.write(q);let K=q.readUInt32BE(0),_=q.readUInt32BE(4),z=q[8],Y=q[9],$=q[10],A=q[11],O=q[12];if(z!==8&&z!==4&&z!==2&&z!==1&&z!==16){this.error(Error("Unsupported bit depth "+z));return}if(!(Y in zW.COLORTYPE_TO_BPP_MAP)){this.error(Error("Unsupported color type"));return}if($!==0){this.error(Error("Unsupported compression method"));return}if(A!==0){this.error(Error("Unsupported filter method"));return}if(O!==0&&O!==1){this.error(Error("Unsupported interlace method"));return}this._colorType=Y;let w=zW.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:K,height:_,depth:z,interlace:Boolean(O),palette:Boolean(Y&zW.COLORTYPE_PALETTE),color:Boolean(Y&zW.COLORTYPE_COLOR),alpha:Boolean(Y&zW.COLORTYPE_ALPHA),bpp:w,colorType:Y}),this._handleChunkEnd()};nD.prototype._handlePLTE=function(q){this.read(q,this._parsePLTE.bind(this))};nD.prototype._parsePLTE=function(q){this._crc.write(q);let K=Math.floor(q.length/3);for(let _=0;_<K;_++)this._palette.push([q[_*3],q[_*3+1],q[_*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};nD.prototype._handleTRNS=function(q){this.simpleTransparency(),this.read(q,this._parseTRNS.bind(this))};nD.prototype._parseTRNS=function(q){if(this._crc.write(q),this._colorType===zW.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(Error("Transparency chunk must be after palette"));return}if(q.length>this._palette.length){this.error(Error("More transparent colors than palette size"));return}for(let K=0;K<q.length;K++)this._palette[K][3]=q[K];this.palette(this._palette)}if(this._colorType===zW.COLORTYPE_GRAYSCALE)this.transColor([q.readUInt16BE(0)]);if(this._colorType===zW.COLORTYPE_COLOR)this.transColor([q.readUInt16BE(0),q.readUInt16BE(2),q.readUInt16BE(4)]);this._handleChunkEnd()};nD.prototype._handleGAMA=function(q){this.read(q,this._parseGAMA.bind(this))};nD.prototype._parseGAMA=function(q){this._crc.write(q),this.gamma(q.readUInt32BE(0)/zW.GAMMA_DIVISION),this._handleChunkEnd()};nD.prototype._handleIDAT=function(q){if(!this._emittedHeadersFinished)this._emittedHeadersFinished=!0,this.headersFinished();this.read(-q,this._parseIDAT.bind(this,q))};nD.prototype._parseIDAT=function(q,K){if(this._crc.write(K),this._colorType===zW.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw Error("Expected palette not found");this.inflateData(K);let _=q-K.length;if(_>0)this._handleIDAT(_);else this._handleChunkEnd()};nD.prototype._handleIEND=function(q){this.read(q,this._parseIEND.bind(this))};nD.prototype._parseIEND=function(q){if(this._crc.write(q),this._hasIEND=!0,this._handleChunkEnd(),this.finished)this.finished()}});var CK7=m((bWY)=>{var aEK=NK7(),LWY=[function(){},function(q,K,_,z){if(z===K.length)throw Error("Ran out of data");let Y=K[z];q[_]=Y,q[_+1]=Y,q[_+2]=Y,q[_+3]=255},function(q,K,_,z){if(z+1>=K.length)throw Error("Ran out of data");let Y=K[z];q[_]=Y,q[_+1]=Y,q[_+2]=Y,q[_+3]=K[z+1]},function(q,K,_,z){if(z+2>=K.length)throw Error("Ran out of data");q[_]=K[z],q[_+1]=K[z+1],q[_+2]=K[z+2],q[_+3]=255},function(q,K,_,z){if(z+3>=K.length)throw Error("Ran out of data");q[_]=K[z],q[_+1]=K[z+1],q[_+2]=K[z+2],q[_+3]=K[z+3]}],RWY=[function(){},function(q,K,_,z){let Y=K[0];q[_]=Y,q[_+1]=Y,q[_+2]=Y,q[_+3]=z},function(q,K,_){let z=K[0];q[_]=z,q[_+1]=z,q[_+2]=z,q[_+3]=K[1]},function(q,K,_,z){q[_]=K[0],q[_+1]=K[1],q[_+2]=K[2],q[_+3]=z},function(q,K,_){q[_]=K[0],q[_+1]=K[1],q[_+2]=K[2],q[_+3]=K[3]}];function hWY(q,K){let _=[],z=0;function Y(){if(z===q.length)throw Error("Ran out of data");let $=q[z];z++;let A,O,w,j,H,J,M,X;switch(K){default:throw Error("unrecognised depth");case 16:M=q[z],z++,_.push(($<<8)+M);break;case 4:M=$&15,X=$>>4,_.push(X,M);break;case 2:H=$&3,J=$>>2&3,M=$>>4&3,X=$>>6&3,_.push(X,M,J,H);break;case 1:A=$&1,O=$>>1&1,w=$>>2&1,j=$>>3&1,H=$>>4&1,J=$>>5&1,M=$>>6&1,X=$>>7&1,_.push(X,M,J,H,j,w,O,A);break}}return{get:function($){while(_.length<$)Y();let A=_.slice(0,$);return _=_.slice($),A},resetAfterLine:function(){_.length=0},end:function(){if(z!==q.length)throw Error("extra data found")}}}function SWY(q,K,_,z,Y,$){let{width:A,height:O,index:w}=q;for(let j=0;j<O;j++)for(let H=0;H<A;H++){let J=_(H,j,w);LWY[z](K,Y,J,$),$+=z}return $}function CWY(q,K,_,z,Y,$){let{width:A,height:O,index:w}=q;for(let j=0;j<O;j++){for(let H=0;H<A;H++){let J=Y.get(z),M=_(H,j,w);RWY[z](K,J,M,$)}Y.resetAfterLine()}}bWY.dataToBitMap=function(q,K){let{width:_,height:z,depth:Y,bpp:$,interlace:A}=K,O;if(Y!==8)O=hWY(q,Y);let w;if(Y<=8)w=Buffer.alloc(_*z*4);else w=new Uint16Array(_*z*4);let j=Math.pow(2,Y)-1,H=0,J,M;if(A)J=aEK.getImagePasses(_,z),M=aEK.getInterlaceIterator(_,z);else{let X=0;M=function(){let P=X;return X+=4,P},J=[{width:_,height:z}]}for(let X=0;X<J.length;X++)if(Y===8)H=SWY(J[X],w,M,$,q,H);else CWY(J[X],w,M,$,O,j);if(Y===8){if(H!==q.length)throw Error("extra data found")}else O.end();return w}});var bK7=m((FJ2,sEK)=>{function IWY(q,K,_,z,Y){let $=0;for(let A=0;A<z;A++)for(let O=0;O<_;O++){let w=Y[q[$]];if(!w)throw Error("index "+q[$]+" not in palette");for(let j=0;j<4;j++)K[$+j]=w[j];$+=4}}function uWY(q,K,_,z,Y){let $=0;for(let A=0;A<z;A++)for(let O=0;O<_;O++){let w=!1;if(Y.length===1){if(Y[0]===q[$])w=!0}else if(Y[0]===q[$]&&Y[1]===q[$+1]&&Y[2]===q[$+2])w=!0;if(w)for(let j=0;j<4;j++)K[$+j]=0;$+=4}}function mWY(q,K,_,z,Y){let $=255,A=Math.pow(2,Y)-1,O=0;for(let w=0;w<z;w++)for(let j=0;j<_;j++){for(let H=0;H<4;H++)K[O+H]=Math.floor(q[O+H]*$/A+0.5);O+=4}}sEK.exports=function(q,K){let{depth:_,width:z,height:Y,colorType:$,transColor:A,palette:O}=K,w=q;if($===3)IWY(q,w,z,Y,O);else{if(A)uWY(q,w,z,Y,A);if(_!==8){if(_===16)w=Buffer.alloc(z*Y*4);mWY(q,w,z,Y,_)}}return w}});var qLK=m((UJ2,eEK)=>{var pWY=U6("util"),xK7=U6("zlib"),tEK=VK7(),BWY=nEK(),gWY=SK7(),FWY=CK7(),UWY=bK7(),Td=eEK.exports=function(q){tEK.call(this),this._parser=new gWY(q,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=q,this.writable=!0,this._parser.start()};pWY.inherits(Td,tEK);Td.prototype._handleError=function(q){if(this.emit("error",q),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy)this._inflate.destroy();if(this._filter)this._filter.destroy(),this._filter.on("error",function(){});this.errord=!0};Td.prototype._inflateData=function(q){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=xK7.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let _=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,z=Math.max(_,xK7.Z_MIN_CHUNK);this._inflate=xK7.createInflate({chunkSize:z});let Y=_,$=this.emit.bind(this,"error");this._inflate.on("error",function(O){if(!Y)return;$(O)}),this._filter.on("complete",this._complete.bind(this));let A=this._filter.write.bind(this._filter);this._inflate.on("data",function(O){if(!Y)return;if(O.length>Y)O=O.slice(0,Y);Y-=O.length,A(O)}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(q)};Td.prototype._handleMetaData=function(q){this._metaData=q,this._bitmapInfo=Object.create(q),this._filter=new BWY(this._bitmapInfo)};Td.prototype._handleTransColor=function(q){this._bitmapInfo.transColor=q};Td.prototype._handlePalette=function(q){this._bitmapInfo.palette=q};Td.prototype._simpleTransparency=function(){this._metaData.alpha=!0};Td.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};Td.prototype._finished=function(){if(this.errord)return;if(!this._inflate)this.emit("error","No Inflate block");else this._inflate.end()};Td.prototype._complete=function(q){if(this.errord)return;let K;try{let _=FWY.dataToBitMap(q,this._bitmapInfo);K=UWY(_,this._bitmapInfo),_=null}catch(_){this._handleError(_);return}this.emit("parsed",K)}});var _LK=m((QJ2,KLK)=>{var Ub=HS6();KLK.exports=function(q,K,_,z){let Y=[Ub.COLORTYPE_COLOR_ALPHA,Ub.COLORTYPE_ALPHA].indexOf(z.colorType)!==-1;if(z.colorType===z.inputColorType){let P=function(){let W=new ArrayBuffer(2);return new DataView(W).setInt16(0,256,!0),new Int16Array(W)[0]!==256}();if(z.bitDepth===8||z.bitDepth===16&&P)return q}let $=z.bitDepth!==16?q:new Uint16Array(q.buffer),A=255,O=Ub.COLORTYPE_TO_BPP_MAP[z.inputColorType];if(O===4&&!z.inputHasAlpha)O=3;let w=Ub.COLORTYPE_TO_BPP_MAP[z.colorType];if(z.bitDepth===16)A=65535,w*=2;let j=Buffer.alloc(K*_*w),H=0,J=0,M=z.bgColor||{};if(M.red===void 0)M.red=A;if(M.green===void 0)M.green=A;if(M.blue===void 0)M.blue=A;function X(){let P,W,D,f=A;switch(z.inputColorType){case Ub.COLORTYPE_COLOR_ALPHA:f=$[H+3],P=$[H],W=$[H+1],D=$[H+2];break;case Ub.COLORTYPE_COLOR:P=$[H],W=$[H+1],D=$[H+2];break;case Ub.COLORTYPE_ALPHA:f=$[H+1],P=$[H],W=P,D=P;break;case Ub.COLORTYPE_GRAYSCALE:P=$[H],W=P,D=P;break;default:throw Error("input color type:"+z.inputColorType+" is not supported at present")}if(z.inputHasAlpha){if(!Y)f/=A,P=Math.min(Math.max(Math.round((1-f)*M.red+f*P),0),A),W=Math.min(Math.max(Math.round((1-f)*M.green+f*W),0),A),D=Math.min(Math.max(Math.round((1-f)*M.blue+f*D),0),A)}return{red:P,green:W,blue:D,alpha:f}}for(let P=0;P<_;P++)for(let W=0;W<K;W++){let D=X($,H);switch(z.colorType){case Ub.COLORTYPE_COLOR_ALPHA:case Ub.COLORTYPE_COLOR:if(z.bitDepth===8){if(j[J]=D.red,j[J+1]=D.green,j[J+2]=D.blue,Y)j[J+3]=D.alpha}else if(j.writeUInt16BE(D.red,J),j.writeUInt16BE(D.green,J+2),j.writeUInt16BE(D.blue,J+4),Y)j.writeUInt16BE(D.alpha,J+6);break;case Ub.COLORTYPE_ALPHA:case Ub.COLORTYPE_GRAYSCALE:{let f=(D.red+D.green+D.blue)/3;if(z.bitDepth===8){if(j[J]=f,Y)j[J+1]=D.alpha}else if(j.writeUInt16BE(f,J),Y)j.writeUInt16BE(D.alpha,J+2);break}default:throw Error("unrecognised color Type "+z.colorType)}H+=O,J+=w}return j}});var $LK=m((dJ2,YLK)=>{var zLK=yK7();function QWY(q,K,_,z,Y){for(let $=0;$<_;$++)z[Y+$]=q[K+$]}function dWY(q,K,_){let z=0,Y=K+_;for(let $=K;$<Y;$++)z+=Math.abs(q[$]);return z}function cWY(q,K,_,z,Y,$){for(let A=0;A<_;A++){let O=A>=$?q[K+A-$]:0,w=q[K+A]-O;z[Y+A]=w}}function lWY(q,K,_,z){let Y=0;for(let $=0;$<_;$++){let A=$>=z?q[K+$-z]:0,O=q[K+$]-A;Y+=Math.abs(O)}return Y}function nWY(q,K,_,z,Y){for(let $=0;$<_;$++){let A=K>0?q[K+$-_]:0,O=q[K+$]-A;z[Y+$]=O}}function iWY(q,K,_){let z=0,Y=K+_;for(let $=K;$<Y;$++){let A=K>0?q[$-_]:0,O=q[$]-A;z+=Math.abs(O)}return z}function rWY(q,K,_,z,Y,$){for(let A=0;A<_;A++){let O=A>=$?q[K+A-$]:0,w=K>0?q[K+A-_]:0,j=q[K+A]-(O+w>>1);z[Y+A]=j}}function oWY(q,K,_,z){let Y=0;for(let $=0;$<_;$++){let A=$>=z?q[K+$-z]:0,O=K>0?q[K+$-_]:0,w=q[K+$]-(A+O>>1);Y+=Math.abs(w)}return Y}function aWY(q,K,_,z,Y,$){for(let A=0;A<_;A++){let O=A>=$?q[K+A-$]:0,w=K>0?q[K+A-_]:0,j=K>0&&A>=$?q[K+A-(_+$)]:0,H=q[K+A]-zLK(O,w,j);z[Y+A]=H}}function sWY(q,K,_,z){let Y=0;for(let $=0;$<_;$++){let A=$>=z?q[K+$-z]:0,O=K>0?q[K+$-_]:0,w=K>0&&$>=z?q[K+$-(_+z)]:0,j=q[K+$]-zLK(A,O,w);Y+=Math.abs(j)}return Y}var tWY={0:QWY,1:cWY,2:nWY,3:rWY,4:aWY},eWY={0:dWY,1:lWY,2:iWY,3:oWY,4:sWY};YLK.exports=function(q,K,_,z,Y){let $;if(!("filterType"in z)||z.filterType===-1)$=[0,1,2,3,4];else if(typeof z.filterType==="number")$=[z.filterType];else throw Error("unrecognised filter types");if(z.bitDepth===16)Y*=2;let A=K*Y,O=0,w=0,j=Buffer.alloc((A+1)*_),H=$[0];for(let J=0;J<_;J++){if($.length>1){let M=1/0;for(let X=0;X<$.length;X++){let P=eWY[$[X]](q,w,A,Y);if(P<M)H=$[X],M=P}}j[O]=H,O++,tWY[H](q,w,A,j,O,Y),O+=A,w+=A}return j}});var IK7=m((cJ2,ALK)=>{var jT=HS6(),qDY=hK7(),KDY=_LK(),_DY=$LK(),zDY=U6("zlib"),R56=ALK.exports=function(q){if(this._options=q,q.deflateChunkSize=q.deflateChunkSize||32768,q.deflateLevel=q.deflateLevel!=null?q.deflateLevel:9,q.deflateStrategy=q.deflateStrategy!=null?q.deflateStrategy:3,q.inputHasAlpha=q.inputHasAlpha!=null?q.inputHasAlpha:!0,q.deflateFactory=q.deflateFactory||zDY.createDeflate,q.bitDepth=q.bitDepth||8,q.colorType=typeof q.colorType==="number"?q.colorType:jT.COLORTYPE_COLOR_ALPHA,q.inputColorType=typeof q.inputColorType==="number"?q.inputColorType:jT.COLORTYPE_COLOR_ALPHA,[jT.COLORTYPE_GRAYSCALE,jT.COLORTYPE_COLOR,jT.COLORTYPE_COLOR_ALPHA,jT.COLORTYPE_ALPHA].indexOf(q.colorType)===-1)throw Error("option color type:"+q.colorType+" is not supported at present");if([jT.COLORTYPE_GRAYSCALE,jT.COLORTYPE_COLOR,jT.COLORTYPE_COLOR_ALPHA,jT.COLORTYPE_ALPHA].indexOf(q.inputColorType)===-1)throw Error("option input color type:"+q.inputColorType+" is not supported at present");if(q.bitDepth!==8&&q.bitDepth!==16)throw Error("option bit depth:"+q.bitDepth+" is not supported at present")};R56.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};R56.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};R56.prototype.filterData=function(q,K,_){let z=KDY(q,K,_,this._options),Y=jT.COLORTYPE_TO_BPP_MAP[this._options.colorType];return _DY(z,K,_,this._options,Y)};R56.prototype._packChunk=function(q,K){let _=K?K.length:0,z=Buffer.alloc(_+12);if(z.writeUInt32BE(_,0),z.writeUInt32BE(q,4),K)K.copy(z,8);return z.writeInt32BE(qDY.crc32(z.slice(4,z.length-4)),z.length-4),z};R56.prototype.packGAMA=function(q){let K=Buffer.alloc(4);return K.writeUInt32BE(Math.floor(q*jT.GAMMA_DIVISION),0),this._packChunk(jT.TYPE_gAMA,K)};R56.prototype.packIHDR=function(q,K){let _=Buffer.alloc(13);return _.writeUInt32BE(q,0),_.writeUInt32BE(K,4),_[8]=this._options.bitDepth,_[9]=this._options.colorType,_[10]=0,_[11]=0,_[12]=0,this._packChunk(jT.TYPE_IHDR,_)};R56.prototype.packIDAT=function(q){return this._packChunk(jT.TYPE_IDAT,q)};R56.prototype.packIEND=function(){return this._packChunk(jT.TYPE_IEND,null)}});var HLK=m((lJ2,jLK)=>{var YDY=U6("util"),OLK=U6("stream"),$DY=HS6(),ADY=IK7(),wLK=jLK.exports=function(q){OLK.call(this);let K=q||{};this._packer=new ADY(K),this._deflate=this._packer.createDeflate(),this.readable=!0};YDY.inherits(wLK,OLK);wLK.prototype.pack=function(q,K,_,z){if(this.emit("data",Buffer.from($DY.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(K,_)),z)this.emit("data",this._packer.packGAMA(z));let Y=this._packer.filterData(q,K,_);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function($){this.emit("data",this._packer.packIDAT($))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(Y)}});var DLK=m((n78,WLK)=>{var JLK=U6("assert").ok,JS6=U6("zlib"),ODY=U6("util"),MLK=U6("buffer").kMaxLength;function sH6(q){if(!(this instanceof sH6))return new sH6(q);if(q&&q.chunkSize<JS6.Z_MIN_CHUNK)q.chunkSize=JS6.Z_MIN_CHUNK;if(JS6.Inflate.call(this,q),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,q&&q.maxLength!=null)this._maxLength=q.maxLength}function wDY(q){return new sH6(q)}function XLK(q,K){if(K)process.nextTick(K);if(!q._handle)return;q._handle.close(),q._handle=null}sH6.prototype._processChunk=function(q,K,_){if(typeof _==="function")return JS6.Inflate._processChunk.call(this,q,K,_);let z=this,Y=q&&q.length,$=this._chunkSize-this._offset,A=this._maxLength,O=0,w=[],j=0,H;this.on("error",function(P){H=P});function J(P,W){if(z._hadError)return;let D=$-W;if(JLK(D>=0,"have should not go down"),D>0){let f=z._buffer.slice(z._offset,z._offset+D);if(z._offset+=D,f.length>A)f=f.slice(0,A);if(w.push(f),j+=f.length,A-=f.length,A===0)return!1}if(W===0||z._offset>=z._chunkSize)$=z._chunkSize,z._offset=0,z._buffer=Buffer.allocUnsafe(z._chunkSize);if(W===0)return O+=Y-P,Y=P,!0;return!1}JLK(this._handle,"zlib binding closed");let M;do M=this._handle.writeSync(K,q,O,Y,this._buffer,this._offset,$),M=M||this._writeState;while(!this._hadError&&J(M[0],M[1]));if(this._hadError)throw H;if(j>=MLK)throw XLK(this),RangeError("Cannot create final Buffer. It would be larger than 0x"+MLK.toString(16)+" bytes");let X=Buffer.concat(w,j);return XLK(this),X};ODY.inherits(sH6,JS6.Inflate);function jDY(q,K){if(typeof K==="string")K=Buffer.from(K);if(!(K instanceof Buffer))throw TypeError("Not a string or buffer");let _=q._finishFlushFlag;if(_==null)_=JS6.Z_FINISH;return q._processChunk(K,_)}function PLK(q,K){return jDY(new sH6(K),q)}WLK.exports=n78=PLK;n78.Inflate=sH6;n78.createInflate=wDY;n78.inflateSync=PLK});var uK7=m((nJ2,ZLK)=>{var fLK=ZLK.exports=function(q){this._buffer=q,this._reads=[]};fLK.prototype.read=function(q,K){this._reads.push({length:Math.abs(q),allowLess:q<0,func:K})};fLK.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let q=this._reads[0];if(this._buffer.length&&(this._buffer.length>=q.length||q.allowLess)){this._reads.shift();let K=this._buffer;this._buffer=K.slice(q.length),q.func.call(this,K.slice(0,q.length))}else break}if(this._reads.length>0)return Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)return Error("unrecognised content at end of stream")}});var GLK=m((MDY)=>{var HDY=uK7(),JDY=EK7();MDY.process=function(q,K){let _=[],z=new HDY(q);return new JDY(K,{read:z.read.bind(z),write:function($){_.push($)},complete:function(){}}).start(),z.process(),Buffer.concat(_)}});var VLK=m((rJ2,kLK)=>{var TLK=!0,vLK=U6("zlib"),PDY=DLK();if(!vLK.deflateSync)TLK=!1;var WDY=uK7(),DDY=GLK(),fDY=SK7(),ZDY=CK7(),GDY=bK7();kLK.exports=function(q,K){if(!TLK)throw Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let _;function z(T){_=T}let Y;function $(T){Y=T}function A(T){Y.transColor=T}function O(T){Y.palette=T}function w(){Y.alpha=!0}let j;function H(T){j=T}let J=[];function M(T){J.push(T)}let X=new WDY(q);if(new fDY(K,{read:X.read.bind(X),error:z,metadata:$,gamma:H,palette:O,transColor:A,inflateData:M,simpleTransparency:w}).start(),X.process(),_)throw _;let W=Buffer.concat(J);J.length=0;let D;if(Y.interlace)D=vLK.inflateSync(W);else{let v=((Y.width*Y.bpp*Y.depth+7>>3)+1)*Y.height;D=PDY(W,{chunkSize:v,maxLength:v})}if(W=null,!D||!D.length)throw Error("bad png - invalid inflate data response");let f=DDY.process(D,Y);W=null;let G=ZDY.dataToBitMap(f,Y);f=null;let Z=GDY(G,Y);return Y.data=Z,Y.gamma=j||0,Y}});var LLK=m((oJ2,ELK)=>{var NLK=!0,yLK=U6("zlib");if(!yLK.deflateSync)NLK=!1;var TDY=HS6(),vDY=IK7();ELK.exports=function(q,K){if(!NLK)throw Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let z=new vDY(K||{}),Y=[];if(Y.push(Buffer.from(TDY.PNG_SIGNATURE)),Y.push(z.packIHDR(q.width,q.height)),q.gamma)Y.push(z.packGAMA(q.gamma));let $=z.filterData(q.data,q.width,q.height),A=yLK.deflateSync($,z.getDeflateOptions());if($=null,!A||!A.length)throw Error("bad png - invalid compressed data response");return Y.push(z.packIDAT(A)),Y.push(z.packIEND()),Buffer.concat(Y)}});var RLK=m((NDY)=>{var kDY=VLK(),VDY=LLK();NDY.read=function(q,K){return kDY(q,K||{})};NDY.write=function(q,K){return VDY(q,K)}});var SLK=m((CDY)=>{var LDY=U6("util"),hLK=U6("stream"),RDY=qLK(),hDY=HLK(),SDY=RLK(),Hk=CDY.PNG=function(q){if(hLK.call(this),q=q||{},this.width=q.width|0,this.height=q.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,q.fill&&this.data)this.data.fill(0);this.gamma=0,this.readable=this.writable=!0,this._parser=new RDY(q),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(K){this.data=K,this.emit("parsed",K)}.bind(this)),this._packer=new hDY(q),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};LDY.inherits(Hk,hLK);Hk.sync=SDY;Hk.prototype.pack=function(){if(!this.data||!this.data.length)return this.emit("error","No data provided"),this;return process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this};Hk.prototype.parse=function(q,K){if(K){let _,z;_=function(Y){this.removeListener("error",z),this.data=Y,K(null,this)}.bind(this),z=function(Y){this.removeListener("parsed",_),K(Y,null)}.bind(this),this.once("parsed",_),this.once("error",z)}return this.end(q),this};Hk.prototype.write=function(q){return this._parser.write(q),!0};Hk.prototype.end=function(q){this._parser.end(q)};Hk.prototype._metadata=function(q){this.width=q.width,this.height=q.height,this.emit("metadata",q)};Hk.prototype._gamma=function(q){this.gamma=q};Hk.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable)this.emit("close")};Hk.bitblt=function(q,K,_,z,Y,$,A,O){if(_|=0,z|=0,Y|=0,$|=0,A|=0,O|=0,_>q.width||z>q.height||_+Y>q.width||z+$>q.height)throw Error("bitblt reading outside image");if(A>K.width||O>K.height||A+Y>K.width||O+$>K.height)throw Error("bitblt writing outside image");for(let w=0;w<$;w++)q.data.copy(K.data,(O+w)*K.width+A<<2,(z+w)*q.width+_<<2,(z+w)*q.width+_+Y<<2)};Hk.prototype.bitblt=function(q,K,_,z,Y,$,A){return Hk.bitblt(this,q,K,_,z,Y,$,A),this};Hk.adjustGamma=function(q){if(q.gamma){for(let K=0;K<q.height;K++)for(let _=0;_<q.width;_++){let z=q.width*K+_<<2;for(let Y=0;Y<3;Y++){let $=q.data[z+Y]/255;$=Math.pow($,0.45454545454545453/q.gamma),q.data[z+Y]=Math.round($*255)}}q.gamma=0}};Hk.prototype.adjustGamma=function(){Hk.adjustGamma(this)}});var i78=m((bDY)=>{function CLK(q){if(typeof q==="number")q=q.toString();if(typeof q!=="string")throw Error("Color should be defined as hex string");let K=q.slice().replace("#","").split("");if(K.length<3||K.length===5||K.length>8)throw Error("Invalid hex color: "+q);if(K.length===3||K.length===4)K=Array.prototype.concat.apply([],K.map(function(z){return[z,z]}));if(K.length===6)K.push("F","F");let _=parseInt(K.join(""),16);return{r:_>>24&255,g:_>>16&255,b:_>>8&255,a:_&255,hex:"#"+K.slice(0,6).join("")}}bDY.getOptions=function(K){if(!K)K={};if(!K.color)K.color={};let _=typeof K.margin>"u"||K.margin===null||K.margin<0?4:K.margin,z=K.width&&K.width>=21?K.width:void 0,Y=K.scale||4;return{width:z,scale:z?4:Y,margin:_,color:{dark:CLK(K.color.dark||"#000000ff"),light:CLK(K.color.light||"#ffffffff")},type:K.type,rendererOpts:K.rendererOpts||{}}};bDY.getScale=function(K,_){return _.width&&_.width>=K+_.margin*2?_.width/(K+_.margin*2):_.scale};bDY.getImageWidth=function(K,_){let z=bDY.getScale(K,_);return Math.floor((K+_.margin*2)*z)};bDY.qrToImageData=function(K,_,z){let Y=_.modules.size,$=_.modules.data,A=bDY.getScale(Y,z),O=Math.floor((Y+z.margin*2)*A),w=z.margin*A,j=[z.color.light,z.color.dark];for(let H=0;H<O;H++)for(let J=0;J<O;J++){let M=(H*O+J)*4,X=z.color.light;if(H>=w&&J>=w&&H<O-w&&J<O-w){let P=Math.floor((H-w)/A),W=Math.floor((J-w)/A);X=j[$[P*Y+W]?1:0]}K[M++]=X.r,K[M++]=X.g,K[M++]=X.b,K[M]=X.a}}});var bLK=m((BDY)=>{var mDY=U6("fs"),pDY=SLK().PNG,pK7=i78();BDY.render=function(K,_){let z=pK7.getOptions(_),Y=z.rendererOpts,$=pK7.getImageWidth(K.modules.size,z);Y.width=$,Y.height=$;let A=new pDY(Y);return pK7.qrToImageData(A.data,K,z),A};BDY.renderToDataURL=function(K,_,z){if(typeof z>"u")z=_,_=void 0;BDY.renderToBuffer(K,_,function(Y,$){if(Y)z(Y);let A="data:image/png;base64,";A+=$.toString("base64"),z(null,A)})};BDY.renderToBuffer=function(K,_,z){if(typeof z>"u")z=_,_=void 0;let Y=BDY.render(K,_),$=[];Y.on("error",z),Y.on("data",function(A){$.push(A)}),Y.on("end",function(){z(null,Buffer.concat($))}),Y.pack()};BDY.renderToFile=function(K,_,z,Y){if(typeof Y>"u")Y=z,z=void 0;let $=!1,A=(...w)=>{if($)return;$=!0,Y.apply(null,w)},O=mDY.createWriteStream(K);O.on("error",A),O.on("close",A),BDY.renderToFileStream(O,_,z)};BDY.renderToFileStream=function(K,_,z){BDY.render(_,z).pack().pipe(K)}});var ILK=m((iDY)=>{var dDY=i78(),cDY={WW:" ",WB:"▄",BB:"█",BW:"▀"},lDY={BB:" ",BW:"▄",WW:"█",WB:"▀"};function nDY(q,K,_){if(q&&K)return _.BB;if(q&&!K)return _.BW;if(!q&&K)return _.WB;return _.WW}iDY.render=function(q,K,_){let z=dDY.getOptions(K),Y=cDY;if(z.color.dark.hex==="#ffffff"||z.color.light.hex==="#000000")Y=lDY;let $=q.modules.size,A=q.modules.data,O="",w=Array($+z.margin*2+1).join(Y.WW);w=Array(z.margin/2+1).join(w+`
6124`);let j=Array(z.margin+1).join(Y.WW);O+=w;for(let H=0;H<$;H+=2){O+=j;for(let J=0;J<$;J++){let M=A[H*$+J],X=A[(H+1)*$+J];O+=nDY(M,X,Y)}O+=j+`
6125`}if(O+=w.slice(0,-1),typeof _==="function")_(null,O);return O};iDY.renderToFile=function(K,_,z,Y){if(typeof Y>"u")Y=z,z=void 0;let $=U6("fs"),A=iDY.render(_,z);$.writeFile(K,A,Y)}});var uLK=m((oDY)=>{oDY.render=function(q,K,_){let z=q.modules.size,Y=q.modules.data,$="\x1B[40m \x1B[0m",A="\x1B[47m \x1B[0m",O="",w=Array(z+3).join("\x1B[47m \x1B[0m"),j=Array(2).join("\x1B[47m \x1B[0m");O+=w+`

Callers 1

cli.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected