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