var qrcode=function(){function y(h,k){if("undefined"==typeof h.length)throw Error(h.length+"/"+k);var f=function(){for(var a=0;a<h.length&&0==h[a];)a+=1;for(var d=Array(h.length-a+k),b=0;b<h.length-a;b+=1)d[b]=h[b+a];return d}(),c={getAt:function(a){return f[a]},getLength:function(){return f.length},multiply:function(a){for(var d=Array(c.getLength()+a.getLength()-1),b=0;b<c.getLength();b+=1)for(var e=0;e<a.getLength();e+=1)d[b+e]^=t.gexp(t.glog(c.getAt(b))+t.glog(a.getAt(e)));return y(d,0)},mod:function(a){if(0>
c.getLength()-a.getLength())return c;for(var d=t.glog(c.getAt(0))-t.glog(a.getAt(0)),b=Array(c.getLength()),e=0;e<c.getLength();e+=1)b[e]=c.getAt(e);for(e=0;e<a.getLength();e+=1)b[e]^=t.gexp(t.glog(a.getAt(e))+d);return y(b,0).mod(a)}};return c}var A=function(h,k){var f=h,c=w[k],a=null,d=0,b=null,e=[],p={},u=function(h,k){for(var l=d=4*f+17,g=Array(l),n=0;n<l;n+=1){g[n]=Array(l);for(var m=0;m<l;m+=1)g[n][m]=null}a=g;z(0,0);z(d-7,0);z(0,d-7);l=x.getPatternPosition(f);for(g=0;g<l.length;g+=1)for(n=
0;n<l.length;n+=1){m=l[g];var p=l[n];if(null==a[m][p])for(var v=-2;2>=v;v+=1)for(var q=-2;2>=q;q+=1)a[m+v][p+q]=-2==v||2==v||-2==q||2==q||0==v&&0==q?!0:!1}for(l=8;l<d-8;l+=1)null==a[l][6]&&(a[l][6]=0==l%2);for(l=8;l<d-8;l+=1)null==a[6][l]&&(a[6][l]=0==l%2);l=x.getBCHTypeInfo(c<<3|k);for(g=0;15>g;g+=1)n=!h&&1==(l>>g&1),6>g?a[g][8]=n:8>g?a[g+1][8]=n:a[d-15+g][8]=n;for(g=0;15>g;g+=1)n=!h&&1==(l>>g&1),8>g?a[8][d-g-1]=n:9>g?a[8][15-g-1+1]=n:a[8][15-g-1]=n;a[d-8][8]=!h;if(7<=f){l=x.getBCHTypeNumber(f);
for(g=0;18>g;g+=1)n=!h&&1==(l>>g&1),a[Math.floor(g/3)][g%3+d-8-3]=n;for(g=0;18>g;g+=1)n=!h&&1==(l>>g&1),a[g%3+d-8-3][Math.floor(g/3)]=n}if(null==b){m=f;l=B.getRSBlocks(m,c);g=C();for(n=0;n<e.length;n+=1)p=e[n],g.put(p.getMode(),4),g.put(p.getLength(),x.getLengthInBits(p.getMode(),m)),p.write(g);for(n=m=0;n<l.length;n+=1)m+=l[n].dataCount;if(g.getLengthInBits()>8*m)throw Error("code length overflow. ("+g.getLengthInBits()+">"+8*m+")");for(g.getLengthInBits()+4<=8*m&&g.put(0,4);0!=g.getLengthInBits()%
8;)g.putBit(!1);for(;!(g.getLengthInBits()>=8*m);){g.put(236,8);if(g.getLengthInBits()>=8*m)break;g.put(17,8)}var u=0;m=n=0;p=Array(l.length);v=Array(l.length);for(q=0;q<l.length;q+=1){var t=l[q].dataCount,w=l[q].totalCount-t;n=Math.max(n,t);m=Math.max(m,w);p[q]=Array(t);for(var r=0;r<p[q].length;r+=1)p[q][r]=255&g.getBuffer()[r+u];u+=t;r=x.getErrorCorrectPolynomial(w);t=y(p[q],r.getLength()-1).mod(r);v[q]=Array(r.getLength()-1);for(r=0;r<v[q].length;r+=1)w=r+t.getLength()-v[q].length,v[q][r]=0<=
w?t.getAt(w):0}for(r=g=0;r<l.length;r+=1)g+=l[r].totalCount;g=Array(g);for(r=u=0;r<n;r+=1)for(q=0;q<l.length;q+=1)r<p[q].length&&(g[u]=p[q][r],u+=1);for(r=0;r<m;r+=1)for(q=0;q<l.length;q+=1)r<v[q].length&&(g[u]=v[q][r],u+=1);b=g}l=b;g=-1;n=d-1;m=7;p=0;v=x.getMaskFunction(k);for(q=d-1;0<q;q-=2)for(6==q&&--q;;){for(r=0;2>r;r+=1)null==a[n][q-r]&&(u=!1,p<l.length&&(u=1==(l[p]>>>m&1)),v(n,q-r)&&(u=!u),a[n][q-r]=u,--m,-1==m&&(p+=1,m=7));n+=g;if(0>n||d<=n){n-=g;g=-g;break}}},z=function(b,c){for(var e=-1;7>=
e;e+=1)if(!(-1>=b+e||d<=b+e))for(var g=-1;7>=g;g+=1)-1>=c+g||d<=c+g||(a[b+e][c+g]=0<=e&&6>=e&&(0==g||6==g)||0<=g&&6>=g&&(0==e||6==e)||2<=e&&4>=e&&2<=g&&4>=g?!0:!1)};p.addData=function(a){a=E(a);e.push(a);b=null};p.isDark=function(b,c){if(0>b||d<=b||0>c||d<=c)throw Error(b+","+c);return a[b][c]};p.getModuleCount=function(){return d};p.make=function(){if(0>f){for(var a=1;10>a;a++){for(var d=B.getRSBlocks(a,c),b=C(),g=0;g<e.length;g+=1){var h=e[g];b.put(h.getMode(),4);b.put(h.getLength(),x.getLengthInBits(h.getMode(),
a));h.write(b)}for(g=h=0;g<d.length;g+=1)h+=d[g].dataCount;if(b.getLengthInBits()<=8*h)break}f=a}for(b=d=a=0;8>b;b+=1)if(u(!0,b),g=x.getLostPoint(p),0==b||a>g)a=g,d=b;u(!1,d)};p.createTableTag=function(a,d){a=a||2;var b='<table class="m-auto" style=" border-width: 0px; border-style: none; border-collapse: collapse;'+(" padding: 0px; margin: "+("undefined"==typeof d?4*a:d)+"px;")+'"><tbody>';for(var c=0;c<p.getModuleCount();c+=1){b+="<tr>";for(var e=0;e<p.getModuleCount();e+=1)b+='<td style="',b+=
" border-width: 0px; border-style: none;",b+=" border-collapse: collapse;",b+=" padding: 0px; margin: 0px;",b+=" width: "+a+"px;",b+=" height: "+a+"px;",b+=" background-color: ",b+=p.isDark(c,e)?"#000000":"#ffffff",b+=";",b+='"/>';b+="</tr>"}return b+"</tbody></table>"};p.createImgTag=function(a,b){a=a||2;b="undefined"==typeof b?4*a:b;var d=p.getModuleCount()*a+2*b,c=b,e=d-b;return F(d,d,function(b,d){return c<=b&&b<e&&c<=d&&d<e?p.isDark(Math.floor((d-c)/a),Math.floor((b-c)/a))?0:1:1})};return p};
A.stringToBytes=function(h){for(var k=[],f=0;f<h.length;f+=1){var c=h.charCodeAt(f);k.push(c&255)}return k};A.createStringToBytes=function(h,k){var f=function(){for(var c=G(h),a=function(){var a=c.read();if(-1==a)throw Error();return a},d=0,b={};;){var e=c.read();if(-1==e)break;var f=a(),u=a(),z=a();e=String.fromCharCode(e<<8|f);b[e]=u<<8|z;d+=1}if(d!=k)throw Error(d+" != "+k);return b}();return function(c){for(var a=[],d=0;d<c.length;d+=1){var b=c.charCodeAt(d);128>b?a.push(b):(b=f[c.charAt(d)],
"number"==typeof b?(b&255)==b?a.push(b):(a.push(b>>>8),a.push(b&255)):a.push(63))}return a}};var w={L:1,M:0,Q:3,H:2},x=function(){var h=[[],[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]],k={},f=function(c){for(var a=0;0!=c;)a+=1,c>>>=1;return a};k.getBCHTypeInfo=function(c){for(var a=c<<10;0<=f(a)-f(1335);)a^=1335<<f(a)-f(1335);return(c<<10|a)^21522};k.getBCHTypeNumber=function(c){for(var a=c<<12;0<=f(a)-f(7973);)a^=7973<<f(a)-f(7973);return c<<
12|a};k.getPatternPosition=function(c){return h[c-1]};k.getMaskFunction=function(c){switch(c){case 0:return function(a,d){return 0==(a+d)%2};case 1:return function(a,d){return 0==a%2};case 2:return function(a,d){return 0==d%3};case 3:return function(a,d){return 0==(a+d)%3};case 4:return function(a,d){return 0==(Math.floor(a/2)+Math.floor(d/3))%2};case 5:return function(a,d){return 0==a*d%2+a*d%3};case 6:return function(a,d){return 0==(a*d%2+a*d%3)%2};case 7:return function(a,d){return 0==(a*d%3+(a+
d)%2)%2};default:throw Error("bad maskPattern:"+c);}};k.getErrorCorrectPolynomial=function(c){for(var a=y([1],0),d=0;d<c;d+=1)a=a.multiply(y([1,t.gexp(d)],0));return a};k.getLengthInBits=function(c,a){if(1<=a&&10>a)switch(c){case 1:return 10;case 2:return 9;case 4:return 8;case 8:return 8;default:throw Error("mode:"+c);}else if(27>a)switch(c){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw Error("mode:"+c);}else if(41>a)switch(c){case 1:return 14;case 2:return 13;
case 4:return 16;case 8:return 12;default:throw Error("mode:"+c);}else throw Error("type:"+a);};k.getLostPoint=function(c){for(var a=c.getModuleCount(),d=0,b=0;b<a;b+=1)for(var e=0;e<a;e+=1){for(var f=0,h=c.isDark(b,e),k=-1;1>=k;k+=1)if(!(0>b+k||a<=b+k))for(var m=-1;1>=m;m+=1)0>e+m||a<=e+m||(0!=k||0!=m)&&h==c.isDark(b+k,e+m)&&(f+=1);5<f&&(d+=3+f-5)}for(b=0;b<a-1;b+=1)for(e=0;e<a-1;e+=1)if(f=0,c.isDark(b,e)&&(f+=1),c.isDark(b+1,e)&&(f+=1),c.isDark(b,e+1)&&(f+=1),c.isDark(b+1,e+1)&&(f+=1),0==f||4==
f)d+=3;for(b=0;b<a;b+=1)for(e=0;e<a-6;e+=1)c.isDark(b,e)&&!c.isDark(b,e+1)&&c.isDark(b,e+2)&&c.isDark(b,e+3)&&c.isDark(b,e+4)&&!c.isDark(b,e+5)&&c.isDark(b,e+6)&&(d+=40);for(e=0;e<a;e+=1)for(b=0;b<a-6;b+=1)c.isDark(b,e)&&!c.isDark(b+1,e)&&c.isDark(b+2,e)&&c.isDark(b+3,e)&&c.isDark(b+4,e)&&!c.isDark(b+5,e)&&c.isDark(b+6,e)&&(d+=40);for(e=f=0;e<a;e+=1)for(b=0;b<a;b+=1)c.isDark(b,e)&&(f+=1);return d+Math.abs(100*f/a/a-50)/5*10};return k}(),t=function(){for(var h=Array(256),k=Array(256),f=0;8>f;f+=1)h[f]=
1<<f;for(f=8;256>f;f+=1)h[f]=h[f-4]^h[f-5]^h[f-6]^h[f-8];for(f=0;255>f;f+=1)k[h[f]]=f;return{glog:function(c){if(1>c)throw Error("glog("+c+")");return k[c]},gexp:function(c){for(;0>c;)c+=255;for(;256<=c;)c-=255;return h[c]}}}(),B=function(){var h=[[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]],k=function(a,d){var b={};b.totalCount=a;b.dataCount=d;return b},f={},c=function(a,d){switch(d){case w.L:return h[4*(a-1)];case w.M:return h[4*(a-1)+1];case w.Q:return h[4*(a-1)+2];case w.H:return h[4*(a-1)+3]}};f.getRSBlocks=function(a,d){var b=
c(a,d);if("undefined"==typeof b)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+d);for(var e=b.length/3,f=[],h=0;h<e;h+=1)for(var t=b[3*h],m=b[3*h+1],v=b[3*h+2],l=0;l<t;l+=1)f.push(k(m,v));return f};return f}(),C=function(){var h=[],k=0,f={getBuffer:function(){return h},getAt:function(c){return 1==(h[Math.floor(c/8)]>>>7-c%8&1)},put:function(c,a){for(var d=0;d<a;d+=1)f.putBit(1==(c>>>a-d-1&1))},getLengthInBits:function(){return k},putBit:function(c){var a=Math.floor(k/8);h.length<=
a&&h.push(0);c&&(h[a]|=128>>>k%8);k+=1}};return f},E=function(h){var k=A.stringToBytes(h);return{getMode:function(){return 4},getLength:function(f){return k.length},write:function(f){for(var c=0;c<k.length;c+=1)f.put(k[c],8)}}},D=function(){var h=[],k={writeByte:function(f){h.push(f&255)},writeShort:function(f){k.writeByte(f);k.writeByte(f>>>8)},writeBytes:function(f,c,a){c=c||0;a=a||f.length;for(var d=0;d<a;d+=1)k.writeByte(f[d+c])},writeString:function(f){for(var c=0;c<f.length;c+=1)k.writeByte(f.charCodeAt(c))},
toByteArray:function(){return h},toString:function(){var f="[";for(var c=0;c<h.length;c+=1)0<c&&(f+=","),f+=h[c];return f+"]"}};return k},H=function(){var h=0,k=0,f=0,c="",a={},d=function(a){if(!(0>a)){if(26>a)return 65+a;if(52>a)return 97+(a-26);if(62>a)return 48+(a-52);if(62==a)return 43;if(63==a)return 47}throw Error("n:"+a);};a.writeByte=function(a){h=h<<8|a&255;k+=8;for(f+=1;6<=k;)c+=String.fromCharCode(d(h>>>k-6&63)),k-=6};a.flush=function(){0<k&&(c+=String.fromCharCode(d(h<<6-k&63)),k=h=0);
if(0!=f%3)for(var a=3-f%3,e=0;e<a;e+=1)c+="="};a.toString=function(){return c};return a},G=function(h){var k=0,f=0,c=0,a=function(a){if(65<=a&&90>=a)return a-65;if(97<=a&&122>=a)return a-97+26;if(48<=a&&57>=a)return a-48+52;if(43==a)return 62;if(47==a)return 63;throw Error("c:"+a);};return{read:function(){for(;8>c;){if(k>=h.length){if(0==c)return-1;throw Error("unexpected end of file./"+c);}var d=h.charAt(k);k+=1;if("="==d)return c=0,-1;d.match(/^\s$/)||(f=f<<6|a(d.charCodeAt(0)),c+=6)}d=f>>>c-8&
255;c-=8;return d}}},I=function(h,k){var f=Array(h*k),c=function(a){var b=0,d=0;return{write:function(c,e){if(0!=c>>>e)throw Error("length over");for(;8<=b+e;)a.writeByte(255&(c<<b|d)),e-=8-b,c>>>=8-b,b=d=0;d|=c<<b;b+=e},flush:function(){0<b&&a.writeByte(d)}}},a=function(){var a={},b=0,c={add:function(d){if(c.contains(d))throw Error("dup key:"+d);a[d]=b;b+=1},size:function(){return b},indexOf:function(b){return a[b]},contains:function(b){return"undefined"!=typeof a[b]}};return c};return{setPixel:function(a,
b,c){f[b*h+a]=c},write:function(d){d.writeString("GIF87a");d.writeShort(h);d.writeShort(k);d.writeByte(128);d.writeByte(0);d.writeByte(0);d.writeByte(0);d.writeByte(0);d.writeByte(0);d.writeByte(255);d.writeByte(255);d.writeByte(255);d.writeString(",");d.writeShort(0);d.writeShort(0);d.writeShort(h);d.writeShort(k);d.writeByte(0);var b=3;for(var e=a(),p=0;4>p;p+=1)e.add(String.fromCharCode(p));e.add(String.fromCharCode(4));e.add(String.fromCharCode(5));p=D();var u=c(p);u.write(4,b);var t=0,m=String.fromCharCode(f[t]);
for(t+=1;t<f.length;){var v=String.fromCharCode(f[t]);t+=1;e.contains(m+v)?m+=v:(u.write(e.indexOf(m),b),4095>e.length&&(e.length==1<<b&&(b+=1),e.add(m+v)),m=v)}u.write(e.indexOf(m),b);u.write(5,b);u.flush();b=p.toByteArray();d.writeByte(2);for(e=0;255<b.length-e;)d.writeByte(255),d.writeBytes(b,e,255),e+=255;d.writeByte(b.length-e);d.writeBytes(b,e,b.length-e);d.writeByte(0);d.writeString(";")}}},F=function(h,k,f,c){for(var a=I(h,k),d=0;d<k;d+=1)for(var b=0;b<h;b+=1)a.setPixel(b,d,f(b,d));f=D();
a.write(f);a=H();f=f.toByteArray();for(d=0;d<f.length;d+=1)a.writeByte(f[d]);a.flush();a='<img src="data:image/gif;base64,'+a+'" width="';a+=h;a+='"';a+=' height="';a+=k;a+='"';c&&(a+=' alt="',a+=c,a+='"');return a+="/>"};return A}();//---------------------------------------------------------------------
