Files
ITAM/public/qrcode.min.js

1 line
22 KiB
JavaScript

var QRCode=function(t){"use strict";function R(){return void 0!==a}var a,O=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Q=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||40<t)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},n=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var g=e(function(t,n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2},n.isValid=function(t){return t&&void 0!==t.bit&&0<=t.bit&&t.bit<4},n.from=function(t,e){if(n.isValid(t))return t;try{var r=t;if("string"!=typeof r)throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+r)}return}catch(t){return e}}});function T(){this.buffer=[],this.length=0}g.L,g.M,g.Q,g.H,g.isValid,T.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>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++}};var W=T;function r(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}r.prototype.set=function(t,e,r,n){t=t*this.size+e;this.data[t]=r,n&&(this.reservedBit[t]=!0)},r.prototype.get=function(t,e){return this.data[t*this.size+e]},r.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},r.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};for(var G=r,V=e(function(t,i){var a=Q;i.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,t=a(t),r=145===t?26:2*Math.ceil((t-13)/(2*e-2)),n=[t-7],o=1;o<e-1;o++)n[o]=n[o-1]-r;return n.push(6),n.reverse()},i.getPositions=function(t){for(var e=[],r=i.getRowColCoords(t),n=r.length,o=0;o<n;o++)for(var a=0;a<n;a++)0===o&&0===a||0===o&&a===n-1||o===n-1&&0===a||e.push([r[o],r[a]]);return e}}),L=(V.getRowColCoords,V.getPositions,Q),tt=function(t){t=L(t);return[[0,0],[t-7,0],[0,t-7]]},q=e(function(t,u){u.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};u.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&0<=t&&t<=7},u.from=function(t){return u.isValid(t)?parseInt(t,10):void 0},u.getPenaltyN1=function(t){for(var e=t.size,r=0,n=0,o=0,a=null,i=null,u=0;u<e;u++){for(var n=o=0,a=i=null,s=0;s<e;s++){var h=t.get(u,s);h===a?n++:(5<=n&&(r+=n-5+3),a=h,n=1),(h=t.get(s,u))===i?o++:(5<=o&&(r+=o-5+3),i=h,o=1)}5<=n&&(r+=n-5+3),5<=o&&(r+=o-5+3)}return r},u.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var a=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==a&&0!==a||r++}return 3*r},u.getPenaltyN3=function(t){for(var e=t.size,r=0,n=0,o=0,a=0;a<e;a++)for(var n=o=0,i=0;i<e;i++)n=n<<1&2047|t.get(a,i),10<=i&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(i,a),10<=i&&(1488===o||93===o)&&r++;return 40*r},u.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n<r;n++)e+=t.data[n];return 10*Math.abs(Math.ceil(100*e/r/5)-10)},u.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,function(t,e,r){switch(t){case u.Patterns.PATTERN000:return(e+r)%2==0;case u.Patterns.PATTERN001:return e%2==0;case u.Patterns.PATTERN010:return r%3==0;case u.Patterns.PATTERN011:return(e+r)%3==0;case u.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case u.Patterns.PATTERN101:return e*r%2+e*r%3==0;case u.Patterns.PATTERN110:return(e*r%2+e*r%3)%2==0;case u.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}(t,o,n))},u.getBestMask=function(t,e){for(var r=Object.keys(u.Patterns).length,n=0,o=1/0,a=0;a<r;a++){e(a),u.applyMask(a,t);var i=u.getPenaltyN1(t)+u.getPenaltyN2(t)+u.getPenaltyN3(t)+u.getPenaltyN4(t);u.applyMask(a,t),i<o&&(o=i,n=a)}return n}}),o=(q.Patterns,q.isValid,q.getPenaltyN1,q.getPenaltyN2,q.getPenaltyN3,q.getPenaltyN4,q.applyMask,q.getBestMask,[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81]),i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430],et=function(t,e){switch(e){case g.L:return o[4*(t-1)+0];case g.M:return o[4*(t-1)+1];case g.Q:return o[4*(t-1)+2];case g.H:return o[4*(t-1)+3];default:return}},j=function(t,e){switch(e){case g.L:return i[4*(t-1)+0];case g.M:return i[4*(t-1)+1];case g.Q:return i[4*(t-1)+2];case g.H:return i[4*(t-1)+3];default:return}},u=new Uint8Array(512),s=new Uint8Array(256),h=1,f=0;f<255;f++)u[f]=h,s[h]=f,256&(h<<=1)&&(h^=285);for(var c=255;c<512;c++)u[c]=u[c-255];function b(t,e){return 0===t||0===e?0:u[s[t]+s[e]]}var d=e(function(t,n){n.mul=function(t,e){for(var r=new Uint8Array(t.length+e.length-1),n=0;n<t.length;n++)for(var o=0;o<e.length;o++)r[n+o]^=b(t[n],e[o]);return r},n.mod=function(t,e){for(var r=new Uint8Array(t);0<=r.length-e.length;){for(var n=r[0],o=0;o<e.length;o++)r[o]^=b(e[o],n);for(var a=0;a<r.length&&0===r[a];)a++;r=r.slice(a)}return r},n.generateECPolynomial=function(t){for(var e=new Uint8Array([1]),r=0;r<t;r++)e=n.mul(e,new Uint8Array([1,u[r]]));return e}});function l(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}d.mul,d.mod,d.generateECPolynomial,l.prototype.initialize=function(t){this.degree=t,this.genPoly=d.generateECPolynomial(this.degree)},l.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e,r=new Uint8Array(t.length+this.degree),t=(r.set(t),d.mod(r,this.genPoly)),r=this.degree-t.length;return 0<r?((e=new Uint8Array(this.degree)).set(t,r),e):t};function p(t){return!isNaN(t)&&1<=t&&t<=40}function U(t,e){for(var r=(t=t.bit<<3|e)<<10;0<=n(r)-S;)r^=1335<<n(r)-S;return 21522^(t<<10|r)}var rt=l,v="(?:(?![A-Z0-9 $%*+\\-./:]|"+(P="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+".replace(/u/g,"\\u"))+")(?:.|[\r\n]))+",w=new RegExp(P,"g"),m=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),v=new RegExp(v,"g"),E=new RegExp("[0-9]+","g"),y=new RegExp("[A-Z $%*+\\-./:]+","g"),x=new RegExp("^"+P+"$"),k=new RegExp("^[0-9]+$"),F=new RegExp("^[A-Z0-9 $%*+\\-./:]+$"),A={KANJI:w,BYTE_KANJI:m,BYTE:v,NUMERIC:E,ALPHANUMERIC:y,testKanji:function(t){return x.test(t)},testNumeric:function(t){return k.test(t)},testAlphanumeric:function(t){return F.test(t)}},$=e(function(t,n){n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(p(e))return 1<=e&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2];throw new Error("Invalid version: "+e)},n.getBestModeForData=function(t){return A.testNumeric(t)?n.NUMERIC:A.testAlphanumeric(t)?n.ALPHANUMERIC:A.testKanji(t)?n.KANJI:n.BYTE},n.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},n.isValid=function(t){return t&&t.bit&&t.ccBits},n.from=function(t,e){if(n.isValid(t))return t;try{var r=t;if("string"!=typeof r)throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+r)}return}catch(t){return e}}}),X=($.NUMERIC,$.ALPHANUMERIC,$.BYTE,$.KANJI,$.MIXED,$.getCharCountIndicator,$.getBestModeForData,$.isValid,e(function(t,f){var r=n(7973);function c(t,e){return $.getCharCountIndicator(t,e)+4}f.from=function(t,e){return p(t)?parseInt(t,10):e},f.getCapacity=function(t,e,r){if(!p(t))throw new Error("Invalid QR Code version");void 0===r&&(r=$.BYTE);e=8*(O[t]-j(t,e));if(r===$.MIXED)return e;var n=e-c(r,t);switch(r){case $.NUMERIC:return Math.floor(n/10*3);case $.ALPHANUMERIC:return Math.floor(n/11*2);case $.KANJI:return Math.floor(n/13);default:$.BYTE;return Math.floor(n/8)}},f.getBestVersionForData=function(t,e){var r,e=g.from(e,g.M);if(Array.isArray(t)){if(1<t.length){var n=t;var o=e;for(var a=1;a<=40;a++)if(function(t,r){var n=0;return t.forEach(function(t){var e=c(t.mode,r);n+=e+t.getBitsLength()}),n}(n,a)<=f.getCapacity(a,o,$.MIXED))return a;return}if(0===t.length)return 1;r=t[0]}else r=t;for(var i=r.mode,u=r.getLength(),s=e,h=1;h<=40;h++)if(u<=f.getCapacity(h,s,i))return h},f.getEncodedBits=function(t){if(!p(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;0<=n(e)-r;)e^=7973<<n(e)-r;return t<<12|e}})),S=(X.getCapacity,X.getBestVersionForData,X.getEncodedBits,n(1335));function I(t){this.mode=$.NUMERIC,this.data=t.toString()}I.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},I.prototype.getLength=function(){return this.data.length},I.prototype.getBitsLength=function(){return I.getBitsLength(this.data.length)},I.prototype.write=function(t){for(var e,r,n=0;n+3<=this.data.length;n+=3)e=this.data.substr(n,3),r=parseInt(e,10),t.put(r,10);var o=this.data.length-n;0<o&&(e=this.data.substr(n),r=parseInt(e,10),t.put(r,3*o+1))};var D=I,Y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function M(t){this.mode=$.ALPHANUMERIC,this.data=t}M.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},M.prototype.getLength=function(){return this.data.length},M.prototype.getBitsLength=function(){return M.getBitsLength(this.data.length)},M.prototype.write=function(t){for(var e=0;e+2<=this.data.length;e+=2){var r=45*Y.indexOf(this.data[e]);r+=Y.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(Y.indexOf(this.data[e]),6)};var _=M;function N(t){this.mode=$.BYTE,"string"==typeof t&&(t=function(t){for(var e=[],r=t.length,n=0;n<r;n++){var o,a=t.charCodeAt(n);55296<=a&&a<=56319&&n+1<r&&(56320<=(o=t.charCodeAt(n+1))&&o<=57343&&(a=1024*(a-55296)+o-56320+65536,n+=1)),a<128?e.push(a):a<2048?(e.push(a>>6|192),e.push(63&a|128)):a<55296||57344<=a&&a<65536?(e.push(a>>12|224),e.push(a>>6&63|128),e.push(63&a|128)):65536<=a&&a<=1114111?(e.push(a>>18|240),e.push(a>>12&63|128),e.push(a>>6&63|128),e.push(63&a|128)):e.push(239,191,189)}return new Uint8Array(e).buffer}(t)),this.data=new Uint8Array(t)}N.getBitsLength=function(t){return 8*t},N.prototype.getLength=function(){return this.data.length},N.prototype.getBitsLength=function(){return N.getBitsLength(this.data.length)},N.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var z=N;function B(t){this.mode=$.KANJI,this.data=t}B.getBitsLength=function(t){return 13*t},B.prototype.getLength=function(){return this.data.length},B.prototype.getBitsLength=function(){return B.getBitsLength(this.data.length)},B.prototype.write=function(t){for(var e=0;e<this.data.length;e++){r=this.data[e];var r=a(r);if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}t.put(r=192*(r>>>8&255)+(255&r),13)}};var H=B,J=e(function(t){var d={single_source_shortest_paths:function(t,e,r){var n={},o={};o[e]=0;var a,i,u,s,h,f,c,g=d.PriorityQueue.make();for(g.push(e,0);!g.empty();)for(u in i=(a=g.pop()).value,s=a.cost,h=t[i]||{})h.hasOwnProperty(u)&&(f=s+h[u],c=o[u],(void 0===o[u]||f<c)&&(o[u]=f,g.push(u,f),n[u]=i));if(void 0!==r&&void 0===o[r])throw e=["Could not find a path from ",e," to ",r,"."].join(""),new Error(e);return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),n=t[n];return r.reverse(),r},find_path:function(t,e,r){t=d.single_source_shortest_paths(t,e,r);return d.extract_shortest_path_from_predecessor_list(t,r)},PriorityQueue:{make:function(t){var e,r=d.PriorityQueue,n={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(n[e]=r[e]);return n.queue=[],n.sorter=t.sorter||r.default_sorter,n},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){this.queue.push({value:t,cost:e}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=d}),Z=e(function(t,i){function u(t){return unescape(encodeURIComponent(t)).length}function o(t,e,r){for(var n,o=[];null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function s(t){var e,r=o(A.NUMERIC,$.NUMERIC,t),n=o(A.ALPHANUMERIC,$.ALPHANUMERIC,t),t=R()?(e=o(A.BYTE,$.BYTE,t),o(A.KANJI,$.KANJI,t)):(e=o(A.BYTE_KANJI,$.BYTE,t),[]);return r.concat(n,e,t).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function l(t,e){switch(e){case $.NUMERIC:return D.getBitsLength(t);case $.ALPHANUMERIC:return _.getBitsLength(t);case $.KANJI:return H.getBitsLength(t);case $.BYTE:return z.getBitsLength(t)}}function r(t,e){var r=$.getBestModeForData(t);if((e=$.from(e,r))!==$.BYTE&&e.bit<r.bit)throw new Error('"'+t+'" cannot be encoded with mode '+$.toString(e)+".\n Suggested mode is: "+$.toString(r));switch(e=e!==$.KANJI||R()?e:$.BYTE){case $.NUMERIC:return new D(t);case $.ALPHANUMERIC:return new _(t);case $.KANJI:return new H(t);case $.BYTE:return new z(t)}}i.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(r(e,null)):e.data&&t.push(r(e.data,e.mode)),t},[])},i.fromString=function(t,e){for(var r=function(t,e){for(var r={},n={start:{}},o=["start"],a=0;a<t.length;a++){for(var i=t[a],u=[],s=0;s<i.length;s++){var h=i[s],f=""+a+s;u.push(f),r[f]={node:h,lastCount:0},n[f]={};for(var c=0;c<o.length;c++){var g=o[c];r[g]&&r[g].node.mode===h.mode?(n[g][f]=l(r[g].lastCount+h.length,h.mode)-l(r[g].lastCount,h.mode),r[g].lastCount+=h.length):(r[g]&&(r[g].lastCount=h.length),n[g][f]=l(h.length,h.mode)+4+$.getCharCountIndicator(h.mode,e))}}o=u}for(var d=0;d<o.length;d++)n[o[d]].end=0;return{map:n,table:r}}(function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];switch(n.mode){case $.NUMERIC:e.push([n,{data:n.data,mode:$.ALPHANUMERIC,length:n.length},{data:n.data,mode:$.BYTE,length:n.length}]);break;case $.ALPHANUMERIC:e.push([n,{data:n.data,mode:$.BYTE,length:n.length}]);break;case $.KANJI:e.push([n,{data:n.data,mode:$.BYTE,length:u(n.data)}]);break;case $.BYTE:e.push([{data:n.data,mode:$.BYTE,length:u(n.data)}])}}return e}(s(t)),e),n=J.find_path(r.map,"start","end"),o=[],a=1;a<n.length-1;a++)o.push(r.table[n[a]].node);return i.fromArray(o.reduce(function(t,e){var r=0<=t.length-1?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},i.rawSplit=function(t){return i.fromArray(s(t))}});function nt(t,e,r){for(var n,o=t.size,a=U(e,r),i=0;i<15;i++)n=1==(a>>i&1),i<6?t.set(i,8,n,!0):i<8?t.set(i+1,8,n,!0):t.set(o-15+i,8,n,!0),i<8?t.set(8,o-i-1,n,!0):i<9?t.set(8,15-i-1+1,n,!0):t.set(8,15-i-1,n,!0);t.set(o-8,8,1,!0)}function K(t,e,r,n){var o;if(Array.isArray(t))o=Z.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var a=e;a||(i=Z.rawSplit(t),a=X.getBestVersionForData(i,r)),o=Z.fromString(t,a||40)}var i=X.getBestVersionForData(o,r);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<i)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+i+".\n")}else e=i;for(var t=function(e,t,r){var n=new W,r=(r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),$.getCharCountIndicator(t.mode,e)),t.write(n)}),8*(O[e]-j(e,t)));for(n.getLengthInBits()+4<=r&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var o=(r-n.getLengthInBits())/8,a=0;a<o;a++)n.put(a%2?17:236,8);for(var r=n,i=O[f=e],u=i-j(f,t),s=et(f,t),h=s-i%s,f=Math.floor(i/s),c=Math.floor(u/s),g=c+1,d=f-c,l=new rt(d),p=0,v=new Array(s),w=new Array(s),m=0,E=new Uint8Array(r.buffer),y=0;y<s;y++){var A=y<h?c:g;v[y]=E.slice(p,p+A),w[y]=l.encode(v[y]),p+=A,m=Math.max(m,A)}for(var I,M=new Uint8Array(i),N=0,B=0;B<m;B++)for(I=0;I<s;I++)B<v[I].length&&(M[N++]=v[I][B]);for(B=0;B<d;B++)for(I=0;I<s;I++)M[N++]=w[I][B];return M}(e,r,o),a=Q(e),i=new G(a),u=i,a=e,s=u.size,h=tt(a),f=0;f<h.length;f++)for(var c=h[f][0],g=h[f][1],d=-1;d<=7;d++)if(!(c+d<=-1||s<=c+d))for(var l=-1;l<=7;l++)g+l<=-1||s<=g+l||(0<=d&&d<=6&&(0===l||6===l)||0<=l&&l<=6&&(0===d||6===d)||2<=d&&d<=4&&2<=l&&l<=4?u.set(c+d,g+l,!0,!0):u.set(c+d,g+l,!1,!0));for(var p=i,S=p.size,v=8;v<S-8;v++){var w=v%2==0;p.set(v,6,w,!0),p.set(6,v,w,!0)}for(var m=i,E=e,y=V.getPositions(E),A=0;A<y.length;A++)for(var D=y[A][0],Y=y[A][1],I=-2;I<=2;I++)for(var M=-2;M<=2;M++)-2===I||2===I||-2===M||2===M||0===I&&0===M?m.set(D+I,Y+M,!0,!0):m.set(D+I,Y+M,!1,!0);if(nt(i,r,0),7<=e){var N=i;E=e;for(var B,_,z,H=N.size,J=X.getEncodedBits(E),C=0;C<18;C++)B=Math.floor(C/3),N.set(B,_=C%3+H-8-3,z=1==(J>>C&1),!0),N.set(_,B,z,!0)}for(var P=i,K=t,R=P.size,T=-1,L=R-1,b=7,U=0,x=R-1;0<x;x-=2)for(6===x&&x--;;){for(var k,F=0;F<2;F++)P.isReserved(L,x-F)||(k=!1,U<K.length&&(k=1==(K[U]>>>b&1)),P.set(L,x-F,k),-1==--b&&(U++,b=7));if((L+=T)<0||R<=L){L-=T,T=-T;break}}return isNaN(n)&&(n=q.getBestMask(i,nt.bind(null,i,r))),q.applyMask(n,i),nt(i,r,n),{modules:i,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}Z.fromArray,Z.fromString,Z.rawSplit;function ot(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,o=g.M;if(void 0!==e&&(o=g.from(e.errorCorrectionLevel,g.M),r=X.from(e.version),n=q.from(e.maskPattern),e.toSJISFunc)){if("function"!=typeof(e=e.toSJISFunc))throw new Error('"toSJISFunc" is not a valid function.');a=e}return K(t,r,o,n)}var C=e(function(t,d){function o(t){if("string"!=typeof(t="number"==typeof t?t.toString():t))throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||8<e.length)throw new Error("Invalid hex color: "+t);6===(e=3!==e.length&&4!==e.length?e:Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))).length&&e.push("F","F");t=parseInt(e.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:255&t,hex:"#"+e.slice(0,6).join("")}}d.getOptions=function(t){(t=t||{}).color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&21<=t.width?t.width:void 0,n=t.scale||4;return{width:r,scale:r?4:n,margin:e,color:{dark:o(t.color.dark||"#000000ff"),light:o(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},d.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},d.getImageWidth=function(t,e){var r=d.getScale(t,e);return Math.floor((t+2*e.margin)*r)},d.qrToImageData=function(t,e,r){for(var n=e.modules.size,o=e.modules.data,a=d.getScale(n,r),i=Math.floor((n+2*r.margin)*a),u=r.margin*a,s=[r.color.light,r.color.dark],h=0;h<i;h++)for(var f=0;f<i;f++){var c=4*(h*i+f),g=r.color.light;u<=h&&u<=f&&h<i-u&&f<i-u&&(g=s[o[Math.floor((h-u)/a)*n+Math.floor((f-u)/a)]?1:0]),t[c++]=g.r,t[c++]=g.g,t[c++]=g.b,t[c]=g.a}}}),P=(C.getOptions,C.getScale,C.getImageWidth,C.qrToImageData,e(function(t,n){n.render=function(t,e,r){var n=e,e=(void 0!==r||e&&e.getContext||(r=e,e=void 0),e||(n=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),r=C.getOptions(r),C.getImageWidth(t.modules.size,r)),o=n.getContext("2d"),a=o.createImageData(e,e);return C.qrToImageData(a.data,t,r),t=n,r=e,o.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px",o.putImageData(a,0,0),n},n.renderToDataURL=function(t,e,r){void 0!==r||e&&e.getContext||(r=e,e=void 0),t=n.render(t,e,r=r||{}),e=r.type||"image/png",r=r.rendererOpts||{};return t.toDataURL(e,r.quality)}}));function at(t,e){var r=t.a/255,t=e+'="'+t.hex+'"';return r<1?t+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':t}function it(t,e,r){t+=e;return void 0!==r&&(t+=" "+r),t}P.render,P.renderToDataURL;function ut(n,o,a,i,t){var e=[].slice.call(arguments,1),r=e.length,e="function"==typeof e[r-1];if(!(e||"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then))throw new Error("Callback required as last argument");if(!e){if(r<1)throw new Error("Too few arguments provided");return 1===r?(a=o,o=i=void 0):2!==r||o.getContext||(i=a,a=o,o=void 0),new Promise(function(t,e){try{var r=ot(a,i);t(n(r,o,i))}catch(t){e(t)}})}if(r<2)throw new Error("Too few arguments provided");2===r?(t=a,a=o,o=i=void 0):3===r&&(o.getContext&&void 0===t?(t=i,i=void 0):(t=i,i=a,a=o,o=void 0));try{var u=ot(a,i);t(null,n(u,o,i))}catch(n){t(n)}}w=ot,m=ut.bind(null,P.render),v=ut.bind(null,P.renderToDataURL),E=ut.bind(null,function(t,e,r){return t=t,r=r,r=C.getOptions(r),o=t.modules.size,t=t.modules.data,a=o+2*r.margin,i=r.color.light.a?"<path "+at(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",t="<path "+at(r.color.dark,"stroke")+' d="'+function(t,e,r){for(var n="",o=0,a=!1,i=0,u=0;u<t.length;u++){var s=Math.floor(u%e),h=Math.floor(u/e);s||a||(a=!0),t[u]?(i++,0<u&&0<s&&t[u-1]||(n+=a?it("M",s+r,.5+h+r):it("m",o,0),o=0,a=!1),s+1<e&&t[u+1]||(n+=it("h",i),i=0)):o++}return n}(t,o,r.margin)+'"/>',o='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+('viewBox="0 0 '+a+" "+a+'"')+' shape-rendering="crispEdges">'+i+t+"</svg>\n","function"==typeof n&&n(null,o),o;var n,o,a,i}),y={create:w,toCanvas:m,toDataURL:v,toString:E};return t.create=w,t.default=y,t.toCanvas=m,t.toDataURL=v,t.toString=E,Object.defineProperty(t,"__esModule",{value:!0}),t}({});