mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
4176f3659b
* Add PSBT QR code scan/show This PR introduces support to show and read PSBTs in BC-UR format via animated QR codes. This allows you to use BTCPay with HW devices such as Cobo Vault and Blue wallet to sign transactions without ever exposing the keys outside of that device. Spec: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md I've also bumped the QR code library we sue as it had a bug with large datasets. * Reuse same code for all and allow wallet import via QR code scan * remove unecessary js vendor files * Allow export wallet from settings via QR * formatting * bundle * fix wallet receive bundle
10 lines
54 KiB
JavaScript
10 lines
54 KiB
JavaScript
/*!
|
|
* vue-qrcode v1.0.2
|
|
* https://fengyuanchen.github.io/vue-qrcode
|
|
*
|
|
* Copyright 2018-present Chen Fengyuan
|
|
* Released under the MIT license
|
|
*
|
|
* Date: 2020-01-18T06:04:33.222Z
|
|
*/
|
|
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).VueQrcode=r()}(this,function(){"use strict";function c(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var t,o=(function(t,r){t.exports=function i(a,u,f){function s(e,t){if(!u[e]){if(!a[e]){var r=c;if(!t&&r)return r(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=u[e]={exports:{}};a[e][0].call(o.exports,function(t){var r=a[e][1][t];return s(r||t)},o,o.exports,i,a,u,f)}return u[e].exports}for(var h=c,t=0;t<f.length;t++)s(f[t]);return s}({1:[function(t,r,e){r.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},{}],2:[function(t,r,a){var u=t("./utils").getSymbolSize;a.getRowColCoords=function(t){if(1===t)return[];for(var r=Math.floor(t/7)+2,e=u(t),n=145===e?26:2*Math.ceil((e-13)/(2*r-2)),o=[e-7],i=1;i<r-1;i++)o[i]=o[i-1]-n;return o.push(6),o.reverse()},a.getPositions=function(t){for(var r=[],e=a.getRowColCoords(t),n=e.length,o=0;o<n;o++)for(var i=0;i<n;i++)0===o&&0===i||0===o&&i===n-1||o===n-1&&0===i||r.push([e[o],e[i]]);return r}},{"./utils":21}],3:[function(t,r,e){var n=t("./mode"),o=["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 i(t){this.mode=n.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var r;for(r=0;r+2<=this.data.length;r+=2){var e=45*o.indexOf(this.data[r]);e+=o.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(o.indexOf(this.data[r]),6)},r.exports=i},{"./mode":14}],4:[function(t,r,e){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var r=Math.floor(t/8);return 1==(this.buffer[r]>>>7-t%8&1)},put:function(t,r){for(var e=0;e<r;e++)this.putBit(1==(t>>>r-e-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},r.exports=n},{}],5:[function(t,r,e){var n=t("../utils/buffer");function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=n.alloc(t*t),this.reservedBit=n.alloc(t*t)}o.prototype.set=function(t,r,e,n){var o=t*this.size+r;this.data[o]=e,n&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,r){return this.data[t*this.size+r]},o.prototype.xor=function(t,r,e){this.data[t*this.size+r]^=e},o.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},r.exports=o},{"../utils/buffer":28}],6:[function(t,r,e){var n=t("../utils/buffer"),o=t("./mode");function i(t){this.mode=o.BYTE,this.data=n.from(t)}i.getBitsLength=function(t){return 8*t},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 r=0,e=this.data.length;r<e;r++)t.put(this.data[r],8)},r.exports=i},{"../utils/buffer":28,"./mode":14}],7:[function(t,r,e){var n=t("./error-correction-level"),o=[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];e.getBlocksCount=function(t,r){switch(r){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,r){switch(r){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},{"./error-correction-level":8}],8:[function(t,r,e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&0<=t.bit&&t.bit<4},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return r}}},{}],9:[function(t,r,e){var n=t("./utils").getSymbolSize;e.getPositions=function(t){var r=n(t);return[[0,0],[r-7,0],[0,r-7]]}},{"./utils":21}],10:[function(t,r,e){var o=t("./utils"),i=o.getBCHDigit(1335);e.getEncodedBits=function(t,r){for(var e=t.bit<<3|r,n=e<<10;0<=o.getBCHDigit(n)-i;)n^=1335<<o.getBCHDigit(n)-i;return 21522^(e<<10|n)}},{"./utils":21}],11:[function(t,r,e){var n=t("../utils/buffer"),o=n.alloc(512),i=n.alloc(256);!function(){for(var t=1,r=0;r<255;r++)o[r]=t,i[t]=r,256&(t<<=1)&&(t^=285);for(r=255;r<512;r++)o[r]=o[r-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},e.exp=function(t){return o[t]},e.mul=function(t,r){return 0===t||0===r?0:o[i[t]+i[r]]}},{"../utils/buffer":28}],12:[function(t,r,e){var n=t("./mode"),o=t("./utils");function i(t){this.mode=n.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var r;for(r=0;r<this.data.length;r++){var e=o.toSJIS(this.data[r]);if(33088<=e&&e<=40956)e-=33088;else{if(!(57408<=e&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},r.exports=i},{"./mode":14,"./utils":21}],13:[function(t,r,u){u.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var h={N1:3,N2:3,N3:40,N4:10};function i(t,r,e){switch(t){case u.Patterns.PATTERN000:return(r+e)%2==0;case u.Patterns.PATTERN001:return r%2==0;case u.Patterns.PATTERN010:return e%3==0;case u.Patterns.PATTERN011:return(r+e)%3==0;case u.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case u.Patterns.PATTERN101:return r*e%2+r*e%3==0;case u.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case u.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}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 r=t.size,e=0,n=0,o=0,i=null,a=null,u=0;u<r;u++){n=o=0,i=a=null;for(var f=0;f<r;f++){var s=t.get(u,f);s===i?n++:(5<=n&&(e+=h.N1+(n-5)),i=s,n=1),(s=t.get(f,u))===a?o++:(5<=o&&(e+=h.N1+(o-5)),a=s,o=1)}5<=n&&(e+=h.N1+(n-5)),5<=o&&(e+=h.N1+(o-5))}return e},u.getPenaltyN2=function(t){for(var r=t.size,e=0,n=0;n<r-1;n++)for(var o=0;o<r-1;o++){var i=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==i&&0!==i||e++}return e*h.N2},u.getPenaltyN3=function(t){for(var r=t.size,e=0,n=0,o=0,i=0;i<r;i++){n=o=0;for(var a=0;a<r;a++)n=n<<1&2047|t.get(i,a),10<=a&&(1488===n||93===n)&&e++,o=o<<1&2047|t.get(a,i),10<=a&&(1488===o||93===o)&&e++}return e*h.N3},u.getPenaltyN4=function(t){for(var r=0,e=t.data.length,n=0;n<e;n++)r+=t.data[n];var o=Math.abs(Math.ceil(100*r/e/5)-10);return o*h.N4},u.applyMask=function(t,r){for(var e=r.size,n=0;n<e;n++)for(var o=0;o<e;o++)r.isReserved(o,n)||r.xor(o,n,i(t,o,n))},u.getBestMask=function(t,r){for(var e=Object.keys(u.Patterns).length,n=0,o=1/0,i=0;i<e;i++){r(i),u.applyMask(i,t);var a=u.getPenaltyN1(t)+u.getPenaltyN2(t)+u.getPenaltyN3(t)+u.getPenaltyN4(t);u.applyMask(i,t),a<o&&(o=a,n=i)}return n}},{}],14:[function(t,r,e){var n=t("./version-check"),o=t("./regex");e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return 1<=r&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return r}}},{"./regex":19,"./version-check":22}],15:[function(t,r,e){var n=t("./mode");function o(t){this.mode=n.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var r,e,n;for(r=0;r+3<=this.data.length;r+=3)e=this.data.substr(r,3),n=parseInt(e,10),t.put(n,10);var o=this.data.length-r;0<o&&(e=this.data.substr(r),n=parseInt(e,10),t.put(n,3*o+1))},r.exports=o},{"./mode":14}],16:[function(t,r,n){var a=t("../utils/buffer"),u=t("./galois-field");n.mul=function(t,r){for(var e=a.alloc(t.length+r.length-1),n=0;n<t.length;n++)for(var o=0;o<r.length;o++)e[n+o]^=u.mul(t[n],r[o]);return e},n.mod=function(t,r){for(var e=a.from(t);0<=e.length-r.length;){for(var n=e[0],o=0;o<r.length;o++)e[o]^=u.mul(r[o],n);for(var i=0;i<e.length&&0===e[i];)i++;e=e.slice(i)}return e},n.generateECPolynomial=function(t){for(var r=a.from([1]),e=0;e<t;e++)r=n.mul(r,[1,u.exp(e)]);return r}},{"../utils/buffer":28,"./galois-field":11}],17:[function(t,r,e){var T=t("../utils/buffer"),R=t("./utils"),i=t("./error-correction-level"),s=t("./bit-buffer"),c=t("./bit-matrix"),l=t("./alignment-pattern"),g=t("./finder-pattern"),p=t("./mask-pattern"),C=t("./error-correction-code"),I=t("./reed-solomon-encoder"),d=t("./version"),u=t("./format-info"),h=t("./mode"),y=t("./segments"),v=t("isarray");function w(t,r,e){var n,o,i=t.size,a=u.getEncodedBits(r,e);for(n=0;n<15;n++)o=1==(a>>n&1),n<6?t.set(n,8,o,!0):n<8?t.set(n+1,8,o,!0):t.set(i-15+n,8,o,!0),n<8?t.set(8,i-n-1,o,!0):n<9?t.set(8,15-n-1+1,o,!0):t.set(8,15-n-1,o,!0);t.set(i-8,8,1,!0)}function m(r,t,e){var n=new s;e.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),h.getCharCountIndicator(t.mode,r)),t.write(n)});var o=R.getSymbolTotalCodewords(r),i=C.getTotalCodewordsCount(r,t),a=8*(o-i);for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var u=(a-n.getLengthInBits())/8,f=0;f<u;f++)n.put(f%2?17:236,8);return function(t,r,e){for(var n=R.getSymbolTotalCodewords(r),o=C.getTotalCodewordsCount(r,e),i=n-o,a=C.getBlocksCount(r,e),u=a-n%a,f=Math.floor(n/a),s=Math.floor(i/a),h=s+1,c=f-s,l=new I(c),g=0,p=new Array(a),d=new Array(a),y=0,v=T.from(t.buffer),w=0;w<a;w++){var m=w<u?s:h;p[w]=v.slice(g,g+m),d[w]=l.encode(p[w]),g+=m,y=Math.max(y,m)}var b,E,A=T.alloc(n),B=0;for(b=0;b<y;b++)for(E=0;E<a;E++)b<p[E].length&&(A[B++]=p[E][b]);for(b=0;b<c;b++)for(E=0;E<a;E++)A[B++]=d[E][b];return A}(n,r,t)}function a(t,r,e,n){var o;if(v(t))o=y.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var i=r;if(!i){var a=y.rawSplit(t);i=d.getBestVersionForData(a,e)}o=y.fromString(t,i||40)}var u=d.getBestVersionForData(o,e);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(r){if(r<u)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+u+".\n")}else r=u;var f=m(r,e,o),s=R.getSymbolSize(r),h=new c(s);return function(t,r){for(var e=t.size,n=g.getPositions(r),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],u=-1;u<=7;u++)if(!(i+u<=-1||e<=i+u))for(var f=-1;f<=7;f++)a+f<=-1||e<=a+f||(0<=u&&u<=6&&(0===f||6===f)||0<=f&&f<=6&&(0===u||6===u)||2<=u&&u<=4&&2<=f&&f<=4?t.set(i+u,a+f,!0,!0):t.set(i+u,a+f,!1,!0))}(h,r),function(t){for(var r=t.size,e=8;e<r-8;e++){var n=e%2==0;t.set(e,6,n,!0),t.set(6,e,n,!0)}}(h),function(t,r){for(var e=l.getPositions(r),n=0;n<e.length;n++)for(var o=e[n][0],i=e[n][1],a=-2;a<=2;a++)for(var u=-2;u<=2;u++)-2===a||2===a||-2===u||2===u||0===a&&0===u?t.set(o+a,i+u,!0,!0):t.set(o+a,i+u,!1,!0)}(h,r),w(h,e,0),7<=r&&function(t,r){for(var e,n,o,i=t.size,a=d.getEncodedBits(r),u=0;u<18;u++)e=Math.floor(u/3),n=u%3+i-8-3,o=1==(a>>u&1),t.set(e,n,o,!0),t.set(n,e,o,!0)}(h,r),function(t,r){for(var e=t.size,n=-1,o=e-1,i=7,a=0,u=e-1;0<u;u-=2)for(6===u&&u--;;){for(var f=0;f<2;f++)if(!t.isReserved(o,u-f)){var s=!1;a<r.length&&(s=1==(r[a]>>>i&1)),t.set(o,u-f,s),-1===--i&&(a++,i=7)}if((o+=n)<0||e<=o){o-=n,n=-n;break}}}(h,f),isNaN(n)&&(n=p.getBestMask(h,w.bind(null,h,e))),p.applyMask(n,h),w(h,e,n),{modules:h,version:r,errorCorrectionLevel:e,maskPattern:n,segments:o}}e.create=function(t,r){if(void 0===t||""===t)throw new Error("No input text");var e,n,o=i.M;return void 0!==r&&(o=i.from(r.errorCorrectionLevel,i.M),e=d.from(r.version),n=p.from(r.maskPattern),r.toSJISFunc&&R.setToSJISFunction(r.toSJISFunc)),a(t,e,o,n)}},{"../utils/buffer":28,"./alignment-pattern":2,"./bit-buffer":4,"./bit-matrix":5,"./error-correction-code":7,"./error-correction-level":8,"./finder-pattern":9,"./format-info":10,"./mask-pattern":13,"./mode":14,"./reed-solomon-encoder":18,"./segments":20,"./utils":21,"./version":23,isarray:33}],18:[function(t,r,e){var a=t("../utils/buffer"),u=t("./polynomial"),f=t("buffer").Buffer;function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(t){this.degree=t,this.genPoly=u.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var r=a.alloc(this.degree),e=f.concat([t,r],t.length+this.degree),n=u.mod(e,this.genPoly),o=this.degree-n.length;if(0<o){var i=a.alloc(this.degree);return n.copy(i,o),i}return n},r.exports=n},{"../utils/buffer":28,"./polynomial":16,buffer:30}],19:[function(t,r,e){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(o,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),u=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return i.test(t)},e.testNumeric=function(t){return a.test(t)},e.testAlphanumeric=function(t){return u.test(t)}},{}],20:[function(t,r,f){var g=t("./mode"),o=t("./numeric-data"),i=t("./alphanumeric-data"),a=t("./byte-data"),u=t("./kanji-data"),s=t("./regex"),h=t("./utils"),c=t("dijkstrajs");function l(t){return unescape(encodeURIComponent(t)).length}function p(t,r,e){for(var n,o=[];null!==(n=t.exec(e));)o.push({data:n[0],index:n.index,mode:r,length:n[0].length});return o}function d(t){var r,e,n=p(s.NUMERIC,g.NUMERIC,t),o=p(s.ALPHANUMERIC,g.ALPHANUMERIC,t);e=h.isKanjiModeEnabled()?(r=p(s.BYTE,g.BYTE,t),p(s.KANJI,g.KANJI,t)):(r=p(s.BYTE_KANJI,g.BYTE,t),[]);var i=n.concat(o,r,e);return i.sort(function(t,r){return t.index-r.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function y(t,r){switch(r){case g.NUMERIC:return o.getBitsLength(t);case g.ALPHANUMERIC:return i.getBitsLength(t);case g.KANJI:return u.getBitsLength(t);case g.BYTE:return a.getBitsLength(t)}}function e(t,r){var e,n=g.getBestModeForData(t);if((e=g.from(r,n))!==g.BYTE&&e.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+g.toString(e)+".\n Suggested mode is: "+g.toString(n));switch(e!==g.KANJI||h.isKanjiModeEnabled()||(e=g.BYTE),e){case g.NUMERIC:return new o(t);case g.ALPHANUMERIC:return new i(t);case g.KANJI:return new u(t);case g.BYTE:return new a(t)}}f.fromArray=function(t){return t.reduce(function(t,r){return"string"==typeof r?t.push(e(r,null)):r.data&&t.push(e(r.data,r.mode)),t},[])},f.fromString=function(t,r){for(var e=d(t,h.isKanjiModeEnabled()),n=function(t){for(var r=[],e=0;e<t.length;e++){var n=t[e];switch(n.mode){case g.NUMERIC:r.push([n,{data:n.data,mode:g.ALPHANUMERIC,length:n.length},{data:n.data,mode:g.BYTE,length:n.length}]);break;case g.ALPHANUMERIC:r.push([n,{data:n.data,mode:g.BYTE,length:n.length}]);break;case g.KANJI:r.push([n,{data:n.data,mode:g.BYTE,length:l(n.data)}]);break;case g.BYTE:r.push([{data:n.data,mode:g.BYTE,length:l(n.data)}])}}return r}(e),o=function(t,r){for(var e={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var a=t[i],u=[],f=0;f<a.length;f++){var s=a[f],h=""+i+f;u.push(h),e[h]={node:s,lastCount:0},n[h]={};for(var c=0;c<o.length;c++){var l=o[c];e[l]&&e[l].node.mode===s.mode?(n[l][h]=y(e[l].lastCount+s.length,s.mode)-y(e[l].lastCount,s.mode),e[l].lastCount+=s.length):(e[l]&&(e[l].lastCount=s.length),n[l][h]=y(s.length,s.mode)+4+g.getCharCountIndicator(s.mode,r))}}o=u}for(c=0;c<o.length;c++)n[o[c]].end=0;return{map:n,table:e}}(n,r),i=c.find_path(o.map,"start","end"),a=[],u=1;u<i.length-1;u++)a.push(o.table[i[u]].node);return f.fromArray(function(t){return t.reduce(function(t,r){var e=0<=t.length-1?t[t.length-1]:null;return e&&e.mode===r.mode?t[t.length-1].data+=r.data:t.push(r),t},[])}(a))},f.rawSplit=function(t){return f.fromArray(d(t,h.isKanjiModeEnabled()))}},{"./alphanumeric-data":3,"./byte-data":6,"./kanji-data":12,"./mode":14,"./numeric-data":15,"./regex":19,"./utils":21,dijkstrajs:31}],21:[function(t,r,e){var n,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];e.getSymbolSize=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},e.getSymbolTotalCodewords=function(t){return o[t]},e.getBCHDigit=function(t){for(var r=0;0!==t;)r++,t>>>=1;return r},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},{}],22:[function(t,r,e){e.isValid=function(t){return!isNaN(t)&&1<=t&&t<=40}},{}],23:[function(t,r,o){var u=t("./utils"),f=t("./error-correction-code"),i=t("./error-correction-level"),s=t("./mode"),h=t("./version-check"),a=t("isarray"),e=u.getBCHDigit(7973);function c(t,r){return s.getCharCountIndicator(t,r)+4}function l(t,e){var n=0;return t.forEach(function(t){var r=c(t.mode,e);n+=r+t.getBitsLength()}),n}o.from=function(t,r){return h.isValid(t)?parseInt(t,10):r},o.getCapacity=function(t,r,e){if(!h.isValid(t))throw new Error("Invalid QR Code version");void 0===e&&(e=s.BYTE);var n=u.getSymbolTotalCodewords(t),o=f.getTotalCodewordsCount(t,r),i=8*(n-o);if(e===s.MIXED)return i;var a=i-c(e,t);switch(e){case s.NUMERIC:return Math.floor(a/10*3);case s.ALPHANUMERIC:return Math.floor(a/11*2);case s.KANJI:return Math.floor(a/13);case s.BYTE:default:return Math.floor(a/8)}},o.getBestVersionForData=function(t,r){var e,n=i.from(r,i.M);if(a(t)){if(1<t.length)return function(t,r){for(var e=1;e<=40;e++){if(l(t,e)<=o.getCapacity(e,r,s.MIXED))return e}return}(t,n);if(0===t.length)return 1;e=t[0]}else e=t;return function(t,r,e){for(var n=1;n<=40;n++)if(r<=o.getCapacity(n,e,t))return n;return}(e.mode,e.getLength(),n)},o.getEncodedBits=function(t){if(!h.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var r=t<<12;0<=u.getBCHDigit(r)-e;)r^=7973<<u.getBCHDigit(r)-e;return t<<12|r}},{"./error-correction-code":7,"./error-correction-level":8,"./mode":14,"./utils":21,"./version-check":22,isarray:33}],24:[function(t,r,e){var s=t("./can-promise"),h=t("./core/qrcode"),n=t("./renderer/canvas"),o=t("./renderer/svg-tag.js");function i(n,o,i,a,r){var t=[].slice.call(arguments,1),e=t.length,u="function"==typeof t[e-1];if(!u&&!s())throw new Error("Callback required as last argument");if(!u){if(e<1)throw new Error("Too few arguments provided");return 1===e?(i=o,o=a=void 0):2!==e||o.getContext||(a=i,i=o,o=void 0),new Promise(function(t,r){try{var e=h.create(i,a);t(n(e,o,a))}catch(t){r(t)}})}if(e<2)throw new Error("Too few arguments provided");2===e?(r=i,i=o,o=a=void 0):3===e&&(o.getContext&&void 0===r?(r=a,a=void 0):(r=a,a=i,i=o,o=void 0));try{var f=h.create(i,a);r(null,n(f,o,a))}catch(t){r(t)}}e.create=h.create,e.toCanvas=i.bind(null,n.render),e.toDataURL=i.bind(null,n.renderToDataURL),e.toString=i.bind(null,function(t,r,e){return o.render(t,e)})},{"./can-promise":1,"./core/qrcode":17,"./renderer/canvas":25,"./renderer/svg-tag.js":26}],25:[function(t,r,u){var f=t("./utils");u.render=function(t,r,e){var n=e,o=r;void 0!==n||r&&r.getContext||(n=r,r=void 0),r||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=f.getOptions(n);var i=f.getImageWidth(t.modules.size,n),a=o.getContext("2d"),u=a.createImageData(i,i);return f.qrToImageData(u.data,t,n),function(t,r,e){t.clearRect(0,0,r.width,r.height),r.style||(r.style={});r.height=e,r.width=e,r.style.height=e+"px",r.style.width=e+"px"}(a,o,i),a.putImageData(u,0,0),o},u.renderToDataURL=function(t,r,e){var n=e;void 0!==n||r&&r.getContext||(n=r,r=void 0),n=n||{};var o=u.render(t,r,n),i=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(i,a.quality)}},{"./utils":27}],26:[function(t,r,e){var l=t("./utils");function g(t,r){var e=t.a/255,n=r+'="'+t.hex+'"';return e<1?n+" "+r+'-opacity="'+e.toFixed(2).slice(1)+'"':n}function p(t,r,e){var n=t+r;return void 0!==e&&(n+=" "+e),n}e.render=function(t,r,e){var n=l.getOptions(r),o=t.modules.size,i=t.modules.data,a=o+2*n.margin,u=n.color.light.a?"<path "+g(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",f="<path "+g(n.color.dark,"stroke")+' d="'+function(t,r,e){for(var n="",o=0,i=!1,a=0,u=0;u<t.length;u++){var f=Math.floor(u%r),s=Math.floor(u/r);f||i||(i=!0),t[u]?(a++,0<u&&0<f&&t[u-1]||(n+=i?p("M",f+e,.5+s+e):p("m",o,0),o=0,i=!1),f+1<r&&t[u+1]||(n+=p("h",a),a=0)):o++}return n}(i,o,n.margin)+'"/>',s='viewBox="0 0 '+a+" "+a+'"',h=n.width?'width="'+n.width+'" height="'+n.width+'" ':"",c='<svg xmlns="http://www.w3.org/2000/svg" '+h+s+' shape-rendering="crispEdges">'+u+f+"</svg>\n";return"function"==typeof e&&e(null,c),c}},{"./utils":27}],27:[function(t,r,d){function o(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var r=t.slice().replace("#","").split("");if(r.length<3||5===r.length||8<r.length)throw new Error("Invalid hex color: "+t);3!==r.length&&4!==r.length||(r=Array.prototype.concat.apply([],r.map(function(t){return[t,t]}))),6===r.length&&r.push("F","F");var e=parseInt(r.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:255&e,hex:"#"+r.slice(0,6).join("")}}d.getOptions=function(t){(t=t||{}).color||(t.color={});var r=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,e=t.width&&21<=t.width?t.width:void 0,n=t.scale||4;return{width:e,scale:e?4:n,margin:r,color:{dark:o(t.color.dark||"#000000ff"),light:o(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},d.getScale=function(t,r){return r.width&&r.width>=t+2*r.margin?r.width/(t+2*r.margin):r.scale},d.getImageWidth=function(t,r){var e=d.getScale(t,r);return Math.floor((t+2*r.margin)*e)},d.qrToImageData=function(t,r,e){for(var n=r.modules.size,o=r.modules.data,i=d.getScale(n,e),a=Math.floor((n+2*e.margin)*i),u=e.margin*i,f=[e.color.light,e.color.dark],s=0;s<a;s++)for(var h=0;h<a;h++){var c=4*(s*a+h),l=e.color.light;if(u<=s&&u<=h&&s<a-u&&h<a-u){var g=Math.floor((s-u)/i),p=Math.floor((h-u)/i);l=f[o[g*n+p]?1:0]}t[c++]=l.r,t[c++]=l.g,t[c++]=l.b,t[c]=l.a}}},{}],28:[function(t,r,e){var a=t("isarray");var n=(u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())?2147483647:1073741823;function u(t,r,e){return u.TYPED_ARRAY_SUPPORT||this instanceof u?"number"==typeof t?s(this,t):function(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer)return function(t,r,e,n){if(e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");var o;o=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);u.TYPED_ARRAY_SUPPORT?o.__proto__=u.prototype:o=h(t,o);return o}(t,r,e,n);return("string"!=typeof r?function(t,r){if(u.isBuffer(r)){var e=0|i(r.length),n=f(t,e);return 0===n.length?n:(r.copy(n,0,0,e),n)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||function(t){return t!=t}(r.length)?f(t,0):h(t,r);if("Buffer"===r.type&&Array.isArray(r.data))return h(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}:function(t,r){var e=0|c(r),n=f(t,e),o=n.write(r);o!==e&&(n=n.slice(0,o));return n})(t,r)}(this,t,r,e):new u(t,r,e)}function i(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function f(t,r){var e;return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r)).__proto__=u.prototype:(null===(e=t)&&(e=new u(r)),e.length=r),e}function s(t,r){var e=f(t,r<0?0:0|i(r));if(!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}function h(t,r){for(var e=r.length<0?0:0|i(r.length),n=f(t,e),o=0;o<e;o+=1)n[o]=255&r[o];return n}function o(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(e=t.charCodeAt(a))&&e<57344){if(!o){if(56319<e){-1<(r-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(r-=3)&&i.push(239,191,189);continue}o=e;continue}if(e<56320){-1<(r-=3)&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&-1<(r-=3)&&i.push(239,191,189);if(o=null,e<128){if(--r<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function c(t){if(u.isBuffer(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 r=t.length;return 0===r?0:o(t).length}function l(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),u.prototype.write=function(t,r,e){void 0===r||void 0===e&&"string"==typeof r?(e=this.length,r=0):isFinite(r)&&(r|=0,isFinite(e)?e|=0:e=void 0);var n=this.length-r;if((void 0===e||n<e)&&(e=n),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,r,e,n){return l(o(r,t.length-e),t,e,n)}(this,t,r,e)},u.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):n<r&&(r=n),r<t&&(r=t),u.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=u.prototype;else{var o=r-t;e=new u(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},u.prototype.copy=function(t,r,e,n){if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),r=r||0,0<n&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;0<=o;--o)t[o+r]=this[o+e];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},u.prototype.fill=function(t,r,e){if("string"==typeof t){if("string"==typeof r?(r=0,e=this.length):"string"==typeof e&&(e=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(o=r;o<e;++o)this[o]=t;else{var i=u.isBuffer(t)?t:new u(t),a=i.length;for(o=0;o<e-r;++o)this[o+r]=i[o%a]}return this},u.concat=function(t,r){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f(null,0);var e;if(void 0===r)for(e=r=0;e<t.length;++e)r+=t[e].length;var n=s(null,r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=c,u.prototype._isBuffer=!0,u.isBuffer=function(t){return!(null==t||!t._isBuffer)},r.exports.alloc=function(t){var r=new u(t);return r.fill(0),r},r.exports.from=function(t){return new u(t)}},{isarray:33}],29:[function(t,r,e){e.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},e.toByteArray=function(t){var r,e,n=c(t),o=n[0],i=n[1],a=new h(function(t,r){return 3*(t+r)/4-r}(o,i)),u=0,f=0<i?o-4:o;for(e=0;e<f;e+=4)r=s[t.charCodeAt(e)]<<18|s[t.charCodeAt(e+1)]<<12|s[t.charCodeAt(e+2)]<<6|s[t.charCodeAt(e+3)],a[u++]=r>>16&255,a[u++]=r>>8&255,a[u++]=255&r;2===i&&(r=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,a[u++]=255&r);1===i&&(r=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r);return a},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,o=[],i=0,a=e-n;i<a;i+=16383)o.push(f(t,i,a<i+16383?a:i+16383));1==n?(r=t[e-1],o.push(u[r>>2]+u[r<<4&63]+"==")):2==n&&(r=(t[e-2]<<8)+t[e-1],o.push(u[r>>10]+u[r>>4&63]+u[r<<2&63]+"="));return o.join("")};for(var u=[],s=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=n.length;o<i;++o)u[o]=n[o],s[n.charCodeAt(o)]=o;function c(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");-1===e&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function f(t,r,e){for(var n,o,i=[],a=r;a<e;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(u[(o=n)>>18&63]+u[o>>12&63]+u[o>>6&63]+u[63&o]);return i.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],30:[function(t,r,e){var n=t("base64-js"),i=t("ieee754"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function u(t){if(a<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,c.prototype),r}function c(t,r,e){if("number"!=typeof t)return f(t,r,e);if("string"==typeof r)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}function f(t,r,e){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|p(t,r),n=u(e),o=n.write(t,r);o!==e&&(n=n.slice(0,o));return n}(t,r);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer))return function(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e);return Object.setPrototypeOf(n,c.prototype),n}(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,r,e);var o=function(t){if(c.isBuffer(t)){var r=0|g(t.length),e=u(r);return 0===e.length?e:(t.copy(e,0,0,r),e)}if(void 0!==t.length)return"number"!=typeof t.length||j(t.length)?u(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return s(t),u(t<0?0:0|g(t))}function l(t){for(var r=t.length<0?0:0|g(t.length),e=u(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function g(t){if(a<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function p(t,r){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===e)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return x(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return _(t).length;default:if(o)return n?-1:x(t).length;r=(""+r).toLowerCase(),o=!0}}function d(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function y(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),j(e=+e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=c.from(r,n)),c.isBuffer(r))return 0===r.length?-1:v(t,r,e,n,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):v(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,r,e,n,o){var i,a=1,u=t.length,f=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u/=a=2,f/=2,e/=2}function s(t,r){return 1===a?t[r]:t.readUInt16BE(r*a)}if(o){var h=-1;for(i=e;i<u;i++)if(s(t,i)===s(r,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===f)return h*a}else-1!==h&&(i-=i-h),h=-1}else for(u<e+f&&(e=u-f),i=e;0<=i;i--){for(var c=!0,l=0;l<f;l++)if(s(t,i+l)!==s(r,l)){c=!1;break}if(c)return i}return-1}function w(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),o<n&&(n=o)):n=o;var i=r.length;i/2<n&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(r.substr(2*a,2),16);if(j(u))return a;t[e+a]=u}return a}function m(t,r,e,n){return k(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function E(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,a,u,f,s=t[o],h=null,c=239<s?4:223<s?3:191<s?2:1;if(o+c<=e)switch(c){case 1:s<128&&(h=s);break;case 2:128==(192&(i=t[o+1]))&&127<(f=(31&s)<<6|63&i)&&(h=f);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&2047<(f=(15&s)<<12|(63&i)<<6|63&a)&&(f<55296||57343<f)&&(h=f);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&65535<(f=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&u)&&f<1114112&&(h=f)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var r=t.length;if(r<=A)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=A));return e}(n)}e.kMaxLength=a,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=function(t,r,e){return f(t,r,e)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,r,e){return function(t,r,e){if(s(t),t<=0)return u(t);return void 0===r?u(t):"string"==typeof e?u(t).fill(r,e):u(t).fill(r)}(t,r,e)},c.allocUnsafe=function(t){return h(t)},c.allocUnsafeSlow=function(t){return h(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,r){if(O(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),O(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},c.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}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var e;if(void 0===r)for(e=r=0;e<t.length;++e)r+=t[e].length;var n=c.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(O(i,Uint8Array)&&(i=c.from(i)),!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.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 r=0;r<t;r+=2)d(this,r,r+1);return this},c.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 r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},c.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 r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):function(t,r,e){var n=!1;(void 0===r||r<0)&&(r=0);if(r>this.length)return"";(void 0===e||e>this.length)&&(e=this.length);if(e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";t=t||"utf8";for(;;)switch(t){case"hex":return R(this,r,e);case"utf8":case"utf-8":return E(this,r,e);case"ascii":return B(this,r,e);case"latin1":case"binary":return T(this,r,e);case"base64":return b(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,r,e,n,o){if(O(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&e<=r)return 0;if(o<=n)return-1;if(e<=r)return 1;if(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=e-r,u=Math.min(i,a),f=this.slice(n,o),s=t.slice(r,e),h=0;h<u;++h)if(f[h]!==s[h]){i=f[h],a=s[h];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},c.prototype.indexOf=function(t,r,e){return y(this,t,r,e,!0)},c.prototype.lastIndexOf=function(t,r,e){return y(this,t,r,e,!1)},c.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||o<e)&&(e=o),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,a,u,f,s,h,c,l,g,p=!1;;)switch(n){case"hex":return w(this,t,r,e);case"utf8":case"utf-8":return l=r,g=e,k(x(t,(c=this).length-l),c,l,g);case"ascii":return m(this,t,r,e);case"latin1":case"binary":return m(this,t,r,e);case"base64":return f=this,s=r,h=e,k(_(t),f,s,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=r,u=e,k(L(t,(i=this).length-a),i,a,u);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function B(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function T(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function R(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||n<e)&&(e=n);for(var o="",i=r;i<e;++i)o+=D[t[i]];return o}function C(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function I(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function P(t,r,e,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<r||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function M(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function N(t,r,e,n,o){return r=+r,e>>>=0,o||M(t,r,e,4),i.write(t,r,e,n,23,4),e+4}function U(t,r,e,n,o){return r=+r,e>>>=0,o||M(t,r,e,8),i.write(t,r,e,n,52,8),e+8}c.prototype.slice=function(t,r){var e=this.length;(t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||I(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||I(t,r,this.length);for(var n=this[t+--r],o=1;0<r&&(o*=256);)n+=this[t+--r]*o;return n},c.prototype.readUInt8=function(t,r){return t>>>=0,r||I(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,r){return t>>>=0,r||I(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,r){return t>>>=0,r||I(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,r){return t>>>=0,r||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,r){return t>>>=0,r||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||I(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*r)),n},c.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||I(t,r,this.length);for(var n=r,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*r)),i},c.prototype.readInt8=function(t,r){return t>>>=0,r||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,r){t>>>=0,r||I(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(t,r){t>>>=0,r||I(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(t,r){return t>>>=0,r||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t>>>=0,r||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,r){return t>>>=0,r||I(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t>>>=0,r||I(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t>>>=0,r||I(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t>>>=0,r||I(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;P(this,t,r,e,o,0)}var i=1,a=0;for(this[r]=255&t;++a<e&&(i*=256);)this[r+a]=t/i&255;return r+e},c.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;P(this,t,r,e,o,0)}var i=e-1,a=1;for(this[r+i]=255&t;0<=--i&&(a*=256);)this[r+i]=t/a&255;return r+e},c.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,1,255,0),this[r]=255&t,r+1},c.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},c.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);P(this,t,r,e,o-1,-o)}var i=0,a=1,u=0;for(this[r]=255&t;++i<e&&(a*=256);)t<0&&0===u&&0!==this[r+i-1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+e},c.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);P(this,t,r,e,o-1,-o)}var i=e-1,a=1,u=0;for(this[r+i]=255&t;0<=--i&&(a*=256);)t<0&&0===u&&0!==this[r+i+1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+e},c.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},c.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||P(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeFloatLE=function(t,r,e){return N(this,t,r,!0,e)},c.prototype.writeFloatBE=function(t,r,e){return N(this,t,r,!1,e)},c.prototype.writeDoubleLE=function(t,r,e){return U(this,t,r,!0,e)},c.prototype.writeDoubleBE=function(t,r,e){return U(this,t,r,!1,e)},c.prototype.copy=function(t,r,e,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),r=r||0,0<n&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o=n-e;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,e,n);else if(this===t&&e<r&&r<n)for(var i=o-1;0<=i;--i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,n),r);return o},c.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(i=r;i<e;++i)this[i]=t;else{var a=c.isBuffer(t)?t:c.from(t,n),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<e-r;++i)this[i+r]=a[i%u]}return this};var S=/[^+/0-9A-Za-z-_]/g;function x(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(e=t.charCodeAt(a))&&e<57344){if(!o){if(56319<e){-1<(r-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(r-=3)&&i.push(239,191,189);continue}o=e;continue}if(e<56320){-1<(r-=3)&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&-1<(r-=3)&&i.push(239,191,189);if(o=null,e<128){if(--r<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function L(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function _(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function k(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function O(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}function j(t){return t!=t}var D=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=16*e,o=0;o<16;++o)r[n+o]=t[e]+t[o];return r}()},{"base64-js":29,ieee754:32}],31:[function(t,r,e){var d={single_source_shortest_paths:function(t,r,e){var n={},o={};o[r]=0;var i,a,u,f,s,h,c,l,g=d.PriorityQueue.make();for(g.push(r,0);!g.empty();)for(u in i=g.pop(),a=i.value,f=i.cost,s=t[a]||{})s.hasOwnProperty(u)&&(h=s[u],c=f+h,l=o[u],(void 0===o[u]||c<l)&&(o[u]=c,g.push(u,c),n[u]=a));if(void 0===e||void 0!==o[e])return n;var p=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(p)},extract_shortest_path_from_predecessor_list:function(t,r){for(var e=[],n=r;n;)e.push(n),t[n],n=t[n];return e.reverse(),e},find_path:function(t,r,e){var n=d.single_source_shortest_paths(t,r,e);return d.extract_shortest_path_from_predecessor_list(n,e)},PriorityQueue:{make:function(t){var r,e=d.PriorityQueue,n={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n.queue=[],n.sorter=t.sorter||e.default_sorter,n},default_sorter:function(t,r){return t.cost-r.cost},push:function(t,r){var e={value:t,cost:r};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==r&&(r.exports=d)},{}],32:[function(t,r,e){e.read=function(t,r,e,n,o){var i,a,u=8*o-n-1,f=(1<<u)-1,s=f>>1,h=-7,c=e?o-1:0,l=e?-1:1,g=t[r+c];for(c+=l,i=g&(1<<-h)-1,g>>=-h,h+=u;0<h;i=256*i+t[r+c],c+=l,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;0<h;a=256*a+t[r+c],c+=l,h-=8);if(0===i)i=1-s;else{if(i===f)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,n),i-=s}return(g?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,r,e,n,o,i){var a,u,f,s=8*i-o-1,h=(1<<s)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,p=n?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),2<=(r+=1<=a+c?l/f:l*Math.pow(2,1-c))*f&&(a++,f/=2),h<=a+c?(u=0,a=h):1<=a+c?(u=(r*f-1)*Math.pow(2,o),a+=c):(u=r*Math.pow(2,c-1)*Math.pow(2,o),a=0));8<=o;t[e+g]=255&u,g+=p,u/=256,o-=8);for(a=a<<o|u,s+=o;0<s;t[e+g]=255&a,g+=p,a/=256,s-=8);t[e+g-p]|=128*d}},{}],33:[function(t,r,e){var n={}.toString;r.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}]},{},[24])(24)}(t={exports:{}},t.exports),t.exports);return{name:"qrcode",props:{value:null,options:Object,tag:{type:String,default:"canvas"}},render:function(t){return t(this.tag,this.$slots.default)},watch:{$props:{deep:!0,immediate:!0,handler:function(){this.$el&&this.generate()}}},methods:{generate:function(){var e=this,t=this.options,r=this.tag,n=String(this.value);"canvas"===r?o.toCanvas(this.$el,n,t,function(t){if(t)throw t}):"img"===r?o.toDataURL(n,t,function(t,r){if(t)throw t;e.$el.src=r}):o.toString(n,t,function(t,r){if(t)throw t;e.$el.innerHTML=r})}},mounted:function(){this.generate()}}}); |