btcpayserver/BTCPayServer/wwwroot/vendor/bbqr/bbqr.iife.js

9 lines
149 KiB
JavaScript
Raw Normal View History

var BBQr=function(At){"use strict";function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kt={},ao=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Hr={},Be={};let Nn;const oo=[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];Be.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},Be.getSymbolTotalCodewords=function(r){return oo[r]},Be.getBCHDigit=function(e){let r=0;for(;e!==0;)r++,e>>>=1;return r},Be.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');Nn=r},Be.isKanjiModeEnabled=function(){return typeof Nn<"u"},Be.toSJIS=function(r){return Nn(r)};var un={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function r(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,l){if(e.isValid(i))return i;try{return r(i)}catch{return l}}})(un);function Ur(){this.buffer=[],this.length=0}Ur.prototype={get:function(e){const r=Math.floor(e/8);return(this.buffer[r]>>>7-e%8&1)===1},put:function(e,r){for(let t=0;t<r;t++)this.putBit((e>>>r-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}};var fo=Ur;function Yt(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Yt.prototype.set=function(e,r,t,i){const l=e*this.size+r;this.data[l]=t,i&&(this.reservedBit[l]=!0)},Yt.prototype.get=function(e,r){return this.data[e*this.size+r]},Yt.prototype.xor=function(e,r,t){this.data[e*this.size+r]^=t},Yt.prototype.isReserved=function(e,r){return this.reservedBit[e*this.size+r]};var lo=Yt,Fr={};(function(e){const r=Be.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const l=Math.floor(i/7)+2,n=r(i),a=n===145?26:Math.ceil((n-13)/(2*l-2))*2,f=[n-7];for(let s=1;s<l-1;s++)f[s]=f[s-1]-a;return f.push(6),f.reverse()},e.getPositions=function(i){const l=[],n=e.getRowColCoords(i),a=n.length;for(let f=0;f<a;f++)for(let s=0;s<a;s++)f===0&&s===0||f===0&&s===a-1||f===a-1&&s===0||l.push([n[f],n[s]]);return l}})(Fr);var $r={};const so=Be.getSymbolSize,Pr=7;$r.getPositions=function(r){const t=so(r);return[[0,0],[t-Pr,0],[0,t-Pr]]};var Kr={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(l){return l!=null&&l!==""&&!isNaN(l)&&l>=0&&l<=7},e.from=function(l){return e.isValid(l)?parseInt(l,10):void 0},e.getPenaltyN1=function(l){const n=l.size;let a=0,f=0,s=0,h=null,c=null;for(let _=0;_<n;_++){f=s=0,h=c=null;for(let v=0;v<n;v++){let w=l.get(_,v);w===h?f++:(f>=5&&(a+=r.N1+(f-5)),h=w,f=1),w=l.get(v,_),w===c?s++:(s>=5&&(a+=r.N1+(s-5)),c=w,s=1)}f>=5&&(a+=r.N1+(f-5)),s>=5&&(a+=r.N1+(s-5))}return a},e.getPenaltyN2=function(l){const n=l.size;let a=0;for(let f=0;f<n-1;f++)for(let s=0;s<n-1;s++){const h=l.get(f,s)+l.get(f,s+1)+l.get(f+1,s)+l.get(f+1,s+1);(h===4||h===0)&&a++}return a*r.N2},e.getPenaltyN3=function(l){const n=l.size;let a=0,f=0,s=0;for(let h=0;h<n;h++){f=s=0;for(let c=0;c<n;c++)f=f<<1&2047|l.get(h,c),c>=10&&(f===1488||f===93)&&a++,s=s<<1&2047|l.get(c,h),c>=10&&(s===1488||s===93)&&a++}return a*r.N3},e.getPenaltyN4=function(l){let n=0;const a=l.data.length;for(let s=0;s<a;s++)n+=l.data[s];return Math.abs(Math.ceil(n*100/a/5)-10)*r.N4};function t(i,l,n){switch(
]))+`;Qe.KANJI=new RegExp(qt,"g"),Qe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Qe.BYTE=new RegExp(uo,"g"),Qe.NUMERIC=new RegExp(jr,"g"),Qe.ALPHANUMERIC=new RegExp(co,"g");const _o=new RegExp("^"+qt+"$"),go=new RegExp("^"+jr+"$"),vo=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Qe.testKanji=function(r){return _o.test(r)},Qe.testNumeric=function(r){return go.test(r)},Qe.testAlphanumeric=function(r){return vo.test(r)},function(e){const r=On,t=Qe;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,a){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!r.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?n.ccBits[0]:a<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return t.testNumeric(n)?e.NUMERIC:t.testAlphanumeric(n)?e.ALPHANUMERIC:t.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function i(l){if(typeof l!="string")throw new Error("Param is not a string");switch(l.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+l)}}e.from=function(n,a){if(e.isValid(n))return n;try{return i(n)}catch{return a}}}(at),function(e){const r=Be,t=_n,i=un,l=at,n=On,a=7973,f=r.getBCHDigit(a);function s(v,w,d){for(let S=1;S<=40;S++)if(w<=e.getCapacity(S,d,v))return S}function h(v,w){return l.getCharCountIndicator(v,w)+4}function c(v,w){let d=0;return v.forEach(function(S){const T=h(S.mode,w);d+=T+S.getBitsLength()}),d}function _(v,w){for(let d=1;d<=40;d++)if(c(v,d)<=e.getCapacity(d,w,l.MIXED))return d}e.from=function(w,d){return n.isValid(w)?parseInt(w,10):d},e.getCapacity=function(w,d,S){if(!n.isValid(w))throw new Error("Invalid QR Code version");typeof S>"u"&&(S=l.BYTE);const T=r.getSymbolTotalCodewords(w),b=t.getTotalCodewordsCount(w,d),x=(T-b)*8;if(S===l.MIXED)return x;const y=x-h(S,w);switch(S){case l.NUMERIC:return Math.floor(y/10*3);case l.ALPHANUMERIC:return Math.floor(y/11*2);case l.KANJI:return Math.floor(y/13);case l.BYTE:default:return Math.floor(y/8)}},e.getBestVersionForData=function(w,d){let S;const T=i.from(d,i.M);if(Array.isArray(w)){if(w.length>1)return _(w,T);if(w.length===0)return 1;S=w[0]}else S=w;return s(S.mode,S.getLength(),T)},e.getEncodedBits=function(w){if(!n.isValid(w)||w<7)throw new Error("Invalid QR Code version");let d=w<<12;for(;r.getBCHDigit(d)-f>=0;)d^=a<<r.getBCHDigit(d)-f;return w<<12|d}}(qr);var Vr={};const Hn=Be,Xr=1335,wo=21522,Jr=Hn.getBCHDigit(Xr);Vr.getEncodedBits=function(r,t){const i=r.bit<<3|t;let l=i<<10;for(;Hn.getBCHDigit(l)-Jr>=0;)l^=Xr<<Hn.getBCHDigit(l)-Jr;return(i<<10|l)^wo};var Wr={};const bo=at;function St(e){this.mode=bo.NUMERIC,this.data=e.toString()}St.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},St.prototype.getLength=function(){return this.data.length},St.prototype.getBitsLength=function(){return St.getBitsLength(this.data.length)},St.prototype.write=function(r){let t,i,l;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),l=parseInt(i,10),r.put(l,10);const n=this.data.length-t;n>0&&(i=this.data.substr(t),l=parseInt(i,10),r.put(l,n*3+1))};var po=St;const xo=at,Un=["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 Tt(e){this.mode=xo.ALPHANUMERIC,this.data=e}Tt.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)},Tt.prototype.getLength=function(){return this.data.length},Tt.prototype.getBitsLength=function(){return Tt.getBitsLength(this.data.length)},Tt.prototype.write=function(r){let t;for(t=0;t+2<=this.data.length;t+=2){let i=Un.indexOf(this.data[t])*45;i+=Un.indexOf(this.data[t+1]),r.put(i,11)}this.data.length%2&&r.put(Un.indexOf(this.data[t]),6)};var Eo=Tt,
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),e.put(t,13)}};var Ro=zt,Gr={exports:{}};(function(e){var r={single_source_shortest_paths:function(t,i,l){var n={},a={};a[i]=0;var f=r.PriorityQueue.make();f.push(i,0);for(var s,h,c,_,v,w,d,S,T;!f.empty();){s=f.pop(),h=s.value,_=s.cost,v=t[h]||{};for(c in v)v.hasOwnProperty(c)&&(w=v[c],d=_+w,S=a[c],T=typeof a[c]>"u",(T||S>d)&&(a[c]=d,f.push(c,d),n[c]=h))}if(typeof l<"u"&&typeof a[l]>"u"){var b=["Could not find a path from ",i," to ",l,"."].join("");throw new Error(b)}return n},extract_shortest_path_from_predecessor_list:function(t,i){for(var l=[],n=i;n;)l.push(n),t[n],n=t[n];return l.reverse(),l},find_path:function(t,i,l){var n=r.single_source_shortest_paths(t,i,l);return r.extract_shortest_path_from_predecessor_list(n,l)},PriorityQueue:{make:function(t){var i=r.PriorityQueue,l={},n;t=t||{};for(n in i)i.hasOwnProperty(n)&&(l[n]=i[n]);return l.queue=[],l.sorter=t.sorter||i.default_sorter,l},default_sorter:function(t,i){return t.cost-i.cost},push:function(t,i){var l={value:t,cost:i};this.queue.push(l),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=r})(Gr);var zo=Gr.exports;(function(e){const r=at,t=po,i=Eo,l=Ao,n=Ro,a=Qe,f=Be,s=zo;function h(b){return unescape(encodeURIComponent(b)).length}function c(b,x,y){const E=[];let R;for(;(R=b.exec(y))!==null;)E.push({data:R[0],index:R.index,mode:x,length:R[0].length});return E}function _(b){const x=c(a.NUMERIC,r.NUMERIC,b),y=c(a.ALPHANUMERIC,r.ALPHANUMERIC,b);let E,R;return f.isKanjiModeEnabled()?(E=c(a.BYTE,r.BYTE,b),R=c(a.KANJI,r.KANJI,b)):(E=c(a.BYTE_KANJI,r.BYTE,b),R=[]),x.concat(y,E,R).sort(function(k,C){return k.index-C.index}).map(function(k){return{data:k.data,mode:k.mode,length:k.length}})}function v(b,x){switch(x){case r.NUMERIC:return t.getBitsLength(b);case r.ALPHANUMERIC:return i.getBitsLength(b);case r.KANJI:return n.getBitsLength(b);case r.BYTE:return l.getBitsLength(b)}}function w(b){return b.reduce(function(x,y){const E=x.length-1>=0?x[x.length-1]:null;return E&&E.mode===y.mode?(x[x.length-1].data+=y.data,x):(x.push(y),x)},[])}function d(b){const x=[];for(let y=0;y<b.length;y++){const E=b[y];switch(E.mode){case r.NUMERIC:x.push([E,{data:E.data,mode:r.ALPHANUMERIC,length:E.length},{data:E.data,mode:r.BYTE,length:E.length}]);break;case r.ALPHANUMERIC:x.push([E,{data:E.data,mode:r.BYTE,length:E.length}]);break;case r.KANJI:x.push([E,{data:E.data,mode:r.BYTE,length:h(E.data)}]);break;case r.BYTE:x.push([{data:E.data,mode:r.BYTE,length:h(E.data)}])}}return x}function S(b,x){const y={},E={start:{}};let R=["start"];for(let D=0;D<b.length;D++){const k=b[D],C=[];for(let Z=0;Z<k.length;Z++){const B=k[Z],N=""+D+Z;C.push(N),y[N]={node:B,lastCount:0},E[N]={};for(let F=0;F<R.length;F++){const U=R[F];y[U]&&y[U].node.mode===B.mode?(E[U][N]=v(y[U].lastCount+B.length,B.mode)-v(y[U].lastCount,B.mode),y[U].lastCount+=B.length):(y[U]&&(y[U].lastCount=B.length),E[U][N]=v(B.length,B.mode)+4+r.getCharCountIndicator(B.mode,x))}}R=C}for(let D=0;D<R.length;D++)E[R[D]].end=0;return{map:E,table:y}}function T(b,x){let y;const E=r.getBestModeForData(b);if(y=r.from(x,E),y!==r.BYTE&&y.bit<E.bit)throw new Error('"'+b+'" cannot be encoded with mode '+r.toString(y)+`.
Suggested mode is: `+r.toString(E));switch(y===r.KANJI&&!f.isKanjiModeEnabled()&&(y=r.BYTE),y){case r.NUMERIC:return new t(b);case r.ALPHANUMERIC:return new i(b);case r.KANJI:return new n(b);case r.BYTE:return new l(b)}}e.fromArray=function(x){return x.reduce(function(y,E){return typeof E=="string"?y.push(T(E,null)):E.data&&y.push(T(E.data,E.mode)),y},[])},e.fromString=function(x,y){const E=_(x,f.isKanjiModeEnabled()),R=d(E),D=S(R,y),k=s.find_path(D.map,"start","end"),C=[];for(let Z=1;Z<k.length-1;Z++)C.push(D.table[k[Z]].node);return e.fromArray(w(C))},e.rawSplit=function(x){return e.fromArray(_(x,f.isKanjiModeEnabled()))}})(Wr);const pn=Be,Fn=un,Io=fo,Co=lo,Do=Fr,Lo=$r,$n=Kr,Pn=_n,Bo=ho,xn=qr,Mo=Vr,No=at,Kn=Wr;function Zo(e,r){const t=e.size,i=Lo.getPositions(r);for(let l=0;l<i.length;l++){const n=i[l][0],a=i[l][1];for(let f=-1;f<=7;f++)if(!(n+f<=-1||t<=n+f))for(let s=-1;s<=7;s++)a+s<=-1||t<=a+s||(f>=0&&f<=6&&(s===0||s===6)||s>=0&&s<=6&&(f===0||f===6)||f>=2&&f<=4&&s>=2&&s<=4?e.set(n+f,a+s,!0,!0):e.set(n+f,a+s,!1,!0))}}function Oo(e){const r=e.size;for(let t=8;t<r-8;t++){const i=t%2===0;e.set(t,6,i,!0),e.set(6,t,i,!0)}}function Ho(e,r){const t=Do.getPositions(r);for(let i=0;i<t.length;i++){const l=t[i][0],n=t[i][1];for(let a=-2;a<=2;a++)for(let f=-2;f<=2;f++)a===-2||a===2||f===-2||f===2||a===0&&f===0?e.set(l+a,n+f,!0,!0):e.set(l+a,n+f,!1,!0)}}function Uo(e,r){const t=e.size,i=xn.getEncodedBits(r);let l,n,a;for(let f=0;f<18;f++)l=Math.floor(f/3),n=f%3+t-8-3,a=(i>>f&1)===1,e.set(l,n,a,!0),e.set(n,l,a,!0)}function Yn(e,r,t){const i=e.size,l=Mo.getEncodedBits(r,t);let n,a;for(n=0;n<15;n++)a=(l>>n&1)===1,n<6?e.set(n,8,a,!0):n<8?e.set(n+1,8,a,!0):e.set(i-15+n,8,a,!0),n<8?e.set(8,i-n-1,a,!0):n<9?e.set(8,15-n-1+1,a,!0):e.set(8,15-n-1,a,!0);e.set(i-8,8,1,!0)}function Fo(e,r){const t=e.size;let i=-1,l=t-1,n=7,a=0;for(let f=t-1;f>0;f-=2)for(f===6&&f--;;){for(let s=0;s<2;s++)if(!e.isReserved(l,f-s)){let h=!1;a<r.length&&(h=(r[a]>>>n&1)===1),e.set(l,f-s,h),n--,n===-1&&(a++,n=7)}if(l+=i,l<0||t<=l){l-=i,i=-i;break}}}function $o(e,r,t){const i=new Io;t.forEach(function(s){i.put(s.mode.bit,4),i.put(s.getLength(),No.getCharCountIndicator(s.mode,e)),s.write(i)});const l=pn.getSymbolTotalCodewords(e),n=Pn.getTotalCodewordsCount(e,r),a=(l-n)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const f=(a-i.getLengthInBits())/8;for(let s=0;s<f;s++)i.put(s%2?17:236,8);return Po(i,e,r)}function Po(e,r,t){const i=pn.getSymbolTotalCodewords(r),l=Pn.getTotalCodewordsCount(r,t),n=i-l,a=Pn.getBlocksCount(r,t),f=i%a,s=a-f,h=Math.floor(i/a),c=Math.floor(n/a),_=c+1,v=h-c,w=new Bo(v);let d=0;const S=new Array(a),T=new Array(a);let b=0;const x=new Uint8Array(e.buffer);for(let k=0;k<a;k++){const C=k<s?c:_;S[k]=x.slice(d,d+C),T[k]=w.encode(S[k]),d+=C,b=Math.max(b,C)}const y=new Uint8Array(i);let E=0,R,D;for(R=0;R<b;R++)for(D=0;D<a;D++)R<S[D].length&&(y[E++]=S[D][R]);for(R=0;R<v;R++)for(D=0;D<a;D++)y[E++]=T[D][R];return y}function Ko(e,r,t,i){let l;if(Array.isArray(e))l=Kn.fromArray(e);else if(typeof e=="string"){let h=r;if(!h){const c=Kn.rawSplit(e);h=xn.getBestVersionForData(c,t)}l=Kn.fromString(e,h||40)}else throw new Error("Invalid data");const n=xn.getBestVersionForData(l,t);if(!n)throw new Error("The amount of data is too big to be stored in a QR Code");if(!r)r=n;else if(r<n)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+n+`.
`);const a=$o(r,t,l),f=pn.getSymbolSize(r),s=new Co(f);return Zo(s,r),Oo(s),Ho(s,r),Yn(s,t,0),r>=7&&Uo(s,r),Fo(s,a),isNaN(i)&&(i=$n.getBestMask(s,Yn.bind(null,s,t))),$n.applyMask(i,s),Yn(s,t,i),{modules:s,version:r,errorCorrectionLevel:t,maskPattern:i,segments:l}}Hr.create=function(r,t){if(typeof r>"u"||r==="")throw new Error("No input text");let i=Fn.M,l,n;return typeof t<"u"&&(i=Fn.from(t.errorCorrectionLevel,Fn.M),l=xn.from(t.version),n=$n.from(t.maskPattern),t.toSJISFunc&&pn.setToSJISFunction(t.toSJISFunc)),Ko(r,l,i,n)};var ei={},Qn={};(function(e){function r(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let i=t.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+t);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(n){return[n,n]}))),i.length===6&&i.push("F","F");const l=parseInt(i.join(""),16);return{r:l>>24&255,g:l>>16&255,b:l>>8&255,a:l&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const l=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,n=i.width&&i.width>=21?i.width:void 0,a=i.scale||4;return{width:n,scale:n?4:a,margin:l,color:{dark:r(i.color.dark||"#000000ff"),light:r(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,l){return l.width&&l.width>=i+l.margin*2?l.width/(i+l.margin*2):l.scale},e.getImageWidth=function(i,l){const n=e.getScale(i,l);return Math.floor((i+l.margin*2)*n)},e.qrToImageData=function(i,l,n){const a=l.modules.size,f=l.modules.data,s=e.getScale(a,n),h=Math.floor((a+n.margin*2)*s),c=n.margin*s,_=[n.color.light,n.color.dark];for(let v=0;v<h;v++)for(let w=0;w<h;w++){let d=(v*h+w)*4,S=n.color.light;if(v>=c&&w>=c&&v<h-c&&w<h-c){const T=Math.floor((v-c)/s),b=Math.floor((w-c)/s);S=_[f[T*a+b]?1:0]}i[d++]=S.r,i[d++]=S.g,i[d++]=S.b,i[d]=S.a}}})(Qn),function(e){const r=Qn;function t(l,n,a){l.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=a,n.width=a,n.style.height=a+"px",n.style.width=a+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(n,a,f){let s=f,h=a;typeof s>"u"&&(!a||!a.getContext)&&(s=a,a=void 0),a||(h=i()),s=r.getOptions(s);const c=r.getImageWidth(n.modules.size,s),_=h.getContext("2d"),v=_.createImageData(c,c);return r.qrToImageData(v.data,n,s),t(_,h,c),_.putImageData(v,0,0),h},e.renderToDataURL=function(n,a,f){let s=f;typeof s>"u"&&(!a||!a.getContext)&&(s=a,a=void 0),s||(s={});const h=e.render(n,a,s),c=s.type||"image/png",_=s.rendererOpts||{};return h.toDataURL(c,_.quality)}}(ei);var ti={};const Yo=Qn;function ni(e,r){const t=e.a/255,i=r+'="'+e.hex+'"';return t<1?i+" "+r+'-opacity="'+t.toFixed(2).slice(1)+'"':i}function qn(e,r,t){let i=e+r;return typeof t<"u"&&(i+=" "+t),i}function Qo(e,r,t){let i="",l=0,n=!1,a=0;for(let f=0;f<e.length;f++){const s=Math.floor(f%r),h=Math.floor(f/r);!s&&!n&&(n=!0),e[f]?(a++,f>0&&s>0&&e[f-1]||(i+=n?qn("M",s+t,.5+h+t):qn("m",l,0),l=0,n=!1),s+1<r&&e[f+1]||(i+=qn("h",a),a=0)):l++}return i}ti.render=function(r,t,i){const l=Yo.getOptions(t),n=r.modules.size,a=r.modules.data,f=n+l.margin*2,s=l.color.light.a?"<path "+ni(l.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+ni(l.color.dark,"stroke")+' d="'+Qo(a,n,l.margin)+'"/>',c='viewBox="0 0 '+f+" "+f+'"',v='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+c+' shape-rendering="crispEdges">'+s+h+`</svg>
`;return typeof i=="function"&&i(null,v),v};const qo=ao,jn=Hr,ri=ei,jo=ti;function Vn(e,r,t,i,l){const n=[].slice.call(arguments,1),a=n.length,f=typeof n[a-1]=="function";if(!f&&!qo())throw new Error("Callback required as last argument");if(f){if(a<2)throw new Error("Too few arguments provided");a===2?(l=t,t=r,r=i=void 0):a===3&&(r.getContext&&typeof l>"u"?(l=i,i=void 0):(l=i,i=t,t=r,r=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(t=r,r=i=void 0):a===2&&!r.getContext&&(i=t,t=r,r=void 0),new Promise(function(s,h){try{const c=jn.create(t,i);s(e(c,r,i))}catch(c){h(c)}})}try{const s=jn.create(t,i);l(null,e(s,r,i))}catch(s){l(s)}}Kt.create=jn.create,Kt.toCanvas=Vn.bind(null,ri.render),Kt.toDataURL=Vn.bind(null,ri.renderToDataURL),Kt.toString=Vn.bind(null,function(e,r,t){return jo.render(e,t)});function Vo(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ii={exports:{}},Xn={},ai;function ot(){return ai||(ai=1,function(e){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(n,a){return Object.prototype.hasOwnProperty.call(n,a)}e.assign=function(n){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var f=a.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var s in f)t(f,s)&&(n[s]=f[s])}}return n},e.shrinkBuf=function(n,a){return n.length===a?n:n.subarray?n.subarray(0,a):(n.length=a,n)};var i={arraySet:function(n,a,f,s,h){if(a.subarray&&n.subarray){n.set(a.subarray(f,f+s),h);return}for(var c=0;c<s;c++)n[h+c]=a[f+c]},flattenChunks:function(n){var a,f,s,h,c,_;for(s=0,a=0,f=n.length;a<f;a++)s+=n[a].length;for(_=new Uint8Array(s),h=0,a=0,f=n.length;a<f;a++)c=n[a],_.set(c,h),h+=c.length;return _}},l={arraySet:function(n,a,f,s,h){for(var c=0;c<s;c++)n[h+c]=a[f+c]},flattenChunks:function(n){return[].concat.apply([],n)}};e.setTyped=function(n){n?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,l))},e.setTyped(r)}(Xn)),Xn}var It={},Ke={},gt={},oi;function Xo(){if(oi)return gt;oi=1;var e=ot(),r=4,t=0,i=1,l=2;function n(p){for(var O=p.length;--O>=0;)p[O]=0}var a=0,f=1,s=2,h=3,c=258,_=29,v=256,w=v+1+_,d=30,S=19,T=2*w+1,b=15,x=16,y=7,E=256,R=16,D=17,k=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=512,U=new Array((w+2)*2);n(U);var P=new Array(d*2);n(P);var J=new Array(F);n(J);var V=new Array(c-h+1);n(V);var Y=new Array(_);n(Y);var j=new Array(d);n(j);function ne(p,O,$,Q,A){this.static_tree=p,this.extra_bits=O,this.extra_base=$,this.elems=Q,this.max_length=A,this.has_stree=p&&p.length}var Ee,Ae,_e;function de(p,O){this.dyn_tree=p,this.max_code=0,this.stat_desc=O}function ve(p){return p<256?J[p]:J[256+(p>>>7)]}function ue(p,O){p.pending_buf[p.pending++]=O&255,p.pending_buf[p.pending++]=O>>>8&255}function ae(p,O,$){p.bi_valid>x-$?(p.bi_buf|=O<<p.bi_valid&65535,ue(p,p.bi_buf),p.bi_buf=O>>x-p.bi_valid,p.bi_valid+=$-x):(p.bi_buf|=O<<p.bi_valid&65535,p.bi_valid+=$)}function se(p,O,$){ae(p,$[O*2],$[O*2+1])}function te(p,O){var $=0;do $|=p&1,p>>>=1,$<<=1;while(--O>0);return $>>>1}function G(p){p.bi_valid===16?(ue(p,p.bi_buf),p.bi_buf=0,p.bi_valid=0):p.bi_valid>=8&&(p.pending_buf[p.pending++]=p.bi_buf&255,p.bi_buf>>=8,p.bi_valid-=8)}function ze(p,O){var $=O.dyn_tree,Q=O.max_code,A=O.stat_desc.static_tree,M=O.stat_desc.has_stree,u=O.stat_desc.extra_bits,H=O.stat_desc.extra_base,W=O.stat_desc.max_length,o,I,L,g,m,z,X=0;for(g=0;g<=b;g++)p.bl_count[g]=0;for($[p.heap[p.heap_max]*2+1]=0,o=p.heap_max+1;o<T;o++)I=p.heap[o],g=$[$[I*2+1]*2+1]+1,g>W&&(g=W,X++),$[I*2+1]=g,!(I>Q)&&(p.bl_count[g]++,m=0,I>=H&&(m=u[I-H]),z=$[I*2],p.opt_len+=z*(g+m),M&&(p.static_len+=z*(A[I*2+1]+m)));if(X!==0){do{for(g=W-1;p.bl_count[g]===0;)g--;p.bl_cou