/** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */ ;!function(t){t.fn.qrcode=function(e){function r(t){this.mode=u,this.data=t}function o(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function n(t,e){if(void 0==t.length)throw Error(t.length+"/"+e);for(var r=0;rt||this.moduleCount<=t||0>e||this.moduleCount<=e)throw Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var t=1,t=1;40>t;t++){for(var e=i.getRSBlocks(t,this.errorCorrectLevel),r=new s,o=0,n=0;n=r;r++)if(!(-1>=t+r||this.moduleCount<=t+r))for(var o=-1;7>=o;o++)-1>=e+o||this.moduleCount<=e+o||(this.modules[t+r][e+o]=0<=r&&6>=r&&(0==o||6==o)||0<=o&&6>=o&&(0==r||6==r)||2<=r&&4>=r&&2<=o&&4>=o)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;8>r;r++){this.makeImpl(!0,r);var o=a.getLostPoint(this);(0==r||t>o)&&(t=o,e=r)}return e},createMovieClip:function(t,e,r){for(t=t.createEmptyMovieClip(e,r),this.make(),e=0;e=i;i++)for(var s=-2;2>=s;s++)this.modules[o+i][n+s]=-2==i||2==i||-2==s||2==s||0==i&&0==s}},setupTypeNumber:function(t){for(var e=a.getBCHTypeNumber(this.typeNumber),r=0;18>r;r++){var o=!t&&1==(e>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=o}for(r=0;18>r;r++)o=!t&&1==(e>>r&1),this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=o},setupTypeInfo:function(t,e){for(var r=a.getBCHTypeInfo(this.errorCorrectLevel<<3|e),o=0;15>o;o++){var n=!t&&1==(r>>o&1);6>o?this.modules[o][8]=n:8>o?this.modules[o+1][8]=n:this.modules[this.moduleCount-15+o][8]=n}for(o=0;15>o;o++)n=!t&&1==(r>>o&1),8>o?this.modules[8][this.moduleCount-o-1]=n:9>o?this.modules[8][15-o-1+1]=n:this.modules[8][15-o-1]=n;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,o=this.moduleCount-1,n=7,i=0,s=this.moduleCount-1;0u;u++)if(null==this.modules[o][s-u]){var h=!1;i>>n&1)),a.getMask(e,o,s-u)&&(h=!h),this.modules[o][s-u]=h,n--,-1==n&&(i++,n=7)}if(o+=r,0>o||this.moduleCount<=o){o-=r,r=-r;break}}}},o.PAD0=236,o.PAD1=17,o.createData=function(t,e,r){for(var e=i.getRSBlocks(t,e),n=new s,u=0;u8*t)throw Error("code length overflow. ("+n.getLengthInBits()+">"+8*t+")");for(n.getLengthInBits()+4<=8*t&&n.put(0,4);0!=n.getLengthInBits()%8;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*t||(n.put(o.PAD0,8),n.getLengthInBits()>=8*t));)n.put(o.PAD1,8);return o.createBytes(n,e)},o.createBytes=function(t,e){for(var r=0,o=0,i=0,s=Array(e.length),u=Array(e.length),h=0;h>>=1;return e},getPatternPosition:function(t){return a.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case 0:return 0==(e+r)%2;case 1:return 0==e%2;case 2:return 0==r%3;case 3:return 0==(e+r)%3;case 4:return 0==(Math.floor(e/2)+Math.floor(r/3))%2;case 5:return 0==e*r%2+e*r%3;case 6:return 0==(e*r%2+e*r%3)%2;case 7:return 0==(e*r%3+(e+r)%2)%2;default:throw Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new n([1],0),r=0;re)switch(t){case 1:return 10;case 2:return 9;case u:return 8;case 8:return 8;default:throw Error("mode:"+t)}else if(27>e)switch(t){case 1:return 12;case 2:return 11;case u:return 16;case 8:return 10;default:throw Error("mode:"+t)}else{if(!(41>e))throw Error("type:"+e);switch(t){case 1:return 14;case 2:return 13;case u:return 16;case 8:return 12;default:throw Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,o=0;o=u;u++)if(!(0>o+u||e<=o+u))for(var a=-1;1>=a;a++)0>n+a||e<=n+a||0==u&&0==a||s==t.isDark(o+u,n+a)&&i++;5t)throw Error("glog("+t+")");return h.LOG_TABLE[t]},gexp:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return h.EXP_TABLE[t]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},l=0;8>l;l++)h.EXP_TABLE[l]=1<l;l++)h.EXP_TABLE[l]=h.EXP_TABLE[l-4]^h.EXP_TABLE[l-5]^h.EXP_TABLE[l-6]^h.EXP_TABLE[l-8];for(l=0;255>l;l++)h.LOG_TABLE[h.EXP_TABLE[l]]=l;return n.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=Array(this.getLength()+t.getLength()-1),r=0;rthis.getLength()-t.getLength())return this;for(var e=h.glog(this.get(0))-h.glog(t.get(0)),r=Array(this.getLength()),o=0;o>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},"string"==typeof e&&(e={text:e}),e=t.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:2,background:"#ffffff",foreground:"#000000"},e),this.each(function(){var r;if("canvas"==e.render){r=new o(e.typeNumber,e.correctLevel),r.addData(e.text),r.make();var n=document.createElement("canvas");n.width=e.width,n.height=e.height;for(var i=n.getContext("2d"),s=e.width/r.getModuleCount(),u=e.height/r.getModuleCount(),a=0;a").css("width",e.width+"px").css("height",e.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",e.background),i=e.width/r.getModuleCount(),s=e.height/r.getModuleCount(),u=0;u").css("height",s+"px").appendTo(n),h=0;h").css("width",i+"px").css("background-color",r.isDark(u,h)?e.foreground:e.background).appendTo(a);r=n,jQuery(r).appendTo(this)})}}(jQuery);