mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
2 lines
45 KiB
JavaScript
2 lines
45 KiB
JavaScript
|
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6839],{91915:t=>{self,t.exports=(()=>{var t={192:(t,e)=>{var r,i,n=function(){var t=function(t,e){var r=t,i=a[e],n=null,o=0,h=null,v=[],w={},_=function(t,e){n=function(t){for(var e=new Array(t),r=0;r<t;r+=1){e[r]=new Array(t);for(var i=0;i<t;i+=1)e[r][i]=null}return e}(o=4*r+17),y(0,0),y(o-7,0),y(0,o-7),x(),b(),M(t,e),r>=7&&S(t),null==h&&(h=A(r,i,v)),C(h,e)},y=function(t,e){for(var r=-1;r<=7;r+=1)if(!(t+r<=-1||o<=t+r))for(var i=-1;i<=7;i+=1)e+i<=-1||o<=e+i||(n[t+r][e+i]=0<=r&&r<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=i&&i<=4)},b=function(){for(var t=8;t<o-8;t+=1)null==n[t][6]&&(n[t][6]=t%2==0);for(var e=8;e<o-8;e+=1)null==n[6][e]&&(n[6][e]=e%2==0)},x=function(){for(var t=s.getPatternPosition(r),e=0;e<t.length;e+=1)for(var i=0;i<t.length;i+=1){var o=t[e],a=t[i];if(null==n[o][a])for(var h=-2;h<=2;h+=1)for(var u=-2;u<=2;u+=1)n[o+h][a+u]=-2==h||2==h||-2==u||2==u||0==h&&0==u}},S=function(t){for(var e=s.getBCHTypeNumber(r),i=0;i<18;i+=1){var a=!t&&1==(e>>i&1);n[Math.floor(i/3)][i%3+o-8-3]=a}for(i=0;i<18;i+=1)a=!t&&1==(e>>i&1),n[i%3+o-8-3][Math.floor(i/3)]=a},M=function(t,e){for(var r=i<<3|e,a=s.getBCHTypeInfo(r),h=0;h<15;h+=1){var u=!t&&1==(a>>h&1);h<6?n[h][8]=u:h<8?n[h+1][8]=u:n[o-15+h][8]=u}for(h=0;h<15;h+=1)u=!t&&1==(a>>h&1),h<8?n[8][o-h-1]=u:h<9?n[8][15-h-1+1]=u:n[8][15-h-1]=u;n[o-8][8]=!t},C=function(t,e){for(var r=-1,i=o-1,a=7,h=0,u=s.getMaskFunction(e),c=o-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var d=0;d<2;d+=1)if(null==n[i][c-d]){var l=!1;h<t.length&&(l=1==(t[h]>>>a&1)),u(i,c-d)&&(l=!l),n[i][c-d]=l,-1==(a-=1)&&(h+=1,a=7)}if((i+=r)<0||o<=i){i-=r,r=-r;break}}},A=function(t,e,r){for(var i=c.getRSBlocks(t,e),n=d(),o=0;o<r.length;o+=1){var a=r[o];n.put(a.getMode(),4),n.put(a.getLength(),s.getLengthInBits(a.getMode(),t)),a.write(n)}var h=0;for(o=0;o<i.length;o+=1)h+=i[o].dataCount;if(n.getLengthInBits()>8*h)throw"code length overflow. ("+n.getLengthInBits()+">"+8*h+")";for(n.getLengthInBits()+4<=8*h&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*h||(n.put(236,8),n.getLengthInBits()>=8*h));)n.put(17,8);return function(t,e){for(var r=0,i=0,n=0,o=new Array(e.length),a=new Array(e.length),h=0;h<e.length;h+=1){var c=e[h].dataCount,d=e[h].totalCount-c;i=Math.max(i,c),n=Math.max(n,d),o[h]=new Array(c);for(var l=0;l<o[h].length;l+=1)o[h][l]=255&t.getBuffer()[l+r];r+=c;var g=s.getErrorCorrectPolynomial(d),f=u(o[h],g.getLength()-1).mod(g);for(a[h]=new Array(g.getLength()-1),l=0;l<a[h].length;l+=1){var p=l+f.getLength()-a[h].length;a[h][l]=p>=0?f.getAt(p):0}}var v=0;for(l=0;l<e.length;l+=1)v+=e[l].totalCount;var w=new Array(v),m=0;for(l=0;l<i;l+=1)for(h=0;h<e.length;h+=1)l<o[h].length&&(w[m]=o[h][l],m+=1);for(l=0;l<n;l+=1)for(h=0;h<e.length;h+=1)l<a[h].length&&(w[m]=a[h][l],m+=1);return w}(n,i)};w.addData=function(t,e){var r=null;switch(e=e||"Byte"){case"Numeric":r=l(t);break;case"Alphanumeric":r=g(t);break;case"Byte":r=f(t);break;case"Kanji":r=p(t);break;default:throw"mode:"+e}v.push(r),h=null},w.isDark=function(t,e){if(t<0||o<=t||e<0||o<=e)throw t+","+e;return n[t][e]},w.getModuleCount=function(){return o},w.make=function(){if(r<1){for(var t=1;t<40;t++){for(var e=c.getRSBlocks(t,i),n=d(),o=0;o<v.length;o++){var a=v[o];n.put(a.getMode(),4),n.put(a.getLength(),s.getLengthInBits(a.getMode(),t)),a.write(n)}var h=0;for(o=0;o<e.length;o++)h+=e[o].dataCount;if(n.getLengthInBits()<=8*h)break}r=t}_(!1,function(){for(var t=0,e=0,r=0;r<8;r+=1){_(!0,r);var i=s.getLostPoint(w);(0==r||t>i)&&(t=i,e=r)}return e}())},w.createTableTag=function(t,e){t=t||2;var r="";r+='<table style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",r+='">',r+="<tbody>";for(var i=0;i<w.getModuleCount();i+=1){r+="<tr>";for(var n=0;n<w.getModuleCount();n+=1)r+='<td style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: 0px;",r+=" width: "+t+"px;",r+=" height: "+t+"px;",r+=" background-color: ",r+=w.isDark(i,n)?"#
|
||
|
//# sourceMappingURL=6839.7574ee59f6159101b320.js.map
|