shopar-plugin
Version:
Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.
1 lines • 168 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShopAR__QR={})}(this,function(t){"use strict";function e(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}),n}var n,r,i={};function o(){return r?n:(r=1,n=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var a,s={},h={};function u(){if(a)return h;let t;a=1;const e=[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];return h.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},h.getSymbolTotalCodewords=function(t){return e[t]},h.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},h.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');t=e},h.isKanjiModeEnabled=function(){return void 0!==t},h.toSJIS=function(e){return t(e)},h}var l,f,c,d,p,g={};function _(){return l||(l=1,(t=g).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(t){return n}}),g;var t}var w,m={};var b,y={};var v,E={};var k,T={};function R(){if(k)return T;k=1;const t=_(),e=[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],n=[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];return T.getBlocksCount=function(n,r){switch(r){case t.L:return e[4*(n-1)+0];case t.M:return e[4*(n-1)+1];case t.Q:return e[4*(n-1)+2];case t.H:return e[4*(n-1)+3];default:return}},T.getTotalCodewordsCount=function(e,r){switch(r){case t.L:return n[4*(e-1)+0];case t.M:return n[4*(e-1)+1];case t.Q:return n[4*(e-1)+2];case t.H:return n[4*(e-1)+3];default:return}},T}var A,L,x,S,C={},I={};function O(){return L||(L=1,function(t){const e=function(){if(A)return I;A=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let n=1;for(let r=0;r<255;r++)t[r]=n,e[n]=r,n<<=1,256&n&&(n^=285);for(let e=255;e<512;e++)t[e]=t[e-255]}(),I.log=function(t){if(t<1)throw new Error("log("+t+")");return e[t]},I.exp=function(e){return t[e]},I.mul=function(n,r){return 0===n||0===r?0:t[e[n]+e[r]]},I}();t.mul=function(t,n){const r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=e.mul(t[i],n[o]);return r},t.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){const t=r[0];for(let i=0;i<n.length;i++)r[i]^=e.mul(n[i],t);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=t.mul(r,new Uint8Array([1,e.exp(i)]));return r}}(C)),C}var P,M={},B={},D={};function z(){return P||(P=1,D.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),D}var N,U,F,Y={};function j(){if(N)return Y;N=1;const t="[0-9]+";let e="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";e=e.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+e+")(?:.|[\r\n]))+";Y.KANJI=new RegExp(e,"g"),Y.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Y.BYTE=new RegExp(n,"g"),Y.NUMERIC=new RegExp(t,"g"),Y.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const r=new RegExp("^"+e+"$"),i=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Y.testKanji=function(t){return r.test(t)},Y.testNumeric=function(t){return i.test(t)},Y.testAlphanumeric=function(t){return o.test(t)},Y}function Z(){return U||(U=1,function(t){const e=z(),n=j();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(t){return n}}}(B)),B}function H(){return F||(F=1,function(t){const e=u(),n=R(),r=_(),i=Z(),o=z(),a=e.getBCHDigit(7973);function s(t,e){return i.getCharCountIndicator(t,e)+4}function h(t,e){let n=0;return t.forEach(function(t){const r=s(t.mode,e);n+=r+t.getBitsLength()}),n}t.from=function(t,e){return o.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,r,a){if(!o.isValid(t))throw new Error("Invalid QR Code version");void 0===a&&(a=i.BYTE);const h=8*(e.getSymbolTotalCodewords(t)-n.getTotalCodewordsCount(t,r));if(a===i.MIXED)return h;const u=h-s(a,t);switch(a){case i.NUMERIC:return Math.floor(u/10*3);case i.ALPHANUMERIC:return Math.floor(u/11*2);case i.KANJI:return Math.floor(u/13);case i.BYTE:default:return Math.floor(u/8)}},t.getBestVersionForData=function(e,n){let o;const a=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(h(e,r)<=t.getCapacity(r,n,i.MIXED))return r}(e,a);if(0===e.length)return 1;o=e[0]}else o=e;return function(e,n,r){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,r,e))return i}(o.mode,o.getLength(),a)},t.getEncodedBits=function(t){if(!o.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;e.getBCHDigit(n)-a>=0;)n^=7973<<e.getBCHDigit(n)-a;return t<<12|n}}(M)),M}var W,q={};var G,V,K,J,X,Q,$,tt,et={};var nt,rt,it,ot={exports:{}};function at(){return nt||(nt=1,function(t){var e={single_source_shortest_paths:function(t,n,r){var i={},o={};o[n]=0;var a,s,h,u,l,f,c,d=e.PriorityQueue.make();for(d.push(n,0);!d.empty();)for(h in s=(a=d.pop()).value,u=a.cost,l=t[s]||{})l.hasOwnProperty(h)&&(f=u+l[h],c=o[h],(void 0===o[h]||c>f)&&(o[h]=f,d.push(h,f),i[h]=s));if(void 0!==r&&void 0===o[r]){var p=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var i=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,i={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e}(ot)),ot.exports}function st(){return rt||(rt=1,function(t){const e=Z(),n=function(){if(V)return G;V=1;const t=Z();function e(e){this.mode=t.NUMERIC,this.data=e.toString()}return e.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const i=this.data.length-e;i>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*i+1))},G=e}(),r=function(){if(J)return K;J=1;const t=Z(),e=["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 n(e){this.mode=t.ALPHANUMERIC,this.data=e}return n.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=45*e.indexOf(this.data[n]);r+=e.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(e.indexOf(this.data[n]),6)},K=n}(),i=function(){if(Q)return X;Q=1;const t=Z();function e(e){this.mode=t.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}return e.getBitsLength=function(t){return 8*t},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)},X=e}(),o=function(){if(tt)return $;tt=1;const t=Z(),e=u();function n(e){this.mode=t.KANJI,this.data=e}return n.getBitsLength=function(t){return 13*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let r=e.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[n]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},$=n}(),a=j(),s=u(),h=at();function l(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){const r=[];let i;for(;null!==(i=t.exec(n));)r.push({data:i[0],index:i.index,mode:e,length:i[0].length});return r}function c(t){const n=f(a.NUMERIC,e.NUMERIC,t),r=f(a.ALPHANUMERIC,e.ALPHANUMERIC,t);let i,o;s.isKanjiModeEnabled()?(i=f(a.BYTE,e.BYTE,t),o=f(a.KANJI,e.KANJI,t)):(i=f(a.BYTE_KANJI,e.BYTE,t),o=[]);return n.concat(r,i,o).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function d(t,a){switch(a){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return o.getBitsLength(t);case e.BYTE:return i.getBitsLength(t)}}function p(t,a){let h;const u=e.getBestModeForData(t);if(h=e.from(a,u),h!==e.BYTE&&h.bit<u.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(h)+".\n Suggested mode is: "+e.toString(u));switch(h!==e.KANJI||s.isKanjiModeEnabled()||(h=e.BYTE),h){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new o(t);case e.BYTE:return new i(t)}}t.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(p(e,null)):e.data&&t.push(p(e.data,e.mode)),t},[])},t.fromString=function(n,r){const i=function(t){const n=[];for(let r=0;r<t.length;r++){const i=t[r];switch(i.mode){case e.NUMERIC:n.push([i,{data:i.data,mode:e.ALPHANUMERIC,length:i.length},{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.ALPHANUMERIC:n.push([i,{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.KANJI:n.push([i,{data:i.data,mode:e.BYTE,length:l(i.data)}]);break;case e.BYTE:n.push([{data:i.data,mode:e.BYTE,length:l(i.data)}])}}return n}(c(n,s.isKanjiModeEnabled())),o=function(t,n){const r={},i={start:{}};let o=["start"];for(let a=0;a<t.length;a++){const s=t[a],h=[];for(let t=0;t<s.length;t++){const u=s[t],l=""+a+t;h.push(l),r[l]={node:u,lastCount:0},i[l]={};for(let t=0;t<o.length;t++){const a=o[t];r[a]&&r[a].node.mode===u.mode?(i[a][l]=d(r[a].lastCount+u.length,u.mode)-d(r[a].lastCount,u.mode),r[a].lastCount+=u.length):(r[a]&&(r[a].lastCount=u.length),i[a][l]=d(u.length,u.mode)+4+e.getCharCountIndicator(u.mode,n))}}o=h}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:r}}(i,r),a=h.find_path(o.map,"start","end"),u=[];for(let t=1;t<a.length-1;t++)u.push(o.table[a[t]].node);return t.fromArray(function(t){return t.reduce(function(t,e){const n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(u))},t.rawSplit=function(e){return t.fromArray(c(e,s.isKanjiModeEnabled()))}}(et)),et}function ht(){if(it)return s;it=1;const t=u(),e=_(),n=function(){if(c)return f;function t(){this.buffer=[],this.length=0}return c=1,t.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},f=t}(),r=function(){if(p)return d;function t(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)}return p=1,t.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},t.prototype.get=function(t,e){return this.data[t*this.size+e]},t.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},t.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},d=t}(),i=(w||(w=1,function(t){const e=u().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,r=e(t),i=145===r?26:2*Math.ceil((r-13)/(2*n-2)),o=[r-7];for(let t=1;t<n-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),i=r.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||n.push([r[t],r[e]]);return n}}(m)),m),o=function(){if(b)return y;b=1;const t=u().getSymbolSize;return y.getPositions=function(e){const n=t(e);return[[0,0],[n-7,0],[0,n-7]]},y}(),a=(v||(v=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,n=3,r=40,i=10;function o(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,i=0,o=0,a=null,s=null;for(let h=0;h<n;h++){i=o=0,a=s=null;for(let u=0;u<n;u++){let n=t.get(h,u);n===a?i++:(i>=5&&(r+=e+(i-5)),a=n,i=1),n=t.get(u,h),n===s?o++:(o>=5&&(r+=e+(o-5)),s=n,o=1)}i>=5&&(r+=e+(i-5)),o>=5&&(r+=e+(o-5))}return r},t.getPenaltyN2=function(t){const e=t.size;let r=0;for(let n=0;n<e-1;n++)for(let i=0;i<e-1;i++){const e=t.get(n,i)+t.get(n,i+1)+t.get(n+1,i)+t.get(n+1,i+1);4!==e&&0!==e||r++}return r*n},t.getPenaltyN3=function(t){const e=t.size;let n=0,i=0,o=0;for(let r=0;r<e;r++){i=o=0;for(let a=0;a<e;a++)i=i<<1&2047|t.get(r,a),a>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|t.get(a,r),a>=10&&(1488===o||93===o)&&n++}return n*r},t.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*i},t.applyMask=function(t,e){const n=e.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.isReserved(i,r)||e.xor(i,r,o(t,i,r))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let i=0,o=1/0;for(let a=0;a<r;a++){n(a),t.applyMask(a,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<o&&(o=r,i=a)}return i}}(E)),E),h=R(),l=function(){if(S)return x;S=1;const t=O();function e(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(e){this.degree=e,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(e.length+this.degree);n.set(e);const r=t.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){const t=new Uint8Array(this.degree);return t.set(r,i),t}return r},x=e}(),g=H(),k=function(){if(W)return q;W=1;const t=u(),e=t.getBCHDigit(1335);return q.getEncodedBits=function(n,r){const i=n.bit<<3|r;let o=i<<10;for(;t.getBCHDigit(o)-e>=0;)o^=1335<<t.getBCHDigit(o)-e;return 21522^(i<<10|o)},q}(),T=Z(),A=st();function L(t,e,n){const r=t.size,i=k.getEncodedBits(e,n);let o,a;for(o=0;o<15;o++)a=1==(i>>o&1),o<6?t.set(o,8,a,!0):o<8?t.set(o+1,8,a,!0):t.set(r-15+o,8,a,!0),o<8?t.set(8,r-o-1,a,!0):o<9?t.set(8,15-o-1+1,a,!0):t.set(8,15-o-1,a,!0);t.set(r-8,8,1,!0)}function C(e,r,i){const o=new n;i.forEach(function(t){o.put(t.mode.bit,4),o.put(t.getLength(),T.getCharCountIndicator(t.mode,e)),t.write(o)});const a=8*(t.getSymbolTotalCodewords(e)-h.getTotalCodewordsCount(e,r));for(o.getLengthInBits()+4<=a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(a-o.getLengthInBits())/8;for(let t=0;t<s;t++)o.put(t%2?17:236,8);return function(e,n,r){const i=t.getSymbolTotalCodewords(n),o=h.getTotalCodewordsCount(n,r),a=i-o,s=h.getBlocksCount(n,r),u=i%s,f=s-u,c=Math.floor(i/s),d=Math.floor(a/s),p=d+1,g=c-d,_=new l(g);let w=0;const m=new Array(s),b=new Array(s);let y=0;const v=new Uint8Array(e.buffer);for(let t=0;t<s;t++){const e=t<f?d:p;m[t]=v.slice(w,w+e),b[t]=_.encode(m[t]),w+=e,y=Math.max(y,e)}const E=new Uint8Array(i);let k,T,R=0;for(k=0;k<y;k++)for(T=0;T<s;T++)k<m[T].length&&(E[R++]=m[T][k]);for(k=0;k<g;k++)for(T=0;T<s;T++)E[R++]=b[T][k];return E}(o,e,r)}function I(e,n,s,h){let u;if(Array.isArray(e))u=A.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let t=n;if(!t){const n=A.rawSplit(e);t=g.getBestVersionForData(n,s)}u=A.fromString(e,t||40)}}const l=g.getBestVersionForData(u,s);if(!l)throw new Error("The amount of data is too big to be stored in a QR Code");if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+".\n")}else n=l;const f=C(n,s,u),c=t.getSymbolSize(n),d=new r(c);return function(t,e){const n=t.size,r=o.getPositions(e);for(let e=0;e<r.length;e++){const i=r[e][0],o=r[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1||n<=i+e))for(let r=-1;r<=7;r++)o+r<=-1||n<=o+r||(e>=0&&e<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===e||6===e)||e>=2&&e<=4&&r>=2&&r<=4?t.set(i+e,o+r,!0,!0):t.set(i+e,o+r,!1,!0))}}(d,n),function(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2==0;t.set(n,6,e,!0),t.set(6,n,e,!0)}}(d),function(t,e){const n=i.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0],i=n[e][1];for(let e=-2;e<=2;e++)for(let n=-2;n<=2;n++)-2===e||2===e||-2===n||2===n||0===e&&0===n?t.set(r+e,i+n,!0,!0):t.set(r+e,i+n,!1,!0)}}(d,n),L(d,s,0),n>=7&&function(t,e){const n=t.size,r=g.getEncodedBits(e);let i,o,a;for(let e=0;e<18;e++)i=Math.floor(e/3),o=e%3+n-8-3,a=1==(r>>e&1),t.set(i,o,a,!0),t.set(o,i,a,!0)}(d,n),function(t,e){const n=t.size;let r=-1,i=n-1,o=7,a=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!t.isReserved(i,s-n)){let r=!1;a<e.length&&(r=1==(e[a]>>>o&1)),t.set(i,s-n,r),o--,-1===o&&(a++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(d,f),isNaN(h)&&(h=a.getBestMask(d,L.bind(null,d,s))),a.applyMask(h,d),L(d,s,h),{modules:d,version:n,errorCorrectionLevel:s,maskPattern:h,segments:u}}return s.create=function(n,r){if(void 0===n||""===n)throw new Error("No input text");let i,o,s=e.M;return void 0!==r&&(s=e.from(r.errorCorrectionLevel,e.M),i=g.from(r.version),o=a.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),I(n,i,s,o)},s}var ut="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},lt=[],ft=[],ct="undefined"!=typeof Uint8Array?Uint8Array:Array,dt=!1;function pt(){dt=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)lt[e]=t[e],ft[t.charCodeAt(e)]=e;ft["-".charCodeAt(0)]=62,ft["_".charCodeAt(0)]=63}function gt(t){return lt[t>>18&63]+lt[t>>12&63]+lt[t>>6&63]+lt[63&t]}function _t(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(gt(r));return i.join("")}function wt(t){var e;dt||pt();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,h=n-r;s<h;s+=a)o.push(_t(t,s,s+a>h?h:s+a));return 1===r?(e=t[n-1],i+=lt[e>>2],i+=lt[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=lt[e>>10],i+=lt[e>>4&63],i+=lt[e<<2&63],i+="="),o.push(i),o.join("")}function mt(t,e,n,r,i){var o,a,s=8*i-r-1,h=(1<<s)-1,u=h>>1,l=-7,f=n?i-1:0,c=n?-1:1,d=t[e+f];for(f+=c,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=c,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=c,l-=8);if(0===o)o=1-u;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)}function bt(t,e,n,r,i,o){var a,s,h,u=8*o-i-1,l=(1<<u)-1,f=l>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+f>=1?c/h:c*Math.pow(2,1-f))*h>=2&&(a++,h/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*h-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[n+d]=255&a,d+=p,a/=256,u-=8);t[n+d-p]|=128*g}var yt={}.toString,vt=Array.isArray||function(t){return"[object Array]"==yt.call(t)};Rt.TYPED_ARRAY_SUPPORT=void 0===ut.TYPED_ARRAY_SUPPORT||ut.TYPED_ARRAY_SUPPORT;var Et=kt();function kt(){return Rt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Tt(t,e){if(kt()<e)throw new RangeError("Invalid typed array length");return Rt.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Rt.prototype:(null===t&&(t=new Rt(e)),t.length=e),t}function Rt(t,e,n){if(!(Rt.TYPED_ARRAY_SUPPORT||this instanceof Rt))return new Rt(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return xt(this,t)}return At(this,t,e,n)}function At(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);Rt.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Rt.prototype:t=St(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!Rt.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ot(e,n);t=Tt(t,r);var i=t.write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(It(e)){var n=0|Ct(e.length);return 0===(t=Tt(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?Tt(t,0):St(t,e);if("Buffer"===e.type&&vt(e.data))return St(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Lt(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,e){if(Lt(e),t=Tt(t,e<0?0:0|Ct(e)),!Rt.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function St(t,e){var n=e.length<0?0:0|Ct(e.length);t=Tt(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function Ct(t){if(t>=kt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kt().toString(16)+" bytes");return 0|t}function It(t){return!(null==t||!t._isBuffer)}function Ot(t,e){if(It(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return oe(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ae(t).length;default:if(r)return oe(t).length;e=(""+e).toLowerCase(),r=!0}}function Pt(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Vt(this,e,n);case"utf8":case"utf-8":return Ht(this,e,n);case"ascii":return qt(this,e,n);case"latin1":case"binary":return Gt(this,e,n);case"base64":return Zt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function Mt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Bt(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=Rt.from(e,r)),It(e))return 0===e.length?-1:Dt(t,e,n,r,i);if("number"==typeof e)return e&=255,Rt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):Dt(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Dt(t,e,n,r,i){var o,a=1,s=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,h/=2,n/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===h)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+h>s&&(n=s-h),o=n;o>=0;o--){for(var f=!0,c=0;c<h;c++)if(u(t,o+c)!==u(e,c)){f=!1;break}if(f)return o}return-1}function zt(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function Nt(t,e,n,r){return se(oe(e,t.length-n),t,n,r)}function Ut(t,e,n,r){return se(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function Ft(t,e,n,r){return Ut(t,e,n,r)}function Yt(t,e,n,r){return se(ae(e),t,n,r)}function jt(t,e,n,r){return se(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function Zt(t,e,n){return 0===e&&n===t.length?wt(t):wt(t.slice(e,n))}function Ht(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,h,u=t[i],l=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=n)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&u)<<6|63&o)>127&&(l=h);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(h=(15&u)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(l=h);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(l=h)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=Wt)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Wt));return n}(r)}Rt.poolSize=8192,Rt._augment=function(t){return t.__proto__=Rt.prototype,t},Rt.from=function(t,e,n){return At(null,t,e,n)},Rt.TYPED_ARRAY_SUPPORT&&(Rt.prototype.__proto__=Uint8Array.prototype,Rt.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Rt[Symbol.species]),Rt.alloc=function(t,e,n){return function(t,e,n,r){return Lt(e),e<=0?Tt(t,e):void 0!==n?"string"==typeof r?Tt(t,e).fill(n,r):Tt(t,e).fill(n):Tt(t,e)}(null,t,e,n)},Rt.allocUnsafe=function(t){return xt(null,t)},Rt.allocUnsafeSlow=function(t){return xt(null,t)},Rt.isBuffer=he,Rt.compare=function(t,e){if(!It(t)||!It(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},Rt.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Rt.concat=function(t,e){if(!vt(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Rt.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=Rt.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!It(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Rt.byteLength=Ot,Rt.prototype._isBuffer=!0,Rt.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Mt(this,e,e+1);return this},Rt.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Mt(this,e,e+3),Mt(this,e+1,e+2);return this},Rt.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Mt(this,e,e+7),Mt(this,e+1,e+6),Mt(this,e+2,e+5),Mt(this,e+3,e+4);return this},Rt.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Ht(this,0,t):Pt.apply(this,arguments)},Rt.prototype.equals=function(t){if(!It(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Rt.compare(this,t)},Rt.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Rt.prototype.compare=function(t,e,n,r,i){if(!It(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),h=this.slice(r,i),u=t.slice(e,n),l=0;l<s;++l)if(h[l]!==u[l]){o=h[l],a=u[l];break}return o<a?-1:a<o?1:0},Rt.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},Rt.prototype.indexOf=function(t,e,n){return Bt(this,t,e,n,!0)},Rt.prototype.lastIndexOf=function(t,e,n){return Bt(this,t,e,n,!1)},Rt.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return zt(this,t,e,n);case"utf8":case"utf-8":return Nt(this,t,e,n);case"ascii":return Ut(this,t,e,n);case"latin1":case"binary":return Ft(this,t,e,n);case"base64":return Yt(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Rt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Wt=4096;function qt(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function Gt(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function Vt(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=ie(t[o]);return i}function Kt(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Jt(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function Xt(t,e,n,r,i,o){if(!It(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Qt(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function $t(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function te(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ee(t,e,n,r,i){return i||te(t,0,n,4),bt(t,e,n,r,23,4),n+4}function ne(t,e,n,r,i){return i||te(t,0,n,8),bt(t,e,n,r,52,8),n+8}Rt.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),Rt.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=Rt.prototype;else{var i=e-t;n=new Rt(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},Rt.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Jt(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},Rt.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Jt(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},Rt.prototype.readUInt8=function(t,e){return e||Jt(t,1,this.length),this[t]},Rt.prototype.readUInt16LE=function(t,e){return e||Jt(t,2,this.length),this[t]|this[t+1]<<8},Rt.prototype.readUInt16BE=function(t,e){return e||Jt(t,2,this.length),this[t]<<8|this[t+1]},Rt.prototype.readUInt32LE=function(t,e){return e||Jt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Rt.prototype.readUInt32BE=function(t,e){return e||Jt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Rt.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Jt(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},Rt.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Jt(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Rt.prototype.readInt8=function(t,e){return e||Jt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Rt.prototype.readInt16LE=function(t,e){e||Jt(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},Rt.prototype.readInt16BE=function(t,e){e||Jt(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},Rt.prototype.readInt32LE=function(t,e){return e||Jt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Rt.prototype.readInt32BE=function(t,e){return e||Jt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Rt.prototype.readFloatLE=function(t,e){return e||Jt(t,4,this.length),mt(this,t,!0,23,4)},Rt.prototype.readFloatBE=function(t,e){return e||Jt(t,4,this.length),mt(this,t,!1,23,4)},Rt.prototype.readDoubleLE=function(t,e){return e||Jt(t,8,this.length),mt(this,t,!0,52,8)},Rt.prototype.readDoubleBE=function(t,e){return e||Jt(t,8,this.length),mt(this,t,!1,52,8)},Rt.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Xt(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},Rt.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Xt(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},Rt.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,1,255,0),Rt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Rt.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,2,65535,0),Rt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Qt(this,t,e,!0),e+2},Rt.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,2,65535,0),Rt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Qt(this,t,e,!1),e+2},Rt.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,4,4294967295,0),Rt.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$t(this,t,e,!0),e+4},Rt.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,4,4294967295,0),Rt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$t(this,t,e,!1),e+4},Rt.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Xt(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+n},Rt.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Xt(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+n},Rt.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,1,127,-128),Rt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Rt.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,2,32767,-32768),Rt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Qt(this,t,e,!0),e+2},Rt.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,2,32767,-32768),Rt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Qt(this,t,e,!1),e+2},Rt.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,4,2147483647,-2147483648),Rt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$t(this,t,e,!0),e+4},Rt.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Xt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Rt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$t(this,t,e,!1),e+4},Rt.prototype.writeFloatLE=function(t,e,n){return ee(this,t,e,!0,n)},Rt.prototype.writeFloatBE=function(t,e,n){return ee(this,t,e,!1,n)},Rt.prototype.writeDoubleLE=function(t,e,n){return ne(this,t,e,!0,n)},Rt.prototype.writeDoubleBE=function(t,e,n){return ne(this,t,e,!1,n)},Rt.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!Rt.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},Rt.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Rt.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=It(t)?t:oe(new Rt(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var re=/[^+\/0-9A-Za-z-_]/g;function ie(t){return t<16?"0"+t.toString(16):t.toString(16)}function oe(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function ae(t){return function(t){var e,n,r,i,o,a;dt||pt();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new ct(3*s/4-o),r=o>0?s-4:s;var h=0;for(e=0,n=0;e<r;e+=4,n+=3)i=ft[t.charCodeAt(e)]<<18|ft[t.charCodeAt(e+1)]<<12|ft[t.charCodeAt(e+2)]<<6|ft[t.charCodeAt(e+3)],a[h++]=i>>16&255,a[h++]=i>>8&255,a[h++]=255&i;return 2===o?(i=ft[t.charCodeAt(e)]<<2|ft[t.charCodeAt(e+1)]>>4,a[h++]=255&i):1===o&&(i=ft[t.charCodeAt(e)]<<10|ft[t.charCodeAt(e+1)]<<4|ft[t.charCodeAt(e+2)]>>2,a[h++]=i>>8&255,a[h++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(re,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function se(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function he(t){return null!=t&&(!!t._isBuffer||ue(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&ue(t.slice(0,0))}(t))}function ue(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var le=Object.freeze({__proto__:null,Buffer:Rt,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Rt.alloc(+t)},isBuffer:he,kMaxLength:Et}),fe={},ce=e(Object.freeze({__proto__:null,default:{}}));function de(){throw new Error("setTimeout has not been defined")}function pe(){throw new Error("clearTimeout has not been defined")}var ge=de,_e=pe;function we(t){if(ge===setTimeout)return setTimeout(t,0);if((ge===de||!ge)&&setTimeout)return ge=setTimeout,setTimeout(t,0);try{return ge(t,0)}catch(e){try{return ge.call(null,t,0)}catch(e){return ge.call(this,t,0)}}}"function"==typeof ut.setTimeout&&(ge=setTimeout),"function"==typeof ut.clearTimeout&&(_e=clearTimeout);var me,be=[],ye=!1,ve=-1;function Ee(){ye&&me&&(ye=!1,me.length?be=me.concat(be):ve=-1,be.length&&ke())}function ke(){if(!ye){var t=we(Ee);ye=!0;for(var e=be.length;e;){for(me=be,be=[];++ve<e;)me&&me[ve].run();ve=-1,e=be.length}me=null,ye=!1,function(t){if(_e===clearTimeout)return clearTimeout(t);if((_e===pe||!_e)&&clearTimeout)return _e=clearTimeout,clearTimeout(t);try{return _e(t)}catch(e){try{return _e.call(null,t)}catch(e){return _e.call(this,t)}}}(t)}}function Te(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];be.push(new Re(t,e)),1!==be.length||ye||we(ke)}function Re(t,e){this.fun=t,this.array=e}Re.prototype.run=function(){this.fun.apply(null,this.array)};function Ae(){}var Le=Ae,xe=Ae,Se=Ae,Ce=Ae,Ie=Ae,Oe=Ae,Pe=Ae;var Me=ut.performance||{},Be=Me.now||Me.mozNow||Me.msNow||Me.oNow||Me.webkitNow||function(){return(new Date).getTime()};var De=new Date;var ze,Ne={nextTick:Te,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Le,addListener:xe,once:Se,off:Ce,removeListener:Ie,removeAllListeners:Oe,emit:Pe,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*Be.call(Me),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-De)/1e3}},Ue={};ze="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t};var Fe=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},Ye=/%[sdj%]/g;function je(t){if(!on(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(Ge(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(t).replace(Ye,function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),a=r[n];n<i;a=r[++n])en(a)||!un(a)?o+=" "+a:o+=" "+Ge(a);return o}function Ze(t,e){if(sn(ut.process))return function(){return Ze(t,e).apply(this,arguments)};if(!0===Ne.noDeprecation)return t;var n=!1;return function(){if(!n){if(Ne.throwDeprecation)throw new Error(e);Ne.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this,arguments)}}var He,We={};function qe(t){if(sn(He)&&(He=Ne.env.NODE_DEBUG||""),t=t.toUpperCase(),!We[t])if(new RegExp("\\b"+t+"\\b","i").test(He)){We[t]=function(){var e=je.apply(null,arguments);console.error("%s %d: %s",t,0,e)}}else We[t]=function(){};return We[t]}function Ge(t,e){var n={seen:[],stylize:Ke};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),tn(e)?n.showHidden=e:e&&bn(n,e),sn(n.showHidden)&&(n.showHidden=!1),sn(n.depth)&&(n.depth=2),sn(n.colors)&&(n.colors=!1),sn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Ve),Je(n,t,n.depth)}function Ve(t,e){var n=Ge.styles[e];return n?"["+Ge.colors[n][0]+"m"+t+"["+Ge.colors[n][1]+"m":t}function Ke(t,e){return t}function Je(t,e,n){if(t.customInspect&&e&&cn(e.inspect)&&e.inspect!==Ge&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return on(r)||(r=Je(t,r,n)),r}var i=function(t,e){if(sn(e))return t.stylize("undefined","undefined");if(on(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(rn(e))return t.stylize(""+e,"number");if(tn(e))return t.stylize(""+e,"boolean");if(en(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),a=function(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),fn(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Xe(e);if(0===o.length){if(cn(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(hn(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(ln(e))return t.stylize(Date.prototype.toString.call(e),"date");if(fn(e))return Xe(e)}var h,u="",l=!1,f=["{","}"];($e(e)&&(l=!0,f=["[","]"]),cn(e))&&(u=" [Function"+(e.name?": "+e.name:"")+"]");return hn(e)&&(u=" "+RegExp.prototype.toString.call(e)),ln(e)&&(u=" "+Date.prototype.toUTCString.call(e)),fn(e)&&(u=" "+Xe(e)),0!==o.length||l&&0!=e.length?n<0?hn(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),h=l?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)yn(e,String(a))?o.push(Qe(t,e,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(Qe(t,e,n,r,i,!0))}),o}(t,e,n,a,o):o.map(function(r){return Qe(t,e,n,a,r,l)}),t.seen.pop(),function(t,e,n){var r=t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(r>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(h,u,f)):f[0]+u+f[1]}function Xe(t){return"["+Error.prototype.toString.call(t)+"]"}function Qe(t,e,n,r,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(s=t.stylize("[Setter]","special")),yn(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(h.value)<0?(s=en(n)?Je(t,h.value,null):Je(t,h.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")