docx-templates
Version:
Template-based docx report creation
6 lines • 195 kB
JavaScript
var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array!="undefined"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$2=0,len=code.length;i$2<len;++i$2)lookup[i$2]=code[i$2],revLookup[code.charCodeAt(i$2)]=i$2;revLookup[45]=62,revLookup[95]=63;function getLens(t){var l=t.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=l);var E=r===l?0:4-r%4;return[r,E]}function byteLength(t){var l=getLens(t),r=l[0],E=l[1];return(r+E)*3/4-E}function _byteLength(t,l,r){return(l+r)*3/4-r}function toByteArray(t){var l,r=getLens(t),E=r[0],T=r[1],A=new Arr(_byteLength(t,E,T)),N=0,y=T>0?E-4:E,ue;for(ue=0;ue<y;ue+=4)l=revLookup[t.charCodeAt(ue)]<<18|revLookup[t.charCodeAt(ue+1)]<<12|revLookup[t.charCodeAt(ue+2)]<<6|revLookup[t.charCodeAt(ue+3)],A[N++]=l>>16&255,A[N++]=l>>8&255,A[N++]=l&255;return T===2&&(l=revLookup[t.charCodeAt(ue)]<<2|revLookup[t.charCodeAt(ue+1)]>>4,A[N++]=l&255),T===1&&(l=revLookup[t.charCodeAt(ue)]<<10|revLookup[t.charCodeAt(ue+1)]<<4|revLookup[t.charCodeAt(ue+2)]>>2,A[N++]=l>>8&255,A[N++]=l&255),A}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,l,r){for(var E,T=[],A=l;A<r;A+=3)E=(t[A]<<16&16711680)+(t[A+1]<<8&65280)+(t[A+2]&255),T.push(tripletToBase64(E));return T.join("")}function fromByteArray(t){for(var l,r=t.length,E=r%3,T=[],A=16383,N=0,y=r-E;N<y;N+=A)T.push(encodeChunk(t,N,N+A>y?y:N+A));return E===1?(l=t[r-1],T.push(lookup[l>>2]+lookup[l<<4&63]+"==")):E===2&&(l=(t[r-2]<<8)+t[r-1],T.push(lookup[l>>10]+lookup[l>>4&63]+lookup[l<<2&63]+"=")),T.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(t,l,r,E,T){var A,N,y=T*8-E-1,ue=(1<<y)-1,Z=ue>>1,M=-7,Se=r?T-1:0,ge=r?-1:1,_e=t[l+Se];for(Se+=ge,A=_e&(1<<-M)-1,_e>>=-M,M+=y;M>0;A=A*256+t[l+Se],Se+=ge,M-=8);for(N=A&(1<<-M)-1,A>>=-M,M+=E;M>0;N=N*256+t[l+Se],Se+=ge,M-=8);if(A===0)A=1-Z;else{if(A===ue)return N?NaN:(_e?-1:1)*(1/0);N=N+Math.pow(2,E),A=A-Z}return(_e?-1:1)*N*Math.pow(2,A-E)},ieee754.write=function(t,l,r,E,T,A){var N,y,ue,Z=A*8-T-1,M=(1<<Z)-1,Se=M>>1,ge=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,_e=E?0:A-1,we=E?1:-1,be=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(y=isNaN(l)?1:0,N=M):(N=Math.floor(Math.log(l)/Math.LN2),l*(ue=Math.pow(2,-N))<1&&(N--,ue*=2),N+Se>=1?l+=ge/ue:l+=ge*Math.pow(2,1-Se),l*ue>=2&&(N++,ue/=2),N+Se>=M?(y=0,N=M):N+Se>=1?(y=(l*ue-1)*Math.pow(2,T),N=N+Se):(y=l*Math.pow(2,Se-1)*Math.pow(2,T),N=0));T>=8;t[r+_e]=y&255,_e+=we,y/=256,T-=8);for(N=N<<T|y,Z+=T;Z>0;t[r+_e]=N&255,_e+=we,N/=256,Z-=8);t[r+_e-we]|=be*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(t){const l=base64Js,r=ieee754,E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=y,t.SlowBuffer=$e,t.INSPECT_MAX_BYTES=50;const T=2147483647;t.kMaxLength=T,y.TYPED_ARRAY_SUPPORT=A(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&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.");function A(){try{const O=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(O,v),O.foo()===42}catch(O){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function N(O){if(O>T)throw new RangeError('The value "'+O+'" is invalid for option "size"');const v=new Uint8Array(O);return Object.setPrototypeOf(v,y.prototype),v}function y(O,v,I){if(typeof O=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Se(O)}return ue(O,v,I)}y.poolSize=8192;function ue(O,v,I){if(typeof O=="string")return ge(O,v);if(ArrayBuffer.isView(O))return we(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(rt(O,ArrayBuffer)||O&&rt(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(rt(O,SharedArrayBuffer)||O&&rt(O.buffer,SharedArrayBuffer)))return be(O,v,I);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const he=O.valueOf&&O.valueOf();if(he!=null&&he!==O)return y.from(he,v,I);const ve=Te(O);if(ve)return ve;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return y.from(O[Symbol.toPrimitive]("string"),v,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}y.from=function(O,v,I){return ue(O,v,I)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function Z(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function M(O,v,I){return Z(O),O<=0?N(O):v!==void 0?typeof I=="string"?N(O).fill(v,I):N(O).fill(v):N(O)}y.alloc=function(O,v,I){return M(O,v,I)};function Se(O){return Z(O),N(O<0?0:Ie(O)|0)}y.allocUnsafe=function(O){return Se(O)},y.allocUnsafeSlow=function(O){return Se(O)};function ge(O,v){if((typeof v!="string"||v==="")&&(v="utf8"),!y.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const I=De(O,v)|0;let he=N(I);const ve=he.write(O,v);return ve!==I&&(he=he.slice(0,ve)),he}function _e(O){const v=O.length<0?0:Ie(O.length)|0,I=N(v);for(let he=0;he<v;he+=1)I[he]=O[he]&255;return I}function we(O){if(rt(O,Uint8Array)){const v=new Uint8Array(O);return be(v.buffer,v.byteOffset,v.byteLength)}return _e(O)}function be(O,v,I){if(v<0||O.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<v+(I||0))throw new RangeError('"length" is outside of buffer bounds');let he;return v===void 0&&I===void 0?he=new Uint8Array(O):I===void 0?he=new Uint8Array(O,v):he=new Uint8Array(O,v,I),Object.setPrototypeOf(he,y.prototype),he}function Te(O){if(y.isBuffer(O)){const v=Ie(O.length)|0,I=N(v);return I.length===0||O.copy(I,0,0,v),I}if(O.length!==void 0)return typeof O.length!="number"||gt(O.length)?N(0):_e(O);if(O.type==="Buffer"&&Array.isArray(O.data))return _e(O.data)}function Ie(O){if(O>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return O|0}function $e(O){return+O!=O&&(O=0),y.alloc(+O)}y.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==y.prototype},y.compare=function(v,I){if(rt(v,Uint8Array)&&(v=y.from(v,v.offset,v.byteLength)),rt(I,Uint8Array)&&(I=y.from(I,I.offset,I.byteLength)),!y.isBuffer(v)||!y.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===I)return 0;let he=v.length,ve=I.length;for(let xe=0,Ae=Math.min(he,ve);xe<Ae;++xe)if(v[xe]!==I[xe]){he=v[xe],ve=I[xe];break}return he<ve?-1:ve<he?1:0},y.isEncoding=function(v){switch(String(v).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}},y.concat=function(v,I){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return y.alloc(0);let he;if(I===void 0)for(I=0,he=0;he<v.length;++he)I+=v[he].length;const ve=y.allocUnsafe(I);let xe=0;for(he=0;he<v.length;++he){let Ae=v[he];if(rt(Ae,Uint8Array))xe+Ae.length>ve.length?(y.isBuffer(Ae)||(Ae=y.from(Ae)),Ae.copy(ve,xe)):Uint8Array.prototype.set.call(ve,Ae,xe);else if(y.isBuffer(Ae))Ae.copy(ve,xe);else throw new TypeError('"list" argument must be an Array of Buffers');xe+=Ae.length}return ve};function De(O,v){if(y.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||rt(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);const I=O.length,he=arguments.length>2&&arguments[2]===!0;if(!he&&I===0)return 0;let ve=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Ke(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return _t(O).length;default:if(ve)return he?-1:Ke(O).length;v=(""+v).toLowerCase(),ve=!0}}y.byteLength=De;function Ce(O,v,I){let he=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,v>>>=0,I<=v))return"";for(O||(O="utf8");;)switch(O){case"hex":return ft(this,v,I);case"utf8":case"utf-8":return Qe(this,v,I);case"ascii":return Me(this,v,I);case"latin1":case"binary":return nt(this,v,I);case"base64":return Ve(this,v,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,v,I);default:if(he)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),he=!0}}y.prototype._isBuffer=!0;function ke(O,v,I){const he=O[v];O[v]=O[I],O[I]=he}y.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<v;I+=2)ke(this,I,I+1);return this},y.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<v;I+=4)ke(this,I,I+3),ke(this,I+1,I+2);return this},y.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<v;I+=8)ke(this,I,I+7),ke(this,I+1,I+6),ke(this,I+2,I+5),ke(this,I+3,I+4);return this},y.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?Qe(this,0,v):Ce.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(v){if(!y.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:y.compare(this,v)===0},y.prototype.inspect=function(){let v="";const I=t.INSPECT_MAX_BYTES;return v=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(v+=" ... "),"<Buffer "+v+">"},E&&(y.prototype[E]=y.prototype.inspect),y.prototype.compare=function(v,I,he,ve,xe){if(rt(v,Uint8Array)&&(v=y.from(v,v.offset,v.byteLength)),!y.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(I===void 0&&(I=0),he===void 0&&(he=v?v.length:0),ve===void 0&&(ve=0),xe===void 0&&(xe=this.length),I<0||he>v.length||ve<0||xe>this.length)throw new RangeError("out of range index");if(ve>=xe&&I>=he)return 0;if(ve>=xe)return-1;if(I>=he)return 1;if(I>>>=0,he>>>=0,ve>>>=0,xe>>>=0,this===v)return 0;let Ae=xe-ve,Ue=he-I;const Ye=Math.min(Ae,Ue),We=this.slice(ve,xe),Xe=v.slice(I,he);for(let ze=0;ze<Ye;++ze)if(We[ze]!==Xe[ze]){Ae=We[ze],Ue=Xe[ze];break}return Ae<Ue?-1:Ue<Ae?1:0};function Fe(O,v,I,he,ve){if(O.length===0)return-1;if(typeof I=="string"?(he=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,gt(I)&&(I=ve?0:O.length-1),I<0&&(I=O.length+I),I>=O.length){if(ve)return-1;I=O.length-1}else if(I<0)if(ve)I=0;else return-1;if(typeof v=="string"&&(v=y.from(v,he)),y.isBuffer(v))return v.length===0?-1:Oe(O,v,I,he,ve);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?ve?Uint8Array.prototype.indexOf.call(O,v,I):Uint8Array.prototype.lastIndexOf.call(O,v,I):Oe(O,[v],I,he,ve);throw new TypeError("val must be string, number or Buffer")}function Oe(O,v,I,he,ve){let xe=1,Ae=O.length,Ue=v.length;if(he!==void 0&&(he=String(he).toLowerCase(),he==="ucs2"||he==="ucs-2"||he==="utf16le"||he==="utf-16le")){if(O.length<2||v.length<2)return-1;xe=2,Ae/=2,Ue/=2,I/=2}function Ye(Xe,ze){return xe===1?Xe[ze]:Xe.readUInt16BE(ze*xe)}let We;if(ve){let Xe=-1;for(We=I;We<Ae;We++)if(Ye(O,We)===Ye(v,Xe===-1?0:We-Xe)){if(Xe===-1&&(Xe=We),We-Xe+1===Ue)return Xe*xe}else Xe!==-1&&(We-=We-Xe),Xe=-1}else for(I+Ue>Ae&&(I=Ae-Ue),We=I;We>=0;We--){let Xe=!0;for(let ze=0;ze<Ue;ze++)if(Ye(O,We+ze)!==Ye(v,ze)){Xe=!1;break}if(Xe)return We}return-1}y.prototype.includes=function(v,I,he){return this.indexOf(v,I,he)!==-1},y.prototype.indexOf=function(v,I,he){return Fe(this,v,I,he,!0)},y.prototype.lastIndexOf=function(v,I,he){return Fe(this,v,I,he,!1)};function Be(O,v,I,he){I=Number(I)||0;const ve=O.length-I;he?(he=Number(he),he>ve&&(he=ve)):he=ve;const xe=v.length;he>xe/2&&(he=xe/2);let Ae;for(Ae=0;Ae<he;++Ae){const Ue=parseInt(v.substr(Ae*2,2),16);if(gt(Ue))return Ae;O[I+Ae]=Ue}return Ae}function Ee(O,v,I,he){return st(Ke(v,O.length-I),O,I,he)}function Pe(O,v,I,he){return st(it(v),O,I,he)}function Re(O,v,I,he){return st(_t(v),O,I,he)}function Le(O,v,I,he){return st(mt(v,O.length-I),O,I,he)}y.prototype.write=function(v,I,he,ve){if(I===void 0)ve="utf8",he=this.length,I=0;else if(he===void 0&&typeof I=="string")ve=I,he=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(he)?(he=he>>>0,ve===void 0&&(ve="utf8")):(ve=he,he=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const xe=this.length-I;if((he===void 0||he>xe)&&(he=xe),v.length>0&&(he<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");ve||(ve="utf8");let Ae=!1;for(;;)switch(ve){case"hex":return Be(this,v,I,he);case"utf8":case"utf-8":return Ee(this,v,I,he);case"ascii":case"latin1":case"binary":return Pe(this,v,I,he);case"base64":return Re(this,v,I,he);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,v,I,he);default:if(Ae)throw new TypeError("Unknown encoding: "+ve);ve=(""+ve).toLowerCase(),Ae=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ve(O,v,I){return v===0&&I===O.length?l.fromByteArray(O):l.fromByteArray(O.slice(v,I))}function Qe(O,v,I){I=Math.min(O.length,I);const he=[];let ve=v;for(;ve<I;){const xe=O[ve];let Ae=null,Ue=xe>239?4:xe>223?3:xe>191?2:1;if(ve+Ue<=I){let Ye,We,Xe,ze;switch(Ue){case 1:xe<128&&(Ae=xe);break;case 2:Ye=O[ve+1],(Ye&192)===128&&(ze=(xe&31)<<6|Ye&63,ze>127&&(Ae=ze));break;case 3:Ye=O[ve+1],We=O[ve+2],(Ye&192)===128&&(We&192)===128&&(ze=(xe&15)<<12|(Ye&63)<<6|We&63,ze>2047&&(ze<55296||ze>57343)&&(Ae=ze));break;case 4:Ye=O[ve+1],We=O[ve+2],Xe=O[ve+3],(Ye&192)===128&&(We&192)===128&&(Xe&192)===128&&(ze=(xe&15)<<18|(Ye&63)<<12|(We&63)<<6|Xe&63,ze>65535&&ze<1114112&&(Ae=ze))}}Ae===null?(Ae=65533,Ue=1):Ae>65535&&(Ae-=65536,he.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),he.push(Ae),ve+=Ue}return at(he)}const tt=4096;function at(O){const v=O.length;if(v<=tt)return String.fromCharCode.apply(String,O);let I="",he=0;for(;he<v;)I+=String.fromCharCode.apply(String,O.slice(he,he+=tt));return I}function Me(O,v,I){let he="";I=Math.min(O.length,I);for(let ve=v;ve<I;++ve)he+=String.fromCharCode(O[ve]&127);return he}function nt(O,v,I){let he="";I=Math.min(O.length,I);for(let ve=v;ve<I;++ve)he+=String.fromCharCode(O[ve]);return he}function ft(O,v,I){const he=O.length;(!v||v<0)&&(v=0),(!I||I<0||I>he)&&(I=he);let ve="";for(let xe=v;xe<I;++xe)ve+=Et[O[xe]];return ve}function ut(O,v,I){const he=O.slice(v,I);let ve="";for(let xe=0;xe<he.length-1;xe+=2)ve+=String.fromCharCode(he[xe]+he[xe+1]*256);return ve}y.prototype.slice=function(v,I){const he=this.length;v=~~v,I=I===void 0?he:~~I,v<0?(v+=he,v<0&&(v=0)):v>he&&(v=he),I<0?(I+=he,I<0&&(I=0)):I>he&&(I=he),I<v&&(I=v);const ve=this.subarray(v,I);return Object.setPrototypeOf(ve,y.prototype),ve};function He(O,v,I){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+v>I)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(v,I,he){v=v>>>0,I=I>>>0,he||He(v,I,this.length);let ve=this[v],xe=1,Ae=0;for(;++Ae<I&&(xe*=256);)ve+=this[v+Ae]*xe;return ve},y.prototype.readUintBE=y.prototype.readUIntBE=function(v,I,he){v=v>>>0,I=I>>>0,he||He(v,I,this.length);let ve=this[v+--I],xe=1;for(;I>0&&(xe*=256);)ve+=this[v+--I]*xe;return ve},y.prototype.readUint8=y.prototype.readUInt8=function(v,I){return v=v>>>0,I||He(v,1,this.length),this[v]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(v,I){return v=v>>>0,I||He(v,2,this.length),this[v]|this[v+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(v,I){return v=v>>>0,I||He(v,2,this.length),this[v]<<8|this[v+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(v,I){return v=v>>>0,I||He(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(v,I){return v=v>>>0,I||He(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},y.prototype.readBigUInt64LE=lt(function(v){v=v>>>0,je(v,"offset");const I=this[v],he=this[v+7];(I===void 0||he===void 0)&&Je(v,this.length-8);const ve=I+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,xe=this[++v]+this[++v]*2**8+this[++v]*2**16+he*2**24;return BigInt(ve)+(BigInt(xe)<<BigInt(32))}),y.prototype.readBigUInt64BE=lt(function(v){v=v>>>0,je(v,"offset");const I=this[v],he=this[v+7];(I===void 0||he===void 0)&&Je(v,this.length-8);const ve=I*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],xe=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+he;return(BigInt(ve)<<BigInt(32))+BigInt(xe)}),y.prototype.readIntLE=function(v,I,he){v=v>>>0,I=I>>>0,he||He(v,I,this.length);let ve=this[v],xe=1,Ae=0;for(;++Ae<I&&(xe*=256);)ve+=this[v+Ae]*xe;return xe*=128,ve>=xe&&(ve-=Math.pow(2,8*I)),ve},y.prototype.readIntBE=function(v,I,he){v=v>>>0,I=I>>>0,he||He(v,I,this.length);let ve=I,xe=1,Ae=this[v+--ve];for(;ve>0&&(xe*=256);)Ae+=this[v+--ve]*xe;return xe*=128,Ae>=xe&&(Ae-=Math.pow(2,8*I)),Ae},y.prototype.readInt8=function(v,I){return v=v>>>0,I||He(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},y.prototype.readInt16LE=function(v,I){v=v>>>0,I||He(v,2,this.length);const he=this[v]|this[v+1]<<8;return he&32768?he|4294901760:he},y.prototype.readInt16BE=function(v,I){v=v>>>0,I||He(v,2,this.length);const he=this[v+1]|this[v]<<8;return he&32768?he|4294901760:he},y.prototype.readInt32LE=function(v,I){return v=v>>>0,I||He(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},y.prototype.readInt32BE=function(v,I){return v=v>>>0,I||He(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},y.prototype.readBigInt64LE=lt(function(v){v=v>>>0,je(v,"offset");const I=this[v],he=this[v+7];(I===void 0||he===void 0)&&Je(v,this.length-8);const ve=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(he<<24);return(BigInt(ve)<<BigInt(32))+BigInt(I+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),y.prototype.readBigInt64BE=lt(function(v){v=v>>>0,je(v,"offset");const I=this[v],he=this[v+7];(I===void 0||he===void 0)&&Je(v,this.length-8);const ve=(I<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(ve)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+he)}),y.prototype.readFloatLE=function(v,I){return v=v>>>0,I||He(v,4,this.length),r.read(this,v,!0,23,4)},y.prototype.readFloatBE=function(v,I){return v=v>>>0,I||He(v,4,this.length),r.read(this,v,!1,23,4)},y.prototype.readDoubleLE=function(v,I){return v=v>>>0,I||He(v,8,this.length),r.read(this,v,!0,52,8)},y.prototype.readDoubleBE=function(v,I){return v=v>>>0,I||He(v,8,this.length),r.read(this,v,!1,52,8)};function qe(O,v,I,he,ve,xe){if(!y.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>ve||v<xe)throw new RangeError('"value" argument is out of bounds');if(I+he>O.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(v,I,he,ve){if(v=+v,I=I>>>0,he=he>>>0,!ve){const Ue=Math.pow(2,8*he)-1;qe(this,v,I,he,Ue,0)}let xe=1,Ae=0;for(this[I]=v&255;++Ae<he&&(xe*=256);)this[I+Ae]=v/xe&255;return I+he},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(v,I,he,ve){if(v=+v,I=I>>>0,he=he>>>0,!ve){const Ue=Math.pow(2,8*he)-1;qe(this,v,I,he,Ue,0)}let xe=he-1,Ae=1;for(this[I+xe]=v&255;--xe>=0&&(Ae*=256);)this[I+xe]=v/Ae&255;return I+he},y.prototype.writeUint8=y.prototype.writeUInt8=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,1,255,0),this[I]=v&255,I+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,2,65535,0),this[I]=v&255,this[I+1]=v>>>8,I+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,2,65535,0),this[I]=v>>>8,this[I+1]=v&255,I+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,4,4294967295,0),this[I+3]=v>>>24,this[I+2]=v>>>16,this[I+1]=v>>>8,this[I]=v&255,I+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,4,4294967295,0),this[I]=v>>>24,this[I+1]=v>>>16,this[I+2]=v>>>8,this[I+3]=v&255,I+4};function ct(O,v,I,he,ve){Ge(v,he,ve,O,I,7);let xe=Number(v&BigInt(4294967295));O[I++]=xe,xe=xe>>8,O[I++]=xe,xe=xe>>8,O[I++]=xe,xe=xe>>8,O[I++]=xe;let Ae=Number(v>>BigInt(32)&BigInt(4294967295));return O[I++]=Ae,Ae=Ae>>8,O[I++]=Ae,Ae=Ae>>8,O[I++]=Ae,Ae=Ae>>8,O[I++]=Ae,I}function ht(O,v,I,he,ve){Ge(v,he,ve,O,I,7);let xe=Number(v&BigInt(4294967295));O[I+7]=xe,xe=xe>>8,O[I+6]=xe,xe=xe>>8,O[I+5]=xe,xe=xe>>8,O[I+4]=xe;let Ae=Number(v>>BigInt(32)&BigInt(4294967295));return O[I+3]=Ae,Ae=Ae>>8,O[I+2]=Ae,Ae=Ae>>8,O[I+1]=Ae,Ae=Ae>>8,O[I]=Ae,I+8}y.prototype.writeBigUInt64LE=lt(function(v,I=0){return ct(this,v,I,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=lt(function(v,I=0){return ht(this,v,I,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(v,I,he,ve){if(v=+v,I=I>>>0,!ve){const Ye=Math.pow(2,8*he-1);qe(this,v,I,he,Ye-1,-Ye)}let xe=0,Ae=1,Ue=0;for(this[I]=v&255;++xe<he&&(Ae*=256);)v<0&&Ue===0&&this[I+xe-1]!==0&&(Ue=1),this[I+xe]=(v/Ae>>0)-Ue&255;return I+he},y.prototype.writeIntBE=function(v,I,he,ve){if(v=+v,I=I>>>0,!ve){const Ye=Math.pow(2,8*he-1);qe(this,v,I,he,Ye-1,-Ye)}let xe=he-1,Ae=1,Ue=0;for(this[I+xe]=v&255;--xe>=0&&(Ae*=256);)v<0&&Ue===0&&this[I+xe+1]!==0&&(Ue=1),this[I+xe]=(v/Ae>>0)-Ue&255;return I+he},y.prototype.writeInt8=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,1,127,-128),v<0&&(v=255+v+1),this[I]=v&255,I+1},y.prototype.writeInt16LE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,2,32767,-32768),this[I]=v&255,this[I+1]=v>>>8,I+2},y.prototype.writeInt16BE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,2,32767,-32768),this[I]=v>>>8,this[I+1]=v&255,I+2},y.prototype.writeInt32LE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,4,2147483647,-2147483648),this[I]=v&255,this[I+1]=v>>>8,this[I+2]=v>>>16,this[I+3]=v>>>24,I+4},y.prototype.writeInt32BE=function(v,I,he){return v=+v,I=I>>>0,he||qe(this,v,I,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[I]=v>>>24,this[I+1]=v>>>16,this[I+2]=v>>>8,this[I+3]=v&255,I+4},y.prototype.writeBigInt64LE=lt(function(v,I=0){return ct(this,v,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=lt(function(v,I=0){return ht(this,v,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function dt(O,v,I,he,ve,xe){if(I+he>O.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function pt(O,v,I,he,ve){return v=+v,I=I>>>0,ve||dt(O,v,I,4),r.write(O,v,I,he,23,4),I+4}y.prototype.writeFloatLE=function(v,I,he){return pt(this,v,I,!0,he)},y.prototype.writeFloatBE=function(v,I,he){return pt(this,v,I,!1,he)};function ce(O,v,I,he,ve){return v=+v,I=I>>>0,ve||dt(O,v,I,8),r.write(O,v,I,he,52,8),I+8}y.prototype.writeDoubleLE=function(v,I,he){return ce(this,v,I,!0,he)},y.prototype.writeDoubleBE=function(v,I,he){return ce(this,v,I,!1,he)},y.prototype.copy=function(v,I,he,ve){if(!y.isBuffer(v))throw new TypeError("argument should be a Buffer");if(he||(he=0),!ve&&ve!==0&&(ve=this.length),I>=v.length&&(I=v.length),I||(I=0),ve>0&&ve<he&&(ve=he),ve===he||v.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(he<0||he>=this.length)throw new RangeError("Index out of range");if(ve<0)throw new RangeError("sourceEnd out of bounds");ve>this.length&&(ve=this.length),v.length-I<ve-he&&(ve=v.length-I+he);const xe=ve-he;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,he,ve):Uint8Array.prototype.set.call(v,this.subarray(he,ve),I),xe},y.prototype.fill=function(v,I,he,ve){if(typeof v=="string"){if(typeof I=="string"?(ve=I,I=0,he=this.length):typeof he=="string"&&(ve=he,he=this.length),ve!==void 0&&typeof ve!="string")throw new TypeError("encoding must be a string");if(typeof ve=="string"&&!y.isEncoding(ve))throw new TypeError("Unknown encoding: "+ve);if(v.length===1){const Ae=v.charCodeAt(0);(ve==="utf8"&&Ae<128||ve==="latin1")&&(v=Ae)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(I<0||this.length<I||this.length<he)throw new RangeError("Out of range index");if(he<=I)return this;I=I>>>0,he=he===void 0?this.length:he>>>0,v||(v=0);let xe;if(typeof v=="number")for(xe=I;xe<he;++xe)this[xe]=v;else{const Ae=y.isBuffer(v)?v:y.from(v,ve),Ue=Ae.length;if(Ue===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(xe=0;xe<he-I;++xe)this[xe+I]=Ae[xe%Ue]}return this};const k={};function Ne(O,v,I){k[O]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(ve){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ve,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Ne("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ne("ERR_INVALID_ARG_TYPE",function(O,v){return`The "${O}" argument must be of type number. Received type ${typeof v}`},TypeError),Ne("ERR_OUT_OF_RANGE",function(O,v,I){let he=`The value of "${O}" is out of range.`,ve=I;return Number.isInteger(I)&&Math.abs(I)>2**32?ve=ye(String(I)):typeof I=="bigint"&&(ve=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(ve=ye(ve)),ve+="n"),he+=` It must be ${v}. Received ${ve}`,he},RangeError);function ye(O){let v="",I=O.length;const he=O[0]==="-"?1:0;for(;I>=he+4;I-=3)v=`_${O.slice(I-3,I)}${v}`;return`${O.slice(0,I)}${v}`}function Ze(O,v,I){je(v,"offset"),(O[v]===void 0||O[v+I]===void 0)&&Je(v,O.length-(I+1))}function Ge(O,v,I,he,ve,xe){if(O>I||O<v){const Ae=typeof v=="bigint"?"n":"";let Ue;throw xe>3?v===0||v===BigInt(0)?Ue=`>= 0${Ae} and < 2${Ae} ** ${(xe+1)*8}${Ae}`:Ue=`>= -(2${Ae} ** ${(xe+1)*8-1}${Ae}) and < 2 ** ${(xe+1)*8-1}${Ae}`:Ue=`>= ${v}${Ae} and <= ${I}${Ae}`,new k.ERR_OUT_OF_RANGE("value",Ue,O)}Ze(he,ve,xe)}function je(O,v){if(typeof O!="number")throw new k.ERR_INVALID_ARG_TYPE(v,"number",O)}function Je(O,v,I){throw Math.floor(O)!==O?(je(O,I),new k.ERR_OUT_OF_RANGE(I||"offset","an integer",O)):v<0?new k.ERR_BUFFER_OUT_OF_BOUNDS:new k.ERR_OUT_OF_RANGE(I||"offset",`>= ${I?1:0} and <= ${v}`,O)}const et=/[^+/0-9A-Za-z-_]/g;function ot(O){if(O=O.split("=")[0],O=O.trim().replace(et,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function Ke(O,v){v=v||1/0;let I;const he=O.length;let ve=null;const xe=[];for(let Ae=0;Ae<he;++Ae){if(I=O.charCodeAt(Ae),I>55295&&I<57344){if(!ve){if(I>56319){(v-=3)>-1&&xe.push(239,191,189);continue}else if(Ae+1===he){(v-=3)>-1&&xe.push(239,191,189);continue}ve=I;continue}if(I<56320){(v-=3)>-1&&xe.push(239,191,189),ve=I;continue}I=(ve-55296<<10|I-56320)+65536}else ve&&(v-=3)>-1&&xe.push(239,191,189);if(ve=null,I<128){if((v-=1)<0)break;xe.push(I)}else if(I<2048){if((v-=2)<0)break;xe.push(I>>6|192,I&63|128)}else if(I<65536){if((v-=3)<0)break;xe.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((v-=4)<0)break;xe.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return xe}function it(O){const v=[];for(let I=0;I<O.length;++I)v.push(O.charCodeAt(I)&255);return v}function mt(O,v){let I,he,ve;const xe=[];for(let Ae=0;Ae<O.length&&!((v-=2)<0);++Ae)I=O.charCodeAt(Ae),he=I>>8,ve=I%256,xe.push(ve),xe.push(he);return xe}function _t(O){return l.toByteArray(ot(O))}function st(O,v,I,he){let ve;for(ve=0;ve<he&&!(ve+I>=v.length||ve>=O.length);++ve)v[ve+I]=O[ve];return ve}function rt(O,v){return O instanceof v||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===v.name}function gt(O){return O!==O}const Et=function(){const O="0123456789abcdef",v=new Array(256);for(let I=0;I<16;++I){const he=I*16;for(let ve=0;ve<16;++ve)v[he+ve]=O[I]+O[ve]}return v}();function lt(O){return typeof BigInt=="undefined"?vt:O}function vt(){throw new Error("BigInt not supported")}})(buffer$1),globalThis.Buffer=buffer$1.Buffer;var utf8$5={},utils$r={},support$5={},nodestream,blob;if(support$5.base64=!0,support$5.array=!0,support$5.string=!0,support$5.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",support$5.nodebuffer=typeof Buffer!="undefined",support$5.uint8array=typeof Uint8Array!="undefined",typeof ArrayBuffer=="undefined")blob=support$5.blob=!1;else{var buffer=new ArrayBuffer(0);try{blob=support$5.blob=new Blob([buffer],{type:"application/zip"}).size===0}catch(t){try{var Builder=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,builder=new Builder;builder.append(buffer),blob=support$5.blob=builder.getBlob("application/zip").size===0}catch(l){blob=support$5.blob=!1}}}try{nodestream=support$5.nodestream=!!require("readable-stream").Readable}catch(t){nodestream=support$5.nodestream=!1}var base64$1={},utils$q=utils$r,support$4=support$5,_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";base64$1.encode=function(t){for(var l=[],r,E,T,A,N,y,ue,Z=0,M=t.length,Se=M,ge=utils$q.getTypeOf(t)!=="string";Z<t.length;)Se=M-Z,ge?(r=t[Z++],E=Z<M?t[Z++]:0,T=Z<M?t[Z++]:0):(r=t.charCodeAt(Z++),E=Z<M?t.charCodeAt(Z++):0,T=Z<M?t.charCodeAt(Z++):0),A=r>>2,N=(r&3)<<4|E>>4,y=Se>1?(E&15)<<2|T>>6:64,ue=Se>2?T&63:64,l.push(_keyStr.charAt(A)+_keyStr.charAt(N)+_keyStr.charAt(y)+_keyStr.charAt(ue));return l.join("")},base64$1.decode=function(t){var l,r,E,T,A,N,y,ue=0,Z=0,M="data:";if(t.substr(0,M.length)===M)throw new Error("Invalid base64 input, it looks like a data url.");t=t.replace(/[^A-Za-z0-9+/=]/g,"");var Se=t.length*3/4;if(t.charAt(t.length-1)===_keyStr.charAt(64)&&Se--,t.charAt(t.length-2)===_keyStr.charAt(64)&&Se--,Se%1!==0)throw new Error("Invalid base64 input, bad content length.");var ge;for(support$4.uint8array?ge=new Uint8Array(Se|0):ge=new Array(Se|0);ue<t.length;)T=_keyStr.indexOf(t.charAt(ue++)),A=_keyStr.indexOf(t.charAt(ue++)),N=_keyStr.indexOf(t.charAt(ue++)),y=_keyStr.indexOf(t.charAt(ue++)),l=T<<2|A>>4,r=(A&15)<<4|N>>2,E=(N&3)<<6|y,ge[Z++]=l,N!==64&&(ge[Z++]=r),y!==64&&(ge[Z++]=E);return ge};var nodejsUtils$2={isNode:typeof Buffer!="undefined",newBufferFrom:function(t,l){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,l);if(typeof t=="number")throw new Error('The "data" argument must not be a number');return new Buffer(t,l)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var l=new Buffer(t);return l.fill(0),l},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}},Mutation=commonjsGlobal.MutationObserver||commonjsGlobal.WebKitMutationObserver,scheduleDrain;if(Mutation){var called=0,observer=new Mutation(nextTick),element=commonjsGlobal.document.createTextNode("");observer.observe(element,{characterData:!0}),scheduleDrain=function(){element.data=called=++called%2}}else if(!commonjsGlobal.setImmediate&&typeof commonjsGlobal.MessageChannel!="undefined"){var channel=new commonjsGlobal.MessageChannel;channel.port1.onmessage=nextTick,scheduleDrain=function(){channel.port2.postMessage(0)}}else"document"in commonjsGlobal&&"onreadystatechange"in commonjsGlobal.document.createElement("script")?scheduleDrain=function(){var t=commonjsGlobal.document.createElement("script");t.onreadystatechange=function(){nextTick(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},commonjsGlobal.document.documentElement.appendChild(t)}:scheduleDrain=function(){setTimeout(nextTick,0)};var draining,queue=[];function nextTick(){draining=!0;for(var t,l,r=queue.length;r;){for(l=queue,queue=[],t=-1;++t<r;)l[t]();r=queue.length}draining=!1}var lib$2=immediate$1;function immediate$1(t){queue.push(t)===1&&!draining&&scheduleDrain()}var immediate=lib$2;function INTERNAL(){}var handlers={},REJECTED=["REJECTED"],FULFILLED=["FULFILLED"],PENDING=["PENDING"],lib$1=Promise$1;function Promise$1(t){if(typeof t!="function")throw new TypeError("resolver must be a function");this.state=PENDING,this.queue=[],this.outcome=void 0,t!==INTERNAL&&safelyResolveThenable(this,t)}Promise$1.prototype.finally=function(t){if(typeof t!="function")return this;var l=this.constructor;return this.then(r,E);function r(T){function A(){return T}return l.resolve(t()).then(A)}function E(T){function A(){throw T}return l.resolve(t()).then(A)}},Promise$1.prototype.catch=function(t){return this.then(null,t)},Promise$1.prototype.then=function(t,l){if(typeof t!="function"&&this.state===FULFILLED||typeof l!="function"&&this.state===REJECTED)return this;var r=new this.constructor(INTERNAL);if(this.state!==PENDING){var E=this.state===FULFILLED?t:l;unwrap(r,E,this.outcome)}else this.queue.push(new QueueItem(r,t,l));return r};function QueueItem(t,l,r){this.promise=t,typeof l=="function"&&(this.onFulfilled=l,this.callFulfilled=this.otherCallFulfilled),typeof r=="function"&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}QueueItem.prototype.callFulfilled=function(t){handlers.resolve(this.promise,t)},QueueItem.prototype.otherCallFulfilled=function(t){unwrap(this.promise,this.onFulfilled,t)},QueueItem.prototype.callRejected=function(t){handlers.reject(this.promise,t)},QueueItem.prototype.otherCallRejected=function(t){unwrap(this.promise,this.onRejected,t)};function unwrap(t,l,r){immediate(function(){var E;try{E=l(r)}catch(T){return handlers.reject(t,T)}E===t?handlers.reject(t,new TypeError("Cannot resolve promise with itself")):handlers.resolve(t,E)})}handlers.resolve=function(t,l){var r=tryCatch(getThen,l);if(r.status==="error")return handlers.reject(t,r.value);var E=r.value;if(E)safelyResolveThenable(t,E);else{t.state=FULFILLED,t.outcome=l;for(var T=-1,A=t.queue.length;++T<A;)t.queue[T].callFulfilled(l)}return t},handlers.reject=function(t,l){t.state=REJECTED,t.outcome=l;for(var r=-1,E=t.queue.length;++r<E;)t.queue[r].callRejected(l);return t};function getThen(t){var l=t&&t.then;if(t&&(typeof t=="object"||typeof t=="function")&&typeof l=="function")return function(){l.apply(t,arguments)}}function safelyResolveThenable(t,l){var r=!1;function E(y){r||(r=!0,handlers.reject(t,y))}function T(y){r||(r=!0,handlers.resolve(t,y))}function A(){l(T,E)}var N=tryCatch(A);N.status==="error"&&E(N.value)}function tryCatch(t,l){var r={};try{r.value=t(l),r.status="success"}catch(E){r.status="error",r.value=E}return r}Promise$1.resolve=resolve;function resolve(t){return t instanceof this?t:handlers.resolve(new this(INTERNAL),t)}Promise$1.reject=reject;function reject(t){var l=new this(INTERNAL);return handlers.reject(l,t)}Promise$1.all=all;function all(t){var l=this;if(Object.prototype.toString.call(t)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=t.length,E=!1;if(!r)return this.resolve([]);for(var T=new Array(r),A=0,N=-1,y=new this(INTERNAL);++N<r;)ue(t[N],N);return y;function ue(Z,M){l.resolve(Z).then(Se,function(ge){E||(E=!0,handlers.reject(y,ge))});function Se(ge){T[M]=ge,++A===r&&!E&&(E=!0,handlers.resolve(y,T))}}}Promise$1.race=race;function race(t){var l=this;if(Object.prototype.toString.call(t)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=t.length,E=!1;if(!r)return this.resolve([]);for(var T=-1,A=new this(INTERNAL);++T<r;)N(t[T]);return A;function N(y){l.resolve(y).then(function(ue){E||(E=!0,handlers.resolve(A,ue))},function(ue){E||(E=!0,handlers.reject(A,ue))})}}var ES6Promise=null;typeof Promise!="undefined"?ES6Promise=Promise:ES6Promise=lib$1;var external$3={Promise:ES6Promise};(function(t,l){if(t.setImmediate)return;var r=1,E={},T=!1,A=t.document,N;function y($e){typeof $e!="function"&&($e=new Function(""+$e));for(var De=new Array(arguments.length-1),Ce=0;Ce<De.length;Ce++)De[Ce]=arguments[Ce+1];var ke={callback:$e,args:De};return E[r]=ke,N(r),r++}function ue($e){delete E[$e]}function Z($e){var De=$e.callback,Ce=$e.args;switch(Ce.length){case 0:De();break;case 1:De(Ce[0]);break;case 2:De(Ce[0],Ce[1]);break;case 3:De(Ce[0],Ce[1],Ce[2]);break;default:De.apply(l,Ce);break}}function M($e){if(T)setTimeout(M,0,$e);else{var De=E[$e];if(De){T=!0;try{Z(De)}finally{ue($e),T=!1}}}}function Se(){N=function($e){setTimeout(function(){M($e)})}}function ge(){if(t.postMessage&&!t.importScripts){var $e=!0,De=t.onmessage;return t.onmessage=function(){$e=!1},t.postMessage("","*"),t.onmessage=De,$e}}function _e(){var $e="setImmediate$"+Math.random()+"$",De=function(Ce){Ce.source===t&&typeof Ce.data=="string"&&Ce.data.indexOf($e)===0&&M(+Ce.data.slice($e.length))};t.addEventListener?t.addEventListener("message",De,!1):t.attachEvent("onmessage",De),N=function(Ce){t.postMessage($e+Ce,"*")}}function we(){var $e=new MessageChannel;$e.port1.onmessage=function(De){var Ce=De.data;M(Ce)},N=function(De){$e.port2.postMessage(De)}}function be(){var $e=A.documentElement;N=function(De){var Ce=A.createElement("script");Ce.onreadystatechange=function(){M(De),Ce.onreadystatechange=null,$e.removeChild(Ce),Ce=null},$e.appendChild(Ce)}}function Te(){N=function($e){setTimeout(M,0,$e)}}var Ie=Object.getPrototypeOf&&Object.getPrototypeOf(t);Ie=Ie&&Ie.setTimeout?Ie:t,{}.toString.call(t.undefined)==="[object undefined]"?Se():ge()?_e():t.MessageChannel?we():A&&"onreadystatechange"in A.createElement("script")?be():Te(),Ie.setImmediate=y,Ie.clearImmediate=ue})(typeof self=="undefined"?commonjsGlobal:self),function(t){var l=support$5,r=base64$1,E=nodejsUtils$2,T=external$3;function A(ge){var _e=null;return l.uint8array?_e=new Uint8Array(ge.length):_e=new Array(ge.length),y(ge,_e)}t.newBlob=function(ge,_e){t.checkSupport("blob");try{return new Blob([ge],{type:_e})}catch(Te){try{var we=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,be=new we;return be.append(ge),be.getBlob(_e)}catch(Ie){throw new Error("Bug : can't construct the Blob.")}}};function N(ge){return ge}function y(ge,_e){for(var we=0;we<ge.length;++we)_e[we]=ge.charCodeAt(we)&255;return _e}var ue={stringifyByChunk:function(ge,_e,we){var be=[],Te=0,Ie=ge.length;if(Ie<=we)return String.fromCharCode.apply(null,ge);for(;Te<Ie;)_e==="array"||_e==="nodebuffer"?be.push(String.fromCharCode.apply(null,ge.slice(Te,Math.min(Te+we,Ie)))):be.push(String.fromCharCode.apply(null,ge.subarray(Te,Math.min(Te+we,Ie)))),Te+=we;return be.join("")},stringifyByChar:function(ge){for(var _e="",we=0;we<ge.length;we++)_e+=String.fromCharCode(ge[we]);return _e},applyCanBeUsed:{uint8array:function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch(ge){return!1}}(),nodebuffer:function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,E.allocBuffer(1)).length===1}catch(ge){return!1}}()}};function Z(ge){var _e=65536,we=t.getTypeOf(ge),be=!0;if(we==="uint8array"?be=ue.applyCanBeUsed.uint8array:we==="nodebuffer"&&(be=ue.applyCanBeUsed.nodebuffer),be)for(;_e>1;)try{return ue.stringifyByChunk(ge,we,_e)}catch(Te){_e=Math.floor(_e/2)}return ue.stringifyByChar(ge)}t.applyFromCharCode=Z;function M(ge,_e){for(var we=0;we<ge.length;we++)_e[we]=ge[we];return _e}var Se={};Se.string={string:N,array:function(ge){return y(ge,new Array(ge.length))},arraybuffer:function(ge){return Se.string.uint8array(ge).buffer},uint8array:function(ge){return y(ge,new Uint8Array(ge.length))},nodebuffer:function(ge){return y(ge,E.allocBuffer(ge.length))}},Se.array={string:Z,array:N,arraybuffer:function(ge){return new Uint8Array(ge).buffer},uint8array:function(ge){return new Uint8Array(ge)},nodebuffer:function(ge){return E.newBufferFrom(ge)}},Se.arraybuffer={string:function(ge){return Z(new Uint8Array(ge))},array:function(ge){return M(new Uint8Array(ge),new Array(ge.byteLength))},arraybuffer:N,uint8array:function(ge){return new Uint8Array(ge)},nodebuffer:function(ge){return E.newBufferFrom(new Uint8Array(ge))}},Se.uint8array={string:Z,array:function(ge){return M(ge,new Array(ge.length))},arraybuffer:function(ge){return ge.buffer},uint8array:N,nodebuffer:function(ge){return E.newBufferFrom(ge)}},Se.nodebuffer={string:Z,array:function(ge){return M(ge,new Array(ge.length))},arraybuffer:function(ge){return Se.nodebuffer.uint8array(ge).buffer},uint8array:function(ge){return M(ge,new Uint8Array(ge.length))},nodebuffer:N},t.transformTo=function(ge,_e){if(_e||(_e=""),!ge)return _e;t.checkSupport(ge);var we=t.getTypeOf(_e),be=Se[we][ge](_e);return be},t.resolve=function(ge){for(var _e=ge.split("/"),we=[],be=0;be<_e.length;be++){var Te=_e[be];Te==="."||Te===""&&be!==0&&be!==_e.length-1||(Te===".."?we.pop():we.push(Te))}return we.join("/")},t.getTypeOf=function(ge){if(typeof ge=="string")return"string";if(Object.prototype.toString.call(ge)==="[object Array]")return"array";if(l.nodebuffer&&E.isBuffer(ge))return"nodebuffer";if(l.uint8array&&ge instanceof Uint8Array)return"uint8array";if(l.arraybuffer&&ge instanceof ArrayBuffer)return"arraybuffer"},t.checkSupport=function(ge){var _e=l[ge.toLowerCase()];if(!_e)throw new Error(ge+" is not supported by this platform")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(ge){var _e="",we,be;for(be=0;be<(ge||"").length;be++)we=ge.charCodeAt(be),_e+="\\x"+(we<16?"0":"")+we.toString(16).toUpperCase();return _e},t.delay=function(ge,_e,we){setImmediate(function(){ge.apply(we||null,_e||[])})},t.inherits=function(ge,_e){var we=function(){};we.prototype=_e.prototype,ge.prototype=new we},t.extend=function(){var ge={},_e,we;for(_e=0;_e<arguments.length;_e++)for(we in arguments[_e])Object.prototype.hasOwnProperty.call(arguments[_e],we)&&typeof ge[we]=="undefined"&&(ge[we]=arguments[_e][we]);return ge},t.prepareContent=function(ge,_e,we,be,Te){var Ie=T.Promise.resolve(_e).then(function($e){var De=l.blob&&($e instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call($e))!==-1);return De&&typeof FileReader!="undefined"?new T.Promise(function(Ce,ke){var Fe=new FileReader;Fe.onload=function(Oe){Ce(Oe.target.result)},Fe.onerror=function(Oe){ke(Oe.target.error)},Fe.readAsArrayBuffer($e)}):$e});return Ie.then(function($e){var De=t.getTypeOf($e);return De?(De==="arraybuffer"?$e=t.transformTo("uint8array",$e):De==="string"&&(Te?$e=r.decode($e):we&&be!==!0&&($e=A($e))),$e):T.Promise.reject(new Error("Can't read the data of '"+ge+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}}(utils$r);function GenericWorker$b(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}GenericWorker$b.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return this.isFinished?!1:(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,l){return this._listeners[t].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,l){if(this._listeners[t])for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].call(this,l)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var l=this;return t.on("data",function(r){l.processChunk(r)}),t.on("end",function(){l.end()}),t.on("error",function(r){l.error(r)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,l){return this.extraStreamInfo[t]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}};var GenericWorker_1=GenericWorker$b;(function(t){for(var l=utils$r,r=support$5,E=nodejsUtils$2,T=GenericWorker_1,A=new Array(256),N=0;N<256;N++)A[N]=N>=252?6:N>=248?5:N>=240?4:N>=224?3:N>=192?2:1;A[254]=A[254]=1;var y=function(ge){var _e,we,be,Te,Ie,$e=ge.length,De=0;for(Te=0;Te<$e;Te++)we=ge.charCodeAt(Te),(we&64512)===55296&&Te+1<$e&&(be=ge.charCodeAt(Te+1),(be&64512)===56320&&(we=65536+(we-55296<<10)+(be-56320),Te++)),De+=we<128?1:we<2048?2:we<65536?3:4;for(r.uint8array?_e=new Uint8Array(De):_e=new Array(De),Ie=0,Te=0;Ie<De;Te++)we=ge.charCodeAt(Te),(we&64512)===55296&&Te+1<$e&&(be=ge.charCodeAt(Te+1),(be&64512)===56320&&(we=65536+(we-55296<<10)+(be-56320),Te++)),we<128?_e[Ie++]=we:we<2048?(_e[Ie++]=192|we>>>6,_e[Ie++]=128|we&63):we<65536?(_e[Ie++]=224|we>>>12,_e[Ie++]=128|we>>>6&63,_e[Ie++]=128|we&63):(_e[Ie++]=240|we>>>18,_e[Ie++]=128|we>>>12&63,_e[Ie++]=128|we>>>6&63,_e[Ie++]=128|we&63);return _e},ue=function(ge,_e){var we;for(_e=_e||ge.length,_e>ge.length&&(_e=ge.length),we=_e-1;we>=0&&(ge[we]&192)===128;)we--;return we<0||we===0?_e:we+A[ge[we]]>_e?we:_e},Z=function(ge){var _e,we,be,Te,Ie=ge.length,$e=new Array(Ie*2);for(we=0,_e=0;_e<Ie;){if(be=ge[_e++],be<128){$e[we++]=be;continue}if(Te=A[be],Te>4){$e[we++]=65533,_e+=Te-1;continue}for(be&=Te===2?31:Te===3?15:7;Te>1&&_e<Ie;)be=be<<6|ge[_e++]&63,Te--;if(Te>1){$e[we++]=65533;continue}be<65536?$e[we++]=be:(be-=65536,$e[we++]=55296|be>>10&1023,$e[we++]=56320|be&1023)}return $e.length!==we&&($e.subarray?$e=$e.subarray(0,we):$e.length=we),l.applyFromCharCode($e)};t.utf8encode=function(_e){return r.nodebuffer?E.newBufferFrom(_e,"utf-8"):y(_e)},t.utf8decode=function(_e){return r.nodebuffer?l.transformTo("nodebuffer",_e).toString("utf-8"):(_e=l.transformTo(r.uint8array?"uint8array":"array",_e),Z(_e))};function M(){T.call(this,"utf-8 decode"),this.leftOver=null}l.inherits(M,T),M.prototype.processChunk=function(ge){var _e=l.transformTo(r.uint8array?"uint8array":"array",ge.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var we=_e;_e=new Uint8Array(we.length+this.leftOver.length),_e.set(this.leftOver,0),_e.set(we,this.leftOver.length)}else _e=this.leftOver.concat(_e);this.leftOver=null}var be=ue(_e),Te=_e;be!==_e.length&&(r.uint8array?(Te=_e.subarray(0,be),this.leftOver=_e.subarray(be,_e.length)):(Te=_e.slice(0,be),this.leftOver=_e.slice(be,_e.length))),this.push({data:t.utf8decode(Te),meta:ge.meta})},M.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=M;function Se(){T.call(this,"utf-8 encode")}l.inherits(Se,T),Se.prototype.processChunk=function(ge){this.push({data:t.utf8encode(ge.data),meta:ge.meta})},t.Utf8EncodeWorker=Se})(utf8$5);var GenericWorker$a=GenericWorker_1,utils$p=utils$r;function ConvertWorker$1(t){GenericWorker$a.call(this,"ConvertWorker to "+t),this.destType=t}utils$p.inherits(ConvertWorker$1,GenericWorker$a),ConvertWorker$1.prototype.processChunk=function(t){this.push({data:utils$p.transformTo(this.destType,t.data),meta:t.meta})};var ConvertWorker_1=ConvertWorker$1,utils$o=utils$r,ConvertWorker=ConvertWorker_1,GenericWorker$9=GenericWorker_1,base64=base64$1,support$3=support$5,external$2=external$3,NodejsStreamOutputAdapter=null;if(support$3.nodestream)try{NodejsStreamOutputAdapter=require("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function transformZipOutput(t,l,r){switch(t){case"blob":return utils$o.newBlob(utils$o.transformTo("arraybuffer",l),r);case"base64":return base64.encode(l);default:return utils$o.transformTo(t,l)}}function concat(t,l){var r,E=0,T=null,A=0;for(r=0;r<l.length;r++)A+=l[r].length;switch(t){case"string":return l.join("");case"array":return Array.prototype.concat.apply([],l);case"uint8array":for(T=new Uint8Array(A),r=0;r<l.length;r++)T.set(l[r],E),E+=l[r].length;return T;case"nodebuffer":return Buffer.concat(l);default:throw new Error("concat : unsupported type '"+t+"'")}}function accumulate(t,l){return new external$2.Promise(function(r,E){var T=[],A=t._internalType,N=t._outputType,y=t._mimeType;t.on("data",function(ue,Z){T.push(ue),l&&l(Z)}).on("error",function(ue){T=[],E(ue)}).on("end",function(){try{var