!function(r){"use strict";function t(t,e,n,o){function i(r,t){return r-=o,t-=o,!(0>r||r>=u||0>t||t>=u)&&a.isdark(r,t)}var a=r(n,e);a.adddata(t),a.make(),o=o||0;var u=a.getmodulecount(),f=a.getmodulecount()+2*o,c=function(r,t,e,n){var o=this.isdark,i=1/f;this.isdark=function(a,u){var f=u*i,c=a*i,s=f+i,l=c+i;return o(a,u)&&(r>s||f>e||t>l||c>n)}};this.text=t,this.level=e,this.version=n,this.modulecount=f,this.isdark=i,this.addblank=c}function e(r,e,n,o,i){n=math.max(1,n||1),o=math.min(40,o||40);for(var a=n;o>=a;a+=1)try{return new t(r,e,a,i)}catch(r){}}function n(r,t,e){var n=e.size,o="bold "+e.msize*n+"px "+e.fontname,i=p("")[0].getcontext("2d");i.font=o;var a=i.measuretext(e.label).width,u=e.msize,f=a/n,c=(1-f)*e.mposx,s=(1-u)*e.mposy,l=c+f,h=s+u,d=.01;1===e.mode?r.addblank(0,s-d,n,h+d):r.addblank(c-d,s-d,l+d,h+d),t.fillstyle=e.fontcolor,t.font=o,t.filltext(e.label,c*n,s*n+.75*e.msize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalwidth||1,i=e.image.naturalheight||1,a=e.msize,u=a*o/i,f=(1-u)*e.mposx,c=(1-a)*e.mposy,s=f+u,l=c+a,h=.01;3===e.mode?r.addblank(0,c-h,n,l+h):r.addblank(f-h,c-h,s+h,l+h),t.drawimage(e.image,f*n,c*n,u*n,a*n)}function i(r,t,e){p(e.background).is("img")?t.drawimage(e.background,0,0,e.size,e.size):e.background&&(t.fillstyle=e.background,t.fillrect(e.left,e.top,e.size,e.size));var i=e.mode;1===i||2===i?n(r,t,e):(3===i||4===i)&&o(r,t,e)}function a(r,t,e,n,o,i,a,u){r.isdark(a,u)&&t.rect(n,o,i,i)}function u(r,t,e,n,o,i,a,u,f,c){a?r.moveto(t+i,e):r.moveto(t,e),u?(r.lineto(n-i,e),r.arcto(n,e,n,o,i)):r.lineto(n,e),f?(r.lineto(n,o-i),r.arcto(n,o,t,o,i)):r.lineto(n,o),c?(r.lineto(t+i,o),r.arcto(t,o,t,e,i)):r.lineto(t,o),a?(r.lineto(t,e+i),r.arcto(t,e,n,e,i)):r.lineto(t,e)}function f(r,t,e,n,o,i,a,u,f,c){a&&(r.moveto(t+i,e),r.lineto(t,e),r.lineto(t,e+i),r.arcto(t,e,t+i,e,i)),u&&(r.moveto(n-i,e),r.lineto(n,e),r.lineto(n,e+i),r.arcto(n,e,n-i,e,i)),f&&(r.moveto(n-i,o),r.lineto(n,o),r.lineto(n,o-i),r.arcto(n,o,n-i,o,i)),c&&(r.moveto(t+i,o),r.lineto(t,o),r.lineto(t,o-i),r.arcto(t,o,t+i,o,i))}function c(r,t,e,n,o,i,a,c){var s=r.isdark,l=n+i,h=o+i,d=e.radius*i,g=a-1,v=a+1,p=c-1,w=c+1,m=s(a,c),t=s(g,p),y=s(g,c),e=s(g,w),a=s(a,w),b=s(v,w),k=s(v,c),b=s(v,p),c=s(a,p);m?u(t,n,o,l,h,d,!y&&!c,!y&&!a,!k&&!a,!k&&!c):f(t,n,o,l,h,d,y&&c&&t,y&&a&&e,k&&a&&b,k&&c&&b)}function s(r,t,e){var n,o,i=r.modulecount,u=e.size/i,f=a;for(m&&e.radius>0&&e.radius<=.5&&(f=c),t.beginpath(),n=0;i>n;n+=1)for(o=0;i>o;o+=1){var s=e.left+o*u,l=e.top+n*u,h=u;f(r,t,e,s,l,h,n,o)}if(p(e.fill).is("img")){t.strokestyle="rgba(0,0,0,0.5)",t.linewidth=2,t.stroke();var d=t.globalcompositeoperation;t.globalcompositeoperation="destination-out",t.fill(),t.globalcompositeoperation=d,t.clip(),t.drawimage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillstyle=e.fill,t.fill()}function l(r,t){var n=e(t.text,t.eclevel,t.minversion,t.maxversion,t.quiet);if(!n)return null;var o=p(r).data("qrcode",n),a=o[0].getcontext("2d");return i(n,a,t),s(n,a,t),o}function h(r){var t=p("").attr("width",r.size).attr("height",r.size);return l(t,r)}function d(r){return p("").attr("src",h(r)[0].todataurl("image/png"))}function g(r){var t=e(r.text,r.eclevel,r.minversion,r.maxversion,r.quiet);if(!t)return null;var n,o,i=r.size,a=r.background,u=math.floor,f=t.modulecount,c=u(i/f),s=u(.5*(i-c*f)),l={position:"relative",left:0,top:0,padding:0,margin:0,width:i,height:i},h={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},d=p("
").data("qrcode",t).css(l);for(a&&d.css("background-color",a),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isdark(n,o)&&p("").css(h).css({left:s+o*c,top:s+n*c}).appendto(d);return d}function v(r){return w&&"canvas"===r.render?h(r):w&&"image"===r.render?d(r):g(r)}var p=jquery,w=function(){var r=document.createelement("canvas");return boolean(r.getcontext&&r.getcontext("2d"))}(),m="[object opera]"!==object.prototype.tostring.call(window.opera),t={render:"canvas",minversion:1,maxversion:40,eclevel:"l",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,msize:.1,mposx:.5,mposy:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};p.fn.qrcode=function(r){var t=p.extend({},t,r);return this.each(function(){"canvas"===this.nodename.tolowercase()?l(this,t):p(this).append(v(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new error(t.length+"/"+e);var n=function(){for(var r=0;re;e+=1){t[e]=new array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(d),t(0,0),t(d-7,0),t(0,d-7),a(),e(),k(r,t),s>=7&&b(r),null==v&&(v=m(s,l,p)),b(v,t)},t=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=d))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=d||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?h[r+e][t+n]=!0:h[r+e][t+n]=!1)},y=function(){for(var r=0,t=0,e=0;8>e;e+=1){m(!0,e);var n=i.getlostpoint(w);(0==e||r>n)&&(r=n,t=e)}return t},e=function(){for(var r=8;d-8>r;r+=1)null==h[r][6]&&(h[r][6]=r%2==0);for(var t=8;d-8>t;t+=1)null==h[6][t]&&(h[6][t]=t%2==0)},a=function(){for(var r=i.getpatternposition(s),t=0;t=a;a+=1)for(var u=-2;2>=u;u+=1)-2==a||2==a||-2==u||2==u||0==a&&0==u?h[n+a][o+u]=!0:h[n+a][o+u]=!1}},b=function(r){for(var t=i.getbchtypenumber(s),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);h[math.floor(e/3)][e%3+d-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);h[e%3+d-8-3][math.floor(e/3)]=n}},k=function(r,t){for(var e=l<<3|t,n=i.getbchtypeinfo(e),o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);6>o?h[o][8]=a:8>o?h[o+1][8]=a:h[d-15+o][8]=a}for(var o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);8>o?h[8][d-o-1]=a:9>o?h[8][15-o-1+1]=a:h[8][15-o-1]=a}h[d-8][8]=!r},b=function(r,t){for(var e=-1,n=d-1,o=7,a=0,u=i.getmaskfunction(t),f=d-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==h[n][f-c]){var s=!1;a>>o&1));var l=u(n,f-c);l&&(s=!s),h[n][f-c]=s,o-=1,-1==o&&(a+=1,o=7)}if(n+=e,0>n||n>=d){n-=e,e=-e;break}}},c=function(t,e){for(var n=0,o=0,a=0,u=new array(e.length),f=new array(e.length),c=0;c=0?v.getat(p):0}}for(var w=0,h=0;hh;h+=1)for(var c=0;ch;h+=1)for(var c=0;c8*h)throw new error("code length overflow. ("+c.getlengthinbits()+">"+8*h+")");for(c.getlengthinbits()+4<=8*h&&c.put(0,4);c.getlengthinbits()%8!=0;)c.putbit(!1);for(;!(c.getlengthinbits()>=8*h)&&(c.put(o,8),!(c.getlengthinbits()>=8*h));)c.put(a,8);return c(c,n)};return w.adddata=function(r){var t=c(r);p.push(t),v=null},w.isdark=function(r,t){if(0>r||r>=d||0>t||t>=d)throw new error(r+","+t);return h[r][t]},w.getmodulecount=function(){return d},w.make=function(){m(!1,y())},w.createtabletag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='',e+="";for(var n=0;n";for(var o=0;o';e+=""}return e+="",e+="
"},w.createimgtag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=w.getmodulecount()*r+2*t,n=t,o=e-t;return g(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var i=math.floor((t-n)/r),a=math.floor((e-n)/r);return w.isdark(a,i)?0:1}return 1})},w};t.stringtobytes=function(r){for(var t=new array,e=0;ei)t.push(i);else{var a=e[r.charat(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(n)}}return t}};var e={mode_number:1,mode_alpha_num:2,mode_8bit_byte:4,mode_kanji:8},n={l:1,m:0,q:3,h:2},o={pattern000:0,pattern001:1,pattern010:2,pattern011:3,pattern100:4,pattern101:5,pattern110:6,pattern111:7},i=function(){var 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]],n=1335,i=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getbchtypeinfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<=0;)t^=i<n;n+=1)e=e.multiply(r([1,a.gexp(n)],0));return e},f.getlengthinbits=function(r,t){if(t>=1&&10>t)switch(r){case e.mode_number:return 10;case e.mode_alpha_num:return 9;case e.mode_8bit_byte:return 8;case e.mode_kanji:return 8;default:throw new error("mode:"+r)}else if(27>t)switch(r){case e.mode_number:return 12;case e.mode_alpha_num:return 11;case e.mode_8bit_byte:return 16;case e.mode_kanji:return 10;default:throw new error("mode:"+r)}else{if(!(41>t))throw new error("type:"+t);switch(r){case e.mode_number:return 14;case e.mode_alpha_num:return 13;case e.mode_8bit_byte:return 16;case e.mode_kanji:return 12;default:throw new error("mode:"+r)}}},f.getlostpoint=function(r){for(var t=r.getmodulecount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var i=0,a=r.isdark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&a==r.isdark(n+u,o+f)&&(i+=1);i>5&&(e+=3+i-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isdark(n,o)&&(c+=1),r.isdark(n+1,o)&&(c+=1),r.isdark(n,o+1)&&(c+=1),r.isdark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isdark(n,o)&&!r.isdark(n,o+1)&&r.isdark(n,o+2)&&r.isdark(n,o+3)&&r.isdark(n,o+4)&&!r.isdark(n,o+5)&&r.isdark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isdark(n,o)&&!r.isdark(n+1,o)&&r.isdark(n+2,o)&&r.isdark(n+3,o)&&r.isdark(n+4,o)&&!r.isdark(n+5,o)&&r.isdark(n+6,o)&&(e+=40);for(var s=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isdark(n,o)&&(s+=1);var l=math.abs(100*s/t/t-50)/5;return e+=10*l},f}(),a=function(){for(var r=new array(256),t=new array(256),e=0;8>e;e+=1)r[e]=1<e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[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]],t=function(r,t){var e={};return e.totalcount=r,e.datacount=t,e},e={},o=function(t,e){switch(e){case n.l:return r[4*(t-1)+0];case n.m:return r[4*(t-1)+1];case n.q:return r[4*(t-1)+2];case n.h:return r[4*(t-1)+3];default:return}};return e.getrsblocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new error("bad rs block @ typenumber:"+r+"/errorcorrectlevel:"+e);for(var i=n.length/3,a=new array,u=0;i>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],s=n[3*u+2],l=0;f>l;l+=1)a.push(t(c,s));return a},e}(),f=function(){var r=new array,t=0,e={};return e.getbuffer=function(){return r},e.getat=function(t){var e=math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putbit(1==(r>>>t-n-1&1))},e.getlengthinbits=function(){return t},e.putbit=function(e){var n=math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.mode_8bit_byte,o=t.stringtobytes(r),i={};return i.getmode=function(){return n},i.getlength=function(r){return o.length},i.write=function(r){for(var t=0;t>>8)},t.writebytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writebyte(r[o+e])},t.writestring=function(r){for(var e=0;e0&&(t+=","),t+=r[e];return t+="]"},t},l=function(){var r=0,t=0,e=0,n="",o={},i=function(r){n+=string.fromcharcode(a(63&r))},a=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new error("n:"+r)};return o.writebyte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)i(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,a=0;o>a;a+=1)n+="="},o.tostring=function(){return n},o},h=function(r){var t=r,e=0,n=0,o=0,i={};i.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new error("unexpected end of file./"+o)}var r=t.charat(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|a(r.charcodeat(0)),o+=6)}var i=n>>>o-8&255;return o-=8,i};var a=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new error("c:"+r)};return i},d=function(r,t){var e=r,n=t,o=new array(r*t),i={};i.setpixel=function(r,t,n){o[t*e+r]=n},i.write=function(r){r.writestring("gif87a"),r.writeshort(e),r.writeshort(n),r.writebyte(128),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(255),r.writebyte(255),r.writebyte(255),r.writestring(","),r.writeshort(0),r.writeshort(0),r.writeshort(e),r.writeshort(n),r.writebyte(0);var t=2,o=u(t);r.writebyte(t);for(var i=0;o.length-i>255;)r.writebyte(255),r.writebytes(o,i,255),i+=255;r.writebyte(o.length-i),r.writebytes(o,i,o.length-i),r.writebyte(0),r.writestring(";")};var a=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new error("length over");for(;e+o>=8;)t.writebyte(255&(r<>>=8-e,n=0,e=0;n|=r<0&&t.writebyte(n)},o},u=function(r){for(var t=1<u;u+=1)i.add(string.fromcharcode(u));i.add(string.fromcharcode(t)),i.add(string.fromcharcode(e));var c=s(),l=a(c);l.write(t,n);var h=0,d=string.fromcharcode(o[h]);for(h+=1;hi;i+=1)for(var a=0;r>a;a+=1)o.setpixel(a,i,e(a,i));var u=s();o.write(u);for(var f=l(),c=u.tobytearray(),h=0;h"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringtobytes=function(r){function t(r){for(var t=[],e=0;en?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charcodeat(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}()),function(r){r.fn.share=function(t){function e(t,e){var n=o(e);"prepend"==e.mode?n.reverse():n,n.length&&r.each(n,function(n,o){var a=i(o,e),u=e.initialized?t.find(".icon-"+o):r('');return!u.length||(u.prop("aria-label","分享到 "+h[o]),u.prop("href",a),"wechat"===o?u.prop("tabindex",-1):u.prop("target","_blank"),void(e.initialized||("prepend"==e.mode?t.prepend(u):t.append(u))))})}function n(r,t){var e=r.find("a.icon-wechat");e.length&&(e.append(''+t.wechatqrcodetitle+'
'+t.wechatqrcodehelper+"
"),e.find(".qrcode").qrcode({render:"image",size:t.wechatqrcodesize,text:t.url}),e.offset().top<100&&e.find(".wechat-qrcode").addclass("bottom"))}function o(t){0===t.mobilesites.length&&t.sites.length&&(t.mobilesites=t.sites);var e=(u()?t.mobilesites:t.sites.length?t.sites:[]).slice(0),n=t.disabled;return"string"==typeof e&&(e=e.split(/\s*,\s*/)),"string"==typeof n&&(n=n.split(/\s*,\s*/)),a()&&n.push("wechat"),n.length&&r.each(n,function(t,n){var o=r.inarray(n,e);o!==-1&&e.splice(o,1)}),e}function i(r,t){var e=l[r];t.summary=t.description;for(var n in t)if(t.hasownproperty(n)){var o=r+n.replace(/^[a-z]/,function(r){return r.touppercase()}),i=encodeuricomponent(void 0===t[o]?t[n]:t[o]);e=e.replace(new regexp("{{"+n.touppercase()+"}}","g"),i)}return e}function a(){return/micromessenger/i.test(navigator.useragent)}function u(){return r(window).width()<=768}var f=r(document.head),c={url:location.href,site_url:location.origin,source:f.find("[name=site], [name=site]").attr("content")||document.title,title:f.find("[name=title], [name=title]").attr("content")||document.title,description:f.find("[name=description], [name=description]").attr("content")||"",image:r("img:first").prop("src")||"",imageselector:void 0,weibokey:"",wechatqrcodetitle:"微信扫一扫:分享",wechatqrcodehelper:"",wechatqrcodesize:100,mobilesites:[],sites:["weibo","qq","wechat","tencent","douban","qzone","linkedin","diandian","facebook","twitter","google"],disabled:[],initialized:!1},s=r.extend({},c,t),l={qzone:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{url}}&title={{title}}&desc={{description}}&summary={{summary}}&site={{source}}",qq:"http://connect.qq.com/widget/shareqq/index.html?url={{url}}&title={{title}}&source={{source}}&desc={{description}}&pics={{image}}",tencent:"http://share.v.t.qq.com/index.php?c=share&a=index&title={{title}}&url={{url}}&pic={{image}}",weibo:"http://service.weibo.com/share/share.php?url={{url}}&title={{title}}&pic={{image}}&appkey={{weibokey}}",wechat:"javascript:;",douban:"http://shuo.douban.com/!service/share?href={{url}}&name={{title}}&text={{description}}&image={{image}}&starid=0&aid=0&style=11",diandian:"http://www.diandian.com/share?lo={{url}}&ti={{title}}&type=link",linkedin:"http://www.linkedin.com/sharearticle?mini=true&ro=true&title={{title}}&url={{url}}&summary={{summary}}&source={{source}}&armin=armin",facebook:"https://www.facebook.com/sharer/sharer.php?u={{url}}&title={{title}}&description={{description}}&caption={{subhead}}&link={{url}}&picture={{image}}",twitter:"https://twitter.com/intent/tweet?text={{title}}&url={{url}}&via={{site_url}}",google:"https://plus.google.com/share?url={{url}}"},h={qzone:"qq空间",qq:"qq",tencent:"腾讯微博",weibo:"微博",wechat:"微信",douban:"豆瓣",diandian:"点点",linkedin:"linkedin",facebook:"facebook",twitter:"twitter",google:"google"};this.each(function(){if(r(this).data("initialized"))return!0;var t=r.extend({},s,r(this).data());t.imageselector&&(t.image=r(t.imageselector).map(function(){return r(this).prop("src")}).get().join("||"));var o=r(this).addclass("share-component social-share");e(o,t),n(o,t),r(this).data("initialized",!0)})},r(function(){r(".share-component,.social-share").share()})}(jquery);