-
Notifications
You must be signed in to change notification settings - Fork 0
/
qrcode_e02eef5_20190918_min.js
41 lines (41 loc) · 19.5 KB
/
qrcode_e02eef5_20190918_min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// minified version of https://github.com/kazuhikoarase/qrcode-generator/blob/0e51e6310a34b5e4f70280533b3d43e1fc6a0b16/js/qrcode.js
var qrcode=function(){function D(n,p){if("undefined"==typeof n.length)throw n.length+"/"+p;var h=function(){for(var c=0;c<n.length&&0==n[c];)c+=1;for(var b=Array(n.length-c+p),g=0;g<n.length-c;g+=1)b[g]=n[g+c];return b}(),a={getAt:function(c){return h[c]},getLength:function(){return h.length},multiply:function(c){for(var b=Array(a.getLength()+c.getLength()-1),g=0;g<a.getLength();g+=1)for(var k=0;k<c.getLength();k+=1)b[g+k]^=G.gexp(G.glog(a.getAt(g))+G.glog(c.getAt(k)));return D(b,0)},mod:function(c){if(0>
a.getLength()-c.getLength())return a;for(var b=G.glog(a.getAt(0))-G.glog(c.getAt(0)),g=Array(a.getLength()),k=0;k<a.getLength();k+=1)g[k]=a.getAt(k);for(k=0;k<c.getLength();k+=1)g[k]^=G.gexp(G.glog(c.getAt(k))+b);return D(g,0).mod(c)}};return a}var C=function(n,p){var h=n,a=F[p],c=null,b=0,g=null,k=[],q={},z=function(f,l){for(var e=b=4*h+17,d=Array(e),m=0;m<e;m+=1){d[m]=Array(e);for(var r=0;r<e;r+=1)d[m][r]=null}c=d;y(0,0);y(b-7,0);y(0,b-7);e=x.getPatternPosition(h);for(d=0;d<e.length;d+=1)for(m=
0;m<e.length;m+=1){r=e[d];var v=e[m];if(null==c[r][v])for(var u=-2;2>=u;u+=1)for(var t=-2;2>=t;t+=1)c[r+u][v+t]=-2==u||2==u||-2==t||2==t||0==u&&0==t?!0:!1}for(e=8;e<b-8;e+=1)null==c[e][6]&&(c[e][6]=0==e%2);for(e=8;e<b-8;e+=1)null==c[6][e]&&(c[6][e]=0==e%2);e=x.getBCHTypeInfo(a<<3|l);for(d=0;15>d;d+=1)m=!f&&1==(e>>d&1),6>d?c[d][8]=m:8>d?c[d+1][8]=m:c[b-15+d][8]=m;for(d=0;15>d;d+=1)m=!f&&1==(e>>d&1),8>d?c[8][b-d-1]=m:9>d?c[8][15-d-1+1]=m:c[8][15-d-1]=m;c[b-8][8]=!f;if(7<=h){e=x.getBCHTypeNumber(h);
for(d=0;18>d;d+=1)m=!f&&1==(e>>d&1),c[Math.floor(d/3)][d%3+b-8-3]=m;for(d=0;18>d;d+=1)m=!f&&1==(e>>d&1),c[d%3+b-8-3][Math.floor(d/3)]=m}if(null==g){m=h;f=H.getRSBlocks(m,a);e=I();for(d=0;d<k.length;d+=1)r=k[d],e.put(r.getMode(),4),e.put(r.getLength(),x.getLengthInBits(r.getMode(),m)),r.write(e);for(d=m=0;d<f.length;d+=1)m+=f[d].dataCount;if(e.getLengthInBits()>8*m)throw"code length overflow. ("+e.getLengthInBits()+">"+8*m+")";for(e.getLengthInBits()+4<=8*m&&e.put(0,4);0!=e.getLengthInBits()%8;)e.putBit(!1);
for(;!(e.getLengthInBits()>=8*m);){e.put(236,8);if(e.getLengthInBits()>=8*m)break;e.put(17,8)}var A=0;m=d=0;r=Array(f.length);v=Array(f.length);for(u=0;u<f.length;u+=1){var E=f[u].dataCount,B=f[u].totalCount-E;d=Math.max(d,E);m=Math.max(m,B);r[u]=Array(E);for(t=0;t<r[u].length;t+=1)r[u][t]=255&e.getBuffer()[t+A];A+=E;t=x.getErrorCorrectPolynomial(B);E=D(r[u],t.getLength()-1).mod(t);v[u]=Array(t.getLength()-1);for(t=0;t<v[u].length;t+=1)B=t+E.getLength()-v[u].length,v[u][t]=0<=B?E.getAt(B):0}for(t=
e=0;t<f.length;t+=1)e+=f[t].totalCount;e=Array(e);for(t=A=0;t<d;t+=1)for(u=0;u<f.length;u+=1)t<r[u].length&&(e[A]=r[u][t],A+=1);for(t=0;t<m;t+=1)for(u=0;u<f.length;u+=1)t<v[u].length&&(e[A]=v[u][t],A+=1);g=e}f=g;e=-1;d=b-1;m=7;r=0;l=x.getMaskFunction(l);for(v=b-1;0<v;v-=2)for(6==v&&--v;;){for(u=0;2>u;u+=1)null==c[d][v-u]&&(t=!1,r<f.length&&(t=1==(f[r]>>>m&1)),l(d,v-u)&&(t=!t),c[d][v-u]=t,--m,-1==m&&(r+=1,m=7));d+=e;if(0>d||b<=d){d-=e;e=-e;break}}},y=function(f,l){for(var e=-1;7>=e;e+=1)if(!(-1>=f+
e||b<=f+e))for(var d=-1;7>=d;d+=1)-1>=l+d||b<=l+d||(c[f+e][l+d]=0<=e&&6>=e&&(0==d||6==d)||0<=d&&6>=d&&(0==e||6==e)||2<=e&&4>=e&&2<=d&&4>=d?!0:!1)};q.addData=function(f,l){l=l||"Byte";switch(l){case "Numeric":f=K(f);break;case "Alphanumeric":f=L(f);break;case "Byte":f=M(f);break;case "Kanji":f=N(f);break;default:throw"mode:"+l;}k.push(f);g=null};q.isDark=function(f,l){if(0>f||b<=f||0>l||b<=l)throw f+","+l;return c[f][l]};q.getModuleCount=function(){return b};q.make=function(){if(1>h){for(var f=1;40>
f;f++){for(var l=H.getRSBlocks(f,a),e=I(),d=0;d<k.length;d++){var m=k[d];e.put(m.getMode(),4);e.put(m.getLength(),x.getLengthInBits(m.getMode(),f));m.write(e)}for(d=m=0;d<l.length;d++)m+=l[d].dataCount;if(e.getLengthInBits()<=8*m)break}h=f}for(e=l=f=0;8>e;e+=1)if(z(!0,e),d=x.getLostPoint(q),0==e||f>d)f=d,l=e;z(!1,l)};q.createTableTag=function(f,l){f=f||2;l='<table style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: '+(("undefined"==typeof l?4*f:l)+'px;"><tbody>');
for(var e=0;e<q.getModuleCount();e+=1){l+="<tr>";for(var d=0;d<q.getModuleCount();d+=1)l+='<td style="',l+=" border-width: 0px; border-style: none;",l+=" border-collapse: collapse;",l+=" padding: 0px; margin: 0px;",l+=" width: "+f+"px;",l+=" height: "+f+"px;",l+=" background-color: ",l+=q.isDark(e,d)?"#000000":"#ffffff",l+=";",l+='"/>';l+="</tr>"}return l+"</tbody></table>"};q.createSvgTag=function(f,l,e,d){var m={};"object"==typeof f&&(m=f,f=m.cellSize,l=m.margin,e=m.alt,d=m.title);f=f||2;l="undefined"==
typeof l?4*f:l;e="string"===typeof e?{text:e}:e||{};e.text=e.text||null;e.id=e.text?e.id||"qrcode-description":null;d="string"===typeof d?{text:d}:d||{};d.text=d.text||null;d.id=d.text?d.id||"qrcode-title":null;var r=q.getModuleCount()*f+2*l;var v="l"+f+",0 0,"+f+" -"+f+",0 0,-"+f+"z ";m='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"'+(m.scalable?"":' width="'+r+'px" height="'+r+'px"');m=m+(' viewBox="0 0 '+r+" "+r+'" preserveAspectRatio="xMinYMin meet"')+(d.text||e.text?' role="img" aria-labelledby="'+
w([d.id,e.id].join(" ").trim())+'"':"");m+=">";m+=d.text?'<title id="'+w(d.id)+'">'+w(d.text)+"</title>":"";m+=e.text?'<description id="'+w(e.id)+'">'+w(e.text)+"</description>":"";m+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';m+='<path d="';for(r=0;r<q.getModuleCount();r+=1){var u=r*f+l;for(e=0;e<q.getModuleCount();e+=1)q.isDark(r,e)&&(d=e*f+l,m+="M"+d+","+u+v)}m+='" stroke="transparent" fill="black"/>';return m+="</svg>"};q.createDataURL=function(f,l){f=f||2;l="undefined"==
typeof l?4*f:l;var e=q.getModuleCount()*f+2*l,d=l,m=e-l;return O(e,e,function(r,v){return d<=r&&r<m&&d<=v&&v<m?q.isDark(Math.floor((v-d)/f),Math.floor((r-d)/f))?0:1:1})};q.createImgTag=function(f,l,e){f=f||2;l="undefined"==typeof l?4*f:l;var d=q.getModuleCount()*f+2*l;f='<img src="'+q.createDataURL(f,l);f=f+'" width="'+d+'" height="';f=f+d+'"';e&&(f+=' alt="',f+=w(e),f+='"');return f+="/>"};var w=function(f){for(var l="",e=0;e<f.length;e+=1){var d=f.charAt(e);switch(d){case "<":l+="<";break;case ">":l+=
">";break;case "&":l+="&";break;case '"':l+=""";break;default:l+=d}}return l};q.createASCII=function(f,l){f=f||1;if(2>f){f=l;f="undefined"==typeof f?2:f;var e=1*q.getModuleCount()+2*f,d=f;l=e-f;var m,r,v={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},u={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},t="";for(m=0;m<e;m+=2){var A=Math.floor(m-d);var E=Math.floor(m+1-d);for(r=0;r<e;r+=1){var B="\u2588";d<=r&&r<l&&d<=m&&m<l&&q.isDark(A,Math.floor(r-
d))&&(B=" ");B=d<=r&&r<l&&d<=m+1&&m+1<l&&q.isDark(E,Math.floor(r-d))?B+" ":B+"\u2588";t+=1>f&&m+1>=l?u[B]:v[B]}t+="\n"}f=e%2&&0<f?t.substring(0,t.length-e-1)+Array(e+1).join("\u2580"):t.substring(0,t.length-1);return f}--f;l="undefined"==typeof l?2*f:l;e=q.getModuleCount()*f+2*l;d=l;l=e-l;B=Array(f+1).join("\u2588\u2588");v=Array(f+1).join(" ");u="";for(m=0;m<e;m+=1){A=Math.floor((m-d)/f);t="";for(r=0;r<e;r+=1)E=1,d<=r&&r<l&&d<=m&&m<l&&q.isDark(A,Math.floor((r-d)/f))&&(E=0),t+=E?B:v;for(A=0;A<f;A+=
1)u+=t+"\n"}return u.substring(0,u.length-1)};q.renderTo2dContext=function(f,l){l=l||2;for(var e=q.getModuleCount(),d=0;d<e;d++)for(var m=0;m<e;m++)f.fillStyle=q.isDark(d,m)?"black":"white",f.fillRect(d*l,m*l,l,l)};return q};C.stringToBytesFuncs={"default":function(n){for(var p=[],h=0;h<n.length;h+=1){var a=n.charCodeAt(h);p.push(a&255)}return p}};C.stringToBytes=C.stringToBytesFuncs["default"];C.createStringToBytes=function(n,p){var h=function(){for(var a=P(n),c=function(){var w=a.read();if(-1==
w)throw"eof";return w},b=0,g={};;){var k=a.read();if(-1==k)break;var q=c(),z=c(),y=c();k=String.fromCharCode(k<<8|q);g[k]=z<<8|y;b+=1}if(b!=p)throw b+" != "+p;return g}();return function(a){for(var c=[],b=0;b<a.length;b+=1){var g=a.charCodeAt(b);128>g?c.push(g):(g=h[a.charAt(b)],"number"==typeof g?(g&255)==g?c.push(g):(c.push(g>>>8),c.push(g&255)):c.push(63))}return c}};var F={L:1,M:0,Q:3,H:2},x=function(){var n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,
54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],
[6,30,58,86,114,142,170]],p={},h=function(a){for(var c=0;0!=a;)c+=1,a>>>=1;return c};p.getBCHTypeInfo=function(a){for(var c=a<<10;0<=h(c)-h(1335);)c^=1335<<h(c)-h(1335);return(a<<10|c)^21522};p.getBCHTypeNumber=function(a){for(var c=a<<12;0<=h(c)-h(7973);)c^=7973<<h(c)-h(7973);return a<<12|c};p.getPatternPosition=function(a){return n[a-1]};p.getMaskFunction=function(a){switch(a){case 0:return function(c,b){return 0==(c+b)%2};case 1:return function(c,b){return 0==c%2};case 2:return function(c,b){return 0==
b%3};case 3:return function(c,b){return 0==(c+b)%3};case 4:return function(c,b){return 0==(Math.floor(c/2)+Math.floor(b/3))%2};case 5:return function(c,b){return 0==c*b%2+c*b%3};case 6:return function(c,b){return 0==(c*b%2+c*b%3)%2};case 7:return function(c,b){return 0==(c*b%3+(c+b)%2)%2};default:throw"bad maskPattern:"+a;}};p.getErrorCorrectPolynomial=function(a){for(var c=D([1],0),b=0;b<a;b+=1)c=c.multiply(D([1,G.gexp(b)],0));return c};p.getLengthInBits=function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;
case 2:return 9;case 4:return 8;case 8:return 8;default:throw"mode:"+a;}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+a;}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+a;}else throw"type:"+c;};p.getLostPoint=function(a){for(var c=a.getModuleCount(),b=0,g=0;g<c;g+=1)for(var k=0;k<c;k+=1){for(var q=0,z=a.isDark(g,k),y=-1;1>=y;y+=1)if(!(0>g+y||c<=g+y))for(var w=-1;1>=w;w+=
1)0>k+w||c<=k+w||(0!=y||0!=w)&&z==a.isDark(g+y,k+w)&&(q+=1);5<q&&(b+=3+q-5)}for(g=0;g<c-1;g+=1)for(k=0;k<c-1;k+=1)if(q=0,a.isDark(g,k)&&(q+=1),a.isDark(g+1,k)&&(q+=1),a.isDark(g,k+1)&&(q+=1),a.isDark(g+1,k+1)&&(q+=1),0==q||4==q)b+=3;for(g=0;g<c;g+=1)for(k=0;k<c-6;k+=1)a.isDark(g,k)&&!a.isDark(g,k+1)&&a.isDark(g,k+2)&&a.isDark(g,k+3)&&a.isDark(g,k+4)&&!a.isDark(g,k+5)&&a.isDark(g,k+6)&&(b+=40);for(k=0;k<c;k+=1)for(g=0;g<c-6;g+=1)a.isDark(g,k)&&!a.isDark(g+1,k)&&a.isDark(g+2,k)&&a.isDark(g+3,k)&&a.isDark(g+
4,k)&&!a.isDark(g+5,k)&&a.isDark(g+6,k)&&(b+=40);for(k=q=0;k<c;k+=1)for(g=0;g<c;g+=1)a.isDark(g,k)&&(q+=1);return b+Math.abs(100*q/c/c-50)/5*10};return p}(),G=function(){for(var n=Array(256),p=Array(256),h=0;8>h;h+=1)n[h]=1<<h;for(h=8;256>h;h+=1)n[h]=n[h-4]^n[h-5]^n[h-6]^n[h-8];for(h=0;255>h;h+=1)p[n[h]]=h;return{glog:function(a){if(1>a)throw"glog("+a+")";return p[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return n[a]}}}(),H=function(){var n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],
[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,
51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,
151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,
46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,
145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],
[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],p={},h=function(a,c){switch(c){case F.L:return n[4*(a-1)];case F.M:return n[4*(a-1)+1];case F.Q:return n[4*(a-1)+2];case F.H:return n[4*(a-1)+3]}};p.getRSBlocks=function(a,c){var b=h(a,c);if("undefined"==
typeof b)throw"bad rs block @ typeNumber:"+a+"/errorCorrectionLevel:"+c;a=b.length/3;c=[];for(var g=0;g<a;g+=1)for(var k=b[3*g],q=b[3*g+1],z=b[3*g+2],y=0;y<k;y+=1){var w=c,f=w.push,l=z,e={};e.totalCount=q;e.dataCount=l;f.call(w,e)}return c};return p}(),I=function(){var n=[],p=0,h={getBuffer:function(){return n},getAt:function(a){return 1==(n[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var b=0;b<c;b+=1)h.putBit(1==(a>>>c-b-1&1))},getLengthInBits:function(){return p},putBit:function(a){var c=
Math.floor(p/8);n.length<=c&&n.push(0);a&&(n[c]|=128>>>p%8);p+=1}};return h},K=function(n){var p=function(h){for(var a=0,c=0;c<h.length;c+=1){a*=10;var b=h.charAt(c);if("0"<=b&&"9">=b)b=b.charCodeAt(0)-48;else throw"illegal char :"+b;a+=b}return a};return{getMode:function(){return 1},getLength:function(h){return n.length},write:function(h){for(var a=0;a+2<n.length;)h.put(p(n.substring(a,a+3)),10),a+=3;a<n.length&&(1==n.length-a?h.put(p(n.substring(a,a+1)),4):2==n.length-a&&h.put(p(n.substring(a,a+
2)),7))}}},L=function(n){var p=function(h){if("0"<=h&&"9">=h)return h.charCodeAt(0)-48;if("A"<=h&&"Z">=h)return h.charCodeAt(0)-65+10;switch(h){case " ":return 36;case "$":return 37;case "%":return 38;case "*":return 39;case "+":return 40;case "-":return 41;case ".":return 42;case "/":return 43;case ":":return 44;default:throw"illegal char :"+h;}};return{getMode:function(){return 2},getLength:function(h){return n.length},write:function(h){for(var a=0;a+1<n.length;)h.put(45*p(n.charAt(a))+p(n.charAt(a+
1)),11),a+=2;a<n.length&&h.put(p(n.charAt(a)),6)}}},M=function(n){var p=C.stringToBytes(n);return{getMode:function(){return 4},getLength:function(h){return p.length},write:function(h){for(var a=0;a<p.length;a+=1)h.put(p[a],8)}}},N=function(n){var p=C.stringToBytesFuncs.SJIS;if(!p)throw"sjis not supported.";!function(a,c){a=p(a);if(2!=a.length||(a[0]<<8|a[1])!=c)throw"sjis not supported.";}("\u53cb",38726);var h=p(n);return{getMode:function(){return 8},getLength:function(a){return~~(h.length/2)},write:function(a){for(var c=
0;c+1<h.length;){var b=(255&h[c])<<8|255&h[c+1];if(33088<=b&&40956>=b)b-=33088;else if(57408<=b&&60351>=b)b-=49472;else throw"illegal char at "+(c+1)+"/"+b;b=192*(b>>>8&255)+(b&255);a.put(b,13);c+=2}if(c<h.length)throw"illegal char at "+(c+1);}}},J=function(){var n=[],p={writeByte:function(h){n.push(h&255)},writeShort:function(h){p.writeByte(h);p.writeByte(h>>>8)},writeBytes:function(h,a,c){a=a||0;c=c||h.length;for(var b=0;b<c;b+=1)p.writeByte(h[b+a])},writeString:function(h){for(var a=0;a<h.length;a+=
1)p.writeByte(h.charCodeAt(a))},toByteArray:function(){return n},toString:function(){var h="[";for(var a=0;a<n.length;a+=1)0<a&&(h+=","),h+=n[a];return h+"]"}};return p},Q=function(){var n=0,p=0,h=0,a="",c={},b=function(g){if(!(0>g)){if(26>g)return 65+g;if(52>g)return 97+(g-26);if(62>g)return 48+(g-52);if(62==g)return 43;if(63==g)return 47}throw"n:"+g;};c.writeByte=function(g){n=n<<8|g&255;p+=8;for(h+=1;6<=p;)a+=String.fromCharCode(b(n>>>p-6&63)),p-=6};c.flush=function(){0<p&&(a+=String.fromCharCode(b(n<<
6-p&63)),p=n=0);if(0!=h%3)for(var g=3-h%3,k=0;k<g;k+=1)a+="="};c.toString=function(){return a};return c},P=function(n){var p=0,h=0,a=0,c=function(b){if(65<=b&&90>=b)return b-65;if(97<=b&&122>=b)return b-97+26;if(48<=b&&57>=b)return b-48+52;if(43==b)return 62;if(47==b)return 63;throw"c:"+b;};return{read:function(){for(;8>a;){if(p>=n.length){if(0==a)return-1;throw"unexpected end of file./"+a;}var b=n.charAt(p);p+=1;if("="==b)return a=0,-1;b.match(/^\s$/)||(h=h<<6|c(b.charCodeAt(0)),a+=6)}b=h>>>a-8&
255;a-=8;return b}}},R=function(n,p){var h=Array(n*p),a=function(b){var g=0,k=0;return{write:function(q,z){if(0!=q>>>z)throw"length over";for(;8<=g+z;)b.writeByte(255&(q<<g|k)),z-=8-g,q>>>=8-g,g=k=0;k|=q<<g;g+=z},flush:function(){0<g&&b.writeByte(k)}}},c=function(){var b={},g=0,k={add:function(q){if(k.contains(q))throw"dup key:"+q;b[q]=g;g+=1},size:function(){return g},indexOf:function(q){return b[q]},contains:function(q){return"undefined"!=typeof b[q]}};return k};return{setPixel:function(b,g,k){h[g*
n+b]=k},write:function(b){b.writeString("GIF87a");b.writeShort(n);b.writeShort(p);b.writeByte(128);b.writeByte(0);b.writeByte(0);b.writeByte(0);b.writeByte(0);b.writeByte(0);b.writeByte(255);b.writeByte(255);b.writeByte(255);b.writeString(",");b.writeShort(0);b.writeShort(0);b.writeShort(n);b.writeShort(p);b.writeByte(0);var g=3;for(var k=c(),q=0;4>q;q+=1)k.add(String.fromCharCode(q));k.add(String.fromCharCode(4));k.add(String.fromCharCode(5));q=J();var z=a(q);z.write(4,g);var y=0,w=String.fromCharCode(h[y]);
for(y+=1;y<h.length;){var f=String.fromCharCode(h[y]);y+=1;k.contains(w+f)?w+=f:(z.write(k.indexOf(w),g),4095>k.size()&&(k.size()==1<<g&&(g+=1),k.add(w+f)),w=f)}z.write(k.indexOf(w),g);z.write(5,g);z.flush();g=q.toByteArray();b.writeByte(2);for(k=0;255<g.length-k;)b.writeByte(255),b.writeBytes(g,k,255),k+=255;b.writeByte(g.length-k);b.writeBytes(g,k,g.length-k);b.writeByte(0);b.writeString(";")}}},O=function(n,p,h){for(var a=R(n,p),c=0;c<p;c+=1)for(var b=0;b<n;b+=1)a.setPixel(b,c,h(b,c));n=J();a.write(n);
a=Q();n=n.toByteArray();for(p=0;p<n.length;p+=1)a.writeByte(n[p]);a.flush();return"data:image/gif;base64,"+a};return C}();!function(){qrcode.stringToBytesFuncs["UTF-8"]=function(D){for(var C=[],F=0;F<D.length;F++){var x=D.charCodeAt(F);128>x?C.push(x):2048>x?C.push(192|x>>6,128|x&63):55296>x||57344<=x?C.push(224|x>>12,128|x>>6&63,128|x&63):(F++,x=65536+((x&1023)<<10|D.charCodeAt(F)&1023),C.push(240|x>>18,128|x>>12&63,128|x>>6&63,128|x&63))}return C}}();
(function(D){"function"===typeof define&&define.amd?define([],D):"object"===typeof exports&&(module.exports=D())})(function(){return qrcode});