Files
wysite/hc-pos.sqygj.cn/static/js/chunk-2d221443.238cb7c7.js

1 line
21 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221443"],{ca2a:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=function(t,e){const n=236,r=17;let o=t;const u=i[e];let c=null,p=0,y=null;const A=[],B={},k=function(t,e){p=4*o+17,c=function(t){const e=new Array(t);for(let n=0;n<t;n+=1){e[n]=new Array(t);for(let r=0;r<t;r+=1)e[n][r]=null}return e}(p),T(0,0),T(p-7,0),T(0,p-7),b(),D(),L(t,e),o>=7&&E(t),null==y&&(y=N(o,u,A)),x(y,e)},T=function(t,e){for(let n=-1;n<=7;n+=1)if(!(t+n<=-1||p<=t+n))for(let r=-1;r<=7;r+=1)e+r<=-1||p<=e+r||(c[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},C=function(){let t=0,e=0;for(let n=0;n<8;n+=1){k(!0,n);const r=l.getLostPoint(B);(0==n||t>r)&&(t=r,e=n)}return e},D=function(){for(let t=8;t<p-8;t+=1)null==c[t][6]&&(c[t][6]=t%2==0);for(let t=8;t<p-8;t+=1)null==c[6][t]&&(c[6][t]=t%2==0)},b=function(){const t=l.getPatternPosition(o);for(let e=0;e<t.length;e+=1)for(let n=0;n<t.length;n+=1){const r=t[e],o=t[n];if(null==c[r][o])for(let t=-2;t<=2;t+=1)for(let e=-2;e<=2;e+=1)c[r+t][o+e]=-2==t||2==t||-2==e||2==e||0==t&&0==e}},E=function(t){const e=l.getBCHTypeNumber(o);for(let n=0;n<18;n+=1){const r=!t&&1==(e>>n&1);c[Math.floor(n/3)][n%3+p-8-3]=r}for(let n=0;n<18;n+=1){const r=!t&&1==(e>>n&1);c[n%3+p-8-3][Math.floor(n/3)]=r}},L=function(t,e){const n=u<<3|e,r=l.getBCHTypeInfo(n);for(let o=0;o<15;o+=1){const e=!t&&1==(r>>o&1);o<6?c[o][8]=e:o<8?c[o+1][8]=e:c[p-15+o][8]=e}for(let o=0;o<15;o+=1){const e=!t&&1==(r>>o&1);o<8?c[8][p-o-1]=e:o<9?c[8][15-o-1+1]=e:c[8][15-o-1]=e}c[p-8][8]=!t},x=function(t,e){let n=-1,r=p-1,o=7,i=0;const u=l.getMaskFunction(e);for(let l=p-1;l>0;l-=2){6==l&&(l-=1);while(1){for(let e=0;e<2;e+=1)if(null==c[r][l-e]){let n=!1;i<t.length&&(n=1==(t[i]>>>o&1));const f=u(r,l-e);f&&(n=!n),c[r][l-e]=n,o-=1,-1==o&&(i+=1,o=7)}if(r+=n,r<0||p<=r){r-=n,n=-n;break}}}},m=function(t,e){let n=0,r=0,o=0;const i=new Array(e.length),u=new Array(e.length);for(let g=0;g<e.length;g+=1){const c=e[g].dataCount,s=e[g].totalCount-c;r=Math.max(r,c),o=Math.max(o,s),i[g]=new Array(c);for(let e=0;e<i[g].length;e+=1)i[g][e]=255&t.getBuffer()[e+n];n+=c;const a=l.getErrorCorrectPolynomial(s),h=f(i[g],a.getLength()-1),d=h.mod(a);u[g]=new Array(a.getLength()-1);for(let t=0;t<u[g].length;t+=1){const e=t+d.getLength()-u[g].length;u[g][t]=e>=0?d.getAt(e):0}}let c=0;for(let l=0;l<e.length;l+=1)c+=e[l].totalCount;const s=new Array(c);let a=0;for(let l=0;l<r;l+=1)for(let t=0;t<e.length;t+=1)l<i[t].length&&(s[a]=i[t][l],a+=1);for(let l=0;l<o;l+=1)for(let t=0;t<e.length;t+=1)l<u[t].length&&(s[a]=u[t][l],a+=1);return s},N=function(t,e,o){const i=s.getRSBlocks(t,e),u=a();for(let n=0;n<o.length;n+=1){const e=o[n];u.put(e.getMode(),4),u.put(e.getLength(),l.getLengthInBits(e.getMode(),t)),e.write(u)}let c=0;for(let n=0;n<i.length;n+=1)c+=i[n].dataCount;if(u.getLengthInBits()>8*c)throw"code length overflow. ("+u.getLengthInBits()+">"+8*c+")";u.getLengthInBits()+4<=8*c&&u.put(0,4);while(u.getLengthInBits()%8!=0)u.putBit(!1);while(1){if(u.getLengthInBits()>=8*c)break;if(u.put(n,8),u.getLengthInBits()>=8*c)break;u.put(r,8)}return m(u,i)};B.addData=function(t,e){e=e||"Byte";let n=null;switch(e){case"Numeric":n=g(t);break;case"Alphanumeric":n=h(t);break;case"Byte":n=d(t);break;case"Kanji":n=w(t);break;default:throw"mode:"+e}A.push(n),y=null},B.isDark=function(t,e){if(t<0||p<=t||e<0||p<=e)throw t+","+e;return c[t][e]},B.getModuleCount=function(){return p},B.make=function(){if(o<1){let t=1;for(;t<40;t++){const e=s.getRSBlocks(t,u),n=a();for(let o=0;o<A.length;o++){const e=A[o];n.put(e.getMode(),4),n.put(e.getLength(),l.getLengthInBits(e.getMode(),t)),e.write(n)}let r=0;for(let t=0;t<e.length;t++)r+=e[t].dataCount;if(n.getLengthInBits()<=8*r)break}o=t}k(!1,C())},B.createTableTag=function(t,e){t=t||2,e="undefined"==typeof e?4*t:e;let n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+e+"px;",n+='">',n+="<tbody>";for(let r=0;r<B.getModuleCount();r+=1){n+="<tr>";for(let e=0;e<B.getModuleCount();e+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+t+"px;",n+=" height: "+t+"px;",n+=" background-color: ",n+=B.isDark(r,e)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>",n},B.createSvgTag=function(t,e,n,r){let o={};"object"==typeof arguments[0]&&(o=arguments[0],t=o.cellSize,e=o.margin,n=o.alt,r=o.title),t=t||2,e="undefined"==typeof e?4*t:e,n="string"===typeof n?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,r="string"===typeof r?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;const i=B.getModuleCount()*t+2*e;let u,l,c,f,s,a="";for(s="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",a+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',a+=o.scalable?"":' width="'+i+'px" height="'+i+'px"',a+=' viewBox="0 0 '+i+" "+i+'" ',a+=' preserveAspectRatio="xMinYMin meet"',a+=r.text||n.text?' role="img" aria-labelledby="'+P([r.id,n.id].join(" ").trim())+'"':"",a+=">",a+=r.text?'<title id="'+P(r.id)+'">'+P(r.text)+"</title>":"",a+=n.text?'<description id="'+P(n.id)+'">'+P(n.text)+"</description>":"",a+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',a+='<path d="',c=0;c<B.getModuleCount();c+=1)for(f=c*t+e,u=0;u<B.getModuleCount();u+=1)B.isDark(c,u)&&(l=u*t+e,a+="M"+l+","+f+s);return a+='" stroke="transparent" fill="black"/>',a+="</svg>",a},B.createDataURL=function(t,e){t=t||2,e="undefined"==typeof e?4*t:e;const n=B.getModuleCount()*t+2*e,r=e,o=n-e;return M(n,n,(function(e,n){if(r<=e&&e<o&&r<=n&&n<o){const o=Math.floor((e-r)/t),i=Math.floor((n-r)/t);return B.isDark(i,o)?0:1}return 1}))},B.createImgTag=function(t,e,n){t=t||2,e="undefined"==typeof e?4*t:e;const r=B.getModuleCount()*t+2*e;let o="";return o+="<img",o+=' src="',o+=B.createDataURL(t,e),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=P(n),o+='"'),o+="/>",o};const P=function(t){let e="";for(let n=0;n<t.length;n+=1){const r=t.charAt(n);switch(r){case"<":e+="&lt;";break;case">":e+="&gt;";break;case"&":e+="&amp;";break;case'"':e+="&quot;";break;default:e+=r;break}}return e},_=function(t){const e=1;t="undefined"==typeof t?2*e:t;const n=B.getModuleCount()*e+2*t,r=t,o=n-t;let i,u,l,c,f;const s={"██":"█","█ ":"▀"," █":"▄"," ":" "},a={"██":"▀","█ ":"▀"," █":" "," ":" "};let g="";for(i=0;i<n;i+=2){for(l=Math.floor((i-r)/e),c=Math.floor((i+1-r)/e),u=0;u<n;u+=1)f="█",r<=u&&u<o&&r<=i&&i<o&&B.isDark(l,Math.floor((u-r)/e))&&(f=" "),r<=u&&u<o&&r<=i+1&&i+1<o&&B.isDark(c,Math.floor((u-r)/e))?f+=" ":f+="█",g+=t<1&&i+1>=o?a[f]:s[f];g+="\n"}return n%2&&t>0?g.substring(0,g.length-n-1)+Array(n+1).join("▀"):g.substring(0,g.length-1)};return B.createASCII=function(t,e){if(t=t||1,t<2)return _(e);t-=1,e="undefined"==typeof e?2*t:e;const n=B.getModuleCount()*t+2*e,r=e,o=n-e;let i,u,l,c;const f=Array(t+1).join("██"),s=Array(t+1).join(" ");let a="",g="";for(i=0;i<n;i+=1){for(l=Math.floor((i-r)/t),g="",u=0;u<n;u+=1)c=1,r<=u&&u<o&&r<=i&&i<o&&B.isDark(l,Math.floor((u-r)/t))&&(c=0),g+=c?f:s;for(l=0;l<t;l+=1)a+=g+"\n"}return a.substring(0,a.length-1)},B.renderTo2dContext=function(t,e){e=e||2;const n=B.getModuleCount();for(let r=0;r<n;r++)for(let o=0;o<n;o++)t.fillStyle=B.isDark(r,o)?"black":"white",t.fillRect(r*e,o*e,e,e)},B};r.stringToBytes=function(t){const e=[];for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e.push(255&r)}return e},r.createStringToBytes=function(t,e){const n=function(){const n=A(t),r=function(){const t=n.read();if(-1==t)throw"eof";return t};let o=0;const i={};while(1){const t=n.read();if(-1==t)break;const e=r(),u=r(),l=r(),c=String.fromCharCode(t<<8|e),f=u<<8|l;i[c]=f,o+=1}if(o!=e)throw o+" != "+e;return i}(),r="?".charCodeAt(0);return function(t){const e=[];for(let o=0;o<t.length;o+=1){const i=t.charCodeAt(o);if(i<128)e.push(i);else{const i=n[t.charAt(o)];"number"==typeof i?(255&i)==i?e.push(i):(e.push(i>>>8),e.push(255&i)):e.push(r)}}return e}};const o={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},u={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},l=function(){const t=[[],[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]],e=1335,n=7973,r=21522,i={},l=function(t){let e=0;while(0!=t)e+=1,t>>>=1;return e};return i.getBCHTypeInfo=function(t){let n=t<<10;while(l(n)-l(e)>=0)n^=e<<l(n)-l(e);return(t<<10|n)^r},i.getBCHTypeNumber=function(t){let e=t<<12;while(l(e)-l(n)>=0)e^=n<<l(e)-l(n);return t<<12|e},i.getPatternPosition=function(e){return t[e-1]},i.getMaskFunction=function(t){switch(t){case u.PATTERN000:return function(t,e){return(t+e)%2==0};case u.PATTERN001:return function(t,e){return t%2==0};case u.PATTERN010:return function(t,e){return e%3==0};case u.PATTERN011:return function(t,e){return(t+e)%3==0};case u.PATTERN100:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case u.PATTERN101:return function(t,e){return t*e%2+t*e%3==0};case u.PATTERN110:return function(t,e){return(t*e%2+t*e%3)%2==0};case u.PATTERN111:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},i.getErrorCorrectPolynomial=function(t){let e=f([1],0);for(let n=0;n<t;n+=1)e=e.multiply(f([1,c.gexp(n)],0));return e},i.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case o.MODE_NUMBER:return 10;case o.MODE_ALPHA_NUM:return 9;case o.MODE_8BIT_BYTE:return 8;case o.MODE_KANJI:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case o.MODE_NUMBER:return 12;case o.MODE_ALPHA_NUM:return 11;case o.MODE_8BIT_BYTE:return 16;case o.MODE_KANJI:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case o.MODE_NUMBER:return 14;case o.MODE_ALPHA_NUM:return 13;case o.MODE_8BIT_BYTE:return 16;case o.MODE_KANJI:return 12;default:throw"mode:"+t}}},i.getLostPoint=function(t){const e=t.getModuleCount();let n=0;for(let i=0;i<e;i+=1)for(let r=0;r<e;r+=1){let o=0;const u=t.isDark(i,r);for(let n=-1;n<=1;n+=1)if(!(i+n<0||e<=i+n))for(let l=-1;l<=1;l+=1)r+l<0||e<=r+l||0==n&&0==l||u==t.isDark(i+n,r+l)&&(o+=1);o>5&&(n+=3+o-5)}for(let i=0;i<e-1;i+=1)for(let r=0;r<e-1;r+=1){let e=0;t.isDark(i,r)&&(e+=1),t.isDark(i+1,r)&&(e+=1),t.isDark(i,r+1)&&(e+=1),t.isDark(i+1,r+1)&&(e+=1),0!=e&&4!=e||(n+=3)}for(let i=0;i<e;i+=1)for(let r=0;r<e-6;r+=1)t.isDark(i,r)&&!t.isDark(i,r+1)&&t.isDark(i,r+2)&&t.isDark(i,r+3)&&t.isDark(i,r+4)&&!t.isDark(i,r+5)&&t.isDark(i,r+6)&&(n+=40);for(let i=0;i<e;i+=1)for(let r=0;r<e-6;r+=1)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);let r=0;for(let i=0;i<e;i+=1)for(let n=0;n<e;n+=1)t.isDark(n,i)&&(r+=1);const o=Math.abs(100*r/e/e-50)/5;return n+=10*o,n},i}(),c=function(){const t=new Array(256),e=new Array(256);for(let r=0;r<8;r+=1)t[r]=1<<r;for(let r=8;r<256;r+=1)t[r]=t[r-4]^t[r-5]^t[r-6]^t[r-8];for(let r=0;r<255;r+=1)e[t[r]]=r;const n={glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(e){while(e<0)e+=255;while(e>=256)e-=255;return t[e]}};return n}(),f=function(t,e){if("undefined"==typeof t.length)throw t.length+"/"+e;const n=function(){let n=0;while(n<t.length&&0==t[n])n+=1;const r=new Array(t.length-n+e);for(let e=0;e<t.length-n;e+=1)r[e]=t[e+n];return r}(),r={getAt:function(t){return n[t]},getLength:function(){return n.length},multiply:function(t){const e=new Array(r.getLength()+t.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let o=0;o<t.getLength();o+=1)e[n+o]^=c.gexp(c.glog(r.getAt(n))+c.glog(t.getAt(o)));return f(e,0)},mod:function(t){if(r.getLength()-t.getLength()<0)return r;const e=c.glog(r.getAt(0))-c.glog(t.getAt(0)),n=new Array(r.getLength());for(let o=0;o<r.getLength();o+=1)n[o]=r.getAt(o);for(let r=0;r<t.getLength();r+=1)n[r]^=c.gexp(c.glog(t.getAt(r))+e);return f(n,0).mod(t)}};return r},s=function(){const t=[[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]],e=function(t,e){const n={};return n.totalCount=t,n.dataCount=e,n},n={},r=function(e,n){switch(n){case i.L:return t[4*(e-1)+0];case i.M:return t[4*(e-1)+1];case i.Q:return t[4*(e-1)+2];case i.H:return t[4*(e-1)+3];default:return}};return n.getRSBlocks=function(t,n){const o=r(t,n);if("undefined"==typeof o)throw"bad rs block @ typeNumber:"+t+"/errorCorrectionLevel:"+n;const i=o.length/3,u=[];for(let r=0;r<i;r+=1){const t=o[3*r+0],n=o[3*r+1],i=o[3*r+2];for(let r=0;r<t;r+=1)u.push(e(n,i))}return u},n}(),a=function(){const t=[];let e=0;const n={getBuffer:function(){return t},getAt:function(e){const n=Math.floor(e/8);return 1==(t[n]>>>7-e%8&1)},put:function(t,e){for(let r=0;r<e;r+=1)n.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return e},putBit:function(n){const r=Math.floor(e/8);t.length<=r&&t.push(0),n&&(t[r]|=128>>>e%8),e+=1}};return n},g=function(t){const e=o.MODE_NUMBER,n=t,r={getMode:function(){return e},getLength:function(t){return n.length},write:function(t){const e=n;let r=0;while(r+2<e.length)t.put(i(e.substring(r,r+3)),10),r+=3;r<e.length&&(e.length-r==1?t.put(i(e.substring(r,r+1)),4):e.length-r==2&&t.put(i(e.substring(r,r+2)),7))}},i=function(t){let e=0;for(let n=0;n<t.length;n+=1)e=10*e+u(t.charAt(n));return e},u=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return r},h=function(t){const e=o.MODE_ALPHA_NUM,n=t,r={getMode:function(){return e},getLength:function(t){return n.length},write:function(t){const e=n;let r=0;while(r+1<e.length)t.put(45*i(e.charAt(r))+i(e.charAt(r+1)),11),r+=2;r<e.length&&t.put(i(e.charAt(r)),6)}},i=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){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 :"+t}};return r},d=function(t){const e=o.MODE_8BIT_BYTE,n=r.stringToBytes(t),i={getMode:function(){return e},getLength:function(t){return n.length},write:function(t){for(let e=0;e<n.length;e+=1)t.put(n[e],8)}};return i},w=function(t){const e=o.MODE_KANJI,n=r.stringToBytes;!function(t,e){const r=n(t);if(2!=r.length||(r[0]<<8|r[1])!=e)throw"sjis not supported."}("友",38726);const i=n(t),u={getMode:function(){return e},getLength:function(t){return~~(i.length/2)},write:function(t){const e=i;let n=0;while(n+1<e.length){let r=(255&e[n])<<8|255&e[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(n+1)+"/"+r;r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13),n+=2}if(n<e.length)throw"illegal char at "+(n+1)}};return u},p=function(){const t=[],e={writeByte:function(e){t.push(255&e)},writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,n,r){n=n||0,r=r||t.length;for(let o=0;o<r;o+=1)e.writeByte(t[o+n])},writeString:function(t){for(let n=0;n<t.length;n+=1)e.writeByte(t.charCodeAt(n))},toByteArray:function(){return t},toString:function(){let e="";e+="[";for(let n=0;n<t.length;n+=1)n>0&&(e+=","),e+=t[n];return e+="]",e}};return e},y=function(){let t=0,e=0,n=0,r="";const o={},i=function(t){r+=String.fromCharCode(u(63&t))},u=function(t){if(t<0)throw"n:"+t;if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47;throw"n:"+t};return o.writeByte=function(r){t=t<<8|255&r,e+=8,n+=1;while(e>=6)i(t>>>e-6),e-=6},o.flush=function(){if(e>0&&(i(t<<6-e),t=0,e=0),n%3!=0){const t=3-n%3;for(let e=0;e<t;e+=1)r+="="}},o.toString=function(){return r},o},A=function(t){const e=t;let n=0,r=0,o=0;const i={read:function(){while(o<8){if(n>=e.length){if(0==o)return-1;throw"unexpected end of file./"+o}const t=e.charAt(n);if(n+=1,"="==t)return o=0,-1;t.match(/^\s$/)||(r=r<<6|u(t.charCodeAt(0)),o+=6)}const t=r>>>o-8&255;return o-=8,t}},u=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return i},B=function(t,e){const n=t,r=e,o=new Array(t*e),i={setPixel:function(t,e,r){o[e*n+t]=r},write:function(t){t.writeString("GIF87a"),t.writeShort(n),t.writeShort(r),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(n),t.writeShort(r),t.writeByte(0);const e=2,o=l(e);t.writeByte(e);let i=0;while(o.length-i>255)t.writeByte(255),t.writeBytes(o,i,255),i+=255;t.writeByte(o.length-i),t.writeBytes(o,i,o.length-i),t.writeByte(0),t.writeString(";")}},u=function(t){const e=t;let n=0,r=0;const o={write:function(t,o){if(t>>>o!=0)throw"length over";while(n+o>=8)e.writeByte(255&(t<<n|r)),o-=8-n,t>>>=8-n,r=0,n=0;r|=t<<n,n+=o},flush:function(){n>0&&e.writeByte(r)}};return o},l=function(t){const e=1<<t,n=1+(1<<t);let r=t+1;const i=c();for(let o=0;o<e;o+=1)i.add(String.fromCharCode(o));i.add(String.fromCharCode(e)),i.add(String.fromCharCode(n));const l=p(),f=u(l);f.write(e,r);let s=0,a=String.fromCharCode(o[s]);s+=1;while(s<o.length){const t=String.fromCharCode(o[s]);s+=1,i.contains(a+t)?a+=t:(f.write(i.indexOf(a),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(a+t)),a=t)}return f.write(i.indexOf(a),r),f.write(n,r),f.flush(),l.toByteArray()},c=function(){const t={};let e=0;const n={add:function(r){if(n.contains(r))throw"dup key:"+r;t[r]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return"undefined"!=typeof t[e]}};return n};return i},M=function(t,e,n){const r=B(t,e);for(let l=0;l<e;l+=1)for(let e=0;e<t;e+=1)r.setPixel(e,l,n(e,l));const o=p();r.write(o);const i=y(),u=o.toByteArray();for(let l=0;l<u.length;l+=1)i.writeByte(u[l]);return i.flush(),"data:image/gif;base64,"+i};r.stringToBytes}}]);