UNPKG

wjshipbill

Version:

Siyool QR Bill generation in Node.js and browsers

2 lines 7.49 MB
/*! For license information please see browser.js.LICENSE.txt */ !function(r,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var t in n)("object"==typeof exports?exports:r)[t]=n[t]}}(self,(function(){return(()=>{var r={3515:(r,e,n)=>{const t=n(9854),a=n(1923),i=n(5079),o=n(2983);function c(r,e,n,i,o){const c=[].slice.call(arguments,1),s=c.length,u="function"==typeof c[s-1];if(!u&&!t())throw new Error("Callback required as last argument");if(!u){if(s<1)throw new Error("Too few arguments provided");return 1===s?(n=e,e=i=void 0):2!==s||e.getContext||(i=n,n=e,e=void 0),new Promise((function(t,o){try{const o=a.create(n,i);t(r(o,e,i))}catch(r){o(r)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(o=n,n=e,e=i=void 0):3===s&&(e.getContext&&void 0===o?(o=i,i=void 0):(o=i,i=n,n=e,e=void 0));try{const t=a.create(n,i);return r(t,e,i,o)}catch(r){o(r)}}e.create=a.create,e.toCanvas=c.bind(null,i.render),e.toDataURL=c.bind(null,i.renderToDataURL),e.toString=c.bind(null,(function(r,e,n,t){return o.render(r,n,t)}))},9854:r=>{r.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},6783:(r,e,n)=>{const t=n(7920).getSymbolSize;e.getRowColCoords=function(r){if(1===r)return[];const e=Math.floor(r/7)+2,n=t(r),a=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7];for(let r=1;r<e-1;r++)i[r]=i[r-1]-a;return i.push(6),i.reverse()},e.getPositions=function(r){const n=[],t=e.getRowColCoords(r),a=t.length;for(let r=0;r<a;r++)for(let e=0;e<a;e++)0===r&&0===e||0===r&&e===a-1||r===a-1&&0===e||n.push([t[r],t[e]]);return n}},3441:(r,e,n)=>{const t=n(7032),a=["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(r){this.mode=t.ALPHANUMERIC,this.data=r}i.getBitsLength=function(r){return 11*Math.floor(r/2)+r%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let e;for(e=0;e+2<=this.data.length;e+=2){let n=45*a.indexOf(this.data[e]);n+=a.indexOf(this.data[e+1]),r.put(n,11)}this.data.length%2&&r.put(a.indexOf(this.data[e]),6)},r.exports=i},9323:r=>{function e(){this.buffer=[],this.length=0}e.prototype={get:function(r){const e=Math.floor(r/8);return 1==(this.buffer[e]>>>7-r%8&1)},put:function(r,e){for(let n=0;n<e;n++)this.putBit(1==(r>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}},r.exports=e},9390:r=>{function e(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}e.prototype.set=function(r,e,n,t){const a=r*this.size+e;this.data[a]=n,t&&(this.reservedBit[a]=!0)},e.prototype.get=function(r,e){return this.data[r*this.size+e]},e.prototype.xor=function(r,e,n){this.data[r*this.size+e]^=n},e.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]},r.exports=e},99:(r,e,n)=>{const t=n(2378),a=n(7032);function i(r){this.mode=a.BYTE,this.data=new Uint8Array(t(r))}i.getBitsLength=function(r){return 8*r},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){for(let e=0,n=this.data.length;e<n;e++)r.put(this.data[e],8)},r.exports=i},3246:(r,e,n)=>{const t=n(9412),a=[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(r,e){switch(e){case t.L:return a[4*(r-1)+0];case t.M:return a[4*(r-1)+1];case t.Q:return a[4*(r-1)+2];case t.H:return a[4*(r-1)+3];default:return}},e.getTotalCodewordsCount=function(r,e){switch(e){case t.L:return i[4*(r-1)+0];case t.M:return i[4*(r-1)+1];case t.Q:return i[4*(r-1)+2];case t.H:return i[4*(r-1)+3];default:return}}},9412:(r,e)=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(r){return r&&void 0!==r.bit&&r.bit>=0&&r.bit<4},e.from=function(r,n){if(e.isValid(r))return r;try{return function(r){if("string"!=typeof r)throw new Error("Param is not a string");switch(r.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: "+r)}}(r)}catch(r){return n}}},9907:(r,e,n)=>{const t=n(7920).getSymbolSize;e.getPositions=function(r){const e=t(r);return[[0,0],[e-7,0],[0,e-7]]}},4876:(r,e,n)=>{const t=n(7920),a=t.getBCHDigit(1335);e.getEncodedBits=function(r,e){const n=r.bit<<3|e;let i=n<<10;for(;t.getBCHDigit(i)-a>=0;)i^=1335<<t.getBCHDigit(i)-a;return 21522^(n<<10|i)}},8361:(r,e)=>{const n=new Uint8Array(512),t=new Uint8Array(256);!function(){let r=1;for(let e=0;e<255;e++)n[e]=r,t[r]=e,r<<=1,256&r&&(r^=285);for(let r=255;r<512;r++)n[r]=n[r-255]}(),e.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},e.exp=function(r){return n[r]},e.mul=function(r,e){return 0===r||0===e?0:n[t[r]+t[e]]}},7615:(r,e,n)=>{const t=n(7032),a=n(7920);function i(r){this.mode=t.KANJI,this.data=r}i.getBitsLength=function(r){return 13*r},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let n=a.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),r.put(n,13)}},r.exports=i},298:(r,e)=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(r,n,t){switch(r){case e.Patterns.PATTERN000:return(n+t)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return t%3==0;case e.Patterns.PATTERN011:return(n+t)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(t/3))%2==0;case e.Patterns.PATTERN101:return n*t%2+n*t%3==0;case e.Patterns.PATTERN110:return(n*t%2+n*t%3)%2==0;case e.Patterns.PATTERN111:return(n*t%3+(n+t)%2)%2==0;default:throw new Error("bad maskPattern:"+r)}}e.isValid=function(r){return null!=r&&""!==r&&!isNaN(r)&&r>=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const e=r.size;let n=0,t=0,a=0,i=null,o=null;for(let c=0;c<e;c++){t=a=0,i=o=null;for(let s=0;s<e;s++){let e=r.get(c,s);e===i?t++:(t>=5&&(n+=t-5+3),i=e,t=1),e=r.get(s,c),e===o?a++:(a>=5&&(n+=a-5+3),o=e,a=1)}t>=5&&(n+=t-5+3),a>=5&&(n+=a-5+3)}return n},e.getPenaltyN2=function(r){const e=r.size;let n=0;for(let t=0;t<e-1;t++)for(let a=0;a<e-1;a++){const e=r.get(t,a)+r.get(t,a+1)+r.get(t+1,a)+r.get(t+1,a+1);4!==e&&0!==e||n++}return 3*n},e.getPenaltyN3=function(r){const e=r.size;let n=0,t=0,a=0;for(let i=0;i<e;i++){t=a=0;for(let o=0;o<e;o++)t=t<<1&2047|r.get(i,o),o>=10&&(1488===t||93===t)&&n++,a=a<<1&2047|r.get(o,i),o>=10&&(1488===a||93===a)&&n++}return 40*n},e.getPenaltyN4=function(r){let e=0;const n=r.data.length;for(let t=0;t<n;t++)e+=r.data[t];return 10*Math.abs(Math.ceil(100*e/n/5)-10)},e.applyMask=function(r,e){const t=e.size;for(let a=0;a<t;a++)for(let i=0;i<t;i++)e.isReserved(i,a)||e.xor(i,a,n(r,i,a))},e.getBestMask=function(r,n){const t=Object.keys(e.Patterns).length;let a=0,i=1/0;for(let o=0;o<t;o++){n(o),e.applyMask(o,r);const t=e.getPenaltyN1(r)+e.getPenaltyN2(r)+e.getPenaltyN3(r)+e.getPenaltyN4(r);e.applyMask(o,r),t<i&&(i=t,a=o)}return a}},7032:(r,e,n)=>{const t=n(7778),a=n(5876);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(r,e){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?r.ccBits[0]:e<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return a.testNumeric(r)?e.NUMERIC:a.testAlphanumeric(r)?e.ALPHANUMERIC:a.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits},e.from=function(r,n){if(e.isValid(r))return r;try{return function(r){if("string"!=typeof r)throw new Error("Param is not a string");switch(r.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: "+r)}}(r)}catch(r){return n}}},4213:(r,e,n)=>{const t=n(7032);function a(r){this.mode=t.NUMERIC,this.data=r.toString()}a.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(r){let e,n,t;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),t=parseInt(n,10),r.put(t,10);const a=this.data.length-e;a>0&&(n=this.data.substr(e),t=parseInt(n,10),r.put(t,3*a+1))},r.exports=a},5361:(r,e,n)=>{const t=n(8361);e.mul=function(r,e){const n=new Uint8Array(r.length+e.length-1);for(let a=0;a<r.length;a++)for(let i=0;i<e.length;i++)n[a+i]^=t.mul(r[a],e[i]);return n},e.mod=function(r,e){let n=new Uint8Array(r);for(;n.length-e.length>=0;){const r=n[0];for(let a=0;a<e.length;a++)n[a]^=t.mul(e[a],r);let a=0;for(;a<n.length&&0===n[a];)a++;n=n.slice(a)}return n},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let a=0;a<r;a++)n=e.mul(n,new Uint8Array([1,t.exp(a)]));return n}},1923:(r,e,n)=>{const t=n(7920),a=n(9412),i=n(9323),o=n(9390),c=n(6783),s=n(9907),u=n(298),X=n(3246),l=n(5459),P=n(9564),K=n(4876),m=n(7032),d=n(1264);function h(r,e,n){const t=r.size,a=K.getEncodedBits(e,n);let i,o;for(i=0;i<15;i++)o=1==(a>>i&1),i<6?r.set(i,8,o,!0):i<8?r.set(i+1,8,o,!0):r.set(t-15+i,8,o,!0),i<8?r.set(8,t-i-1,o,!0):i<9?r.set(8,15-i-1+1,o,!0):r.set(8,15-i-1,o,!0);r.set(t-8,8,1,!0)}function f(r,e,n,a){let K;if(Array.isArray(r))K=d.fromArray(r);else{if("string"!=typeof r)throw new Error("Invalid data");{let t=e;if(!t){const e=d.rawSplit(r);t=P.getBestVersionForData(e,n)}K=d.fromString(r,t||40)}}const f=P.getBestVersionForData(K,n);if(!f)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<f)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+f+".\n")}else e=f;const g=function(r,e,n){const a=new i;n.forEach((function(e){a.put(e.mode.bit,4),a.put(e.getLength(),m.getCharCountIndicator(e.mode,r)),e.write(a)}));const o=8*(t.getSymbolTotalCodewords(r)-X.getTotalCodewordsCount(r,e));for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);const c=(o-a.getLengthInBits())/8;for(let r=0;r<c;r++)a.put(r%2?17:236,8);return function(r,e,n){const a=t.getSymbolTotalCodewords(e),i=a-X.getTotalCodewordsCount(e,n),o=X.getBlocksCount(e,n),c=o-a%o,s=Math.floor(a/o),u=Math.floor(i/o),P=u+1,K=s-u,m=new l(K);let d=0;const h=new Array(o),f=new Array(o);let g=0;const p=new Uint8Array(r.buffer);for(let r=0;r<o;r++){const e=r<c?u:P;h[r]=p.slice(d,d+e),f[r]=m.encode(h[r]),d+=e,g=Math.max(g,e)}const v=new Uint8Array(a);let A,y,b=0;for(A=0;A<g;A++)for(y=0;y<o;y++)A<h[y].length&&(v[b++]=h[y][A]);for(A=0;A<K;A++)for(y=0;y<o;y++)v[b++]=f[y][A];return v}(a,r,e)}(e,n,K),p=t.getSymbolSize(e),v=new o(p);return function(r,e){const n=r.size,t=s.getPositions(e);for(let e=0;e<t.length;e++){const a=t[e][0],i=t[e][1];for(let e=-1;e<=7;e++)if(!(a+e<=-1||n<=a+e))for(let t=-1;t<=7;t++)i+t<=-1||n<=i+t||(e>=0&&e<=6&&(0===t||6===t)||t>=0&&t<=6&&(0===e||6===e)||e>=2&&e<=4&&t>=2&&t<=4?r.set(a+e,i+t,!0,!0):r.set(a+e,i+t,!1,!0))}}(v,e),function(r){const e=r.size;for(let n=8;n<e-8;n++){const e=n%2==0;r.set(n,6,e,!0),r.set(6,n,e,!0)}}(v),function(r,e){const n=c.getPositions(e);for(let e=0;e<n.length;e++){const t=n[e][0],a=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?r.set(t+e,a+n,!0,!0):r.set(t+e,a+n,!1,!0)}}(v,e),h(v,n,0),e>=7&&function(r,e){const n=r.size,t=P.getEncodedBits(e);let a,i,o;for(let e=0;e<18;e++)a=Math.floor(e/3),i=e%3+n-8-3,o=1==(t>>e&1),r.set(a,i,o,!0),r.set(i,a,o,!0)}(v,e),function(r,e){const n=r.size;let t=-1,a=n-1,i=7,o=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!r.isReserved(a,c-n)){let t=!1;o<e.length&&(t=1==(e[o]>>>i&1)),r.set(a,c-n,t),i--,-1===i&&(o++,i=7)}if(a+=t,a<0||n<=a){a-=t,t=-t;break}}}(v,g),isNaN(a)&&(a=u.getBestMask(v,h.bind(null,v,n))),u.applyMask(a,v),h(v,n,a),{modules:v,version:e,errorCorrectionLevel:n,maskPattern:a,segments:K}}e.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let n,i,o=a.M;return void 0!==e&&(o=a.from(e.errorCorrectionLevel,a.M),n=P.from(e.version),i=u.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),f(r,n,o,i)}},5459:(r,e,n)=>{const t=n(5361);function a(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}a.prototype.initialize=function(r){this.degree=r,this.genPoly=t.generateECPolynomial(this.degree)},a.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(r.length+this.degree);e.set(r);const n=t.mod(e,this.genPoly),a=this.degree-n.length;if(a>0){const r=new Uint8Array(this.degree);return r.set(n,a),r}return n},r.exports=a},5876:(r,e)=>{let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const t="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(t,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const a=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(r){return a.test(r)},e.testNumeric=function(r){return i.test(r)},e.testAlphanumeric=function(r){return o.test(r)}},1264:(r,e,n)=>{const t=n(7032),a=n(4213),i=n(3441),o=n(99),c=n(7615),s=n(5876),u=n(7920),X=n(5987);function l(r){return unescape(encodeURIComponent(r)).length}function P(r,e,n){const t=[];let a;for(;null!==(a=r.exec(n));)t.push({data:a[0],index:a.index,mode:e,length:a[0].length});return t}function K(r){const e=P(s.NUMERIC,t.NUMERIC,r),n=P(s.ALPHANUMERIC,t.ALPHANUMERIC,r);let a,i;return u.isKanjiModeEnabled()?(a=P(s.BYTE,t.BYTE,r),i=P(s.KANJI,t.KANJI,r)):(a=P(s.BYTE_KANJI,t.BYTE,r),i=[]),e.concat(n,a,i).sort((function(r,e){return r.index-e.index})).map((function(r){return{data:r.data,mode:r.mode,length:r.length}}))}function m(r,e){switch(e){case t.NUMERIC:return a.getBitsLength(r);case t.ALPHANUMERIC:return i.getBitsLength(r);case t.KANJI:return c.getBitsLength(r);case t.BYTE:return o.getBitsLength(r)}}function d(r,e){let n;const s=t.getBestModeForData(r);if(n=t.from(e,s),n!==t.BYTE&&n.bit<s.bit)throw new Error('"'+r+'" cannot be encoded with mode '+t.toString(n)+".\n Suggested mode is: "+t.toString(s));switch(n!==t.KANJI||u.isKanjiModeEnabled()||(n=t.BYTE),n){case t.NUMERIC:return new a(r);case t.ALPHANUMERIC:return new i(r);case t.KANJI:return new c(r);case t.BYTE:return new o(r)}}e.fromArray=function(r){return r.reduce((function(r,e){return"string"==typeof e?r.push(d(e,null)):e.data&&r.push(d(e.data,e.mode)),r}),[])},e.fromString=function(r,n){const a=function(r,e){const n={},a={start:{}};let i=["start"];for(let o=0;o<r.length;o++){const c=r[o],s=[];for(let r=0;r<c.length;r++){const u=c[r],X=""+o+r;s.push(X),n[X]={node:u,lastCount:0},a[X]={};for(let r=0;r<i.length;r++){const o=i[r];n[o]&&n[o].node.mode===u.mode?(a[o][X]=m(n[o].lastCount+u.length,u.mode)-m(n[o].lastCount,u.mode),n[o].lastCount+=u.length):(n[o]&&(n[o].lastCount=u.length),a[o][X]=m(u.length,u.mode)+4+t.getCharCountIndicator(u.mode,e))}}i=s}for(let r=0;r<i.length;r++)a[i[r]].end=0;return{map:a,table:n}}(function(r){const e=[];for(let n=0;n<r.length;n++){const a=r[n];switch(a.mode){case t.NUMERIC:e.push([a,{data:a.data,mode:t.ALPHANUMERIC,length:a.length},{data:a.data,mode:t.BYTE,length:a.length}]);break;case t.ALPHANUMERIC:e.push([a,{data:a.data,mode:t.BYTE,length:a.length}]);break;case t.KANJI:e.push([a,{data:a.data,mode:t.BYTE,length:l(a.data)}]);break;case t.BYTE:e.push([{data:a.data,mode:t.BYTE,length:l(a.data)}])}}return e}(K(r,u.isKanjiModeEnabled())),n),i=X.find_path(a.map,"start","end"),o=[];for(let r=1;r<i.length-1;r++)o.push(a.table[i[r]].node);return e.fromArray(o.reduce((function(r,e){const n=r.length-1>=0?r[r.length-1]:null;return n&&n.mode===e.mode?(r[r.length-1].data+=e.data,r):(r.push(e),r)}),[]))},e.rawSplit=function(r){return e.fromArray(K(r,u.isKanjiModeEnabled()))}},7920:(r,e)=>{let n;const t=[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(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return 4*r+17},e.getSymbolTotalCodewords=function(r){return t[r]},e.getBCHDigit=function(r){let e=0;for(;0!==r;)e++,r>>>=1;return e},e.setToSJISFunction=function(r){if("function"!=typeof r)throw new Error('"toSJISFunc" is not a valid function.');n=r},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(r){return n(r)}},7778:(r,e)=>{e.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}},9564:(r,e,n)=>{const t=n(7920),a=n(3246),i=n(9412),o=n(7032),c=n(7778),s=t.getBCHDigit(7973);function u(r,e){return o.getCharCountIndicator(r,e)+4}function X(r,e){let n=0;return r.forEach((function(r){const t=u(r.mode,e);n+=t+r.getBitsLength()})),n}e.from=function(r,e){return c.isValid(r)?parseInt(r,10):e},e.getCapacity=function(r,e,n){if(!c.isValid(r))throw new Error("Invalid QR Code version");void 0===n&&(n=o.BYTE);const i=8*(t.getSymbolTotalCodewords(r)-a.getTotalCodewordsCount(r,e));if(n===o.MIXED)return i;const s=i-u(n,r);switch(n){case o.NUMERIC:return Math.floor(s/10*3);case o.ALPHANUMERIC:return Math.floor(s/11*2);case o.KANJI:return Math.floor(s/13);case o.BYTE:default:return Math.floor(s/8)}},e.getBestVersionForData=function(r,n){let t;const a=i.from(n,i.M);if(Array.isArray(r)){if(r.length>1)return function(r,n){for(let t=1;t<=40;t++)if(X(r,t)<=e.getCapacity(t,n,o.MIXED))return t}(r,a);if(0===r.length)return 1;t=r[0]}else t=r;return function(r,n,t){for(let a=1;a<=40;a++)if(n<=e.getCapacity(a,t,r))return a}(t.mode,t.getLength(),a)},e.getEncodedBits=function(r){if(!c.isValid(r)||r<7)throw new Error("Invalid QR Code version");let e=r<<12;for(;t.getBCHDigit(e)-s>=0;)e^=7973<<t.getBCHDigit(e)-s;return r<<12|e}},5079:(r,e,n)=>{const t=n(9006);e.render=function(r,e,n){let a=n,i=e;void 0!==a||e&&e.getContext||(a=e,e=void 0),e||(i=function(){try{return document.createElement("canvas")}catch(r){throw new Error("You need to specify a canvas element")}}()),a=t.getOptions(a);const o=t.getImageWidth(r.modules.size,a),c=i.getContext("2d"),s=c.createImageData(o,o);return t.qrToImageData(s.data,r,a),function(r,e,n){r.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(c,i,o),c.putImageData(s,0,0),i},e.renderToDataURL=function(r,n,t){let a=t;void 0!==a||n&&n.getContext||(a=n,n=void 0),a||(a={});const i=e.render(r,n,a),o=a.type||"image/png",c=a.rendererOpts||{};return i.toDataURL(o,c.quality)}},2983:(r,e,n)=>{const t=n(9006);function a(r,e){const n=r.a/255,t=e+'="'+r.hex+'"';return n<1?t+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':t}function i(r,e,n,t){return`M ${r.toFixed(2)}, ${e.toFixed(2)} V ${(e+t).toFixed(2)} H ${(r+n).toFixed(2)} V ${e.toFixed(2)} H ${r.toFixed(2)} Z `}e.render=function(r,e,n){const o=t.getOptions(e),c=r.modules.size,s=r.modules.data,u=c+2*o.margin,X=o.color.light.a?"<path "+a(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",l="<path "+a(o.color.dark,"fill")+' d="'+function(r,e,n,t){let a="";for(let o=0;o<r.length;o++){const c=Math.floor(o%e),s=Math.floor(o/e),u=(t-2*n)/e;r[o]&&(a+=i(c*u,s*u,u,u))}return a}(s,c,o.margin,o.width)+'"/>',P='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'"':"")+' shape-rendering="crispEdges">'+X+l+"</svg>\n";return"function"==typeof n&&n(null,P),P}},9006:(r,e)=>{function n(r){if("number"==typeof r&&(r=r.toString()),"string"!=typeof r)throw new Error("Color should be defined as hex string");let e=r.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+r);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(r){return[r,r]})))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const e=void 0===r.margin||null===r.margin||r.margin<0?4:r.margin,t=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:t,scale:t?4:a,margin:e,color:{dark:n(r.color.dark||"#000000ff"),light:n(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,e){return e.width&&e.width>=r+2*e.margin?e.width/(r+2*e.margin):e.scale},e.getImageWidth=function(r,n){const t=e.getScale(r,n);return Math.floor((r+2*n.margin)*t)},e.qrToImageData=function(r,n,t){const a=n.modules.size,i=n.modules.data,o=e.getScale(a,t),c=Math.floor((a+2*t.margin)*o),s=t.margin*o,u=[t.color.light,t.color.dark];for(let e=0;e<c;e++)for(let n=0;n<c;n++){let X=4*(e*c+n),l=t.color.light;e>=s&&n>=s&&e<c-s&&n<c-s&&(l=u[i[Math.floor((e-s)/o)*a+Math.floor((n-s)/o)]?1:0]),r[X++]=l.r,r[X++]=l.g,r[X++]=l.b,r[X]=l.a}}},2190:r=>{r.exports=function(r,n,t){if(r.filter)return r.filter(n,t);if(null==r)throw new TypeError;if("function"!=typeof n)throw new TypeError;for(var a=[],i=0;i<r.length;i++)if(e.call(r,i)){var o=r[i];n.call(t,o,i,r)&&a.push(o)}return a};var e=Object.prototype.hasOwnProperty},9742:(r,e)=>{"use strict";e.byteLength=function(r){var e=s(r),n=e[0],t=e[1];return 3*(n+t)/4-t},e.toByteArray=function(r){var e,n,i=s(r),o=i[0],c=i[1],u=new a(function(r,e,n){return 3*(e+n)/4-n}(0,o,c)),X=0,l=c>0?o-4:o;for(n=0;n<l;n+=4)e=t[r.charCodeAt(n)]<<18|t[r.charCodeAt(n+1)]<<12|t[r.charCodeAt(n+2)]<<6|t[r.charCodeAt(n+3)],u[X++]=e>>16&255,u[X++]=e>>8&255,u[X++]=255&e;return 2===c&&(e=t[r.charCodeAt(n)]<<2|t[r.charCodeAt(n+1)]>>4,u[X++]=255&e),1===c&&(e=t[r.charCodeAt(n)]<<10|t[r.charCodeAt(n+1)]<<4|t[r.charCodeAt(n+2)]>>2,u[X++]=e>>8&255,u[X++]=255&e),u},e.fromByteArray=function(r){for(var e,t=r.length,a=t%3,i=[],o=16383,c=0,s=t-a;c<s;c+=o)i.push(u(r,c,c+o>s?s:c+o));return 1===a?(e=r[t-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(r[t-2]<<8)+r[t-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],t=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=i.length;o<c;++o)n[o]=i[o],t[i.charCodeAt(o)]=o;function s(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=r.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(r,e,t){for(var a,i,o=[],c=e;c<t;c+=3)a=(r[c]<<16&16711680)+(r[c+1]<<8&65280)+(255&r[c+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63},7152:(r,e,n)=>{var t=n(2830).Writable,a=n(9539),i=n(5548),o=n.g.URL||n.g.webkitURL||n.g.mozURL;function c(){if(!(this instanceof c))return new c;t.call(this),this._chunks=[],this._blob=null,this.length=0}a.inherits(c,t),c.prototype._write=function(r,e,n){r instanceof Uint8Array||(r=new Uint8Array(r)),this.length+=r.length,this._chunks.push(r),n()},c.prototype.toBlob=function(r){return r=r||"application/octet-stream",this._blob||(this._blob=new i(this._chunks,{type:r}),this._chunks=[]),this._blob.type!==r&&(this._blob=new i([this._blob],{type:r})),this._blob},c.prototype.toBlobURL=function(r){return o.createObjectURL(this.toBlob(r))},r.exports=c},5548:(r,e,n)=>{var t=n.g.BlobBuilder||n.g.WebKitBlobBuilder||n.g.MSBlobBuilder||n.g.MozBlobBuilder,a=function(){try{return 2===new Blob(["hi"]).size}catch(r){return!1}}(),i=a&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(r){return!1}}(),o=t&&t.prototype.append&&t.prototype.getBlob;function c(r){for(var e=0;e<r.length;e++){var n=r[e];if(n.buffer instanceof ArrayBuffer){var t=n.buffer;if(n.byteLength!==t.byteLength){var a=new Uint8Array(n.byteLength);a.set(new Uint8Array(t,n.byteOffset,n.byteLength)),t=a.buffer}r[e]=t}}}r.exports=a?i?n.g.Blob:function(r,e){return c(r),new Blob(r,e||{})}:o?function(r,e){e=e||{};var n=new t;c(r);for(var a=0;a<r.length;a++)n.append(r[a]);return e.type?n.getBlob(e.type):n.getBlob()}:void 0},8764:(r,e,n)=>{"use strict";const t=n(9742),a=n(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(r){return+r!=r&&(r=0),s.alloc(+r)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function c(r){if(r>o)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,s.prototype),e}function s(r,e,n){if("number"==typeof r){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(r)}return u(r,e,n)}function u(r,e,n){if("string"==typeof r)return function(r,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|d(r,e);let t=c(n);const a=t.write(r,e);return a!==n&&(t=t.slice(0,a)),t}(r,e);if(ArrayBuffer.isView(r))return function(r){if(H(r,Uint8Array)){const e=new Uint8Array(r);return K(e.buffer,e.byteOffset,e.byteLength)}return P(r)}(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(H(r,ArrayBuffer)||r&&H(r.buffer,ArrayBuffer))return K(r,e,n);if("undefined"!=typeof SharedArrayBuffer&&(H(r,SharedArrayBuffer)||r&&H(r.buffer,SharedArrayBuffer)))return K(r,e,n);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');const t=r.valueOf&&r.valueOf();if(null!=t&&t!==r)return s.from(t,e,n);const a=function(r){if(s.isBuffer(r)){const e=0|m(r.length),n=c(e);return 0===n.length||r.copy(n,0,0,e),n}return void 0!==r.length?"number"!=typeof r.length||J(r.length)?c(0):P(r):"Buffer"===r.type&&Array.isArray(r.data)?P(r.data):void 0}(r);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return s.from(r[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}function X(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function l(r){return X(r),c(r<0?0:0|m(r))}function P(r){const e=r.length<0?0:0|m(r.length),n=c(e);for(let t=0;t<e;t+=1)n[t]=255&r[t];return n}function K(r,e,n){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let t;return t=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),Object.setPrototypeOf(t,s.prototype),t}function m(r){if(r>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|r}function d(r,e){if(s.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||H(r,ArrayBuffer))return r.byteLength;if("string"!=typeof r)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const n=r.length,t=arguments.length>2&&!0===arguments[2];if(!t&&0===n)return 0;let a=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return j(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(r).length;default:if(a)return t?-1:j(r).length;e=(""+e).toLowerCase(),a=!0}}function h(r,e,n){let t=!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(r||(r="utf8");;)switch(r){case"hex":return O(this,e,n);case"utf8":case"utf-8":return W(this,e,n);case"ascii":return w(this,e,n);case"latin1":case"binary":return x(this,e,n);case"base64":return B(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(t)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),t=!0}}function f(r,e,n){const t=r[e];r[e]=r[n],r[n]=t}function g(r,e,n,t,a){if(0===r.length)return-1;if("string"==typeof n?(t=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=a?0:r.length-1),n<0&&(n=r.length+n),n>=r.length){if(a)return-1;n=r.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=s.from(e,t)),s.isBuffer(e))return 0===e.length?-1:p(r,e,n,t,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(r,e,n):Uint8Array.prototype.lastIndexOf.call(r,e,n):p(r,[e],n,t,a);throw new TypeError("val must be string, number or Buffer")}function p(r,e,n,t,a){let i,o=1,c=r.length,s=e.length;if(void 0!==t&&("ucs2"===(t=String(t).toLowerCase())||"ucs-2"===t||"utf16le"===t||"utf-16le"===t)){if(r.length<2||e.length<2)return-1;o=2,c/=2,s/=2,n/=2}function u(r,e){return 1===o?r[e]:r.readUInt16BE(e*o)}if(a){let t=-1;for(i=n;i<c;i++)if(u(r,i)===u(e,-1===t?0:i-t)){if(-1===t&&(t=i),i-t+1===s)return t*o}else-1!==t&&(i-=i-t),t=-1}else for(n+s>c&&(n=c-s),i=n;i>=0;i--){let n=!0;for(let t=0;t<s;t++)if(u(r,i+t)!==u(e,t)){n=!1;break}if(n)return i}return-1}function v(r,e,n,t){n=Number(n)||0;const a=r.length-n;t?(t=Number(t))>a&&(t=a):t=a;const i=e.length;let o;for(t>i/2&&(t=i/2),o=0;o<t;++o){const t=parseInt(e.substr(2*o,2),16);if(J(t))return o;r[n+o]=t}return o}function A(r,e,n,t){return G(j(e,r.length-n),r,n,t)}function y(r,e,n,t){return G(function(r){const e=[];for(let n=0;n<r.length;++n)e.push(255&r.charCodeAt(n));return e}(e),r,n,t)}function b(r,e,n,t){return G(q(e),r,n,t)}function C(r,e,n,t){return G(function(r,e){let n,t,a;const i=[];for(let o=0;o<r.length&&!((e-=2)<0);++o)n=r.charCodeAt(o),t=n>>8,a=n%256,i.push(a),i.push(t);return i}(e,r.length-n),r,n,t)}function B(r,e,n){return 0===e&&n===r.length?t.fromByteArray(r):t.fromByteArray(r.slice(e,n))}function W(r,e,n){n=Math.min(r.length,n);const t=[];let a=e;for(;a<n;){const e=r[a];let i=null,o=e>239?4:e>223?3:e>191?2:1;if(a+o<=n){let n,t,c,s;switch(o){case 1:e<128&&(i=e);break;case 2:n=r[a+1],128==(192&n)&&(s=(31&e)<<6|63&n,s>127&&(i=s));break;case 3:n=r[a+1],t=r[a+2],128==(192&n)&&128==(192&t)&&(s=(15&e)<<12|(63&n)<<6|63&t,s>2047&&(s<55296||s>57343)&&(i=s));break;case 4:n=r[a+1],t=r[a+2],c=r[a+3],128==(192&n)&&128==(192&t)&&128==(192&c)&&(s=(15&e)<<18|(63&n)<<12|(63&t)<<6|63&c,s>65535&&s<1114112&&(i=s))}}null===i?(i=65533,o=1):i>65535&&(i-=65536,t.push(i>>>10&1023|55296),i=56320|1023&i),t.push(i),a+=o}return function(r){const e=r.length;if(e<=N)return String.fromCharCode.apply(String,r);let n="",t=0;for(;t<e;)n+=String.fromCharCode.apply(String,r.slice(t,t+=N));return n}(t)}e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=function(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),42===r.foo()}catch(r){return!1}}(),s.TYPED_ARRAY_SUPPORT||"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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(r,e,n){return u(r,e,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(r,e,n){return function(r,e,n){return X(r),r<=0?c(r):void 0!==e?"string"==typeof n?c(r).fill(e,n):c(r).fill(e):c(r)}(r,e,n)},s.allocUnsafe=function(r){return l(r)},s.allocUnsafeSlow=function(r){return l(r)},s.isBuffer=function(r){return null!=r&&!0===r._isBuffer&&r!==s.prototype},s.compare=function(r,e){if(H(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),H(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(r)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;let n=r.length,t=e.length;for(let a=0,i=Math.min(n,t);a<i;++a)if(r[a]!==e[a]){n=r[a],t=e[a];break}return n<t?-1:t<n?1:0},s.isEncoding=function(r){switch(String(r).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}},s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(0===r.length)return s.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<r.length;++n)e+=r[n].length;const t=s.allocUnsafe(e);let a=0;for(n=0;n<r.length;++n){let e=r[n];if(H(e,Uint8Array))a+e.length>t.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(t,a)):Uint8Array.prototype.set.call(t,e,a);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(t,a)}a+=e.length}return t},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<r;e+=2)f(this,e,e+1);return this},s.prototype.swap32=function(){const r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<r;e+=4)f(this,e,e+3),f(this,e+1,e+2);return this},s.prototype.swap64=function(){const r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<r;e+=8)f(this,e,e+7),f(this,e+1,e+6),f(this,e+2,e+5),f(this,e+3,e+4);return this},s.prototype.toString=function(){const r=this.length;return 0===r?"":0===arguments.length?W(this,0,r):h.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||0===s.compare(this,r)},s.prototype.inspect=function(){let r="";const n=e.INSPECT_MAX_BYTES;return r=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(r+=" ... "),"<Buffer "+r+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(r,e,n,t,a){if(H(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(void 0===e&&(e=0),void 0===n&&(n=r?r.length:0),void 0===t&&(t=0),void 0===a&&(a=this.length),e<0||n>r.length||t<0||a>this.length)throw new RangeError("out of range index");if(t>=a&&e>=n)return 0;if(t>=a)return-1;if(e>=n)return 1;if(this===r)return 0;let i=(a>>>=0)-(t>>>=0),o=(n>>>=0)-(e>>>=0);const c=Math.min(i,o),u=this.slice(t,a),X=r.slice(e,n);for(let r=0;r<c;++r)if(u[r]!==X[r]){i=u[r],o=X[r];break}return i<o?-1:o<i?1:0},s.prototype.includes=function(r,e,n){return-1!==this.indexOf(r,e,n)},s.prototype.indexOf=function(r,e,n){return g(this,r,e,n,!0)},s.prototype.lastIndexOf=function(r,e,n){return g(this,r,e,n,!1)},s.prototype.write=function(r,e,n,t){if(void 0===e)t="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)t=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===t&&(t="utf8")):(t=n,n=void 0)}const a=this.length-e;if((void 0===n||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");let i=!1;for(;;)switch(t){case"hex":return v(this,r,e,n);case"utf8":case"utf-8":return A(this,r,e,n);case"ascii":case"latin1":case"binary":return y(this,r,e,n);case"base64":return b(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function w(r,e,n){let t="";n=Math.min(r.length,n);for(let a=e;a<n;++a)t+=String.fromCharCode(127&r[a]);return t}function x(r,e,n){let t="";n=Math.min(r.length,n);for(let a=e;a<n;++a)t+=String.fromCharCode(r[a]);return t}function O(r,e,n){const t=r.length;(!e||e<0)&&(e=0),(!n||n<0||n>t)&&(n=t);let a="";for(let t=e;t<n;++t)a+=Z[r[t]];return a}function k(r,e,n){const t=r.slice(e,n);let a="";for(let r=0;r<t.length-1;r+=2)a+=String.fromCharCode(t[r]+256*t[r+1]);return a}function T(r,e,n){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+e>n)throw new RangeError("Trying to access beyond buffer length")}function _(r,e,n,t,a,i){if(!s.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(n+t>r.length)throw new RangeError("Index out of range")}function U(r,e,n,t,a){F(e,t,a,r,n,7);let i=Number(e&BigInt(4294967295));r[n++]=i,i>>=8,r[n++]=i,i>>=8,r[n++]=i,i>>=8,r[n++]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[n++]=o,o>>=8,r[n++]=o,o>>=8,r[n++]=o,o>>=8,r[n++]=o,n}function S(r,e,n,t,a){F(e,t,a,r,n,7);let i=Number(e&BigInt(4294967295));r[n+7]=i,i>>=8,r[n+6]=i,i>>=8,r[n+5]=i,i>>=8,r[n+4]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[n+3]=o,o>>=8,r[n+2]=o,o>>=8,r[n+1]=o,o>>=8,r[n]=o,n+8}function Y(r,e,n,t,a,i){if(n+t>r.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(r,e,n,t,i){return e=+e,n>>>=0,i||Y(r,0,n,4),a.write(r,e,n,t,23,4),n+4}function E(r,e,n,t,i){return e=+e,n>>>=0,i||Y(r,0,n,8),a.write(r,e,n,t,52,8),n+8}s.prototype.slice=function(r,e){const n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<r&&(e=r);const t=this.subarray(r,e);return Object.setPrototypeOf(t,s.prototype),t},s.prototype.readUintLE=s.prototype.readUIntLE=function(r,e,n){r>>>=0,e>>>=0,n||T(r,e,this.length);let t=this[r],a=1,i=0;for(;++i<e&&(a*=256);)t+=this[r+i]*a;return t},s.prototype.readUintBE=s.prototype.readUIntBE=function(r,e,n){r>>>=0,e>>>=0,n||T(r,e,this.length);let t=this[r+--e],a=1;for(;e>0&&(a*=256);)t+=this[r+--e]*a;return t},s.prototype.readUint8=s.prototype.readUInt8=function(r,e){return r>>>=0,e||T(r,1,this.length),this[r]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,e){return r>>>=0,e||T(r,2,this.length),this[r]|this[r+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,e){return r>>>=0,e||T(r,2,this.length),this[r]<<8|this[r+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,e){return r>>>=0,e||T(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,e){return r>>>=0,e||T(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},s.prototype.readBigUInt64LE=Q((function(r){V(r>>>=0,"offset");const e=this[r],n=this[r+7];void 0!==e&&void 0!==n||M(r,this.length-8);const t=e+256*this[++r]+65536*this[++r]+this[++r]*2**24,a=this[++r]+256*this[++r]+65536*this[++r]+n*2**24;return BigInt(t)+(BigInt(a)<<BigInt(32))})),s.prototype.readBigUInt64BE=Q((function(r){V(r>>>=0,"offset");const e=this[r],n=this[r+7];void 0!==e&&void 0!==n||M(r,this.length-8);const t=e*2**24+65536*this[++r]+256*this[++r]+this[++r],a=this[++r]*2**24+65536*this[++r]+256*this[++r]+n;return(BigInt(t)<<BigInt(32))+BigInt(a)})),s.prototype.readIntLE=function(r,e,n){r>>>=0,e>>>=0,n||T(r,e,this.length);let t=this[r],a=1,i=0;for(;++i<e&&(a*=256);)t+=this[r+i]*a;return a*=128,t>=a&&(t-=Math.pow(2,8*e)),t},s.prototype.readIntBE=function(r,e,n){r>>>=0,e>>>=0,n||T(r,e,this.length);let t=e,a=1,i=this[r+--t];for(;t>0&&(a*=256);)i+=this[r+--t]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(r,e){return r>>>=0,e||T(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},s.prototype.readInt16LE=function(r,e){r>>>=0,e||T(r,2,this.length);const n=this[r]|this[r+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(r,e){r>>>=0,e||T(r,2,this.length);const n=this[r+1]|this[r]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(r,e){return r>>>=0,e||T(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},s.prototype.readInt32BE=function(r,e){return r>>>=0,e||T(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},s.prototype.readBigInt64LE=Q((function(r){V(r>>>=0,"offset");const e=this[r],n=this[r+7];void 0!==e&&void 0!==n||M(r,this.length-8);const t=this[r+4]+256*this[r+5]+65536*this[r+6]+(n<<24);return(BigInt(t)<<BigInt(32))+BigInt(e+256*this[++r]+65536*this[++r]+this[++r]*2**24)})),s.prototype.readBigInt64BE=Q((function(r){V(r>>>=0,"offset");const e=this[r],n=this[r+7];void 0!==e&&void 0!==n||M(r,this.length-8);const t=(e<<24)+65536*this[++r]+256*this[++r]+this[++r];return(BigInt(t)<<BigInt(32))+BigInt(this[++r]*2**24+65536*this[++r]+256*this[++r]+n)})),s.prototype.readFloatLE=function(r,e){return r>>>=0,e||T(r,4,this.length),a.read(this,r,!0,23,4)},s.prototype.readFloatBE=function(r,e){return r>>>=0,e||T(r,4,this.length),a.read(this,r,!1,23,4)},s.prototype.readDoubleLE=function(r,e){return r>>>=0,e||T(r,8,this.length),a.read(this,r,!0,52,8)},s.prototype.readDoubleBE=function(r,e){return r>>>=0,e||T(r,8,this.length),a.read(this,r,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,e,n,t){r=+r,e>>>=0,n>>>=0,t||_(this,r,e,n,Math.pow(2,8*n)-1,0);let a=1,i=0;for(this[e]=255&r;++i<n&&(a*=256);)this[e+i]=r/a&255;return e+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,e,n,t){r=+r,e>>>=0,n>>>=0,t||_(this,r,e,n,Math.pow(2,8*n)-1,0);let a=n-1,i=1;for(this[e+a]=255&r;--a>=0&&(i*=256);)this[e+a]=r/i&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,1,255,0),this[e]=255&r,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,2,65535,0),this[e]=255&r,this[e+1]=r>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=255&r,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=255&r,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},s.prototype.writeBigUInt64LE=Q((function(r,e=0){return U(this,r,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=Q((function(r,e=0){return S(this,r,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(r,e,n,t){if(r=+r,e>>>=0,!t){const t=Math.pow(2,8*n-1);_(this,r,e,n,t-1,-t)}let a=0,i=1,o=0;for(this[e]=255&r;++a<n&&(i*=256);)r<0&&0===o&&0!==this[e+a-1]&&(o=1),this[e+a]=(r/i>>0)-o&255;return e+n},s.prototype.writeIntBE=function(r,e,n,t){if(r=+r,e>>>=0,!t){const t=Math.pow(2,8*n-1);_(this,r,e,n,t-1,-t)}let a=n-1,i=1,o=0;for(this[e+a]=255&r;--a>=0&&(i*=256);)r<0&&0===o&&0!==this[e+a+1]&&(o=1),this[e+a]=(r/i>>0)-o&255;return e+n},s.prototype.writeInt8=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=255&r,e+1},s.prototype.writeInt16LE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,2,32767,-32768),this[e]=255&r,this[e+1]=r>>>8,e+2},s.prototype.writeInt16BE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=255&r,e+2},s.prototype.writeInt32LE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,4,2147483647,-2147483648),this[e]=255&r,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4},s.prototype.writeInt32BE=function(r,e,n){return r=+r,e>>>=0,n||_(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},s.prototype.writeBigInt64LE=Q((function(r,e=0){return U(this,r,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=Q((function(r,e=0){return S(this,r,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(r,e,n){return R(this,r,e,!0,n)},s.prototype.writeFloatBE=function(r,e,n){return R(this,r,e,!1,n)},s.prototype.writeDoubleLE=function(r,e,n){return E(this,r,e,!0,n)},s.prototype.writeDoubleBE=function(r,e,n){return E(this,r,e,!1,n)},s.prototype.copy=function(r,e,n,t){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),t||0===t||(t=this.length),e>=r.length&&(e=r.length),e||(e=0),t>0&&t<n&&(t=n),t===n)return 0;if(0===r.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("Index out of range");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-e<t-n&&(t=r.length-e+n);const a=t-n;return this===r&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,t):Uint8Array.prototype.set.call(r,this.subarray(n,t),e),a},s.prototype.fill=function(r,e,n,t){if("string"==typeof r){if("string"==typeof e?(t=e,e=0,n=this.length):"string"==typeof n&&(t=n,n=this.length),void 0!==t&&"string"!=typeof t)throw new TypeError("encoding must be a string");if("string"==typeof t&&!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);if(1===r.length){const e=r.charCodeAt(0);("utf8"===t&&e<128||"latin1"===t)&&(r=e)}}else"number"==typeof r?r&=255:"boolean"==typeof r&&(r=Number(r));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let a;if(e>>>=0,n=void 0===n?this.length:n>>>0,r||(r=0),"number"==typeof r)for(a=e;a<n;++a)this[a]=r;else{const i=s.isBuffer(r)?r:s.from(r,t),o=i.length;if(0===o)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(a=0;a<n-e;++a)this[a+e]=i[a%o]}return this};const L={};function I(r,e,n){L[r]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}function D(r){let e="",n=r.length;const t="-"===r[0]?1:0;for(;n>=t+4;n-=3)e=`_${r.slice(n-3,n)}${e}`;return`${r.slice(0,n)}${e}`}function F(r,e,n,t,a,i){if(r>n||r<e){const t="bigint"==typeof e?"n":"";let a;throw a=i>3?0===e||e===BigInt(0)?`>= 0${t} and < 2${t} ** ${8*(i+1)}${t}`:`>= -(2${t} ** ${8*(i+1)-1}${t}) and < 2 ** ${8*(i+1)-1}${t}`:`>= ${e}${t} and <= ${n}${t}`,new L.ERR_OUT_OF_RANGE("value",a,r)}!function(r,e,n){V(e,"offset"),void 0!==r[e]&&void 0!==r[e+n]||M(e,r.length-(n+1))}(t,a,i)}function V(r,e){if("number"!=typeof r)throw new L.ERR_INVALID_ARG_TYPE(e,"number",r)}function M(r,e,n){if(Math.floor(r)!==r)throw V(r,n),new L.ERR_OUT_OF_RANGE(n||"offset","an integer",r);if(e<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,r)}I("ERR_BUFFER_OUT_OF_BOUNDS",(function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),I("ERR_INVALID_ARG_TYPE",(function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`}),TypeError),I("ERR_OUT_OF_RANGE",(function(r,e,n){let t=`The value of "${r}" is out of range.`,a=n;return Number.isInteger(n)&&Math.abs(n)>2**32?a=D(String(n)):"bigint"==typeof n&&(a=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(a=D(a)),a+="n"),t+=` It must be ${e}. Received ${a}`,t}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function j(r,e){let n;e=e||1/0;const t=r.length;let