filesbox/web/dist/design/designstatic/chatroom/js/jquery.qrcode.min.js

2 lines
19 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
var QRCode;(function(){function M(t){this.mode=c.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=[],r=0,n=this.data.length;n>r;r++){var o=this.data.charCodeAt(r);o>65536?(e[0]=240|(1835008&o)>>>18,e[1]=128|(258048&o)>>>12,e[2]=128|(4032&o)>>>6,e[3]=128|63&o):o>2048?(e[0]=224|(61440&o)>>>12,e[1]=128|(4032&o)>>>6,e[2]=128|63&o):o>128?(e[0]=192|(1984&o)>>>6,e[1]=128|63&o):e[0]=o,this.parsedData=this.parsedData.concat(e)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function _(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function T(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}function C(t,e){this.totalCount=t,this.dataCount=e}function k(){this.buffer=[],this.length=0}function N(){return typeof CanvasRenderingContext2D!="undefined"}function I(){var t=!1,e=navigator.userAgent;return/android/i.test(e)&&(t=!0,aMat=e.toString().match(/android ([0-9]\.[0-9])/i),aMat&&aMat[1]&&(t=parseFloat(aMat[1]))),t}function R(t,e){for(var r=1,n=O(t),o=0,s=L.length;s>=o;o++){var a=0;switch(e){case A.L:a=L[o][0];break;case A.M:a=L[o][1];break;case A.Q:a=L[o][2];break;case A.H:a=L[o][3]}if(a>=n)break;r++}if(r>L.length)throw new Error("Too long data");return r}function O(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}M.prototype={getLength:function(){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;r>e;e++)t.put(this.parsedData[e],8)}},_.prototype={addData:function(t){var e=new M(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(0>t||this.moduleCount<=t||0>e||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=_.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;7>=r;r++)if(!(-1>=t+r||this.moduleCount<=t+r))for(var n=-1;7>=n;n++)-1>=e+n||this.moduleCount<=e+n||(this.modules[t+r][e+n]=r>=0&&6>=r&&(n==0||n==6)||n>=0&&6>=n&&(r==0||r==6)||r>=2&&4>=r&&n>=2&&4>=n)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;8>r;r++){this.makeImpl(!0,r);var n=g.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),o=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*o,i=0;i<this.modules[s].length;i++){var h=i*o,l=this.modules[s][i];l&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+o,a),n.lineTo(h+o,a+o),n.lineTo(h,a+o),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=g.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],o=t[r];if(this.modules[n][o]==null)for(var s=-2;2>=s;s++)for(var a=-2;2>=a;a++)this.modules[n+s][o+a]=s==-2||s==2||a==-2||a==2||s==0&&a==0}},setupTypeNumber:function(t){for(var e=g.getBCHTypeNumber(this.typeNumber),r=0;18>r;r++){var n=!t&&(1&e>>r)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;18>r;r++){var n=!