@visactor/vtable-export 0.16.4-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +97 -0
  2. package/cjs/csv/index.d.ts +4 -0
  3. package/cjs/csv/index.js +33 -0
  4. package/cjs/csv/index.js.map +1 -0
  5. package/cjs/excel/index.d.ts +3 -0
  6. package/cjs/excel/index.js +92 -0
  7. package/cjs/excel/index.js.map +1 -0
  8. package/cjs/excel/style.d.ts +6 -0
  9. package/cjs/excel/style.js +84 -0
  10. package/cjs/excel/style.js.map +1 -0
  11. package/cjs/index.d.ts +4 -0
  12. package/cjs/index.js +41 -0
  13. package/cjs/index.js.map +1 -0
  14. package/cjs/util/color.d.ts +152 -0
  15. package/cjs/util/color.js +193 -0
  16. package/cjs/util/color.js.map +1 -0
  17. package/cjs/util/download.d.ts +2 -0
  18. package/cjs/util/download.js +30 -0
  19. package/cjs/util/download.js.map +1 -0
  20. package/cjs/util/encode.d.ts +3 -0
  21. package/cjs/util/encode.js +17 -0
  22. package/cjs/util/encode.js.map +1 -0
  23. package/cjs/util/type.d.ts +6 -0
  24. package/cjs/util/type.js +6 -0
  25. package/cjs/util/type.js.map +1 -0
  26. package/dist/vtable-export.js +76258 -0
  27. package/dist/vtable-export.min.js +92 -0
  28. package/es/csv/index.d.ts +4 -0
  29. package/es/csv/index.js +25 -0
  30. package/es/csv/index.js.map +1 -0
  31. package/es/excel/index.d.ts +3 -0
  32. package/es/excel/index.js +82 -0
  33. package/es/excel/index.js.map +1 -0
  34. package/es/excel/style.d.ts +6 -0
  35. package/es/excel/style.js +75 -0
  36. package/es/excel/style.js.map +1 -0
  37. package/es/index.d.ts +4 -0
  38. package/es/index.js +7 -0
  39. package/es/index.js.map +1 -0
  40. package/es/util/color.d.ts +152 -0
  41. package/es/util/color.js +186 -0
  42. package/es/util/color.js.map +1 -0
  43. package/es/util/download.d.ts +2 -0
  44. package/es/util/download.js +22 -0
  45. package/es/util/download.js.map +1 -0
  46. package/es/util/encode.d.ts +3 -0
  47. package/es/util/encode.js +10 -0
  48. package/es/util/encode.js.map +1 -0
  49. package/es/util/type.d.ts +6 -0
  50. package/es/util/type.js +2 -0
  51. package/es/util/type.js.map +1 -0
  52. package/package.json +87 -0
@@ -0,0 +1,92 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("crypto"),require("fs"),require("stream"),require("events"),require("buffer"),require("util"),require("string_decoder"),require("path"),require("constants"),require("assert"),require("zlib"),require("os")):"function"==typeof define&&define.amd?define(["exports","crypto","fs","stream","events","buffer","util","string_decoder","path","constants","assert","zlib","os"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VTable={},e.require$$0$1,e.require$$0$6,e.require$$0$2,e.require$$0$5,e.require$$0$3,e.require$$0$4,e.require$$0$7,e.require$$1,e.require$$0$8,e.require$$5,e.require$$0$9,e.require$$1$1)}(this,(function(e,t,r,n,i,s,o,a,l,h,u,c,f){"use strict";function d(e,t,r){const n=r.getCellRange(e,t),i=n.start.col,s=n.start.row;if(i!==e||s!==t)return"";return r.getCellValue(e,t)}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var y={exports:{}};!function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){a(n.response,t,r)},n.onerror=function(){},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof p&&p.global===p?p:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=s.saveAs||("object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,t,o){var a=s.URL||s.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):n(l.href)?r(e,t,o):i(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,s,o){if(s=s||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,o),s);else if(n(e))r(e,s,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout((function(){i(a)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var a="application/octet-stream"===e.type,l=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||a&&l||o)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=h?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var c=s.URL||s.webkitURL,f=c.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout((function(){c.revokeObjectURL(f)}),4e4)}});s.saveAs=a.saveAs=a,e.exports=a}()}(y);var v=y.exports;const{toString:b}=Object.prototype,w=/["&<>]/,x={each:function(e,t){e&&(Array.isArray(e)?e.forEach(t):Object.keys(e).forEach((r=>{t(e[r],r)})))},some:function(e,t){return!!e&&(Array.isArray(e)?e.some(t):Object.keys(e).some((r=>t(e[r],r))))},every:function(e,t){return!e||(Array.isArray(e)?e.every(t):Object.keys(e).every((r=>t(e[r],r))))},map:function(e,t){return e?Array.isArray(e)?e.map(t):Object.keys(e).map((r=>t(e[r],r))):[]},keyBy:(e,t)=>e.reduce(((e,r)=>(e[r[t]]=r,e)),{}),isEqual:function(e,t){const r=typeof e,n=typeof t,i=Array.isArray(e),s=Array.isArray(t);let o;if(r!==n)return!1;if("object"==typeof e){if(i||s)return!(!i||!s)&&(e.length===t.length&&e.every(((e,r)=>{const n=t[r];return x.isEqual(e,n)})));if(null===e||null===t)return e===t;if(o=Object.keys(e),Object.keys(t).length!==o.length)return!1;for(const e of o)if(!t.hasOwnProperty(e))return!1;return x.every(e,((e,r)=>{const n=t[r];return x.isEqual(e,n)}))}return e===t},escapeHtml(e){const t=w.exec(e);if(!t)return e;let r="",n="",i=0,s=t.index;for(;s<e.length;s++){switch(e.charAt(s)){case'"':n="&quot;";break;case"&":n="&amp;";break;case"'":n="&apos;";break;case"<":n="&lt;";break;case">":n="&gt;";break;default:continue}i!==s&&(r+=e.substring(i,s)),i=s+1,r+=n}return i!==s?r+e.substring(i,s):r},strcmp:(e,t)=>e<t?-1:e>t?1:0,isUndefined:e=>"[object Undefined]"===b.call(e),isObject:e=>"[object Object]"===b.call(e),deepMerge(){const e=arguments[0]||{},{length:t}=arguments;let r,n,i;function s(t,s){r=e[s],i=Array.isArray(t),x.isObject(t)||i?(i?(i=!1,n=r&&Array.isArray(r)?r:[]):n=r&&x.isObject(r)?r:{},e[s]=x.deepMerge(n,t)):x.isUndefined(t)||(e[s]=t)}for(let e=0;e<t;e++)x.each(arguments[e],s);return e}};var k=x;const S=/^[A-Z]+\d+$/,E={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:e=>e<=26?1:e<=676?2:3,_fill(e){let t,r,n,i,s,o=1;if(e>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&e>=1){for(;o<=26;)t=this._dictionary[o-1],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(o=27;o<=702;)r=o-27,n=r%26,i=Math.floor(r/26),t=this._dictionary[i]+this._dictionary[n],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)r=o-703,n=r%26,i=Math.floor(r/26)%26,s=Math.floor(r/676),t=this._dictionary[s]+this._dictionary[i]+this._dictionary[n],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw new Error(`Out of bounds. Invalid column letter: ${e}`);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw new Error(`${e} is out of bounds. Excel supports columns from 1 to 16384`);return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},validateAddress(e){if(!S.test(e))throw new Error(`Invalid Address: ${e}`);return!0},decodeAddress(e){const t=e.length<5&&this._hash[e];if(t)return t;let r=!1,n="",i=0,s=!1,o="",a=0;for(let t,l=0;l<e.length;l++)if(t=e.charCodeAt(l),!s&&t>=65&&t<=90)r=!0,n+=e[l],i=26*i+t-64;else if(t>=48&&t<=57)s=!0,o+=e[l],a=10*a+t-48;else if(s&&r&&36!==t)break;if(r){if(i>16384)throw new Error(`Out of bounds. Invalid column letter: ${n}`)}else i=void 0;s||(a=void 0);const l={address:e=n+o,col:i,row:a,$col$row:`$${n}$${o}`};return i<=100&&a<=100&&(this._hash[e]=l,this._hash[l.$col$row]=l),l},getAddress(e,t){if(t){const r=this.n2l(t)+e;return this.decodeAddress(r)}return this.decodeAddress(e)},decode(e){const t=e.split(":");if(2===t.length){const e=this.decodeAddress(t[0]),r=this.decodeAddress(t[1]),n={top:Math.min(e.row,r.row),left:Math.min(e.col,r.col),bottom:Math.max(e.row,r.row),right:Math.max(e.col,r.col)};return n.tl=this.n2l(n.left)+n.top,n.br=this.n2l(n.right)+n.bottom,n.dimensions=`${n.tl}:${n.br}`,n}return this.decodeAddress(e)},decodeEx(e){const t=e.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),r=t[1]||t[2],n=t[3],i=n.split(":");if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]);const n=Math.min(e.row,t.row),s=Math.min(e.col,t.col),o=Math.max(e.row,t.row),a=Math.max(e.col,t.col);return e=this.n2l(s)+n,t=this.n2l(a)+o,{top:n,left:s,bottom:o,right:a,sheetName:r,tl:{address:e,col:s,row:n,$col$row:`$${this.n2l(s)}$${n}`,sheetName:r},br:{address:t,col:a,row:o,$col$row:`$${this.n2l(a)}$${o}`,sheetName:r},dimensions:`${e}:${t}`}}if(n.startsWith("#"))return r?{sheetName:r,error:n}:{error:n};const s=this.decodeAddress(n);return r?{sheetName:r,...s}:s},encodeAddress:(e,t)=>E.n2l(t)+e,encode(){switch(arguments.length){case 2:return E.encodeAddress(arguments[0],arguments[1]);case 4:return`${E.encodeAddress(arguments[0],arguments[1])}:${E.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(e,t){const[r,n,,i,s]=e,[o,a]=t;return o>=r&&o<=i&&a>=n&&a<=s}};var T=E;const C=T;var O=class e{constructor(){this.decode(arguments)}setTLBR(e,t,r,n,i){if(arguments.length<4){const n=C.decodeAddress(e),s=C.decodeAddress(t);this.model={top:Math.min(n.row,s.row),left:Math.min(n.col,s.col),bottom:Math.max(n.row,s.row),right:Math.max(n.col,s.col),sheetName:r},this.setTLBR(n.row,n.col,s.row,s.col,i)}else this.model={top:Math.min(e,r),left:Math.min(t,n),bottom:Math.max(e,r),right:Math.max(t,n),sheetName:i}}decode(t){switch(t.length){case 5:this.setTLBR(t[0],t[1],t[2],t[3],t[4]);break;case 4:this.setTLBR(t[0],t[1],t[2],t[3]);break;case 3:this.setTLBR(t[0],t[1],t[2]);break;case 2:this.setTLBR(t[0],t[1]);break;case 1:{const r=t[0];if(r instanceof e)this.model={top:r.model.top,left:r.model.left,bottom:r.model.bottom,right:r.model.right,sheetName:r.sheetName};else if(r instanceof Array)this.decode(r);else if(r.top&&r.left&&r.bottom&&r.right)this.model={top:r.top,left:r.left,bottom:r.bottom,right:r.right,sheetName:r.sheetName};else{const e=C.decodeEx(r);e.top?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error(`Invalid number of arguments to _getDimensions() - ${t.length}`)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){const{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?`${e}!`:`'${e}'!`:""}expand(e,t,r,n){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||r>this.bottom)&&(this.bottom=r),(!this.model.right||n>this.right)&&(this.right=n)}expandRow(e){if(e){const{dimensions:t,number:r}=e;t&&this.expand(r,t.min,r,t.max)}}expandToAddress(e){const t=C.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return C.n2l(this.left)+this.top}get $t$l(){return`$${C.n2l(this.left)}$${this.top}`}get br(){return C.n2l(this.right)+this.bottom}get $b$r(){return`$${C.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&(!(e.bottom<this.top)&&(!(e.top>this.bottom)&&(!(e.right<this.left)&&!(e.left>this.right))))}contains(e){const t=C.decodeEx(e);return this.containsEx(t)}containsEx(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&(e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right)}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let r=this.top;r<=this.bottom;r++)e(C.encodeAddress(r,t),r,t)}},R={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}};const A=T,N=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,I=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;var P={slideFormula:function(e,t,r){const n=A.decode(t),i=A.decode(r);return e.replace(N,((e,t,r,s,o)=>{if(o)return e;const a=I.exec(s);if(a){const r=a[1],s=a[2].toUpperCase(),o=a[3],l=a[4];if(s.length>3||3===s.length&&s>"XFD")return e;let h=A.l2n(s),u=parseInt(l,10);r||(h+=i.col-n.col),o||(u+=i.row-n.row);return(t||"")+(r||"")+A.n2l(h)+(o||"")+u}return e}))}};const F=k;let D=class e{constructor(e){this.note=e}get model(){let t=null;if("string"==typeof this.note)t={type:"note",note:{texts:[{text:this.note}]}};else t={type:"note",note:this.note};return F.deepMerge({},e.DEFAULT_CONFIGS,t)}set model(e){const{note:t}=e,{texts:r}=t;1===r.length&&1===Object.keys(r[0]).length?this.note=r[0].text:this.note=t}static fromModel(t){const r=new e;return r.model=t,r}};D.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};var j=D;const M=T,L=k,B=R,{slideFormula:z}=P,$=j;let H=class e{constructor(t,r,n){if(!t||!r)throw new Error("A Cell needs a Row");this._row=t,this._column=r,M.validateAddress(n),this._address=n,this._value=U.create(e.Types.Null,this),this.style=this._mergeStyle(t.style,r.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,r){const n=e&&e.numFmt||t&&t.numFmt;n&&(r.numFmt=n);const i=e&&e.font||t&&t.font;i&&(r.font=i);const s=e&&e.alignment||t&&t.alignment;s&&(r.alignment=s);const o=e&&e.border||t&&t.border;o&&(r.border=o);const a=e&&e.fill||t&&t.fill;a&&(r.fill=a);const l=e&&e.protection||t&&t.protection;return l&&(r.protection=l),r}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===e.Types.Merge}merge(t,r){this._value.release(),this._value=U.create(e.Types.Merge,this,t),r||(this.style=t.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=U.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(t){return this._value.type===e.Types.Merge&&this._value.isMergedTo(t)}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(t){this.type!==e.Types.Merge?(this._value.release(),this._value=U.create(U.getType(t),this,t)):this._value.master.value=t}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new $(e)}get text(){return this._value.toString()}get html(){return L.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(t){this.type===e.Types.String&&(this._value=U.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:t}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){const{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach((e=>{t.addEx(this.fullAddress,e)}))}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){const{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){if(this._value.release(),this._value=U.create(e.type,this),this._value.model=e,e.comment&&"note"===e.comment.type)this._comment=$.fromModel(e.comment);e.style?this.style=e.style:this.style={}}};H.Types=B.ValueType;const U={getType:e=>null==e?H.Types.Null:e instanceof String||"string"==typeof e?H.Types.String:"number"==typeof e?H.Types.Number:"boolean"==typeof e?H.Types.Boolean:e instanceof Date?H.Types.Date:e.text&&e.hyperlink?H.Types.Hyperlink:e.formula||e.sharedFormula?H.Types.Formula:e.richText?H.Types.RichText:e.sharedString?H.Types.SharedString:e.error?H.Types.Error:H.Types.JSON,types:[{t:H.Types.Null,f:class{constructor(e){this.model={address:e.address,type:H.Types.Null}}get value(){return null}set value(e){}get type(){return H.Types.Null}get effectiveType(){return H.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){}toString(){return""}}},{t:H.Types.Number,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.Number}get effectiveType(){return H.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:H.Types.String,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.String}get effectiveType(){return H.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:H.Types.Date,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.Date}get effectiveType(){return H.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:H.Types.Hyperlink,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){const e={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(e.tooltip=this.model.tooltip),e}set value(e){this.model={text:e.text,hyperlink:e.hyperlink},e.tooltip&&(this.model.tooltip=e.tooltip)}get text(){return this.model.text}set text(e){this.model.text=e}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return H.Types.Hyperlink}get effectiveType(){return H.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:H.Types.Formula,f:class{constructor(e,t){this.cell=e,this.model={address:e.address,type:H.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0}}_copyModel(e){const t={},r=r=>{const n=e[r];n&&(t[r]=n)};return r("formula"),r("result"),r("ref"),r("shareType"),r("sharedFormula"),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(U.getType(e)){case H.Types.Null:case H.Types.String:case H.Types.Number:case H.Types.Date:break;case H.Types.Hyperlink:case H.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?B.FormulaType.Master:this.model.sharedFormula?B.FormulaType.Shared:B.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return H.Types.Formula}get effectiveType(){const e=this.model.result;return null==e?B.ValueType.Null:e instanceof String||"string"==typeof e?B.ValueType.String:"number"==typeof e?B.ValueType.Number:e instanceof Date?B.ValueType.Date:e.text&&e.hyperlink?B.ValueType.Hyperlink:e.formula?B.ValueType.Formula:B.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&z(t.formula,t.address,this.model.address)}return this._translatedFormula}toCsvString(){return`${this.model.result||""}`}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:H.Types.Merge,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof H?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return H.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:H.Types.JSON,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return H.Types.String}get effectiveType(){return H.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:H.Types.SharedString,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.SharedString}get effectiveType(){return H.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:H.Types.RichText,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map((e=>e.text)).join("")}get type(){return H.Types.RichText}get effectiveType(){return H.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:H.Types.Boolean,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.Boolean}get effectiveType(){return H.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:H.Types.Error,f:class{constructor(e,t){this.model={address:e.address,type:H.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return H.Types.Error}get effectiveType(){return H.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce(((e,t)=>(e[t.t]=t.f,e)),[]),create(e,t,r){const n=this.types[e];if(!n)throw new Error(`Could not create Value of type ${e}`);return new n(t,r)}};const V=k,W=R,q=T,X=H;var Z=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){const r=this._worksheet.getColumn(e.col);t=new X(this,r,e.address),this._cells[e.col-1]=t}return t}getCell(e){if("string"==typeof e){const t=this._worksheet.getColumnKey(e);e=t?t.number:q.l2n(e)}return this._cells[e-1]||this.getCellEx({address:q.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,t){const r=e+t;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];const o=i.length-t,a=this._cells.length;let l,h,u;if(o<0)for(l=e+i.length;l<=a;l++)u=this._cells[l-1],h=this._cells[l-o-1],h?(u=this.getCell(l),u.value=h.value,u.style=h.style,u._comment=h._comment):u&&(u.value=null,u.style={},u._comment=void 0);else if(o>0)for(l=a;l>=r;l--)h=this._cells[l-1],h?(u=this.getCell(l+o),u.value=h.value,u.style=h.style,u._comment=h._comment):this._cells[l+o-1]=void 0;for(l=0;l<i.length;l++)u=this.getCell(e+l),u.value=i[l],u.style={},u._comment=void 0}eachCell(e,t){if(t||(t=e,e=null),e&&e.includeEmpty){const e=this._cells.length;for(let r=1;r<=e;r++)t(this.getCell(r),r)}else this._cells.forEach(((e,r)=>{e&&e.type!==W.ValueType.Null&&t(e,r+1)}))}addPageBreak(e,t){const r=this._worksheet,n=Math.max(0,e-1)||0,i=Math.max(0,t-1)||16838,s={id:this._number,max:i,man:1};n&&(s.min=n),r.rowBreaks.push(s)}get values(){const e=[];return this._cells.forEach((t=>{t&&t.type!==W.ValueType.Null&&(e[t.col]=t.value)})),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;e.hasOwnProperty("0")&&(t=1),e.forEach(((e,r)=>{void 0!==e&&(this.getCellEx({address:q.encodeAddress(this._number,r+t),row:this._number,col:r+t}).value=e)}))}else this._worksheet.eachColumnKey(((t,r)=>{void 0!==e[r]&&(this.getCellEx({address:q.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[r])}));else;}get hasValues(){return V.some(this._cells,(e=>e&&e.type!==W.ValueType.Null))}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell((()=>{e++})),e}get dimensions(){let e=0,t=0;return this._cells.forEach((r=>{r&&r.type!==W.ValueType.Null&&((!e||e>r.col)&&(e=r.col),t<r.col&&(t=r.col))})),e>0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach((r=>{r&&(r[e]=t)})),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const e=[];let t=0,r=0;return this._cells.forEach((n=>{if(n){const i=n.model;i&&((!t||t>n.col)&&(t=n.col),r<n.col&&(r=n.col),e.push(i))}})),this.height||e.length?{cells:e,number:this.number,min:t,max:r,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(e){if(e.number!==this._number)throw new Error("Invalid row number in model");let t;this._cells=[],e.cells.forEach((e=>{switch(e.type){case X.Types.Merge:break;default:{let r;if(e.address)r=q.decodeAddress(e.address);else if(t){const{row:e}=t,n=t.col+1;r={row:e,col:n,address:q.encodeAddress(e,n),$col$row:`$${q.n2l(n)}$${e}`}}t=r;this.getCellEx(r).model=e;break}}})),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}};const G=k,Y=R,K=T;var Q=class e{constructor(e,t,r){this._worksheet=e,this._number=t,!1!==r&&(this.defn=r)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return K.n2l(this._number)}get isCustomWidth(){return void 0!==this.width&&9!==this.width}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=void 0!==e.width?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){void 0!==e?(this._header=e,this.headers.forEach(((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&G.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,t){const r=this.number;t||(t=e,e=null),this._worksheet.eachRow(e,((e,n)=>{t(e.getCell(r),n)}))}get values(){const e=[];return this.eachCell(((t,r)=>{t&&t.type!==Y.ValueType.Null&&(e[r]=t.value)})),e}set values(e){if(!e)return;const t=this.number;let r=0;e.hasOwnProperty("0")&&(r=1),e.forEach(((e,n)=>{this._worksheet.getCell(n+r,t).value=e}))}_applyStyle(e,t){return this.style[e]=t,this.eachCell((r=>{r[e]=t})),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const t=[];let r=null;return e&&e.forEach(((e,n)=>{e.isDefault?r&&(r=null):r&&e.equivalentTo(r)?r.max=n+1:(r={min:n+1,max:n+1,width:void 0!==e.width?e.width:9,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(r))})),t.length?t:void 0}static fromModel(t,r){const n=[];let i=1,s=0;for(r=(r=r||[]).sort((function(e,t){return e.min-t.min}));s<r.length;){const o=r[s++];for(;i<o.min;)n.push(new e(t,i++));for(;i<=o.max;)n.push(new e(t,i++,o))}return n.length?n:null}};const J=T;var ee=class e{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.worksheet=e,t)if("string"==typeof t){const e=J.decodeAddress(t);this.nativeCol=e.col+r,this.nativeColOff=0,this.nativeRow=e.row+r,this.nativeRowOff=0}else void 0!==t.nativeCol?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):void 0!==t.col?(this.col=t.col+r,this.row=t.row+r):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(t){return t instanceof e||null==t?t:new e(t)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e),this.nativeColOff=Math.floor((e-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e),this.nativeRowOff=Math.floor((e-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}};const te=T,re=ee;var ne=class{constructor(e,t){this.worksheet=e,this.model=t}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(e){let{type:t,imageId:r,range:n,hyperlinks:i}=e;if(this.type=t,this.imageId=r,"image"===t)if("string"==typeof n){const e=te.decode(n);this.range={tl:new re(this.worksheet,{col:e.left,row:e.top},-1),br:new re(this.worksheet,{col:e.right,row:e.bottom},0),editAs:"oneCell"}}else this.range={tl:new re(this.worksheet,n.tl,0),br:n.br&&new re(this.worksheet,n.br,0),ext:n.ext,editAs:n.editAs,hyperlinks:i||n.hyperlinks}}};const ie=T;var se=class{constructor(e,t){this.worksheet=e,t&&(this.table=t,this.validate(),this.store())}getFormula(e){switch(e.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${e.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${e.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${e.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${e.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${e.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${e.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${e.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${e.name}])`;case"custom":return e.totalsRowFormula;default:throw new Error(`Invalid Totals Row Function: ${e.totalsRowFunction}`)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:e}=this,t=(e,t,r)=>{void 0===e[t]&&(e[t]=r)};t(e,"headerRow",!0),t(e,"totalsRow",!1),t(e,"style",{}),t(e.style,"theme","TableStyleMedium2"),t(e.style,"showFirstColumn",!1),t(e.style,"showLastColumn",!1),t(e.style,"showRowStripes",!1),t(e.style,"showColumnStripes",!1);const r=(e,t)=>{if(!e)throw new Error(t)};r(e.ref,"Table must have ref"),r(e.columns,"Table must have column definitions"),r(e.rows,"Table must have row definitions"),e.tl=ie.decodeAddress(e.ref);const{row:n,col:i}=e.tl;r(n>0,"Table must be on valid row"),r(i>0,"Table must be on valid col");const{width:s,filterHeight:o,tableHeight:a}=this;e.autoFilterRef=ie.encode(n,i,n+o-1,i+s-1),e.tableRef=ie.encode(n,i,n+a-1,i+s-1),e.columns.forEach(((e,n)=>{r(e.name,`Column ${n} must have a name`),0===n?t(e,"totalsRowLabel","Total"):(t(e,"totalsRowFunction","none"),e.totalsRowFormula=this.getFormula(e))}))}store(){const e=(e,t)=>{t&&Object.keys(t).forEach((r=>{e[r]=t[r]}))},{worksheet:t,table:r}=this,{row:n,col:i}=r.tl;let s=0;if(r.headerRow){const o=t.getRow(n+s++);r.columns.forEach(((t,r)=>{const{style:n,name:s}=t,a=o.getCell(i+r);a.value=s,e(a,n)}))}if(r.rows.forEach((o=>{const a=t.getRow(n+s++);o.forEach(((t,n)=>{const s=a.getCell(i+n);s.value=t,e(s,r.columns[n].style)}))})),r.totalsRow){const o=t.getRow(n+s++);r.columns.forEach(((t,r)=>{const n=o.getCell(i+r);if(0===r)n.value=t.totalsRowLabel;else{const e=this.getFormula(t);n.value=e?{formula:t.totalsRowFormula,result:t.totalsRowResult}:null}e(n,t.style)}))}}load(e){const{table:t}=this,{row:r,col:n}=t.tl;let i=0;if(t.headerRow){const s=e.getRow(r+i++);t.columns.forEach(((e,t)=>{s.getCell(n+t).value=e.name}))}if(t.rows.forEach((t=>{const s=e.getRow(r+i++);t.forEach(((e,t)=>{s.getCell(n+t).value=e}))})),t.totalsRow){const s=e.getRow(r+i++);t.columns.forEach(((e,t)=>{const r=s.getCell(n+t);if(0===t)r.value=e.totalsRowLabel;else{this.getFormula(e)&&(r.value={formula:e.totalsRowFormula,result:e.totalsRowResult})}}))}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const e=ie.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){r.getCell(e.col+t).value=null}}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){r.getCell(e.col+t).value=null}}for(let t=0;t<this.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++){r.getCell(e.col+t).value=null}}}this.store()}addRow(e,t){this.cacheState(),void 0===t?this.table.rows.push(e):this.table.rows.splice(t,0,e)}removeRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){const t=this.table.columns[e];return new class{constructor(e,t,r){this.table=e,this.column=t,this.index=r}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set("name",e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set("totalsRowLabel",e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set("totalsRowFunction",e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set("totalsRowResult",e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set("totalsRowFormula",e)}}(this,t,e)}addColumn(e,t,r){this.cacheState(),void 0===r?(this.table.columns.push(e),this.table.rows.forEach(((e,r)=>{e.push(t[r])}))):(this.table.columns.splice(r,0,e),this.table.rows.forEach(((e,n)=>{e.splice(r,0,t[n])})))}removeColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach((r=>{r.splice(e,t)}))}_assign(e,t,r){this.cacheState(),e[t]=r}get ref(){return this.table.ref}set ref(e){this._assign(this.table,"ref",e)}get name(){return this.table.name}set name(e){this.table.name=e}get displayName(){return this.table.displyName||this.table.name}set displayNamename(e){this.table.displayName=e}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,"headerRow",e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,"totalsRow",e)}get theme(){return this.table.style.name}set theme(e){this.table.style.name=e}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(e){this.table.style.showFirstColumn=e}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(e){this.table.style.showLastColumn=e}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(e){this.table.style.showRowStripes=e}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(e){this.table.style.showColumnStripes=e}};var oe=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){return this.model[e]}remove(e){this.model[e]=void 0}};const ae=t,le={hash(e){const t=ae.createHash(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t.update(Buffer.concat(n)),t.digest()},convertPasswordToHash(e,t,r,n){t=t.toLowerCase();if(ae.getHashes().indexOf(t)<0)throw new Error(`Hash algorithm '${t}' not supported!`);const i=Buffer.from(e,"utf16le");let s=this.hash(t,Buffer.from(r,"base64"),i);for(let e=0;e<n;e++){const r=Buffer.alloc(4);r.writeUInt32LE(e,0),s=this.hash(t,s,r)}return s.toString("base64")},randomBytes:e=>ae.randomBytes(e)};var he=le,ue={};const ce=(e,t)=>({...e,...t.reduce(((t,r)=>(e[r]&&(t[r]={...e[r]}),t)),{})}),fe=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];e[r]&&(t[r]=ce(e[r],n))};ue.copyStyle=e=>{if(!e)return e;if(t=e,0===Object.keys(t).length)return{};var t;const r={...e};return fe(e,r,"font",["color"]),fe(e,r,"alignment"),fe(e,r,"protection"),e.border&&(fe(e,r,"border"),fe(e.border,r.border,"top",["color"]),fe(e.border,r.border,"left",["color"]),fe(e.border,r.border,"bottom",["color"]),fe(e.border,r.border,"right",["color"]),fe(e.border,r.border,"diagonal",["color"])),e.fill&&(fe(e,r,"fill",["fgColor","bgColor","center"]),e.fill.stops&&(r.fill.stops=e.fill.stops.map((e=>ce(e,["color"]))))),r};const de=k,pe=T,me=O,ge=Z,ye=Q,ve=R,_e=ne,be=se,we=oe,xe=he,{copyStyle:ke}=ue;var Se=class{constructor(e){e=e||{},this._workbook=e.workbook,this.id=e.id,this.orderNo=e.orderNo,this.name=e.name,this.state=e.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new we,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(void 0===e&&(e=`sheet${this.id}`),this._name!==e){if("string"!=typeof e)throw new Error("The name has to be a string.");if(""===e)throw new Error("The name can't be empty.");if("History"===e)throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(e))throw new Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw new Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook._worksheets.find((t=>t&&t.name.toLowerCase()===e.toLowerCase())))throw new Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const e=new me;return this._rows.forEach((t=>{if(t){const r=t.dimensions;r&&e.expand(t.number,r.min,t.number,r.max)}})),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce(((e,t)=>{const r=(t.header?1:t.headers&&t.headers.length)||0;return Math.max(e,r)}),0);let t=1;const r=this._columns=[];e.forEach((e=>{const n=new ye(this,t++,!1);r.push(n),n.defn=e}))}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){de.each(this._keys,e)}getColumn(e){if("string"==typeof e){const t=this._keys[e];if(t)return t;e=pe.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new ye(this,t++))}return this._columns[e-1]}spliceColumns(e,t){const r=this._rows.length;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];if(i.length>0)for(let n=0;n<r;n++){const r=[e,t];i.forEach((e=>{r.push(e[n]||null)}));const s=this.getRow(n+1);s.splice.apply(s,r)}else this._rows.forEach((r=>{r&&r.splice(e,t)}));const o=i.length-t,a=e+t,l=this._columns.length;if(o<0)for(let t=e+i.length;t<=l;t++)this.getColumn(t).defn=this.getColumn(t-o).defn;else if(o>0)for(let e=l;e>=a;e--)this.getColumn(e+o).defn=this.getColumn(e).defn;for(let t=e;t<e+i.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,i.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow((t=>{e=Math.max(e,t.cellCount)})),e}get actualColumnCount(){const e=[];let t=0;return this.eachRow((r=>{r.eachCell((r=>{let{col:n}=r;e[n]||(e[n]=!0,t++)}))})),t}_commitRow(){}get _lastRowNumber(){const e=this._rows;let t=e.length;for(;t>0&&void 0===e[t-1];)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow((()=>{e++})),e}getRow(e){let t=this._rows[e-1];return t||(t=this._rows[e-1]=new ge(this,e)),t}getRows(e,t){if(t<1)return;const r=[];for(let n=e;n<e+t;n++)r.push(this.getRow(n));return r}addRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=this._nextRow,n=this.getRow(r);return n.values=e,this._setStyleOption(r,"i"===t[0]?t:"n"),n}addRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=[];return e.forEach((e=>{r.push(this.addRow(e,t))})),r}insertRow(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";return this.spliceRows(e,0,t),this._setStyleOption(e,r),this.getRow(e)}insertRows(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";if(this.spliceRows(e,0,...t),"n"!==r)for(let n=0;n<t.length;n++)"o"===r[0]&&void 0!==this.findRow(t.length+e+n)?this._copyStyle(t.length+e+n,e+n,"+"===r[1]):"i"===r[0]&&void 0!==this.findRow(e-1)&&this._copyStyle(e-1,e+n,"+"===r[1]);return this.getRows(e,t.length)}_setStyleOption(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";"o"===t[0]&&void 0!==this.findRow(e+1)?this._copyStyle(e+1,e,"+"===t[1]):"i"===t[0]&&void 0!==this.findRow(e-1)&&this._copyStyle(e-1,e,"+"===t[1])}_copyStyle(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this.getRow(e),i=this.getRow(t);i.style=ke(n.style),n.eachCell({includeEmpty:r},((e,t)=>{i.getCell(t).style=ke(e.style)})),i.height=n.height}duplicateRow(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this._rows[e-1],i=new Array(t).fill(n.values);this.spliceRows(e+1,r?0:t,...i);for(let r=0;r<t;r++){const t=this._rows[e+r];t.style=n.style,t.height=n.height,n.eachCell({includeEmpty:!0},((e,r)=>{t.getCell(r).style=e.style}))}}spliceRows(e,t){const r=e+t;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];const o=i.length,a=o-t,l=this._rows.length;let h,u;if(a<0)for(e===l&&(this._rows[l-1]=void 0),h=r;h<=l;h++)if(u=this._rows[h-1],u){const e=this.getRow(h+a);e.values=u.values,e.style=u.style,e.height=u.height,u.eachCell({includeEmpty:!0},((t,r)=>{e.getCell(r).style=t.style})),this._rows[h-1]=void 0}else this._rows[h+a-1]=void 0;else if(a>0)for(h=l;h>=r;h--)if(u=this._rows[h-1],u){const e=this.getRow(h+a);e.values=u.values,e.style=u.style,e.height=u.height,u.eachCell({includeEmpty:!0},((t,r)=>{if(e.getCell(r).style=t.style,"MergeValue"===t._value.constructor.name){const e=this.getRow(t._row._number+o).getCell(r),n=t._value._master,i=this.getRow(n._row._number+o).getCell(n._column._number);e.merge(i)}}))}else this._rows[h+a-1]=void 0;for(h=0;h<o;h++){const t=this.getRow(e+h);t.style={},t.values=i[h]}this.workbook.definedNames.spliceRows(this.name,e,t,o)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){const e=this._rows.length;for(let r=1;r<=e;r++)t(this.getRow(r),r)}else this._rows.forEach((e=>{e&&e.hasValues&&t(e,e.number)}))}getSheetValues(){const e=[];return this._rows.forEach((t=>{t&&(e[t.number]=t.values)})),e}findCell(e,t){const r=pe.getAddress(e,t),n=this._rows[r.row-1];return n?n.findCell(r.col):void 0}getCell(e,t){const r=pe.getAddress(e,t);return this.getRow(r.row).getCellEx(r)}mergeCells(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=new me(t);this._mergeCellsInternal(n)}mergeCellsWithoutStyle(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=new me(t);this._mergeCellsInternal(n,!0)}_mergeCellsInternal(e,t){de.each(this._merges,(t=>{if(t.intersects(e))throw new Error("Cannot merge already merged cells")}));const r=this.getCell(e.top,e.left);for(let n=e.top;n<=e.bottom;n++)for(let i=e.left;i<=e.right;i++)(n>e.top||i>e.left)&&this.getCell(n,i).merge(r,t);this._merges[r.address]=e}_unMergeMaster(e){const t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let r=t.left;r<=t.right;r++)this.getCell(e,r).unmerge();delete this._merges[e.address]}}get hasMerges(){return de.some(this._merges,Boolean)}unMergeCells(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=new me(t);for(let e=n.top;e<=n.bottom;e++)for(let t=n.left;t<=n.right;t++){const r=this.findCell(e,t);r&&(r.type===ve.ValueType.Merge?this._unMergeMaster(r.master):this._merges[r.address]&&this._unMergeMaster(r))}}fillFormula(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"shared";const i=pe.decode(e),{top:s,left:o,bottom:a,right:l}=i,h=l-o+1,u=pe.encodeAddress(s,o),c="shared"===n;let f;f="function"==typeof r?r:Array.isArray(r)?Array.isArray(r[0])?(e,t)=>r[e-s][t-o]:(e,t)=>r[(e-s)*h+(t-o)]:()=>{};let d=!0;for(let r=s;r<=a;r++)for(let i=o;i<=l;i++)d?(this.getCell(r,i).value={shareType:n,formula:t,ref:e,result:f(r,i)},d=!1):this.getCell(r,i).value=c?{sharedFormula:u,result:f(r,i)}:f(r,i)}addImage(e,t){const r={type:"image",imageId:e,range:t};this._media.push(new _e(this,r))}getImages(){return this._media.filter((e=>"image"===e.type))}addBackgroundImage(e){const t={type:"background",imageId:e};this._media.push(new _e(this,t))}getBackgroundImageId(){const e=this._media.find((e=>"background"===e.type));return e&&e.imageId}protect(e,t){return new Promise((r=>{this.sheetProtection={sheet:!0},t&&"spinCount"in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=xe.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=t&&"spinCount"in t?t.spinCount:1e5,this.sheetProtection.hashValue=xe.convertPasswordToHash(e,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&"spinCount"in t&&delete this.sheetProtection.spinCount),r()}))}unprotect(){this.sheetProtection=null}addTable(e){const t=new be(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){"number"==typeof e?this.conditionalFormattings.splice(e,1):this.conditionalFormattings=e instanceof Function?this.conditionalFormattings.filter(e):[]}get tabColor(){return this.properties.tabColor}set tabColor(e){this.properties.tabColor=e}get model(){const e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((e=>e.model)),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((e=>e.model)),conditionalFormattings:this.conditionalFormattings};e.cols=ye.toModel(this.columns);const t=e.rows=[],r=e.dimensions=new me;return this._rows.forEach((e=>{const n=e&&e.model;n&&(r.expand(n.number,n.min,n.number,n.max),t.push(n))})),e.merges=[],de.each(this._merges,(t=>{e.merges.push(t.range)})),e}_parseRows(e){this._rows=[],e.rows.forEach((e=>{const t=new ge(this,e.number);this._rows[t.number-1]=t,t.model=e}))}_parseMergeCells(e){de.each(e.mergeCells,(e=>{this.mergeCellsWithoutStyle(e)}))}set model(e){this.name=e.name,this._columns=ye.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new we(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map((e=>new _e(this,e))),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce(((e,t)=>{const r=new be;return r.model=t,e[t.name]=r,e}),{}),this.conditionalFormattings=e.conditionalFormattings}};const Ee=k,Te=T;var Ce=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(Te.decodeEx(e))}getCell(e){return this.findCellEx(Te.decodeEx(e),!0)}findCell(e){return this.findCellEx(Te.decodeEx(e),!1)}findCellAt(e,t,r){const n=this.sheets[e],i=n&&n[t];return i&&i[r]}addCellEx(e){if(e.top)for(let t=e.top;t<=e.bottom;t++)for(let r=e.left;r<=e.right;r++)this.getCellAt(e.sheetName,t,r);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){const r=this.findSheet(e,t),n=this.findSheetRow(r,e,t);return this.findRowCell(n,e,t)}getCellAt(e,t,r){const n=this.sheets[e]||(this.sheets[e]=[]),i=n[t]||(n[t]=[]);return i[r]||(i[r]={sheetName:e,address:Te.n2l(r)+t,row:t,col:r})}removeCellEx(e){const t=this.findSheet(e);if(!t)return;const r=this.findSheetRow(t,e);r&&delete r[e.col]}forEachInSheet(e,t){const r=this.sheets[e];r&&r.forEach(((e,r)=>{e&&e.forEach(((e,n)=>{e&&t(e,r,n)}))}))}forEach(e){Ee.each(this.sheets,((t,r)=>{this.forEachInSheet(r,e)}))}map(e){const t=[];return this.forEach((r=>{t.push(e(r))})),t}findSheet(e,t){const r=e.sheetName;return this.sheets[r]?this.sheets[r]:t?this.sheets[r]=[]:void 0}findSheetRow(e,t,r){const{row:n}=t;return e&&e[n]?e[n]:r?e[n]=[]:void 0}findRowCell(e,t,r){const{col:n}=t;return e&&e[n]?e[n]:r?e[n]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t:void 0}spliceRows(e,t,r,n){const i=this.sheets[e];if(i){const e=[];for(let t=0;t<n;t++)e.push([]);i.splice(t,r,...e)}}spliceColumns(e,t,r,n){const i=this.sheets[e];if(i){const e=[];for(let t=0;t<n;t++)e.push(null);Ee.each(i,(n=>{n.splice(t,r,...e)}))}}};const Oe=k,Re=T,Ae=Ce,Ne=O,Ie=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var Pe,Fe,De,je,Me,Le=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new Ae)}add(e,t){const r=Re.decodeEx(e);this.addEx(r,t)}addEx(e,t){const r=this.getMatrix(t);if(e.top)for(let t=e.left;t<=e.right;t++)for(let n=e.top;n<=e.bottom;n++){const i={sheetName:e.sheetName,address:Re.n2l(t)+n,row:n,col:t};r.addCellEx(i)}else r.addCellEx(e)}remove(e,t){const r=Re.decodeEx(e);this.removeEx(r,t)}removeEx(e,t){this.getMatrix(t).removeCellEx(e)}removeAllNames(e){Oe.each(this.matrixMap,(t=>{t.removeCellEx(e)}))}forEach(e){Oe.each(this.matrixMap,((t,r)=>{t.forEach((t=>{e(r,t)}))}))}getNames(e){return this.getNamesEx(Re.decodeEx(e))}getNamesEx(e){return Oe.map(this.matrixMap,((t,r)=>t.findCellEx(e)&&r)).filter(Boolean)}_explore(e,t){t.mark=!1;const{sheetName:r}=t,n=new Ne(t.row,t.col,t.row,t.col,r);let i,s;function o(i,s){const o=e.findCellAt(r,i,t.col);return!(!o||!o.mark)&&(n[s]=i,o.mark=!1,!0)}for(s=t.row-1;o(s,"top");s--);for(s=t.row+1;o(s,"bottom");s++);function a(t,i){const o=[];for(s=n.top;s<=n.bottom;s++){const n=e.findCellAt(r,s,t);if(!n||!n.mark)return!1;o.push(n)}n[i]=t;for(let e=0;e<o.length;e++)o[e].mark=!1;return!0}for(i=t.col-1;a(i,"left");i--);for(i=t.col+1;a(i,"right");i++);return n}getRanges(e,t){if(!(t=t||this.matrixMap[e]))return{name:e,ranges:[]};t.forEach((e=>{e.mark=!0}));const r=t.map((e=>e.mark&&this._explore(t,e))).filter(Boolean).map((e=>e.$shortRange));return{name:e,ranges:r}}normaliseMatrix(e,t){e.forEachInSheet(t,((e,t,r)=>{e&&(e.row===t&&e.col===r||(e.row=t,e.col=r,e.address=Re.n2l(r)+t))}))}spliceRows(e,t,r,n){Oe.each(this.matrixMap,(i=>{i.spliceRows(e,t,r,n),this.normaliseMatrix(i,e)}))}spliceColumns(e,t,r,n){Oe.each(this.matrixMap,(i=>{i.spliceColumns(e,t,r,n),this.normaliseMatrix(i,e)}))}get model(){return Oe.map(this.matrixMap,((e,t)=>this.getRanges(t,e))).filter((e=>e.ranges.length))}set model(e){const t=this.matrixMap={};e.forEach((e=>{const r=t[e.name]=new Ae;e.ranges.forEach((e=>{Ie.test(e.split("!").pop()||"")&&r.addCell(e)}))}))}},Be={},ze={},$e={},He={exports:{}},Ue={exports:{}};function Ve(){if(Pe)return Ue.exports;return Pe=1,"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?Ue.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return process.nextTick((function(){e.apply(null,i)}))}}}:Ue.exports=process,Ue.exports}function We(){return Me?je:(Me=1,je=n)}var qe,Xe={exports:{}};function Ze(){return qe||(qe=1,function(e,t){var r=s,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(Xe,Xe.exports)),Xe.exports}var Ge,Ye={};function Ke(){if(Ge)return Ye;function e(e){return Object.prototype.toString.call(e)}return Ge=1,Ye.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},Ye.isBoolean=function(e){return"boolean"==typeof e},Ye.isNull=function(e){return null===e},Ye.isNullOrUndefined=function(e){return null==e},Ye.isNumber=function(e){return"number"==typeof e},Ye.isString=function(e){return"string"==typeof e},Ye.isSymbol=function(e){return"symbol"==typeof e},Ye.isUndefined=function(e){return void 0===e},Ye.isRegExp=function(t){return"[object RegExp]"===e(t)},Ye.isObject=function(e){return"object"==typeof e&&null!==e},Ye.isDate=function(t){return"[object Date]"===e(t)},Ye.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},Ye.isFunction=function(e){return"function"==typeof e},Ye.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},Ye.isBuffer=s.Buffer.isBuffer,Ye}var Qe,Je,et={exports:{}},tt={exports:{}};function rt(){if(Je)return et.exports;Je=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";et.exports=e.inherits}catch(e){et.exports=(Qe||(Qe=1,"function"==typeof Object.create?tt.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:tt.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),tt.exports)}return et.exports}var nt,it,st,ot,at,lt,ht,ut,ct,ft={exports:{}};function dt(){return nt||(nt=1,function(e){var t=Ze().Buffer,r=o;function n(e,t,r){e.copy(t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return t.alloc(0);for(var r=t.allocUnsafe(e>>>0),i=this.head,s=0;i;)n(i.data,r,s),s+=i.data.length,i=i.next;return r},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})}(ft)),ft.exports}function pt(){if(st)return it;st=1;var e=Ve();function t(e,t){e.emit("error",t)}return it={destroy:function(r,n){var i=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(n?n(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(t,this,r)):e.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(r){!n&&r?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,e.nextTick(t,i,r)):e.nextTick(t,i,r):n&&n(r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}},it}function mt(){return at?ot:(at=1,ot=o.deprecate)}function gt(){if(ht)return lt;ht=1;var e=Ve();function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}lt=d;var r,n=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:e.nextTick;d.WritableState=f;var i=Object.create(Ke());i.inherits=rt();var s={deprecate:mt()},o=We(),a=Ze().Buffer,l=(void 0!==p?p:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,u=pt();function c(){}function f(i,s){r=r||yt(),i=i||{};var o=s instanceof r;this.objectMode=!!i.objectMode,o&&(this.objectMode=this.objectMode||!!i.writableObjectMode);var a=i.highWaterMark,l=i.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:o&&(l||0===l)?l:h,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===i.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=i.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var i=t._writableState,s=i.sync,o=i.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),r)!function(t,r,n,i,s){--r.pendingcb,n?(e.nextTick(s,i),e.nextTick(b,t,r),t._writableState.errorEmitted=!0,t.emit("error",i)):(s(i),t._writableState.errorEmitted=!0,t.emit("error",i),b(t,r))}(t,i,s,r,o);else{var a=v(i);a||i.corked||i.bufferProcessing||!i.bufferedRequest||y(t,i),s?n(g,t,i,a,o):g(t,i,a,o)}}(s,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function d(e){if(r=r||yt(),!(h.call(d,this)||this instanceof r))return new d(e);this._writableState=new f(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function m(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function g(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),b(e,t)}function y(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,s=new Array(i),o=r.corkedRequestsFree;o.entry=n;for(var a=0,l=!0;n;)s[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;s.allBuffers=l,m(e,r,!0,r.length,s,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var h=n.chunk,u=n.encoding,c=n.callback;if(m(e,r,!1,r.objectMode?1:h.length,h,u,c),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),b(e,t)}))}function b(t,r){var n=v(r);return n&&(!function(t,r){r.prefinished||r.finalCalled||("function"==typeof t._final?(r.pendingcb++,r.finalCalled=!0,e.nextTick(_,t,r)):(r.prefinished=!0,t.emit("prefinish")))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"))),n}return i.inherits(d,o),f.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(f.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(d,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===d&&(e&&e._writableState instanceof f)}})):h=function(e){return e instanceof this},d.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},d.prototype.write=function(t,r,n){var i,s=this._writableState,o=!1,h=!s.objectMode&&(i=t,a.isBuffer(i)||i instanceof l);return h&&!a.isBuffer(t)&&(t=function(e){return a.from(e)}(t)),"function"==typeof r&&(n=r,r=null),h?r="buffer":r||(r=s.defaultEncoding),"function"!=typeof n&&(n=c),s.ended?function(t,r){var n=new Error("write after end");t.emit("error",n),e.nextTick(r,n)}(this,n):(h||function(t,r,n,i){var s=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||r.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),e.nextTick(i,o),s=!1),s}(this,s,t,n))&&(s.pendingcb++,o=function(e,t,r,n,i,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=t.objectMode?1:n.length;t.length+=l;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,l,n,i,s);return h}(this,s,h,t,r,n)),o},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||y(this,e))},d.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),d.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},d.prototype._writev=null,d.prototype.end=function(t,r,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),null!=t&&this.write(t,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,r,n){r.ending=!0,b(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n));r.ended=!0,t.writable=!1}(this,i,n)},Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),d.prototype.destroy=u.destroy,d.prototype._undestroy=u.undestroy,d.prototype._destroy=function(e,t){this.end(),t(e)},lt}function yt(){if(ct)return ut;ct=1;var e=Ve(),t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};ut=l;var r=Object.create(Ke());r.inherits=rt();var n=Ot(),i=gt();r.inherits(l,n);for(var s=t(i.prototype),o=0;o<s.length;o++){var a=s[o];l.prototype[a]||(l.prototype[a]=i.prototype[a])}function l(e){if(!(this instanceof l))return new l(e);n.call(this,e),i.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||e.nextTick(u,this)}function u(e){e.end()}return Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(t,r){this.push(null),this.end(),e.nextTick(r,t)},ut}var vt,_t,bt,wt,xt,kt,St,Et,Tt={};function Ct(){if(vt)return Tt;vt=1;var e=Ze().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=s,this.end=o,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=l,n=3;break;default:return this.write=h,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function o(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}return Tt.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var s=n(t[i]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--i<r||-2===s)return 0;if(s=n(t[i]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--i<r||-2===s)return 0;if(s=n(t[i]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Tt}function Ot(){if(bt)return _t;bt=1;var e=Ve();_t=v;var t,r=function(){if(De)return Fe;De=1;var e={}.toString;return Fe=Array.isArray||function(t){return"[object Array]"==e.call(t)}}();v.ReadableState=y,i.EventEmitter;var n=function(e,t){return e.listeners(t).length},s=We(),a=Ze().Buffer,l=(void 0!==p?p:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h=Object.create(Ke());h.inherits=rt();var u=o,c=void 0;c=u&&u.debuglog?u.debuglog("stream"):function(){};var f,d=dt(),m=pt();h.inherits(v,s);var g=["error","close","destroy","pause","resume"];function y(e,r){e=e||{};var n=r instanceof(t=t||yt());this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=Ct().StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function v(e){if(t=t||yt(),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function _(e,t,r,n,i){var s,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,o)):(i||(s=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):b(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?b(e,o,t,!1):E(e,o)):b(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function b(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),E(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},v.prototype.unshift=function(e){return _(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return f||(f=Ct().StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var w=8388608;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=w?e=w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(c("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(S,t):S(t))}function S(e){c("emit readable"),e.emit("readable"),R(e)}function E(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(T,t,r))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(c("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function C(e){c("readable nexttick read 0"),e.read(0)}function O(e,t){t.reading||(c("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function A(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var s=r.data,o=e>s.length?s.length:e;if(o===s.length?i+=s:i+=s.slice(0,e),0===(e-=o)){o===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=a.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,o),0===(e-=o)){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function N(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');r.endEmitted||(r.ended=!0,e.nextTick(I,r,t))}function I(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return v.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):k(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(r,t))),null===(n=e>0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,i){var s=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,i);var a=(!i||!1!==i.end)&&t!==process.stdout&&t!==process.stderr?h:v;function l(e,r){c("onunpipe"),e===s&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",u),t.removeListener("error",m),t.removeListener("unpipe",l),s.removeListener("end",h),s.removeListener("end",v),s.removeListener("data",p),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function h(){c("onend"),t.end()}o.endEmitted?e.nextTick(a):s.once("end",a),t.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,R(e))}}(s);t.on("drain",u);var f=!1;var d=!1;function p(e){c("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!f&&(c("false write response, pause",o.awaitDrain),o.awaitDrain++,d=!0),s.pause())}function m(e){c("onerror",e),v(),t.removeListener("error",m),0===n(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",y),v()}function y(){c("onfinish"),t.removeListener("close",g),v()}function v(){c("unpipe"),s.unpipe(t)}return s.on("data",p),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",m),t.once("close",g),t.once("finish",y),t.emit("pipe",s),o.flowing||(c("pipe resume"),s.resume()),t},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=P(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(t,r){var n=s.prototype.on.call(this,t,r);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&k(this):e.nextTick(C,this))}return n},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!0,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(O,t,r))}(this,t)),this},v.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<g.length;s++)e.on(g[s],this.emit.bind(this,g[s]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=A,_t}function Rt(){if(xt)return wt;xt=1,wt=n;var e=yt(),t=Object.create(Ke());function r(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function n(t){if(!(this instanceof n))return new n(t);e.call(this,t),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",i)}function i(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){s(e,t,r)})):s(this,null,null)}function s(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}return t.inherits=rt(),t.inherits(n,e),n.prototype.push=function(t,r){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,r)},n.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},n.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},n.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},n.prototype._destroy=function(t,r){var n=this;e.prototype._destroy.call(this,t,(function(e){r(e),n.emit("close")}))},wt}function At(){return Et||(Et=1,function(e,t){var r=n;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r,(t=e.exports=r.Readable).Readable=r.Readable,t.Writable=r.Writable,t.Duplex=r.Duplex,t.Transform=r.Transform,t.PassThrough=r.PassThrough,t.Stream=r):((t=e.exports=Ot()).Stream=r||t,t.Readable=t,t.Writable=gt(),t.Duplex=yt(),t.Transform=Rt(),t.PassThrough=function(){if(St)return kt;St=1,kt=r;var e=Rt(),t=Object.create(Ke());function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return t.inherits=rt(),t.inherits(r,e),r.prototype._transform=function(e,t,r){r(null,e)},kt}())}(He,He.exports)),He.exports}if($e.base64=!0,$e.array=!0,$e.string=!0,$e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,$e.nodebuffer="undefined"!=typeof Buffer,$e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)$e.blob=!1;else{var Nt=new ArrayBuffer(0);try{$e.blob=0===new Blob([Nt],{type:"application/zip"}).size}catch(e){try{var It=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);It.append(Nt),$e.blob=0===It.getBlob("application/zip").size}catch(e){$e.blob=!1}}}try{$e.nodestream=!!At().Readable}catch(e){$e.nodestream=!1}var Pt,Ft={};function Dt(){if(Pt)return Ft;Pt=1;var e=Vt(),t=$e,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return Ft.encode=function(t){for(var n,i,s,o,a,l,h,u=[],c=0,f=t.length,d=f,p="string"!==e.getTypeOf(t);c<t.length;)d=f-c,p?(n=t[c++],i=c<f?t[c++]:0,s=c<f?t[c++]:0):(n=t.charCodeAt(c++),i=c<f?t.charCodeAt(c++):0,s=c<f?t.charCodeAt(c++):0),o=n>>2,a=(3&n)<<4|i>>4,l=d>1?(15&i)<<2|s>>6:64,h=d>2?63&s:64,u.push(r.charAt(o)+r.charAt(a)+r.charAt(l)+r.charAt(h));return u.join("")},Ft.decode=function(e){var n,i,s,o,a,l,h=0,u=0,c="data:";if(e.substr(0,5)===c)throw new Error("Invalid base64 input, it looks like a data url.");var f,d=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===r.charAt(64)&&d--,e.charAt(e.length-2)===r.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=t.uint8array?new Uint8Array(0|d):new Array(0|d);h<e.length;)n=r.indexOf(e.charAt(h++))<<2|(o=r.indexOf(e.charAt(h++)))>>4,i=(15&o)<<4|(a=r.indexOf(e.charAt(h++)))>>2,s=(3&a)<<6|(l=r.indexOf(e.charAt(h++))),f[u++]=n,64!==a&&(f[u++]=i),64!==l&&(f[u++]=s);return f},Ft}var jt,Mt,Lt,Bt,zt={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}};var $t=null;$t="undefined"!=typeof Promise?Promise:function(){if(Bt)return Lt;Bt=1;var e=function(){if(Mt)return jt;Mt=1;var e,t,r=p.MutationObserver||p.WebKitMutationObserver;if(process.browser)if(r){var n=0,i=new r(l),s=p.document.createTextNode("");i.observe(s,{characterData:!0}),e=function(){s.data=n=++n%2}}else if(p.setImmediate||void 0===p.MessageChannel)e="document"in p&&"onreadystatechange"in p.document.createElement("script")?function(){var e=p.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},p.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var o=new p.MessageChannel;o.port1.onmessage=l,e=function(){o.port2.postMessage(0)}}else e=function(){process.nextTick(l)};var a=[];function l(){var e,r;t=!0;for(var n=a.length;n;){for(r=a,a=[],e=-1;++e<n;)r[e]();n=a.length}t=!1}return jt=function(r){1!==a.push(r)||t||e()}}();function t(){}var r={},n=["REJECTED"],i=["FULFILLED"],s=["PENDING"];if(!process.browser)var o=["UNHANDLED"];function a(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,process.browser||(this.handled=o),e!==t&&c(this,e)}function l(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(t,n,i){e((function(){var e;try{e=n(i)}catch(e){return r.reject(t,e)}e===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,e)}))}function u(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function c(e,t){var n=!1;function i(t){n||(n=!0,r.reject(e,t))}function s(t){n||(n=!0,r.resolve(e,t))}var o=f((function(){t(s,i)}));"error"===o.status&&i(o.value)}function f(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}return Lt=a,a.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,r){if("function"!=typeof e&&this.state===i||"function"!=typeof r&&this.state===n)return this;var a=new this.constructor(t);return process.browser||this.handled===o&&(this.handled=null),this.state!==s?h(a,this.state===i?e:r,this.outcome):this.queue.push(new l(a,e,r)),a},l.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){r.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},r.resolve=function(e,t){var n=f(u,t);if("error"===n.status)return r.reject(e,n.value);var s=n.value;if(s)c(e,s);else{e.state=i,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},r.reject=function(t,r){t.state=n,t.outcome=r,process.browser||t.handled===o&&e((function(){t.handled===o&&process.emit("unhandledRejection",r,t)}));for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callRejected(r);return t},a.resolve=function(e){return e instanceof this?e:r.resolve(new this(t),e)},a.reject=function(e){var n=new this(t);return r.reject(n,e)},a.all=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,s=!1;if(!i)return this.resolve([]);for(var o=new Array(i),a=0,l=-1,h=new this(t);++l<i;)u(e[l],l);return h;function u(e,t){n.resolve(e).then((function(e){o[t]=e,++a!==i||s||(s=!0,r.resolve(h,o))}),(function(e){s||(s=!0,r.reject(h,e))}))}},a.race=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,s=!1;if(!i)return this.resolve([]);for(var o,a=-1,l=new this(t);++a<i;)o=e[a],n.resolve(o).then((function(e){s||(s=!0,r.resolve(l,e))}),(function(e){s||(s=!0,r.reject(l,e))}));return l},Lt}();var Ht,Ut={Promise:$t};function Vt(){return Ht||(Ht=1,function(e){var t=$e,r=Dt(),n=zt,i=Ut;function s(e){return e}function o(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e.newBlob=function(t,r){e.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var a={stringifyByChunk:function(e,t,r){var n=[],i=0,s=e.length;if(s<=r)return String.fromCharCode.apply(null,e);for(;i<s;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,s)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,s)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return t.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return t.nodebuffer&&1===String.fromCharCode.apply(null,n.allocBuffer(1)).length}catch(e){return!1}}()}};function l(t){var r=65536,n=e.getTypeOf(t),i=!0;if("uint8array"===n?i=a.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=a.applyCanBeUsed.nodebuffer),i)for(;r>1;)try{return a.stringifyByChunk(t,n,r)}catch(e){r=Math.floor(r/2)}return a.stringifyByChar(t)}function h(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}e.applyFromCharCode=l;var u={};u.string={string:s,array:function(e){return o(e,new Array(e.length))},arraybuffer:function(e){return u.string.uint8array(e).buffer},uint8array:function(e){return o(e,new Uint8Array(e.length))},nodebuffer:function(e){return o(e,n.allocBuffer(e.length))}},u.array={string:l,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(e)}},u.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(new Uint8Array(e))}},u.uint8array={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return n.newBufferFrom(e)}},u.nodebuffer={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return u.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:s},e.transformTo=function(t,r){if(r||(r=""),!t)return r;e.checkSupport(t);var n=e.getTypeOf(r);return u[n][t](r)},e.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},e.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":t.nodebuffer&&n.isBuffer(e)?"nodebuffer":t.uint8array&&e instanceof Uint8Array?"uint8array":t.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(e){if(!t[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},e.delay=function(e,t,r){setImmediate((function(){e.apply(r||null,t||[])}))},e.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r},e.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},e.prepareContent=function(n,s,a,l,h){var u=i.Promise.resolve(s).then((function(e){return t.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new i.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e}));return u.then((function(s){var u,c=e.getTypeOf(s);return c?("arraybuffer"===c?s=e.transformTo("uint8array",s):"string"===c&&(h?s=r.decode(s):a&&!0!==l&&(s=o(u=s,t.uint8array?new Uint8Array(u.length):new Array(u.length)))),s):i.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}(ze)),ze}function Wt(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}!function(e,t){if(!e.setImmediate){var r,n,i,s,o,a=1,l={},h=!1,u=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?r=function(e){process.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(n=u.documentElement,r=function(e){var t=u.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}),c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[a]=i,r(a),a++},c.clearImmediate=f}function f(e){delete l[e]}function d(e){if(h)setTimeout(d,0,e);else{var r=l[e];if(r){h=!0;try{!function(e){var r=e.callback,n=e.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(t,n)}}(r)}finally{f(e),h=!1}}}}}("undefined"==typeof self?p:self),Wt.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&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},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 t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(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,t){return this.extraStreamInfo[e]=t,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 qt=Wt;!function(e){for(var t=Vt(),r=$e,n=zt,i=qt,s=new Array(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;s[254]=s[254]=1;function a(){i.call(this,"utf-8 decode"),this.leftOver=null}function l(){i.call(this,"utf-8 encode")}e.utf8encode=function(e){return r.nodebuffer?n.newBufferFrom(e,"utf-8"):function(e){var t,n,i,s,o,a=e.length,l=0;for(s=0;s<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(i-56320),s++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=r.uint8array?new Uint8Array(l):new Array(l),o=0,s=0;o<l;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(i-56320),s++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t}(e)},e.utf8decode=function(e){return r.nodebuffer?t.transformTo("nodebuffer",e).toString("utf-8"):function(e){var r,n,i,o,a=e.length,l=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)l[n++]=i;else if((o=s[i])>4)l[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),t.applyFromCharCode(l)}(e=t.transformTo(r.uint8array?"uint8array":"array",e))},t.inherits(a,i),a.prototype.processChunk=function(n){var i=t.transformTo(r.uint8array?"uint8array":"array",n.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=i;(i=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),i.set(o,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(i),l=i;a!==i.length&&(r.uint8array?(l=i.subarray(0,a),this.leftOver=i.subarray(a,i.length)):(l=i.slice(0,a),this.leftOver=i.slice(a,i.length))),this.push({data:e.utf8decode(l),meta:n.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=a,t.inherits(l,i),l.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=l}(Be);var Xt=qt,Zt=Vt();function Gt(e){Xt.call(this,"ConvertWorker to "+e),this.destType=e}Zt.inherits(Gt,Xt),Gt.prototype.processChunk=function(e){this.push({data:Zt.transformTo(this.destType,e.data),meta:e.meta})};var Yt,Kt,Qt=Gt;var Jt=Vt(),er=Qt,tr=qt,rr=Dt(),nr=Ut,ir=null;if($e.nodestream)try{ir=function(){if(Kt)return Yt;Kt=1;var e=At().Readable;function t(t,r,n){e.call(this,r),this._helper=t;var i=this;t.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}return Vt().inherits(t,e),t.prototype._read=function(){this._helper.resume()},Yt=t}()}catch(e){}function sr(e,t){return new nr.Promise((function(r,n){var i=[],s=e._internalType,o=e._outputType,a=e._mimeType;e.on("data",(function(e,r){i.push(e),t&&t(r)})).on("error",(function(e){i=[],n(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return Jt.newBlob(Jt.transformTo("arraybuffer",t),r);case"base64":return rr.encode(t);default:return Jt.transformTo(e,t)}}(o,function(e,t){var r,n=0,i=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(s),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,i),a);r(e)}catch(e){n(e)}i=[]})).resume()}))}function or(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,Jt.checkSupport(n),this._worker=e.pipe(new er(n)),e.lock()}catch(e){this._worker=new tr("error"),this._worker.error(e)}}or.prototype={accumulate:function(e){return sr(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){Jt.delay(t,arguments,r)})),this},resume:function(){return Jt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Jt.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new ir(this,{objectMode:"nodebuffer"!==this._outputType},e)}};var ar=or,lr={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},hr=Vt(),ur=qt;function cr(e){ur.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=hr.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}hr.inherits(cr,ur),cr.prototype.cleanUp=function(){ur.prototype.cleanUp.call(this),this.data=null},cr.prototype.resume=function(){return!!ur.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,hr.delay(this._tickAndRepeat,[],this)),!0)},cr.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(hr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},cr.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var fr=cr,dr=Vt();var pr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var mr=function(e,t){return void 0!==e&&e.length?"string"!==dr.getTypeOf(e)?function(e,t,r,n){var i=pr,s=n+r;e^=-1;for(var o=n;o<s;o++)e=e>>>8^i[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=pr,s=n+r;e^=-1;for(var o=n;o<s;o++)e=e>>>8^i[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0},gr=qt,yr=mr;function vr(){gr.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Vt().inherits(vr,gr),vr.prototype.processChunk=function(e){this.streamInfo.crc32=yr(e.data,this.streamInfo.crc32||0),this.push(e)};var _r=vr,br=Vt(),wr=qt;function xr(e){wr.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}br.inherits(xr,wr),xr.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}wr.prototype.processChunk.call(this,e)};var kr=Ut,Sr=fr,Er=_r,Tr=xr;function Cr(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}Cr.prototype={getContentWorker:function(){var e=new Sr(kr.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Tr("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new Sr(kr.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},Cr.createWorkerFrom=function(e,t,r){return e.pipe(new Er).pipe(new Tr("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new Tr("compressedSize")).withStreamInfo("compression",t)};var Or=Cr,Rr=ar,Ar=fr,Nr=Be,Ir=Or,Pr=qt,Fr=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};Fr.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new Nr.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new Nr.Utf8DecodeWorker))}catch(e){(t=new Pr("error")).error(e)}return new Rr(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof Ir&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new Nr.Utf8EncodeWorker)),Ir.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof Ir?this._data.getContentWorker():this._data instanceof Pr?this._data:new Ar(this._data)}};for(var Dr=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],jr=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},Mr=0;Mr<Dr.length;Mr++)Fr.prototype[Dr[Mr]]=jr;var Lr=Fr,Br={},zr={},$r={},Hr={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)s=e[t],o.set(s,i),i+=s.length;return o}},i={arraySet:function(e,t,r,n,i){for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(Hr);var Ur={},Vr={},Wr={},qr=Hr,Xr=0,Zr=1;function Gr(e){for(var t=e.length;--t>=0;)e[t]=0}var Yr=0,Kr=29,Qr=256,Jr=Qr+1+Kr,en=30,tn=19,rn=2*Jr+1,nn=15,sn=16,on=7,an=256,ln=16,hn=17,un=18,cn=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],fn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],dn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],mn=new Array(2*(Jr+2));Gr(mn);var gn=new Array(2*en);Gr(gn);var yn=new Array(512);Gr(yn);var vn=new Array(256);Gr(vn);var _n=new Array(Kr);Gr(_n);var bn,wn,xn,kn=new Array(en);function Sn(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function En(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Tn(e){return e<256?yn[e]:yn[256+(e>>>7)]}function Cn(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function On(e,t,r){e.bi_valid>sn-r?(e.bi_buf|=t<<e.bi_valid&65535,Cn(e,e.bi_buf),e.bi_buf=t>>sn-e.bi_valid,e.bi_valid+=r-sn):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Rn(e,t,r){On(e,r[2*t],r[2*t+1])}function An(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function Nn(e,t,r){var n,i,s=new Array(nn+1),o=0;for(n=1;n<=nn;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=An(s[a]++,a))}}function In(e){var t;for(t=0;t<Jr;t++)e.dyn_ltree[2*t]=0;for(t=0;t<en;t++)e.dyn_dtree[2*t]=0;for(t=0;t<tn;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*an]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Pn(e){e.bi_valid>8?Cn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Fn(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function Dn(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&Fn(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Fn(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function jn(e,t,r){var n,i,s,o,a=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],i=e.pending_buf[e.l_buf+a],a++,0===n?Rn(e,i,t):(Rn(e,(s=vn[i])+Qr+1,t),0!==(o=cn[s])&&On(e,i-=_n[s],o),Rn(e,s=Tn(--n),r),0!==(o=fn[s])&&On(e,n-=kn[s],o))}while(a<e.last_lit);Rn(e,an,t)}function Mn(e,t){var r,n,i,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=rn,r=0;r<l;r++)0!==s[2*r]?(e.heap[++e.heap_len]=h=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=o[2*i+1]);for(t.max_code=h,r=e.heap_len>>1;r>=1;r--)Dn(e,s,r);i=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Dn(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,Dn(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,l=t.dyn_tree,h=t.max_code,u=t.stat_desc.static_tree,c=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=nn;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<rn;r++)(s=l[2*l[2*(n=e.heap[r])+1]+1]+1)>p&&(s=p,m++),l[2*n+1]=s,n>h||(e.bl_count[s]++,o=0,n>=d&&(o=f[n-d]),a=l[2*n],e.opt_len+=a*(s+o),c&&(e.static_len+=a*(u[2*n+1]+o)));if(0!==m){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)(i=e.heap[--r])>h||(l[2*i+1]!==s&&(e.opt_len+=(s-l[2*i+1])*l[2*i],l[2*i+1]=s),n--)}}(e,t),Nn(s,h,e.bl_count)}function Ln(e,t,r){var n,i,s=-1,o=t[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++a<l&&i===o||(a<h?e.bl_tree[2*i]+=a:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*ln]++):a<=10?e.bl_tree[2*hn]++:e.bl_tree[2*un]++,a=0,s=i,0===o?(l=138,h=3):i===o?(l=6,h=3):(l=7,h=4))}function Bn(e,t,r){var n,i,s=-1,o=t[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++a<l&&i===o)){if(a<h)do{Rn(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(Rn(e,i,e.bl_tree),a--),Rn(e,ln,e.bl_tree),On(e,a-3,2)):a<=10?(Rn(e,hn,e.bl_tree),On(e,a-3,3)):(Rn(e,un,e.bl_tree),On(e,a-11,7));a=0,s=i,0===o?(l=138,h=3):i===o?(l=6,h=3):(l=7,h=4)}}Gr(kn);var zn=!1;function $n(e,t,r,n){On(e,(Yr<<1)+(n?1:0),3),function(e,t,r,n){Pn(e),n&&(Cn(e,r),Cn(e,~r)),qr.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}Wr._tr_init=function(e){zn||(!function(){var e,t,r,n,i,s=new Array(nn+1);for(r=0,n=0;n<Kr-1;n++)for(_n[n]=r,e=0;e<1<<cn[n];e++)vn[r++]=n;for(vn[r-1]=n,i=0,n=0;n<16;n++)for(kn[n]=i,e=0;e<1<<fn[n];e++)yn[i++]=n;for(i>>=7;n<en;n++)for(kn[n]=i<<7,e=0;e<1<<fn[n]-7;e++)yn[256+i++]=n;for(t=0;t<=nn;t++)s[t]=0;for(e=0;e<=143;)mn[2*e+1]=8,e++,s[8]++;for(;e<=255;)mn[2*e+1]=9,e++,s[9]++;for(;e<=279;)mn[2*e+1]=7,e++,s[7]++;for(;e<=287;)mn[2*e+1]=8,e++,s[8]++;for(Nn(mn,Jr+1,s),e=0;e<en;e++)gn[2*e+1]=5,gn[2*e]=An(e,5);bn=new Sn(mn,cn,Qr+1,Jr,nn),wn=new Sn(gn,fn,0,en,nn),xn=new Sn(new Array(0),dn,0,tn,on)}(),zn=!0),e.l_desc=new En(e.dyn_ltree,bn),e.d_desc=new En(e.dyn_dtree,wn),e.bl_desc=new En(e.bl_tree,xn),e.bi_buf=0,e.bi_valid=0,In(e)},Wr._tr_stored_block=$n,Wr._tr_flush_block=function(e,t,r,n){var i,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return Xr;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Zr;for(t=32;t<Qr;t++)if(0!==e.dyn_ltree[2*t])return Zr;return Xr}(e)),Mn(e,e.l_desc),Mn(e,e.d_desc),o=function(e){var t;for(Ln(e,e.dyn_ltree,e.l_desc.max_code),Ln(e,e.dyn_dtree,e.d_desc.max_code),Mn(e,e.bl_desc),t=tn-1;t>=3&&0===e.bl_tree[2*pn[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?$n(e,t,r,n):4===e.strategy||s===i?(On(e,2+(n?1:0),3),jn(e,mn,gn)):(On(e,4+(n?1:0),3),function(e,t,r,n){var i;for(On(e,t-257,5),On(e,r-1,5),On(e,n-4,4),i=0;i<n;i++)On(e,e.bl_tree[2*pn[i]+1],3);Bn(e,e.dyn_ltree,t-1),Bn(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),jn(e,e.dyn_ltree,e.dyn_dtree)),In(e),n&&Pn(e)},Wr._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(vn[r]+Qr+1)]++,e.dyn_dtree[2*Tn(t)]++),e.last_lit===e.lit_bufsize-1},Wr._tr_align=function(e){On(e,2,3),Rn(e,an,mn),function(e){16===e.bi_valid?(Cn(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var Hn=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(i=i+t[n++]|0)|0}while(--o);i%=65521,s%=65521}return i|s<<16|0};var Un=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var Vn,Wn=function(e,t,r,n){var i=Un,s=n+r;e^=-1;for(var o=n;o<s;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},qn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Xn=Hr,Zn=Wr,Gn=Hn,Yn=Wn,Kn=qn,Qn=0,Jn=4,ei=0,ti=-2,ri=-1,ni=4,ii=2,si=8,oi=9,ai=286,li=30,hi=19,ui=2*ai+1,ci=15,fi=3,di=258,pi=di+fi+1,mi=42,gi=103,yi=113,vi=666,_i=1,bi=2,wi=3,xi=4;function ki(e,t){return e.msg=Kn[t],t}function Si(e){return(e<<1)-(e>4?9:0)}function Ei(e){for(var t=e.length;--t>=0;)e[t]=0}function Ti(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Xn.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Ci(e,t){Zn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ti(e.strm)}function Oi(e,t){e.pending_buf[e.pending++]=t}function Ri(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ai(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-pi?e.strstart-(e.w_size-pi):0,h=e.window,u=e.w_mask,c=e.prev,f=e.strstart+di,d=h[s+o-1],p=h[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(h[(r=t)+o]===p&&h[r+o-1]===d&&h[r]===h[s]&&h[++r]===h[s+1]){s+=2,r++;do{}while(h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&s<f);if(n=di-(f-s),s=f-di,n>o){if(e.match_start=t,o=n,n>=a)break;d=h[s+o-1],p=h[s+o]}}}while((t=c[t&u])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead}function Ni(e){var t,r,n,i,s,o,a,l,h,u,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-pi)){Xn.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,l=e.strstart+e.lookahead,h=i,u=void 0,(u=o.avail_in)>h&&(u=h),r=0===u?0:(o.avail_in-=u,Xn.arraySet(a,o.input,o.next_in,u,l),1===o.state.wrap?o.adler=Gn(o.adler,a,u,l):2===o.state.wrap&&(o.adler=Yn(o.adler,a,u,l)),o.next_in+=u,o.total_in+=u,u),e.lookahead+=r,e.lookahead+e.insert>=fi)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+fi-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<fi)););}while(e.lookahead<pi&&0!==e.strm.avail_in)}function Ii(e,t){for(var r,n;;){if(e.lookahead<pi){if(Ni(e),e.lookahead<pi&&t===Qn)return _i;if(0===e.lookahead)break}if(r=0,e.lookahead>=fi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+fi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-pi&&(e.match_length=Ai(e,r)),e.match_length>=fi)if(n=Zn._tr_tally(e,e.strstart-e.match_start,e.match_length-fi),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=fi){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+fi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Zn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Ci(e,!1),0===e.strm.avail_out))return _i}return e.insert=e.strstart<fi-1?e.strstart:fi-1,t===Jn?(Ci(e,!0),0===e.strm.avail_out?wi:xi):e.last_lit&&(Ci(e,!1),0===e.strm.avail_out)?_i:bi}function Pi(e,t){for(var r,n,i;;){if(e.lookahead<pi){if(Ni(e),e.lookahead<pi&&t===Qn)return _i;if(0===e.lookahead)break}if(r=0,e.lookahead>=fi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+fi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=fi-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-pi&&(e.match_length=Ai(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===fi&&e.strstart-e.match_start>4096)&&(e.match_length=fi-1)),e.prev_length>=fi&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-fi,n=Zn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-fi),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+fi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=fi-1,e.strstart++,n&&(Ci(e,!1),0===e.strm.avail_out))return _i}else if(e.match_available){if((n=Zn._tr_tally(e,0,e.window[e.strstart-1]))&&Ci(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return _i}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Zn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<fi-1?e.strstart:fi-1,t===Jn?(Ci(e,!0),0===e.strm.avail_out?wi:xi):e.last_lit&&(Ci(e,!1),0===e.strm.avail_out)?_i:bi}function Fi(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function Di(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=si,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Xn.Buf16(2*ui),this.dyn_dtree=new Xn.Buf16(2*(2*li+1)),this.bl_tree=new Xn.Buf16(2*(2*hi+1)),Ei(this.dyn_ltree),Ei(this.dyn_dtree),Ei(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xn.Buf16(ci+1),this.heap=new Xn.Buf16(2*ai+1),Ei(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xn.Buf16(2*ai+1),Ei(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ji(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=ii,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?mi:yi,e.adler=2===t.wrap?0:1,t.last_flush=Qn,Zn._tr_init(t),ei):ki(e,ti)}function Mi(e){var t,r=ji(e);return r===ei&&((t=e.state).window_size=2*t.w_size,Ei(t.head),t.max_lazy_match=Vn[t.level].max_lazy,t.good_match=Vn[t.level].good_length,t.nice_match=Vn[t.level].nice_length,t.max_chain_length=Vn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=fi-1,t.match_available=0,t.ins_h=0),r}function Li(e,t,r,n,i,s){if(!e)return ti;var o=1;if(t===ri&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>oi||r!==si||n<8||n>15||t<0||t>9||s<0||s>ni)return ki(e,ti);8===n&&(n=9);var a=new Di;return e.state=a,a.strm=e,a.wrap=o,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+fi-1)/fi),a.window=new Xn.Buf8(2*a.w_size),a.head=new Xn.Buf16(a.hash_size),a.prev=new Xn.Buf16(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Xn.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=t,a.strategy=s,a.method=r,Mi(e)}Vn=[new Fi(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ni(e),0===e.lookahead&&t===Qn)return _i;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ci(e,!1),0===e.strm.avail_out))return _i;if(e.strstart-e.block_start>=e.w_size-pi&&(Ci(e,!1),0===e.strm.avail_out))return _i}return e.insert=0,t===Jn?(Ci(e,!0),0===e.strm.avail_out?wi:xi):(e.strstart>e.block_start&&(Ci(e,!1),e.strm.avail_out),_i)})),new Fi(4,4,8,4,Ii),new Fi(4,5,16,8,Ii),new Fi(4,6,32,32,Ii),new Fi(4,4,16,16,Pi),new Fi(8,16,32,32,Pi),new Fi(8,16,128,128,Pi),new Fi(8,32,128,256,Pi),new Fi(32,128,258,1024,Pi),new Fi(32,258,258,4096,Pi)],Vr.deflateInit=function(e,t){return Li(e,t,si,15,8,0)},Vr.deflateInit2=Li,Vr.deflateReset=Mi,Vr.deflateResetKeep=ji,Vr.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?ti:(e.state.gzhead=t,ei):ti},Vr.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||t>5||t<0)return e?ki(e,ti):ti;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===vi&&t!==Jn)return ki(e,0===e.avail_out?-5:ti);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===mi)if(2===n.wrap)e.adler=0,Oi(n,31),Oi(n,139),Oi(n,8),n.gzhead?(Oi(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Oi(n,255&n.gzhead.time),Oi(n,n.gzhead.time>>8&255),Oi(n,n.gzhead.time>>16&255),Oi(n,n.gzhead.time>>24&255),Oi(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),Oi(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Oi(n,255&n.gzhead.extra.length),Oi(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Yn(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(Oi(n,0),Oi(n,0),Oi(n,0),Oi(n,0),Oi(n,0),Oi(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),Oi(n,3),n.status=yi);else{var o=si+(n.w_bits-8<<4)<<8;o|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=yi,Ri(n,o),0!==n.strstart&&(Ri(n,e.adler>>>16),Ri(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),Ti(e),i=n.pending,n.pending!==n.pending_buf_size));)Oi(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),Ti(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Oi(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),Ti(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Oi(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=Yn(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=gi)}else n.status=gi;if(n.status===gi&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ti(e),n.pending+2<=n.pending_buf_size&&(Oi(n,255&e.adler),Oi(n,e.adler>>8&255),e.adler=0,n.status=yi)):n.status=yi),0!==n.pending){if(Ti(e),0===e.avail_out)return n.last_flush=-1,ei}else if(0===e.avail_in&&Si(t)<=Si(r)&&t!==Jn)return ki(e,-5);if(n.status===vi&&0!==e.avail_in)return ki(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==Qn&&n.status!==vi){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(Ni(e),0===e.lookahead)){if(t===Qn)return _i;break}if(e.match_length=0,r=Zn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ci(e,!1),0===e.strm.avail_out))return _i}return e.insert=0,t===Jn?(Ci(e,!0),0===e.strm.avail_out?wi:xi):e.last_lit&&(Ci(e,!1),0===e.strm.avail_out)?_i:bi}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=di){if(Ni(e),e.lookahead<=di&&t===Qn)return _i;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=fi&&e.strstart>0&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){s=e.strstart+di;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);e.match_length=di-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=fi?(r=Zn._tr_tally(e,1,e.match_length-fi),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Zn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ci(e,!1),0===e.strm.avail_out))return _i}return e.insert=0,t===Jn?(Ci(e,!0),0===e.strm.avail_out?wi:xi):e.last_lit&&(Ci(e,!1),0===e.strm.avail_out)?_i:bi}(n,t):Vn[n.level].func(n,t);if(a!==wi&&a!==xi||(n.status=vi),a===_i||a===wi)return 0===e.avail_out&&(n.last_flush=-1),ei;if(a===bi&&(1===t?Zn._tr_align(n):5!==t&&(Zn._tr_stored_block(n,0,0,!1),3===t&&(Ei(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Ti(e),0===e.avail_out))return n.last_flush=-1,ei}return t!==Jn?ei:n.wrap<=0?1:(2===n.wrap?(Oi(n,255&e.adler),Oi(n,e.adler>>8&255),Oi(n,e.adler>>16&255),Oi(n,e.adler>>24&255),Oi(n,255&e.total_in),Oi(n,e.total_in>>8&255),Oi(n,e.total_in>>16&255),Oi(n,e.total_in>>24&255)):(Ri(n,e.adler>>>16),Ri(n,65535&e.adler)),Ti(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?ei:1)},Vr.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==mi&&69!==t&&73!==t&&91!==t&&t!==gi&&t!==yi&&t!==vi?ki(e,ti):(e.state=null,t===yi?ki(e,-3):ei):ti},Vr.deflateSetDictionary=function(e,t){var r,n,i,s,o,a,l,h,u=t.length;if(!e||!e.state)return ti;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==mi||r.lookahead)return ti;for(1===s&&(e.adler=Gn(e.adler,t,u,0)),r.wrap=0,u>=r.w_size&&(0===s&&(Ei(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new Xn.Buf8(r.w_size),Xn.arraySet(h,t,u-r.w_size,r.w_size,0),t=h,u=r.w_size),o=e.avail_in,a=e.next_in,l=e.input,e.avail_in=u,e.next_in=0,e.input=t,Ni(r);r.lookahead>=fi;){n=r.strstart,i=r.lookahead-(fi-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+fi-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=fi-1,Ni(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=fi-1,r.match_available=0,e.next_in=a,e.input=l,e.avail_in=o,r.wrap=s,ei},Vr.deflateInfo="pako deflate (from Nodeca project)";var Bi={},zi=Hr,$i=!0,Hi=!0;try{String.fromCharCode.apply(null,[0])}catch(e){$i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Hi=!1}for(var Ui=new zi.Buf8(256),Vi=0;Vi<256;Vi++)Ui[Vi]=Vi>=252?6:Vi>=248?5:Vi>=240?4:Vi>=224?3:Vi>=192?2:1;function Wi(e,t){if(t<65534&&(e.subarray&&Hi||!e.subarray&&$i))return String.fromCharCode.apply(null,zi.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Ui[254]=Ui[254]=1,Bi.string2buf=function(e){var t,r,n,i,s,o=e.length,a=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new zi.Buf8(a),s=0,i=0;s<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},Bi.buf2binstring=function(e){return Wi(e,e.length)},Bi.binstring2buf=function(e){for(var t=new zi.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},Bi.buf2string=function(e,t){var r,n,i,s,o=t||e.length,a=new Array(2*o);for(n=0,r=0;r<o;)if((i=e[r++])<128)a[n++]=i;else if((s=Ui[i])>4)a[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&r<o;)i=i<<6|63&e[r++],s--;s>1?a[n++]=65533:i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|1023&i)}return Wi(a,n)},Bi.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Ui[e[r]]>t?r:t};var qi=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Xi=Vr,Zi=Hr,Gi=Bi,Yi=qn,Ki=qi,Qi=Object.prototype.toString,Ji=0,es=-1,ts=0,rs=8;function ns(e){if(!(this instanceof ns))return new ns(e);this.options=Zi.assign({level:es,method:rs,chunkSize:16384,windowBits:15,memLevel:8,strategy:ts,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ki,this.strm.avail_out=0;var r=Xi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ji)throw new Error(Yi[r]);if(t.header&&Xi.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?Gi.string2buf(t.dictionary):"[object ArrayBuffer]"===Qi.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=Xi.deflateSetDictionary(this.strm,n))!==Ji)throw new Error(Yi[r]);this._dict_set=!0}}function is(e,t){var r=new ns(t);if(r.push(e,!0),r.err)throw r.msg||Yi[r.err];return r.result}ns.prototype.push=function(e,t){var r,n,i=this.strm,s=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=Gi.string2buf(e):"[object ArrayBuffer]"===Qi.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Zi.Buf8(s),i.next_out=0,i.avail_out=s),1!==(r=Xi.deflate(i,n))&&r!==Ji)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(Gi.buf2binstring(Zi.shrinkBuf(i.output,i.next_out))):this.onData(Zi.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=Xi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ji):2!==n||(this.onEnd(Ji),i.avail_out=0,!0)},ns.prototype.onData=function(e){this.chunks.push(e)},ns.prototype.onEnd=function(e){e===Ji&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Zi.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Ur.Deflate=ns,Ur.deflate=is,Ur.deflateRaw=function(e,t){return(t=t||{}).raw=!0,is(e,t)},Ur.gzip=function(e,t){return(t=t||{}).gzip=!0,is(e,t)};var ss={},os={},as=Hr,ls=15,hs=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],us=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],cs=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],fs=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],ds=Hr,ps=Hn,ms=Wn,gs=function(e,t){var r,n,i,s,o,a,l,h,u,c,f,d,p,m,g,y,v,_,b,w,x,k,S,E,T;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),s=e.next_out,T=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=r.dmax,h=r.wsize,u=r.whave,c=r.wnext,f=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,y=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),_=m[d&y];t:for(;;){if(d>>>=b=_>>>24,p-=b,0===(b=_>>>16&255))T[s++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=m[(65535&_)+(d&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&_,(b&=15)&&(p<b&&(d+=E[n++]<<p,p+=8),w+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),_=g[d&v];r:for(;;){if(d>>>=b=_>>>24,p-=b,!(16&(b=_>>>16&255))){if(0==(64&b)){_=g[(65535&_)+(d&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(x=65535&_,p<(b&=15)&&(d+=E[n++]<<p,(p+=8)<b&&(d+=E[n++]<<p,p+=8)),(x+=d&(1<<b)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=b,p-=b,x>(b=s-o)){if((b=x-b)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,S=f,0===c){if(k+=h-b,b<w){w-=b;do{T[s++]=f[k++]}while(--b);k=s-x,S=T}}else if(c<b){if(k+=h+c-b,(b-=c)<w){w-=b;do{T[s++]=f[k++]}while(--b);if(k=0,c<w){w-=b=c;do{T[s++]=f[k++]}while(--b);k=s-x,S=T}}}else if(k+=c-b,b<w){w-=b;do{T[s++]=f[k++]}while(--b);k=s-x,S=T}for(;w>2;)T[s++]=S[k++],T[s++]=S[k++],T[s++]=S[k++],w-=3;w&&(T[s++]=S[k++],w>1&&(T[s++]=S[k++]))}else{k=s-x;do{T[s++]=T[k++],T[s++]=T[k++],T[s++]=T[k++],w-=3}while(w>2);w&&(T[s++]=T[k++],w>1&&(T[s++]=T[k++]))}break}}break}}while(n<i&&s<a);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<a?a-s+257:257-(s-a),r.hold=d,r.bits=p},ys=function(e,t,r,n,i,s,o,a){var l,h,u,c,f,d,p,m,g,y=a.bits,v=0,_=0,b=0,w=0,x=0,k=0,S=0,E=0,T=0,C=0,O=null,R=0,A=new as.Buf16(16),N=new as.Buf16(16),I=null,P=0;for(v=0;v<=ls;v++)A[v]=0;for(_=0;_<n;_++)A[t[r+_]]++;for(x=y,w=ls;w>=1&&0===A[w];w--);if(x>w&&(x=w),0===w)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(b=1;b<w&&0===A[b];b++);for(x<b&&(x=b),E=1,v=1;v<=ls;v++)if(E<<=1,(E-=A[v])<0)return-1;if(E>0&&(0===e||1!==w))return-1;for(N[1]=0,v=1;v<ls;v++)N[v+1]=N[v]+A[v];for(_=0;_<n;_++)0!==t[r+_]&&(o[N[t[r+_]]++]=_);if(0===e?(O=I=o,d=19):1===e?(O=hs,R-=257,I=us,P-=257,d=256):(O=cs,I=fs,d=-1),C=0,_=0,v=b,f=s,k=x,S=0,u=-1,c=(T=1<<x)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){p=v-S,o[_]<d?(m=0,g=o[_]):o[_]>d?(m=I[P+o[_]],g=O[R+o[_]]):(m=96,g=0),l=1<<v-S,b=h=1<<k;do{i[f+(C>>S)+(h-=l)]=p<<24|m<<16|g|0}while(0!==h);for(l=1<<v-1;C&l;)l>>=1;if(0!==l?(C&=l-1,C+=l):C=0,_++,0==--A[v]){if(v===w)break;v=t[r+o[_]]}if(v>x&&(C&c)!==u){for(0===S&&(S=x),f+=b,E=1<<(k=v-S);k+S<w&&!((E-=A[k+S])<=0);)k++,E<<=1;if(T+=1<<k,1===e&&T>852||2===e&&T>592)return 1;i[u=C&c]=x<<24|k<<16|f-s|0}}return 0!==C&&(i[f+C]=v-S<<24|64<<16|0),a.bits=x,0},vs=1,_s=2,bs=0,ws=-2,xs=1,ks=12,Ss=30,Es=852,Ts=592;function Cs(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Os(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ds.Buf16(320),this.work=new ds.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Rs(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=xs,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ds.Buf32(Es),t.distcode=t.distdyn=new ds.Buf32(Ts),t.sane=1,t.back=-1,bs):ws}function As(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,Rs(e)):ws}function Ns(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ws:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,As(e))):ws}function Is(e,t){var r,n;return e?(n=new Os,e.state=n,n.window=null,(r=Ns(e,t))!==bs&&(e.state=null),r):ws}var Ps,Fs,Ds=!0;function js(e){if(Ds){var t;for(Ps=new ds.Buf32(512),Fs=new ds.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ys(vs,e.lens,0,288,Ps,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ys(_s,e.lens,0,32,Fs,0,e.work,{bits:5}),Ds=!1}e.lencode=Ps,e.lenbits=9,e.distcode=Fs,e.distbits=5}function Ms(e,t,r,n){var i,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new ds.Buf8(s.wsize)),n>=s.wsize?(ds.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((i=s.wsize-s.wnext)>n&&(i=n),ds.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(ds.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}os.inflateReset=As,os.inflateReset2=Ns,os.inflateResetKeep=Rs,os.inflateInit=function(e){return Is(e,15)},os.inflateInit2=Is,os.inflate=function(e,t){var r,n,i,s,o,a,l,h,u,c,f,d,p,m,g,y,v,_,b,w,x,k,S,E,T=0,C=new ds.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ws;(r=e.state).mode===ks&&(r.mode=13),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,h=r.hold,u=r.bits,c=a,f=l,k=bs;e:for(;;)switch(r.mode){case xs:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(2&r.wrap&&35615===h){r.check=0,C[0]=255&h,C[1]=h>>>8&255,r.check=ms(r.check,C,2,0),h=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=Ss;break}if(8!=(15&h)){e.msg="unknown compression method",r.mode=Ss;break}if(u-=4,x=8+(15&(h>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=Ss;break}r.dmax=1<<x,e.adler=r.check=1,r.mode=512&h?10:ks,h=0,u=0;break;case 2:for(;u<16;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(r.flags=h,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=Ss;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Ss;break}r.head&&(r.head.text=h>>8&1),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ms(r.check,C,2,0)),h=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.head&&(r.head.time=h),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,r.check=ms(r.check,C,4,0)),h=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.head&&(r.head.xflags=255&h,r.head.os=h>>8),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ms(r.check,C,2,0)),h=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.length=h,r.head&&(r.head.extra_len=h),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ms(r.check,C,2,0)),h=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>a&&(d=a),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ds.arraySet(r.head.extra,n,s,d,x)),512&r.flags&&(r.check=ms(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;d=0;do{x=n[s+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<a);if(512&r.flags&&(r.check=ms(r.check,n,d,s)),a-=d,s+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===a)break e;d=0;do{x=n[s+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<a);if(512&r.flags&&(r.check=ms(r.check,n,d,s)),a-=d,s+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(h!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Ss;break}h=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=ks;break;case 10:for(;u<32;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}e.adler=r.check=Cs(h),h=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=l,e.next_in=s,e.avail_in=a,r.hold=h,r.bits=u,2;e.adler=r.check=1,r.mode=ks;case ks:if(5===t||6===t)break e;case 13:if(r.last){h>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}switch(r.last=1&h,u-=1,3&(h>>>=1)){case 0:r.mode=14;break;case 1:if(js(r),r.mode=20,6===t){h>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=Ss}h>>>=2,u-=2;break;case 14:for(h>>>=7&u,u-=7&u;u<32;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ss;break}if(r.length=65535&h,h=0,u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>a&&(d=a),d>l&&(d=l),0===d)break e;ds.arraySet(i,n,s,d,o),a-=d,s+=d,l-=d,o+=d,r.length-=d;break}r.mode=ks;break;case 17:for(;u<14;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(r.nlen=257+(31&h),h>>>=5,u-=5,r.ndist=1+(31&h),h>>>=5,u-=5,r.ncode=4+(15&h),h>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ss;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.lens[O[r.have++]]=7&h,h>>>=3,u-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},k=ys(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,k){e.msg="invalid code lengths set",r.mode=Ss;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(T=r.lencode[h&(1<<r.lenbits)-1])>>>16&255,v=65535&T,!((g=T>>>24)<=u);){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(v<16)h>>>=g,u-=g,r.lens[r.have++]=v;else{if(16===v){for(E=g+2;u<E;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(h>>>=g,u-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Ss;break}x=r.lens[r.have-1],d=3+(3&h),h>>>=2,u-=2}else if(17===v){for(E=g+3;u<E;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}u-=g,x=0,d=3+(7&(h>>>=g)),h>>>=3,u-=3}else{for(E=g+7;u<E;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}u-=g,x=0,d=11+(127&(h>>>=g)),h>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ss;break}for(;d--;)r.lens[r.have++]=x}}if(r.mode===Ss)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Ss;break}if(r.lenbits=9,S={bits:r.lenbits},k=ys(vs,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,k){e.msg="invalid literal/lengths set",r.mode=Ss;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},k=ys(_s,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,k){e.msg="invalid distances set",r.mode=Ss;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=s,e.avail_in=a,r.hold=h,r.bits=u,gs(e,f),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,h=r.hold,u=r.bits,r.mode===ks&&(r.back=-1);break}for(r.back=0;y=(T=r.lencode[h&(1<<r.lenbits)-1])>>>16&255,v=65535&T,!((g=T>>>24)<=u);){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(y&&0==(240&y)){for(_=g,b=y,w=v;y=(T=r.lencode[w+((h&(1<<_+b)-1)>>_)])>>>16&255,v=65535&T,!(_+(g=T>>>24)<=u);){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}h>>>=_,u-=_,r.back+=_}if(h>>>=g,u-=g,r.back+=g,r.length=v,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=ks;break}if(64&y){e.msg="invalid literal/length code",r.mode=Ss;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(E=r.extra;u<E;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(T=r.distcode[h&(1<<r.distbits)-1])>>>16&255,v=65535&T,!((g=T>>>24)<=u);){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(0==(240&y)){for(_=g,b=y,w=v;y=(T=r.distcode[w+((h&(1<<_+b)-1)>>_)])>>>16&255,v=65535&T,!(_+(g=T>>>24)<=u);){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}h>>>=_,u-=_,r.back+=_}if(h>>>=g,u-=g,r.back+=g,64&y){e.msg="invalid distance code",r.mode=Ss;break}r.offset=v,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(E=r.extra;u<E;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ss;break}r.mode=25;case 25:if(0===l)break e;if(d=f-l,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ss;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>l&&(d=l),l-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===l)break e;i[o++]=r.length,l--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===a)break e;a--,h|=n[s++]<<u,u+=8}if(f-=l,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?ms(r.check,i,f,o-f):ps(r.check,i,f,o-f)),f=l,(r.flags?h:Cs(h))!==r.check){e.msg="incorrect data check",r.mode=Ss;break}h=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===a)break e;a--,h+=n[s++]<<u,u+=8}if(h!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Ss;break}h=0,u=0}r.mode=29;case 29:k=1;break e;case Ss:k=-3;break e;case 31:return-4;default:return ws}return e.next_out=o,e.avail_out=l,e.next_in=s,e.avail_in=a,r.hold=h,r.bits=u,(r.wsize||f!==e.avail_out&&r.mode<Ss&&(r.mode<27||4!==t))&&Ms(e,e.output,e.next_out,f-e.avail_out),c-=e.avail_in,f-=e.avail_out,e.total_in+=c,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?ms(r.check,i,f,e.next_out-f):ps(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===ks?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===f||4===t)&&k===bs&&(k=-5),k},os.inflateEnd=function(e){if(!e||!e.state)return ws;var t=e.state;return t.window&&(t.window=null),e.state=null,bs},os.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?ws:(r.head=t,t.done=!1,bs):ws},os.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ws:11===r.mode&&ps(1,t,n,0)!==r.check?-3:Ms(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,bs):ws},os.inflateInfo="pako inflate (from Nodeca project)";var Ls={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var Bs=os,zs=Hr,$s=Bi,Hs=Ls,Us=qn,Vs=qi,Ws=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},qs=Object.prototype.toString;function Xs(e){if(!(this instanceof Xs))return new Xs(e);this.options=zs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vs,this.strm.avail_out=0;var r=Bs.inflateInit2(this.strm,t.windowBits);if(r!==Hs.Z_OK)throw new Error(Us[r]);if(this.header=new Ws,Bs.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=$s.string2buf(t.dictionary):"[object ArrayBuffer]"===qs.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Bs.inflateSetDictionary(this.strm,t.dictionary))!==Hs.Z_OK))throw new Error(Us[r])}function Zs(e,t){var r=new Xs(t);if(r.push(e,!0),r.err)throw r.msg||Us[r.err];return r.result}Xs.prototype.push=function(e,t){var r,n,i,s,o,a=this.strm,l=this.options.chunkSize,h=this.options.dictionary,u=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?Hs.Z_FINISH:Hs.Z_NO_FLUSH,"string"==typeof e?a.input=$s.binstring2buf(e):"[object ArrayBuffer]"===qs.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new zs.Buf8(l),a.next_out=0,a.avail_out=l),(r=Bs.inflate(a,Hs.Z_NO_FLUSH))===Hs.Z_NEED_DICT&&h&&(r=Bs.inflateSetDictionary(this.strm,h)),r===Hs.Z_BUF_ERROR&&!0===u&&(r=Hs.Z_OK,u=!1),r!==Hs.Z_STREAM_END&&r!==Hs.Z_OK)return this.onEnd(r),this.ended=!0,!1;a.next_out&&(0!==a.avail_out&&r!==Hs.Z_STREAM_END&&(0!==a.avail_in||n!==Hs.Z_FINISH&&n!==Hs.Z_SYNC_FLUSH)||("string"===this.options.to?(i=$s.utf8border(a.output,a.next_out),s=a.next_out-i,o=$s.buf2string(a.output,i),a.next_out=s,a.avail_out=l-s,s&&zs.arraySet(a.output,a.output,i,s,0),this.onData(o)):this.onData(zs.shrinkBuf(a.output,a.next_out)))),0===a.avail_in&&0===a.avail_out&&(u=!0)}while((a.avail_in>0||0===a.avail_out)&&r!==Hs.Z_STREAM_END);return r===Hs.Z_STREAM_END&&(n=Hs.Z_FINISH),n===Hs.Z_FINISH?(r=Bs.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Hs.Z_OK):n!==Hs.Z_SYNC_FLUSH||(this.onEnd(Hs.Z_OK),a.avail_out=0,!0)},Xs.prototype.onData=function(e){this.chunks.push(e)},Xs.prototype.onEnd=function(e){e===Hs.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},ss.Inflate=Xs,ss.inflate=Zs,ss.inflateRaw=function(e,t){return(t=t||{}).raw=!0,Zs(e,t)},ss.ungzip=Zs;var Gs={};(0,Hr.assign)(Gs,Ur,ss,Ls);var Ys="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,Ks=Gs,Qs=Vt(),Js=qt,eo=Ys?"uint8array":"array";function to(e,t){Js.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}$r.magic="\b\0",Qs.inherits(to,Js),to.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Qs.transformTo(eo,e.data),!1)},to.prototype.flush=function(){Js.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},to.prototype.cleanUp=function(){Js.prototype.cleanUp.call(this),this._pako=null},to.prototype._createPako=function(){this._pako=new Ks[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},$r.compressWorker=function(e){return new to("Deflate",e)},$r.uncompressWorker=function(){return new to("Inflate",{})};var ro=qt;zr.STORE={magic:"\0\0",compressWorker:function(){return new ro("STORE compression")},uncompressWorker:function(){return new ro("STORE decompression")}},zr.DEFLATE=$r;var no={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},io=Vt(),so=qt,oo=Be,ao=mr,lo=no,ho=function(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n},uo=function(e,t,r,n,i,s){var o,a,l=e.file,h=e.compression,u=s!==oo.utf8encode,c=io.transformTo("string",s(l.name)),f=io.transformTo("string",oo.utf8encode(l.name)),d=l.comment,p=io.transformTo("string",s(d)),m=io.transformTo("string",oo.utf8encode(d)),g=f.length!==l.name.length,y=m.length!==d.length,v="",_="",b="",w=l.dir,x=l.date,k={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(k.crc32=e.crc32,k.compressedSize=e.compressedSize,k.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),u||!g&&!y||(S|=2048);var E,T,C,O=0,R=0;w&&(O|=16),"UNIX"===i?(R=798,O|=(E=l.unixPermissions,T=w,C=E,E||(C=T?16893:33204),(65535&C)<<16)):(R=20,O|=63&(l.dosPermissions||0)),o=x.getUTCHours(),o<<=6,o|=x.getUTCMinutes(),o<<=5,o|=x.getUTCSeconds()/2,a=x.getUTCFullYear()-1980,a<<=4,a|=x.getUTCMonth()+1,a<<=5,a|=x.getUTCDate(),g&&(_=ho(1,1)+ho(ao(c),4)+f,v+="up"+ho(_.length,2)+_),y&&(b=ho(1,1)+ho(ao(p),4)+m,v+="uc"+ho(b.length,2)+b);var A="";return A+="\n\0",A+=ho(S,2),A+=h.magic,A+=ho(o,2),A+=ho(a,2),A+=ho(k.crc32,4),A+=ho(k.compressedSize,4),A+=ho(k.uncompressedSize,4),A+=ho(c.length,2),A+=ho(v.length,2),{fileRecord:lo.LOCAL_FILE_HEADER+A+c+v,dirRecord:lo.CENTRAL_FILE_HEADER+ho(R,2)+A+ho(p.length,2)+"\0\0\0\0"+ho(O,4)+ho(n,4)+c+v+p}},co=function(e){return lo.DATA_DESCRIPTOR+ho(e.crc32,4)+ho(e.compressedSize,4)+ho(e.uncompressedSize,4)};function fo(e,t,r,n){so.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}io.inherits(fo,so),fo.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,so.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},fo.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=uo(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},fo.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=uo(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:co(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},fo.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,i){var s=io.transformTo("string",i(n));return lo.CENTRAL_DIRECTORY_END+"\0\0\0\0"+ho(e,2)+ho(e,2)+ho(t,4)+ho(r,4)+ho(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},fo.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},fo.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},fo.prototype.resume=function(){return!!so.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},fo.prototype.error=function(e){var t=this._sources;if(!so.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},fo.prototype.lock=function(){so.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};var po=zr,mo=fo;Br.generateWorker=function(e,t,r){var n=new mo(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach((function(e,r){i++;var s=function(e,t){var r=e||t,n=po[r];if(!n)throw new Error(r+" is not a valid compression method !");return n}(r.options.compression,t.compression),o=r.options.compressionOptions||t.compressionOptions||{},a=r.dir,l=r.date;r._compressWorker(s,o).withStreamInfo("file",{name:e,dir:a,date:l,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)})),n.entriesCount=i}catch(e){n.error(e)}return n};var go=Vt(),yo=qt;function vo(e,t){yo.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}go.inherits(vo,yo),vo.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},vo.prototype.pause=function(){return!!yo.prototype.pause.call(this)&&(this._stream.pause(),!0)},vo.prototype.resume=function(){return!!yo.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};var _o=vo,bo=Be,wo=Vt(),xo=qt,ko=ar,So=lr,Eo=Or,To=Lr,Co=Br,Oo=zt,Ro=_o,Ao=function(e,t,r){var n,i=wo.getTypeOf(t),s=wo.extend(r||{},So);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=Io(e)),s.createFolders&&(n=No(e))&&Po.call(this,n,!0);var o="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!o),(t instanceof Eo&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var a=null;a=t instanceof Eo||t instanceof xo?t:Oo.isNode&&Oo.isStream(t)?new Ro(e,t):wo.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var l=new To(e,a,s);this.files[e]=l},No=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Io=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},Po=function(e,t){return t=void 0!==t?t:So.createFolders,e=Io(e),this.files[e]||Ao.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Fo(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Do={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1===arguments.length){if(Fo(e)){var n=e;return this.filter((function(e,t){return!t.dir&&n.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,Ao.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(Fo(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=Po.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=wo.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:bo.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");wo.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=Co.generateWorker(this,r,n)}catch(e){(t=new xo("error")).error(e)}return new ko(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}},jo=Do,Mo=Vt();function Lo(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Lo.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return Mo.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var Bo=Lo,zo=Bo;function $o(e){zo.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}Vt().inherits($o,zo),$o.prototype.byteAt=function(e){return this.data[this.zero+e]},$o.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===t&&this.data[s+1]===r&&this.data[s+2]===n&&this.data[s+3]===i)return s-this.zero;return-1},$o.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&r===s[1]&&n===s[2]&&i===s[3]},$o.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ho=$o,Uo=Bo;function Vo(e){Uo.call(this,e)}Vt().inherits(Vo,Uo),Vo.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Vo.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Vo.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Vo.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Wo=Vo,qo=Ho;function Xo(e){qo.call(this,e)}Vt().inherits(Xo,qo),Xo.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Zo=Xo,Go=Zo;function Yo(e){Go.call(this,e)}Vt().inherits(Yo,Go),Yo.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ko=Yo,Qo=Vt(),Jo=$e,ea=Ho,ta=Wo,ra=Ko,na=Zo,ia=function(e){var t=Qo.getTypeOf(e);return Qo.checkSupport(t),"string"!==t||Jo.uint8array?"nodebuffer"===t?new ra(e):Jo.uint8array?new na(Qo.transformTo("uint8array",e)):new ea(Qo.transformTo("array",e)):new ta(e)},sa=ia,oa=Vt(),aa=Or,la=mr,ha=Be,ua=zr,ca=$e;function fa(e,t){this.options=e,this.loadOptions=t}fa.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=function(e){for(var t in ua)if(Object.prototype.hasOwnProperty.call(ua,t)&&ua[t].magic===e)return ua[t];return null}(this.compressionMethod),null===t)throw new Error("Corrupted zip : compression "+oa.pretty(this.compressionMethod)+" unknown (inner file : "+oa.transformTo("string",this.fileName)+")");this.decompressed=new aa(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=sa(this.extraFields[1].value);this.uncompressedSize===oa.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===oa.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===oa.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===oa.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=ca.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=ha.utf8decode(this.fileName),this.fileCommentStr=ha.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=oa.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=oa.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=sa(e.value);return 1!==t.readInt(1)||la(this.fileName)!==t.readInt(4)?null:ha.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=sa(e.value);return 1!==t.readInt(1)||la(this.fileComment)!==t.readInt(4)?null:ha.utf8decode(t.readData(e.length-5))}return null}};var da=fa,pa=ia,ma=Vt(),ga=no,ya=da,va=$e;function _a(e){this.files=[],this.loadOptions=e}_a.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+ma.pretty(t)+", expected "+ma.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=va.uint8array?"uint8array":"array",r=ma.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(ga.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(ga.CENTRAL_FILE_HEADER);)(e=new ya({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(ga.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,ga.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(ga.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===ma.MAX_VALUE_16BITS||this.diskWithCentralDirStart===ma.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===ma.MAX_VALUE_16BITS||this.centralDirRecords===ma.MAX_VALUE_16BITS||this.centralDirSize===ma.MAX_VALUE_32BITS||this.centralDirOffset===ma.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(ga.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(ga.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,ga.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(ga.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(ga.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(n>0)this.isSignature(t,ga.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=pa(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var ba=_a,wa=Vt(),xa=Ut,ka=Be,Sa=ba,Ea=_r,Ta=zt;function Ca(e){return new xa.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new Ea);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function Oa(){if(!(this instanceof Oa))return new Oa;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new Oa;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}Oa.prototype=jo,Oa.prototype.loadAsync=function(e,t){var r=this;return t=wa.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:ka.utf8decode}),Ta.isNode&&Ta.isStream(e)?xa.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):wa.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new Sa(t);return r.load(e),r})).then((function(e){var r=[xa.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i<n.length;i++)r.push(Ca(n[i]));return xa.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,s=0;s<i.length;s++){var o=i[s],a=o.fileNameStr,l=wa.resolve(o.fileNameStr);r.file(l,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(r.file(l).unsafeOriginalName=a)}return n.zipComment.length&&(r.comment=n.zipComment),r}))},Oa.support=$e,Oa.defaults=lr,Oa.version="3.10.1",Oa.loadAsync=function(e,t){return(new Oa).loadAsync(e,t)},Oa.external=Ut;var Ra,Aa,Na,Ia,Pa,Fa,Da=Oa,ja={exports:{}};function Ma(){return Aa?Ra:(Aa=1,Ra=n)}function La(){if(Ia)return Na;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}Ia=1;var a=s.Buffer,l=o.inspect,h=l&&l.custom||"inspect";function u(e,t,r){a.prototype.copy.call(e,t,r)}return Na=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var r,i,s;return r=e,i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)u(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0==(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:h,value:function(e,r){return l(this,t(t({},r),{},{depth:0,customInspect:!1}))}}],i&&n(r.prototype,i),s&&n(r,s),Object.defineProperty(r,"prototype",{writable:!1}),e}(),Na}function Ba(){if(Fa)return Pa;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return Fa=1,Pa={destroy:function(n,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!i&&r?s._writableState?s._writableState.errorEmitted?process.nextTick(t,s):(s._writableState.errorEmitted=!0,process.nextTick(e,s,r)):process.nextTick(e,s,r):i?(process.nextTick(t,s),i(r)):process.nextTick(t,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},Pa}var za,$a,Ha,Ua,Va,Wa,qa,Xa={};function Za(){if(za)return Xa;za=1;const e={};function t(t,r,n){n||(n=Error);class i extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function r(e,t){if(Array.isArray(e)){const r=e.length;return e=e.map((e=>String(e))),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}return t("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,t,n){let i;var s,o;let a;if("string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${i} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${i} ${r(t,"type")}`}return a+=". Received type "+typeof n,a}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Xa.codes=e,Xa}function Ga(){if(Ha)return $a;Ha=1;var e=Za().codes.ERR_INVALID_OPT_VALUE;return $a={getHighWaterMark:function(t,r,n,i){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new e(i?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}}function Ya(){if(Va)return Ua;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var t;Va=1,Ua=k,k.WritableState=x;var r={deprecate:mt()},n=Ma(),i=s.Buffer,o=(void 0!==p?p:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,l=Ba(),h=Ga().getHighWaterMark,u=Za().codes,c=u.ERR_INVALID_ARG_TYPE,f=u.ERR_METHOD_NOT_IMPLEMENTED,d=u.ERR_MULTIPLE_CALLBACK,m=u.ERR_STREAM_CANNOT_PIPE,g=u.ERR_STREAM_DESTROYED,y=u.ERR_STREAM_NULL_VALUES,v=u.ERR_STREAM_WRITE_AFTER_END,_=u.ERR_UNKNOWN_ENCODING,b=l.errorOrDestroy;function w(){}function x(r,n,i){t=t||Ka(),r=r||{},"boolean"!=typeof i&&(i=n instanceof t),this.objectMode=!!r.objectMode,i&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=h(this,r,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===r.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new d;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(R,e,t),e._writableState.errorEmitted=!0,b(e,n)):(i(n),e._writableState.errorEmitted=!0,b(e,n),R(e,t))}(e,r,n,t,i);else{var s=C(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?process.nextTick(E,e,r,s,i):E(e,r,s,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function k(e){var r=this instanceof(t=t||Ka());if(!r&&!a.call(k,this))return new k(e);this._writableState=new x(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function S(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function E(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function T(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var i=r.bufferedRequestCount,s=new Array(i),o=r.corkedRequestsFree;o.entry=n;for(var a=0,l=!0;n;)s[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;s.allBuffers=l,S(t,r,!0,r.length,s,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var h=n.chunk,u=n.encoding,c=n.callback;if(S(t,r,!1,r.objectMode?1:h.length,h,u,c),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=C(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return rt()(k,n),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===k&&(e&&e._writableState instanceof x)}})):a=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new m)},k.prototype.write=function(e,t,r){var n,s=this._writableState,a=!1,l=!s.objectMode&&(n=e,i.isBuffer(n)||n instanceof o);return l&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof t&&(r=t,t=null),l?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof r&&(r=w),s.ending?function(e,t){var r=new v;b(e,r),process.nextTick(t,r)}(this,r):(l||function(e,t,r,n){var i;return null===r?i=new y:"string"==typeof r||t.objectMode||(i=new c("chunk",["string","Buffer"],r)),!i||(b(e,i),process.nextTick(n,i),!1)}(this,s,e,r))&&(s.pendingcb++,a=function(e,t,r,n,s,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=i.from(t,r));return t}(t,n,s);n!==a&&(r=!0,s="buffer",n=a)}var l=t.objectMode?1:n.length;t.length+=l;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,l,n,s,o);return h}(this,s,l,e,t,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new f("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(e,t){t(e)},Ua}function Ka(){if(qa)return Wa;qa=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Wa=o;var t=bl(),r=Ya();rt()(o,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(e){if(!(this instanceof o))return new o(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Wa}var Qa,Ja,el,tl,rl,nl,il,sl,ol,al,ll,hl,ul,cl,fl,dl,pl={},ml={exports:{}};function gl(){if(Ja)return pl;Ja=1;var e=(Qa||(Qa=1,function(e,t){var r=s,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(ml,ml.exports)),ml.exports).Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=a,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=l,this.end=h,n=3;break;default:return this.write=u,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function c(e){return e&&e.length?this.write(e):""}return pl.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var s=n(t[i]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--i<r||-2===s)return 0;if(s=n(t[i]),s>=0)return s>0&&(e.lastNeed=s-2),s;if(--i<r||-2===s)return 0;if(s=n(t[i]),s>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},pl}function yl(){if(tl)return el;tl=1;var e=Za().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return el=function r(n,i,s){if("function"==typeof i)return r(n,null,i);i||(i={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(s||t);var o=i.readable||!1!==i.readable&&n.readable,a=i.writable||!1!==i.writable&&n.writable,l=function(){n.writable||u()},h=n._writableState&&n._writableState.finished,u=function(){a=!1,h=!0,o||s.call(n)},c=n._readableState&&n._readableState.endEmitted,f=function(){o=!1,c=!0,a||s.call(n)},d=function(e){s.call(n,e)},p=function(){var t;return o&&!c?(n._readableState&&n._readableState.ended||(t=new e),s.call(n,t)):a&&!h?(n._writableState&&n._writableState.ended||(t=new e),s.call(n,t)):void 0},m=function(){n.req.on("finish",u)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?a&&!n._writableState&&(n.on("end",l),n.on("close",l)):(n.on("complete",u),n.on("abort",p),n.req?m():n.on("request",m)),n.on("end",f),n.on("finish",u),!1!==i.error&&n.on("error",d),n.on("close",p),function(){n.removeListener("complete",u),n.removeListener("abort",p),n.removeListener("request",m),n.req&&n.req.removeListener("finish",u),n.removeListener("end",l),n.removeListener("close",l),n.removeListener("finish",u),n.removeListener("end",f),n.removeListener("error",d),n.removeListener("close",p)}},el}function vl(){if(nl)return rl;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}nl=1;var r=yl(),n=Symbol("lastResolve"),i=Symbol("lastReject"),s=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function u(e,t){return{value:e,done:t}}function c(e){var t=e[n];if(null!==t){var r=e[h].read();null!==r&&(e[a]=null,e[n]=null,e[i]=null,t(u(r,!1)))}}function f(e){process.nextTick(c,e)}var d=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e={get stream(){return this[h]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[o])return Promise.resolve(u(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[s]?r(e[s]):t(u(void 0,!0))}))}));var r,n=this[a];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[o]?r(u(void 0,!0)):t[l](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(u(i,!1));r=new Promise(this[l])}return this[a]=r,r}},t(e,Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(u(void 0,!0))}))}))})),e),d);return rl=function(e){var c,d=Object.create(p,(t(c={},h,{value:e,writable:!0}),t(c,n,{value:null,writable:!0}),t(c,i,{value:null,writable:!0}),t(c,s,{value:null,writable:!0}),t(c,o,{value:e._readableState.endEmitted,writable:!0}),t(c,l,{value:function(e,t){var r=d[h].read();r?(d[a]=null,d[n]=null,d[i]=null,e(u(r,!1))):(d[n]=e,d[i]=t)},writable:!0}),c));return d[a]=null,r(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=d[i];return null!==t&&(d[a]=null,d[n]=null,d[i]=null,t(e)),void(d[s]=e)}var r=d[n];null!==r&&(d[a]=null,d[n]=null,d[i]=null,r(u(void 0,!0))),d[o]=!0})),e.on("readable",f.bind(null,d)),d},rl}function _l(){if(sl)return il;function e(e,t,r,n,i,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}sl=1;var n=Za().codes.ERR_INVALID_ARG_TYPE;return il=function(i,s,o){var a;if(s&&"function"==typeof s.next)a=s;else if(s&&s[Symbol.asyncIterator])a=s[Symbol.asyncIterator]();else{if(!s||!s[Symbol.iterator])throw new n("iterable",["Iterable"],s);a=s[Symbol.iterator]()}var l=new i(function(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({objectMode:!0},o)),h=!1;function u(){return c.apply(this,arguments)}function c(){var t;return t=function*(){try{var e=yield a.next(),t=e.value;e.done?l.push(null):l.push(yield t)?u():h=!1}catch(e){l.destroy(e)}},c=function(){var r=this,n=arguments;return new Promise((function(i,s){var o=t.apply(r,n);function a(t){e(o,i,s,a,l,"next",t)}function l(t){e(o,i,s,a,l,"throw",t)}a(void 0)}))},c.apply(this,arguments)}return l._read=function(){h||(h=!0,u())},l},il}function bl(){if(al)return ol;var e;al=1,ol=E,E.ReadableState=S,i.EventEmitter;var t=function(e,t){return e.listeners(t).length},r=Ma(),n=s.Buffer,a=(void 0!==p?p:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,h=o;l=h&&h.debuglog?h.debuglog("stream"):function(){};var u,c,f,d=La(),m=Ba(),g=Ga().getHighWaterMark,y=Za().codes,v=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;rt()(E,r);var x=m.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(t,r,n){e=e||Ka(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=gl().StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function E(t){if(e=e||Ka(),!(this instanceof E))return new E(t);var n=this instanceof e;this._readableState=new S(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function T(e,t,r,i,s){l("readableAddChunk",t);var o,h=e._readableState;if(null===t)h.reading=!1,function(e,t){if(l("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}(e,h);else if(s||(o=function(e,t){var r;i=t,n.isBuffer(i)||i instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(h,t)),o)x(e,o);else if(h.objectMode||t&&t.length>0)if("string"==typeof t||h.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),i)h.endEmitted?x(e,new w):C(e,h,t,!0);else if(h.ended)x(e,new _);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(t=h.decoder.write(t),h.objectMode||0!==t.length?C(e,h,t,!1):I(e,h)):C(e,h,t,!1)}else i||(h.reading=!1,I(e,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function C(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),I(e,t)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=m.destroy,E.prototype._undestroy=m.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=n.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},E.prototype.unshift=function(e){return T(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){u||(u=gl().StringDecoder);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var O=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(N,e))}function N(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function I(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(l("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function F(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){l("readable nexttick read 0"),e.read(0)}function j(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(z,t,e))}function z(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function $(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return E.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):A(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){x(this,new b("_read()"))},E.prototype.pipe=function(e,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,r);var s=(!r||!1!==r.end)&&e!==process.stdout&&e!==process.stderr?a:m;function o(t,r){l("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",h),e.removeListener("error",f),e.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",m),n.removeListener("data",c),u=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function a(){l("onend"),e.end()}i.endEmitted?process.nextTick(s):n.once("end",s),e.on("unpipe",o);var h=function(e){return function(){var r=e._readableState;l("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,M(e))}}(n);e.on("drain",h);var u=!1;function c(t){l("ondata");var r=e.write(t);l("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==$(i.pipes,e))&&!u&&(l("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(r){l("onerror",r),m(),e.removeListener("error",f),0===t(e,"error")&&x(e,r)}function d(){e.removeListener("finish",p),m()}function p(){l("onfinish"),e.removeListener("close",d),m()}function m(){l("unpipe"),n.unpipe(e)}return n.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",n),i.flowing||(l("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=$(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},E.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,l("on readable",i.length,i.reading),i.length?A(this):i.reading||process.nextTick(D,this))),n},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(F,this),n},E.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(F,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(j,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<k.length;s++)e.on(k[s],this.emit.bind(this,k[s]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=vl()),c(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=L,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(e,t){return void 0===f&&(f=_l()),f(E,e,t)}),ol}function wl(){if(hl)return ll;hl=1,ll=a;var e=Za().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,s=Ka();function o(e,t){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(null===i)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),i(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);s.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new i;if(e._transformState.transforming)throw new n;return e.push(null)}return rt()(a,s),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},a.prototype._transform=function(e,r,n){n(new t("_transform()"))},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},a.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,(function(e){t(e)}))},ll}function xl(){if(dl)return fl;var e;dl=1;var t=Za().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function i(e){if(e)throw e}function s(e){e()}function o(e,t){return e.pipe(t)}return fl=function(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];var h,u=function(e){return e.length?"function"!=typeof e[e.length-1]?i:e.pop():i}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new r("streams");var c=a.map((function(t,r){var i=r<a.length-1;return function(t,r,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var o=!1;t.on("close",(function(){o=!0})),void 0===e&&(e=yl()),e(t,{readable:r,writable:i},(function(e){if(e)return s(e);o=!0,s()}));var a=!1;return function(e){if(!o&&!a)return a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new n("pipe"))}}(t,i,r>0,(function(e){h||(h=e),e&&c.forEach(s),i||(c.forEach(s),u(h))}))}));return a.reduce(o)},fl}!function(e,t){var r=n;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=bl()).Stream=r||t,t.Readable=t,t.Writable=Ya(),t.Duplex=Ka(),t.Transform=wl(),t.PassThrough=function(){if(cl)return ul;cl=1,ul=t;var e=wl();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return rt()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},ul}(),t.finished=yl(),t.pipeline=xl())}(ja,ja.exports);var kl=ja.exports;const Sl=r,El=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,Tl={nop(){},promiseImmediate:e=>new Promise((t=>{p.setImmediate?setImmediate((()=>{t(e)})):setTimeout((()=>{t(e)}),1)})),inherits:function(e,t,r,n){e.super_=t,n||(n=r,r=null),r&&Object.keys(r).forEach((t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}));const i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};n&&Object.keys(n).forEach((e=>{i[e]=Object.getOwnPropertyDescriptor(n,e)})),e.prototype=Object.create(t.prototype,i)},dateToExcel:(e,t)=>25569+e.getTime()/864e5-(t?1462:0),excelToDate(e,t){const r=Math.round(24*(e-25569+(t?1462:0))*3600*1e3);return new Date(r)},parsePath(e){const t=e.lastIndexOf("/");return{path:e.substring(0,t),name:e.substring(t+1)}},getRelsPath(e){const t=Tl.parsePath(e);return`${t.path}/_rels/${t.name}.rels`},xmlEncode(e){const t=El.exec(e);if(!t)return e;let r="",n="",i=0,s=t.index;for(;s<e.length;s++){const t=e.charCodeAt(s);switch(t){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&apos;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;case 127:n="";break;default:if(t<=31&&(t<=8||t>=11&&13!==t)){n="";break}continue}i!==s&&(r+=e.substring(i,s)),i=s+1,n&&(r+=n)}return i!==s?r+e.substring(i,s):r},xmlDecode:e=>e.replace(/&([a-z]*);/g,(e=>{switch(e){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":return'"';default:return e}})),validInt(e){const t=parseInt(e,10);return Number.isNaN(t)?0:t},isDateFmt(e){if(!e)return!1;return null!==(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)},fs:{exists:e=>new Promise((t=>{Sl.access(e,Sl.constants.F_OK,(e=>{t(!e)}))}))},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>!0===e||"true"===e||1===e||"1"===e};var Cl=Tl;var Ol=class{constructor(e){this._buf=Buffer.alloc(e&&e.size||16384),this._encoding=e&&e.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e=e||0,this._buffer=void 0,this._inPos=e}_grow(e){let t=2*this._buf.length;for(;t<e;)t*=2;const r=Buffer.alloc(t);this._buf.copy(r,0),this._buf=r}addText(e){this._buffer=void 0;let t=this._inPos+this._buf.write(e,this._inPos,this._encoding);for(;t>=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}};const Rl=kl,Al=Cl,Nl=Ol;class Il{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,r,n){return this.toBuffer().copy(e,t,r,n)}toBuffer(){return this._buffer||(this._buffer=Buffer.from(this._data,this._encoding)),this._buffer}}class Pl{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,r,n){return this._data._buf.copy(e,t,r,n)}toBuffer(){return this._data.toBuffer()}}class Fl{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,r,n){this._data.copy(e,t,r,n)}toBuffer(){return this._data}}class Dl{constructor(e){this.size=e,this.buffer=Buffer.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(0===this.iRead&&this.iWrite===this.size)return this.buffer;const e=Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return 0===e?null:void 0===e||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=Buffer.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,r){const n=Math.min(r,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+n),this.iWrite+=n,n}}const jl=function(e){e=e||{},this.bufSize=e.bufSize||1048576,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Al.inherits(jl,Rl.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return Buffer.concat(this.buffers.map((e=>e.toBuffer())))}},_getWritableBuffer(){if(this.buffers.length){const e=this.buffers[this.buffers.length-1];if(!e.full)return e}const e=new Dl(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map((function(t){return new Promise((r=>{t.write(e.toBuffer(),(()=>{r()}))}))})))},_writeToBuffers(e){let t=0;const r=e.length;for(;t<r;){t+=this._getWritableBuffer().write(e,t,r-t)}},async write(e,t,r){let n;if(t instanceof Function&&(r=t,t="utf8"),r=r||Al.nop,e instanceof Nl)n=new Pl(e);else if(e instanceof Buffer)n=new Fl(e);else{if(!("string"==typeof e||e instanceof String||e instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");n=new Il(e,t)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(n);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(n),process.nextTick(r)):(await this._pipe(n),r());else this.paused||this.emit("data",n.toBuffer()),this._writeToBuffers(n),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,r){const n=e=>{e?r(e):(this._flush(),this.pipes.forEach((e=>{e.end()})),this.emit("finish"))};e?this.write(e,t,n):n()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){const r=this.buffers[0],n=r.read(e);e-=n.length,t.push(n),r.eod&&r.full&&this.buffers.shift()}return Buffer.concat(t)}return t=this.buffers.map((e=>e.toBuffer())).filter(Boolean),this.buffers=[],Buffer.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){this.pipes.push(e),!this.paused&&this.buffers.length&&this.end()},unpipe(e){this.pipes=this.pipes.filter((t=>t!==e))},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}});var Ml=jl,Ll={};const Bl="undefined"==typeof TextEncoder?null:new TextEncoder("utf-8"),{Buffer:zl}=s;Ll.stringToBuffer=function(e){return"string"!=typeof e?e:Bl?zl.from(Bl.encode(e).buffer):zl.from(e)};const $l=i,Hl=Da,Ul=Ml,{stringToBuffer:Vl}=Ll;class Wl extends $l.EventEmitter{constructor(e){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},e),this.zip=new Hl,this.stream=new Ul}append(e,t){t.hasOwnProperty("base64")&&t.base64?this.zip.file(t.name,e,{base64:!0}):(process.browser&&"string"==typeof e&&(e=Vl(e)),this.zip.file(t.name,e))}async finalize(){const e=await this.zip.generateAsync(this.options);this.stream.end(e),this.emit("finish")}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}}var ql={ZipWriter:Wl};const Xl=k,Zl=Cl,Gl=">";function Yl(e,t,r){e.push(` ${t}="${Zl.xmlEncode(r.toString())}"`)}function Kl(e,t){if(t){const r=[];Xl.each(t,((e,t)=>{void 0!==e&&Yl(r,t,e)})),e.push(r.join(""))}}let Ql=class{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){const t=this._xml;t.push("<?xml"),Kl(t,e),t.push("?>\n")}openNode(e,t){const r=this.tos,n=this._xml;r&&this.open&&n.push(Gl),this._stack.push(e),n.push("<"),n.push(e),Kl(n,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");void 0!==t&&Yl(this._xml,e,t)}addAttributes(e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");Kl(this._xml,e)}writeText(e){const t=this._xml;this.open&&(t.push(Gl),this.open=!1),this.leaf=!1,t.push(Zl.xmlEncode(e.toString()))}writeXml(e){this.open&&(this._xml.push(Gl),this.open=!1),this.leaf=!1,this._xml.push(e)}closeNode(){const e=this._stack.pop(),t=this._xml;this.leaf?t.push("/>"):(t.push("</"),t.push(e),t.push(Gl)),this.open=!1,this.leaf=!1}leafNode(e,t,r){this.openNode(e,t),void 0!==r&&this.writeText(r),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join("")}};Ql.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};var Jl=Ql,eh={};const th="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");eh.bufferToString=function(e){return"string"==typeof e?e:th?th.decode(e):e.toString()};var rh={},nh={};!function(e){
2
+ /**
3
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
4
+ *
5
+ * @author Louis-Dominique Dubeau
6
+ * @license MIT
7
+ * @copyright Louis-Dominique Dubeau
8
+ */
9
+ Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR="\t\n\r -퟿-�𐀀-􏿿",e.S=" \t\r\n",e.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",e.NAME_CHAR="-"+e.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",e.CHAR_RE=new RegExp("^["+e.CHAR+"]$","u"),e.S_RE=new RegExp("^["+e.S+"]+$","u"),e.NAME_START_CHAR_RE=new RegExp("^["+e.NAME_START_CHAR+"]$","u"),e.NAME_CHAR_RE=new RegExp("^["+e.NAME_CHAR+"]$","u"),e.NAME_RE=new RegExp("^["+e.NAME_START_CHAR+"]["+e.NAME_CHAR+"]*$","u"),e.NMTOKEN_RE=new RegExp("^["+e.NAME_CHAR+"]+$","u");var t=9,r=10,n=13,i=32;function s(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.S_LIST=[i,r,n,t],e.isChar=function(e){return e>=i&&e<=55295||e===r||e===n||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111},e.isS=function(e){return e===i||e===r||e===n||e===t},e.isNameStartChar=s,e.isNameChar=function(e){return s(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}}(nh);var ih={};!function(e){
10
+ /**
11
+ * Character classes and associated utilities for the 2nd edition of XML 1.1.
12
+ *
13
+ * @author Louis-Dominique Dubeau
14
+ * @license MIT
15
+ * @copyright Louis-Dominique Dubeau
16
+ */
17
+ Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR="-퟿-�𐀀-􏿿",e.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",e.S=" \t\r\n",e.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",e.NAME_CHAR="-"+e.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",e.CHAR_RE=new RegExp("^["+e.CHAR+"]$","u"),e.RESTRICTED_CHAR_RE=new RegExp("^["+e.RESTRICTED_CHAR+"]$","u"),e.S_RE=new RegExp("^["+e.S+"]+$","u"),e.NAME_START_CHAR_RE=new RegExp("^["+e.NAME_START_CHAR+"]$","u"),e.NAME_CHAR_RE=new RegExp("^["+e.NAME_CHAR+"]$","u"),e.NAME_RE=new RegExp("^["+e.NAME_START_CHAR+"]["+e.NAME_CHAR+"]*$","u"),e.NMTOKEN_RE=new RegExp("^["+e.NAME_CHAR+"]+$","u");function t(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.S_LIST=[32,10,13,9],e.isChar=function(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},e.isRestrictedChar=function(e){return e>=1&&e<=8||11===e||12===e||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159},e.isCharAndNotRestricted=function(e){return 9===e||10===e||13===e||e>31&&e<127||133===e||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},e.isS=function(e){return 32===e||10===e||13===e||9===e},e.isNameStartChar=t,e.isNameChar=function(e){return t(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}}(ih);var sh={};!function(e){function t(e){return e>=65&&e<=90||95===e||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}
18
+ /**
19
+ * Character class utilities for XML NS 1.0 edition 3.
20
+ *
21
+ * @author Louis-Dominique Dubeau
22
+ * @license MIT
23
+ * @copyright Louis-Dominique Dubeau
24
+ */
25
+ Object.defineProperty(e,"__esModule",{value:!0}),e.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",e.NC_NAME_CHAR="-"+e.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",e.NC_NAME_START_CHAR_RE=new RegExp("^["+e.NC_NAME_START_CHAR+"]$","u"),e.NC_NAME_CHAR_RE=new RegExp("^["+e.NC_NAME_CHAR+"]$","u"),e.NC_NAME_RE=new RegExp("^["+e.NC_NAME_START_CHAR+"]["+e.NC_NAME_CHAR+"]*$","u"),e.isNCNameStartChar=t,e.isNCNameChar=function(e){return t(e)||45===e||46===e||e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}}(sh),Object.defineProperty(rh,"__esModule",{value:!0});var oh=nh.isS,ah=nh.isChar,lh=nh.isNameStartChar,hh=nh.isNameChar,uh=nh.S_LIST,ch=nh.NAME_RE,fh=ih.isChar,dh=sh.isNCNameStartChar,ph=sh.isNCNameChar,mh=sh.NC_NAME_RE;const gh="http://www.w3.org/XML/1998/namespace",yh="http://www.w3.org/2000/xmlns/",vh={__proto__:null,xml:gh,xmlns:yh},_h={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},bh=-1,wh=-2,xh=13,kh=33,Sh=10,Eh=60,Th=61,Ch=62,Oh=63,Rh=93,Ah=e=>34===e||39===e,Nh=[34,39],Ih=[...Nh,91,Ch],Ph=[...Nh,Eh,Rh],Fh=[Th,Oh,...uh],Dh=[...uh,Ch,38,Eh];function jh(e,t,r){switch(t){case"xml":r!==gh&&e.fail(`xml prefix must be bound to ${gh}.`);break;case"xmlns":r!==yh&&e.fail(`xmlns prefix must be bound to ${yh}.`)}switch(r){case yh:e.fail(""===t?`the default namespace may not be set to ${r}.`:`may not assign a prefix (even "xmlns") to the URI ${yh}.`);break;case gh:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${r}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}}}const Mh=e=>mh.test(e),Lh=e=>ch.test(e);rh.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const Bh={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};rh.SaxesParser=class{constructor(e){this.opt=null!=e?e:{},this.fragmentOpt=!!this.opt.fragment;const t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,t){this.nameStartCheck=dh,this.nameCheck=ph,this.isName=Mh,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},vh);const e=this.opt.additionalNamespaces;null!=e&&(!function(e,t){for(const r of Object.keys(t))jh(e,r,t[r])}(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=lh,this.nameCheck=hh,this.isName=Lh,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:t}=this;this.state=t?xh:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:r}=this.opt;if(void 0===r){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");r="1.0"}this.setXMLVersion(r),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(_h),null===(e=this.readyHandler)||void 0===e||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[Bh[e]]=t}off(e){this[Bh[e]]=void 0}makeError(e){var t;let r=null!==(t=this.fileName)&&void 0!==t?t:"";return this.trackPosition&&(r.length>0&&(r+=":"),r+=`${this.line}:${this.column}`),r.length>0&&(r+=": "),new Error(r+e)}fail(e){const t=this.makeError(e),r=this.errorHandler;if(void 0===r)throw t;return r(t),this}write(e){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let t=!1;null===e?(t=!0,e=""):"object"==typeof e&&(e=e.toString()),void 0!==this.carriedFromPrevious&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let r=e.length;const n=e.charCodeAt(r-1);!t&&(13===n||n>=55296&&n<=56319)&&(this.carriedFromPrevious=e[r-1],r--,e=e.slice(0,r));const{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<r;)i[this.state].call(this);return this.chunkPosition+=r,t?this.end():this}close(){return this.write(null)}getCode10(){const{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return bh;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>=32||9===r)return r;switch(r){case Sh:return this.line++,this.column=0,this.positionAtNewLine=this.position,Sh;case 13:return e.charCodeAt(t+1)===Sh&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,wh;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){const{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return bh;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>31&&r<127||r>159&&8232!==r||9===r)return r;switch(r){case Sh:return this.line++,this.column=0,this.positionAtNewLine=this.position,Sh;case 13:{const r=e.charCodeAt(t+1);r!==Sh&&133!==r||(this.i=t+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,wh;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){const e=this.getCode();return e===wh?Sh:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this;const{chunk:r}=this;for(;;){const n=this.getCode(),i=n===wh,s=i?Sh:n;if(s===bh||e.includes(s))return this.text+=r.slice(t,this.prevI),s;i&&(this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this;const{chunk:r}=this;for(;;){let n=this.getCode();switch(n){case wh:this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i,n=Sh;break;case bh:return this.text+=r.slice(t),!1}if(n===e)return this.text+=r.slice(t,this.prevI),!0}}captureNameChars(){const{chunk:e,i:t}=this;for(;;){const r=this.getCode();if(r===bh)return this.name+=e.slice(t),bh;if(!hh(r))return this.name+=e.slice(t,this.prevI),r===wh?Sh:r}}skipSpaces(){for(;;){const e=this.getCodeNorm();if(e===bh||!oh(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,"1.0"===e?(this.isChar=ah,this.getCode=this.getCode10):(this.isChar=fh,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case Eh:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case bh:break;default:this.unget(),this.state=xh,this.xmlDeclPossible=!1}}sDoctype(){var e;const t=this.captureTo(Ih);switch(t){case Ch:null===(e=this.doctypeHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=xh,this.doctype=!0;break;case bh:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:Ah(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){const e=this.captureTo(Ph);e!==bh&&(this.text+=String.fromCodePoint(e),e===Rh?this.state=2:e===Eh?this.state=6:Ah(e)&&(this.state=5,this.q=e))}sDTDQuoted(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){const e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang="";break;case Oh:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,"-"!==t&&(this.state="--"===t?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=45===e?10:8}sDTDCommentEnded(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===Ch?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(Oh)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===Ch&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:e}=this;const{chunk:t}=this;e:for(;;)switch(this.getCode()){case wh:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{const{entityReturnState:r}=this,n=this.entity+t.slice(e,this.prevI);let i;this.state=r,""===n?(this.fail("empty entity name."),i="&;"):(i=this.parseEntity(n),this.entity=""),r===xh&&void 0===this.textHandler||(this.text+=i);break e}case bh:this.entity+=t.slice(e);break e}}sOpenWaka(){const e=this.getCode();if(lh(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case Oh:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=xh,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;const t=this.getCodeNorm();45===t?(this.state=19,null===(e=this.commentHandler)||void 0===e||e.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const e=this.getCodeNorm();e!==Ch?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(e)}`,this.state=17):this.state=xh}sCData(){this.captureToChar(Rh)&&(this.state=21)}sCDataEnding(){const e=this.getCodeNorm();e===Rh?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;const t=this.getCodeNorm();switch(t){case Ch:null===(e=this.cdataHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=xh;break;case Rh:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===Oh||oh(e)?(this.fail("processing instruction without a target."),this.state=e===Oh?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){const{chunk:e,i:t}=this;for(;;){const r=this.getCodeNorm();if(r===bh)return void(this.piTarget+=e.slice(t));if(!this.nameCheck(r)){this.piTarget+=e.slice(t,this.prevI);const n=r===Oh;n||oh(r)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=n?kh:27):this.state=n?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(r));break}}}sPIBody(){if(0===this.text.length){const e=this.getCodeNorm();e===Oh?this.state=26:oh(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(Oh)&&(this.state=26)}sPIEnding(){var e;const t=this.getCodeNorm();if(t===Ch){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),null===(e=this.piHandler)||void 0===e||e.call(this,{target:t,body:this.text}),this.piTarget=this.text="",this.state=xh}else t===Oh?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const e=this.skipSpaces();e!==Oh?e!==bh&&(this.state=28,this.name=String.fromCodePoint(e)):this.state=kh}sXMLDeclName(){const e=this.captureTo(Fh);if(e===Oh)return this.state=kh,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(oh(e)||e===Th){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=e===Th?30:29}}sXMLDeclEq(){const e=this.getCodeNorm();if(e===Oh)return this.state=kh,void this.fail("XML declaration is incomplete.");oh(e)||(e!==Th&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const e=this.getCodeNorm();if(e===Oh)return this.state=kh,void this.fail("XML declaration is incomplete.");oh(e)||(Ah(e)?this.q=e:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const e=this.captureTo([this.q,Oh]);if(e===Oh)return this.state=kh,this.text="",void this.fail("XML declaration is incomplete.");if(e===bh)return;const t=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=t;break;case"standalone":"yes"!==t&&"no"!==t&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=t}this.name="",this.state=32}sXMLDeclSeparator(){const e=this.getCodeNorm();e!==Oh?(oh(e)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=kh}sXMLDeclEnding(){var e;this.getCodeNorm()===Ch?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),null===(e=this.xmldeclHandler)||void 0===e||e.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=xh):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var e;const t=this.captureNameChars();if(t===bh)return;const r=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=r.ns=Object.create(null)),null===(e=this.openTagStartHandler)||void 0===e||e.call(this,r),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case Ch:this.openTag();break;case 47:this.state=35;break;default:oh(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===Ch?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const e=this.skipSpaces();e!==bh&&(lh(e)?(this.unget(),this.state=37):e===Ch?this.openTag():47===e?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const e=this.captureNameChars();e===Th?this.state=39:oh(e)?this.state=38:e===Ch?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):e!==bh&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const e=this.skipSpaces();switch(e){case bh:return;case Th:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",e===Ch?this.openTag():lh(e)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const e=this.getCodeNorm();Ah(e)?(this.q=e,this.state=40):oh(e)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:e,chunk:t}=this;let{i:r}=this;for(;;)switch(this.getCode()){case e:return this.pushAttrib(this.name,this.text+t.slice(r,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=t.slice(r,this.prevI),this.state=14,void(this.entityReturnState=40);case Sh:case wh:case 9:this.text+=`${t.slice(r,this.prevI)} `,r=this.i;break;case Eh:return this.text+=t.slice(r,this.prevI),void this.fail("disallowed character.");case bh:return void(this.text+=t.slice(r))}}sAttribValueClosed(){const e=this.getCodeNorm();oh(e)?this.state=36:e===Ch?this.openTag():47===e?this.state=35:lh(e)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const e=this.captureTo(Dh);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case Eh:this.fail("disallowed character.");break;case bh:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",e===Ch?this.openTag():this.state=36}}sCloseTag(){const e=this.captureNameChars();e===Ch?this.closeTag():oh(e)?this.state=44:e!==bh&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case Ch:this.closeTag();break;case bh:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:e,forbiddenState:t}=this;const{chunk:r,textHandler:n}=this;e:for(;;)switch(this.getCode()){case Eh:if(this.state=15,void 0!==n){const{text:t}=this,i=r.slice(e,this.prevI);0!==t.length?(n(t+i),this.text=""):0!==i.length&&n(i)}t=0;break e;case 38:this.state=14,this.entityReturnState=xh,void 0!==n&&(this.text+=r.slice(e,this.prevI)),t=0;break e;case Rh:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw new Error("impossible state")}break;case Ch:2===t&&this.fail('the string "]]>" is disallowed in char data.'),t=0;break;case wh:void 0!==n&&(this.text+=`${r.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case bh:void 0!==n&&(this.text+=r.slice(e));break e;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this;const{chunk:t,textHandler:r}=this;let n=!1;e:for(;;){const i=this.getCode();switch(i){case Eh:if(this.state=15,void 0!==r){const{text:n}=this,i=t.slice(e,this.prevI);0!==n.length?(r(n+i),this.text=""):0!==i.length&&r(i)}break e;case 38:this.state=14,this.entityReturnState=xh,void 0!==r&&(this.text+=t.slice(e,this.prevI)),n=!0;break e;case wh:void 0!==r&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case bh:void 0!==r&&(this.text+=t.slice(e));break e;default:oh(i)||(n=!0)}}n&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var r;const{prefix:n,local:i}=this.qname(e),s={name:e,prefix:n,local:i,value:t};if(this.attribList.push(s),null===(r=this.attributeHandler)||void 0===r||r.call(this,s),"xmlns"===n){const e=t.trim();"1.0"===this.currentXMLVersion&&""===e&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=e,jh(this,i,e)}else if("xmlns"===e){const e=t.trim();this.topNS[""]=e,jh(this,"",e)}}pushAttribPlain(e,t){var r;const n={name:e,value:t};this.attribList.push(n),null===(r=this.attributeHandler)||void 0===r||r.call(this,n)}end(){var e,t;this.sawRoot||this.fail("document must contain a root element.");const{tags:r}=this;for(;r.length>0;){const e=r.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==xh&&this.fail("unexpected end.");const{text:n}=this;return 0!==n.length&&(null===(e=this.textHandler)||void 0===e||e.call(this,n),this.text=""),this._closed=!0,null===(t=this.endHandler)||void 0===t||t.call(this),this._init(),this}resolve(e){var t,r;let n=this.topNS[e];if(void 0!==n)return n;const{tags:i}=this;for(let t=i.length-1;t>=0;t--)if(n=i[t].ns[e],void 0!==n)return n;return n=this.ns[e],void 0!==n?n:null===(r=(t=this.opt).resolvePrefix)||void 0===r?void 0:r.call(t,e)}qname(e){const t=e.indexOf(":");if(-1===t)return{prefix:"",local:e};const r=e.slice(t+1),n=e.slice(0,t);return(""===n||""===r||r.includes(":"))&&this.fail(`malformed name: ${e}.`),{prefix:n,local:r}}processAttribsNS(){var e;const{attribList:t}=this,r=this.tag;{const{prefix:t,local:n}=this.qname(r.name);r.prefix=t,r.local=n;const i=r.uri=null!==(e=this.resolve(t))&&void 0!==e?e:"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),r.uri=t))}if(0===t.length)return;const{attributes:n}=r,i=new Set;for(const e of t){const{name:t,prefix:r,local:s}=e;let o,a;""===r?(o="xmlns"===t?yh:"",a=t):(o=this.resolve(r),void 0===o&&(this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`),o=r),a=`{${o}}${s}`),i.has(a)&&this.fail(`duplicate attribute: ${a}.`),i.add(a),e.uri=o,n[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:e}=this,t=this.tag.attributes;for(const{name:r,value:n}of e)void 0!==t[r]&&this.fail(`duplicate attribute: ${r}.`),t[r]=n;this.attribList=[]}openTag(){var e;this.processAttribs();const{tags:t}=this,r=this.tag;r.isSelfClosing=!1,null===(e=this.openTagHandler)||void 0===e||e.call(this,r),t.push(r),this.state=xh,this.name=""}openSelfClosingTag(){var e,t,r;this.processAttribs();const{tags:n}=this,i=this.tag;i.isSelfClosing=!0,null===(e=this.openTagHandler)||void 0===e||e.call(this,i),null===(t=this.closeTagHandler)||void 0===t||t.call(this,i);null===(this.tag=null!==(r=n[n.length-1])&&void 0!==r?r:null)&&(this.closedRoot=!0),this.state=xh,this.name=""}closeTag(){const{tags:e,name:t}=this;if(this.state=xh,this.name="",""===t)return this.fail("weird empty close tag."),void(this.text+="</>");const r=this.closeTagHandler;let n=e.length;for(;n-- >0;){const n=this.tag=e.pop();if(this.topNS=n.ns,null==r||r(n),n.name===t)break;this.fail("unexpected close tag.")}0===n?this.closedRoot=!0:n<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if("#"!==e[0]){const t=this.ENTITIES[e];return void 0!==t?t:(this.fail(this.isName(e)?"undefined entity.":"disallowed character in entity name."),`&${e};`)}let t=NaN;return"x"===e[1]&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail("malformed character entity."),`&${e};`)}};const{SaxesParser:zh}=rh,{PassThrough:$h}=kl,{bufferToString:Hh}=eh;var Uh=async function*(e){e.pipe&&!e[Symbol.asyncIterator]&&(e=e.pipe(new $h));const t=new zh;let r;t.on("error",(e=>{r=e}));let n=[];t.on("opentag",(e=>n.push({eventType:"opentag",value:e}))),t.on("text",(e=>n.push({eventType:"text",value:e}))),t.on("closetag",(e=>n.push({eventType:"closetag",value:e})));for await(const i of e){if(t.write(Hh(i)),r)throw r;yield n,n=[]}};const Vh=Uh,Wh=Jl;var qh=class e{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach((t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()}))}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(const t of e)for(const{eventType:e,value:r}of t)if("opentag"===e)this.parseOpen(r);else if("text"===e)this.parseText(r);else if("closetag"===e&&!this.parseClose(r.name))return this.model;return this.model}async parseStream(e){return this.parse(Vh(e))}get xml(){return this.toXml(this.model)}toXml(e){const t=new Wh;return this.render(t,e),t.xml}static toAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(r)return t}else if(r||e!==t)return e.toString()}static toStringAttribute(t,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.toAttribute(t,r,n)}static toStringValue(e,t){return void 0===e?t:e}static toBoolAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(r)return t}else if(r||e!==t)return e?"1":"0"}static toBoolValue(e,t){return void 0===e?t:"1"===e}static toIntAttribute(t,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.toAttribute(t,r,n)}static toIntValue(e,t){return void 0===e?t:parseInt(e,10)}static toFloatAttribute(t,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.toAttribute(t,r,n)}static toFloatValue(e,t){return void 0===e?t:parseFloat(e)}};const Xh=qh,Zh=Jl;function Gh(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach((t=>{Gh(e,t)})),t.t&&e.writeText(t.t),e.closeNode()}var Yh=class extends Xh{constructor(e){super(),this._model=e}render(e){if(!this._xml){const e=new Zh;Gh(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){return e!==this._model.tag}};const Kh=qh;var Qh=class extends Kh{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||"count",this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){const{childXform:r}=this;e&&e.forEach(((e,n)=>{t.index=n,r.prepare(e,t)}))}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);const{childXform:r}=this;(t||[]).forEach(((t,n)=>{r.render(e,t,n)})),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(e)&&(this.parser=this.childXform,!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){const{childXform:r}=this;e.forEach((e=>{r.reconcile(e,t)}))}}};const Jh=qh;var eu=class extends Jh{constructor(e){super(),this.name=e||"color"}get tag(){return this.name}render(e,t){return!!t&&(e.openNode(this.name),t.argb?e.addAttribute("rgb",t.argb):void 0!==t.theme?(e.addAttribute("theme",t.theme),void 0!==t.tint&&e.addAttribute("tint",t.tint)):void 0!==t.indexed?e.addAttribute("indexed",t.indexed):e.addAttribute("auto","1"),e.closeNode(),!0)}parseOpen(e){return e.name===this.name&&(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}};const tu=qh;var ru=class extends tu{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}};const nu=qh;var iu=class extends nu{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag&&(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0)}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}};const su=qh;var ou=class extends su{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs}render(e,t){void 0!==t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}};const au=qh;let lu=class e extends au{constructor(e){super(),this.model=e}get tag(){return"u"}render(t,r){if(!0===(r=r||this.model))t.leafNode("u");else{const n=e.Attributes[r];n&&t.leafNode("u",n)}}parseOpen(e){"u"===e.name&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}};lu.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}};const hu=eu,uu=ru,cu=iu,fu=ou,du=lu,pu=k,mu=qh;let gu=class e extends mu{constructor(t){super(),this.options=t||e.OPTIONS,this.map={b:{prop:"bold",xform:new uu({tag:"b",attr:"val"})},i:{prop:"italic",xform:new uu({tag:"i",attr:"val"})},u:{prop:"underline",xform:new du},charset:{prop:"charset",xform:new cu({tag:"charset",attr:"val"})},color:{prop:"color",xform:new hu},condense:{prop:"condense",xform:new uu({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new uu({tag:"extend",attr:"val"})},family:{prop:"family",xform:new cu({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new uu({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new fu({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new fu({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new uu({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new uu({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new cu({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new fu({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(e,t){const{map:r}=this;e.openNode(this.options.tagName),pu.each(this.map,((n,i)=>{r[i].xform.render(e,t[n.prop])})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):this.map[e.name]?(this.parser=this.map[e.name].xform,this.parser.parseOpen(e)):e.name===this.options.tagName&&(this.model={},!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){const t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}return e!==this.options.tagName}};gu.OPTIONS={tagName:"font",fontNameTag:"name"};var yu=gu;const vu=qh,_u=eu;class bu extends vu{constructor(){super(),this.map={color:new _u}}get tag(){return"stop"}render(e,t){e.openNode("stop"),e.addAttribute("position",t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"stop":return this.model={position:parseFloat(e.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class wu extends vu{constructor(){super(),this.map={fgColor:new _u("fgColor"),bgColor:new _u("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(e,t){e.openNode("patternFill"),e.addAttribute("patternType",t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"patternFill"===e.name?(this.model={type:"pattern",pattern:e.attributes.patternType},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0)}}class xu extends vu{constructor(){super(),this.map={stop:new bu}}get name(){return"gradient"}get tag(){return"gradientFill"}render(e,t){switch(e.openNode("gradientFill"),t.gradient){case"angle":e.addAttribute("degree",t.degree);break;case"path":e.addAttribute("type","path"),t.center.left&&(e.addAttribute("left",t.center.left),void 0===t.center.right&&e.addAttribute("right",t.center.left)),t.center.right&&e.addAttribute("right",t.center.right),t.center.top&&(e.addAttribute("top",t.center.top),void 0===t.center.bottom&&e.addAttribute("bottom",t.center.top)),t.center.bottom&&e.addAttribute("bottom",t.center.bottom)}const r=this.map.stop;t.stops.forEach((t=>{r.render(e,t)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"gradientFill":{const t=this.model={stops:[]};return e.attributes.degree?(t.gradient="angle",t.degree=parseInt(e.attributes.degree,10)):"path"===e.attributes.type&&(t.gradient="path",t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}let ku=class e extends vu{constructor(){super(),this.map={patternFill:new wu,gradientFill:new xu}}get tag(){return"fill"}render(e,t){switch(e.addRollback(),e.openNode("fill"),t.type){case"pattern":this.map.patternFill.render(e,t);break;case"gradient":this.map.gradientFill.render(e,t);break;default:return void e.rollback()}e.closeNode(),e.commit()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"fill"===e.name?(this.model={},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(t){return e.validPatternValues[t]}};ku.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce(((e,t)=>(e[t]=!0,e)),{}),ku.StopXform=bu,ku.PatternFillXform=wu,ku.GradientFillXform=xu;var Su=ku;const Eu=qh,Tu=Cl,Cu=eu;class Ou extends Eu{constructor(e){super(),this.name=e,this.map={color:new Cu}}get tag(){return this.name}render(e,t,r){const n=t&&t.color||r||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute("style",t.style),n&&this.map.color.render(e,n)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:t}=e.attributes;return this.model=t?{style:t}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return Ou.validStyleValues[e]}}Ou.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce(((e,t)=>(e[t]=!0,e)),{});var Ru=class extends Eu{constructor(){super(),this.map={top:new Ou("top"),left:new Ou("left"),bottom:new Ou("bottom"),right:new Ou("right"),diagonal:new Ou("diagonal")}}render(e,t){const{color:r}=t;function n(n,i){n&&!n.color&&t.color&&(n={...n,color:t.color}),i.render(e,n,r)}e.openNode("border"),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute("diagonalUp","1"),t.diagonal.down&&e.addAttribute("diagonalDown","1")),n(t.left,this.map.left),n(t.right,this.map.right),n(t.top,this.map.top),n(t.bottom,this.map.bottom),n(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"border"===e.name?(this.reset(),this.diagonalUp=Tu.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=Tu.parseBoolean(e.attributes.diagonalDown),!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("border"===e){const e=this.model={},t=function(t,r,n){r&&(n&&Object.assign(r,n),e[t]=r)};t("left",this.map.left.model),t("right",this.map.right.model),t("top",this.map.top.model),t("bottom",this.map.bottom.model),t("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}};const Au=k,Nu={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}},Iu=qh;const Pu=function(){const e={};return Au.each(Nu,((t,r)=>{t.f&&(e[t.f]=parseInt(r,10))})),e}();let Fu=class extends Iu{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return"numFmt"}render(e,t){e.leafNode("numFmt",{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){return"numFmt"===e.name&&(this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0)}parseText(){}parseClose(){return!1}};Fu.getDefaultFmtId=function(e){return Pu[e]},Fu.getDefaultFmtCode=function(e){return Nu[e]&&Nu[e].f};var Du=Fu;const ju=R,Mu=Cl,Lu=qh,Bu={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce(((e,t)=>(e[t]=!0,e)),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce(((e,t)=>(e[t]=!0,e)),{}),vertical(e){return"middle"===e?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation:e=>"vertical"===e||(e=Mu.validInt(e))>=-90&&e<=90?e:void 0,indent:e=>(e=Mu.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return ju.ReadingOrder.LeftToRight;case"rtl":return ju.ReadingOrder.RightToLeft;default:return}}},zu={toXml(e){if(e=Bu.textRotation(e)){if("vertical"===e)return 255;const t=Math.round(e);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(e){const t=Mu.validInt(e);if(void 0!==t){if(255===t)return"vertical";if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var $u=class extends Lu{get tag(){return"alignment"}render(e,t){e.addRollback(),e.openNode("alignment");let r=!1;function n(t,n){n&&(e.addAttribute(t,n),r=!0)}n("horizontal",Bu.horizontal(t.horizontal)),n("vertical",Bu.vertical(t.vertical)),n("wrapText",!!Bu.wrapText(t.wrapText)&&"1"),n("shrinkToFit",!!Bu.shrinkToFit(t.shrinkToFit)&&"1"),n("indent",Bu.indent(t.indent)),n("textRotation",zu.toXml(t.textRotation)),n("readingOrder",Bu.readingOrder(t.readingOrder)),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const t={};let r=!1;function n(e,n,i){e&&(t[n]=i,r=!0)}n(e.attributes.horizontal,"horizontal",e.attributes.horizontal),n(e.attributes.vertical,"vertical","center"===e.attributes.vertical?"middle":e.attributes.vertical),n(e.attributes.wrapText,"wrapText",Mu.parseBoolean(e.attributes.wrapText)),n(e.attributes.shrinkToFit,"shrinkToFit",Mu.parseBoolean(e.attributes.shrinkToFit)),n(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),n(e.attributes.textRotation,"textRotation",zu.toModel(e.attributes.textRotation)),n(e.attributes.readingOrder,"readingOrder","2"===e.attributes.readingOrder?"rtl":"ltr"),this.model=r?t:null}parseText(){}parseClose(){return!1}};const Hu=qh,Uu={boolean:(e,t)=>void 0===e?t:e};var Vu=class extends Hu{get tag(){return"protection"}render(e,t){e.addRollback(),e.openNode("protection");let r=!1;function n(t,n){void 0!==n&&(e.addAttribute(t,n),r=!0)}n("locked",Uu.boolean(t.locked,!0)?void 0:"0"),n("hidden",Uu.boolean(t.hidden,!1)?"1":void 0),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const t={locked:!("0"===e.attributes.locked),hidden:"1"===e.attributes.hidden},r=!t.locked||t.hidden;this.model=r?t:null}parseText(){}parseClose(){return!1}};const Wu=qh,qu=$u,Xu=Vu;var Zu=class extends Wu{constructor(e){super(),this.xfId=!(!e||!e.xfId),this.map={alignment:new qu,protection:new Xu}}get tag(){return"xf"}render(e,t){e.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute("xfId",t.xfId||0),t.numFmtId&&e.addAttribute("applyNumberFormat","1"),t.fontId&&e.addAttribute("applyFont","1"),t.fillId&&e.addAttribute("applyFill","1"),t.borderId&&e.addAttribute("applyBorder","1"),t.alignment&&e.addAttribute("applyAlignment","1"),t.protection&&e.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"xf":return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):"xf"!==e}};const Gu=qh,Yu=$u,Ku=Ru,Qu=Su,Ju=yu,ec=Du,tc=Vu;var rc=class extends Gu{constructor(){super(),this.map={alignment:new Yu,border:new Ku,fill:new Qu,font:new Ju,numFmt:new ec,protection:new tc}}get tag(){return"dxf"}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){const r={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,r)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}};const nc=R,ic=Jl,sc=qh,oc=Yh,ac=Qh,lc=yu,hc=Su,uc=Ru,cc=Du,fc=Zu,dc=rc;let pc=class e extends sc{constructor(t){super(),this.map={numFmts:new ac({tag:"numFmts",count:!0,childXform:new cc}),fonts:new ac({tag:"fonts",count:!0,childXform:new lc,$:{"x14ac:knownFonts":1}}),fills:new ac({tag:"fills",count:!0,childXform:new hc}),borders:new ac({tag:"borders",count:!0,childXform:new uc}),cellStyleXfs:new ac({tag:"cellStyleXfs",count:!0,childXform:new fc}),cellXfs:new ac({tag:"cellXfs",count:!0,childXform:new fc({xfId:!0})}),dxfs:new ac({tag:"dxfs",always:!0,count:!0,childXform:new dc}),numFmt:new cc,font:new lc,fill:new hc,border:new uc,style:new fc({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(t,r){r=r||this.model,t.openXml(ic.StdDocAttributes),t.openNode("styleSheet",e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode("numFmts",{count:r.numFmts.length}),r.numFmts.forEach((e=>{t.writeXml(e)})),t.closeNode()),r.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),t.openNode("fonts",{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach((e=>{t.writeXml(e)})),t.closeNode(),t.openNode("fills",{count:r.fills.length}),r.fills.forEach((e=>{t.writeXml(e)})),t.closeNode(),t.openNode("borders",{count:r.borders.length}),r.borders.forEach((e=>{t.writeXml(e)})),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode("cellXfs",{count:r.styles.length}),r.styles.forEach((e=>{t.writeXml(e)})),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"styleSheet"===e.name?(this.initIndex(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("styleSheet"===e){this.model={};const e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e("numFmts",this.map.numFmts),e("fonts",this.map.fonts),e("fills",this.map.fills),e("borders",this.map.borders),e("styles",this.map.cellXfs),e("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const e=this.index.numFmt;this.model.numFmts.forEach((t=>{e[t.id]=t.formatCode}))}return!1}return!0}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);const r={};if(t=t||nc.ValueType.Number,e.numFmt)r.numFmtId=this._addNumFmtStr(e.numFmt);else switch(t){case nc.ValueType.Number:r.numFmtId=this._addNumFmtStr("General");break;case nc.ValueType.Date:r.numFmtId=this._addNumFmtStr("mm-dd-yy")}e.font&&(r.fontId=this._addFont(e.font)),e.border&&(r.borderId=this._addBorder(e.border)),e.fill&&(r.fillId=this._addFill(e.fill)),e.alignment&&(r.alignment=e.alignment),e.protection&&(r.protection=e.protection);const n=this._addStyle(r);return this.weakMap&&this.weakMap.set(e,n),n}getStyleModel(e){const t=this.model.styles[e];if(!t)return null;let r=this.index.model[e];if(r)return r;if(r=this.index.model[e]={},t.numFmtId){const e=this.index.numFmt[t.numFmtId]||cc.getDefaultFmtCode(t.numFmtId);e&&(r.numFmt=e)}function n(e,t,n){if(n||0===n){const i=t[n];i&&(r[e]=i)}}return n("font",this.model.fonts,t.fontId),n("border",this.model.borders,t.borderId),n("fill",this.model.fills,t.fillId),t.alignment&&(r.alignment=t.alignment),t.protection&&(r.protection=t.protection),r}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){const t=this.map.style.toXml(e);let r=this.index.style[t];return void 0===r&&(r=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),r}_addNumFmtStr(e){let t=cc.getDefaultFmtId(e);if(void 0!==t)return t;if(t=this.index.numFmt[e],void 0!==t)return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;const r=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(r),t}_addFont(e){const t=this.map.font.toXml(e);let r=this.index.font[t];return void 0===r&&(r=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),r}_addBorder(e){const t=this.map.border.toXml(e);let r=this.index.border[t];return void 0===r&&(r=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),r}_addFill(e){const t=this.map.fill.toXml(e);let r=this.index.fill[t];return void 0===r&&(r=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),r}};pc.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},pc.STATIC_XFORMS={cellStyles:new oc({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new oc({tag:"dxfs",$:{count:0}}),tableStyles:new oc({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new oc({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})};pc.Mock=class extends pc{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){return t===nc.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){const e={numFmtId:cc.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var mc=pc;const gc=qh;var yc=class extends gc{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?"":e.toISOString()}catch(e){return""}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}};const vc=Jl,_c=qh,bc=yc,wc=ou,xc=iu;let kc=class e extends _c{constructor(){super(),this.map={"dc:creator":new wc({tag:"dc:creator"}),"dc:title":new wc({tag:"dc:title"}),"dc:subject":new wc({tag:"dc:subject"}),"dc:description":new wc({tag:"dc:description"}),"dc:identifier":new wc({tag:"dc:identifier"}),"dc:language":new wc({tag:"dc:language"}),"cp:keywords":new wc({tag:"cp:keywords"}),"cp:category":new wc({tag:"cp:category"}),"cp:lastModifiedBy":new wc({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new bc({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new xc({tag:"cp:revision"}),"cp:version":new wc({tag:"cp:version"}),"cp:contentStatus":new wc({tag:"cp:contentStatus"}),"cp:contentType":new wc({tag:"cp:contentType"}),"dcterms:created":new bc({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new bc({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(t,r){t.openXml(vc.StdDocAttributes),t.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(t,r.creator),this.map["dc:title"].render(t,r.title),this.map["dc:subject"].render(t,r.subject),this.map["dc:description"].render(t,r.description),this.map["dc:identifier"].render(t,r.identifier),this.map["dc:language"].render(t,r.language),this.map["cp:keywords"].render(t,r.keywords),this.map["cp:category"].render(t,r.category),this.map["cp:lastModifiedBy"].render(t,r.lastModifiedBy),this.map["cp:lastPrinted"].render(t,r.lastPrinted),this.map["cp:revision"].render(t,r.revision),this.map["cp:version"].render(t,r.version),this.map["cp:contentStatus"].render(t,r.contentStatus),this.map["cp:contentType"].render(t,r.contentType),this.map["dcterms:created"].render(t,r.created),this.map["dcterms:modified"].render(t,r.modified),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error(`Unexpected xml node in parseClose: ${e}`)}}};kc.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,"")},kc.DateAttrs={"xsi:type":"dcterms:W3CDTF"},kc.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"};var Sc=kc;const Ec=qh;var Tc=class extends Ec{get tag(){return"t"}render(e,t){e.openNode("t"),/^\s|\n|\s$/.test(t)&&e.addAttribute("xml:space","preserve"),e.writeText(t),e.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}parseOpen(e){return"t"===e.name&&(this._text=[],!0)}parseText(e){this._text.push(e)}parseClose(){return!1}};const Cc=Tc,Oc=yu,Rc=qh;let Ac=class e extends Rc{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new Cc)}get fontXform(){return this._fontXform||(this._fontXform=new Oc(e.FONT_OPTIONS))}render(e,t){t=t||this.model,e.openNode("r"),t.font&&this.fontXform.render(e,t.font),this.textXform.render(e,t.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}};Ac.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"};var Nc=Ac;const Ic=Tc,Pc=Nc,Fc=qh;var Dc=class extends Fc{constructor(){super(),this.map={r:new Pc,t:new Ic}}get tag(){return"rPh"}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:r}=this.map;t.richText.forEach((t=>{r.render(e,t)}))}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}};const jc=Tc,Mc=Nc,Lc=Dc,Bc=qh;var zc=class extends Bc{constructor(e){super(),this.model=e,this.map={r:new Mc,t:new jc,rPh:new Lc}}get tag(){return"si"}render(e,t){e.openNode(this.tag),t&&t.hasOwnProperty("richText")&&t.richText?t.richText.length?t.richText.forEach((t=>{this.map.r.render(e,t)})):this.map.t.render(e,""):null!=t&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}};const $c=Jl,Hc=qh,Uc=zc;var Vc=class extends Hc{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new Uc)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return void 0===t&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){const t=this.sharedStringXform.toXml(e);let r=this.rich[t];return void 0===r&&(r=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,r}render(e,t){t=t||this._values,e.openXml($c.StdDocAttributes),e.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const r=this.sharedStringXform;t.values.forEach((t=>{r.render(e,t)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if("sst"===e)return!1;throw new Error(`Unexpected xml node in parseClose: ${e}`)}};const Wc=qh;var qc=class extends Wc{render(e,t){e.leafNode("Relationship",t)}parseOpen(e){return"Relationship"===e.name&&(this.model=e.attributes,!0)}parseText(){}parseClose(){return!1}};const Xc=Jl,Zc=qh,Gc=qc;let Yc=class e extends Zc{constructor(){super(),this.map={Relationship:new Gc}}render(t,r){r=r||this._values,t.openXml(Xc.StdDocAttributes),t.openNode("Relationships",e.RELATIONSHIPS_ATTRIBUTES),r.forEach((e=>{this.map.Relationship.render(t,e)})),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("Relationships"===e.name)return this.model=[],!0;if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;if("Relationships"===e)return!1;throw new Error(`Unexpected xml node in parseClose: ${e}`)}};Yc.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"};var Kc=Yc;const Qc=Jl,Jc=qh;let ef=class e extends Jc{render(t,r){t.openXml(Qc.StdDocAttributes),t.openNode("Types",e.PROPERTY_ATTRIBUTES);const n={};(r.media||[]).forEach((e=>{if("image"===e.type){const r=e.extension;n[r]||(n[r]=!0,t.leafNode("Default",{Extension:r,ContentType:`image/${r}`}))}})),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),r.worksheets.forEach((e=>{const r=`/xl/worksheets/sheet${e.id}.xml`;t.leafNode("Override",{PartName:r,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})})),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"});r.sharedStrings&&r.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),r.tables&&r.tables.forEach((e=>{t.leafNode("Override",{PartName:`/xl/tables/${e.target}`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})})),r.drawings&&r.drawings.forEach((e=>{t.leafNode("Override",{PartName:`/xl/drawings/${e.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})})),r.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),r.commentRefs.forEach((e=>{let{commentName:r}=e;t.leafNode("Override",{PartName:`/xl/${r}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})}))),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}};ef.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"};var tf=ef;const rf=qh;var nf=class extends rf{render(e,t){e.openNode("HeadingPairs"),e.openNode("vt:vector",{size:2,baseType:"variant"}),e.openNode("vt:variant"),e.leafNode("vt:lpstr",void 0,"Worksheets"),e.closeNode(),e.openNode("vt:variant"),e.leafNode("vt:i4",void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return"HeadingPairs"===e.name}parseText(){}parseClose(e){return"HeadingPairs"!==e}};const sf=qh;var of=class extends sf{render(e,t){e.openNode("TitlesOfParts"),e.openNode("vt:vector",{size:t.length,baseType:"lpstr"}),t.forEach((t=>{e.leafNode("vt:lpstr",void 0,t.name)})),e.closeNode(),e.closeNode()}parseOpen(e){return"TitlesOfParts"===e.name}parseText(){}parseClose(e){return"TitlesOfParts"!==e}};const af=Jl,lf=qh,hf=ou,uf=nf,cf=of;let ff=class e extends lf{constructor(){super(),this.map={Company:new hf({tag:"Company"}),Manager:new hf({tag:"Manager"}),HeadingPairs:new uf,TitleOfParts:new cf}}render(t,r){t.openXml(af.StdDocAttributes),t.openNode("Properties",e.PROPERTY_ATTRIBUTES),t.leafNode("Application",void 0,"Microsoft Excel"),t.leafNode("DocSecurity",void 0,"0"),t.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(t,r.worksheets),this.map.TitleOfParts.render(t,r.worksheets),this.map.Company.render(t,r.company||""),this.map.Manager.render(t,r.manager),t.leafNode("LinksUpToDate",void 0,"false"),t.leafNode("SharedDoc",void 0,"false"),t.leafNode("HyperlinksChanged",void 0,"false"),t.leafNode("AppVersion",void 0,"16.0300"),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"Properties"===e.name||(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"Properties"!==e||(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1)}};ff.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,"")},ff.DateAttrs={"xsi:type":"dcterms:W3CDTF"},ff.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"};var df=ff;const pf=qh,mf=T;function gf(e){try{return mf.decodeEx(e),!0}catch(e){return!1}}function yf(e){const t=[];let r=!1,n="";return e.split(",").forEach((e=>{if(!e)return;const i=(e.match(/'/g)||[]).length;if(!i)return void(r?n+=`${e},`:gf(e)&&t.push(e));const s=i%2==0;!r&&s&&gf(e)?t.push(e):r&&!s?(r=!1,gf(n+e)&&t.push(n+e),n=""):(r=!0,n+=`${e},`)})),t}var vf=class extends pf{render(e,t){e.openNode("definedName",{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(",")),e.closeNode()}parseOpen(e){return"definedName"===e.name&&(this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0)}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:yf(this._parsedText.join(""))},void 0!==this._parsedLocalSheetId&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}};const _f=Cl,bf=qh;var wf=class extends bf{render(e,t){e.leafNode("sheet",{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return"sheet"===e.name&&(this.model={name:_f.xmlDecode(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}};const xf=qh;var kf=class extends xf{render(e,t){const r={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&"visible"!==t.visibility&&(r.visibility=t.visibility),e.leafNode("workbookView",r)}parseOpen(e){if("workbookView"===e.name){const t=this.model={},r=function(e,r,n){const i=void 0!==r?t[e]=r:n;void 0!==i&&(t[e]=i)},n=function(e,r,n){const i=void 0!==r?t[e]=parseInt(r,10):n;void 0!==i&&(t[e]=i)};return n("x",e.attributes.xWindow,0),n("y",e.attributes.yWindow,0),n("width",e.attributes.windowWidth,25e3),n("height",e.attributes.windowHeight,1e4),r("visibility",e.attributes.visibility,"visible"),n("activeTab",e.attributes.activeTab,void 0),n("firstSheet",e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}};const Sf=qh;var Ef=class extends Sf{render(e,t){e.leafNode("workbookPr",{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return"workbookPr"===e.name&&(this.model={date1904:"1"===e.attributes.date1904},!0)}parseText(){}parseClose(){return!1}};const Tf=qh;var Cf=class extends Tf{render(e,t){e.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return"calcPr"===e.name&&(this.model={},!0)}parseText(){}parseClose(){return!1}};const Of=k,Rf=T,Af=Jl,Nf=qh,If=Yh,Pf=Qh,Ff=vf,Df=wf,jf=kf,Mf=Ef,Lf=Cf;let Bf=class e extends Nf{constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new Mf,bookViews:new Pf({tag:"bookViews",count:!1,childXform:new jf}),sheets:new Pf({tag:"sheets",count:!1,childXform:new Df}),definedNames:new Pf({tag:"definedNames",count:!1,childXform:new Ff}),calcPr:new Lf}}prepare(e){e.sheets=e.worksheets;const t=[];let r=0;e.sheets.forEach((e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split("&&").forEach((n=>{const i=n.split(":"),s={name:"_xlnm.Print_Area",ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:r};t.push(s)})),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){const n=[];if(e.pageSetup.printTitlesColumn){const t=e.pageSetup.printTitlesColumn.split(":");n.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){const t=e.pageSetup.printTitlesRow.split(":");n.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}const i={name:"_xlnm.Print_Titles",ranges:n,localSheetId:r};t.push(i)}r++})),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach(((e,t)=>{e.name=e.type+(t+1)}))}render(t,r){t.openXml(Af.StdDocAttributes),t.openNode("workbook",e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,r.properties),this.map.bookViews.render(t,r.views),this.map.sheets.render(t,r.sheets),this.map.definedNames.render(t,r.definedNames),this.map.calcPr.render(t,r.calcProperties),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):("workbook"===e.name||(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"workbook"!==e||(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1)}reconcile(e){const t=(e.workbookRels||[]).reduce(((e,t)=>(e[t.Id]=t,e)),{}),r=[];let n,i=0;(e.sheets||[]).forEach((s=>{const o=t[s.rId];o&&(n=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,"")}`],n&&(n.name=s.name,n.id=s.id,n.state=s.state,r[i++]=n))}));const s=[];Of.each(e.definedNames,(e=>{if("_xlnm.Print_Area"===e.name){if(n=r[e.localSheetId],n){n.pageSetup||(n.pageSetup={});const t=Rf.decodeEx(e.ranges[0]);n.pageSetup.printArea=n.pageSetup.printArea?`${n.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if("_xlnm.Print_Titles"===e.name){if(n=r[e.localSheetId],n){n.pageSetup||(n.pageSetup={});const t=e.ranges.join(","),r=/\$/g,i=/\$\d+:\$\d+/,s=t.match(i);if(s&&s.length){const e=s[0];n.pageSetup.printTitlesRow=e.replace(r,"")}const o=/\$[A-Z]+:\$[A-Z]+/,a=t.match(o);if(a&&a.length){const e=a[0];n.pageSetup.printTitlesColumn=e.replace(r,"")}}}else s.push(e)})),e.definedNames=s,e.media.forEach(((e,t)=>{e.index=t}))}};Bf.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},Bf.STATIC_XFORMS={fileVersion:new If({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})};var zf=Bf,$f={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"};const Hf=k,Uf=O,Vf=T,Wf=R;var qf=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{const t=`${e.master}:${e.address}`;this.merges[e.master]=new Uf(t)}}get mergeCells(){return Hf.map(this.merges,(e=>e.range))}reconcile(e,t){Hf.each(e,(e=>{const r=Vf.decode(e);for(let e=r.top;e<=r.bottom;e++){const n=t[e-1];for(let t=r.left;t<=r.right;t++){const i=n.cells[t-1];i?i.type===Wf.ValueType.Merge&&(i.master=r.tl):n.cells[t]={type:Wf.ValueType.Null,address:Vf.encodeAddress(e,t)}}}}))}getMasterAddress(e){const t=this.hash[e];return t&&t.tl}};const Xf=Cl,Zf=qh,Gf=O,Yf=R,Kf=Nc;function Qf(e){if(null==e)return Yf.ValueType.Null;if(e instanceof String||"string"==typeof e)return Yf.ValueType.String;if("number"==typeof e)return Yf.ValueType.Number;if("boolean"==typeof e)return Yf.ValueType.Boolean;if(e instanceof Date)return Yf.ValueType.Date;if(e.text&&e.hyperlink)return Yf.ValueType.Hyperlink;if(e.formula)return Yf.ValueType.Formula;if(e.error)return Yf.ValueType.Error;throw new Error("I could not understand type of value")}var Jf=class extends Zf{constructor(){super(),this.richTextXForm=new Kf}get tag(){return"c"}prepare(e,t){const r=t.styles.addStyleModel(e.style||{},function(e){return e.type===Yf.ValueType.Formula?Qf(e.result):e.type}(e));switch(r&&(e.styleId=r),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case Yf.ValueType.String:case Yf.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case Yf.ValueType.Date:t.date1904&&(e.date1904=!0);break;case Yf.ValueType.Hyperlink:t.sharedStrings&&void 0!==e.text&&null!==e.text&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case Yf.ValueType.Merge:t.merges.add(e);break;case Yf.ValueType.Formula:if(t.date1904&&(e.date1904=!0),"shared"===e.shareType&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){const r=t.formulae[e.sharedFormula];if(!r)throw new Error(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);void 0===r.si?(r.shareType="shared",r.si=t.siFormulae++,r.range=new Gf(r.address,e.address)):r.range&&r.range.expandToAddress(e.address),e.si=r.si}}}renderFormula(e,t){let r=null;switch(t.shareType){case"shared":r={t:"shared",ref:t.ref||t.range.range,si:t.si};break;case"array":r={t:"array",ref:t.ref};break;default:void 0!==t.si&&(r={t:"shared",si:t.si})}switch(Qf(t.result)){case Yf.ValueType.Null:e.leafNode("f",r,t.formula);break;case Yf.ValueType.String:e.addAttribute("t","str"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result);break;case Yf.ValueType.Number:e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result);break;case Yf.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result?1:0);break;case Yf.ValueType.Error:e.addAttribute("t","e"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result.error);break;case Yf.ValueType.Date:e.leafNode("f",r,t.formula),e.leafNode("v",null,Xf.dateToExcel(t.result,t.date1904));break;default:throw new Error("I could not understand type of value")}}render(e,t){if(t.type!==Yf.ValueType.Null||t.styleId){switch(e.openNode("c"),e.addAttribute("r",t.address),t.styleId&&e.addAttribute("s",t.styleId),t.type){case Yf.ValueType.Null:break;case Yf.ValueType.Number:e.leafNode("v",null,t.value);break;case Yf.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("v",null,t.value?"1":"0");break;case Yf.ValueType.Error:e.addAttribute("t","e"),e.leafNode("v",null,t.value.error);break;case Yf.ValueType.String:case Yf.ValueType.RichText:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):t.value&&t.value.richText?(e.addAttribute("t","inlineStr"),e.openNode("is"),t.value.richText.forEach((t=>{this.richTextXForm.render(e,t)})),e.closeNode("is")):(e.addAttribute("t","str"),e.leafNode("v",null,t.value));break;case Yf.ValueType.Date:e.leafNode("v",null,Xf.dateToExcel(t.value,t.date1904));break;case Yf.ValueType.Hyperlink:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):(e.addAttribute("t","str"),e.leafNode("v",null,t.text));break;case Yf.ValueType.Formula:this.renderFormula(e,t);case Yf.ValueType.Merge:}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"c":return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser)this.parser.parseText(e);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+e:e;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e}}parseClose(e){switch(e){case"c":{const{model:e}=this;if(e.formula||e.shareType)e.type=Yf.ValueType.Formula,e.value&&("str"===this.t?e.result=Xf.xmlDecode(e.value):"b"===this.t?e.result=0!==parseInt(e.value,10):"e"===this.t?e.result={error:e.value}:e.result=parseFloat(e.value),e.value=void 0);else if(void 0!==e.value)switch(this.t){case"s":e.type=Yf.ValueType.String,e.value=parseInt(e.value,10);break;case"str":e.type=Yf.ValueType.String,e.value=Xf.xmlDecode(e.value);break;case"inlineStr":e.type=Yf.ValueType.String;break;case"b":e.type=Yf.ValueType.Boolean,e.value=0!==parseInt(e.value,10);break;case"e":e.type=Yf.ValueType.Error,e.value={error:e.value};break;default:e.type=Yf.ValueType.Number,e.value=parseFloat(e.value)}else e.styleId?e.type=Yf.ValueType.Null:e.type=Yf.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(e),!0)}}reconcile(e,t){const r=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(r&&(e.style=r),void 0!==e.styleId&&(e.styleId=void 0),e.type){case Yf.ValueType.String:"number"==typeof e.value&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=Yf.ValueType.RichText);break;case Yf.ValueType.Number:r&&Xf.isDateFmt(r.numFmt)&&(e.type=Yf.ValueType.Date,e.value=Xf.excelToDate(e.value,t.date1904));break;case Yf.ValueType.Formula:void 0!==e.result&&r&&Xf.isDateFmt(r.numFmt)&&(e.result=Xf.excelToDate(e.result,t.date1904)),"shared"===e.shareType&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si)}const n=t.hyperlinkMap[e.address];n&&(e.type===Yf.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=Yf.ValueType.Hyperlink,e.hyperlink=n);const i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}};const ed=qh,td=Cl,rd=Jf;var nd=class extends ed{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new rd}}get tag(){return"row"}prepare(e,t){const r=t.styles.addStyleModel(e.style);r&&(e.styleId=r);const n=this.map.c;e.cells.forEach((e=>{n.prepare(e,t)}))}render(e,t,r){e.openNode("row"),e.addAttribute("r",t.number),t.height&&(e.addAttribute("ht",t.height),e.addAttribute("customHeight","1")),t.hidden&&e.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(e.addAttribute("s",t.styleId),e.addAttribute("customFormat","1")),e.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1");const n=this.map.c;t.cells.forEach((t=>{n.render(e,t,r)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("row"===e.name){this.numRowsSeen+=1;const t=e.attributes.spans?e.attributes.spans.split(":").map((e=>parseInt(e,10))):[void 0,void 0],r=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(r.styleId=parseInt(e.attributes.s,10)),td.parseBoolean(e.attributes.hidden)&&(r.hidden=!0),td.parseBoolean(e.attributes.bestFit)&&(r.bestFit=!0),e.attributes.ht&&(r.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(r.outlineLevel=parseInt(e.attributes.outlineLevel,10)),td.parseBoolean(e.attributes.collapsed)&&(r.collapsed=!0),!0}return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},void 0!==e.styleId&&(e.styleId=void 0);const r=this.map.c;e.cells.forEach((e=>{r.reconcile(e,t)}))}};const id=Cl,sd=qh;var od=class extends sd{get tag(){return"col"}prepare(e,t){const r=t.styles.addStyleModel(e.style||{});r&&(e.styleId=r)}render(e,t){e.openNode("col"),e.addAttribute("min",t.min),e.addAttribute("max",t.max),t.width&&e.addAttribute("width",t.width),t.styleId&&e.addAttribute("style",t.styleId),t.hidden&&e.addAttribute("hidden","1"),t.bestFit&&e.addAttribute("bestFit","1"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1"),e.addAttribute("customWidth","1"),e.closeNode()}parseOpen(e){if("col"===e.name){const t=this.model={min:parseInt(e.attributes.min||"0",10),max:parseInt(e.attributes.max||"0",10),width:void 0===e.attributes.width?void 0:parseFloat(e.attributes.width||"0")};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),id.parseBoolean(e.attributes.hidden)&&(t.hidden=!0),id.parseBoolean(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),id.parseBoolean(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}};const ad=qh;var ld=class extends ad{get tag(){return"dimension"}render(e,t){t&&e.leafNode("dimension",{ref:t})}parseOpen(e){return"dimension"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}};const hd=qh;var ud=class extends hd{get tag(){return"hyperlink"}render(e,t){this.isInternalLink(t)?e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return"hyperlink"===e.name&&(this.model={address:e.attributes.ref,rId:e.attributes["r:id"],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(e){return e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target)}};const cd=qh;var fd=class extends cd{get tag(){return"mergeCell"}render(e,t){e.leafNode("mergeCell",{ref:t})}parseOpen(e){return"mergeCell"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}};const dd=k,pd=Cl,md=T,gd=qh,yd=O;function vd(e,t,r,n){const i=t[r];void 0!==i?e[r]=i:void 0!==n&&(e[r]=n)}function _d(e,t,r,n){const i=t[r];void 0!==i?e[r]=pd.parseBoolean(i):void 0!==n&&(e[r]=n)}var bd=class extends gd{get tag(){return"dataValidations"}render(e,t){const r=function(e){const t=dd.map(e,((e,t)=>({address:t,dataValidation:e,marked:!1}))).sort(((e,t)=>dd.strcmp(e.address,t.address))),r=dd.keyBy(t,"address"),n=(t,r,n)=>{for(let i=0;i<r;i++){const r=md.encodeAddress(t.row+i,n);if(!e[r]||!dd.isEqual(e[t.address],e[r]))return!1}return!0};return t.map((t=>{if(!t.marked){const i=md.decodeEx(t.address);if(i.dimensions)return r[i.dimensions].marked=!0,{...t.dataValidation,sqref:t.address};let s=1,o=md.encodeAddress(i.row+s,i.col);for(;e[o]&&dd.isEqual(t.dataValidation,e[o]);)s++,o=md.encodeAddress(i.row+s,i.col);let a=1;for(;n(i,s,i.col+a);)a++;for(let e=0;e<s;e++)for(let t=0;t<a;t++)o=md.encodeAddress(i.row+e,i.col+t),r[o].marked=!0;if(s>1||a>1){const e=i.row+(s-1),r=i.col+(a-1);return{...t.dataValidation,sqref:`${t.address}:${md.encodeAddress(e,r)}`}}return{...t.dataValidation,sqref:t.address}}return null})).filter(Boolean)}(t);r.length&&(e.openNode("dataValidations",{count:r.length}),r.forEach((t=>{e.openNode("dataValidation"),"any"!==t.type&&(e.addAttribute("type",t.type),t.operator&&"list"!==t.type&&"between"!==t.operator&&e.addAttribute("operator",t.operator),t.allowBlank&&e.addAttribute("allowBlank","1")),t.showInputMessage&&e.addAttribute("showInputMessage","1"),t.promptTitle&&e.addAttribute("promptTitle",t.promptTitle),t.prompt&&e.addAttribute("prompt",t.prompt),t.showErrorMessage&&e.addAttribute("showErrorMessage","1"),t.errorStyle&&e.addAttribute("errorStyle",t.errorStyle),t.errorTitle&&e.addAttribute("errorTitle",t.errorTitle),t.error&&e.addAttribute("error",t.error),e.addAttribute("sqref",t.sqref),(t.formulae||[]).forEach(((r,n)=>{e.openNode(`formula${n+1}`),"date"===t.type?e.writeText(pd.dateToExcel(new Date(r))):e.writeText(r),e.closeNode()})),e.closeNode()})),e.closeNode())}parseOpen(e){switch(e.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=e.attributes.sqref;const t={type:e.attributes.type||"any",formulae:[]};switch(e.attributes.type&&_d(t,e.attributes,"allowBlank"),_d(t,e.attributes,"showInputMessage"),_d(t,e.attributes,"showErrorMessage"),t.type){case"any":case"list":case"custom":break;default:vd(t,e.attributes,"operator","between")}return vd(t,e.attributes,"promptTitle"),vd(t,e.attributes,"prompt"),vd(t,e.attributes,"errorStyle"),vd(t,e.attributes,"errorTitle"),vd(t,e.attributes,"error"),this._dataValidation=t,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case"dataValidations":return!1;case"dataValidation":this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator);return(this._address.split(/\s+/g)||[]).forEach((e=>{if(e.includes(":")){new yd(e).forEachAddress((e=>{this.model[e]=this._dataValidation}))}else this.model[e]=this._dataValidation})),!0;case"formula1":case"formula2":{let e=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":e=parseInt(e,10);break;case"decimal":e=parseFloat(e);break;case"date":e=pd.excelToDate(parseFloat(e))}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}};const wd=qh;var xd=class extends wd{get tag(){return"pageSetUpPr"}render(e,t){return!(!t||!t.fitToPage)&&(e.leafNode(this.tag,{fitToPage:t.fitToPage?"1":void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={fitToPage:"1"===e.attributes.fitToPage},!0)}parseText(){}parseClose(){return!1}};const kd=qh,Sd=e=>void 0!==e;var Ed=class extends kd{get tag(){return"outlinePr"}render(e,t){return!(!t||!Sd(t.summaryBelow)&&!Sd(t.summaryRight))&&(e.leafNode(this.tag,{summaryBelow:Sd(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:Sd(t.summaryRight)?Number(t.summaryRight):void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={summaryBelow:Sd(e.attributes.summaryBelow)?Boolean(Number(e.attributes.summaryBelow)):void 0,summaryRight:Sd(e.attributes.summaryRight)?Boolean(Number(e.attributes.summaryRight)):void 0},!0)}parseText(){}parseClose(){return!1}};const Td=qh,Cd=eu,Od=xd,Rd=Ed;var Ad=class extends Td{constructor(){super(),this.map={tabColor:new Cd("tabColor"),pageSetUpPr:new Od,outlinePr:new Rd}}get tag(){return"sheetPr"}render(e,t){if(t){e.addRollback(),e.openNode("sheetPr");let r=!1;r=this.map.tabColor.render(e,t.tabColor)||r,r=this.map.pageSetUpPr.render(e,t.pageSetup)||r,r=this.map.outlinePr.render(e,t.outlineProperties)||r,r?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}};const Nd=k,Id=qh;var Pd=class extends Id{get tag(){return"sheetFormatPr"}render(e,t){if(t){const r={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(r.defaultColWidth=t.defaultColWidth),t.defaultRowHeight&&15===t.defaultRowHeight||(r.customHeight="1"),Nd.some(r,(e=>void 0!==e))&&e.leafNode("sheetFormatPr",r)}}parseOpen(e){return"sheetFormatPr"===e.name&&(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(e.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||"0",10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}};const Fd=T,Dd=qh,jd={frozen:"frozen",frozenSplit:"frozen",split:"split"};var Md=class extends Dd{get tag(){return"sheetView"}prepare(e){switch(e.state){case"frozen":case"split":break;default:e.state="normal"}}render(e,t){e.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const r=function(t,r,n){n&&e.addAttribute(t,r)};let n,i,s,o;switch(r("rightToLeft","1",!0===t.rightToLeft),r("tabSelected","1",t.tabSelected),r("showRuler","0",!1===t.showRuler),r("showRowColHeaders","0",!1===t.showRowColHeaders),r("showGridLines","0",!1===t.showGridLines),r("zoomScale",t.zoomScale,t.zoomScale),r("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),r("view",t.style,t.style),t.state){case"frozen":i=t.xSplit||0,s=t.ySplit||0,n=t.topLeftCell||Fd.getAddress(s+1,i+1).address,o=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:n,activePane:o,state:"frozen"}),e.leafNode("selection",{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":"topLeft"===t.activePane&&(t.activePane=void 0),e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&e.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}e.closeNode()}parseOpen(e){switch(e.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:"1"===e.attributes.rightToLeft,tabSelected:"1"===e.attributes.tabSelected,showRuler:!("0"===e.attributes.showRuler),showRowColHeaders:!("0"===e.attributes.showRowColHeaders),showGridLines:!("0"===e.attributes.showGridLines),zoomScale:parseInt(e.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||"100",10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(e.attributes.xSplit||"0",10),ySplit:parseInt(e.attributes.ySplit||"0",10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||"topLeft",state:e.attributes.state},!0;case"selection":{const t=e.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,r;return"sheetView"!==e||(this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:jd[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},"split"===this.model.state&&(t.activePane=this.pane.activePane),r=this.selections[this.pane.activePane],r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},r=this.selections.topLeft,r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1)}reconcile(){}};const Ld=k,Bd=qh;function zd(e,t){return e?t:void 0}function $d(e,t){return e===t||void 0}var Hd=class extends Bd{get tag(){return"sheetProtection"}render(e,t){if(t){const r={sheet:zd(t.sheet,"1"),selectLockedCells:!1===t.selectLockedCells?"1":void 0,selectUnlockedCells:!1===t.selectUnlockedCells?"1":void 0,formatCells:zd(t.formatCells,"0"),formatColumns:zd(t.formatColumns,"0"),formatRows:zd(t.formatRows,"0"),insertColumns:zd(t.insertColumns,"0"),insertRows:zd(t.insertRows,"0"),insertHyperlinks:zd(t.insertHyperlinks,"0"),deleteColumns:zd(t.deleteColumns,"0"),deleteRows:zd(t.deleteRows,"0"),sort:zd(t.sort,"0"),autoFilter:zd(t.autoFilter,"0"),pivotTables:zd(t.pivotTables,"0")};t.sheet&&(r.algorithmName=t.algorithmName,r.hashValue=t.hashValue,r.saltValue=t.saltValue,r.spinCount=t.spinCount,r.objects=zd(!1===t.objects,"1"),r.scenarios=zd(!1===t.scenarios,"1")),Ld.some(r,(e=>void 0!==e))&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={sheet:$d(e.attributes.sheet,"1"),objects:"1"!==e.attributes.objects&&void 0,scenarios:"1"!==e.attributes.scenarios&&void 0,selectLockedCells:"1"!==e.attributes.selectLockedCells&&void 0,selectUnlockedCells:"1"!==e.attributes.selectUnlockedCells&&void 0,formatCells:$d(e.attributes.formatCells,"0"),formatColumns:$d(e.attributes.formatColumns,"0"),formatRows:$d(e.attributes.formatRows,"0"),insertColumns:$d(e.attributes.insertColumns,"0"),insertRows:$d(e.attributes.insertRows,"0"),insertHyperlinks:$d(e.attributes.insertHyperlinks,"0"),deleteColumns:$d(e.attributes.deleteColumns,"0"),deleteRows:$d(e.attributes.deleteRows,"0"),sort:$d(e.attributes.sort,"0"),autoFilter:$d(e.attributes.autoFilter,"0"),pivotTables:$d(e.attributes.pivotTables,"0")},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0)}parseText(){}parseClose(){return!1}};const Ud=k,Vd=qh;var Wd=class extends Vd{get tag(){return"pageMargins"}render(e,t){if(t){const r={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Ud.some(r,(e=>void 0!==e))&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0)}parseText(){}parseClose(){return!1}};const qd=k,Xd=qh;function Zd(e){return e?"1":void 0}function Gd(e){if("overThenDown"===e)return e}function Yd(e){switch(e){case"atEnd":case"asDisplyed":return e;default:return}}function Kd(e){switch(e){case"dash":case"blank":case"NA":return e;default:return}}var Qd=class extends Xd{get tag(){return"pageSetup"}render(e,t){if(t){const r={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:Gd(t.pageOrder),blackAndWhite:Zd(t.blackAndWhite),draft:Zd(t.draft),cellComments:Yd(t.cellComments),errors:Kd(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:Zd(t.firstPageNumber),usePrinterDefaults:Zd(t.usePrinterDefaults),copies:t.copies};qd.some(r,(e=>void 0!==e))&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={paperSize:(t=e.attributes.paperSize,void 0!==t?parseInt(t,10):void 0),orientation:e.attributes.orientation||"portrait",horizontalDpi:parseInt(e.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(e.attributes.verticalDpi||"4294967295",10),pageOrder:e.attributes.pageOrder||"downThenOver",blackAndWhite:"1"===e.attributes.blackAndWhite,draft:"1"===e.attributes.draft,cellComments:e.attributes.cellComments||"None",errors:e.attributes.errors||"displayed",scale:parseInt(e.attributes.scale||"100",10),fitToWidth:parseInt(e.attributes.fitToWidth||"1",10),fitToHeight:parseInt(e.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(e.attributes.firstPageNumber||"1",10),useFirstPageNumber:"1"===e.attributes.useFirstPageNumber,usePrinterDefaults:"1"===e.attributes.usePrinterDefaults,copies:parseInt(e.attributes.copies||"1",10)},!0);var t}parseText(){}parseClose(){return!1}};const Jd=k,ep=qh;function tp(e){return e?"1":void 0}var rp=class extends ep{get tag(){return"printOptions"}render(e,t){if(t){const r={headings:tp(t.showRowColHeaders),gridLines:tp(t.showGridLines),horizontalCentered:tp(t.horizontalCentered),verticalCentered:tp(t.verticalCentered)};Jd.some(r,(e=>void 0!==e))&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={showRowColHeaders:"1"===e.attributes.headings,showGridLines:"1"===e.attributes.gridLines,horizontalCentered:"1"===e.attributes.horizontalCentered,verticalCentered:"1"===e.attributes.verticalCentered},!0)}parseText(){}parseClose(){return!1}};const np=T,ip=qh;var sp=class extends ip{get tag(){return"autoFilter"}render(e,t){if(t)if("string"==typeof t)e.leafNode("autoFilter",{ref:t});else{const r=function(e){return"string"==typeof e?e:np.getAddress(e.row,e.column).address},n=r(t.from),i=r(t.to);n&&i&&e.leafNode("autoFilter",{ref:`${n}:${i}`})}}parseOpen(e){"autoFilter"===e.name&&(this.model=e.attributes.ref)}};const op=qh;var ap=class extends op{get tag(){return"picture"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}};const lp=qh;var hp=class extends lp{get tag(){return"drawing"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}};const up=qh;var cp=class extends up{get tag(){return"tablePart"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}};const fp=qh;var dp=class extends fp{get tag(){return"brk"}render(e,t){e.leafNode("brk",t)}parseOpen(e){return"brk"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}};const pp=dp,mp=Qh;var gp=class extends mp{constructor(){super({tag:"rowBreaks",count:!0,childXform:new pp})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute("manualBreakCount",t.length));const{childXform:r}=this;t.forEach((t=>{r.render(e,t)})),e.closeNode()}else this.empty&&e.leafNode(this.tag)}};const yp=qh;var vp=class extends yp{get tag(){return"headerFooter"}render(e,t){if(t){e.addRollback();let r=!1;e.openNode("headerFooter"),t.differentFirst&&(e.addAttribute("differentFirst","1"),r=!0),t.differentOddEven&&(e.addAttribute("differentOddEven","1"),r=!0),t.oddHeader&&"string"==typeof t.oddHeader&&(e.leafNode("oddHeader",null,t.oddHeader),r=!0),t.oddFooter&&"string"==typeof t.oddFooter&&(e.leafNode("oddFooter",null,t.oddFooter),r=!0),t.evenHeader&&"string"==typeof t.evenHeader&&(e.leafNode("evenHeader",null,t.evenHeader),r=!0),t.evenFooter&&"string"==typeof t.evenFooter&&(e.leafNode("evenFooter",null,t.evenFooter),r=!0),t.firstHeader&&"string"==typeof t.firstHeader&&(e.leafNode("firstHeader",null,t.firstHeader),r=!0),t.firstFooter&&"string"==typeof t.firstFooter&&(e.leafNode("firstFooter",null,t.firstFooter),r=!0),r?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case"headerFooter":return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=1===parseInt(e.attributes.differentFirst,0)),e.attributes.differentOddEven&&(this.model.differentOddEven=1===parseInt(e.attributes.differentOddEven,0)),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(e){switch(this.currentNode){case"oddHeader":this.model.oddHeader=e;break;case"oddFooter":this.model.oddFooter=e;break;case"evenHeader":this.model.evenHeader=e;break;case"evenFooter":this.model.evenFooter=e;break;case"firstHeader":this.model.firstHeader=e;break;case"firstFooter":this.model.firstFooter=e}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}};const _p=qh;var bp=class extends _p{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag&&(this.model=this.createNewModel(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}};const wp=qh;var xp=class extends wp{get tag(){return"cfvo"}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:wp.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}};const kp=bp,Sp=eu,Ep=xp;var Tp=class extends kp{constructor(){super(),this.map={cfvo:this.cfvoXform=new Ep,color:this.colorXform=new Sp}}get tag(){return"dataBar"}render(e,t){e.openNode(this.tag),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}};const Cp=qh,Op=bp;class Rp extends Cp{get tag(){return"x14:id"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}let Ap=class extends Op{constructor(){super(),this.map={"x14:id":this.idXform=new Rp}}get tag(){return"ext"}render(e,t){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}};var Np=class extends Op{constructor(){super(),this.map={ext:new Ap}}get tag(){return"extLst"}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}};const Ip=qh;var Pp=class extends Ip{get tag(){return"formula"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}};const Fp=bp,Dp=eu,jp=xp;var Mp=class extends Fp{constructor(){super(),this.map={cfvo:this.cfvoXform=new jp,color:this.colorXform=new Dp}}get tag(){return"colorScale"}render(e,t){e.openNode(this.tag),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),t.color.forEach((t=>{this.colorXform.render(e,t)})),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}};const Lp=qh,Bp=bp,zp=xp;var $p=class extends Bp{constructor(){super(),this.map={cfvo:this.cfvoXform=new zp}}get tag(){return"iconSet"}render(e,t){e.openNode(this.tag,{iconSet:Lp.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:Lp.toBoolAttribute(t.reverse,!1),showValue:Lp.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{iconSet:Lp.toStringValue(t.iconSet,"3TrafficLights"),reverse:Lp.toBoolValue(t.reverse),showValue:Lp.toBoolValue(t.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};const Hp=qh,Up=bp,Vp=O,Wp=Tp,qp=Np,Xp=Pp,Zp=Mp,Gp=$p,Yp={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Kp=e=>{const{type:t,operator:r}=e;switch(t){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:t};default:return{type:t,operator:r}}};var Qp=class e extends Up{constructor(){super(),this.map={dataBar:this.databarXform=new Wp,extLst:this.extLstRefXform=new qp,formula:this.formulaXform=new Xp,colorScale:this.colorScaleXform=new Zp,iconSet:this.iconSetXform=new Gp}}get tag(){return"cfRule"}static isPrimitive(e){return"iconSet"!==e.type||!e.custom&&!Yp[e.iconSet]}render(e,t){switch(t.type){case"expression":this.renderExpression(e,t);break;case"cellIs":this.renderCellIs(e,t);break;case"top10":this.renderTop10(e,t);break;case"aboveAverage":this.renderAboveAverage(e,t);break;case"dataBar":this.renderDataBar(e,t);break;case"colorScale":this.renderColorScale(e,t);break;case"iconSet":this.renderIconSet(e,t);break;case"containsText":this.renderText(e,t);break;case"timePeriod":this.renderTimePeriod(e,t)}}renderExpression(e,t){e.openNode(this.tag,{type:"expression",dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:"cellIs",dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach((t=>{this.formulaXform.render(e,t)})),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:"top10",dxfId:t.dxfId,priority:t.priority,percent:Hp.toBoolAttribute(t.percent,!1),bottom:Hp.toBoolAttribute(t.bottom,!1),rank:Hp.toIntValue(t.rank,10,!0)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:"aboveAverage",dxfId:t.dxfId,priority:t.priority,aboveAverage:Hp.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:"colorScale",priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,r){e.isPrimitive(r)&&(t.openNode(this.tag,{type:"iconSet",priority:r.priority}),this.iconSetXform.render(t,r),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:Hp.toStringAttribute(t.operator,"containsText")});const r=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new Vp(e.ref),{tl:r}=t;switch(e.operator){case"containsText":return`NOT(ISERROR(SEARCH("${e.text}",${r})))`;case"containsBlanks":return`LEN(TRIM(${r}))=0`;case"notContainsBlanks":return`LEN(TRIM(${r}))>0`;case"containsErrors":return`ISERROR(${r})`;case"notContainsErrors":return`NOT(ISERROR(${r}))`;default:return}})(t);r&&this.formulaXform.render(e,r),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:"timePeriod",dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});const r=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new Vp(e.ref),{tl:r}=t;switch(e.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${r},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${r},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${r},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${r},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${r},1)=TODAY()-1`;case"today":return`FLOOR(${r},1)=TODAY()`;case"tomorrow":return`FLOOR(${r},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${r},1)<=6,FLOOR(${r},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0-1)),YEAR(${r})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${r})=MONTH(TODAY()),YEAR(${r})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0+1)),YEAR(${r})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(t);r&&this.formulaXform.render(e,r),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{...Kp(t),dxfId:Hp.toIntValue(t.dxfId),priority:Hp.toIntValue(t.priority),timePeriod:t.timePeriod,percent:Hp.toBoolValue(t.percent),bottom:Hp.toBoolValue(t.bottom),rank:Hp.toIntValue(t.rank),aboveAverage:Hp.toBoolValue(t.aboveAverage)}}onParserClose(e,t){switch(e){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,t.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model)}}};const Jp=bp,em=Qp;var tm=class extends Jp{constructor(){super(),this.map={cfRule:new em}}get tag(){return"conditionalFormatting"}render(e,t){t.rules.some(em.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach((r=>{em.isPrimitive(r)&&(r.ref=t.ref,this.map.cfRule.render(e,r))})),e.closeNode())}createNewModel(e){let{attributes:t}=e;return{ref:t.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}};const rm=qh,nm=tm;var im,sm=class extends rm{constructor(){super(),this.cfXform=new nm}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(e,t){let r=e.reduce(((e,t)=>Math.max(e,...t.rules.map((e=>e.priority||0)))),1);e.forEach((e=>{e.rules.forEach((e=>{e.priority||(e.priority=r++),e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))}))}))}render(e,t){t.forEach((t=>{this.cfXform.render(e,t)}))}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"conditionalFormatting"===e.name&&(this.parser=this.cfXform,this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(!!this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(e,t){e.forEach((e=>{e.rules.forEach((e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)}))}))}},om=new Uint8Array(16);function am(){if(!im&&!(im="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return im(om)}var lm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function hm(e){return"string"==typeof e&&lm.test(e)}for(var um,cm,fm=[],dm=0;dm<256;++dm)fm.push((dm+256).toString(16).substr(1));function pm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(fm[e[t+0]]+fm[e[t+1]]+fm[e[t+2]]+fm[e[t+3]]+"-"+fm[e[t+4]]+fm[e[t+5]]+"-"+fm[e[t+6]]+fm[e[t+7]]+"-"+fm[e[t+8]]+fm[e[t+9]]+"-"+fm[e[t+10]]+fm[e[t+11]]+fm[e[t+12]]+fm[e[t+13]]+fm[e[t+14]]+fm[e[t+15]]).toLowerCase();if(!hm(r))throw TypeError("Stringified UUID is invalid");return r}var mm=0,gm=0;function ym(e){if(!hm(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function vm(e,t,r){function n(e,n,i,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=ym(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var o=new Uint8Array(16+e.length);if(o.set(n),o.set(e,n.length),(o=r(o))[6]=15&o[6]|t,o[8]=63&o[8]|128,i){s=s||0;for(var a=0;a<16;++a)i[s+a]=o[a];return i}return pm(o)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function _m(e){return 14+(e+64>>>9<<4)+1}function bm(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function wm(e,t,r,n,i,s){return bm((o=bm(bm(t,e),bm(n,s)))<<(a=i)|o>>>32-a,r);var o,a}function xm(e,t,r,n,i,s,o){return wm(t&r|~t&n,e,t,i,s,o)}function km(e,t,r,n,i,s,o){return wm(t&n|r&~n,e,t,i,s,o)}function Sm(e,t,r,n,i,s,o){return wm(t^r^n,e,t,i,s,o)}function Em(e,t,r,n,i,s,o){return wm(r^(t|~n),e,t,i,s,o)}var Tm=vm("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var s=e[i>>5]>>>i%32&255,o=parseInt(n.charAt(s>>>4&15)+n.charAt(15&s),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[_m(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,s=271733878,o=0;o<e.length;o+=16){var a=r,l=n,h=i,u=s;r=xm(r,n,i,s,e[o],7,-680876936),s=xm(s,r,n,i,e[o+1],12,-389564586),i=xm(i,s,r,n,e[o+2],17,606105819),n=xm(n,i,s,r,e[o+3],22,-1044525330),r=xm(r,n,i,s,e[o+4],7,-176418897),s=xm(s,r,n,i,e[o+5],12,1200080426),i=xm(i,s,r,n,e[o+6],17,-1473231341),n=xm(n,i,s,r,e[o+7],22,-45705983),r=xm(r,n,i,s,e[o+8],7,1770035416),s=xm(s,r,n,i,e[o+9],12,-1958414417),i=xm(i,s,r,n,e[o+10],17,-42063),n=xm(n,i,s,r,e[o+11],22,-1990404162),r=xm(r,n,i,s,e[o+12],7,1804603682),s=xm(s,r,n,i,e[o+13],12,-40341101),i=xm(i,s,r,n,e[o+14],17,-1502002290),r=km(r,n=xm(n,i,s,r,e[o+15],22,1236535329),i,s,e[o+1],5,-165796510),s=km(s,r,n,i,e[o+6],9,-1069501632),i=km(i,s,r,n,e[o+11],14,643717713),n=km(n,i,s,r,e[o],20,-373897302),r=km(r,n,i,s,e[o+5],5,-701558691),s=km(s,r,n,i,e[o+10],9,38016083),i=km(i,s,r,n,e[o+15],14,-660478335),n=km(n,i,s,r,e[o+4],20,-405537848),r=km(r,n,i,s,e[o+9],5,568446438),s=km(s,r,n,i,e[o+14],9,-1019803690),i=km(i,s,r,n,e[o+3],14,-187363961),n=km(n,i,s,r,e[o+8],20,1163531501),r=km(r,n,i,s,e[o+13],5,-1444681467),s=km(s,r,n,i,e[o+2],9,-51403784),i=km(i,s,r,n,e[o+7],14,1735328473),r=Sm(r,n=km(n,i,s,r,e[o+12],20,-1926607734),i,s,e[o+5],4,-378558),s=Sm(s,r,n,i,e[o+8],11,-2022574463),i=Sm(i,s,r,n,e[o+11],16,1839030562),n=Sm(n,i,s,r,e[o+14],23,-35309556),r=Sm(r,n,i,s,e[o+1],4,-1530992060),s=Sm(s,r,n,i,e[o+4],11,1272893353),i=Sm(i,s,r,n,e[o+7],16,-155497632),n=Sm(n,i,s,r,e[o+10],23,-1094730640),r=Sm(r,n,i,s,e[o+13],4,681279174),s=Sm(s,r,n,i,e[o],11,-358537222),i=Sm(i,s,r,n,e[o+3],16,-722521979),n=Sm(n,i,s,r,e[o+6],23,76029189),r=Sm(r,n,i,s,e[o+9],4,-640364487),s=Sm(s,r,n,i,e[o+12],11,-421815835),i=Sm(i,s,r,n,e[o+15],16,530742520),r=Em(r,n=Sm(n,i,s,r,e[o+2],23,-995338651),i,s,e[o],6,-198630844),s=Em(s,r,n,i,e[o+7],10,1126891415),i=Em(i,s,r,n,e[o+14],15,-1416354905),n=Em(n,i,s,r,e[o+5],21,-57434055),r=Em(r,n,i,s,e[o+12],6,1700485571),s=Em(s,r,n,i,e[o+3],10,-1894986606),i=Em(i,s,r,n,e[o+10],15,-1051523),n=Em(n,i,s,r,e[o+1],21,-2054922799),r=Em(r,n,i,s,e[o+8],6,1873313359),s=Em(s,r,n,i,e[o+15],10,-30611744),i=Em(i,s,r,n,e[o+6],15,-1560198380),n=Em(n,i,s,r,e[o+13],21,1309151649),r=Em(r,n,i,s,e[o+4],6,-145523070),s=Em(s,r,n,i,e[o+11],10,-1120210379),i=Em(i,s,r,n,e[o+2],15,718787259),n=Em(n,i,s,r,e[o+9],21,-343485551),r=bm(r,a),n=bm(n,l),i=bm(i,h),s=bm(s,u)}return[r,n,i,s]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(_m(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),Cm=Tm;function Om(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function Rm(e,t){return e<<t|e>>>32-t}var Am=vm("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var s=e.length/4+2,o=Math.ceil(s/16),a=new Array(o),l=0;l<o;++l){for(var h=new Uint32Array(16),u=0;u<16;++u)h[u]=e[64*l+4*u]<<24|e[64*l+4*u+1]<<16|e[64*l+4*u+2]<<8|e[64*l+4*u+3];a[l]=h}a[o-1][14]=8*(e.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(e.length-1)&4294967295;for(var c=0;c<o;++c){for(var f=new Uint32Array(80),d=0;d<16;++d)f[d]=a[c][d];for(var p=16;p<80;++p)f[p]=Rm(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var m=r[0],g=r[1],y=r[2],v=r[3],_=r[4],b=0;b<80;++b){var w=Math.floor(b/20),x=Rm(m,5)+Om(w,g,y,v)+_+t[w]+f[b]>>>0;_=v,v=y,y=Rm(g,30)>>>0,g=m,m=x}r[0]=r[0]+m>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Nm=Am;var Im=Object.freeze({__proto__:null,NIL:"00000000-0000-0000-0000-000000000000",parse:ym,stringify:pm,v1:function(e,t,r){var n=t&&r||0,i=t||new Array(16),s=(e=e||{}).node||um,o=void 0!==e.clockseq?e.clockseq:cm;if(null==s||null==o){var a=e.random||(e.rng||am)();null==s&&(s=um=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==o&&(o=cm=16383&(a[6]<<8|a[7]))}var l=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:gm+1,u=l-mm+(h-gm)/1e4;if(u<0&&void 0===e.clockseq&&(o=o+1&16383),(u<0||l>mm)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");mm=l,gm=h,cm=o;var c=(1e4*(268435455&(l+=122192928e5))+h)%4294967296;i[n++]=c>>>24&255,i[n++]=c>>>16&255,i[n++]=c>>>8&255,i[n++]=255&c;var f=l/4294967296*1e4&268435455;i[n++]=f>>>8&255,i[n++]=255&f,i[n++]=f>>>24&15|16,i[n++]=f>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var d=0;d<6;++d)i[n+d]=s[d];return t||pm(i)},v3:Cm,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||am)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return pm(n)},v5:Nm,validate:hm,version:function(e){if(!hm(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}}),Pm=g(Im);const Fm=qh;var Dm=class extends Fm{get tag(){return"xm:f"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}};const jm=bp,Mm=Dm;var Lm=class extends jm{constructor(){super(),this.map={"xm:f":this.fExtXform=new Mm}}get tag(){return"x14:cfvo"}render(e,t){e.openNode(this.tag,{type:t.type}),void 0!==t.value&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){if("xm:f"===e)this.model.value=t.model?parseFloat(t.model):0}};const Bm=qh,zm=bp,$m=eu,Hm=Lm;var Um=class extends zm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Hm,"x14:borderColor":this.borderColorXform=new $m("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new $m("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new $m("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new $m("x14:axisColor")}}static isExt(e){return!e.gradient}get tag(){return"x14:dataBar"}render(e,t){e.openNode(this.tag,{minLength:Bm.toIntAttribute(t.minLength,0,!0),maxLength:Bm.toIntAttribute(t.maxLength,100,!0),border:Bm.toBoolAttribute(t.border,!1),gradient:Bm.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:Bm.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:Bm.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:Bm.toAttribute(t.axisPosition,"auto"),direction:Bm.toAttribute(t.direction,"leftToRight")}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],minLength:Bm.toIntValue(t.minLength,0),maxLength:Bm.toIntValue(t.maxLength,100),border:Bm.toBoolValue(t.border,!1),gradient:Bm.toBoolValue(t.gradient,!0),negativeBarColorSameAsPositive:Bm.toBoolValue(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:Bm.toBoolValue(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:Bm.toStringValue(t.axisPosition,"auto"),direction:Bm.toStringValue(t.direction,"leftToRight")}}onParserClose(e,t){const[,r]=e.split(":");if("cfvo"===r)this.model.cfvo.push(t.model);else this.model[r]=t.model}};const Vm=qh;var Wm=class extends Vm{get tag(){return"x14:cfIcon"}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen(e){let{attributes:t}=e;this.model={iconSet:t.iconSet,iconId:Vm.toIntValue(t.iconId)}}parseClose(e){return e!==this.tag}};const qm=qh,Xm=bp,Zm=Lm,Gm=Wm;var Ym=class extends Xm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Zm,"x14:cfIcon":this.cfIconXform=new Gm}}get tag(){return"x14:iconSet"}render(e,t){e.openNode(this.tag,{iconSet:qm.toStringAttribute(t.iconSet),reverse:qm.toBoolAttribute(t.reverse,!1),showValue:qm.toBoolAttribute(t.showValue,!0),custom:qm.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),t.icons&&t.icons.forEach(((t,r)=>{t.iconId=r,this.cfIconXform.render(e,t)})),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],iconSet:qm.toStringValue(t.iconSet,"3TrafficLights"),reverse:qm.toBoolValue(t.reverse,!1),showValue:qm.toBoolValue(t.showValue,!0)}}onParserClose(e,t){const[,r]=e.split(":");switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[r]=t.model}}};const{v4:Km}=Pm,Qm=qh,Jm=bp,eg=Um,tg=Ym,rg={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var ng=class e extends Jm{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new eg,"x14:iconSet":this.iconSetXform=new tg}}get tag(){return"x14:cfRule"}static isExt(e){return"dataBar"===e.type?eg.isExt(e):!("iconSet"!==e.type||!e.custom&&!rg[e.iconSet])}prepare(t){e.isExt(t)&&(t.x14Id=`{${Km()}}`.toUpperCase())}render(t,r){if(e.isExt(r))switch(r.type){case"dataBar":this.renderDataBar(t,r);break;case"iconSet":this.renderIconSet(t,r)}}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:"iconSet",priority:t.priority,id:t.x14Id||`{${Km()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{type:t.type,x14Id:t.id,priority:Qm.toIntValue(t.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}};const ig=qh;var sg=class extends ig{get tag(){return"xm:sqref"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}};const og=bp,ag=sg,lg=ng;var hg=class extends og{constructor(){super(),this.map={"xm:sqref":this.sqRef=new ag,"x14:cfRule":this.cfRule=new lg}}get tag(){return"x14:conditionalFormatting"}prepare(e,t){e.rules.forEach((e=>{this.cfRule.prepare(e,t)}))}render(e,t){t.rules.some(lg.isExt)&&(e.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(lg.isExt).forEach((t=>this.cfRule.render(e,t))),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}};const ug=bp,cg=ng,fg=hg;var dg=class extends ug{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new fg}}get tag(){return"x14:conditionalFormattings"}hasContent(e){return void 0===e.hasExtContent&&(e.hasExtContent=e.some((e=>e.rules.some(cg.isExt)))),e.hasExtContent}prepare(e,t){e.forEach((e=>{this.cfXform.prepare(e,t)}))}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach((t=>this.cfXform.render(e,t))),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}};const pg=bp,mg=dg;let gg=class extends pg{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new mg}}get tag(){return"ext"}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,t){this.conditionalFormattings.prepare(e.conditionalFormattings,t)}render(e,t){e.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}};var yg=class extends pg{constructor(){super(),this.map={ext:this.ext=new gg}}get tag(){return"extLst"}prepare(e,t){this.ext.prepare(e,t)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode("extLst"),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}};const vg=k,_g=T,bg=Jl,wg=$f,xg=qf,kg=qh,Sg=Qh,Eg=nd,Tg=od,Cg=ld,Og=ud,Rg=fd,Ag=bd,Ng=Ad,Ig=Pd,Pg=Md,Fg=Hd,Dg=Wd,jg=Qd,Mg=rp,Lg=sp,Bg=ap,zg=hp,$g=cp,Hg=gp,Ug=vp,Vg=sm,Wg=yg,qg=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;const r={},n={};return e.forEach((e=>{r[e.ref]=e,e.rules.forEach((e=>{const{x14Id:t}=e;t&&(n[t]=e)}))})),t.forEach((t=>{t.rules.forEach((i=>{const s=n[i.x14Id];s?((e,t)=>{Object.keys(t).forEach((r=>{const n=e[r],i=t[r];void 0===n&&void 0!==i&&(e[r]=i)}))})(s,i):r[t.ref]?r[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})}))})),e};class Xg extends kg{constructor(e){super();const{maxRows:t,maxCols:r,ignoreNodes:n}=e||{};this.ignoreNodes=n||[],this.map={sheetPr:new Ng,dimension:new Cg,sheetViews:new Sg({tag:"sheetViews",count:!1,childXform:new Pg}),sheetFormatPr:new Ig,cols:new Sg({tag:"cols",count:!1,childXform:new Tg}),sheetData:new Sg({tag:"sheetData",count:!1,empty:!0,childXform:new Eg({maxItems:r}),maxItems:t}),autoFilter:new Lg,mergeCells:new Sg({tag:"mergeCells",count:!0,childXform:new Rg}),rowBreaks:new Hg,hyperlinks:new Sg({tag:"hyperlinks",count:!1,childXform:new Og}),pageMargins:new Dg,dataValidations:new Ag,pageSetup:new jg,headerFooter:new Ug,printOptions:new Mg,picture:new Bg,drawing:new zg,sheetProtection:new Fg,tableParts:new Sg({tag:"tableParts",count:!0,childXform:new $g}),conditionalFormatting:new Vg,extLst:new Wg}}prepare(e,t){t.merges=new xg,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;const r=e.rels=[];function n(e){return`rId${e.length+1}`}if(e.hyperlinks.forEach((e=>{const t=n(r);e.rId=t,r.push({Id:t,Type:wg.Hyperlink,Target:e.target,TargetMode:"External"})})),e.comments.length>0){const i={Id:n(r),Type:wg.Comments,Target:`../comments${e.id}.xml`};r.push(i);const s={Id:n(r),Type:wg.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};r.push(s),e.comments.forEach((e=>{e.refAddress=_g.decodeAddress(e.ref)})),t.commentRefs.push({commentName:`comments${e.id}`,vmlDrawing:`vmlDrawing${e.id}`})}const i=[];let s;e.media.forEach((o=>{if("background"===o.type){const i=n(r);s=t.media[o.imageId],r.push({Id:i,Type:wg.Image,Target:`../media/${s.name}.${s.extension}`}),e.background={rId:i},e.image=t.media[o.imageId]}else if("image"===o.type){let{drawing:a}=e;s=t.media[o.imageId],a||(a=e.drawing={rId:n(r),name:"drawing"+ ++t.drawingsCount,anchors:[],rels:[]},t.drawings.push(a),r.push({Id:a.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${a.name}.xml`}));let l=this.preImageId===o.imageId?i[o.imageId]:i[a.rels.length];l||(l=n(a.rels),i[a.rels.length]=l,a.rels.push({Id:l,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${s.name}.${s.extension}`}));const h={picture:{rId:l},range:o.range};if(o.hyperlinks&&o.hyperlinks.hyperlink){const e=n(a.rels);i[a.rels.length]=e,h.picture.hyperlinks={tooltip:o.hyperlinks.tooltip,rId:e},a.rels.push({Id:e,Type:wg.Hyperlink,Target:o.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=o.imageId,a.anchors.push(h)}})),e.tables.forEach((e=>{const i=n(r);e.rId=i,r.push({Id:i,Type:wg.Table,Target:`../tables/${e.target}`}),e.columns.forEach((e=>{const{style:r}=e;r&&(e.dxfId=t.styles.addDxfStyle(r))}))})),this.map.extLst.prepare(e,t)}render(e,t){e.openXml(bg.StdDocAttributes),e.openNode("worksheet",Xg.WORKSHEET_ATTRIBUTES);const r=t.properties?{defaultRowHeight:t.properties.defaultRowHeight,dyDescent:t.properties.dyDescent,outlineLevelCol:t.properties.outlineLevelCol,outlineLevelRow:t.properties.outlineLevelRow}:void 0;t.properties&&t.properties.defaultColWidth&&(r.defaultColWidth=t.properties.defaultColWidth);const n={outlineProperties:t.properties&&t.properties.outlineProperties,tabColor:t.properties&&t.properties.tabColor,pageSetup:t.pageSetup&&t.pageSetup.fitToPage?{fitToPage:t.pageSetup.fitToPage}:void 0},i=t.pageSetup&&t.pageSetup.margins,s={showRowColHeaders:t.pageSetup&&t.pageSetup.showRowColHeaders,showGridLines:t.pageSetup&&t.pageSetup.showGridLines,horizontalCentered:t.pageSetup&&t.pageSetup.horizontalCentered,verticalCentered:t.pageSetup&&t.pageSetup.verticalCentered},o=t.sheetProtection;this.map.sheetPr.render(e,n),this.map.dimension.render(e,t.dimensions),this.map.sheetViews.render(e,t.views),this.map.sheetFormatPr.render(e,r),this.map.cols.render(e,t.cols),this.map.sheetData.render(e,t.rows),this.map.sheetProtection.render(e,o),this.map.autoFilter.render(e,t.autoFilter),this.map.mergeCells.render(e,t.mergeCells),this.map.conditionalFormatting.render(e,t.conditionalFormattings),this.map.dataValidations.render(e,t.dataValidations),this.map.hyperlinks.render(e,t.hyperlinks),this.map.printOptions.render(e,s),this.map.pageMargins.render(e,i),this.map.pageSetup.render(e,t.pageSetup),this.map.headerFooter.render(e,t.headerFooter),this.map.rowBreaks.render(e,t.rowBreaks),this.map.drawing.render(e,t.drawing),this.map.picture.render(e,t.background),this.map.tableParts.render(e,t.tables),this.map.extLst.render(e,t),t.rels&&t.rels.forEach((t=>{t.Type===wg.VmlDrawing&&e.leafNode("legacyDrawing",{"r:id":t.Id})})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"worksheet"===e.name?(vg.each(this.map,(e=>{e.reset()})),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("worksheet"===e){const e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);const t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},r=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),n=qg(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:r,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:n},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}return!0}reconcile(e,t){const r=(e.relationships||[]).reduce(((r,n)=>{if(r[n.Id]=n,n.Type===wg.Comments&&(e.comments=t.comments[n.Target].comments),n.Type===wg.VmlDrawing&&e.comments&&e.comments.length){const r=t.vmlDrawings[n.Target].comments;e.comments.forEach(((e,t)=>{e.note=Object.assign({},e.note,r[t])}))}return r}),{});if(t.commentsMap=(e.comments||[]).reduce(((e,t)=>(t.ref&&(e[t.ref]=t),e)),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce(((e,t)=>(t.rId&&(e[t.address]=r[t.rId].Target),e)),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach((e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]})),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){const n=r[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(n){const r=n[1];t.drawings[r].anchors.forEach((t=>{if(t.medium){const r={type:"image",imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(r)}}))}}const n=e.background&&r[e.background.rId];if(n){const r=n.Target.split("/media/")[1],i=t.mediaIndex&&t.mediaIndex[r];void 0!==i&&e.media.push({type:"background",imageId:i})}e.tables=(e.tables||[]).map((e=>{const n=r[e.rId];return t.tables[n.Target]})),delete e.relationships,delete e.hyperlinks,delete e.comments}}Xg.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"};var Zg=Xg;const Gg=qh;var Yg=class extends Gg{parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset(),this.model={range:{editAs:e.attributes.editAs||"oneCell"}};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){const r=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const e=r[1],n=t.mediaIndex[e];return t.media[n]}}}};const Kg=qh,Qg=iu;var Jg=class extends Kg{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new Qg({tag:"xdr:col",zero:!0}),"xdr:colOff":new Qg({tag:"xdr:colOff",zero:!0}),"xdr:row":new Qg({tag:"xdr:row",zero:!0}),"xdr:rowOff":new Qg({tag:"xdr:rowOff",zero:!0})}}render(e,t){e.openNode(this.tag),this.map["xdr:col"].render(e,t.nativeCol),this.map["xdr:colOff"].render(e,t.nativeColOff),this.map["xdr:row"].render(e,t.nativeRow),this.map["xdr:rowOff"].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset();else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1)}};const ey=qh;var ty=class extends ey{get tag(){return"a:blip"}render(e,t){e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":t.rId,cstate:"print"})}parseOpen(e){return e.name!==this.tag||(this.model={rId:e.attributes["r:embed"]},!0)}parseText(){}parseClose(e){return e!==this.tag}};const ry=qh,ny=ty;var iy=class extends ry{constructor(){super(),this.map={"a:blip":new ny}}get tag(){return"xdr:blipFill"}render(e,t){e.openNode(this.tag),this.map["a:blip"].render(e,t),e.openNode("a:stretch"),e.leafNode("a:fillRect"),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset();else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:blip"].model,!1)}};const sy=qh;var oy=class extends sy{get tag(){return"a:hlinkClick"}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){return e.name!==this.tag||(this.model={hyperlinks:{rId:e.attributes["r:id"],tooltip:e.attributes.tooltip}},!0)}parseText(){}parseClose(){return!1}};const ay=qh;var ly=class extends ay{get tag(){return"a:extLst"}render(e){e.openNode(this.tag),e.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),e.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}};const hy=qh,uy=oy,cy=ly;var fy=class extends hy{constructor(){super(),this.map={"a:hlinkClick":new uy,"a:extLst":new cy}}get tag(){return"xdr:cNvPr"}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map["a:hlinkClick"].render(e,t),this.map["a:extLst"].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset();else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:hlinkClick"].model,!1)}};const dy=qh;var py=class extends dy{get tag(){return"xdr:cNvPicPr"}render(e){e.openNode(this.tag),e.leafNode("a:picLocks",{noChangeAspect:"1"}),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}};const my=qh,gy=fy,yy=py;var vy=class extends my{constructor(){super(),this.map={"xdr:cNvPr":new gy,"xdr:cNvPicPr":new yy}}get tag(){return"xdr:nvPicPr"}render(e,t){e.openNode(this.tag),this.map["xdr:cNvPr"].render(e,t),this.map["xdr:cNvPicPr"].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset();else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["xdr:cNvPr"].model,!1)}};const _y=qh,by=Yh,wy=iy,xy=vy,ky={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]};var Sy=class extends _y{constructor(){super(),this.map={"xdr:nvPicPr":new xy,"xdr:blipFill":new wy,"xdr:spPr":new by(ky)}}get tag(){return"xdr:pic"}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,t),this.map["xdr:blipFill"].render(e,t),this.map["xdr:spPr"].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset();else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):e!==this.tag}};const Ey=Yg,Ty=Yh,Cy=Jg,Oy=Sy;var Ry=class extends Ey{constructor(){super(),this.map={"xdr:from":new Cy({tag:"xdr:from"}),"xdr:to":new Cy({tag:"xdr:to"}),"xdr:pic":new Oy,"xdr:clientData":new Ty({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:to"].render(e,t.range.br),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};const Ay=qh,Ny=9525;var Iy=class extends Ay{constructor(e){super(),this.tag=e.tag,this.map={}}render(e,t){e.openNode(this.tag);const r=Math.floor(t.width*Ny),n=Math.floor(t.height*Ny);e.addAttribute("cx",r),e.addAttribute("cy",n),e.closeNode()}parseOpen(e){return e.name===this.tag&&(this.model={width:parseInt(e.attributes.cx||"0",10)/Ny,height:parseInt(e.attributes.cy||"0",10)/Ny},!0)}parseText(){}parseClose(){return!1}};const Py=Yg,Fy=Yh,Dy=Jg,jy=Iy,My=Sy;var Ly=class extends Py{constructor(){super(),this.map={"xdr:from":new Dy({tag:"xdr:from"}),"xdr:ext":new jy({tag:"xdr:ext"}),"xdr:pic":new My,"xdr:clientData":new Fy({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:ext"].render(e,t.range.ext),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};const By=T,zy=Jl,$y=qh,Hy=Ry,Uy=Ly;let Vy=class e extends $y{constructor(){super(),this.map={"xdr:twoCellAnchor":new Hy,"xdr:oneCellAnchor":new Uy}}prepare(e){e.anchors.forEach(((e,t)=>{e.anchorType=function(e){return("string"==typeof e.range?By.decode(e.range):e.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(e);this.map[e.anchorType].prepare(e,{index:t})}))}get tag(){return"xdr:wsDr"}render(t,r){t.openXml(zy.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach((e=>{this.map[e.anchorType].render(t,e)})),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset(),this.model={anchors:[]};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach((e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)}))}};Vy.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"};var Wy=Vy;const qy=qh;var Xy=class extends qy{get tag(){return"customFilter"}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val,operator:e.attributes.operator},!0)}parseText(){}parseClose(){return!1}};const Zy=qh;var Gy=class extends Zy{get tag(){return"filter"}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val},!0)}parseText(){}parseClose(){return!1}};const Yy=qh,Ky=Qh,Qy=Xy,Jy=Gy;var ev=class extends Yy{constructor(){super(),this.map={customFilters:new Ky({tag:"customFilters",count:!1,empty:!0,childXform:new Qy}),filters:new Ky({tag:"filters",count:!1,empty:!0,childXform:new Jy})}}get tag(){return"filterColumn"}prepare(e,t){e.colId=t.index.toString()}render(e,t){return t.customFilters?(e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),this.map.customFilters.render(e,t.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{attributes:t}=e;if(e.name===this.tag)return this.model={filterButton:"0"===t.hiddenButton},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.customFilters=this.map.customFilters.model,!1)}};const tv=qh,rv=ev;var nv=class extends tv{constructor(){super(),this.map={filterColumn:new rv}}get tag(){return"autoFilter"}prepare(e){e.columns.forEach(((e,t)=>{this.map.filterColumn.prepare(e,{index:t})}))}render(e,t){return e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach((t=>{this.map.filterColumn.render(e,t)})),e.closeNode(),!0}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(e===this.tag)return!1;throw new Error(`Unexpected xml node in parseClose: ${e}`)}};const iv=qh;var sv=class extends iv{get tag(){return"tableColumn"}prepare(e,t){e.id=t.index+1}render(e,t){return e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}};const ov=qh;var av=class extends ov{get tag(){return"tableStyleInfo"}render(e,t){return e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?"1":"0",showLastColumn:t.showLastColumn?"1":"0",showRowStripes:t.showRowStripes?"1":"0",showColumnStripes:t.showColumnStripes?"1":"0"}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:"1"===t.showFirstColumn,showLastColumn:"1"===t.showLastColumn,showRowStripes:"1"===t.showRowStripes,showColumnStripes:"1"===t.showColumnStripes},!0}return!1}parseText(){}parseClose(){return!1}};const lv=Jl,hv=qh,uv=Qh,cv=nv,fv=sv,dv=av;let pv=class e extends hv{constructor(){super(),this.map={autoFilter:new cv,tableColumns:new uv({tag:"tableColumns",count:!0,empty:!0,childXform:new fv}),tableStyleInfo:new dv}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return"table"}render(t,r){t.openXml(lv.StdDocAttributes),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:r.id,name:r.name,displayName:r.displayName||r.name,ref:r.tableRef,totalsRowCount:r.totalsRow?"1":void 0,totalsRowShown:r.totalsRow?void 0:"1",headerRowCount:r.headerRow?"1":"0"}),this.map.autoFilter.render(t,r),this.map.tableColumns.render(t,r.columns),this.map.tableStyleInfo.render(t,r.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{name:t,attributes:r}=e;if(t===this.tag)this.reset(),this.model={name:r.name,displayName:r.displayName||r.name,tableRef:r.ref,totalsRow:"1"===r.totalsRowCount,headerRow:"1"===r.headerRowCount};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach(((e,t)=>{this.model.columns[t].filterButton=e.filterButton}))),this.model.style=this.map.tableStyleInfo.model,!1)}reconcile(e,t){e.columns.forEach((e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId))}))}};pv.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"};var mv=pv,gv={exports:{}},yv={exports:{}};const vv=Nc,_v=Cl,bv=qh,wv=yv.exports=function(e){this.model=e};_v.inherits(wv,bv,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new vv),this._richTextXform},render(e,t){t=t||this.model,e.openNode("comment",{ref:t.ref,authorId:0}),e.openNode("text"),t&&t.note&&t.note.texts&&t.note.texts.forEach((t=>{this.richTextXform.render(e,t)})),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"comment":return this.model={type:"note",note:{texts:[]},...e.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}});var xv=yv.exports;const kv=Jl,Sv=Cl,Ev=qh,Tv=xv,Cv=gv.exports=function(){this.map={comment:new Tv}};Sv.inherits(Cv,Ev,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,t){t=t||this.model,e.openXml(kv.StdDocAttributes),e.openNode("comments",Cv.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),t.comments.forEach((t=>{this.map.comment.render(e,t)})),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}});var Ov=gv.exports;const Rv=qh;var Av=class extends Rv{get tag(){return"v:textbox"}conversionUnit(e,t,r){return`${parseFloat(e)*t.toFixed(2)}${r}`}reverseConversionUnit(e){return(e||"").split(",").map((e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,"")).toFixed(2))))}render(e,t){const r={style:"mso-direction-alt:auto"};if(t&&t.note){let{inset:e}=t.note&&t.note.margins;Array.isArray(e)&&(e=e.map((e=>this.conversionUnit(e,10,"mm"))).join(",")),e&&(r.inset=e)}e.openNode("v:textbox",r),e.leafNode("div",{style:"text-align:left"}),e.closeNode()}parseOpen(e){return e.name!==this.tag||(this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0)}parseText(){}parseClose(e){return e!==this.tag}};const Nv=qh;var Iv=class extends Nv{get tag(){return"x:Anchor"}getAnchorRect(e){const t=Math.floor(e.left),r=Math.floor(68*(e.left-t)),n=Math.floor(e.top),i=Math.floor(18*(e.top-n)),s=Math.floor(e.right),o=Math.floor(68*(e.right-s)),a=Math.floor(e.bottom);return[t,r,n,i,s,o,a,Math.floor(18*(e.bottom-a))]}getDefaultRect(e){const t=e.col,r=Math.max(e.row-2,0);return[t,6,r,14,t+2,2,r+4,16]}render(e,t){const r=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode("x:Anchor",null,r.join(", "))}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}};const Pv=qh;var Fv=class extends Pv{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}};const Dv=qh;var jv=class extends Dv{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t,r){(t===r[2]||"x:SizeWithCells"===this.tag&&t===r[1])&&e.leafNode(this.tag)}parseOpen(e){return e.name===this.tag&&(this.model={},this.model[this.tag]=!0,!0)}parseText(){}parseClose(){return!1}};const Mv=qh,Lv=Iv,Bv=Fv,zv=jv,$v=["twoCells","oneCells","absolute"];var Hv=class extends Mv{constructor(){super(),this.map={"x:Anchor":new Lv,"x:Locked":new Bv({tag:"x:Locked"}),"x:LockText":new Bv({tag:"x:LockText"}),"x:SizeWithCells":new zv({tag:"x:SizeWithCells"}),"x:MoveWithCells":new zv({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,t){const{protection:r,editAs:n}=t.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,n,$v),this.map["x:SizeWithCells"].render(e,n,$v),this.map["x:Anchor"].render(e,t),this.map["x:Locked"].render(e,r.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,r.lockText),e.leafNode("x:Row",null,t.refAddress.row-1),e.leafNode("x:Column",null,t.refAddress.col-1),e.closeNode()}parseOpen(e){if(e.name===this.tag)this.reset(),this.model={anchor:[],protection:{},editAs:""};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.normalizeModel(),!1)}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),t=Object.keys(e).length;this.model.editAs=$v[t],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}};const Uv=qh,Vv=Av,Wv=Hv;let qv=class e extends Uv{constructor(){super(),this.map={"v:textbox":new Vv,"x:ClientData":new Wv}}get tag(){return"v:shape"}render(t,r,n){t.openNode("v:shape",e.V_SHAPE_ATTRIBUTES(r,n)),t.leafNode("v:fill",{color2:"infoBackground [80]"}),t.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),t.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(t,r),this.map["x:ClientData"].render(t,r),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1)}};qv.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":e.note.margins&&e.note.margins.insetmode});var Xv=qv;const Zv=Jl,Gv=qh,Yv=Xv;let Kv=class e extends Gv{constructor(){super(),this.map={"v:shape":new Yv}}get tag(){return"xml"}render(t,r){t.openXml(Zv.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode("o:shapelayout",{"v:ext":"edit"}),t.leafNode("o:idmap",{"v:ext":"edit",data:1}),t.closeNode(),t.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),t.leafNode("v:stroke",{joinstyle:"miter"}),t.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),t.closeNode(),r.comments.forEach(((e,r)=>{this.map["v:shape"].render(t,e,r)})),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)this.reset(),this.model={comments:[]};else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach((e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)}))}};Kv.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"};var Qv=Kv,Jv='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>';const e_=r,t_=Da,{PassThrough:r_}=kl,n_=ql,i_=Ml,s_=Cl,o_=Jl,{bufferToString:a_}=eh,l_=mc,h_=Sc,u_=Vc,c_=Kc,f_=tf,d_=df,p_=zf,m_=Zg,g_=Wy,y_=mv,v_=Ov,__=Qv,b_=Jv;let w_=class e{constructor(e){this.workbook=e}async readFile(e,t){if(!await s_.fs.exists(e))throw new Error(`File not found: ${e}`);const r=e_.createReadStream(e);try{const e=await this.read(r,t);return r.close(),e}catch(e){throw r.close(),e}}parseRels(e){return(new c_).parseStream(e)}parseWorkbook(e){return(new p_).parseStream(e)}parseSharedStrings(e){return(new u_).parseStream(e)}reconcile(e,t){const r=new p_,n=new m_(t),i=new g_,s=new y_;r.reconcile(e);const o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach((t=>{const r=e.drawings[t],n=e.drawingRels[t];n&&(o.rels=n.reduce(((e,t)=>(e[t.Id]=t,e)),{}),(r.anchors||[]).forEach((e=>{const t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)})),i.reconcile(r,o))}));const a={styles:e.styles};Object.values(e.tables).forEach((e=>{s.reconcile(e,a)}));const l={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach((t=>{t.relationships=e.worksheetRels[t.sheetNo],n.reconcile(t,l)})),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,r,n,i){const s=new m_(n),o=await s.parseStream(e);o.sheetNo=r,t.worksheetHash[i]=o,t.worksheets.push(o)}async _processCommentEntry(e,t,r){const n=new v_,i=await n.parseStream(e);t.comments[`../${r}.xml`]=i}async _processTableEntry(e,t,r){const n=new y_,i=await n.parseStream(e);t.tables[`../tables/${r}.xml`]=i}async _processWorksheetRelsEntry(e,t,r){const n=new c_,i=await n.parseStream(e);t.worksheetRels[r]=i}async _processMediaEntry(e,t,r){const n=r.lastIndexOf(".");if(n>=1){const i=r.substr(n+1),s=r.substr(0,n);await new Promise(((n,o)=>{const a=new i_;a.on("finish",(()=>{t.mediaIndex[r]=t.media.length,t.mediaIndex[s]=t.media.length;const e={type:"image",name:s,extension:i,buffer:a.toBuffer()};t.media.push(e),n()})),e.on("error",(e=>{o(e)})),e.pipe(a)}))}}async _processDrawingEntry(e,t,r){const n=new g_,i=await n.parseStream(e);t.drawings[r]=i}async _processDrawingRelsEntry(e,t,r){const n=new c_,i=await n.parseStream(e);t.drawingRels[r]=i}async _processVmlDrawingEntry(e,t,r){const n=new __,i=await n.parseStream(e);t.vmlDrawings[`../drawings/${r}.vml`]=i}async _processThemeEntry(e,t,r){await new Promise(((n,i)=>{const s=new i_;e.on("error",i),s.on("error",i),s.on("finish",(()=>{t.themes[r]=s.read().toString(),n()})),e.pipe(s)}))}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(e,t){!e[Symbol.asyncIterator]&&e.pipe&&(e=e.pipe(new r_));const r=[];for await(const t of e)r.push(t);return this.load(Buffer.concat(r),t)}async load(e,t){let r;r=t&&t.base64?Buffer.from(e.toString(),"base64"):e;const n={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},i=await t_.loadAsync(r);for(const e of Object.values(i.files))if(!e.dir){let r,i=e.name;if("/"===i[0]&&(i=i.substr(1)),i.match(/xl\/media\//)||i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))r=new r_,r.write(await e.async("nodebuffer"));else{let t;r=new r_({writableObjectMode:!0,readableObjectMode:!0}),t=process.browser?a_(await e.async("nodebuffer")):await e.async("string");const n=16384;for(let e=0;e<t.length;e+=n)r.write(t.substring(e,e+n))}switch(r.end(),i){case"_rels/.rels":n.globalRels=await this.parseRels(r);break;case"xl/workbook.xml":{const e=await this.parseWorkbook(r);n.sheets=e.sheets,n.definedNames=e.definedNames,n.views=e.views,n.properties=e.properties,n.calcProperties=e.calcProperties;break}case"xl/_rels/workbook.xml.rels":n.workbookRels=await this.parseRels(r);break;case"xl/sharedStrings.xml":n.sharedStrings=new u_,await n.sharedStrings.parseStream(r);break;case"xl/styles.xml":n.styles=new l_,await n.styles.parseStream(r);break;case"docProps/app.xml":{const e=new d_,t=await e.parseStream(r);n.company=t.company,n.manager=t.manager;break}case"docProps/core.xml":{const e=new h_,t=await e.parseStream(r);Object.assign(n,t);break}default:{let e=i.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(e){await this._processWorksheetEntry(r,n,e[1],t,i);break}if(e=i.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),e){await this._processWorksheetRelsEntry(r,n,e[1]);break}if(e=i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),e){await this._processThemeEntry(r,n,e[1]);break}if(e=i.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),e){await this._processMediaEntry(r,n,e[1]);break}if(e=i.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),e){await this._processDrawingEntry(r,n,e[1]);break}if(e=i.match(/xl\/(comments\d+)[.]xml/),e){await this._processCommentEntry(r,n,e[1]);break}if(e=i.match(/xl\/tables\/(table\d+)[.]xml/),e){await this._processTableEntry(r,n,e[1]);break}if(e=i.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),e){await this._processDrawingRelsEntry(r,n,e[1]);break}if(e=i.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),e){await this._processVmlDrawingEntry(r,n,e[1]);break}}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async addMedia(e,t){await Promise.all(t.media.map((async t=>{if("image"===t.type){const r=`xl/media/${t.name}.${t.extension}`;if(t.filename){const n=await function(e,t){return new Promise(((r,n)=>{e_.readFile(e,t,((e,t)=>{e?n(e):r(t)}))}))}(t.filename);return e.append(n,{name:r})}if(t.buffer)return e.append(t.buffer,{name:r});if(t.base64){const n=t.base64,i=n.substring(n.indexOf(",")+1);return e.append(i,{name:r,base64:!0})}}throw new Error("Unsupported media")})))}addDrawings(e,t){const r=new g_,n=new c_;t.worksheets.forEach((t=>{const{drawing:i}=t;if(i){r.prepare(i,{});let t=r.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=n.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}}))}addTables(e,t){const r=new y_;t.worksheets.forEach((t=>{const{tables:n}=t;n.forEach((t=>{r.prepare(t,{});const n=r.toXml(t);e.append(n,{name:`xl/tables/${t.target}`})}))}))}async addContentTypes(e,t){const r=(new f_).toXml(t);e.append(r,{name:"[Content_Types].xml"})}async addApp(e,t){const r=(new d_).toXml(t);e.append(r,{name:"docProps/app.xml"})}async addCore(e,t){const r=new h_;e.append(r.toXml(t),{name:"docProps/core.xml"})}async addThemes(e,t){const r=t.themes||{theme1:b_};Object.keys(r).forEach((t=>{const n=r[t],i=`xl/theme/${t}.xml`;e.append(n,{name:i})}))}async addOfficeRels(t){const r=(new c_).toXml([{Id:"rId1",Type:e.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:e.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:e.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);t.append(r,{name:"_rels/.rels"})}async addWorkbookRels(t,r){let n=1;const i=[{Id:"rId"+n++,Type:e.RelType.Styles,Target:"styles.xml"},{Id:"rId"+n++,Type:e.RelType.Theme,Target:"theme/theme1.xml"}];r.sharedStrings.count&&i.push({Id:"rId"+n++,Type:e.RelType.SharedStrings,Target:"sharedStrings.xml"}),r.worksheets.forEach((t=>{t.rId="rId"+n++,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.id}.xml`})}));const s=(new c_).toXml(i);t.append(s,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(e,t){const{xml:r}=t.styles;r&&e.append(r,{name:"xl/styles.xml"})}async addWorkbook(e,t){const r=new p_;e.append(r.toXml(t),{name:"xl/workbook.xml"})}async addWorksheets(e,t){const r=new m_,n=new c_,i=new v_,s=new __;t.worksheets.forEach((t=>{let o=new o_;r.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new o_,n.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new o_,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new o_,s.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))}))}_finalize(e){return new Promise(((t,r)=>{e.on("finish",(()=>{t(this)})),e.on("error",r),e.finalize()}))}prepareModel(e,t){e.creator=e.creator||"ExcelJS",e.lastModifiedBy=e.lastModifiedBy||"ExcelJS",e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=void 0===t.useSharedStrings||t.useSharedStrings,e.useStyles=void 0===t.useStyles||t.useStyles,e.sharedStrings=new u_,e.styles=e.useStyles?new l_(!0):new l_.Mock;const r=new p_,n=new m_;r.prepare(e);const i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let s=0;e.tables=[],e.worksheets.forEach((t=>{t.tables.forEach((t=>{s++,t.target=`table${s}.xml`,t.id=s,e.tables.push(t)})),n.prepare(t,i)}))}async write(e,t){t=t||{};const{model:r}=this.workbook,n=new n_.ZipWriter(t.zip);return n.pipe(e),this.prepareModel(r,t),await this.addContentTypes(n,r),await this.addOfficeRels(n,r),await this.addWorkbookRels(n,r),await this.addWorksheets(n,r),await this.addSharedStrings(n,r),await this.addDrawings(n,r),await this.addTables(n,r),await Promise.all([this.addThemes(n,r),this.addStyles(n,r)]),await this.addMedia(n,r),await Promise.all([this.addApp(n,r),this.addCore(n,r)]),await this.addWorkbook(n,r),this._finalize(n)}writeFile(e,t){const r=e_.createWriteStream(e);return new Promise(((e,n)=>{r.on("finish",(()=>{e()})),r.on("error",(e=>{n(e)})),this.write(r,t).then((()=>{r.end()})).catch((e=>{n(e)}))}))}async writeBuffer(e){const t=new i_;return await this.write(t,e),t.read()}};w_.RelType=$f;var x_=w_,k_={},S_={},E_={};Object.defineProperty(E_,"__esModule",{value:!0}),E_.FormatterOptions=void 0;E_.FormatterOptions=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.objectMode=!0,this.delimiter=",",this.rowDelimiter="\n",this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\ufeff",this.alwaysWriteHeaders=!1,Object.assign(this,e||{}),void 0===(null==e?void 0:e.quoteHeaders)&&(this.quoteHeaders=this.quoteColumns),!0===(null==e?void 0:e.quote)?this.quote='"':!1===(null==e?void 0:e.quote)&&(this.quote=""),"string"!=typeof(null==e?void 0:e.escape)&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(null===(t=e.writeHeaders)||void 0===t||t),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}};var T_={},C_={},O_={},R_="[object Null]",A_="[object Undefined]",N_="object"==typeof p&&p&&p.Object===Object&&p,I_="object"==typeof self&&self&&self.Object===Object&&self,P_=N_||I_||Function("return this")(),F_=Object.prototype,D_=F_.hasOwnProperty,j_=F_.toString,M_=P_.Symbol,L_=M_?M_.toStringTag:void 0;function B_(e){return null==e?void 0===e?A_:R_:L_&&L_ in Object(e)?function(e){var t=D_.call(e,L_),r=e[L_];try{e[L_]=void 0;var n=!0}catch(e){}var i=j_.call(e);n&&(t?e[L_]=r:delete e[L_]);return i}(e):function(e){return j_.call(e)}(e)}var z_=function(e){if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return!1;var t=B_(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},$_={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=1,i=2,s=9007199254740991,o="[object Arguments]",a="[object Array]",l="[object AsyncFunction]",h="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Function]",d="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",v="[object Object]",_="[object Promise]",b="[object Proxy]",w="[object RegExp]",x="[object Set]",k="[object String]",S="[object Symbol]",E="[object Undefined]",T="[object WeakMap]",C="[object ArrayBuffer]",O="[object DataView]",R=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[o]=N[a]=N[C]=N[h]=N[O]=N[u]=N[c]=N[f]=N[m]=N[g]=N[v]=N[w]=N[x]=N[k]=N[T]=!1;var I="object"==typeof p&&p&&p.Object===Object&&p,P="object"==typeof self&&self&&self.Object===Object&&self,F=I||P||Function("return this")(),D=t&&!t.nodeType&&t,j=D&&e&&!e.nodeType&&e,M=j&&j.exports===D,L=M&&I.process,B=function(){try{return L&&L.binding&&L.binding("util")}catch(e){}}(),z=B&&B.isTypedArray;function $(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function U(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var V,W=Array.prototype,q=Function.prototype,X=Object.prototype,Z=F["__core-js_shared__"],G=q.toString,Y=X.hasOwnProperty,K=(V=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Q=X.toString,J=RegExp("^"+G.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=M?F.Buffer:void 0,te=F.Symbol,re=F.Uint8Array,ne=X.propertyIsEnumerable,ie=W.splice,se=te?te.toStringTag:void 0,oe=Object.getOwnPropertySymbols,ae=ee?ee.isBuffer:void 0,le=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),he=Me(F,"DataView"),ue=Me(F,"Map"),ce=Me(F,"Promise"),fe=Me(F,"Set"),de=Me(F,"WeakMap"),pe=Me(Object,"create"),me=$e(he),ge=$e(ue),ye=$e(ce),ve=$e(fe),_e=$e(de),be=te?te.prototype:void 0,we=be?be.valueOf:void 0;function xe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ee(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Se;++t<r;)this.add(e[t])}function Te(e){var t=this.__data__=new ke(e);this.size=t.size}function Ce(e,t){var r=Ve(e),n=!r&&Ue(e),i=!r&&!n&&We(e),s=!r&&!n&&!i&&Ke(e),o=r||n||i||s,a=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],l=a.length;for(var h in e)!t&&!Y.call(e,h)||o&&("length"==h||i&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||ze(h,l))||a.push(h);return a}function Oe(e,t){for(var r=e.length;r--;)if(He(e[r][0],t))return r;return-1}function Re(e){return null==e?void 0===e?E:y:se&&se in Object(e)?function(e){var t=Y.call(e,se),r=e[se];try{e[se]=void 0;var n=!0}catch(e){}var i=Q.call(e);n&&(t?e[se]=r:delete e[se]);return i}(e):function(e){return Q.call(e)}(e)}function Ae(e){return Ge(e)&&Re(e)==o}function Ne(e,t,r,s,l){return e===t||(null==e||null==t||!Ge(e)&&!Ge(t)?e!=e&&t!=t:function(e,t,r,s,l,f){var d=Ve(e),p=Ve(t),y=d?a:Be(e),_=p?a:Be(t),b=(y=y==o?v:y)==v,E=(_=_==o?v:_)==v,T=y==_;if(T&&We(e)){if(!We(t))return!1;d=!0,b=!1}if(T&&!b)return f||(f=new Te),d||Ke(e)?Fe(e,t,r,s,l,f):function(e,t,r,s,o,a,l){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!a(new re(e),new re(t)));case h:case u:case g:return He(+e,+t);case c:return e.name==t.name&&e.message==t.message;case w:case k:return e==t+"";case m:var f=H;case x:var d=s&n;if(f||(f=U),e.size!=t.size&&!d)return!1;var p=l.get(e);if(p)return p==t;s|=i,l.set(e,t);var y=Fe(f(e),f(t),s,o,a,l);return l.delete(e),y;case S:if(we)return we.call(e)==we.call(t)}return!1}(e,t,y,r,s,l,f);if(!(r&n)){var R=b&&Y.call(e,"__wrapped__"),A=E&&Y.call(t,"__wrapped__");if(R||A){var N=R?e.value():e,I=A?t.value():t;return f||(f=new Te),l(N,I,r,s,f)}}if(!T)return!1;return f||(f=new Te),function(e,t,r,i,s,o){var a=r&n,l=De(e),h=l.length,u=De(t),c=u.length;if(h!=c&&!a)return!1;var f=h;for(;f--;){var d=l[f];if(!(a?d in t:Y.call(t,d)))return!1}var p=o.get(e);if(p&&o.get(t))return p==t;var m=!0;o.set(e,t),o.set(t,e);var g=a;for(;++f<h;){var y=e[d=l[f]],v=t[d];if(i)var _=a?i(v,y,d,t,e,o):i(y,v,d,e,t,o);if(!(void 0===_?y===v||s(y,v,r,i,o):_)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,r,s,l,f)}(e,t,r,s,Ne,l))}function Ie(e){return!(!Ze(e)||(t=e,K&&K in t))&&(qe(e)?J:R).test($e(e));var t}function Pe(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||X,t!==n)return le(e);var t,r,n,i=[];for(var s in Object(e))Y.call(e,s)&&"constructor"!=s&&i.push(s);return i}function Fe(e,t,r,s,o,a){var l=r&n,h=e.length,u=t.length;if(h!=u&&!(l&&u>h))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var f=-1,d=!0,p=r&i?new Ee:void 0;for(a.set(e,t),a.set(t,e);++f<h;){var m=e[f],g=t[f];if(s)var y=l?s(g,m,f,t,e,a):s(m,g,f,e,t,a);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!$(t,(function(e,t){if(n=t,!p.has(n)&&(m===e||o(m,e,r,s,a)))return p.push(t);var n}))){d=!1;break}}else if(m!==g&&!o(m,g,r,s,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function De(e){return function(e,t,r){var n=t(e);return Ve(e)?n:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(n,r(e))}(e,Qe,Le)}function je(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function Me(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Ie(r)?r:void 0}xe.prototype.clear=function(){this.__data__=pe?pe(null):{},this.size=0},xe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xe.prototype.get=function(e){var t=this.__data__;if(pe){var n=t[e];return n===r?void 0:n}return Y.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return pe?void 0!==t[e]:Y.call(t,e)},xe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=pe&&void 0===t?r:t,this},ke.prototype.clear=function(){this.__data__=[],this.size=0},ke.prototype.delete=function(e){var t=this.__data__,r=Oe(t,e);return!(r<0)&&(r==t.length-1?t.pop():ie.call(t,r,1),--this.size,!0)},ke.prototype.get=function(e){var t=this.__data__,r=Oe(t,e);return r<0?void 0:t[r][1]},ke.prototype.has=function(e){return Oe(this.__data__,e)>-1},ke.prototype.set=function(e,t){var r=this.__data__,n=Oe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Se.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(ue||ke),string:new xe}},Se.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Se.prototype.get=function(e){return je(this,e).get(e)},Se.prototype.has=function(e){return je(this,e).has(e)},Se.prototype.set=function(e,t){var r=je(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Ee.prototype.add=Ee.prototype.push=function(e){return this.__data__.set(e,r),this},Ee.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.clear=function(){this.__data__=new ke,this.size=0},Te.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!ue||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Se(n)}return r.set(e,t),this.size=r.size,this};var Le=oe?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}(oe(e),(function(t){return ne.call(e,t)})))}:function(){return[]},Be=Re;function ze(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||A.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function He(e,t){return e===t||e!=e&&t!=t}(he&&Be(new he(new ArrayBuffer(1)))!=O||ue&&Be(new ue)!=m||ce&&Be(ce.resolve())!=_||fe&&Be(new fe)!=x||de&&Be(new de)!=T)&&(Be=function(e){var t=Re(e),r=t==v?e.constructor:void 0,n=r?$e(r):"";if(n)switch(n){case me:return O;case ge:return m;case ye:return _;case ve:return x;case _e:return T}return t});var Ue=Ae(function(){return arguments}())?Ae:function(e){return Ge(e)&&Y.call(e,"callee")&&!ne.call(e,"callee")},Ve=Array.isArray;var We=ae||function(){return!1};function qe(e){if(!Ze(e))return!1;var t=Re(e);return t==f||t==d||t==l||t==b}function Xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Ze(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return null!=e&&"object"==typeof e}var Ye,Ke=z?(Ye=z,function(e){return Ye(e)}):function(e){return Ge(e)&&Xe(e.length)&&!!N[Re(e)]};function Qe(e){return null!=(t=e)&&Xe(t.length)&&!qe(t)?Ce(e):Pe(e);var t}e.exports=function(e,t){return Ne(e,t)}}($_,$_.exports);var H_=$_.exports,U_={},V_=Object.prototype.toString;var W_=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==V_.call(e)};var q_=function(e){return null==e},X_=1/0,Z_="[object Symbol]",G_=/[\\^$.*+?()[\]{}|]/g,Y_=RegExp(G_.source),K_="object"==typeof p&&p&&p.Object===Object&&p,Q_="object"==typeof self&&self&&self.Object===Object&&self,J_=K_||Q_||Function("return this")(),eb=Object.prototype.toString,tb=J_.Symbol,rb=tb?tb.prototype:void 0,nb=rb?rb.toString:void 0;function ib(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&eb.call(e)==Z_}(e))return nb?nb.call(e):"";var t=e+"";return"0"==t&&1/e==-X_?"-0":t}var sb=function(e){var t;return(e=null==(t=e)?"":ib(t))&&Y_.test(e)?e.replace(G_,"\\$&"):e},ob=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U_,"__esModule",{value:!0}),U_.FieldFormatter=void 0;const ab=ob(W_),lb=ob(q_),hb=ob(sb);U_.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,null!==e.headers&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,"g");const t=`[${e.delimiter}${hb.default(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){const r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return ab.default(r)?r:Array.isArray(r)?r[e]:null!==this._headers&&r[this._headers[e]]}format(e,t,r){const n=`${lb.default(e)?"":e}`.replace(/\0/g,""),{formatterOptions:i}=this;if(""!==i.quote){if(-1!==n.indexOf(i.quote))return this.quoteField(n.replace(this.REPLACE_REGEXP,i.escapedQuote))}return-1!==n.search(this.ESCAPE_REGEXP)||this.shouldQuote(t,r)?this.quoteField(n):n}quoteField(e){const{quote:t}=this.formatterOptions;return`${t}${e}${t}`}};var ub={};Object.defineProperty(ub,"__esModule",{value:!0}),ub.isSyncTransform=void 0,ub.isSyncTransform=e=>1===e.length;var cb=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O_,"__esModule",{value:!0}),O_.RowFormatter=void 0;const fb=cb(z_),db=cb(H_),pb=U_,mb=ub;class gb{constructor(e){this.rowCount=0,this.formatterOptions=e,this.fieldFormatter=new pb.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,null!==this.headers&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}static isRowHashArray(e){return!!Array.isArray(e)&&(Array.isArray(e[0])&&2===e[0].length)}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(e){return gb.isRowHashArray(e)?e.map((e=>e[0])):Array.isArray(e)?e:Object.keys(e)}static createTransform(e){return mb.isSyncTransform(e)?(t,r)=>{let n=null;try{n=e(t)}catch(e){return r(e)}return r(null,n)}:(t,r)=>{e(t,r)}}set rowTransform(e){if(!fb.default(e))throw new TypeError("The transform should be a function");this._rowTransform=gb.createTransform(e)}format(e,t){this.callTransformer(e,((r,n)=>{if(r)return t(r);if(!e)return t(null);const i=[];if(n){const{shouldFormatColumns:e,headers:t}=this.checkHeaders(n);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){const e=this.gatherColumns(n);i.push(this.formatColumns(e,!1))}}return t(null,i)}))}finish(e){const t=[];if(this.formatterOptions.alwaysWriteHeaders&&0===this.rowCount){if(!this.headers)return e(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(e){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const t=gb.gatherHeaders(e);return this.headers=t,this.fieldFormatter.headers=t,this.shouldWriteHeaders?{shouldFormatColumns:!db.default(t,e),headers:t}:{shouldFormatColumns:!0,headers:null}}gatherColumns(e){if(null===this.headers)throw new Error("Headers is currently null");return Array.isArray(e)?gb.isRowHashArray(e)?this.headers.map(((t,r)=>{const n=e[r];return n?n[1]:""})):gb.isRowArray(e)&&!this.shouldWriteHeaders?e:this.headers.map(((t,r)=>e[r])):this.headers.map((t=>e[t]))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){const r=e.map(((e,r)=>this.fieldFormatter.format(e,r,t))).join(this.formatterOptions.delimiter),{rowCount:n}=this;return this.rowCount+=1,n?[this.formatterOptions.rowDelimiter,r].join(""):r}}O_.RowFormatter=gb,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldFormatter=e.RowFormatter=void 0;var t=O_;Object.defineProperty(e,"RowFormatter",{enumerable:!0,get:function(){return t.RowFormatter}});var r=U_;Object.defineProperty(e,"FieldFormatter",{enumerable:!0,get:function(){return r.FieldFormatter}})}(C_),Object.defineProperty(T_,"__esModule",{value:!0}),T_.CsvFormatterStream=void 0;const yb=n,vb=C_;class _b extends yb.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new vb.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,t,r){let n=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,((e,t)=>e?(n=!0,r(e)):(t&&t.forEach((e=>{this.push(Buffer.from(e,"utf8"))})),n=!0,r())))}catch(e){if(n)throw e;r(e)}}_flush(e){this.rowFormatter.finish(((t,r)=>t?e(t):(r&&r.forEach((e=>{this.push(Buffer.from(e,"utf8"))})),e())))}}T_.CsvFormatterStream=_b,function(e){var t=p&&p.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&t(r,e,n);return i(r,e),r},a=p&&p.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=e.FormatterOptions=e.CsvFormatterStream=void 0;const l=o,h=n,u=s(r),c=E_,f=T_;a(ub,e);var d=T_;Object.defineProperty(e,"CsvFormatterStream",{enumerable:!0,get:function(){return d.CsvFormatterStream}});var m=E_;Object.defineProperty(e,"FormatterOptions",{enumerable:!0,get:function(){return m.FormatterOptions}}),e.format=e=>new f.CsvFormatterStream(new c.FormatterOptions(e)),e.write=(t,r)=>{const n=e.format(r),i=l.promisify(((e,t)=>{n.write(e,void 0,t)}));return t.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>n.end())).catch((e=>{n.emit("error",e)})),n},e.writeToStream=(t,r,n)=>e.write(r,n).pipe(t),e.writeToBuffer=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[],i=new h.Writable({write(e,t,r){n.push(e),r()}});return new Promise(((s,o)=>{i.on("error",o).on("finish",(()=>s(Buffer.concat(n)))),e.write(t,r).pipe(i)}))},e.writeToString=(t,r)=>e.writeToBuffer(t,r).then((e=>e.toString())),e.writeToPath=(t,r,n)=>{const i=u.createWriteStream(t,{encoding:"utf8"});return e.write(r,n).pipe(i)}}(S_);var bb={},wb={},xb=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wb,"__esModule",{value:!0}),wb.ParserOptions=void 0;const kb=xb(sb),Sb=xb(q_);wb.ParserOptions=class{constructor(e){var t;if(this.objectMode=!0,this.delimiter=",",this.ignoreEmpty=!1,this.quote='"',this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn="\r",this.encoding="utf8",this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,e||{}),this.delimiter.length>1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=kb.default(this.delimiter),this.escapeChar=null!==(t=this.escape)&&void 0!==t?t:this.quote,this.supportsComments=!Sb.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}};var Eb={},Tb={},Cb={},Ob={};Object.defineProperty(Ob,"__esModule",{value:!0}),Ob.isSyncValidate=Ob.isSyncTransform=void 0,Ob.isSyncTransform=e=>1===e.length,Ob.isSyncValidate=e=>1===e.length;var Rb=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cb,"__esModule",{value:!0}),Cb.RowTransformerValidator=void 0;const Ab=Rb(z_),Nb=Ob;class Ib{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return Nb.isSyncTransform(e)?(t,r)=>{let n=null;try{n=e(t)}catch(e){return r(e)}return r(null,n)}:e}static createValidator(e){return Nb.isSyncValidate(e)?(t,r)=>{r(null,{row:t,isValid:e(t)})}:(t,r)=>{e(t,((e,n,i)=>e?r(e):r(null,n?{row:t,isValid:n,reason:i}:{row:t,isValid:!1,reason:i})))}}set rowTransform(e){if(!Ab.default(e))throw new TypeError("The transform should be a function");this._rowTransform=Ib.createTransform(e)}set rowValidator(e){if(!Ab.default(e))throw new TypeError("The validate should be a function");this._rowValidator=Ib.createValidator(e)}transformAndValidate(e,t){return this.callTransformer(e,((e,r)=>e?t(e):r?this.callValidator(r,((e,n)=>e?t(e):n&&!n.isValid?t(null,{row:r,isValid:!1,reason:n.reason}):t(null,{row:r,isValid:!0}))):t(null,{row:null,isValid:!0})))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}Cb.RowTransformerValidator=Ib;var Pb={};var Fb=function(e){return void 0===e},Db=200,jb="__lodash_hash_undefined__",Mb="[object Function]",Lb="[object GeneratorFunction]",Bb=/^\[object .+?Constructor\]$/,zb="object"==typeof p&&p&&p.Object===Object&&p,$b="object"==typeof self&&self&&self.Object===Object&&self,Hb=zb||$b||Function("return this")();function Ub(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var i=e.length,s=r+(n?1:-1);for(;n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,Wb,r);var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,0)>-1}function Vb(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)if(r(t,e[n]))return!0;return!1}function Wb(e){return e!=e}function qb(e,t){return e.has(t)}function Xb(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var Zb,Gb=Array.prototype,Yb=Function.prototype,Kb=Object.prototype,Qb=Hb["__core-js_shared__"],Jb=(Zb=/[^.]+$/.exec(Qb&&Qb.keys&&Qb.keys.IE_PROTO||""))?"Symbol(src)_1."+Zb:"",ew=Yb.toString,tw=Kb.hasOwnProperty,rw=Kb.toString,nw=RegExp("^"+ew.call(tw).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),iw=Gb.splice,sw=gw(Hb,"Map"),ow=gw(Hb,"Set"),aw=gw(Object,"create");function lw(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hw(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function uw(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function cw(e){var t=-1,r=e?e.length:0;for(this.__data__=new uw;++t<r;)this.add(e[t])}function fw(e,t){for(var r,n,i=e.length;i--;)if((r=e[i][0])===(n=t)||r!=r&&n!=n)return i;return-1}function dw(e){if(!yw(e)||(t=e,Jb&&Jb in t))return!1;var t,r=function(e){var t=yw(e)?rw.call(e):"";return t==Mb||t==Lb}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?nw:Bb;return r.test(function(e){if(null!=e){try{return ew.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}lw.prototype.clear=function(){this.__data__=aw?aw(null):{}},lw.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},lw.prototype.get=function(e){var t=this.__data__;if(aw){var r=t[e];return r===jb?void 0:r}return tw.call(t,e)?t[e]:void 0},lw.prototype.has=function(e){var t=this.__data__;return aw?void 0!==t[e]:tw.call(t,e)},lw.prototype.set=function(e,t){return this.__data__[e]=aw&&void 0===t?jb:t,this},hw.prototype.clear=function(){this.__data__=[]},hw.prototype.delete=function(e){var t=this.__data__,r=fw(t,e);return!(r<0)&&(r==t.length-1?t.pop():iw.call(t,r,1),!0)},hw.prototype.get=function(e){var t=this.__data__,r=fw(t,e);return r<0?void 0:t[r][1]},hw.prototype.has=function(e){return fw(this.__data__,e)>-1},hw.prototype.set=function(e,t){var r=this.__data__,n=fw(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},uw.prototype.clear=function(){this.__data__={hash:new lw,map:new(sw||hw),string:new lw}},uw.prototype.delete=function(e){return mw(this,e).delete(e)},uw.prototype.get=function(e){return mw(this,e).get(e)},uw.prototype.has=function(e){return mw(this,e).has(e)},uw.prototype.set=function(e,t){return mw(this,e).set(e,t),this},cw.prototype.add=cw.prototype.push=function(e){return this.__data__.set(e,jb),this},cw.prototype.has=function(e){return this.__data__.has(e)};var pw=ow&&1/Xb(new ow([,-0]))[1]==1/0?function(e){return new ow(e)}:function(){};function mw(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function gw(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return dw(r)?r:void 0}function yw(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var vw=function(e){return e&&e.length?function(e,t,r){var n=-1,i=Ub,s=e.length,o=!0,a=[],l=a;if(r)o=!1,i=Vb;else if(s>=Db){var h=t?null:pw(e);if(h)return Xb(h);o=!1,i=qb,l=new cw}else l=t?[]:a;e:for(;++n<s;){var u=e[n],c=t?t(u):u;if(u=r||0!==u?u:0,o&&c==c){for(var f=l.length;f--;)if(l[f]===c)continue e;t&&l.push(c),a.push(u)}else i(l,c,r)||(l!==a&&l.push(c),a.push(u))}return a}(e):[]},_w={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=1,i=2,s=1/0,o=9007199254740991,a="[object Arguments]",l="[object Array]",h="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Function]",d="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Object]",v="[object Promise]",_="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",k="[object WeakMap]",S="[object ArrayBuffer]",E="[object DataView]",T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,O=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A=/\\(\\)?/g,N=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[a]=P[l]=P[S]=P[h]=P[E]=P[u]=P[c]=P[f]=P[m]=P[g]=P[y]=P[_]=P[b]=P[w]=P[k]=!1;var F="object"==typeof p&&p&&p.Object===Object&&p,D="object"==typeof self&&self&&self.Object===Object&&self,j=F||D||Function("return this")(),M=t&&!t.nodeType&&t,L=M&&e&&!e.nodeType&&e,B=L&&L.exports===M&&F.process,z=function(){try{return B&&B.binding("util")}catch(e){}}(),$=z&&z.isTypedArray;function H(e,t,r,n){for(var i=-1,s=e?e.length:0;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function U(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function W(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function q(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var X=Array.prototype,Z=Function.prototype,G=Object.prototype,Y=j["__core-js_shared__"],K=function(){var e=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Q=Z.toString,J=G.hasOwnProperty,ee=G.toString,te=RegExp("^"+Q.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=j.Symbol,ne=j.Uint8Array,ie=G.propertyIsEnumerable,se=X.splice,oe=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),ae=He(j,"DataView"),le=He(j,"Map"),he=He(j,"Promise"),ue=He(j,"Set"),ce=He(j,"WeakMap"),fe=He(Object,"create"),de=Ye(ae),pe=Ye(le),me=Ye(he),ge=Ye(ue),ye=Ye(ce),ve=re?re.prototype:void 0,_e=ve?ve.valueOf:void 0,be=ve?ve.toString:void 0;function we(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function xe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ke(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=e?e.length:0;for(this.__data__=new ke;++t<r;)this.add(e[t])}function Ee(e){this.__data__=new xe(e)}function Te(e,t){var r=nt(e)||rt(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var s in e)!t&&!J.call(e,s)||i&&("length"==s||Ve(s,n))||r.push(s);return r}function Ce(e,t){for(var r=e.length;r--;)if(tt(e[r][0],t))return r;return-1}function Oe(e,t,r,n){return Ne(e,(function(e,i,s){t(n,e,r(e),s)})),n}we.prototype.clear=function(){this.__data__=fe?fe(null):{}},we.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},we.prototype.get=function(e){var t=this.__data__;if(fe){var n=t[e];return n===r?void 0:n}return J.call(t,e)?t[e]:void 0},we.prototype.has=function(e){var t=this.__data__;return fe?void 0!==t[e]:J.call(t,e)},we.prototype.set=function(e,t){return this.__data__[e]=fe&&void 0===t?r:t,this},xe.prototype.clear=function(){this.__data__=[]},xe.prototype.delete=function(e){var t=this.__data__,r=Ce(t,e);return!(r<0)&&(r==t.length-1?t.pop():se.call(t,r,1),!0)},xe.prototype.get=function(e){var t=this.__data__,r=Ce(t,e);return r<0?void 0:t[r][1]},xe.prototype.has=function(e){return Ce(this.__data__,e)>-1},xe.prototype.set=function(e,t){var r=this.__data__,n=Ce(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new we,map:new(le||xe),string:new we}},ke.prototype.delete=function(e){return $e(this,e).delete(e)},ke.prototype.get=function(e){return $e(this,e).get(e)},ke.prototype.has=function(e){return $e(this,e).has(e)},ke.prototype.set=function(e,t){return $e(this,e).set(e,t),this},Se.prototype.add=Se.prototype.push=function(e){return this.__data__.set(e,r),this},Se.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.clear=function(){this.__data__=new xe},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xe){var n=r.__data__;if(!le||n.length<199)return n.push([e,t]),this;r=this.__data__=new ke(n)}return r.set(e,t),this};var Re,Ae,Ne=(Re=function(e,t){return e&&Ie(e,t,ft)},function(e,t){if(null==e)return e;if(!it(e))return Re(e,t);for(var r=e.length,n=Ae?r:-1,i=Object(e);(Ae?n--:++n<r)&&!1!==t(i[n],n,i););return e}),Ie=function(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),a=o.length;a--;){var l=o[e?a:++i];if(!1===r(s[l],l,s))break}return t}}();function Pe(e,t){for(var r=0,n=(t=We(t,e)?[t]:Be(t)).length;null!=e&&r<n;)e=e[Ge(t[r++])];return r&&r==n?e:void 0}function Fe(e,t){return null!=e&&t in Object(e)}function De(e,t,r,s,o){return e===t||(null==e||null==t||!at(e)&&!lt(t)?e!=e&&t!=t:function(e,t,r,s,o,f){var d=nt(e),p=nt(t),v=l,k=l;d||(v=(v=Ue(e))==a?y:v);p||(k=(k=Ue(t))==a?y:k);var T=v==y&&!V(e),C=k==y&&!V(t),O=v==k;if(O&&!T)return f||(f=new Ee),d||ct(e)?ze(e,t,r,s,o,f):function(e,t,r,s,o,a,l){switch(r){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!s(new ne(e),new ne(t)));case h:case u:case g:return tt(+e,+t);case c:return e.name==t.name&&e.message==t.message;case _:case w:return e==t+"";case m:var f=W;case b:var d=a&i;if(f||(f=q),e.size!=t.size&&!d)return!1;var p=l.get(e);if(p)return p==t;a|=n,l.set(e,t);var y=ze(f(e),f(t),s,o,a,l);return l.delete(e),y;case x:if(_e)return _e.call(e)==_e.call(t)}return!1}(e,t,v,r,s,o,f);if(!(o&i)){var R=T&&J.call(e,"__wrapped__"),A=C&&J.call(t,"__wrapped__");if(R||A){var N=R?e.value():e,I=A?t.value():t;return f||(f=new Ee),r(N,I,s,o,f)}}if(!O)return!1;return f||(f=new Ee),function(e,t,r,n,s,o){var a=s&i,l=ft(e),h=l.length,u=ft(t),c=u.length;if(h!=c&&!a)return!1;var f=h;for(;f--;){var d=l[f];if(!(a?d in t:J.call(t,d)))return!1}var p=o.get(e);if(p&&o.get(t))return p==t;var m=!0;o.set(e,t),o.set(t,e);var g=a;for(;++f<h;){var y=e[d=l[f]],v=t[d];if(n)var _=a?n(v,y,d,t,e,o):n(y,v,d,e,t,o);if(!(void 0===_?y===v||r(y,v,n,s,o):_)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,r,s,o,f)}(e,t,De,r,s,o))}function je(e){return!(!at(e)||(t=e,K&&K in t))&&(st(e)||V(e)?te:N).test(Ye(e));var t}function Me(e){return"function"==typeof e?e:null==e?dt:"object"==typeof e?nt(e)?function(e,t){if(We(e)&&qe(t))return Xe(Ge(e),t);return function(r){var s=function(e,t,r){var n=null==e?void 0:Pe(e,t);return void 0===n?r:n}(r,e);return void 0===s&&s===t?function(e,t){return null!=e&&function(e,t,r){t=We(t,e)?[t]:Be(t);var n,i=-1,s=t.length;for(;++i<s;){var o=Ge(t[i]);if(!(n=null!=e&&r(e,o)))break;e=e[o]}if(n)return n;s=e?e.length:0;return!!s&&ot(s)&&Ve(o,s)&&(nt(e)||rt(e))}(e,t,Fe)}(r,e):De(t,s,void 0,n|i)}}(e[0],e[1]):function(e){var t=function(e){var t=ft(e),r=t.length;for(;r--;){var n=t[r],i=e[n];t[r]=[n,i,qe(i)]}return t}(e);if(1==t.length&&t[0][2])return Xe(t[0][0],t[0][1]);return function(r){return r===e||function(e,t,r,s){var o=r.length,a=o,l=!s;if(null==e)return!a;for(e=Object(e);o--;){var h=r[o];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++o<a;){var u=(h=r[o])[0],c=e[u],f=h[1];if(l&&h[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Ee;if(s)var p=s(c,f,u,e,t,d);if(!(void 0===p?De(f,c,s,n|i,d):p))return!1}}return!0}(r,e,t)}}(e):function(e){return We(e)?(t=Ge(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pe(t,e)}}(e);var t}(e)}function Le(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||G,t!==n)return oe(e);var t,r,n,i=[];for(var s in Object(e))J.call(e,s)&&"constructor"!=s&&i.push(s);return i}function Be(e){return nt(e)?e:Ze(e)}function ze(e,t,r,s,o,a){var l=o&i,h=e.length,u=t.length;if(h!=u&&!(l&&u>h))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var f=-1,d=!0,p=o&n?new Se:void 0;for(a.set(e,t),a.set(t,e);++f<h;){var m=e[f],g=t[f];if(s)var y=l?s(g,m,f,t,e,a):s(m,g,f,e,t,a);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!U(t,(function(e,t){if(!p.has(t)&&(m===e||r(m,e,s,o,a)))return p.add(t)}))){d=!1;break}}else if(m!==g&&!r(m,g,s,o,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function $e(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function He(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return je(r)?r:void 0}var Ue=function(e){return ee.call(e)};function Ve(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||I.test(e))&&e>-1&&e%1==0&&e<t}function We(e,t){if(nt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ht(e))||(C.test(e)||!T.test(e)||null!=t&&e in Object(t))}function qe(e){return e==e&&!at(e)}function Xe(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}(ae&&Ue(new ae(new ArrayBuffer(1)))!=E||le&&Ue(new le)!=m||he&&Ue(he.resolve())!=v||ue&&Ue(new ue)!=b||ce&&Ue(new ce)!=k)&&(Ue=function(e){var t=ee.call(e),r=t==y?e.constructor:void 0,n=r?Ye(r):void 0;if(n)switch(n){case de:return E;case pe:return m;case me:return v;case ge:return b;case ye:return k}return t});var Ze=et((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ht(e))return be?be.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var r=[];return O.test(e)&&r.push(""),e.replace(R,(function(e,t,n,i){r.push(n?i.replace(A,"$1"):t||e)})),r}));function Ge(e){if("string"==typeof e||ht(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function Ye(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ke,Qe,Je=(Ke=function(e,t,r){J.call(e,r)?e[r].push(t):e[r]=[t]},function(e,t){var r=nt(e)?H:Oe,n=Qe?Qe():{};return r(e,Ke,Me(t),n)});function et(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new(et.Cache||ke),r}function tt(e,t){return e===t||e!=e&&t!=t}function rt(e){return function(e){return lt(e)&&it(e)}(e)&&J.call(e,"callee")&&(!ie.call(e,"callee")||ee.call(e)==a)}et.Cache=ke;var nt=Array.isArray;function it(e){return null!=e&&ot(e.length)&&!st(e)}function st(e){var t=at(e)?ee.call(e):"";return t==f||t==d}function ot(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function at(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ht(e){return"symbol"==typeof e||lt(e)&&ee.call(e)==x}var ut,ct=$?(ut=$,function(e){return ut(e)}):function(e){return lt(e)&&ot(e.length)&&!!P[ee.call(e)]};function ft(e){return it(e)?Te(e):Le(e)}function dt(e){return e}e.exports=Je}(_w,_w.exports);var bw=_w.exports,ww=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pb,"__esModule",{value:!0}),Pb.HeaderTransformer=void 0;const xw=ww(Fb),kw=ww(z_),Sw=ww(vw),Ew=ww(bw);Pb.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,!0===e.headers?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):kw.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){const t={},{headers:r,headersLength:n}=this;for(let i=0;i<n;i+=1){const n=r[i];if(!xw.default(n)){const r=e[i];xw.default(r)?t[n]="":t[n]=r}}return t}setHeaders(e){var t;const r=e.filter((e=>!!e));if(Sw.default(r).length!==r.length){const e=Ew.default(r),t=Object.keys(e).filter((t=>e[t].length>1));throw new Error(`Duplicate headers found ${JSON.stringify(t)}`)}this.headers=e,this.receivedHeaders=!0,this.headersLength=(null===(t=this.headers)||void 0===t?void 0:t.length)||0}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderTransformer=e.RowTransformerValidator=void 0;var t=Cb;Object.defineProperty(e,"RowTransformerValidator",{enumerable:!0,get:function(){return t.RowTransformerValidator}});var r=Pb;Object.defineProperty(e,"HeaderTransformer",{enumerable:!0,get:function(){return r.HeaderTransformer}})}(Tb);var Tw={},Cw={},Ow={},Rw={};Object.defineProperty(Rw,"__esModule",{value:!0}),Rw.Token=void 0;Rw.Token=class{constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}static isTokenRowDelimiter(e){const t=e.token;return"\r"===t||"\n"===t||"\r\n"===t}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}},Object.defineProperty(Ow,"__esModule",{value:!0}),Ow.Scanner=void 0;const Aw=Rw,Nw=/((?:\r\n)|\n|\r)/;Ow.Scanner=class{constructor(e){this.cursor=0,this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:e}=this,t=this.parserOptions.NEXT_TOKEN_REGEXP;if(-1===e.search(t))return null;const r=t.exec(e);if(null==r)return null;const n=r[1],i=this.cursor+(r.index||0);return new Aw.Token({token:n,startCursor:i,endCursor:i+n.length-1})}get nextCharacterToken(){const{cursor:e,lineLength:t}=this;return t<=e?null:new Aw.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const e=Nw.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}};var Iw={},Pw={},Fw={},Dw={},jw={};Object.defineProperty(jw,"__esModule",{value:!0}),jw.ColumnFormatter=void 0;jw.ColumnFormatter=class{constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}},Object.defineProperty(Dw,"__esModule",{value:!0}),Dw.NonQuotedColumnParser=void 0;const Mw=jw,Lw=Rw;Dw.NonQuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new Mw.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const{parserOptions:t}=this,r=[];let n=e.nextCharacterToken;for(;n&&(!Lw.Token.isTokenDelimiter(n,t)&&!Lw.Token.isTokenRowDelimiter(n));n=e.nextCharacterToken)r.push(n.token),e.advancePastToken(n);return this.columnFormatter.format(r.join(""))}};var Bw={};Object.defineProperty(Bw,"__esModule",{value:!0}),Bw.QuotedColumnParser=void 0;const zw=jw,$w=Rw;Bw.QuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new zw.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const t=e.cursor,{foundClosingQuote:r,col:n}=this.gatherDataBetweenQuotes(e);if(!r){if(e.advanceTo(t),!e.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(e),n}gatherDataBetweenQuotes(e){const{parserOptions:t}=this;let r=!1,n=!1;const i=[];let s=e.nextCharacterToken;for(;!n&&null!==s;s=e.nextCharacterToken){const o=$w.Token.isTokenQuote(s,t);if(!r&&o)r=!0;else if(r)if($w.Token.isTokenEscapeCharacter(s,t)){e.advancePastToken(s);const r=e.nextCharacterToken;null!==r&&($w.Token.isTokenQuote(r,t)||$w.Token.isTokenEscapeCharacter(r,t))?(i.push(r.token),s=r):o?n=!0:i.push(s.token)}else o?n=!0:i.push(s.token);e.advancePastToken(s)}return{col:this.columnFormatter.format(i.join("")),foundClosingQuote:n}}checkForMalformedColumn(e){const{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){const n=$w.Token.isTokenDelimiter(r,t),i=$w.Token.isTokenRowDelimiter(r);if(!n&&!i){const n=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}},Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.ColumnParser=void 0;const Hw=Dw,Uw=Bw,Vw=Rw;Fw.ColumnParser=class{constructor(e){this.parserOptions=e,this.quotedColumnParser=new Uw.QuotedColumnParser(e),this.nonQuotedColumnParser=new Hw.NonQuotedColumnParser(e)}parse(e){const{nextNonSpaceToken:t}=e;return null!==t&&Vw.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnFormatter=e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=void 0;var t=Fw;Object.defineProperty(e,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}});var r=Dw;Object.defineProperty(e,"NonQuotedColumnParser",{enumerable:!0,get:function(){return r.NonQuotedColumnParser}});var n=Bw;Object.defineProperty(e,"QuotedColumnParser",{enumerable:!0,get:function(){return n.QuotedColumnParser}});var i=jw;Object.defineProperty(e,"ColumnFormatter",{enumerable:!0,get:function(){return i.ColumnFormatter}})}(Pw),Object.defineProperty(Iw,"__esModule",{value:!0}),Iw.RowParser=void 0;const Ww=Pw,qw=Rw;Iw.RowParser=class{constructor(e){this.parserOptions=e,this.columnParser=new Ww.ColumnParser(e)}static isEmptyRow(e){return""===e.join("").replace(/\s+/g,"")}parse(e){const{parserOptions:t}=this,{hasMoreData:r}=e,n=e,i=[];let s=this.getStartToken(n,i);for(;s;){if(qw.Token.isTokenRowDelimiter(s))return n.advancePastToken(s),!n.hasMoreCharacters&&qw.Token.isTokenCarriageReturn(s,t)&&r?null:(n.truncateToCursor(),i);if(!this.shouldSkipColumnParse(n,s,i)){const e=this.columnParser.parse(n);if(null===e)return null;i.push(e)}s=n.nextNonSpaceToken}return r?null:(n.truncateToCursor(),i)}getStartToken(e,t){const r=e.nextNonSpaceToken;return null!==r&&qw.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(""),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){const{parserOptions:n}=this;if(qw.Token.isTokenDelimiter(t,n)){e.advancePastToken(t);const i=e.nextCharacterToken;if(!e.hasMoreCharacters||null!==i&&qw.Token.isTokenRowDelimiter(i))return r.push(""),!0;if(null!==i&&qw.Token.isTokenDelimiter(i,n))return r.push(""),!0}return!1}},Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.Parser=void 0;const Xw=Ow,Zw=Iw,Gw=Rw;class Yw{constructor(e){this.parserOptions=e,this.rowParser=new Zw.RowParser(this.parserOptions)}static removeBOM(e){return e&&65279===e.charCodeAt(0)?e.slice(1):e}parse(e,t){const r=new Xw.Scanner({line:Yw.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:t});return this.parserOptions.supportsComments?this.parseWithComments(r):this.parseWithoutComments(r)}parseWithoutComments(e){const t=[];let r=!0;for(;r;)r=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){const{parserOptions:t}=this,r=[];for(let n=e.nextCharacterToken;null!==n;n=e.nextCharacterToken)if(Gw.Token.isTokenComment(n,t)){if(null===e.advancePastLine())return{line:e.lineFromCursor,rows:r};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:r};e.truncateToCursor()}else if(!this.parseRow(e,r))break;return{line:e.line,rows:r}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;const r=this.rowParser.parse(e);return null!==r&&(this.parserOptions.ignoreEmpty&&Zw.RowParser.isEmptyRow(r)||t.push(r),!0)}}Cw.Parser=Yw,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var t=Cw;Object.defineProperty(e,"Parser",{enumerable:!0,get:function(){return t.Parser}});var r=Iw;Object.defineProperty(e,"RowParser",{enumerable:!0,get:function(){return r.RowParser}});var n=Ow;Object.defineProperty(e,"Scanner",{enumerable:!0,get:function(){return n.Scanner}});var i=Rw;Object.defineProperty(e,"Token",{enumerable:!0,get:function(){return i.Token}});var s=Pw;Object.defineProperty(e,"ColumnParser",{enumerable:!0,get:function(){return s.ColumnParser}}),Object.defineProperty(e,"NonQuotedColumnParser",{enumerable:!0,get:function(){return s.NonQuotedColumnParser}}),Object.defineProperty(e,"QuotedColumnParser",{enumerable:!0,get:function(){return s.QuotedColumnParser}})}(Tw),Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.CsvParserStream=void 0;const Kw=a,Qw=n,Jw=Tb,ex=Tw;class tx extends Qw.Transform{constructor(e){super({objectMode:e.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=e,this.parser=new ex.Parser(e),this.headerTransformer=new Jw.HeaderTransformer(e),this.decoder=new Kw.StringDecoder(e.encoding),this.rowTransformerValidator=new Jw.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e){if("end"===e)return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return super.emit(e,...r)}_transform(e,t,r){if(this.hasHitRowLimit)return r();const n=tx.wrapDoneCallback(r);try{const{lines:t}=this,r=t+this.decoder.write(e),i=this.parse(r,!0);return this.processRows(i,n)}catch(e){return n(e)}}_flush(e){const t=tx.wrapDoneCallback(e);if(this.hasHitRowLimit)return t();try{const e=this.lines+this.decoder.end(),r=this.parse(e,!1);return this.processRows(r,t)}catch(e){return t(e)}}parse(e,t){if(!e)return[];const{line:r,rows:n}=this.parser.parse(e,t);return this.lines=r,n}processRows(e,t){const r=e.length,n=i=>{const s=e=>e?t(e):i%100!=0?n(i+1):void setImmediate((()=>n(i+1)));if(this.checkAndEmitHeaders(),i>=r||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return s();const o=e[i];this.rowCount+=1,this.parsedRowCount+=1;const a=this.rowCount;return this.transformRow(o,((e,t)=>{if(e)return this.rowCount-=1,s(e);if(!t)return s(new Error("expected transform result"));if(t.isValid){if(t.row)return this.pushRow(t.row,s)}else this.emit("data-invalid",t.row,a,t.reason);return s()}))};n(0)}transformRow(e,t){try{this.headerTransformer.transform(e,((r,n)=>r?t(r):n?n.isValid?n.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(n.row,t):this.skipRow(t):(this.rowCount-=1,this.parsedRowCount-=1,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(new Error("Expected result from header transform"))))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(e){return this.rowCount-=1,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return function(r){if(r){if(t)throw r;return t=!0,void e(r)}for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];e(...i)}}}Eb.CsvParserStream=tx,function(e){var t=p&&p.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&t(r,e,n);return i(r,e),r},o=p&&p.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseString=e.parseFile=e.parseStream=e.parse=e.ParserOptions=e.CsvParserStream=void 0;const a=s(r),l=n,h=wb,u=Eb;o(Ob,e);var c=Eb;Object.defineProperty(e,"CsvParserStream",{enumerable:!0,get:function(){return c.CsvParserStream}});var f=wb;Object.defineProperty(e,"ParserOptions",{enumerable:!0,get:function(){return f.ParserOptions}}),e.parse=e=>new u.CsvParserStream(new h.ParserOptions(e)),e.parseStream=(e,t)=>e.pipe(new u.CsvParserStream(new h.ParserOptions(t))),e.parseFile=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.createReadStream(e).pipe(new u.CsvParserStream(new h.ParserOptions(t)))},e.parseString=(e,t)=>{const r=new l.Readable;return r.push(e),r.push(null),r.pipe(new u.CsvParserStream(new h.ParserOptions(t)))}}(bb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CsvParserStream=e.ParserOptions=e.parseFile=e.parseStream=e.parseString=e.parse=e.FormatterOptions=e.CsvFormatterStream=e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=void 0;var t=S_;Object.defineProperty(e,"format",{enumerable:!0,get:function(){return t.format}}),Object.defineProperty(e,"write",{enumerable:!0,get:function(){return t.write}}),Object.defineProperty(e,"writeToStream",{enumerable:!0,get:function(){return t.writeToStream}}),Object.defineProperty(e,"writeToBuffer",{enumerable:!0,get:function(){return t.writeToBuffer}}),Object.defineProperty(e,"writeToString",{enumerable:!0,get:function(){return t.writeToString}}),Object.defineProperty(e,"writeToPath",{enumerable:!0,get:function(){return t.writeToPath}}),Object.defineProperty(e,"CsvFormatterStream",{enumerable:!0,get:function(){return t.CsvFormatterStream}}),Object.defineProperty(e,"FormatterOptions",{enumerable:!0,get:function(){return t.FormatterOptions}});var r=bb;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}}),Object.defineProperty(e,"parseString",{enumerable:!0,get:function(){return r.parseString}}),Object.defineProperty(e,"parseStream",{enumerable:!0,get:function(){return r.parseStream}}),Object.defineProperty(e,"parseFile",{enumerable:!0,get:function(){return r.parseFile}}),Object.defineProperty(e,"ParserOptions",{enumerable:!0,get:function(){return r.ParserOptions}}),Object.defineProperty(e,"CsvParserStream",{enumerable:!0,get:function(){return r.CsvParserStream}})}(k_);var rx={exports:{}};!function(e,t){e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,s={},o=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],h=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var r,n=s.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,t))>-1){r=i>12;break}}else r=e===(t?"pm":"PM");return r},c={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,a("seconds")],ss:[n,a("seconds")],m:[n,a("minutes")],mm:[n,a("minutes")],H:[n,a("hours")],h:[n,a("hours")],HH:[n,a("hours")],hh:[n,a("hours")],D:[n,a("day")],DD:[r,a("day")],Do:[i,function(e){var t=s.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,a("month")],MM:[r,a("month")],MMM:[i,function(e){var t=h("months"),r=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[r,function(e){this.year=o(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function f(r){var n,i;n=r,i=s&&s.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,n){var s=n&&n.toUpperCase();return r||i[n]||e[n]||i[s].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,r){return t||r.slice(1)}))}))).match(t),a=o.length,l=0;l<a;l+=1){var h=o[l],u=c[h],f=u&&u[0],d=u&&u[1];o[l]=d?{regex:f,parser:d}:h.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,n=0;r<a;r+=1){var i=o[r];if("string"==typeof i)n+=i.length;else{var s=i.regex,l=i.parser,h=e.slice(n),u=s.exec(h)[0];l.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(o=e.parseTwoDigitYear);var n=t.prototype,i=n.parse;n.parse=function(e){var t=e.date,n=e.utc,o=e.args;this.$u=n;var a=o[1];if("string"==typeof a){var l=!0===o[2],h=!0===o[3],u=l||h,c=o[2];h&&(c=o[2]),s=this.$locale(),!l&&c&&(s=r.Ls[c]),this.$d=function(e,t,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var n=f(t)(e),i=n.year,s=n.month,o=n.day,a=n.hours,l=n.minutes,h=n.seconds,u=n.milliseconds,c=n.zone,d=new Date,p=o||(i||s?1:d.getDate()),m=i||d.getFullYear(),g=0;i&&!s||(g=s>0?s-1:d.getMonth());var y=a||0,v=l||0,_=h||0,b=u||0;return c?new Date(Date.UTC(m,g,p,y,v,_,b+60*c.offset*1e3)):r?new Date(Date.UTC(m,g,p,y,v,_,b)):new Date(m,g,p,y,v,_,b)}catch(e){return new Date("")}}(t,a,n),this.init(),c&&!0!==c&&(this.$L=this.locale(c).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),s={}}else if(a instanceof Array)for(var d=a.length,p=1;p<=d;p+=1){o[1]=a[p-1];var m=r.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===d&&(this.$d=new Date(""))}else i.call(this,e)}}}()}(rx);var nx=rx.exports,ix={exports:{}};!function(e,t){e.exports=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var o=i.prototype;s.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var r=s(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var h=o.utcOffset;o.utcOffset=function(n,i){var s=this.$utils().u;if(s(n))return this.$u?0:s(this.$offset)?h.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],s=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===s?o:-o}(n),null===n))return this;var o=Math.abs(n)<=16?60*n:n,a=this;if(i)return a.$offset=o,a.$u=0===n,a;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+l,e)).$offset=o,a.$x.$localOffset=l}else a=this.utc();return a};var u=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var c=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var f=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return f.call(this,e,t,r);var n=this.local(),i=s(e).local();return f.call(n,i,t,r)}}}()}(ix);var sx=ix.exports,ox={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",s="minute",o="hour",a="day",l="week",h="month",u="quarter",c="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},y=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},v={s:y,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,h),s=r-i<0,o=t.clone().add(n+(s?-1:1),h);return+(-(n+(r-i)/(s?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:h,y:c,w:l,d:a,D:f,h:o,m:s,s:i,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",b={};b[_]=g;var w="$isDayjsObject",x=function(e){return e instanceof T||!(!e||!e[w])},k=function e(t,r,n){var i;if(!t)return _;if("string"==typeof t){var s=t.toLowerCase();b[s]&&(i=s),r&&(b[s]=r,i=s);var o=t.split("-");if(!i&&o.length>1)return e(o[0])}else{var a=t.name;b[a]=t,i=a}return!n&&i&&(_=i),i||!n&&_},S=function(e,t){if(x(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new T(r)},E=v;E.l=k,E.i=x,E.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===d)},y.isSame=function(e,t){var r=S(e);return this.startOf(t)<=r&&r<=this.endOf(t)},y.isAfter=function(e,t){return S(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<S(e)},y.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var r=this,n=!!E.u(t)||t,u=E.p(e),d=function(e,t){var i=E.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?i:i.endOf(a)},p=function(e,t){return E.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case c:return n?d(1,0):d(31,11);case h:return n?d(1,g):d(0,g+1);case l:var _=this.$locale().weekStart||0,b=(m<_?m+7:m)-_;return d(n?y-b:y+(6-b),g);case a:case f:return p(v+"Hours",0);case o:return p(v+"Minutes",1);case s:return p(v+"Seconds",2);case i:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var r,l=E.p(e),u="set"+(this.$u?"UTC":""),d=(r={},r[a]=u+"Date",r[f]=u+"Date",r[h]=u+"Month",r[c]=u+"FullYear",r[o]=u+"Hours",r[s]=u+"Minutes",r[i]=u+"Seconds",r[n]=u+"Milliseconds",r)[l],p=l===a?this.$D+(t-this.$W):t;if(l===h||l===c){var m=this.clone().set(f,1);m.$d[d](p),m.init(),this.$d=m.set(f,Math.min(this.$D,m.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[E.p(e)]()},y.add=function(n,u){var f,d=this;n=Number(n);var p=E.p(u),m=function(e){var t=S(d);return E.w(t.date(t.date()+Math.round(e*n)),d)};if(p===h)return this.set(h,this.$M+n);if(p===c)return this.set(c,this.$y+n);if(p===a)return m(1);if(p===l)return m(7);var g=(f={},f[s]=t,f[o]=r,f[i]=e,f)[p]||1,y=this.$d.getTime()+n*g;return E.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||d;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=E.z(this),s=this.$H,o=this.$m,a=this.$M,l=r.weekdays,h=r.months,u=r.meridiem,c=function(e,r,i,s){return e&&(e[r]||e(t,n))||i[r].slice(0,s)},f=function(e){return E.s(s%12||12,e,"0")},p=u||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(m,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return a+1;case"MM":return E.s(a+1,2,"0");case"MMM":return c(r.monthsShort,a,h,3);case"MMMM":return c(h,a);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return c(r.weekdaysMin,t.$W,l,2);case"ddd":return c(r.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return E.s(s,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(s,o,!0);case"A":return p(s,o,!1);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,f,d){var p,m=this,g=E.p(f),y=S(n),v=(y.utcOffset()-this.utcOffset())*t,_=this-y,b=function(){return E.m(m,y)};switch(g){case c:p=b()/12;break;case h:p=b();break;case u:p=b()/3;break;case l:p=(_-v)/6048e5;break;case a:p=(_-v)/864e5;break;case o:p=_/r;break;case s:p=_/t;break;case i:p=_/e;break;default:p=_}return d?p:E.a(p)},y.daysInMonth=function(){return this.endOf(h).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},y.clone=function(){return E.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),C=T.prototype;return S.prototype=C,[["$ms",n],["$s",i],["$m",s],["$H",o],["$W",a],["$M",h],["$y",c],["$D",f]].forEach((function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,T,S),e.$i=!0),S},S.locale=k,S.isDayjs=x,S.unix=function(e){return S(1e3*e)},S.en=b[_],S.Ls=b,S.p={},S}()}(ox);const ax=r,lx=k_,hx=nx,ux=sx,cx=ox.exports.extend(hx).extend(ux),fx=Ml,{fs:{exists:dx}}=Cl,px={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};var mx=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t=t||{},!await dx(e))throw new Error(`File not found: ${e}`);const r=ax.createReadStream(e),n=await this.read(r,t);return r.close(),n}read(e,t){return t=t||{},new Promise(((r,n)=>{const i=this.workbook.addWorksheet(t.sheetName),s=t.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],o=t.map||function(e){if(""===e)return null;const t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;const r=s.reduce(((t,r)=>{if(t)return t;const n=cx(e,r,!0);return n.isValid()?n:null}),null);if(r)return new Date(r.valueOf());const n=px[e];return void 0!==n?n:e},a=lx.parse(t.parserOptions).on("data",(e=>{i.addRow(e.map(o))})).on("end",(()=>{a.emit("worksheet",i)}));a.on("worksheet",r).on("error",n),e.pipe(a)}))}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(e,t){return new Promise(((r,n)=>{t=t||{};const i=this.workbook.getWorksheet(t.sheetName||t.sheetId),s=lx.format(t.formatterOptions);e.on("finish",(()=>{r()})),s.on("error",n),s.pipe(e);const{dateFormat:o,dateUTC:a}=t,l=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||"";if(e.formula||e.result)return e.result||"";if(e instanceof Date)return o?a?cx.utc(e).format(o):cx(e).format(o):a?cx.utc(e).format():cx(e).format();if(e.error)return e.error;if("object"==typeof e)return JSON.stringify(e)}return e}),h=void 0===t.includeEmptyRows||t.includeEmptyRows;let u=1;i&&i.eachRow(((e,t)=>{if(h)for(;u++<t-1;)s.write([]);const{values:r}=e;r.shift(),s.write(r.map(l)),u=t})),s.end()}))}writeFile(e,t){const r={encoding:(t=t||{}).encoding||"utf8"},n=ax.createWriteStream(e,r);return this.write(n,t)}async writeBuffer(e){const t=new fx;return await this.write(t,e),t.read()}};const gx=Se,yx=Le,vx=x_,_x=mx;var bx=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new yx}get xlsx(){return this._xlsx||(this._xlsx=new vx(this)),this._xlsx}get csv(){return this._csv||(this._csv=new _x(this)),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){const r=this.nextId;t&&("string"==typeof t?t={properties:{tabColor:{argb:t}}}:(t.argb||t.theme||t.indexed)&&(t={properties:{tabColor:t}}));const n=this._worksheets.reduce(((e,t)=>(t&&t.orderNo)>e?t.orderNo:e),0),i=Object.assign({},t,{id:r,name:e,orderNo:n+1,workbook:this}),s=new gx(i);return this._worksheets[r]=s,s}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){const t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){return void 0===e?this._worksheets.find(Boolean):"number"==typeof e?this._worksheets[e]:"string"==typeof e?this._worksheets.find((t=>t&&t.name===e)):void 0}get worksheets(){return this._worksheets.slice(1).sort(((e,t)=>e.orderNo-t.orderNo)).filter(Boolean)}eachSheet(e){this.worksheets.forEach((t=>{e(t,t.id)}))}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){const t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map((e=>e.model)),sheets:this.worksheets.map((e=>e.model)).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach((t=>{const{id:r,name:n,state:i}=t,s=e.sheets&&e.sheets.findIndex((e=>e.id===r));(this._worksheets[r]=new gx({id:r,name:n,orderNo:s,state:i,workbook:this})).model=t})),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}};const wx=x_;var xx=class{constructor(e){this.model=e}get xlsx(){return this._xlsx||(this._xlsx=new wx(this)),this._xlsx}};var kx="object"==typeof process&&process&&"win32"===process.platform?{sep:"\\"}:{sep:"/"},Sx=Ex;function Ex(e,t,r){e instanceof RegExp&&(e=Tx(e,r)),t instanceof RegExp&&(t=Tx(t,r));var n=Cx(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function Tx(e,t){var r=t.match(e);return r?r[0]:null}function Cx(e,t,r){var n,i,s,o,a,l=r.indexOf(e),h=r.indexOf(t,l+1),u=l;if(l>=0&&h>0){if(e===t)return[l,h];for(n=[],s=r.length;u>=0&&!a;)u==l?(n.push(u),l=r.indexOf(e,u+1)):1==n.length?a=[n.pop(),h]:((i=n.pop())<s&&(s=i,o=h),h=r.indexOf(t,u+1)),u=l<h&&l>=0?l:h;n.length&&(a=[s,o])}return a}Ex.range=Cx;var Ox=Sx,Rx=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return Hx(function(e){return e.split("\\\\").join(Ax).split("\\{").join(Nx).split("\\}").join(Ix).split("\\,").join(Px).split("\\.").join(Fx)}(e),!0).map(jx)},Ax="\0SLASH"+Math.random()+"\0",Nx="\0OPEN"+Math.random()+"\0",Ix="\0CLOSE"+Math.random()+"\0",Px="\0COMMA"+Math.random()+"\0",Fx="\0PERIOD"+Math.random()+"\0";function Dx(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function jx(e){return e.split(Ax).join("\\").split(Nx).join("{").split(Ix).join("}").split(Px).join(",").split(Fx).join(".")}function Mx(e){if(!e)return[""];var t=[],r=Ox("{","}",e);if(!r)return e.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var a=Mx(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function Lx(e){return"{"+e+"}"}function Bx(e){return/^-?0\d/.test(e)}function zx(e,t){return e<=t}function $x(e,t){return e>=t}function Hx(e,t){var r=[],n=Ox("{","}",e);if(!n)return[e];var i=n.pre,s=n.post.length?Hx(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var a=i+"{"+n.body+"}"+s[o];r.push(a)}else{var l,h,u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),f=u||c,d=n.body.indexOf(",")>=0;if(!f&&!d)return n.post.match(/,.*\}/)?Hx(e=n.pre+"{"+n.body+Ix+n.post):[e];if(f)l=n.body.split(/\.\./);else if(1===(l=Mx(n.body)).length&&1===(l=Hx(l[0],!1).map(Lx)).length)return s.map((function(e){return n.pre+l[0]+e}));if(f){var p=Dx(l[0]),m=Dx(l[1]),g=Math.max(l[0].length,l[1].length),y=3==l.length?Math.abs(Dx(l[2])):1,v=zx;m<p&&(y*=-1,v=$x);var _=l.some(Bx);h=[];for(var b=p;v(b,m);b+=y){var w;if(c)"\\"===(w=String.fromCharCode(b))&&(w="");else if(w=String(b),_){var x=g-w.length;if(x>0){var k=new Array(x+1).join("0");w=b<0?"-"+k+w.slice(1):k+w}}h.push(w)}}else{h=[];for(var S=0;S<l.length;S++)h.push.apply(h,Hx(l[S],!1))}for(S=0;S<h.length;S++)for(o=0;o<s.length;o++){a=i+h[S]+s[o];(!t||f||a)&&r.push(a)}}return r}const Ux=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return nk(t),!(!r.nocomment&&"#"===t.charAt(0))&&new ok(t,r).match(e)};var Vx=Ux;const Wx=kx;Ux.sep=Wx.sep;const qx=Symbol("globstar **");Ux.GLOBSTAR=qx;const Xx=Rx,Zx={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Gx="[^/]",Yx=Gx+"*?",Kx=e=>e.split("").reduce(((e,t)=>(e[t]=!0,e)),{}),Qx=Kx("().*{}+?[]^$\\!"),Jx=Kx("[.("),ek=/\/+/;Ux.filter=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(r,n,i)=>Ux(r,e,t)};const tk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={};return Object.keys(e).forEach((t=>r[t]=e[t])),Object.keys(t).forEach((e=>r[e]=t[e])),r};Ux.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return Ux;const t=Ux,r=(r,n,i)=>t(r,n,tk(e,i));return(r.Minimatch=class extends t.Minimatch{constructor(t,r){super(t,tk(e,r))}}).defaults=r=>t.defaults(tk(e,r)).Minimatch,r.filter=(r,n)=>t.filter(r,tk(e,n)),r.defaults=r=>t.defaults(tk(e,r)),r.makeRe=(r,n)=>t.makeRe(r,tk(e,n)),r.braceExpand=(r,n)=>t.braceExpand(r,tk(e,n)),r.match=(r,n,i)=>t.match(r,n,tk(e,i)),r},Ux.braceExpand=(e,t)=>rk(e,t);const rk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nk(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Xx(e)},nk=e=>{if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},ik=Symbol("subparse");Ux.makeRe=(e,t)=>new ok(e,t||{}).makeRe(),Ux.match=function(e,t){const r=new ok(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return e=e.filter((e=>r.match(e))),r.options.nonull&&!e.length&&e.push(t),e};const sk=e=>e.replace(/[[\]\\]/g,"\\$&");let ok=class{constructor(e,t){nk(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||!1===t.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();let r=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){}),this.debug(this.pattern,r),r=this.globParts=r.map((e=>e.split(ek))),this.debug(this.pattern,r),r=r.map(((e,t,r)=>e.map(this.parse,this))),this.debug(this.pattern,r),r=r.filter((e=>-1===e.indexOf(!1))),this.debug(this.pattern,r),this.set=r}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,r=0;for(let n=0;n<e.length&&"!"===e.charAt(n);n++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,o=e.length,a=t.length;i<o&&s<a;i++,s++){this.debug("matchOne loop");var l,h=t[s],u=e[i];if(this.debug(t,h,u),!1===h)return!1;if(h===qx){this.debug("GLOBSTAR",[t,h,u]);var c=i,f=s+1;if(f===a){for(this.debug("** at the end");i<o;i++)if("."===e[i]||".."===e[i]||!n.dot&&"."===e[i].charAt(0))return!1;return!0}for(;c<o;){var d=e[c];if(this.debug("\nglobstar while",e,c,t,f,d),this.matchOne(e.slice(c),t.slice(f),r))return this.debug("globstar found match!",c,o,d),!0;if("."===d||".."===d||!n.dot&&"."===d.charAt(0)){this.debug("dot detected!",e,c,t,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!(!r||(this.debug("\n>>> no match, partial?",e,c,t,f),c!==o))}if("string"==typeof h?(l=u===h,this.debug("string match",h,u,l)):(l=u.match(h),this.debug("pattern match",h,u,l)),!l)return!1}if(i===o&&s===a)return!0;if(i===o)return r;if(s===a)return i===o-1&&""===e[i];throw new Error("wtf?")}braceExpand(){return rk(this.pattern,this.options)}parse(e,t){nk(e);const r=this.options;if("**"===e){if(!r.noglobstar)return qx;e="*"}if(""===e)return"";let n="",i=!1,s=!1;const o=[],a=[];let l,h,u,c,f=!1,d=-1,p=-1,m="."===e.charAt(0),g=r.dot||m;const y=e=>"."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",v=()=>{if(l){switch(l){case"*":n+=Yx,i=!0;break;case"?":n+=Gx,i=!0;break;default:n+="\\"+l}this.debug("clearStateChar %j %j",l,n),l=!1}};for(let t,c=0;c<e.length&&(t=e.charAt(c));c++)if(this.debug("%s\t%s %s %j",e,c,n,t),s){if("/"===t)return!1;Qx[t]&&(n+="\\"),n+=t,s=!1}else switch(t){case"/":return!1;case"\\":if(f&&"-"===e.charAt(c+1)){n+=t;continue}v(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,c,n,t),f){this.debug(" in class"),"!"===t&&c===p+1&&(t="^"),n+=t;continue}this.debug("call clearStateChar %j",l),v(),l=t,r.noext&&v();continue;case"(":{if(f){n+="(";continue}if(!l){n+="\\(";continue}const t={type:l,start:c-1,reStart:n.length,open:Zx[l].open,close:Zx[l].close};this.debug(this.pattern,"\t",t),o.push(t),n+=t.open,0===t.start&&"!"!==t.type&&(m=!0,n+=y(e.slice(c+1))),this.debug("plType %j %j",l,n),l=!1;continue}case")":{const e=o[o.length-1];if(f||!e){n+="\\)";continue}o.pop(),v(),i=!0,u=e,n+=u.close,"!"===u.type&&a.push(Object.assign(u,{reEnd:n.length}));continue}case"|":{const t=o[o.length-1];if(f||!t){n+="\\|";continue}v(),n+="|",0===t.start&&"!"!==t.type&&(m=!0,n+=y(e.slice(c+1)));continue}case"[":if(v(),f){n+="\\"+t;continue}f=!0,p=c,d=n.length,n+=t;continue;case"]":if(c===p+1||!f){n+="\\"+t;continue}h=e.substring(p+1,c);try{RegExp("["+sk(h.replace(/\\([^-\]])/g,"$1"))+"]"),n+=t}catch(e){n=n.substring(0,d)+"(?:$.)"}i=!0,f=!1;continue;default:v(),!Qx[t]||"^"===t&&f||(n+="\\"),n+=t}for(f&&(h=e.slice(p+1),c=this.parse(h,ik),n=n.substring(0,d)+"\\["+c[0],i=i||c[1]),u=o.pop();u;u=o.pop()){let e;e=n.slice(u.reStart+u.open.length),this.debug("setting tail",n,u),e=e.replace(/((?:\\{2}){0,64})(\\?)\|/g,((e,t,r)=>(r||(r="\\"),t+t+r+"|"))),this.debug("tail=%j\n %s",e,e,u,n);const t="*"===u.type?Yx:"?"===u.type?Gx:"\\"+u.type;i=!0,n=n.slice(0,u.reStart)+t+"\\("+e}v(),s&&(n+="\\\\");const _=Jx[n.charAt(0)];for(let e=a.length-1;e>-1;e--){const r=a[e],i=n.slice(0,r.reStart),s=n.slice(r.reStart,r.reEnd-8);let o=n.slice(r.reEnd);const l=n.slice(r.reEnd-8,r.reEnd)+o,h=i.split(")").length,u=i.split("(").length-h;let c=o;for(let e=0;e<u;e++)c=c.replace(/\)[+*?]?/,"");o=c;n=i+s+o+(""===o&&t!==ik?"(?:$|\\/)":"")+l}if(""!==n&&i&&(n="(?=.)"+n),_&&(n=(m?"":g?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)")+n),t===ik)return[n,i];if(r.nocase&&!i&&(i=e.toUpperCase()!==e.toLowerCase()),!i)return(e=>e.replace(/\\(.)/g,"$1"))(e);const b=r.nocase?"i":"";try{return Object.assign(new RegExp("^"+n+"$",b),{_glob:e,_src:n})}catch(e){return new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const t=this.options,r=t.noglobstar?Yx:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",n=t.nocase?"i":"";let i=e.map((e=>(e=e.map((e=>"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e===qx?qx:e._src)).reduce(((e,t)=>(e[e.length-1]===qx&&t===qx||e.push(t),e)),[]),e.forEach(((t,n)=>{t===qx&&e[n-1]!==qx&&(0===n?e.length>1?e[n+1]="(?:\\/|"+r+"\\/)?"+e[n+1]:e[n]=r:n===e.length-1?e[n-1]+="(?:\\/|"+r+")?":(e[n-1]+="(?:\\/|\\/"+r+"\\/)"+e[n+1],e[n+1]=qx))})),e.filter((e=>e!==qx)).join("/")))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch(e){this.regexp=!1}return this.regexp}match(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.partial;if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;const r=this.options;"/"!==Wx.sep&&(e=e.split(Wx.sep).join("/")),e=e.split(ek),this.debug(this.pattern,"split",e);const n=this.set;let i;this.debug(this.pattern,"set",n);for(let t=e.length-1;t>=0&&(i=e[t],!i);t--);for(let s=0;s<n.length;s++){const o=n[s];let a=e;r.matchBase&&1===o.length&&(a=[i]);if(this.matchOne(a,o,t))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(e){return Ux.defaults(e).Minimatch}};Ux.Minimatch=ok;var ak=mk;const lk=r,{EventEmitter:hk}=i,{Minimatch:uk}=Vx,{resolve:ck}=l;function fk(e,t){return new Promise(((r,n)=>{(t?lk.stat:lk.lstat)(e,((n,i)=>{if(n)if("ENOENT"===n.code)r(t?fk(e,!1):null);else r(null);else r(i)}))}))}async function*dk(e,t,r,n,i,s){let o=await function(e,t){return new Promise(((r,n)=>{lk.readdir(e,{withFileTypes:!0},((e,i)=>{if(e)switch(e.code){case"ENOTDIR":t?n(e):r([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":r([]);break;default:n(e)}else r(i)}))}))}(t+e,s);for(const s of o){let o=s.name;void 0===o&&(o=s,n=!0);const a=e+"/"+o,l=a.slice(1),h=t+"/"+l;let u=null;(n||r)&&(u=await fk(h,r)),u||void 0===s.name||(u=s),null===u&&(u={isDirectory:()=>!1}),u.isDirectory()?i(l)||(yield{relative:l,absolute:h,stats:u},yield*dk(a,t,r,n,i,!1)):yield{relative:l,absolute:h,stats:u}}}class pk extends hk{constructor(e,t,r){if(super(),"function"==typeof t&&(r=t,t=null),this.options=function(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}(t||{}),this.matchers=[],this.options.pattern){const e=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=e.map((e=>new uk(e,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}if(this.ignoreMatchers=[],this.options.ignore){const e=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=e.map((e=>new uk(e,{dot:!0})))}if(this.skipMatchers=[],this.options.skip){const e=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=e.map((e=>new uk(e,{dot:!0})))}this.iterator=async function*(e,t,r,n){yield*dk("",e,t,r,n,!0)}(ck(e||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,r&&(this._matches=[],this.on("match",(e=>this._matches.push(this.options.absolute?e.absolute:e.relative))),this.on("error",(e=>r(e))),this.on("end",(()=>r(null,this._matches)))),setTimeout((()=>this._next()),0)}_shouldSkipDirectory(e){return this.skipMatchers.some((t=>t.match(e)))}_fileMatches(e,t){const r=e+(t?"/":"");return(0===this.matchers.length||this.matchers.some((e=>e.match(r))))&&!this.ignoreMatchers.some((e=>e.match(r)))&&(!this.options.nodir||!t)}_next(){this.paused||this.aborted?this.inactive=!0:this.iterator.next().then((e=>{if(e.done)this.emit("end");else{const t=e.value.stats.isDirectory();if(this._fileMatches(e.value.relative,t)){let r=e.value.relative,n=e.value.absolute;this.options.mark&&t&&(r+="/",n+="/"),this.options.stat?this.emit("match",{relative:r,absolute:n,stat:e.value.stats}):this.emit("match",{relative:r,absolute:n})}this._next(this.iterator)}})).catch((e=>{this.abort(),this.emit("error",e),!e.code&&this.options.silent}))}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}}function mk(e,t,r){return new pk(e,t,r)}function gk(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e(...r,...n)}}function yk(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.pop();return e.call(this,r,i)}}mk.ReaddirGlob=pk;var vk="function"==typeof queueMicrotask&&queueMicrotask,_k="function"==typeof setImmediate&&setImmediate,bk="object"==typeof process&&"function"==typeof process.nextTick;function wk(e){setTimeout(e,0)}function xk(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e((()=>t(...n)))}}var kk=xk(vk?queueMicrotask:_k?setImmediate:bk?process.nextTick:wk);function Sk(e){return Ck(e)?function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const i=r.pop();return Ek(e.apply(this,r),i)}:yk((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return Ek(n,r);r(null,n)}))}function Ek(e,t){return e.then((e=>{Tk(t,null,e)}),(e=>{Tk(t,e&&(e instanceof Error||e.message)?e:new Error(e))}))}function Tk(e,t,r){try{e(t,r)}catch(e){kk((e=>{throw e}),e)}}function Ck(e){return"AsyncFunction"===e[Symbol.toStringTag]}function Ok(e){if("function"!=typeof e)throw new Error("expected a function");return Ck(e)?Sk(e):e}function Rk(e,t){if(t||(t=e.length),!t)throw new Error("arity is undefined");return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return"function"==typeof n[t-1]?e.apply(this,n):new Promise(((r,i)=>{n[t-1]=function(e){if(e)return i(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];r(n.length>1?n:n[0])},e.apply(this,n)}))}}function Ak(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Rk((function(r){var i=this;return e(t,((e,t)=>{Ok(e).apply(i,n.concat(t))}),r)}))}}function Nk(e,t,r,n){t=t||[];var i=[],s=0,o=Ok(r);return e(t,((e,t,r)=>{var n=s++;o(e,((e,t)=>{i[n]=t,r(e)}))}),(e=>{n(e,i)}))}function Ik(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}var Pk={};function Fk(e){function t(){if(null!==e){var t=e;e=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}return Object.assign(t,e),t}function Dk(e){if(Ik(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):function(e){var t=e?Object.keys(e):[],r=-1,n=t.length;return function i(){var s=t[++r];return"__proto__"===s?i():r<n?{value:e[s],key:s}:null}}(e)}function jk(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}function Mk(e,t,r,n){let i=!1,s=!1,o=!1,a=0,l=0;function h(){a>=t||o||i||(o=!0,e.next().then((e=>{let{value:t,done:c}=e;if(!s&&!i){if(o=!1,c)return i=!0,void(a<=0&&n(null));a++,r(t,l,u),l++,h()}})).catch(c))}function u(e,t){if(a-=1,!s)return e?c(e):!1===e?(i=!0,void(s=!0)):t===Pk||i&&a<=0?(i=!0,n(null)):void h()}function c(e){s||(o=!1,i=!0,n(e))}h()}var Lk=e=>(t,r,n)=>{if(n=Fk(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if("AsyncGenerator"===t[Symbol.toStringTag])return Mk(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return Mk(t[Symbol.asyncIterator](),e,r,n);var i=Dk(t),s=!1,o=!1,a=0,l=!1;function h(e,t){if(!o)if(a-=1,e)s=!0,n(e);else if(!1===e)s=!0,o=!0;else{if(t===Pk||s&&a<=0)return s=!0,n(null);l||u()}}function u(){for(l=!0;a<e&&!s;){var t=i();if(null===t)return s=!0,void(a<=0&&n(null));a+=1,r(t.value,t.key,jk(h))}l=!1}u()};var Bk=Rk((function(e,t,r,n){return Lk(t)(e,Ok(r),n)}),4);function zk(e,t,r){r=Fk(r);var n=0,i=0,{length:s}=e,o=!1;function a(e,t){!1===e&&(o=!0),!0!==o&&(e?r(e):++i!==s&&t!==Pk||r(null))}for(0===s&&r(null);n<s;n++)t(e[n],n,jk(a))}function $k(e,t,r){return Bk(e,1/0,t,r)}var Hk=Rk((function(e,t,r){return(Ik(e)?zk:$k)(e,Ok(t),r)}),3);var Uk=Rk((function(e,t,r){return Nk(Hk,e,t,r)}),3),Vk=Ak(Uk);var Wk=Rk((function(e,t,r){return Bk(e,1,t,r)}),3);var qk=Rk((function(e,t,r){return Nk(Wk,e,t,r)}),3),Xk=Ak(qk);const Zk=Symbol("promiseCallback");function Gk(){let e,t;function r(r){if(r)return t(r);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];e(i.length>1?i:i[0])}return r[Zk]=new Promise(((r,n)=>{e=r,t=n})),r}function Yk(e,t,r){"number"!=typeof t&&(r=t,t=null),r=Fk(r||Gk());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},s=0,o=!1,a=!1,l=Object.create(null),h=[],u=[],c={};function f(e,t){h.push((()=>function(e,t){if(a)return;var n=jk((function(t){for(var n=arguments.length,h=new Array(n>1?n-1:0),u=1;u<n;u++)h[u-1]=arguments[u];if(s--,!1!==t)if(h.length<2&&([h]=h),t){var c={};if(Object.keys(i).forEach((e=>{c[e]=i[e]})),c[e]=h,a=!0,l=Object.create(null),o)return;r(t,c)}else i[e]=h,(l[e]||[]).forEach((e=>e())),d();else o=!0}));s++;var h=Ok(t[t.length-1]);t.length>1?h(i,n):h(n)}(e,t)))}function d(){if(!o){if(0===h.length&&0===s)return r(null,i);for(;h.length&&s<t;){h.shift()()}}}function p(t){var r=[];return Object.keys(e).forEach((n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)})),r}return Object.keys(e).forEach((t=>{var r=e[t];if(!Array.isArray(r))return f(t,[r]),void u.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return f(t,r),void u.push(t);c[t]=i,n.forEach((s=>{if(!e[s])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+s+"` in "+n.join(", "));!function(e,t){var r=l[e];r||(r=l[e]=[]);r.push(t)}(s,(()=>{0===--i&&f(t,r)}))}))})),function(){var e=0;for(;u.length;)e++,p(u.pop()).forEach((e=>{0==--c[e]&&u.push(e)}));if(e!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d(),r[Zk]}var Kk=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Qk=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Jk=/,/,eS=/(=.+)?(\s*)$/;function tS(e,t){var r={};return Object.keys(e).forEach((t=>{var n,i=e[t],s=Ck(i),o=!s&&1===i.length||s&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?a:i);else if(o)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(Kk);if(r||(r=t.match(Qk)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(Jk).map((e=>e.replace(eS,"").trim()))}(i),0===i.length&&!s&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");s||n.pop(),r[t]=n.concat(a)}function a(e,t){var r=n.map((t=>e[t]));r.push(t),Ok(i)(...r)}})),Yk(r,t)}class rS{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):nS(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):nS(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function nS(e,t){e.length=1,e.head=e.tail=t}function iS(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=Ok(e),i=0,s=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(e,t){return e?t?void(o[e]=o[e].filter((e=>e!==t))):o[e]=[]:Object.keys(o).forEach((e=>o[e]=[]))}function l(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o[e].forEach((e=>e(...r)))}var h=!1;function u(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,s;function o(e){if(e)return r?s(e):i();for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(n.length<=1)return i(n[0]);i(n)}m.started=!0;var a=m._createTaskItem(e,r?o:n||o);if(t?m._tasks.unshift(a):m._tasks.push(a),h||(h=!0,kk((()=>{h=!1,m.process()}))),r||!n)return new Promise(((e,t)=>{i=e,s=t}))}function c(e){return function(t){i-=1;for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var a=0,h=e.length;a<h;a++){var u=e[a],c=s.indexOf(u);0===c?s.shift():c>0&&s.splice(c,1),u.callback(t,...n),null!=t&&l("error",t,u.data)}i<=m.concurrency-m.buffer&&l("unsaturated"),m.idle()&&l("drain"),m.process()}}function f(e){return!(0!==e.length||!m.idle())&&(kk((()=>l("drain"))),!0)}const d=e=>t=>{if(!t)return new Promise(((t,r)=>{!function(e,t){const r=function(){a(e,r),t(...arguments)};o[e].push(r)}(e,((e,n)=>{if(e)return r(e);t(n)}))}));a(e),function(e,t){o[e].push(t)}(e,t)};var p=!1,m={_tasks:new rS,_createTaskItem:(e,t)=>({data:e,callback:t}),*[Symbol.iterator](){yield*m._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>u(e,!1,!1,t)))}return u(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>u(e,!1,!0,t)))}return u(e,!1,!0,t)},kill(){a(),m._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>u(e,!0,!1,t)))}return u(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>u(e,!0,!0,t)))}return u(e,!0,!0,t)},remove(e){m._tasks.remove(e)},process(){if(!p){for(p=!0;!m.paused&&i<m.concurrency&&m._tasks.length;){var e=[],t=[],r=m._tasks.length;m.payload&&(r=Math.min(r,m.payload));for(var o=0;o<r;o++){var a=m._tasks.shift();e.push(a),s.push(a),t.push(a.data)}i+=1,0===m._tasks.length&&l("empty"),i===m.concurrency&&l("saturated");var h=jk(c(e));n(t,h)}p=!1}},length:()=>m._tasks.length,running:()=>i,workersList:()=>s,idle:()=>m._tasks.length+i===0,pause(){m.paused=!0},resume(){!1!==m.paused&&(m.paused=!1,kk(m.process))}};return Object.defineProperties(m,{saturated:{writable:!1,value:d("saturated")},unsaturated:{writable:!1,value:d("unsaturated")},empty:{writable:!1,value:d("empty")},drain:{writable:!1,value:d("drain")},error:{writable:!1,value:d("error")}}),m}function sS(e,t){return iS(e,1,t)}function oS(e,t,r){return iS(e,t,r)}var aS=Rk((function(e,t,r,n){n=Fk(n);var i=Ok(r);return Wk(e,((e,r,n)=>{i(t,e,((e,r)=>{t=r,n(e)}))}),(e=>n(e,t)))}),4);function lS(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map(Ok);return function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var s=r[r.length-1];return"function"==typeof s?r.pop():s=Gk(),aS(n,r,((t,r,n)=>{r.apply(e,t.concat((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];n(e,r)})))}),((e,t)=>s(e,...t))),s[Zk]}}function hS(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return lS(...t.reverse())}var uS=Rk((function(e,t,r,n){return Nk(Lk(t),e,r,n)}),4);var cS=Rk((function(e,t,r,n){var i=Ok(r);return uS(e,t,((e,t)=>{i(e,(function(e){if(e)return t(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t(e,n)}))}),((e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)}))}),4);var fS=Rk((function(e,t,r){return cS(e,1/0,t,r)}),3);var dS=Rk((function(e,t,r){return cS(e,1,t,r)}),3);function pS(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.pop()(null,...t)}}function mS(e,t){return(r,n,i,s)=>{var o,a=!1;const l=Ok(i);r(n,((r,n,i)=>{l(r,((n,s)=>n||!1===n?i(n):e(s)&&!o?(a=!0,o=t(!0,r),i(null,Pk)):void i()))}),(e=>{if(e)return s(e);s(null,a?o:t(!1))}))}}var gS=Rk((function(e,t,r){return mS((e=>e),((e,t)=>t))(Hk,e,t,r)}),3);var yS=Rk((function(e,t,r,n){return mS((e=>e),((e,t)=>t))(Lk(t),e,r,n)}),4);var vS=Rk((function(e,t,r){return mS((e=>e),((e,t)=>t))(Lk(1),e,t,r)}),3);function _S(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Ok(t)(...n,(function(t){if("object"==typeof console)if(t)console.error&&console.error(t);else if(console[e]){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.forEach((t=>console[e](t)))}}))}}var bS=_S("dir");var wS=Rk((function(e,t,r){r=jk(r);var n,i=Ok(e),s=Ok(t);function o(e){if(e)return r(e);if(!1!==e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];n=i,s(...i,a)}}function a(e,t){return e?r(e):!1!==e?t?void i(o):r(null,...n):void 0}return a(null,!0)}),3);function xS(e,t,r){const n=Ok(t);return wS(e,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const i=t.pop();n(...t,((e,t)=>i(e,!t)))}),r)}function kS(e){return(t,r,n)=>e(t,n)}var SS=Rk((function(e,t,r){return Hk(e,kS(Ok(t)),r)}),3);var ES=Rk((function(e,t,r,n){return Lk(t)(e,kS(Ok(r)),n)}),4);var TS=Rk((function(e,t,r){return ES(e,1,t,r)}),3);function CS(e){return Ck(e)?e:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.pop(),s=!0;r.push((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s?kk((()=>i(...t))):i(...t)})),e.apply(this,r),s=!1}}var OS=Rk((function(e,t,r){return mS((e=>!e),(e=>!e))(Hk,e,t,r)}),3);var RS=Rk((function(e,t,r,n){return mS((e=>!e),(e=>!e))(Lk(t),e,r,n)}),4);var AS=Rk((function(e,t,r){return mS((e=>!e),(e=>!e))(Wk,e,t,r)}),3);function NS(e,t,r,n){var i=new Array(t.length);e(t,((e,t,n)=>{r(e,((e,r)=>{i[t]=!!r,n(e)}))}),(e=>{if(e)return n(e);for(var r=[],s=0;s<t.length;s++)i[s]&&r.push(t[s]);n(null,r)}))}function IS(e,t,r,n){var i=[];e(t,((e,t,n)=>{r(e,((r,s)=>{if(r)return n(r);s&&i.push({index:t,value:e}),n(r)}))}),(e=>{if(e)return n(e);n(null,i.sort(((e,t)=>e.index-t.index)).map((e=>e.value)))}))}function PS(e,t,r,n){return(Ik(t)?NS:IS)(e,t,Ok(r),n)}var FS=Rk((function(e,t,r){return PS(Hk,e,t,r)}),3);var DS=Rk((function(e,t,r,n){return PS(Lk(t),e,r,n)}),4);var jS=Rk((function(e,t,r){return PS(Wk,e,t,r)}),3);var MS=Rk((function(e,t){var r=jk(t),n=Ok(CS(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2);var LS=Rk((function(e,t,r,n){var i=Ok(r);return uS(e,t,((e,t)=>{i(e,((r,n)=>r?t(r):t(r,{key:n,val:e})))}),((e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,s=0;s<t.length;s++)if(t[s]){var{key:o}=t[s],{val:a}=t[s];i.call(r,o)?r[o].push(a):r[o]=[a]}return n(e,r)}))}),4);function BS(e,t,r){return LS(e,1/0,t,r)}function zS(e,t,r){return LS(e,1,t,r)}var $S=_S("log");var HS=Rk((function(e,t,r,n){n=Fk(n);var i={},s=Ok(r);return Lk(t)(e,((e,t,r)=>{s(e,t,((e,n)=>{if(e)return r(e);i[t]=n,r(e)}))}),(e=>n(e,i)))}),4);function US(e,t,r){return HS(e,1/0,t,r)}function VS(e,t,r){return HS(e,1,t,r)}function WS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;var r=Object.create(null),n=Object.create(null),i=Ok(e),s=yk(((e,s)=>{var o=t(...e);o in r?kk((()=>s(null,...r[o]))):o in n?n[o].push(s):(n[o]=[s],i(...e,(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];e||(r[o]=i);var a=n[o];delete n[o];for(var l=0,h=a.length;l<h;l++)a[l](e,...i)})))}));return s.memo=r,s.unmemoized=e,s}var qS=xk(bk?process.nextTick:_k?setImmediate:wk),XS=Rk(((e,t,r)=>{var n=Ik(t)?[]:{};e(t,((e,t,r)=>{Ok(e)((function(e){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];s.length<2&&([s]=s),n[t]=s,r(e)}))}),(e=>r(e,n)))}),3);function ZS(e,t){return XS(Hk,e,t)}function GS(e,t,r){return XS(Lk(t),e,r)}function YS(e,t){var r=Ok(e);return iS(((e,t)=>{r(e[0],t)}),t,1)}class KS{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&eE(this.heap[e],this.heap[t=JS(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=QS(e))<this.heap.length&&(t+1<this.heap.length&&eE(this.heap[t+1],this.heap[t])&&(t+=1),!eE(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=JS(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function QS(e){return 1+(e<<1)}function JS(e){return(e+1>>1)-1}function eE(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}function tE(e,t){var r=YS(e,t),{push:n,pushAsync:i}=r;function s(e,t){return Array.isArray(e)?e.map((e=>({data:e,priority:t}))):{data:e,priority:t}}return r._tasks=new KS,r._createTaskItem=(e,t)=>{let{data:r,priority:n}=e;return{data:r,priority:n,callback:t}},r.push=function(e){let t=arguments.length>2?arguments[2]:void 0;return n(s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),t)},r.pushAsync=function(e){let t=arguments.length>2?arguments[2]:void 0;return i(s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),t)},delete r.unshift,delete r.unshiftAsync,r}var rE=Rk((function(e,t){if(t=Fk(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)Ok(e[r])(t)}),2);function nE(e,t,r,n){var i=[...e].reverse();return aS(i,t,r,n)}function iE(e){var t=Ok(e);return yk((function(e,r){return e.push((function(e){let t={};e&&(t.error=e);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];if(i.length>0){var o=i;i.length<=1&&([o]=i),t.value=o}r(null,t)})),t.apply(this,e)}))}function sE(e){var t;return Array.isArray(e)?t=e.map(iE):(t={},Object.keys(e).forEach((r=>{t[r]=iE.call(this,e[r])}))),t}function oE(e,t,r,n){const i=Ok(r);return PS(e,t,((e,t)=>{i(e,((e,r)=>{t(e,!r)}))}),n)}var aE=Rk((function(e,t,r){return oE(Hk,e,t,r)}),3);var lE=Rk((function(e,t,r,n){return oE(Lk(t),e,r,n)}),4);var hE=Rk((function(e,t,r){return oE(Wk,e,t,r)}),3);function uE(e){return function(){return e}}const cE=5,fE=0;function dE(e,t,r){var n={times:cE,intervalFunc:uE(fE)};if(arguments.length<3&&"function"==typeof e?(r=t||Gk(),t=e):(!function(e,t){if("object"==typeof t)e.times=+t.times||cE,e.intervalFunc="function"==typeof t.interval?t.interval:uE(+t.interval||fE),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||cE}}(n,e),r=r||Gk()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=Ok(t),s=1;return function e(){i((function(t){if(!1!==t)if(t&&s++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(t)))setTimeout(e,n.intervalFunc(s-1));else{for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];r(t,...o)}}))}(),r[Zk]}function pE(e,t){t||(t=e,e=null);let r=e&&e.arity||t.length;Ck(t)&&(r+=1);var n=Ok(t);return yk(((t,i)=>{function s(e){n(...t,e)}return(t.length<r-1||null==i)&&(t.push(i),i=Gk()),e?dE(e,s,i):dE(s,i),i[Zk]}))}function mE(e,t){return XS(Wk,e,t)}var gE=Rk((function(e,t,r){return mS(Boolean,(e=>e))(Hk,e,t,r)}),3);var yE=Rk((function(e,t,r,n){return mS(Boolean,(e=>e))(Lk(t),e,r,n)}),4);var vE=Rk((function(e,t,r){return mS(Boolean,(e=>e))(Wk,e,t,r)}),3);var _E=Rk((function(e,t,r){var n=Ok(t);return Uk(e,((e,t)=>{n(e,((r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})}))}),((e,t)=>{if(e)return r(e);r(null,t.sort(i).map((e=>e.value)))}));function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function bE(e,t,r){var n=Ok(e);return yk(((i,s)=>{var o,a=!1;i.push((function(){a||(s(...arguments),clearTimeout(o))})),o=setTimeout((function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,s(n)}),t),n(...i)}))}function wE(e,t,r,n){var i=Ok(r);return uS(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}function xE(e,t,r){return wE(e,1/0,t,r)}function kE(e,t,r){return wE(e,1,t,r)}function SE(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=Fk(n||Gk());var i=Ok(r);return Hk(e,((e,r,n)=>{i(t,e,r,n)}),(e=>n(e,t))),n[Zk]}var EE=Rk((function(e,t){var r,n=null;return TS(e,((e,t)=>{Ok(e)((function(e){if(!1===e)return t(e);for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];s.length<2?[r]=s:r=s,n=e,t(e?null:{})}))}),(()=>t(n,r)))}));function TE(e){return function(){return(e.unmemoized||e)(...arguments)}}var CE=Rk((function(e,t,r){r=jk(r);var n=Ok(t),i=Ok(e),s=[];function o(e){if(e)return r(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];s=n,!1!==e&&i(a)}function a(e,t){return e?r(e):!1!==e?t?void n(o):r(null,...s):void 0}return i(a)}),3);function OE(e,t,r){const n=Ok(e);return CE((e=>n(((t,r)=>e(t,!r)))),t,r)}var RE=Rk((function(e,t){if(t=Fk(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){Ok(e[r++])(...t,jk(i))}function i(i){if(!1!==i){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(i||r===e.length)return t(i,...o);n(o)}}n([])})),AE={apply:gk,applyEach:Vk,applyEachSeries:Xk,asyncify:Sk,auto:Yk,autoInject:tS,cargo:sS,cargoQueue:oS,compose:hS,concat:fS,concatLimit:cS,concatSeries:dS,constant:pS,detect:gS,detectLimit:yS,detectSeries:vS,dir:bS,doUntil:xS,doWhilst:wS,each:SS,eachLimit:ES,eachOf:Hk,eachOfLimit:Bk,eachOfSeries:Wk,eachSeries:TS,ensureAsync:CS,every:OS,everyLimit:RS,everySeries:AS,filter:FS,filterLimit:DS,filterSeries:jS,forever:MS,groupBy:BS,groupByLimit:LS,groupBySeries:zS,log:$S,map:Uk,mapLimit:uS,mapSeries:qk,mapValues:US,mapValuesLimit:HS,mapValuesSeries:VS,memoize:WS,nextTick:qS,parallel:ZS,parallelLimit:GS,priorityQueue:tE,queue:YS,race:rE,reduce:aS,reduceRight:nE,reflect:iE,reflectAll:sE,reject:aE,rejectLimit:lE,rejectSeries:hE,retry:dE,retryable:pE,seq:lS,series:mE,setImmediate:kk,some:gE,someLimit:yE,someSeries:vE,sortBy:_E,timeout:bE,times:xE,timesLimit:wE,timesSeries:kE,transform:SE,tryEach:EE,unmemoize:TE,until:OE,waterfall:RE,whilst:CE,all:OS,allLimit:RS,allSeries:AS,any:gE,anyLimit:yE,anySeries:vE,find:gS,findLimit:yS,findSeries:vS,flatMap:fS,flatMapLimit:cS,flatMapSeries:dS,forEach:SS,forEachSeries:TS,forEachLimit:ES,forEachOf:Hk,forEachOfSeries:Wk,forEachOfLimit:Bk,inject:aS,foldl:aS,foldr:nE,select:FS,selectLimit:DS,selectSeries:jS,wrapSync:Sk,during:CE,doDuring:wS},NE=g(Object.freeze({__proto__:null,all:OS,allLimit:RS,allSeries:AS,any:gE,anyLimit:yE,anySeries:vE,apply:gk,applyEach:Vk,applyEachSeries:Xk,asyncify:Sk,auto:Yk,autoInject:tS,cargo:sS,cargoQueue:oS,compose:hS,concat:fS,concatLimit:cS,concatSeries:dS,constant:pS,default:AE,detect:gS,detectLimit:yS,detectSeries:vS,dir:bS,doDuring:wS,doUntil:xS,doWhilst:wS,during:CE,each:SS,eachLimit:ES,eachOf:Hk,eachOfLimit:Bk,eachOfSeries:Wk,eachSeries:TS,ensureAsync:CS,every:OS,everyLimit:RS,everySeries:AS,filter:FS,filterLimit:DS,filterSeries:jS,find:gS,findLimit:yS,findSeries:vS,flatMap:fS,flatMapLimit:cS,flatMapSeries:dS,foldl:aS,foldr:nE,forEach:SS,forEachLimit:ES,forEachOf:Hk,forEachOfLimit:Bk,forEachOfSeries:Wk,forEachSeries:TS,forever:MS,groupBy:BS,groupByLimit:LS,groupBySeries:zS,inject:aS,log:$S,map:Uk,mapLimit:uS,mapSeries:qk,mapValues:US,mapValuesLimit:HS,mapValuesSeries:VS,memoize:WS,nextTick:qS,parallel:ZS,parallelLimit:GS,priorityQueue:tE,queue:YS,race:rE,reduce:aS,reduceRight:nE,reflect:iE,reflectAll:sE,reject:aE,rejectLimit:lE,rejectSeries:hE,retry:dE,retryable:pE,select:FS,selectLimit:DS,selectSeries:jS,seq:lS,series:mE,setImmediate:kk,some:gE,someLimit:yE,someSeries:vE,sortBy:_E,timeout:bE,times:xE,timesLimit:wE,timesSeries:kE,transform:SE,tryEach:EE,unmemoize:TE,until:OE,waterfall:RE,whilst:CE,wrapSync:Sk})),IE={exports:{}},PE=h,FE=process.cwd,DE=null,jE=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return DE||(DE=FE.call(process)),DE};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ME=process.chdir;process.chdir=function(e){DE=null,ME.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ME)}var LE=function(e){PE.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,r,n){e.open(t,PE.O_WRONLY|PE.O_SYMLINK,r,(function(t,i){t?n&&n(t):e.fchmod(i,r,(function(t){e.close(i,(function(e){n&&n(t||e)}))}))}))},e.lchmodSync=function(t,r){var n,i=e.openSync(t,PE.O_WRONLY|PE.O_SYMLINK,r),s=!0;try{n=e.fchmodSync(i,r),s=!1}finally{if(s)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return n}}(e);e.lutimes||function(e){PE.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,r,n,i){e.open(t,PE.O_SYMLINK,(function(t,s){t?i&&i(t):e.futimes(s,r,n,(function(t){e.close(s,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,r,n){var i,s=e.openSync(t,PE.O_SYMLINK),o=!0;try{i=e.futimesSync(s,r,n),o=!1}finally{if(o)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return i}):e.futimes&&(e.lutimes=function(e,t,r,n){n&&process.nextTick(n)},e.lutimesSync=function(){})}(e);e.chown=n(e.chown),e.fchown=n(e.fchown),e.lchown=n(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=i(e.chownSync),e.fchownSync=i(e.fchownSync),e.lchownSync=i(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=o(e.statSync),e.fstatSync=o(e.fstatSync),e.lstatSync=o(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,r){r&&process.nextTick(r)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,r,n){n&&process.nextTick(n)},e.lchownSync=function(){});"win32"===jE&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function r(r,n,i){var s=Date.now(),o=0;t(r,n,(function a(l){if(l&&("EACCES"===l.code||"EPERM"===l.code||"EBUSY"===l.code)&&Date.now()-s<6e4)return setTimeout((function(){e.stat(n,(function(e,s){e&&"ENOENT"===e.code?t(r,n,a):i(l)}))}),o),void(o<100&&(o+=10));i&&i(l)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.rename));function t(t){return t?function(r,n,i){return t.call(e,r,n,(function(e){a(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function r(t){return t?function(r,n){try{return t.call(e,r,n)}catch(e){if(!a(e))throw e}}:t}function n(t){return t?function(r,n,i,s){return t.call(e,r,n,i,(function(e){a(e)&&(e=null),s&&s.apply(this,arguments)}))}:t}function i(t){return t?function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!a(e))throw e}}:t}function s(t){return t?function(r,n,i){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof n&&(i=n,n=null),n?t.call(e,r,n,s):t.call(e,r,s)}:t}function o(t){return t?function(r,n){var i=n?t.call(e,r,n):t.call(e,r);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:t}function a(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function r(r,n,i,s,o,a){var l;if(a&&"function"==typeof a){var h=0;l=function(u,c,f){if(u&&"EAGAIN"===u.code&&h<10)return h++,t.call(e,r,n,i,s,o,l);a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,l)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(l=e.readSync,function(t,r,n,i,s){for(var o=0;;)try{return l.call(e,t,r,n,i,s)}catch(e){if("EAGAIN"===e.code&&o<10){o++;continue}throw e}});var l};var BE=n.Stream,zE=function(e){return{ReadStream:function t(r,n){if(!(this instanceof t))return new t(r,n);BE.call(this);var i=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o<a;o++){var l=s[o];this[l]=n[l]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(r,n){if(!(this instanceof t))return new t(r,n);BE.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var i=Object.keys(n),s=0,o=i.length;s<o;s++){var a=i[s];this[a]=n[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var $E=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:HE(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t},HE=Object.getPrototypeOf||function(e){return e.__proto__};var UE,VE,WE=r,qE=LE,XE=zE,ZE=$E,GE=o;function YE(e,t){Object.defineProperty(e,UE,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(UE=Symbol.for("graceful-fs.queue"),VE=Symbol.for("graceful-fs.previous")):(UE="___graceful-fs.queue",VE="___graceful-fs.previous");var KE=function(){};if(GE.debuglog?KE=GE.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(KE=function(){var e=GE.format.apply(GE,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ")}),!WE[UE]){var QE=p[UE]||[];YE(WE,QE),WE.close=function(e){function t(t,r){return e.call(WE,t,(function(e){e||nT(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(t,VE,{value:e}),t}(WE.close),WE.closeSync=function(e){function t(t){e.apply(WE,arguments),nT()}return Object.defineProperty(t,VE,{value:e}),t}(WE.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){KE(WE[UE]),u.equal(WE[UE].length,0)}))}p[UE]||YE(p,WE[UE]);var JE,eT=tT(ZE(WE));function tT(e){qE(e),e.gracefulify=tT,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,n){"function"==typeof r&&(n=r,r=null);return function e(r,n,i,s){return t(r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):rT([e,[r,n,i],t,s||Date.now(),Date.now()])}))}(e,r,n)};var r=e.writeFile;e.writeFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,s,o){return r(t,n,i,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):rT([e,[t,n,i,s],r,o||Date.now(),Date.now()])}))}(e,t,n,i)};var n=e.appendFile;n&&(e.appendFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,s,o){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof s&&s.apply(this,arguments):rT([e,[t,r,i,s],n,o||Date.now(),Date.now()])}))}(e,t,r,i)});var i=e.copyFile;i&&(e.copyFile=function(e,t,r,n){"function"==typeof r&&(n=r,r=0);return function e(t,r,n,s,o){return i(t,r,n,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof s&&s.apply(this,arguments):rT([e,[t,r,n,s],i,o||Date.now(),Date.now()])}))}(e,t,r,n)});var s=e.readdir;e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);var n=o.test(process.version)?function(e,t,r,n){return s(e,i(e,t,r,n))}:function(e,t,r,n){return s(e,t,i(e,t,r,n))};return n(e,t,r);function i(e,t,r,i){return function(s,o){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(o&&o.sort&&o.sort(),"function"==typeof r&&r.call(this,s,o)):rT([n,[e,t,r],s,i||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var a=XE(e);f=a.ReadStream,d=a.WriteStream}var l=e.ReadStream;l&&(f.prototype=Object.create(l.prototype),f.prototype.open=function(){var e=this;m(e.path,e.flags,e.mode,(function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())}))});var h=e.WriteStream;h&&(d.prototype=Object.create(h.prototype),d.prototype.open=function(){var e=this;m(e.path,e.flags,e.mode,(function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var u=f;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var c=d;function f(e,t){return this instanceof f?(l.apply(this,arguments),this):f.apply(Object.create(f.prototype),arguments)}function d(e,t){return this instanceof d?(h.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return c},set:function(e){c=e},enumerable:!0,configurable:!0});var p=e.open;function m(e,t,r,n){return"function"==typeof r&&(n=r,r=null),function e(t,r,n,i,s){return p(t,r,n,(function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):rT([e,[t,r,n,i],o,s||Date.now(),Date.now()])}))}(e,t,r,n)}return e.open=m,e}function rT(e){KE("ENQUEUE",e[0].name,e[1]),WE[UE].push(e),iT()}function nT(){for(var e=Date.now(),t=0;t<WE[UE].length;++t)WE[UE][t].length>2&&(WE[UE][t][3]=e,WE[UE][t][4]=e);iT()}function iT(){if(clearTimeout(JE),JE=void 0,0!==WE[UE].length){var e=WE[UE].shift(),t=e[0],r=e[1],n=e[2],i=e[3],s=e[4];if(void 0===i)KE("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-i>=6e4){KE("TIMEOUT",t.name,r);var o=r.pop();"function"==typeof o&&o.call(null,n)}else{var a=Date.now()-s,l=Math.max(s-i,1);a>=Math.min(1.2*l,100)?(KE("RETRY",t.name,r),t.apply(null,r.concat([i]))):WE[UE].push(e)}void 0===JE&&(JE=setTimeout(iT,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!WE.__patched&&(eT=tT(WE),WE.__patched=!0);var sT=At().PassThrough,oT=o,aT=sT,lT={Readable:uT,Writable:cT};function hT(e,t,r){e[t]=function(){return delete e[t],r.apply(this,arguments),this[t].apply(this,arguments)}}function uT(e,t){if(!(this instanceof uT))return new uT(e,t);aT.call(this,t),hT(this,"_read",(function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),r.pipe(this)})),this.emit("readable")}function cT(e,t){if(!(this instanceof cT))return new cT(e,t);aT.call(this,t),hT(this,"_write",(function(){var r=e.call(this,t),n=this.emit.bind(this,"error");r.on("error",n),this.pipe(r)})),this.emit("writable")}
26
+ /*!
27
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
28
+ *
29
+ * Copyright (c) 2014-2018, Jon Schlinkert.
30
+ * Released under the MIT License.
31
+ */oT.inherits(uT,aT),oT.inherits(cT,aT);var fT=function(e,t){if("string"!=typeof e)throw new TypeError("expected path to be a string");if("\\"===e||"/"===e)return"/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&"\\"===e[3]){var i=e[2];"?"!==i&&"."!==i||"\\\\"!==e.slice(0,2)||(e=e.slice(2),n="//")}var s=e.split(/[/\\]+/);return!1!==t&&""===s[s.length-1]&&s.pop(),n+s.join("/")},dT=9007199254740991,pT="[object Arguments]",mT="[object Function]",gT="[object GeneratorFunction]",yT=/^(?:0|[1-9]\d*)$/;function vT(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var _T=Object.prototype,bT=_T.hasOwnProperty,wT=_T.toString,xT=_T.propertyIsEnumerable,kT=Math.max;function ST(e,t){var r=NT(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&IT(e)}(e)&&bT.call(e,"callee")&&(!xT.call(e,"callee")||wT.call(e)==pT)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var s in e)!t&&!bT.call(e,s)||i&&("length"==s||RT(s,n))||r.push(s);return r}function ET(e,t,r,n){return void 0===e||AT(e,_T[r])&&!bT.call(n,r)?t:e}function TT(e,t,r){var n=e[t];bT.call(e,t)&&AT(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function CT(e){if(!PT(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t,r,n,i=(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||_T,t===n),s=[];for(var o in e)("constructor"!=o||!i&&bT.call(e,o))&&s.push(o);return s}function OT(e,t){return t=kT(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=kT(r.length-t,0),s=Array(i);++n<i;)s[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];return o[t]=s,vT(e,this,o)}}function RT(e,t){return!!(t=null==t?dT:t)&&("number"==typeof e||yT.test(e))&&e>-1&&e%1==0&&e<t}function AT(e,t){return e===t||e!=e&&t!=t}var NT=Array.isArray;function IT(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=dT}(e.length)&&!function(e){var t=PT(e)?wT.call(e):"";return t==mT||t==gT}(e)}function PT(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var FT,DT=(FT=function(e,t,r,n){!function(e,t,r,n){r||(r={});for(var i=-1,s=t.length;++i<s;){var o=t[i],a=n?n(r[o],e[o],o,r,e):void 0;TT(r,o,void 0===a?e[o]:a)}}(t,function(e){return IT(e)?ST(e,!0):CT(e)}(t),e,n)},OT((function(e,t){var r=-1,n=t.length,i=n>1?t[n-1]:void 0,s=n>2?t[2]:void 0;for(i=FT.length>3&&"function"==typeof i?(n--,i):void 0,s&&function(e,t,r){if(!PT(r))return!1;var n=typeof t;return!!("number"==n?IT(r)&&RT(t,r.length):"string"==n&&t in r)&&AT(r[t],e)}(t[0],t[1],s)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var o=t[r];o&&FT(e,o,r,i)}return e})));var jT=OT((function(e){return e.push(void 0,ET),vT(DT,void 0,e)})),MT={exports:{}},LT=9007199254740991,BT="[object Arguments]",zT="[object Function]",$T="[object GeneratorFunction]",HT="object"==typeof p&&p&&p.Object===Object&&p,UT="object"==typeof self&&self&&self.Object===Object&&self,VT=HT||UT||Function("return this")();function WT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var qT=Object.prototype,XT=qT.hasOwnProperty,ZT=qT.toString,GT=VT.Symbol,YT=qT.propertyIsEnumerable,KT=GT?GT.isConcatSpreadable:void 0;function QT(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=JT),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?QT(a,t-1,r,n,i):WT(i,a):n||(i[i.length]=a)}return i}function JT(e){return eC(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=LT}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?ZT.call(e):"";return t==zT||t==$T}(e)}(e)}(e)&&XT.call(e,"callee")&&(!YT.call(e,"callee")||ZT.call(e)==BT)}(e)||!!(KT&&e&&e[KT])}var eC=Array.isArray;var tC=function(e){return(e?e.length:0)?QT(e,1):[]},rC="__lodash_hash_undefined__",nC=9007199254740991,iC="[object Arguments]",sC="[object Function]",oC="[object GeneratorFunction]",aC=/^\[object .+?Constructor\]$/,lC="object"==typeof p&&p&&p.Object===Object&&p,hC="object"==typeof self&&self&&self.Object===Object&&self,uC=lC||hC||Function("return this")();function cC(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var i=e.length,s=r+(n?1:-1);for(;n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,pC,r);var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,0)>-1}function fC(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)if(r(t,e[n]))return!0;return!1}function dC(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function pC(e){return e!=e}function mC(e,t){return e.has(t)}var gC=Array.prototype,yC=Function.prototype,vC=Object.prototype,_C=uC["__core-js_shared__"],bC=function(){var e=/[^.]+$/.exec(_C&&_C.keys&&_C.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),wC=yC.toString,xC=vC.hasOwnProperty,kC=vC.toString,SC=RegExp("^"+wC.call(xC).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),EC=uC.Symbol,TC=vC.propertyIsEnumerable,CC=gC.splice,OC=EC?EC.isConcatSpreadable:void 0,RC=Math.max,AC=$C(uC,"Map"),NC=$C(Object,"create");function IC(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function PC(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function FC(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function DC(e){var t=-1,r=e?e.length:0;for(this.__data__=new FC;++t<r;)this.add(e[t])}function jC(e,t){for(var r,n,i=e.length;i--;)if((r=e[i][0])===(n=t)||r!=r&&n!=n)return i;return-1}function MC(e,t,r,n){var i,s=-1,o=cC,a=!0,l=e.length,h=[],u=t.length;if(!l)return h;r&&(t=function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(t,(i=r,function(e){return i(e)}))),n?(o=fC,a=!1):t.length>=200&&(o=mC,a=!1,t=new DC(t));e:for(;++s<l;){var c=e[s],f=r?r(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var d=u;d--;)if(t[d]===f)continue e;h.push(c)}else o(t,f,n)||h.push(c)}return h}function LC(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=HC),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?LC(a,t-1,r,n,i):dC(i,a):n||(i[i.length]=a)}return i}function BC(e){if(!YC(e)||(t=e,bC&&bC in t))return!1;var t,r=GC(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?SC:aC;return r.test(function(e){if(null!=e){try{return wC.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function zC(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function $C(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return BC(r)?r:void 0}function HC(e){return qC(e)||function(e){return ZC(e)&&xC.call(e,"callee")&&(!TC.call(e,"callee")||kC.call(e)==iC)}(e)||!!(OC&&e&&e[OC])}IC.prototype.clear=function(){this.__data__=NC?NC(null):{}},IC.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},IC.prototype.get=function(e){var t=this.__data__;if(NC){var r=t[e];return r===rC?void 0:r}return xC.call(t,e)?t[e]:void 0},IC.prototype.has=function(e){var t=this.__data__;return NC?void 0!==t[e]:xC.call(t,e)},IC.prototype.set=function(e,t){return this.__data__[e]=NC&&void 0===t?rC:t,this},PC.prototype.clear=function(){this.__data__=[]},PC.prototype.delete=function(e){var t=this.__data__,r=jC(t,e);return!(r<0)&&(r==t.length-1?t.pop():CC.call(t,r,1),!0)},PC.prototype.get=function(e){var t=this.__data__,r=jC(t,e);return r<0?void 0:t[r][1]},PC.prototype.has=function(e){return jC(this.__data__,e)>-1},PC.prototype.set=function(e,t){var r=this.__data__,n=jC(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},FC.prototype.clear=function(){this.__data__={hash:new IC,map:new(AC||PC),string:new IC}},FC.prototype.delete=function(e){return zC(this,e).delete(e)},FC.prototype.get=function(e){return zC(this,e).get(e)},FC.prototype.has=function(e){return zC(this,e).has(e)},FC.prototype.set=function(e,t){return zC(this,e).set(e,t),this},DC.prototype.add=DC.prototype.push=function(e){return this.__data__.set(e,rC),this},DC.prototype.has=function(e){return this.__data__.has(e)};var UC,VC,WC=(UC=function(e,t){return ZC(e)?MC(e,LC(t,1,ZC,!0)):[]},VC=RC(void 0===VC?UC.length-1:VC,0),function(){for(var e=arguments,t=-1,r=RC(e.length-VC,0),n=Array(r);++t<r;)n[t]=e[VC+t];t=-1;for(var i=Array(VC+1);++t<VC;)i[t]=e[t];return i[VC]=n,function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(UC,this,i)});var qC=Array.isArray;function XC(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=nC}(e.length)&&!GC(e)}function ZC(e){return function(e){return!!e&&"object"==typeof e}(e)&&XC(e)}function GC(e){var t=YC(e)?kC.call(e):"";return t==sC||t==oC}function YC(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var KC=WC,QC="__lodash_hash_undefined__",JC=9007199254740991,eO="[object Arguments]",tO="[object Function]",rO="[object GeneratorFunction]",nO=/^\[object .+?Constructor\]$/,iO="object"==typeof p&&p&&p.Object===Object&&p,sO="object"==typeof self&&self&&self.Object===Object&&self,oO=iO||sO||Function("return this")();function aO(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var i=e.length,s=r+(n?1:-1);for(;n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,uO,r);var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,0)>-1}function lO(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)if(r(t,e[n]))return!0;return!1}function hO(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function uO(e){return e!=e}function cO(e,t){return e.has(t)}function fO(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var dO=Array.prototype,pO=Function.prototype,mO=Object.prototype,gO=oO["__core-js_shared__"],yO=function(){var e=/[^.]+$/.exec(gO&&gO.keys&&gO.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),vO=pO.toString,_O=mO.hasOwnProperty,bO=mO.toString,wO=RegExp("^"+vO.call(_O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xO=oO.Symbol,kO=mO.propertyIsEnumerable,SO=dO.splice,EO=xO?xO.isConcatSpreadable:void 0,TO=Math.max,CO=BO(oO,"Map"),OO=BO(oO,"Set"),RO=BO(Object,"create");function AO(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function NO(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function IO(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function PO(e){var t=-1,r=e?e.length:0;for(this.__data__=new IO;++t<r;)this.add(e[t])}function FO(e,t){for(var r,n,i=e.length;i--;)if((r=e[i][0])===(n=t)||r!=r&&n!=n)return i;return-1}function DO(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=zO),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?DO(a,t-1,r,n,i):hO(i,a):n||(i[i.length]=a)}return i}function jO(e){if(!qO(e)||function(e){return!!yO&&yO in e}(e))return!1;var t=WO(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?wO:nO;return t.test(function(e){if(null!=e){try{return vO.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}AO.prototype.clear=function(){this.__data__=RO?RO(null):{}},AO.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},AO.prototype.get=function(e){var t=this.__data__;if(RO){var r=t[e];return r===QC?void 0:r}return _O.call(t,e)?t[e]:void 0},AO.prototype.has=function(e){var t=this.__data__;return RO?void 0!==t[e]:_O.call(t,e)},AO.prototype.set=function(e,t){return this.__data__[e]=RO&&void 0===t?QC:t,this},NO.prototype.clear=function(){this.__data__=[]},NO.prototype.delete=function(e){var t=this.__data__,r=FO(t,e);return!(r<0)&&(r==t.length-1?t.pop():SO.call(t,r,1),!0)},NO.prototype.get=function(e){var t=this.__data__,r=FO(t,e);return r<0?void 0:t[r][1]},NO.prototype.has=function(e){return FO(this.__data__,e)>-1},NO.prototype.set=function(e,t){var r=this.__data__,n=FO(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},IO.prototype.clear=function(){this.__data__={hash:new AO,map:new(CO||NO),string:new AO}},IO.prototype.delete=function(e){return LO(this,e).delete(e)},IO.prototype.get=function(e){return LO(this,e).get(e)},IO.prototype.has=function(e){return LO(this,e).has(e)},IO.prototype.set=function(e,t){return LO(this,e).set(e,t),this},PO.prototype.add=PO.prototype.push=function(e){return this.__data__.set(e,QC),this},PO.prototype.has=function(e){return this.__data__.has(e)};var MO=OO&&1/fO(new OO([,-0]))[1]==1/0?function(e){return new OO(e)}:function(){};function LO(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function BO(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return jO(r)?r:void 0}function zO(e){return HO(e)||function(e){return VO(e)&&_O.call(e,"callee")&&(!kO.call(e,"callee")||bO.call(e)==eO)}(e)||!!(EO&&e&&e[EO])}var $O=function(e,t){return t=TO(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=TO(r.length-t,0),s=Array(i);++n<i;)s[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];return o[t]=s,function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,o)}}((function(e){return function(e,t,r){var n=-1,i=aO,s=e.length,o=!0,a=[],l=a;if(r)o=!1,i=lO;else if(s>=200){var h=t?null:MO(e);if(h)return fO(h);o=!1,i=cO,l=new PO}else l=t?[]:a;e:for(;++n<s;){var u=e[n],c=t?t(u):u;if(u=r||0!==u?u:0,o&&c==c){for(var f=l.length;f--;)if(l[f]===c)continue e;t&&l.push(c),a.push(u)}else i(l,c,r)||(l!==a&&l.push(c),a.push(u))}return a}(DO(e,1,VO,!0))}));var HO=Array.isArray;function UO(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=JC}(e.length)&&!WO(e)}function VO(e){return function(e){return!!e&&"object"==typeof e}(e)&&UO(e)}function WO(e){var t=qO(e)?bO.call(e):"";return t==tO||t==rO}function qO(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var XO=$O;var ZO=Function.prototype,GO=Object.prototype,YO=ZO.toString,KO=GO.hasOwnProperty,QO=YO.call(Object),JO=GO.toString,eR=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var tR,rR,nR,iR,sR,oR,aR,lR,hR,uR=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=JO.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=eR(e);if(null===t)return!0;var r=KO.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&YO.call(r)==QO},cR={};function fR(){if(tR)return cR;tR=1;var e=l,t="win32"===process.platform,n=r,i=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function s(e){return"function"==typeof e?e:function(){var e;if(i){var t=new Error;e=function(e){e&&(t.message=e.message,r(e=t))}}else e=r;return e;function r(e){if(e){if(process.throwDeprecation)throw e;process.noDeprecation||(e.stack||e.message,process.traceDeprecation)}}}()}if(e.normalize,t)var o=/(.*?)(?:[\/\\]+|$)/g;else o=/(.*?)(?:[\/]+|$)/g;if(t)var a=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else a=/^[\/]*/;return cR.realpathSync=function(r,i){if(r=e.resolve(r),i&&Object.prototype.hasOwnProperty.call(i,r))return i[r];var s,l,h,u,c=r,f={},d={};function p(){var e=a.exec(r);s=e[0].length,l=e[0],h=e[0],u="",t&&!d[h]&&(n.lstatSync(h),d[h]=!0)}for(p();s<r.length;){o.lastIndex=s;var m=o.exec(r);if(u=l,l+=m[0],h=u+m[1],s=o.lastIndex,!(d[h]||i&&i[h]===h)){var g;if(i&&Object.prototype.hasOwnProperty.call(i,h))g=i[h];else{var y=n.lstatSync(h);if(!y.isSymbolicLink()){d[h]=!0,i&&(i[h]=h);continue}var v=null;if(!t){var _=y.dev.toString(32)+":"+y.ino.toString(32);f.hasOwnProperty(_)&&(v=f[_])}null===v&&(n.statSync(h),v=n.readlinkSync(h)),g=e.resolve(u,v),i&&(i[h]=g),t||(f[_]=v)}r=e.resolve(g,r.slice(s)),p()}}return i&&(i[c]=r),r},cR.realpath=function(r,i,l){if("function"!=typeof l&&(l=s(i),i=null),r=e.resolve(r),i&&Object.prototype.hasOwnProperty.call(i,r))return process.nextTick(l.bind(null,null,i[r]));var h,u,c,f,d=r,p={},m={};function g(){var e=a.exec(r);h=e[0].length,u=e[0],c=e[0],f="",t&&!m[c]?n.lstat(c,(function(e){if(e)return l(e);m[c]=!0,y()})):process.nextTick(y)}function y(){if(h>=r.length)return i&&(i[d]=r),l(null,r);o.lastIndex=h;var e=o.exec(r);return f=u,u+=e[0],c=f+e[1],h=o.lastIndex,m[c]||i&&i[c]===c?process.nextTick(y):i&&Object.prototype.hasOwnProperty.call(i,c)?b(i[c]):n.lstat(c,v)}function v(e,r){if(e)return l(e);if(!r.isSymbolicLink())return m[c]=!0,i&&(i[c]=c),process.nextTick(y);if(!t){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(p.hasOwnProperty(s))return _(null,p[s],c)}n.stat(c,(function(e){if(e)return l(e);n.readlink(c,(function(e,r){t||(p[s]=r),_(e,r)}))}))}function _(t,r,n){if(t)return l(t);var s=e.resolve(f,r);i&&(i[n]=s),b(s)}function b(t){r=e.resolve(t,r.slice(h)),g()}g()},cR}function dR(){if(nR)return rR;nR=1,rR=l,l.realpath=l,l.sync=h,l.realpathSync=h,l.monkeypatch=function(){e.realpath=l,e.realpathSync=h},l.unmonkeypatch=function(){e.realpath=t,e.realpathSync=n};var e=r,t=e.realpath,n=e.realpathSync,i=process.version,s=/^v[0-5]\./.test(i),o=fR();function a(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,r,n){if(s)return t(e,r,n);"function"==typeof r&&(n=r,r=null),t(e,r,(function(t,i){a(t)?o.realpath(e,r,n):n(t,i)}))}function h(e,t){if(s)return n(e,t);try{return n(e,t)}catch(r){if(a(r))return o.realpathSync(e,t);throw r}}return rR}function pR(){if(sR)return iR;sR=1,iR=function(t,r){for(var n=[],i=0;i<t.length;i++){var s=r(t[i],i);e(s)?n.push.apply(n,s):n.push(s)}return n};var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return iR}function mR(){if(aR)return oR;aR=1;var e=pR(),t=Sx;oR=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return p(function(e){return e.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(i).split("\\,").join(s).split("\\.").join(o)}(e),!0).map(l)};var r="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",o="\0PERIOD"+Math.random()+"\0";function a(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(r).join("\\").split(n).join("{").split(i).join("}").split(s).join(",").split(o).join(".")}function h(e){if(!e)return[""];var r=[],n=t("{","}",e);if(!n)return e.split(",");var i=n.pre,s=n.body,o=n.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var l=h(o);return o.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),r.push.apply(r,a),r}function u(e){return"{"+e+"}"}function c(e){return/^-?0\d/.test(e)}function f(e,t){return e<=t}function d(e,t){return e>=t}function p(r,n){var s=[],o=t("{","}",r);if(!o||/\$$/.test(o.pre))return[r];var l,m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),y=m||g,v=o.body.indexOf(",")>=0;if(!y&&!v)return o.post.match(/,.*\}/)?p(r=o.pre+"{"+o.body+i+o.post):[r];if(y)l=o.body.split(/\.\./);else if(1===(l=h(o.body)).length&&1===(l=p(l[0],!1).map(u)).length)return(w=o.post.length?p(o.post,!1):[""]).map((function(e){return o.pre+l[0]+e}));var _,b=o.pre,w=o.post.length?p(o.post,!1):[""];if(y){var x=a(l[0]),k=a(l[1]),S=Math.max(l[0].length,l[1].length),E=3==l.length?Math.abs(a(l[2])):1,T=f;k<x&&(E*=-1,T=d);var C=l.some(c);_=[];for(var O=x;T(O,k);O+=E){var R;if(g)"\\"===(R=String.fromCharCode(O))&&(R="");else if(R=String(O),C){var A=S-R.length;if(A>0){var N=new Array(A+1).join("0");R=O<0?"-"+N+R.slice(1):N+R}}_.push(R)}}else _=e(l,(function(e){return p(e,!1)}));for(var I=0;I<_.length;I++)for(var P=0;P<w.length;P++){var F=b+_[I]+w[P];(!n||y||F)&&s.push(F)}return s}return oR}function gR(){if(hR)return lR;hR=1,lR=h,h.Minimatch=u;var e=function(){try{return require("path")}catch(e){}}()||{sep:"/"};h.sep=e.sep;var t=h.GLOBSTAR=u.GLOBSTAR={},r=mR(),n={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},i="[^/]",s=i+"*?",o="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{});var a=/\/+/;function l(e,t){t=t||{};var r={};return Object.keys(e).forEach((function(t){r[t]=e[t]})),Object.keys(t).forEach((function(e){r[e]=t[e]})),r}function h(e,t,r){return f(t),r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&new u(t,r).match(e)}function u(t,r){if(!(this instanceof u))return new u(t,r);f(t),r||(r={}),t=t.trim(),r.allowWindowsEscape||"/"===e.sep||(t=t.split(e.sep).join("/")),this.options=r,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.make()}function c(e,t){return t||(t=this instanceof u?this.options:{}),e=void 0===e?this.pattern:e,f(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:r(e)}h.filter=function(e,t){return t=t||{},function(r,n,i){return h(r,e,t)}},h.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return h;var t=h,r=function(r,n,i){return t(r,n,l(e,i))};return(r.Minimatch=function(r,n){return new t.Minimatch(r,l(e,n))}).defaults=function(r){return t.defaults(l(e,r)).Minimatch},r.filter=function(r,n){return t.filter(r,l(e,n))},r.defaults=function(r){return t.defaults(l(e,r))},r.makeRe=function(r,n){return t.makeRe(r,l(e,n))},r.braceExpand=function(r,n){return t.braceExpand(r,l(e,n))},r.match=function(r,n,i){return t.match(r,n,l(e,i))},r},u.defaults=function(e){return h.defaults(e).Minimatch},u.prototype.debug=function(){},u.prototype.make=function(){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)});this.debug(this.pattern,r),r=this.globParts=r.map((function(e){return e.split(a)})),this.debug(this.pattern,r),r=r.map((function(e,t,r){return e.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,r),this.set=r},u.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,n=0;if(r.nonegate)return;for(var i=0,s=e.length;i<s&&"!"===e.charAt(i);i++)t=!t,n++;n&&(this.pattern=e.substr(n));this.negate=t},h.braceExpand=function(e,t){return c(e,t)},u.prototype.braceExpand=c;var f=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};u.prototype.parse=function(e,r){f(e);var a=this.options;if("**"===e){if(!a.noglobstar)return t;e="*"}if(""===e)return"";var l,h="",u=!!a.nocase,c=!1,p=[],m=[],g=!1,y=-1,v=-1,_="."===e.charAt(0)?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(l){switch(l){case"*":h+=s,u=!0;break;case"?":h+=i,u=!0;break;default:h+="\\"+l}b.debug("clearStateChar %j %j",l,h),l=!1}}for(var x,k=0,S=e.length;k<S&&(x=e.charAt(k));k++)if(this.debug("%s\t%s %s %j",e,k,h,x),c&&o[x])h+="\\"+x,c=!1;else switch(x){case"/":return!1;case"\\":w(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,k,h,x),g){this.debug(" in class"),"!"===x&&k===v+1&&(x="^"),h+=x;continue}b.debug("call clearStateChar %j",l),w(),l=x,a.noext&&w();continue;case"(":if(g){h+="(";continue}if(!l){h+="\\(";continue}p.push({type:l,start:k-1,reStart:h.length,open:n[l].open,close:n[l].close}),h+="!"===l?"(?:(?!(?:":"(?:",this.debug("plType %j %j",l,h),l=!1;continue;case")":if(g||!p.length){h+="\\)";continue}w(),u=!0;var E=p.pop();h+=E.close,"!"===E.type&&m.push(E),E.reEnd=h.length;continue;case"|":if(g||!p.length||c){h+="\\|",c=!1;continue}w(),h+="|";continue;case"[":if(w(),g){h+="\\"+x;continue}g=!0,v=k,y=h.length,h+=x;continue;case"]":if(k===v+1||!g){h+="\\"+x,c=!1;continue}var T=e.substring(v+1,k);try{RegExp("["+T+"]")}catch(e){var C=this.parse(T,d);h=h.substr(0,y)+"\\["+C[0]+"\\]",u=u||C[1],g=!1;continue}u=!0,g=!1,h+=x;continue;default:w(),c?c=!1:!o[x]||"^"===x&&g||(h+="\\"),h+=x}g&&(T=e.substr(v+1),C=this.parse(T,d),h=h.substr(0,y)+"\\["+C[0],u=u||C[1]);for(E=p.pop();E;E=p.pop()){var O=h.slice(E.reStart+E.open.length);this.debug("setting tail",h,E),O=O.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,r){return r||(r="\\"),t+t+r+"|"})),this.debug("tail=%j\n %s",O,O,E,h);var R="*"===E.type?s:"?"===E.type?i:"\\"+E.type;u=!0,h=h.slice(0,E.reStart)+R+"\\("+O}w(),c&&(h+="\\\\");var A=!1;switch(h.charAt(0)){case"[":case".":case"(":A=!0}for(var N=m.length-1;N>-1;N--){var I=m[N],P=h.slice(0,I.reStart),F=h.slice(I.reStart,I.reEnd-8),D=h.slice(I.reEnd-8,I.reEnd),j=h.slice(I.reEnd);D+=j;var M=P.split("(").length-1,L=j;for(k=0;k<M;k++)L=L.replace(/\)[+*?]?/,"");var B="";""===(j=L)&&r!==d&&(B="$"),h=P+F+j+B+D}""!==h&&u&&(h="(?=.)"+h);A&&(h=_+h);if(r===d)return[h,u];if(!u)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var z=a.nocase?"i":"";try{var $=new RegExp("^"+h+"$",z)}catch(e){return new RegExp("$.")}return $._glob=e,$._src=h,$};var d={};return h.makeRe=function(e,t){return new u(e,t||{}).makeRe()},u.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?s:r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=r.nocase?"i":"",o=e.map((function(e){return e.map((function(e){return e===t?n:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src})).join("\\/")})).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,i)}catch(e){this.regexp=!1}return this.regexp},h.match=function(e,t,r){var n=new u(t,r=r||{});return e=e.filter((function(e){return n.match(e)})),n.options.nonull&&!e.length&&e.push(t),e},u.prototype.match=function(t,r){if(void 0===r&&(r=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&r)return!0;var n=this.options;"/"!==e.sep&&(t=t.split(e.sep).join("/")),t=t.split(a),this.debug(this.pattern,"split",t);var i,s,o=this.set;for(this.debug(this.pattern,"set",o),s=t.length-1;s>=0&&!(i=t[s]);s--);for(s=0;s<o.length;s++){var l=o[s],h=t;if(n.matchBase&&1===l.length&&(h=[i]),this.matchOne(h,l,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},u.prototype.matchOne=function(e,r,n){var i=this.options;this.debug("matchOne",{this:this,file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var s=0,o=0,a=e.length,l=r.length;s<a&&o<l;s++,o++){this.debug("matchOne loop");var h,u=r[o],c=e[s];if(this.debug(r,u,c),!1===u)return!1;if(u===t){this.debug("GLOBSTAR",[r,u,c]);var f=s,d=o+1;if(d===l){for(this.debug("** at the end");s<a;s++)if("."===e[s]||".."===e[s]||!i.dot&&"."===e[s].charAt(0))return!1;return!0}for(;f<a;){var p=e[f];if(this.debug("\nglobstar while",e,f,r,d,p),this.matchOne(e.slice(f),r.slice(d),n))return this.debug("globstar found match!",f,a,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",e,f,r,d);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",e,f,r,d),f!==a))}if("string"==typeof u?(h=c===u,this.debug("string match",u,c,h)):(h=c.match(u),this.debug("pattern match",u,c,h)),!h)return!1}if(s===a&&o===l)return!0;if(s===a)return n;if(o===l)return s===a-1&&""===e[s];throw new Error("wtf?")},lR}var yR,vR={exports:{}};function _R(){if(yR)return vR.exports;function e(e){return"/"===e.charAt(0)}function t(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),r=t[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(t[2]||n)}return yR=1,vR.exports="win32"===process.platform?t:e,vR.exports.posix=e,vR.exports.win32=t,vR.exports}var bR,wR,xR,kR,SR,ER={};function TR(){if(bR)return ER;function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}bR=1,ER.setopts=function(r,i,a){a||(a={});if(a.matchBase&&-1===i.indexOf("/")){if(a.noglobstar)throw new Error("base matching requires globstar");i="**/"+i}r.silent=!!a.silent,r.pattern=i,r.strict=!1!==a.strict,r.realpath=!!a.realpath,r.realpathCache=a.realpathCache||Object.create(null),r.follow=!!a.follow,r.dot=!!a.dot,r.mark=!!a.mark,r.nodir=!!a.nodir,r.nodir&&(r.mark=!0);r.sync=!!a.sync,r.nounique=!!a.nounique,r.nonull=!!a.nonull,r.nosort=!!a.nosort,r.nocase=!!a.nocase,r.stat=!!a.stat,r.noprocess=!!a.noprocess,r.absolute=!!a.absolute,r.fs=a.fs||t,r.maxLength=a.maxLength||1/0,r.cache=a.cache||Object.create(null),r.statCache=a.statCache||Object.create(null),r.symlinks=a.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(h))}(r,a),r.changedCwd=!1;var l=process.cwd();e(a,"cwd")?(r.cwd=n.resolve(a.cwd),r.changedCwd=r.cwd!==l):r.cwd=l;r.root=a.root||n.resolve(r.cwd,"/"),r.root=n.resolve(r.root),"win32"===process.platform&&(r.root=r.root.replace(/\\/g,"/"));r.cwdAbs=s(r.cwd)?r.cwd:u(r,r.cwd),"win32"===process.platform&&(r.cwdAbs=r.cwdAbs.replace(/\\/g,"/"));r.nomount=!!a.nomount,a.nonegate=!0,a.nocomment=!0,a.allowWindowsEscape=!1,r.minimatch=new o(i,a),r.options=r.minimatch.options},ER.ownProp=e,ER.makeAbs=u,ER.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(s&&0!==Object.keys(s).length){var o=Object.keys(s);t?r.push.apply(r,o):o.forEach((function(e){r[e]=!0}))}else if(e.nonull){var l=e.minimatch.globSet[n];t?r.push(l):r[l]=!0}}t||(r=Object.keys(r));e.nosort||(r=r.sort(a));if(e.mark){for(n=0;n<r.length;n++)r[n]=e._mark(r[n]);e.nodir&&(r=r.filter((function(t){var r=!/\/$/.test(t),n=e.cache[t]||e.cache[u(e,t)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r})))}e.ignore.length&&(r=r.filter((function(t){return!c(e,t)})));e.found=r},ER.mark=function(e,t){var r=u(e,t),n=e.cache[r],i=t;if(n){var s="DIR"===n||Array.isArray(n),o="/"===t.slice(-1);if(s&&!o?i+="/":!s&&o&&(i=i.slice(0,-1)),i!==t){var a=u(e,i);e.statCache[a]=e.statCache[r],e.cache[a]=e.cache[r]}}return i},ER.isIgnored=c,ER.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var t=r,n=l,i=gR(),s=_R(),o=i.Minimatch;function a(e,t){return e.localeCompare(t,"en")}function h(e){var t=null;if("/**"===e.slice(-3)){var r=e.replace(/(\/\*\*)+$/,"");t=new o(r,{dot:!0})}return{matcher:new o(e,{dot:!0}),gmatcher:t}}function u(e,t){var r=t;return r="/"===t.charAt(0)?n.join(e.root,t):s(t)||""===t?t:e.changedCwd?n.resolve(e.cwd,t):n.resolve(t),"win32"===process.platform&&(r=r.replace(/\\/g,"/")),r}function c(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}return ER}function CR(){if(SR)return kR;return SR=1,kR=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}},kR}var OR,RR,AR,NR,IR,PR={exports:{}};function FR(){if(OR)return PR.exports;OR=1;var e=CR();function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}return PR.exports=e(t),PR.exports.strict=e(r),t.proto=t((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})})),PR.exports}function DR(){if(AR)return RR;AR=1;var e=CR(),t=Object.create(null),r=FR();return RR=e((function(e,n){return t[e]?(t[e].push(n),null):(t[e]=[n],function(e){return r((function r(){var n=t[e],i=n.length,s=function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}(arguments);try{for(var o=0;o<i;o++)n[o].apply(null,s)}finally{n.length>i?(n.splice(0,i),process.nextTick((function(){r.apply(null,s)}))):delete t[e]}}))}(e))})),RR}function jR(){if(IR)return NR;IR=1,NR=v;var e=dR(),t=gR();t.Minimatch;var r=rt(),n=i.EventEmitter,s=l,o=u,a=_R(),h=function(){if(xR)return wR;xR=1,wR=u,u.GlobSync=c;var e=dR(),t=gR();t.Minimatch,jR().Glob;var r=l,n=_R(),i=TR(),s=i.setopts,o=i.ownProp,a=i.childrenIgnored,h=i.isIgnored;function u(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new c(e,t).found}function c(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof c))return new c(e,t);if(s(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}return c.prototype._finish=function(){if(this.realpath){var t=this;this.matches.forEach((function(r,n){var i=t.matches[n]=Object.create(null);for(var s in r)try{s=t._makeAbs(s),i[e.realpathSync(s,t.realpathCache)]=!0}catch(e){if("stat"!==e.syscall)throw e;i[t._makeAbs(s)]=!0}}))}i.finish(this)},c.prototype._process=function(e,r,i){for(var s,o=0;"string"==typeof e[o];)o++;switch(o){case e.length:return void this._processSimple(e.join("/"),r);case 0:s=null;break;default:s=e.slice(0,o).join("/")}var l,h=e.slice(o);null===s?l=".":n(s)||n(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(s&&n(s)||(s="/"+s),l=s):l=s;var u=this._makeAbs(l);a(this,l)||(h[0]===t.GLOBSTAR?this._processGlobStar(s,l,u,h,r,i):this._processReaddir(s,l,u,h,r,i))},c.prototype._processReaddir=function(e,t,n,i,s,o){var a=this._readdir(n,o);if(a){for(var l=i[0],h=!!this.minimatch.negate,u=l._glob,c=this.dot||"."===u.charAt(0),f=[],d=0;d<a.length;d++)("."!==(g=a[d]).charAt(0)||c)&&(h&&!e?!g.match(l):g.match(l))&&f.push(g);var p=f.length;if(0!==p)if(1!==i.length||this.mark||this.stat)for(i.shift(),d=0;d<p;d++){var m;g=f[d],m=e?[e,g]:[g],this._process(m.concat(i),s,o)}else{this.matches[s]||(this.matches[s]=Object.create(null));for(d=0;d<p;d++){var g=f[d];e&&(g="/"!==e.slice(-1)?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=r.join(this.root,g)),this._emitMatch(s,g)}}}},c.prototype._emitMatch=function(e,t){if(!h(this,t)){var r=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},c.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,r;try{r=this.fs.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var n=r&&r.isSymbolicLink();return this.symlinks[e]=n,n||!r||r.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},c.prototype._readdir=function(e,t){if(t&&!o(this.symlinks,e))return this._readdirInGlobStar(e);if(o(this.cache,e)){var r=this.cache[e];if(!r||"FILE"===r)return null;if(Array.isArray(r))return r}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},c.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];n="/"===e?e+n:e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t},c.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent}},c.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(o){var a=n.slice(1),l=e?[e]:[],h=l.concat(a);this._process(h,i,!1);var u=o.length;if(!this.symlinks[r]||!s)for(var c=0;c<u;c++)if("."!==o[c].charAt(0)||this.dot){var f=l.concat(o[c],a);this._process(f,i,!0);var d=l.concat(o[c],n);this._process(d,i,!0)}}},c.prototype._processSimple=function(e,t){var i=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),i){if(e&&n(e)&&!this.nomount){var s=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=r.join(this.root,e):(e=r.resolve(this.root,e),s&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},c.prototype._stat=function(e){var t=this._makeAbs(e),r="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&o(this.cache,t)){var n=this.cache[t];if(Array.isArray(n)&&(n="DIR"),!r||"DIR"===n)return n;if(r&&"FILE"===n)return!1}var i=this.statCache[t];if(!i){var s;try{s=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(s&&s.isSymbolicLink())try{i=this.fs.statSync(t)}catch(e){i=s}else i=s}return this.statCache[t]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||n,(!r||"FILE"!==n)&&n},c.prototype._mark=function(e){return i.mark(this,e)},c.prototype._makeAbs=function(e){return i.makeAbs(this,e)},wR}(),c=TR(),f=c.setopts,d=c.ownProp,p=DR(),m=c.childrenIgnored,g=c.isIgnored,y=FR();function v(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return h(e,t)}return new b(e,t,r)}v.sync=h;var _=v.GlobSync=h.GlobSync;function b(e,t,r){if("function"==typeof t&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new _(e,t)}if(!(this instanceof b))return new b(e,t,r);f(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=y(r),this.on("error",r),this.on("end",(function(e){r(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var s=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--i._processing,i._processing<=0&&(s?process.nextTick((function(){i._finish()})):i._finish())}s=!1}return v.glob=v,v.hasMagic=function(e,t){var r=function(e,t){if(null===t||"object"!=typeof t)return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}({},t);r.noprocess=!0;var n=new b(e,r).minimatch.set;if(!e)return!1;if(n.length>1)return!0;for(var i=0;i<n[0].length;i++)if("string"!=typeof n[0][i])return!0;return!1},v.Glob=b,r(b,n),b.prototype._finish=function(){if(o(this instanceof b),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();c.finish(this),this.emit("end",this.found)}},b.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n)}function n(){0==--e&&t._finish()}},b.prototype._realpathSet=function(t,r){var n=this.matches[t];if(!n)return r();var i=Object.keys(n),s=this,o=i.length;if(0===o)return r();var a=this.matches[t]=Object.create(null);i.forEach((function(n,i){n=s._makeAbs(n),e.realpath(n,s.realpathCache,(function(e,i){e?"stat"===e.syscall?a[n]=!0:s.emit("error",e):a[i]=!0,0==--o&&(s.matches[t]=a,r())}))}))},b.prototype._mark=function(e){return c.mark(this,e)},b.prototype._makeAbs=function(e){return c.makeAbs(this,e)},b.prototype.abort=function(){this.aborted=!0,this.emit("abort")},b.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},b.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},b.prototype._process=function(e,r,n,i){if(o(this instanceof b),o("function"==typeof i),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,r,n,i]);else{for(var s,l=0;"string"==typeof e[l];)l++;switch(l){case e.length:return void this._processSimple(e.join("/"),r,i);case 0:s=null;break;default:s=e.slice(0,l).join("/")}var h,u=e.slice(l);null===s?h=".":a(s)||a(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(s&&a(s)||(s="/"+s),h=s):h=s;var c=this._makeAbs(h);if(m(this,h))return i();u[0]===t.GLOBSTAR?this._processGlobStar(s,h,c,u,r,n,i):this._processReaddir(s,h,c,u,r,n,i)}},b.prototype._processReaddir=function(e,t,r,n,i,s,o){var a=this;this._readdir(r,s,(function(l,h){return a._processReaddir2(e,t,r,n,i,s,h,o)}))},b.prototype._processReaddir2=function(e,t,r,n,i,o,a,l){if(!a)return l();for(var h=n[0],u=!!this.minimatch.negate,c=h._glob,f=this.dot||"."===c.charAt(0),d=[],p=0;p<a.length;p++){if("."!==(g=a[p]).charAt(0)||f)(u&&!e?!g.match(h):g.match(h))&&d.push(g)}var m=d.length;if(0===m)return l();if(1===n.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(p=0;p<m;p++){var g=d[p];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=s.join(this.root,g)),this._emitMatch(i,g)}return l()}n.shift();for(p=0;p<m;p++){g=d[p];e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(n),i,o,l)}l()},b.prototype._emitMatch=function(e,t){if(!this.aborted&&!g(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var r=a(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}}},b.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var r=this,n=p("lstat\0"+e,(function(n,i){if(n&&"ENOENT"===n.code)return t();var s=i&&i.isSymbolicLink();r.symlinks[e]=s,s||!i||i.isDirectory()?r._readdir(e,!1,t):(r.cache[e]="FILE",t())}));n&&r.fs.lstat(e,n)}},b.prototype._readdir=function(e,t,r){if(!this.aborted&&(r=p("readdir\0"+e+"\0"+t,r))){if(t&&!d(this.symlinks,e))return this._readdirInGlobStar(e,r);if(d(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return r();if(Array.isArray(n))return r(null,n)}this.fs.readdir(e,function(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}(this,e,r))}},b.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}},b.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent}return r()}},b.prototype._processGlobStar=function(e,t,r,n,i,s,o){var a=this;this._readdir(r,s,(function(l,h){a._processGlobStar2(e,t,r,n,i,s,h,o)}))},b.prototype._processGlobStar2=function(e,t,r,n,i,s,o,a){if(!o)return a();var l=n.slice(1),h=e?[e]:[],u=h.concat(l);this._process(u,i,!1,a);var c=this.symlinks[r],f=o.length;if(c&&s)return a();for(var d=0;d<f;d++){if("."!==o[d].charAt(0)||this.dot){var p=h.concat(o[d],l);this._process(p,i,!0,a);var m=h.concat(o[d],n);this._process(m,i,!0,a)}}a()},b.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,(function(i,s){n._processSimple2(e,t,i,s,r)}))},b.prototype._processSimple2=function(e,t,r,n,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return i();if(e&&a(e)&&!this.nomount){var o=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=s.join(this.root,e):(e=s.resolve(this.root,e),o&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()},b.prototype._stat=function(e,t){var r=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&d(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return t(null,i);if(n&&"FILE"===i)return t()}var s=this.statCache[r];if(void 0!==s){if(!1===s)return t(null,s);var o=s.isDirectory()?"DIR":"FILE";return n&&"FILE"===o?t():t(null,o,s)}var a=this,l=p("stat\0"+r,(function(n,i){if(i&&i.isSymbolicLink())return a.fs.stat(r,(function(n,s){n?a._stat2(e,r,null,i,t):a._stat2(e,r,n,s,t)}));a._stat2(e,r,n,i,t)}));l&&a.fs.lstat(r,l)},b.prototype._stat2=function(e,t,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[t]=!1,i();var s="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,s&&"FILE"===o?i():i(null,o,n)},NR}var MR=eT,LR=l,BR=tC,zR=KC,$R=XO,HR=uR,UR=jR(),VR=MT.exports={},WR=/[\/\\]/g;VR.exists=function(){var e=LR.join.apply(LR,arguments);return MR.existsSync(e)},VR.expand=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=HR(t[0])?t.shift():{},i=Array.isArray(t[0])?t[0]:t;if(0===i.length)return[];var s=function(e,t){var r=[];return BR(e).forEach((function(e){var n=0===e.indexOf("!");n&&(e=e.slice(1));var i=t(e);r=n?zR(r,i):$R(r,i)})),r}(i,(function(e){return UR.sync(e,n)}));return n.filter&&(s=s.filter((function(e){e=LR.join(n.cwd||"",e);try{return"function"==typeof n.filter?n.filter(e):MR.statSync(e)[n.filter]()}catch(e){return!1}}))),s},VR.expandMapping=function(e,t,r){r=Object.assign({rename:function(e,t){return LR.join(e||"",t)}},r);var n=[],i={};return VR.expand(r,e).forEach((function(e){var s=e;r.flatten&&(s=LR.basename(s)),r.ext&&(s=s.replace(/(\.[^\/]*)?$/,r.ext));var o=r.rename(t,s,r);r.cwd&&(e=LR.join(r.cwd,e)),o=o.replace(WR,"/"),e=e.replace(WR,"/"),i[o]?i[o].src.push(e):(n.push({src:[e],dest:o}),i[o]=n[n.length-1])})),n},VR.normalizeFilesArray=function(e){var t=[];return e.forEach((function(e){("src"in e||"dest"in e)&&t.push(e)})),0===t.length?[]:(t=_(t).chain().forEach((function(e){"src"in e&&e.src&&(Array.isArray(e.src)?e.src=BR(e.src):e.src=[e.src])})).map((function(e){var t=Object.assign({},e);if(delete t.src,delete t.dest,e.expand)return VR.expandMapping(e.src,e.dest,t).map((function(t){var r=Object.assign({},e);return r.orig=Object.assign({},e),r.src=t.src,r.dest=t.dest,["expand","cwd","flatten","rename","ext"].forEach((function(e){delete r[e]})),r}));var r=Object.assign({},e);return r.orig=Object.assign({},e),"src"in r&&Object.defineProperty(r,"src",{enumerable:!0,get:function r(){var n;return"result"in r||(n=e.src,n=Array.isArray(n)?BR(n):[n],r.result=VR.expand(t,n)),r.result}}),"dest"in r&&(r.dest=e.dest),r})).flatten().value(),t)};var qR=MT.exports,XR=eT,ZR=l,GR=lT,YR=fT,KR=jT,QR=n.Stream,JR=At().PassThrough,eA=IE.exports={};eA.file=qR,eA.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",(function(e){r.push(e),n+=e.length})),e.on("end",(function(){var e=new Buffer(n),i=0;r.forEach((function(t){t.copy(e,i),i+=t.length})),t(null,e)}))},eA.dateify=function(e){return(e=e||new Date)instanceof Date||(e="string"==typeof e?new Date(e):new Date),e},eA.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},KR(...n)},eA.isStream=function(e){return e instanceof QR},eA.lazyReadStream=function(e){return new GR.Readable((function(){return XR.createReadStream(e)}))},eA.normalizeInputSource=function(e){if(null===e)return new Buffer(0);if("string"==typeof e)return new Buffer(e);if(eA.isStream(e)&&!e._readableState){var t=new JR;return e.pipe(t),t}return e},eA.sanitizePath=function(e){return YR(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")},eA.trailingSlashIt=function(e){return"/"!==e.slice(-1)?e+"/":e},eA.unixifyPath=function(e){return YR(e,!1).replace(/^\w+:/,"")},eA.walkdir=function(e,t,r){var n=[];"function"==typeof t&&(r=t,t=e),XR.readdir(e,(function(i,s){var o,a,l=0;if(i)return r(i);!function i(){if(!(o=s[l++]))return r(null,n);a=ZR.join(e,o),XR.stat(a,(function(e,r){n.push({path:a,relative:ZR.relative(t,a).replace(/\\/g,"/"),stats:r}),r&&r.isDirectory()?eA.walkdir(a,t,(function(e,t){t.forEach((function(e){n.push(e)})),i()})):i()}))}()}))};var tA=IE.exports,rA={exports:{}};
32
+ /**
33
+ * Archiver Core
34
+ *
35
+ * @ignore
36
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
37
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
38
+ */
39
+ !function(e,t){const r={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function n(e,t){Error.captureStackTrace(this,this.constructor),this.message=r[e]||e,this.code=e,this.data=t}o.inherits(n,Error),e.exports=n}(rA);var nA=rA.exports,iA=r,sA=ak,oA=NE,aA=l,lA=tA,hA=o.inherits,uA=nA,cA=kl.Transform,fA="win32"===process.platform,dA=function(e,t){if(!(this instanceof dA))return new dA(e,t);"string"!=typeof e&&(t=e,e="zip"),t=this.options=lA.defaults(t,{highWaterMark:1048576,statConcurrency:4}),cA.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=oA.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=oA.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};
40
+ /**
41
+ * Archiver Core
42
+ *
43
+ * @ignore
44
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
45
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
46
+ */hA(dA,cA),dA.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()},dA.prototype._append=function(e,t){var r={source:null,filepath:e};(t=t||{}).name||(t.name=e),t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof iA.Stats?(r=this._updateQueueTaskWithStats(r,t.stats))&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r)):this._statQueue.push(r)},dA.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)},dA.prototype._maybeFinalize=function(){return!(this._state.finalizing||this._state.finalized||this._state.aborted)&&(!!(this._state.finalize&&0===this._pending&&this._queue.idle()&&this._statQueue.idle())&&(this._finalize(),!0))},dA.prototype._moduleAppend=function(e,t,r){this._state.aborted?r():this._module.append(e,t,function(e){if(this._task=null,this._state.aborted)this._shutdown();else{if(e)return this.emit("error",e),void setImmediate(r);this.emit("entry",t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}}.bind(this))},dA.prototype._moduleFinalize=function(){"function"==typeof this._module.finalize?this._module.finalize():"function"==typeof this._module.end?this._module.end():this.emit("error",new uA("NOENDMETHOD"))},dA.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0},dA.prototype._moduleSupports=function(e){return!(!this._module.supports||!this._module.supports[e])&&this._module.supports[e]},dA.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1},dA.prototype._normalizeEntryData=function(e,t){e=lA.defaults(e,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&!1===e.stats&&(e.stats=t);var r="directory"===e.type;return e.name&&("string"==typeof e.prefix&&""!==e.prefix&&(e.name=e.prefix+"/"+e.name,e.prefix=null),e.name=lA.sanitizePath(e.name),"symlink"!==e.type&&"/"===e.name.slice(-1)?(r=!0,e.type="directory"):r&&(e.name+="/")),"number"==typeof e.mode?e.mode&=fA?511:4095:e.stats&&null===e.mode?(e.mode=fA?511&e.stats.mode:4095&e.stats.mode,fA&&r&&(e.mode=493)):null===e.mode&&(e.mode=r?493:420),e.stats&&null===e.date?e.date=e.stats.mtime:e.date=lA.dateify(e.date),e},dA.prototype._onModuleError=function(e){this.emit("error",e)},dA.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&0===this._pending&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()},dA.prototype._onQueueTask=function(e,t){var r=()=>{e.data.callback&&e.data.callback(),t()};this._state.finalizing||this._state.finalized||this._state.aborted?r():(this._task=e,this._moduleAppend(e.source,e.data,r))},dA.prototype._onStatQueueTask=function(e,t){this._state.finalizing||this._state.finalized||this._state.aborted?t():iA.lstat(e.filepath,function(r,n){if(this._state.aborted)setImmediate(t);else{if(r)return this._entriesCount--,this.emit("warning",r),void setImmediate(t);(e=this._updateQueueTaskWithStats(e,n))&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(t)}}.bind(this))},dA.prototype._shutdown=function(){this._moduleUnpipe(),this.end()},dA.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)},dA.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=lA.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=lA.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=lA.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else{if(!t.isSymbolicLink()||!this._moduleSupports("symlink"))return t.isDirectory()?this.emit("warning",new uA("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new uA("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new uA("ENTRYNOTSUPPORTED",e.data)),null;var r=iA.readlinkSync(e.filepath),n=aA.dirname(e.filepath);e.data.type="symlink",e.data.linkname=aA.relative(n,aA.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}return e.data=this._normalizeEntryData(e.data,t),e},dA.prototype.abort=function(){return this._state.aborted||this._state.finalized||this._abort(),this},dA.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new uA("QUEUECLOSED")),this;if("string"!=typeof(t=this._normalizeEntryData(t)).name||0===t.name.length)return this.emit("error",new uA("ENTRYNAMEREQUIRED")),this;if("directory"===t.type&&!this._moduleSupports("directory"))return this.emit("error",new uA("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=lA.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else{if(!lA.isStream(e))return this.emit("error",new uA("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;t.sourceType="stream"}return this._entriesCount++,this._queue.push({data:t,source:e}),this},dA.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new uA("QUEUECLOSED")),this;if("string"!=typeof e||0===e.length)return this.emit("error",new uA("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,!1===t?t="":"string"!=typeof t&&(t=e);var n=!1;"function"==typeof r?(n=r,r={}):"object"!=typeof r&&(r={});var i=sA(e,{stat:!0,dot:!0});return i.on("error",function(e){this.emit("error",e)}.bind(this)),i.on("match",function(s){i.pause();var o=!1,a=Object.assign({},r);a.name=s.relative,a.prefix=t,a.stats=s.stat,a.callback=i.resume.bind(i);try{if(n)if(!1===(a=n(a)))o=!0;else if("object"!=typeof a)throw new uA("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}catch(e){return void this.emit("error",e)}o?i.resume():this._append(s.absolute,a)}.bind(this)),i.on("end",function(){this._pending--,this._maybeFinalize()}.bind(this)),this},dA.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new uA("QUEUECLOSED")),this):"string"!=typeof e||0===e.length?(this.emit("error",new uA("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)},dA.prototype.glob=function(e,t,r){this._pending++,t=lA.defaults(t,{stat:!0,pattern:e});var n=sA(t.cwd||".",t);return n.on("error",function(e){this.emit("error",e)}.bind(this)),n.on("match",function(e){n.pause();var t=Object.assign({},r);t.callback=n.resume.bind(n),t.stats=e.stat,t.name=e.relative,this._append(e.absolute,t)}.bind(this)),n.on("end",function(){this._pending--,this._maybeFinalize()}.bind(this)),this},dA.prototype.finalize=function(){if(this._state.aborted){var e=new uA("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new uA("FINALIZING");return this.emit("error",t),Promise.reject(t)}this._state.finalize=!0,0===this._pending&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise((function(e,t){var n;r._module.on("end",(function(){n||e()})),r._module.on("error",(function(e){n=!0,t(e)}))}))},dA.prototype.setFormat=function(e){return this._format?(this.emit("error",new uA("FORMATSET")),this):(this._format=e,this)},dA.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new uA("ABORTED")),this):this._state.module?(this.emit("error",new uA("MODULESET")),this):(this._module=e,this._modulePipe(),this)},dA.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new uA("QUEUECLOSED")),this;if("string"!=typeof e||0===e.length)return this.emit("error",new uA("SYMLINKFILEPATHREQUIRED")),this;if("string"!=typeof t||0===t.length)return this.emit("error",new uA("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new uA("SYMLINKNOTSUPPORTED",{filepath:e})),this;var n={type:"symlink"};return n.name=e.replace(/\\/g,"/"),n.linkname=t.replace(/\\/g,"/"),n.sourceType="buffer","number"==typeof r&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this},dA.prototype.pointer=function(){return this._pointer},dA.prototype.use=function(e){return this._streams.push(e),this};var pA=dA,mA={exports:{}},gA={exports:{}},yA=gA.exports=function(){};yA.prototype.getName=function(){},yA.prototype.getSize=function(){},yA.prototype.getLastModifiedDate=function(){},yA.prototype.isDirectory=function(){};var vA=gA.exports,_A={exports:{}},bA={exports:{}},wA={exports:{}},xA=wA.exports={};xA.dateToDos=function(e,t){var r=(t=t||!1)?e.getFullYear():e.getUTCFullYear();return r<1980?2162688:r>=2044?2141175677:r-1980<<25|(t?e.getMonth():e.getUTCMonth())+1<<21|(t?e.getDate():e.getUTCDate())<<16|(t?e.getHours():e.getUTCHours())<<11|(t?e.getMinutes():e.getUTCMinutes())<<5|(t?e.getSeconds():e.getUTCSeconds())/2},xA.dosToDate=function(e){return new Date(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1)},xA.fromDosTime=function(e){return xA.dosToDate(e.readUInt32LE(0))},xA.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t},xA.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((65535&e)>>>0,0),t},xA.getShortBytesValue=function(e,t){return e.readUInt16LE(t)},xA.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((4294967295&e)>>>0,0),t},xA.getLongBytesValue=function(e,t){return e.readUInt32LE(t)},xA.toDosTime=function(e){return xA.getLongBytes(xA.dateToDos(e))};var kA=wA.exports,SA=kA,EA=bA.exports=function(){return this instanceof EA?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new EA};EA.prototype.encode=function(){return SA.getShortBytes((this.descriptor?8:0)|(this.utf8?2048:0)|(this.encryption?1:0)|(this.strongEncryption?64:0))},EA.prototype.parse=function(e,t){var r=SA.getShortBytesValue(e,t),n=new EA;return n.useDataDescriptor(0!=(8&r)),n.useUTF8ForNames(0!=(2048&r)),n.useStrongEncryption(0!=(64&r)),n.useEncryption(0!=(1&r)),n.setSlidingDictionarySize(0!=(2&r)?8192:4096),n.setNumberOfShannonFanoTrees(0!=(4&r)?3:2),n},EA.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e},EA.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees},EA.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e},EA.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize},EA.prototype.useDataDescriptor=function(e){this.descriptor=e},EA.prototype.usesDataDescriptor=function(){return this.descriptor},EA.prototype.useEncryption=function(e){this.encryption=e},EA.prototype.usesEncryption=function(){return this.encryption},EA.prototype.useStrongEncryption=function(e){this.strongEncryption=e},EA.prototype.usesStrongEncryption=function(){return this.strongEncryption},EA.prototype.useUTF8ForNames=function(e){this.utf8=e},EA.prototype.usesUTF8ForNames=function(){return this.utf8};var TA=bA.exports,CA={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1},OA=o.inherits,RA=fT,AA=vA,NA=TA,IA={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420},PA=CA,FA=kA,DA=_A.exports=function(e){if(!(this instanceof DA))return new DA(e);AA.call(this),this.platform=PA.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new NA,this.crc=0,this.time=-1,this.minver=PA.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};OA(DA,AA),DA.prototype.getCentralDirectoryExtra=function(){return this.getExtra()},DA.prototype.getComment=function(){return null!==this.comment?this.comment:""},DA.prototype.getCompressedSize=function(){return this.csize},DA.prototype.getCrc=function(){return this.crc},DA.prototype.getExternalAttributes=function(){return this.exattr},DA.prototype.getExtra=function(){return null!==this.extra?this.extra:PA.EMPTY},DA.prototype.getGeneralPurposeBit=function(){return this.gpb},DA.prototype.getInternalAttributes=function(){return this.inattr},DA.prototype.getLastModifiedDate=function(){return this.getTime()},DA.prototype.getLocalFileDataExtra=function(){return this.getExtra()},DA.prototype.getMethod=function(){return this.method},DA.prototype.getName=function(){return this.name},DA.prototype.getPlatform=function(){return this.platform},DA.prototype.getSize=function(){return this.size},DA.prototype.getTime=function(){return-1!==this.time?FA.dosToDate(this.time):-1},DA.prototype.getTimeDos=function(){return-1!==this.time?this.time:0},DA.prototype.getUnixMode=function(){return this.platform!==PA.PLATFORM_UNIX?0:this.getExternalAttributes()>>PA.SHORT_SHIFT&PA.SHORT_MASK},DA.prototype.getVersionNeededToExtract=function(){return this.minver},DA.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e},DA.prototype.setCompressedSize=function(e){if(e<0)throw new Error("invalid entry compressed size");this.csize=e},DA.prototype.setCrc=function(e){if(e<0)throw new Error("invalid entry crc32");this.crc=e},DA.prototype.setExternalAttributes=function(e){this.exattr=e>>>0},DA.prototype.setExtra=function(e){this.extra=e},DA.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof NA))throw new Error("invalid entry GeneralPurposeBit");this.gpb=e},DA.prototype.setInternalAttributes=function(e){this.inattr=e},DA.prototype.setMethod=function(e){if(e<0)throw new Error("invalid entry compression method");this.method=e},DA.prototype.setName=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=RA(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e},DA.prototype.setPlatform=function(e){this.platform=e},DA.prototype.setSize=function(e){if(e<0)throw new Error("invalid entry size");this.size=e},DA.prototype.setTime=function(e,t){if(!(e instanceof Date))throw new Error("invalid entry time");this.time=FA.dateToDos(e,t)},DA.prototype.setUnixMode=function(e){var t=0;t|=(e|=this.isDirectory()?PA.S_IFDIR:PA.S_IFREG)<<PA.SHORT_SHIFT|(this.isDirectory()?PA.S_DOS_D:PA.S_DOS_A),this.setExternalAttributes(t),this.mode=e&PA.MODE_MASK,this.platform=PA.PLATFORM_UNIX},DA.prototype.setVersionNeededToExtract=function(e){this.minver=e},DA.prototype.isDirectory=function(){return"/"===this.getName().slice(-1)},DA.prototype.isUnixSymlink=function(){return(this.getUnixMode()&IA.FILE_TYPE_FLAG)===IA.LINK_FLAG},DA.prototype.isZip64=function(){return this.csize>PA.ZIP64_MAGIC||this.size>PA.ZIP64_MAGIC};var jA=_A.exports,MA={exports:{}},LA={exports:{}},BA=n.Stream,zA=kl.PassThrough,$A=LA.exports={};$A.isStream=function(e){return e instanceof BA},$A.normalizeInputSource=function(e){if(null===e)return Buffer.alloc(0);if("string"==typeof e)return Buffer.from(e);if($A.isStream(e)&&!e._readableState){var t=new zA;return e.pipe(t),t}return e};var HA=LA.exports,UA=o.inherits,VA=kl.Transform,WA=vA,qA=HA,XA=MA.exports=function(e){if(!(this instanceof XA))return new XA(e);VA.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};UA(XA,VA),XA.prototype._appendBuffer=function(e,t,r){},XA.prototype._appendStream=function(e,t,r){},XA.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)},XA.prototype._finish=function(e){},XA.prototype._normalizeEntry=function(e){},XA.prototype._transform=function(e,t,r){r(null,e)},XA.prototype.entry=function(e,t,r){if(t=t||null,"function"!=typeof r&&(r=this._emitErrorCallback.bind(this)),e instanceof WA)if(this._archive.finish||this._archive.finished)r(new Error("unacceptable entry after finish"));else{if(!this._archive.processing){if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=qA.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else{if(!qA.isStream(t))return this._archive.processing=!1,void r(new Error("input source must be valid Stream or Buffer instance"));this._appendStream(e,t,r)}return this}r(new Error("already processing an entry"))}else r(new Error("not a valid instance of ArchiveEntry"))},XA.prototype.finish=function(){this._archive.processing?this._archive.finish=!0:this._finish()},XA.prototype.getBytesWritten=function(){return this.offset},XA.prototype.write=function(e,t){return e&&(this.offset+=e.length),VA.prototype.write.call(this,e,t)};var ZA=MA.exports,GA={exports:{}},YA=s.Buffer,KA=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function QA(e){if(YA.isBuffer(e))return e;var t="function"==typeof YA.alloc&&"function"==typeof YA.from;if("number"==typeof e)return t?YA.alloc(e):new YA(e);if("string"==typeof e)return t?YA.from(e):new YA(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function JA(e,t){e=QA(e),YA.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=-1^~~t,n=0;n<e.length;n++)r=KA[255&(r^e[n])]^r>>>8;return-1^r}function eN(){return function(e){var t=QA(4);return t.writeInt32BE(e,0),t}(JA.apply(null,arguments))}"undefined"!=typeof Int32Array&&(KA=new Int32Array(KA)),eN.signed=function(){return JA.apply(null,arguments)},eN.unsigned=function(){return JA.apply(null,arguments)>>>0};var tN=eN,rN={};
47
+ /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
48
+ !function(e){var t;t=function(e){e.version="1.2.2";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),r=function(e){var t=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)i[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=i[t]=r>>>8^e[255&r];var s=[];for(n=1;16!=n;++n)s[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return s}(t),n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],h=r[6],u=r[7],c=r[8],f=r[9],d=r[10],p=r[11],m=r[12],g=r[13],y=r[14];e.table=t,e.bstr=function(e,r){for(var n=-1^r,i=0,s=e.length;i<s;)n=n>>>8^t[255&(n^e.charCodeAt(i++))];return~n},e.buf=function(e,r){for(var v=-1^r,_=e.length-15,b=0;b<_;)v=y[e[b++]^255&v]^g[e[b++]^v>>8&255]^m[e[b++]^v>>16&255]^p[e[b++]^v>>>24]^d[e[b++]]^f[e[b++]]^c[e[b++]]^u[e[b++]]^h[e[b++]]^l[e[b++]]^a[e[b++]]^o[e[b++]]^s[e[b++]]^i[e[b++]]^n[e[b++]]^t[e[b++]];for(_+=15;b<_;)v=v>>>8^t[255&(v^e[b++])];return~v},e.str=function(e,r){for(var n=-1^r,i=0,s=e.length,o=0,a=0;i<s;)(o=e.charCodeAt(i++))<128?n=n>>>8^t[255&(n^o)]:o<2048?n=(n=n>>>8^t[255&(n^(192|o>>6&31))])>>>8^t[255&(n^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),a=1023&e.charCodeAt(i++),n=(n=(n=(n=n>>>8^t[255&(n^(240|o>>8&7))])>>>8^t[255&(n^(128|o>>2&63))])>>>8^t[255&(n^(128|a>>6&15|(3&o)<<4))])>>>8^t[255&(n^(128|63&a))]):n=(n=(n=n>>>8^t[255&(n^(224|o>>12&15))])>>>8^t[255&(n^(128|o>>6&63))])>>>8^t[255&(n^(128|63&o))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?t(e):t({})}(rN);const{Transform:nN}=kl,iN=rN;var sN=class extends nN{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,t,r){e&&(this.checksum=iN.buf(e,this.checksum)>>>0,this.rawSize+=e.length),r(null,e)}digest(e){const t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};const{DeflateRaw:oN}=c,aN=rN;var lN=class extends oN{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,t){return e&&(this.compressedSize+=e.length),super.push(e,t)}_transform(e,t,r){e&&(this.checksum=aN.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,t,r)}digest(e){const t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest("hex").toUpperCase()}size(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.compressedSize:this.rawSize}},hN={CRC32Stream:sN,DeflateCRC32Stream:lN},uN=o.inherits,cN=tN,{CRC32Stream:fN}=hN,{DeflateCRC32Stream:dN}=hN,pN=ZA,mN=CA,gN=kA,yN=GA.exports=function(e){if(!(this instanceof yN))return new yN(e);e=this.options=this._defaults(e),pN.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};uN(yN,pN),yN.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()},yN.prototype._appendBuffer=function(e,t,r){0===t.length&&e.setMethod(mN.METHOD_STORED);var n=e.getMethod();return n===mN.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(cN.unsigned(t))),this._writeLocalFileHeader(e),n===mN.METHOD_STORED?(this.write(t),this._afterAppend(e),void r(null,e)):n===mN.METHOD_DEFLATED?void this._smartStream(e,r).end(t):void r(new Error("compression method "+n+" not implemented"))},yN.prototype._appendStream=function(e,t,r){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(mN.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var n=this._smartStream(e,r);t.once("error",(function(e){n.emit("error",e),n.end()})),t.pipe(n)},yN.prototype._defaults=function(e){return"object"!=typeof e&&(e={}),"object"!=typeof e.zlib&&(e.zlib={}),"number"!=typeof e.zlib.level&&(e.zlib.level=mN.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e},yN.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()},yN.prototype._normalizeEntry=function(e){-1===e.getMethod()&&e.setMethod(mN.METHOD_DEFLATED),e.getMethod()===mN.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(mN.MIN_VERSION_DATA_DESCRIPTOR)),-1===e.getTime()&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}},yN.prototype._smartStream=function(e,t){var r=e.getMethod()===mN.METHOD_DEFLATED?new dN(this.options.zlib):new fN,n=null;return r.once("end",function(){var i=r.digest().readUInt32BE(0);e.setCrc(i),e.setSize(r.size()),e.setCompressedSize(r.size(!0)),this._afterAppend(e),t(n,e)}.bind(this)),r.once("error",(function(e){n=e})),r.pipe(this,{end:!1}),r},yN.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,r=this._archive.centralOffset;this.isZip64()&&(e=mN.ZIP64_MAGIC_SHORT,t=mN.ZIP64_MAGIC,r=mN.ZIP64_MAGIC),this.write(gN.getLongBytes(mN.SIG_EOCD)),this.write(mN.SHORT_ZERO),this.write(mN.SHORT_ZERO),this.write(gN.getShortBytes(e)),this.write(gN.getShortBytes(e)),this.write(gN.getLongBytes(t)),this.write(gN.getLongBytes(r));var n=this.getComment(),i=Buffer.byteLength(n);this.write(gN.getShortBytes(i)),this.write(n)},yN.prototype._writeCentralDirectoryZip64=function(){this.write(gN.getLongBytes(mN.SIG_ZIP64_EOCD)),this.write(gN.getEightBytes(44)),this.write(gN.getShortBytes(mN.MIN_VERSION_ZIP64)),this.write(gN.getShortBytes(mN.MIN_VERSION_ZIP64)),this.write(mN.LONG_ZERO),this.write(mN.LONG_ZERO),this.write(gN.getEightBytes(this._entries.length)),this.write(gN.getEightBytes(this._entries.length)),this.write(gN.getEightBytes(this._archive.centralLength)),this.write(gN.getEightBytes(this._archive.centralOffset)),this.write(gN.getLongBytes(mN.SIG_ZIP64_EOCD_LOC)),this.write(mN.LONG_ZERO),this.write(gN.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(gN.getLongBytes(1))},yN.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e._offsets,i=e.getSize(),s=e.getCompressedSize();if(e.isZip64()||n.file>mN.ZIP64_MAGIC){i=mN.ZIP64_MAGIC,s=mN.ZIP64_MAGIC,e.setVersionNeededToExtract(mN.MIN_VERSION_ZIP64);var o=Buffer.concat([gN.getShortBytes(mN.ZIP64_EXTRA_ID),gN.getShortBytes(24),gN.getEightBytes(e.getSize()),gN.getEightBytes(e.getCompressedSize()),gN.getEightBytes(n.file)],28);e.setExtra(o)}this.write(gN.getLongBytes(mN.SIG_CFH)),this.write(gN.getShortBytes(e.getPlatform()<<8|mN.VERSION_MADEBY)),this.write(gN.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(gN.getShortBytes(r)),this.write(gN.getLongBytes(e.getTimeDos())),this.write(gN.getLongBytes(e.getCrc())),this.write(gN.getLongBytes(s)),this.write(gN.getLongBytes(i));var a=e.getName(),l=e.getComment(),h=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(a=Buffer.from(a),l=Buffer.from(l)),this.write(gN.getShortBytes(a.length)),this.write(gN.getShortBytes(h.length)),this.write(gN.getShortBytes(l.length)),this.write(mN.SHORT_ZERO),this.write(gN.getShortBytes(e.getInternalAttributes())),this.write(gN.getLongBytes(e.getExternalAttributes())),n.file>mN.ZIP64_MAGIC?this.write(gN.getLongBytes(mN.ZIP64_MAGIC)):this.write(gN.getLongBytes(n.file)),this.write(a),this.write(h),this.write(l)},yN.prototype._writeDataDescriptor=function(e){this.write(gN.getLongBytes(mN.SIG_DD)),this.write(gN.getLongBytes(e.getCrc())),e.isZip64()?(this.write(gN.getEightBytes(e.getCompressedSize())),this.write(gN.getEightBytes(e.getSize()))):(this.write(gN.getLongBytes(e.getCompressedSize())),this.write(gN.getLongBytes(e.getSize())))},yN.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(mN.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(n=Buffer.from(n)),e._offsets.file=this.offset,this.write(gN.getLongBytes(mN.SIG_LFH)),this.write(gN.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(gN.getShortBytes(r)),this.write(gN.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(mN.LONG_ZERO),this.write(mN.LONG_ZERO),this.write(mN.LONG_ZERO)):(this.write(gN.getLongBytes(e.getCrc())),this.write(gN.getLongBytes(e.getCompressedSize())),this.write(gN.getLongBytes(e.getSize()))),this.write(gN.getShortBytes(n.length)),this.write(gN.getShortBytes(i.length)),this.write(n),this.write(i),e._offsets.contents=this.offset},yN.prototype.getComment=function(e){return null!==this._archive.comment?this._archive.comment:""},yN.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>mN.ZIP64_MAGIC_SHORT||this._archive.centralLength>mN.ZIP64_MAGIC||this._archive.centralOffset>mN.ZIP64_MAGIC},yN.prototype.setComment=function(e){this._archive.comment=e};var vN={ArchiveEntry:vA,ZipArchiveEntry:jA,ArchiveOutputStream:ZA,ZipArchiveOutputStream:GA.exports},_N={exports:{}},bN={exports:{}},wN=eT,xN=l,kN=tC,SN=KC,EN=XO,TN=uR,CN=jR(),ON=bN.exports={},RN=/[\/\\]/g;ON.exists=function(){var e=xN.join.apply(xN,arguments);return wN.existsSync(e)},ON.expand=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=TN(t[0])?t.shift():{},i=Array.isArray(t[0])?t[0]:t;if(0===i.length)return[];var s=function(e,t){var r=[];return kN(e).forEach((function(e){var n=0===e.indexOf("!");n&&(e=e.slice(1));var i=t(e);r=n?SN(r,i):EN(r,i)})),r}(i,(function(e){return CN.sync(e,n)}));return n.filter&&(s=s.filter((function(e){e=xN.join(n.cwd||"",e);try{return"function"==typeof n.filter?n.filter(e):wN.statSync(e)[n.filter]()}catch(e){return!1}}))),s},ON.expandMapping=function(e,t,r){r=Object.assign({rename:function(e,t){return xN.join(e||"",t)}},r);var n=[],i={};return ON.expand(r,e).forEach((function(e){var s=e;r.flatten&&(s=xN.basename(s)),r.ext&&(s=s.replace(/(\.[^\/]*)?$/,r.ext));var o=r.rename(t,s,r);r.cwd&&(e=xN.join(r.cwd,e)),o=o.replace(RN,"/"),e=e.replace(RN,"/"),i[o]?i[o].src.push(e):(n.push({src:[e],dest:o}),i[o]=n[n.length-1])})),n},ON.normalizeFilesArray=function(e){var t=[];return e.forEach((function(e){("src"in e||"dest"in e)&&t.push(e)})),0===t.length?[]:(t=_(t).chain().forEach((function(e){"src"in e&&e.src&&(Array.isArray(e.src)?e.src=kN(e.src):e.src=[e.src])})).map((function(e){var t=Object.assign({},e);if(delete t.src,delete t.dest,e.expand)return ON.expandMapping(e.src,e.dest,t).map((function(t){var r=Object.assign({},e);return r.orig=Object.assign({},e),r.src=t.src,r.dest=t.dest,["expand","cwd","flatten","rename","ext"].forEach((function(e){delete r[e]})),r}));var r=Object.assign({},e);return r.orig=Object.assign({},e),"src"in r&&Object.defineProperty(r,"src",{enumerable:!0,get:function r(){var n;return"result"in r||(n=e.src,n=Array.isArray(n)?kN(n):[n],r.result=ON.expand(t,n)),r.result}}),"dest"in r&&(r.dest=e.dest),r})).flatten().value(),t)};var AN=bN.exports,NN=eT,IN=l,PN=lT,FN=fT,DN=jT,jN=n.Stream,MN=kl.PassThrough,LN=_N.exports={};LN.file=AN,LN.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",(function(e){r.push(e),n+=e.length})),e.on("end",(function(){var e=Buffer.alloc(n),i=0;r.forEach((function(t){t.copy(e,i),i+=t.length})),t(null,e)}))},LN.dateify=function(e){return(e=e||new Date)instanceof Date||(e="string"==typeof e?new Date(e):new Date),e},LN.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},DN(...n)},LN.isStream=function(e){return e instanceof jN},LN.lazyReadStream=function(e){return new PN.Readable((function(){return NN.createReadStream(e)}))},LN.normalizeInputSource=function(e){return null===e?Buffer.alloc(0):"string"==typeof e?Buffer.from(e):LN.isStream(e)?e.pipe(new MN):e},LN.sanitizePath=function(e){return FN(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")},LN.trailingSlashIt=function(e){return"/"!==e.slice(-1)?e+"/":e},LN.unixifyPath=function(e){return FN(e,!1).replace(/^\w+:/,"")},LN.walkdir=function(e,t,r){var n=[];"function"==typeof t&&(r=t,t=e),NN.readdir(e,(function(i,s){var o,a,l=0;if(i)return r(i);!function i(){if(!(o=s[l++]))return r(null,n);a=IN.join(e,o),NN.stat(a,(function(e,r){n.push({path:a,relative:IN.relative(t,a).replace(/\\/g,"/"),stats:r}),r&&r.isDirectory()?LN.walkdir(a,t,(function(e,t){t.forEach((function(e){n.push(e)})),i()})):i()}))}()}))};var BN=_N.exports,zN=o.inherits,$N=vN.ZipArchiveOutputStream,HN=vN.ZipArchiveEntry,UN=BN,VN=mA.exports=function(e){if(!(this instanceof VN))return new VN(e);(e=this.options=e||{}).zlib=e.zlib||{},$N.call(this,e),"number"==typeof e.level&&e.level>=0&&(e.zlib.level=e.level,delete e.level),e.forceZip64||"number"!=typeof e.zlib.level||0!==e.zlib.level||(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};
49
+ /**
50
+ * ZipStream
51
+ *
52
+ * @ignore
53
+ * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
54
+ * @copyright (c) 2014 Chris Talkington, contributors.
55
+ */zN(VN,$N),VN.prototype._normalizeFileData=function(e){var t="directory"===(e=UN.defaults(e,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""})).type,r="symlink"===e.type;return e.name&&(e.name=UN.sanitizePath(e.name),r||"/"!==e.name.slice(-1)?t&&(e.name+="/"):(t=!0,e.type="directory")),(t||r)&&(e.store=!0),e.date=UN.dateify(e.date),e},VN.prototype.entry=function(e,t,r){if("function"!=typeof r&&(r=this._emitErrorCallback.bind(this)),"file"===(t=this._normalizeFileData(t)).type||"directory"===t.type||"symlink"===t.type)if("string"==typeof t.name&&0!==t.name.length){if("symlink"!==t.type||"string"==typeof t.linkname){var n=new HN(t.name);return n.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&n.setName(t.name,!0),t.store&&n.setMethod(0),t.comment.length>0&&n.setComment(t.comment),"symlink"===t.type&&"number"!=typeof t.mode&&(t.mode=40960),"number"==typeof t.mode&&("symlink"===t.type&&(t.mode|=40960),n.setUnixMode(t.mode)),"symlink"===t.type&&"string"==typeof t.linkname&&(e=Buffer.from(t.linkname)),$N.prototype.entry.call(this,n,e,r)}r(new Error("entry linkname must be a non-empty string value when type equals symlink"))}else r(new Error("entry name must be a non-empty string value"));else r(new Error(t.type+" entries not currently supported"))},VN.prototype.finalize=function(){this.finish()};var WN=mA.exports,qN=tA,XN=function(e){if(!(this instanceof XN))return new XN(e);e=this.options=qN.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new WN(e)};
56
+ /**
57
+ * ZIP Format Plugin
58
+ *
59
+ * @module plugins/zip
60
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
61
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
62
+ */XN.prototype.append=function(e,t,r){this.engine.entry(e,t,r)},XN.prototype.finalize=function(){this.engine.finalize()},XN.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},XN.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)},XN.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};var ZN=XN,GN={},YN={exports:{}};const{Buffer:KN}=s,QN=Symbol.for("BufferList");function JN(e){if(!(this instanceof JN))return new JN(e);JN._init.call(this,e)}JN._init=function(e){Object.defineProperty(this,QN,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},JN.prototype._new=function(e){return new JN(e)},JN.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},JN.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},JN.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},JN.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},JN.prototype.copy=function(e,t,r,n){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof n||n>this.length)&&(n=this.length),r>=this.length)return e||KN.alloc(0);if(n<=0)return e||KN.alloc(0);const i=!!e,s=this._offset(r),o=n-r;let a=o,l=i&&t||0,h=s[1];if(0===r&&n===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:KN.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,l),l+=this._bufs[t].length;return e}if(a<=this._bufs[s[0]].length-h)return i?this._bufs[s[0]].copy(e,t,h,h+a):this._bufs[s[0]].slice(h,h+a);i||(e=KN.allocUnsafe(o));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-h;if(!(a>r)){this._bufs[t].copy(e,l,h,h+a),l+=r;break}this._bufs[t].copy(e,l,h),l+=r,a-=r,h&&(h=0)}return e.length>l?e.slice(0,l):e},JN.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},JN.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},JN.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},JN.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},JN.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(KN.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(KN.from(e));return this},JN.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},JN.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"==typeof t&&(r=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=KN.from([e]):"string"==typeof e?e=KN.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=KN.from(e.buffer,e.byteOffset,e.byteLength):KN.isBuffer(e)||(e=KN.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const n=this._offset(t);let i=n[0],s=n[1];for(;i<this._bufs.length;i++){const t=this._bufs[i];for(;s<t.length;){if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([i,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([i,s]);if(this._match(t,e))return t;s++}}s=0}return-1},JN.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){JN.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.slice(r,r+e[t])[t](0)}}(t)}(),JN.prototype._isBufferList=function(e){return e instanceof JN||JN.isBufferList(e)},JN.isBufferList=function(e){return null!=e&&e[QN]};var eI=JN;const tI=kl.Duplex,rI=rt(),nI=eI;function iI(e){if(!(this instanceof iI))return new iI(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}nI._init.call(this,e),tI.call(this)}rI(iI,tI),Object.assign(iI.prototype,nI.prototype),iI.prototype._new=function(e){return new iI(e)},iI.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},iI.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},iI.prototype.end=function(e){tI.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},iI.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},iI.prototype._isBufferList=function(e){return e instanceof iI||e instanceof nI||iI.isBufferList(e)},iI.isBufferList=nI.isBufferList,YN.exports=iI,YN.exports.BufferListStream=iI,YN.exports.BufferList=nI;var sI=YN.exports,oI={},aI=Buffer.alloc,lI="0".charCodeAt(0),hI=Buffer.from("ustar\0","binary"),uI=Buffer.from("00","binary"),cI=Buffer.from("ustar ","binary"),fI=Buffer.from(" \0","binary"),dI=parseInt("7777",8),pI=257,mI=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},gI=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},yI=function(e,t){return(e=e.toString(8)).length>t?"7777777777777777777".slice(0,t)+" ":"0000000000000000000".slice(0,t-e.length)+e+" "};var vI=function(e,t,r){if(128&(e=e.slice(t,t+r))[t=0])return function(e){var t;if(128===e[0])t=!0;else{if(255!==e[0])return null;t=!1}for(var r=[],n=e.length-1;n>0;n--){var i=e[n];t?r.push(i):r.push(255-i)}var s=0,o=r.length;for(n=0;n<o;n++)s+=r[n]*Math.pow(256,n);return t?s:-1*s}(e);for(;t<e.length&&32===e[t];)t++;for(var n=function(e,t,r){return"number"!=typeof e?r:(e=~~e)>=t?t:e>=0||(e+=t)>=0?e:0}(mI(e,32,t,e.length),e.length,e.length);t<n&&0===e[t];)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},_I=function(e,t,r,n){return e.slice(t,mI(e,0,t,t+r)).toString(n)},bI=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};oI.decodeLongPath=function(e,t){return _I(e,0,e.length,t)},oI.encodePax=function(e){var t="";e.name&&(t+=bI(" path="+e.name+"\n")),e.linkname&&(t+=bI(" linkpath="+e.linkname+"\n"));var r=e.pax;if(r)for(var n in r)t+=bI(" "+n+"="+r[n]+"\n");return Buffer.from(t)},oI.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&32!==e[r];)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),s=i.indexOf("=");if(-1===s)return t;t[i.slice(0,s)]=i.slice(s+1),e=e.slice(n)}return t},oI.encode=function(e){var t=aI(512),r=e.name,n="";if(5===e.typeflag&&"/"!==r[r.length-1]&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(-1===i)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(yI(e.mode&dI,6),100),t.write(yI(e.uid,6),108),t.write(yI(e.gid,6),116),t.write(yI(e.size,11),124),t.write(yI(e.mtime.getTime()/1e3|0,11),136),t[156]=lI+function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}(e.type),e.linkname&&t.write(e.linkname,157),hI.copy(t,pI),uI.copy(t,263),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(yI(e.devmajor||0,6),329),t.write(yI(e.devminor||0,6),337),n&&t.write(n,345),t.write(yI(gI(t),6),148),t)},oI.decode=function(e,t,r){var n=0===e[156]?0:e[156]-lI,i=_I(e,0,100,t),s=vI(e,100,8),o=vI(e,108,8),a=vI(e,116,8),l=vI(e,124,12),h=vI(e,136,12),u=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}(n),c=0===e[157]?null:_I(e,157,100,t),f=_I(e,265,32),d=_I(e,297,32),p=vI(e,329,8),m=vI(e,337,8),g=gI(e);if(256===g)return null;if(g!==vI(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(0===hI.compare(e,pI,263))e[345]&&(i=_I(e,345,155,t)+"/"+i);else if(0===cI.compare(e,pI,263)&&0===fI.compare(e,263,265));else if(!r)throw new Error("Invalid tar header: unknown format.");return 0===n&&i&&"/"===i[i.length-1]&&(n=5),{name:i,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*h),type:u,linkname:c,uname:f,gname:d,devmajor:p,devminor:m}};var wI=o,xI=sI,kI=oI,SI=kl.Writable,EI=kl.PassThrough,TI=function(){},CI=function(e){return(e&=511)&&512-e},OI=function(e,t){this._parent=e,this.offset=t,EI.call(this,{autoDestroy:!1})};wI.inherits(OI,EI),OI.prototype.destroy=function(e){this._parent.destroy(e)};var RI=function(e){if(!(this instanceof RI))return new RI(e);SI.call(this,e),e=e||{},this._offset=0,this._buffer=xI(),this._missing=0,this._partial=!1,this._onparse=TI,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(e){if(t._locked=!1,e)return t.destroy(e);t._stream||n()},s=function(){t._stream=null;var e=CI(t._header.size);e?t._parse(e,o):t._parse(512,c),t._locked||n()},o=function(){t._buffer.consume(CI(t._header.size)),t._parse(512,c),n()},a=function(){var e=t._header.size;t._paxGlobal=kI.decodePax(r.slice(0,e)),r.consume(e),s()},l=function(){var e=t._header.size;t._pax=kI.decodePax(r.slice(0,e)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(e),s()},h=function(){var n=t._header.size;this._gnuLongPath=kI.decodeLongPath(r.slice(0,n),e.filenameEncoding),r.consume(n),s()},u=function(){var n=t._header.size;this._gnuLongLinkPath=kI.decodeLongPath(r.slice(0,n),e.filenameEncoding),r.consume(n),s()},c=function(){var o,f=t._offset;try{o=t._header=kI.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(e){t.emit("error",e)}return r.consume(512),o?"gnu-long-path"===o.type?(t._parse(o.size,h),void n()):"gnu-long-link-path"===o.type?(t._parse(o.size,u),void n()):"pax-global-header"===o.type?(t._parse(o.size,a),void n()):"pax-header"===o.type?(t._parse(o.size,l),void n()):(t._gnuLongPath&&(o.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(o.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=o=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e}(o,t._pax),t._pax=null),t._locked=!0,o.size&&"directory"!==o.type?(t._stream=new OI(t,f),t.emit("entry",o,t._stream,i),t._parse(o.size,s),void n()):(t._parse(512,c),void t.emit("entry",o,function(e,t){var r=new OI(e,t);return r.end(),r}(t,f),i))):(t._parse(512,c),void n())};this._onheader=c,this._parse(512,c)};wI.inherits(RI,SI),RI.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))},RI.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)},RI.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=TI,this._overflow?this._write(this._overflow,void 0,e):e()}},RI.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,s=this._missing;if(e.length&&(this._partial=!0),e.length<s)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>s&&(o=e.slice(s),e=e.slice(0,s)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}},RI.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};var AI=RI,NI=r.constants||h,II=FR(),PI=function(){},FI=function(e,t,r){if("function"==typeof t)return FI(e,null,t);t||(t={}),r=II(r||PI);var n=e._writableState,i=e._readableState,s=t.readable||!1!==t.readable&&e.readable,o=t.writable||!1!==t.writable&&e.writable,a=!1,l=function(){e.writable||h()},h=function(){o=!1,s||r.call(e)},u=function(){s=!1,o||r.call(e)},c=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},f=function(t){r.call(e,t)},d=function(){process.nextTick(p)},p=function(){if(!a)return(!s||i&&i.ended&&!i.destroyed)&&(!o||n&&n.ended&&!n.destroyed)?void 0:r.call(e,new Error("premature close"))},m=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?o&&!n&&(e.on("end",l),e.on("close",l)):(e.on("complete",h),e.on("abort",d),e.req?m():e.on("request",m)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",c),e.on("end",u),e.on("finish",h),!1!==t.error&&e.on("error",f),e.on("close",d),function(){a=!0,e.removeListener("complete",h),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",h),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("exit",c),e.removeListener("end",u),e.removeListener("error",f),e.removeListener("close",d)}},DI=NI,jI=FI,MI=rt(),LI=Buffer.alloc,BI=kl.Readable,zI=kl.Writable,$I=a.StringDecoder,HI=oI,UI=parseInt("755",8),VI=parseInt("644",8),WI=LI(1024),qI=function(){},XI=function(e,t){(t&=511)&&e.push(WI.slice(0,512-t))};var ZI=function(e){zI.call(this),this.written=0,this._to=e,this._destroyed=!1};MI(ZI,zI),ZI.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r},ZI.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var GI=function(){zI.call(this),this.linkname="",this._decoder=new $I("utf-8"),this._destroyed=!1};MI(GI,zI),GI.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()},GI.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var YI=function(){zI.call(this),this._destroyed=!1};MI(YI,zI),YI.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))},YI.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var KI=function(e){if(!(this instanceof KI))return new KI(e);BI.call(this,e),this._drain=qI,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};MI(KI,BI),KI.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!this._finalized&&!this._destroyed){"function"==typeof t&&(r=t,t=null),r||(r=qI);var n=this;if(e.size&&"symlink"!==e.type||(e.size=0),e.type||(e.type=function(e){switch(e&DI.S_IFMT){case DI.S_IFBLK:return"block-device";case DI.S_IFCHR:return"character-device";case DI.S_IFDIR:return"directory";case DI.S_IFIFO:return"fifo";case DI.S_IFLNK:return"symlink"}return"file"}(e.mode)),e.mode||(e.mode="directory"===e.type?UI:VI),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),"string"==typeof t&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return XI(n,e.size),i?process.nextTick(r):this._drain=r,new YI}if("symlink"===e.type&&!e.linkname){var s=new GI;return jI(s,(function(t){if(t)return n.destroy(),r(t);e.linkname=s.linkname,n._encode(e),r()})),s}if(this._encode(e),"file"!==e.type&&"contiguous-file"!==e.type)return process.nextTick(r),new YI;var o=new ZI(this);return this._stream=o,jI(o,(function(t){return n._stream=null,t?(n.destroy(),r(t)):o.written!==e.size?(n.destroy(),r(new Error("size mismatch"))):(XI(n,e.size),n._finalizing&&n.finalize(),void r())})),o}},KI.prototype.finalize=function(){this._stream?this._finalizing=!0:this._finalized||(this._finalized=!0,this.push(WI),this.push(null))},KI.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())},KI.prototype._encode=function(e){if(!e.pax){var t=HI.encode(e);if(t)return void this.push(t)}this._encodePax(e)},KI.prototype._encodePax=function(e){var t=HI.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(HI.encode(r)),this.push(t),XI(this,t.length),r.size=e.size,r.type=e.type,this.push(HI.encode(r))},KI.prototype._read=function(e){var t=this._drain;this._drain=qI,t()};var QI=KI;GN.extract=AI,GN.pack=QI;
63
+ /**
64
+ * TAR Format Plugin
65
+ *
66
+ * @module plugins/tar
67
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
68
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
69
+ */
70
+ var JI=c,eP=GN,tP=tA,rP=function(e){if(!(this instanceof rP))return new rP(e);"object"!=typeof(e=this.options=tP.defaults(e,{gzip:!1})).gzipOptions&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=eP.pack(e),this.compressor=!1,e.gzip&&(this.compressor=JI.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};rP.prototype._onCompressorError=function(e){this.engine.emit("error",e)},rP.prototype.append=function(e,t,r){var n=this;function i(e,i){e?r(e):n.engine.entry(t,i,(function(e){r(e,t)}))}if(t.mtime=t.date,"buffer"===t.sourceType)i(null,e);else if("stream"===t.sourceType&&t.stats){t.size=t.stats.size;var s=n.engine.entry(t,(function(e){r(e,t)}));e.pipe(s)}else"stream"===t.sourceType&&tP.collectStream(e,i)},rP.prototype.finalize=function(){this.engine.finalize()},rP.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},rP.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)},rP.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};var nP=rP,iP=o.inherits,sP=kl.Transform,oP=tN,aP=tA,lP=function(e){if(!(this instanceof lP))return new lP(e);e=this.options=aP.defaults(e,{}),sP.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};
71
+ /**
72
+ * JSON Format Plugin
73
+ *
74
+ * @module plugins/json
75
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
76
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
77
+ */iP(lP,sP),lP.prototype._transform=function(e,t,r){r(null,e)},lP.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)},lP.prototype.append=function(e,t,r){var n=this;function i(e,i){e?r(e):(t.size=i.length||0,t.crc32=oP.unsigned(i),n.files.push(t),r(null,t))}t.crc32=0,"buffer"===t.sourceType?i(null,e):"stream"===t.sourceType&&aP.collectStream(e,i)},lP.prototype.finalize=function(){this._writeStringified(),this.end()};var hP=lP,uP=pA,cP={},fP=function(e,t){return fP.create(e,t)};
78
+ /**
79
+ * Archiver Vending
80
+ *
81
+ * @ignore
82
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
83
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
84
+ */fP.create=function(e,t){if(cP[e]){var r=new uP(e,t);return r.setFormat(e),r.setModule(new cP[e](t)),r}throw new Error("create("+e+"): format not registered")},fP.registerFormat=function(e,t){if(cP[e])throw new Error("register("+e+"): format already registered");if("function"!=typeof t)throw new Error("register("+e+"): format module invalid");if("function"!=typeof t.prototype.append||"function"!=typeof t.prototype.finalize)throw new Error("register("+e+"): format module missing methods");cP[e]=t},fP.isRegisteredFormat=function(e){return!!cP[e]},fP.registerFormat("zip",ZN),fP.registerFormat("tar",nP),fP.registerFormat("json",hP);var dP=fP;var pP=class{constructor(){this._values=[],this._totalRefs=0,this._hash=Object.create(null)}get count(){return this._values.length}get values(){return this._values}get totalRefs(){return this._totalRefs}getString(e){return this._values[e]}add(e){let t=this._hash[e];return void 0===t&&(t=this._hash[e]=this._values.length,this._values.push(e)),this._totalRefs++,t}};const mP=Cl,gP=$f;class yP{constructor(e){this.writer=e}push(e){this.writer.addHyperlink(e)}}var vP=class{constructor(e){this.id=e.id,this.count=0,this._hyperlinks=[],this._workbook=e.workbook}get stream(){return this._stream||(this._stream=this._workbook._openStream(`/xl/worksheets/_rels/sheet${this.id}.xml.rels`)),this._stream}get length(){return this._hyperlinks.length}each(e){return this._hyperlinks.forEach(e)}get hyperlinksProxy(){return this._hyperlinksProxy||(this._hyperlinksProxy=new yP(this))}addHyperlink(e){const t={Target:e.target,Type:gP.Hyperlink,TargetMode:"External"},r=this._writeRelationship(t);this._hyperlinks.push({rId:r,address:e.address})}addMedia(e){return this._writeRelationship(e)}addRelationship(e){return this._writeRelationship(e)}commit(){this.count&&(this._writeClose(),this.stream.end())}_writeOpen(){this.stream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">')}_writeRelationship(e){this.count||this._writeOpen();const t="rId"+ ++this.count;return e.TargetMode?this.stream.write(`<Relationship Id="${t}" Type="${e.Type}" Target="${mP.xmlEncode(e.Target)}" TargetMode="${e.TargetMode}"/>`):this.stream.write(`<Relationship Id="${t}" Type="${e.Type}" Target="${e.Target}"/>`),t}_writeClose(){this.stream.write("</Relationships>")}};const _P=Jl,bP=$f,wP=T,xP=xv,kP=Xv;var SP=class{constructor(e,t,r){this.id=r.id,this.count=0,this._worksheet=e,this._workbook=r.workbook,this._sheetRelsWriter=t}get commentsStream(){return this._commentsStream||(this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`)),this._commentsStream}get vmlStream(){return this._vmlStream||(this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`)),this._vmlStream}_addRelationships(){const e={Type:bP.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship(e);const t={Type:bP.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(t)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment(e,t){const r=new xP,n=new _P;r.render(n,e),this.commentsStream.write(n.xml);const i=new kP,s=new _P;i.render(s,e,t),this.vmlStream.write(s.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments(e){e&&e.length&&(this.startedData||(this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0),e.forEach((e=>{e.refAddress=wP.decodeAddress(e.ref)})),e.forEach((e=>{this._writeComment(e,this.count),this.count+=1})))}commit(){this.count&&(this._writeClose(),this.commentsStream.end(),this.vmlStream.end())}};const EP=k,TP=$f,CP=T,OP=he,RP=O,AP=Z,NP=Q,IP=vP,PP=SP,FP=oe,DP=new Ol,jP=Qh,MP=Ad,LP=Pd,BP=od,zP=nd,$P=ud,HP=Md,UP=Hd,VP=Wd,WP=Qd,qP=sp,XP=ap,ZP=sm,GP=vp,YP=gp,KP={dataValidations:new bd,sheetProperties:new MP,sheetFormatProperties:new LP,columns:new jP({tag:"cols",length:!1,childXform:new BP}),row:new zP,hyperlinks:new jP({tag:"hyperlinks",length:!1,childXform:new $P}),sheetViews:new jP({tag:"sheetViews",length:!1,childXform:new HP}),sheetProtection:new UP,pageMargins:new VP,pageSeteup:new WP,autoFilter:new qP,picture:new XP,conditionalFormattings:new ZP,headerFooter:new GP,rowBreaks:new YP};var QP=class{constructor(e){this.id=e.id,this.name=e.name||`Sheet${this.id}`,this.state=e.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new IP(e),this._sheetCommentsWriter=new PP(this,this._sheetRelsWriter,e),this._dimensions=new RP,this._rowZero=1,this.committed=!1,this.dataValidations=new FP,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.useSharedStrings=e.useSharedStrings||!1,this._workbook=e.workbook,this.hasComments=!1,this._views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get workbook(){return this._workbook}get stream(){return this._stream||(this._stream=this._workbook._openStream(`/xl/worksheets/sheet${this.id}.xml`),this._stream.pause()),this._stream}destroy(){throw new Error("Invalid Operation: destroy")}commit(){this.committed||(this._rows.forEach((e=>{e&&this._writeRow(e)})),this._rows=null,this.startedData||this._writeOpenSheetData(),this._writeCloseSheetData(),this._writeAutoFilter(),this._writeMergeCells(),this._writeHyperlinks(),this._writeConditionalFormatting(),this._writeDataValidations(),this._writeSheetProtection(),this._writePageMargins(),this._writePageSetup(),this._writeBackground(),this._writeHeaderFooter(),this._writeRowBreaks(),this._writeLegacyData(),this._writeCloseWorksheet(),this.stream.end(),this._sheetCommentsWriter.commit(),this._sheetRelsWriter.commit(),this.committed=!0)}get dimensions(){return this._dimensions}get views(){return this._views}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce(((e,t)=>{const r=(t.header?1:t.headers&&t.headers.length)||0;return Math.max(e,r)}),0);let t=1;const r=this._columns=[];e.forEach((e=>{const n=new NP(this,t++,!1);r.push(n),n.defn=e}))}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){EP.each(this._keys,e)}getColumn(e){if("string"==typeof e){const t=this._keys[e];if(t)return t;e=CP.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new NP(this,t++))}return this._columns[e-1]}get _nextRow(){return this._rowZero+this._rows.length}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){const e=this._nextRow;for(let r=this._rowZero;r<e;r++)t(this.getRow(r),r)}else this._rows.forEach((e=>{e.hasValues&&t(e,e.number)}))}_commitRow(e){let t=!1;for(;this._rows.length&&!t;){const r=this._rows.shift();this._rowZero++,r&&(this._writeRow(r),t=r.number===e.number,this._rowZero=r.number+1)}}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){const t=e-this._rowZero;return this._rows[t]}getRow(e){const t=e-this._rowZero;if(t<0)throw new Error("Out of bounds: this row has been committed");let r=this._rows[t];return r||(this._rows[t]=r=new AP(this,e)),r}addRow(e){const t=new AP(this,this._nextRow);return this._rows[t.number-this._rowZero]=t,t.values=e,t}findCell(e,t){const r=CP.getAddress(e,t),n=this.findRow(r.row);return n?n.findCell(r.column):void 0}getCell(e,t){const r=CP.getAddress(e,t);return this.getRow(r.row).getCellEx(r)}mergeCells(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=new RP(t);this._merges.forEach((e=>{if(e.intersects(n))throw new Error("Cannot merge already merged cells")}));const i=this.getCell(n.top,n.left);for(let e=n.top;e<=n.bottom;e++)for(let t=n.left;t<=n.right;t++)(e>n.top||t>n.left)&&this.getCell(e,t).merge(i);this._merges.push(n)}addConditionalFormatting(e){this.conditionalFormatting.push(e)}removeConditionalFormatting(e){"number"==typeof e?this.conditionalFormatting.splice(e,1):this.conditionalFormatting=e instanceof Function?this.conditionalFormatting.filter(e):[]}addBackgroundImage(e){this._background={imageId:e}}getBackgroundImageId(){return this._background&&this._background.imageId}protect(e,t){return new Promise((r=>{this.sheetProtection={sheet:!0},t&&"spinCount"in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=OP.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=t&&"spinCount"in t?t.spinCount:1e5,this.sheetProtection.hashValue=OP.convertPasswordToHash(e,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&"spinCount"in t&&delete this.sheetProtection.spinCount),r()}))}unprotect(){this.sheetProtection=null}_write(e){DP.reset(),DP.addText(e),this.stream.write(DP)}_writeSheetProperties(e,t,r){const n={outlineProperties:t&&t.outlineProperties,tabColor:t&&t.tabColor,pageSetup:r&&r.fitToPage?{fitToPage:r.fitToPage}:void 0};e.addText(KP.sheetProperties.toXml(n))}_writeSheetFormatProperties(e,t){const r=t?{defaultRowHeight:t.defaultRowHeight,dyDescent:t.dyDescent,outlineLevelCol:t.outlineLevelCol,outlineLevelRow:t.outlineLevelRow}:void 0;t.defaultColWidth&&(r.defaultColWidth=t.defaultColWidth),e.addText(KP.sheetFormatProperties.toXml(r))}_writeOpenWorksheet(){DP.reset(),DP.addText('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),DP.addText('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'),this._writeSheetProperties(DP,this.properties,this.pageSetup),DP.addText(KP.sheetViews.toXml(this.views)),this._writeSheetFormatProperties(DP,this.properties),this.stream.write(DP)}_writeColumns(){const e=NP.toModel(this.columns);e&&(KP.columns.prepare(e,{styles:this._workbook.styles}),this.stream.write(KP.columns.toXml(e)))}_writeOpenSheetData(){this._write("<sheetData>")}_writeRow(e){if(this.startedData||(this._writeColumns(),this._writeOpenSheetData(),this.startedData=!0),e.hasValues||e.height){const{model:t}=e,r={styles:this._workbook.styles,sharedStrings:this.useSharedStrings?this._workbook.sharedStrings:void 0,hyperlinks:this._sheetRelsWriter.hyperlinksProxy,merges:this._merges,formulae:this._formulae,siFormulae:this._siFormulae,comments:[]};KP.row.prepare(t,r),this.stream.write(KP.row.toXml(t)),r.comments.length&&(this.hasComments=!0,this._sheetCommentsWriter.addComments(r.comments))}}_writeCloseSheetData(){this._write("</sheetData>")}_writeMergeCells(){this._merges.length&&(DP.reset(),DP.addText(`<mergeCells count="${this._merges.length}">`),this._merges.forEach((e=>{DP.addText(`<mergeCell ref="${e}"/>`)})),DP.addText("</mergeCells>"),this.stream.write(DP))}_writeHyperlinks(){this.stream.write(KP.hyperlinks.toXml(this._sheetRelsWriter._hyperlinks))}_writeConditionalFormatting(){const e={styles:this._workbook.styles};KP.conditionalFormattings.prepare(this.conditionalFormatting,e),this.stream.write(KP.conditionalFormattings.toXml(this.conditionalFormatting))}_writeRowBreaks(){this.stream.write(KP.rowBreaks.toXml(this.rowBreaks))}_writeDataValidations(){this.stream.write(KP.dataValidations.toXml(this.dataValidations.model))}_writeSheetProtection(){this.stream.write(KP.sheetProtection.toXml(this.sheetProtection))}_writePageMargins(){this.stream.write(KP.pageMargins.toXml(this.pageSetup.margins))}_writePageSetup(){this.stream.write(KP.pageSeteup.toXml(this.pageSetup))}_writeHeaderFooter(){this.stream.write(KP.headerFooter.toXml(this.headerFooter))}_writeAutoFilter(){this.stream.write(KP.autoFilter.toXml(this.autoFilter))}_writeBackground(){if(this._background){if(void 0!==this._background.imageId){const e=this._workbook.getImage(this._background.imageId),t=this._sheetRelsWriter.addMedia({Target:`../media/${e.name}`,Type:TP.Image});this._background={...this._background,rId:t}}this.stream.write(KP.picture.toXml({rId:this._background.rId}))}}_writeLegacyData(){this.hasComments&&(DP.reset(),DP.addText(`<legacyDrawing r:id="${this._sheetCommentsWriter.vmlRelId}"/>`),this.stream.write(DP))}_writeDimensions(){}_writeCloseWorksheet(){this._write("</worksheet>")}};const JP=r,eF=dP,tF=Ml,rF=$f,nF=mc,iF=pP,sF=Le,oF=Sc,aF=Kc,lF=tf,hF=df,uF=zf,cF=Vc,fF=QP,dF=Jv;var pF=class{constructor(e){e=e||{},this.created=e.created||new Date,this.modified=e.modified||this.created,this.creator=e.creator||"ExcelJS",this.lastModifiedBy=e.lastModifiedBy||"ExcelJS",this.lastPrinted=e.lastPrinted,this.useSharedStrings=e.useSharedStrings||!1,this.sharedStrings=new iF,this.styles=e.useStyles?new nF(!0):new nF.Mock(!0),this._definedNames=new sF,this._worksheets=[],this.views=[],this.zipOptions=e.zip,this.media=[],this.commentRefs=[],this.zip=eF("zip",this.zipOptions),e.stream?this.stream=e.stream:e.filename?this.stream=JP.createWriteStream(e.filename):this.stream=new tF,this.zip.pipe(this.stream),this.promise=Promise.all([this.addThemes(),this.addOfficeRels()])}get definedNames(){return this._definedNames}_openStream(e){const t=new tF({bufSize:65536,batch:!0});return this.zip.append(t,{name:e}),t.on("finish",(()=>{t.emit("zipped")})),t}_commitWorksheets(){const e=this._worksheets.map((function(e){return e.committed?Promise.resolve():new Promise((t=>{e.stream.on("zipped",(()=>{t()})),e.commit()}))}));return e.length?Promise.all(e):Promise.resolve()}async commit(){return await this.promise,await this.addMedia(),await this._commitWorksheets(),await Promise.all([this.addContentTypes(),this.addApp(),this.addCore(),this.addSharedStrings(),this.addStyles(),this.addWorkbookRels()]),await this.addWorkbook(),this._finalize()}get nextId(){let e;for(e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addImage(e){const t=this.media.length,r=Object.assign({},e,{type:"image",name:`image${t}.${e.extension}`});return this.media.push(r),t}getImage(e){return this.media[e]}addWorksheet(e,t){const r=void 0!==(t=t||{}).useSharedStrings?t.useSharedStrings:this.useSharedStrings;t.tabColor&&(t.properties=Object.assign({tabColor:t.tabColor},t.properties));const n=this.nextId,i=new fF({id:n,name:e=e||`sheet${n}`,workbook:this,useSharedStrings:r,properties:t.properties,state:t.state,pageSetup:t.pageSetup,views:t.views,autoFilter:t.autoFilter,headerFooter:t.headerFooter});return this._worksheets[n]=i,i}getWorksheet(e){return void 0===e?this._worksheets.find((()=>!0)):"number"==typeof e?this._worksheets[e]:"string"==typeof e?this._worksheets.find((t=>t&&t.name===e)):void 0}addStyles(){return new Promise((e=>{this.zip.append(this.styles.xml,{name:"xl/styles.xml"}),e()}))}addThemes(){return new Promise((e=>{this.zip.append(dF,{name:"xl/theme/theme1.xml"}),e()}))}addOfficeRels(){return new Promise((e=>{const t=(new aF).toXml([{Id:"rId1",Type:rF.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:rF.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:rF.ExtenderProperties,Target:"docProps/app.xml"}]);this.zip.append(t,{name:"/_rels/.rels"}),e()}))}addContentTypes(){return new Promise((e=>{const t={worksheets:this._worksheets.filter(Boolean),sharedStrings:this.sharedStrings,commentRefs:this.commentRefs,media:this.media},r=(new lF).toXml(t);this.zip.append(r,{name:"[Content_Types].xml"}),e()}))}addMedia(){return Promise.all(this.media.map((e=>{if("image"===e.type){const t=`xl/media/${e.name}`;if(e.filename)return this.zip.file(e.filename,{name:t});if(e.buffer)return this.zip.append(e.buffer,{name:t});if(e.base64){const r=e.base64,n=r.substring(r.indexOf(",")+1);return this.zip.append(n,{name:t,base64:!0})}}throw new Error("Unsupported media")})))}addApp(){return new Promise((e=>{const t={worksheets:this._worksheets.filter(Boolean)},r=(new hF).toXml(t);this.zip.append(r,{name:"docProps/app.xml"}),e()}))}addCore(){return new Promise((e=>{const t=(new oF).toXml(this);this.zip.append(t,{name:"docProps/core.xml"}),e()}))}addSharedStrings(){return this.sharedStrings.count?new Promise((e=>{const t=(new cF).toXml(this.sharedStrings);this.zip.append(t,{name:"/xl/sharedStrings.xml"}),e()})):Promise.resolve()}addWorkbookRels(){let e=1;const t=[{Id:"rId"+e++,Type:rF.Styles,Target:"styles.xml"},{Id:"rId"+e++,Type:rF.Theme,Target:"theme/theme1.xml"}];return this.sharedStrings.count&&t.push({Id:"rId"+e++,Type:rF.SharedStrings,Target:"sharedStrings.xml"}),this._worksheets.forEach((r=>{r&&(r.rId="rId"+e++,t.push({Id:r.rId,Type:rF.Worksheet,Target:`worksheets/sheet${r.id}.xml`}))})),new Promise((e=>{const r=(new aF).toXml(t);this.zip.append(r,{name:"/xl/_rels/workbook.xml.rels"}),e()}))}addWorkbook(){const{zip:e}=this,t={worksheets:this._worksheets.filter(Boolean),definedNames:this._definedNames.model,views:this.views,properties:{},calcProperties:{}};return new Promise((r=>{const n=new uF;n.prepare(t),e.append(n.toXml(t),{name:"/xl/workbook.xml"}),r()}))}_finalize(){return new Promise(((e,t)=>{this.stream.on("error",t),this.stream.on("finish",(()=>{e(this)})),this.zip.on("error",t),this.zip.finalize()}))}},mF={};i.listenerCount;var gF=function(e){return(process&&process.version?process.version:"v5.0.0").split(".")[0].replace("v","")<6?new Buffer(e):Buffer.from(e)};function yF(e,t){"string"==typeof e||e instanceof String?e=gF(e):("number"==typeof e||e instanceof Number)&&(e=gF([e]));for(var r=e.length,n=t=t||this.length-r;n>=0;n--){for(var i=!1,s=0;s<r;s++)if(this[n+s]!=e[s]){i=!0;break}if(!i)return n}return-1}Buffer.prototype.indexOf||(Buffer.prototype.indexOf=function(e,t){t=t||0,"string"==typeof e||e instanceof String?e=gF(e):("number"==typeof e||e instanceof Number)&&(e=gF([e]));for(var r=e.length,n=t;n<=this.length-r;n++){for(var i=!1,s=0;s<r;s++)if(this[n+s]!=e[s]){i=!0;break}if(!i)return n}return-1}),Buffer.prototype.lastIndexOf?-1===gF("ABC").lastIndexOf("ABC")&&(Buffer.prototype.lastIndexOf=yF):Buffer.prototype.lastIndexOf=yF;var vF={exports:{}},_F=bF;function bF(e){if(!(this instanceof bF))return new bF(e);this.value=e}function wF(e,t,r){var n=[],i=[],s=!0;return function e(o){var a=r?xF(o):o,l={},h={node:a,node_:o,path:[].concat(n),parent:i.slice(-1)[0],key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(e){h.isRoot||(h.parent.node[h.key]=e),h.node=e},delete:function(){delete h.parent.node[h.key]},remove:function(){Array.isArray(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key]},before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){s=!1}};if(!s)return h;if("object"==typeof a&&null!==a){h.isLeaf=0==Object.keys(a).length;for(var u=0;u<i.length;u++)if(i[u].node_===o){h.circular=i[u];break}}else h.isLeaf=!0;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot;var c=t.call(h,h.node);if(void 0!==c&&h.update&&h.update(c),l.before&&l.before.call(h,h.node),"object"==typeof h.node&&null!==h.node&&!h.circular){i.push(h);var f=Object.keys(h.node);f.forEach((function(t,i){n.push(t),l.pre&&l.pre.call(h,h.node[t],t);var s=e(h.node[t]);r&&Object.hasOwnProperty.call(h.node,t)&&(h.node[t]=s.node),s.isLast=i==f.length-1,s.isFirst=0==i,l.post&&l.post.call(h,s),n.pop()})),i.pop()}return l.after&&l.after.call(h,h.node),h}(e).node}function xF(e){var t;return"object"==typeof e&&null!==e?(t=Array.isArray(e)?[]:e instanceof Date?new Date(e):e instanceof Boolean?new Boolean(e):e instanceof Number?new Number(e):e instanceof String?new String(e):Object.create(Object.getPrototypeOf(e)),Object.keys(e).forEach((function(r){t[r]=e[r]})),t):e}bF.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var n=e[r];if(!Object.hasOwnProperty.call(t,n)){t=void 0;break}t=t[n]}return t},bF.prototype.set=function(e,t){for(var r=this.value,n=0;n<e.length-1;n++){var i=e[n];Object.hasOwnProperty.call(r,i)||(r[i]={}),r=r[i]}return r[e[n]]=t,t},bF.prototype.map=function(e){return wF(this.value,e,!0)},bF.prototype.forEach=function(e){return this.value=wF(this.value,e,!1),this.value},bF.prototype.reduce=function(e,t){var r=1===arguments.length,n=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(n=e.call(this,n,t))})),n},bF.prototype.deepEqual=function(e){if(1!==arguments.length)throw new Error("deepEqual requires exactly one object to compare against");var t=!0,r=e;return this.forEach((function(n){var i=function(){t=!1}.bind(this);if(!this.isRoot){if("object"!=typeof r)return i();r=r[this.key]}var s=r;this.post((function(){r=s}));var o=function(e){return Object.prototype.toString.call(e)};if(this.circular)bF(e).get(this.circular.path)!==s&&i();else if(typeof s!=typeof n)i();else if(null===s||null===n||void 0===s||void 0===n)s!==n&&i();else if(s.__proto__!==n.__proto__)i();else if(s===n);else if("function"==typeof s)s instanceof RegExp?s.toString()!=n.toString()&&i():s!==n&&i();else if("object"==typeof s)if("[object Arguments]"===o(n)||"[object Arguments]"===o(s))o(s)!==o(n)&&i();else if(s instanceof Date||n instanceof Date)s instanceof Date&&n instanceof Date&&s.getTime()===n.getTime()||i();else{var a=Object.keys(s),l=Object.keys(n);if(a.length!==l.length)return i();for(var h=0;h<a.length;h++){var u=a[h];Object.hasOwnProperty.call(n,u)||i()}}})),t},bF.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},bF.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},bF.prototype.clone=function(){var e=[],t=[];return function r(n){for(var i=0;i<e.length;i++)if(e[i]===n)return t[i];if("object"==typeof n&&null!==n){var s=xF(n);return e.push(n),t.push(s),Object.keys(n).forEach((function(e){s[e]=r(n[e])})),e.pop(),t.pop(),s}return n}(this.value)},Object.keys(bF.prototype).forEach((function(e){bF[e]=function(t){var r=[].slice.call(arguments,1),n=bF(t);return n[e].apply(n,r)}}));var kF=_F,SF=i.EventEmitter,EF=TF;function TF(e){var t=TF.saw(e,{}),r=e.call(t.handlers,t);return void 0!==r&&(t.handlers=r),t.record(),t.chain()}TF.light=function(e){var t=TF.saw(e,{}),r=e.call(t.handlers,t);return void 0!==r&&(t.handlers=r),t.chain()},TF.saw=function(e,t){var r=new SF;return r.handlers=t,r.actions=[],r.chain=function(){var e=kF(r.handlers).map((function(t){if(this.isRoot)return t;var n=this.path;"function"==typeof t&&this.update((function(){return r.actions.push({path:n,args:[].slice.call(arguments)}),e}))}));return process.nextTick((function(){r.emit("begin"),r.next()})),e},r.pop=function(){return r.actions.shift()},r.next=function(){var e=r.pop();if(e){if(!e.trap){var t=r.handlers;e.path.forEach((function(e){t=t[e]})),t.apply(r.handlers,e.args)}}else r.emit("end")},r.nest=function(t){var n=[].slice.call(arguments,1),i=!0;if("boolean"==typeof t){i=t;t=n.shift()}var s=TF.saw(e,{}),o=e.call(s.handlers,s);void 0!==o&&(s.handlers=o),void 0!==r.step&&s.record(),t.apply(s.chain(),n),!1!==i&&s.on("end",r.next)},r.record=function(){!function(e){e.step=0,e.pop=function(){return e.actions[e.step++]},e.trap=function(t,r){var n=Array.isArray(t)?t:[t];e.actions.push({path:n,step:e.step,cb:r,trap:!0})},e.down=function(t){var r=(Array.isArray(t)?t:[t]).join("/"),n=e.actions.slice(e.step).map((function(t){return!(t.trap&&t.step<=e.step)&&t.path.join("/")==r})).indexOf(!0);n>=0?e.step+=n:e.step=e.actions.length;var i=e.actions[e.step-1];i&&i.trap?(e.step=i.step,i.cb()):e.next()},e.jump=function(t){e.step=t,e.next()}}(r)},["trap","down","jump"].forEach((function(e){r[e]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}})),r};var CF=OF;function OF(e){if(!(this instanceof OF))return new OF(e);this.buffers=e||[],this.length=this.buffers.reduce((function(e,t){return e+t.length}),0)}OF.prototype.push=function(){for(var e=0;e<arguments.length;e++)if(!Buffer.isBuffer(arguments[e]))throw new TypeError("Tried to push a non-buffer");for(e=0;e<arguments.length;e++){var t=arguments[e];this.buffers.push(t),this.length+=t.length}return this.length},OF.prototype.unshift=function(){for(var e=0;e<arguments.length;e++)if(!Buffer.isBuffer(arguments[e]))throw new TypeError("Tried to unshift a non-buffer");for(e=0;e<arguments.length;e++){var t=arguments[e];this.buffers.unshift(t),this.length+=t.length}return this.length},OF.prototype.copy=function(e,t,r,n){return this.slice(r,n).copy(e,t,0,n-r)},OF.prototype.splice=function(e,t){var r=this.buffers,n=e>=0?e:this.length-e,i=[].slice.call(arguments,2);(void 0===t||t>this.length-n)&&(t=this.length-n);for(e=0;e<i.length;e++)this.length+=i[e].length;for(var s=new OF,o=0,a=0;a<r.length&&o+r[a].length<n;a++)o+=r[a].length;if(n-o>0){var l=n-o;if(l+t<r[a].length){s.push(r[a].slice(l,l+t));var h=r[a],u=new Buffer(l);for(e=0;e<l;e++)u[e]=h[e];var c=new Buffer(h.length-l-t);for(e=l+t;e<h.length;e++)c[e-t-l]=h[e];if(i.length>0){var f=i.slice();f.unshift(u),f.push(c),r.splice.apply(r,[a,1].concat(f)),a+=f.length,i=[]}else r.splice(a,1,u,c),a+=2}else s.push(r[a].slice(l)),r[a]=r[a].slice(0,l),a++}for(i.length>0&&(r.splice.apply(r,[a,0].concat(i)),a+=i.length);s.length<t;){var d=r[a],p=d.length,m=Math.min(p,t-s.length);m===p?(s.push(d),r.splice(a,1)):(s.push(d.slice(0,m)),r[a]=r[a].slice(m))}return this.length-=s.length,s},OF.prototype.slice=function(e,t){var r=this.buffers;void 0===t&&(t=this.length),void 0===e&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=0;i<r.length&&n+r[i].length<=e;i++)n+=r[i].length;for(var s=new Buffer(t-e),o=0,a=i;o<t-e&&a<r.length;a++){var l=r[a].length,h=0===o?e-n:0,u=o+l>=t-e?Math.min(h+(t-e)-o,l):l;r[a].copy(s,o,h,u),o+=u-h}return s},OF.prototype.pos=function(e){if(e<0||e>=this.length)throw new Error("oob");for(var t=e,r=0,n=null;;){if(t<(n=this.buffers[r]).length)return{buf:r,offset:t};t-=n.length,r++}},OF.prototype.get=function(e){var t=this.pos(e);return this.buffers[t.buf].get(t.offset)},OF.prototype.set=function(e,t){var r=this.pos(e);return this.buffers[r.buf].set(r.offset,t)},OF.prototype.indexOf=function(e,t){if("string"==typeof e)e=new Buffer(e);else if(!(e instanceof Buffer))throw new Error("Invalid type for a search string");if(!e.length)return 0;if(!this.length)return-1;var r,n=0,i=0,s=0,o=0;if(t){var a=this.pos(t);n=a.buf,i=a.offset,o=t}for(;;){for(;i>=this.buffers[n].length;)if(i=0,++n>=this.buffers.length)return-1;if(this.buffers[n][i]==e[s]){if(0==s&&(r={i:n,j:i,pos:o}),++s==e.length)return r.pos}else 0!=s&&(n=r.i,i=r.j,o=r.pos,s=0);i++,o++}},OF.prototype.toBuffer=function(){return this.slice()},OF.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)};var RF=function(e){function t(e,t){var n=r.store,i=e.split(".");i.slice(0,-1).forEach((function(e){void 0===n[e]&&(n[e]={}),n=n[e]}));var s=i[i.length-1];return 1==arguments.length?n[s]:n[s]=t}var r={get:function(e){return t(e)},set:function(e,r){return t(e,r)},store:e||{}};return r};!function(e,t){var r=EF,s=i.EventEmitter,o=CF,a=RF,l=n.Stream;function h(e){for(var t=0,r=0;r<e.length;r++)t+=Math.pow(256,r)*e[r];return t}function u(e){for(var t=0,r=0;r<e.length;r++)t+=Math.pow(256,e.length-r-1)*e[r];return t}function c(e){var t=u(e);return 128==(128&e[0])&&(t-=Math.pow(256,e.length)),t}function f(e){var t=h(e);return 128==(128&e[e.length-1])&&(t-=Math.pow(256,e.length)),t}function d(e){var t={};return[1,2,4,8].forEach((function(r){var n=8*r;t["word"+n+"le"]=t["word"+n+"lu"]=e(r,h),t["word"+n+"ls"]=e(r,f),t["word"+n+"be"]=t["word"+n+"bu"]=e(r,u),t["word"+n+"bs"]=e(r,c)})),t.word8=t.word8u=t.word8be,t.word8s=t.word8bs,t}(t=e.exports=function(e,r){if(Buffer.isBuffer(e))return t.parse(e);var n=t.stream();return e&&e.pipe?e.pipe(n):e&&(e.on(r||"data",(function(e){n.write(e)})),e.on("end",(function(){n.end()}))),n}).stream=function(e){if(e)return t.apply(null,arguments);var n=null;function i(e,t,r){n={bytes:e,skip:r,cb:function(e){n=null,t(e)}},u()}var h=null;function u(){if(n)if("function"==typeof n)n();else{var e,t=h+n.bytes;if(f.length>=t)null==h?(e=f.splice(0,t),n.skip||(e=e.slice())):(n.skip||(e=f.slice(h,t)),h=t),n.skip?n.cb():n.cb(e)}else g&&(m=!0)}var c=r.light((function(e){function t(){m||e.next()}var r=d((function(e,r){return function(n){i(e,(function(e){p.set(n,r(e)),t()}))}}));return r.tap=function(t){e.nest(t,p.store)},r.into=function(t,r){p.get(t)||p.set(t,{});var n=p;p=a(n.get(t)),e.nest((function(){r.apply(this,arguments),this.tap((function(){p=n}))}),p.store)},r.flush=function(){p.store={},t()},r.loop=function(r){var n=!1;e.nest(!1,(function i(){this.vars=p.store,r.call(this,(function(){n=!0,t()}),p.store),this.tap(function(){n?e.next():i.call(this)}.bind(this))}),p.store)},r.buffer=function(e,r){"string"==typeof r&&(r=p.get(r)),i(r,(function(r){p.set(e,r),t()}))},r.skip=function(e){"string"==typeof e&&(e=p.get(e)),i(e,(function(){t()}))},r.scan=function(e,r){if("string"==typeof r)r=new Buffer(r);else if(!Buffer.isBuffer(r))throw new Error("search must be a Buffer or a string");var i=0;n=function(){var s=f.indexOf(r,h+i),o=s-h-i;-1!==s?(n=null,null!=h?(p.set(e,f.slice(h,h+i+o)),h+=i+o+r.length):(p.set(e,f.slice(0,i+o)),f.splice(0,i+o+r.length)),t(),u()):o=Math.max(f.length-r.length-h-i,0),i+=o},u()},r.peek=function(t){h=0,e.nest((function(){t.call(this,p.store),this.tap((function(){h=null}))}))},r}));c.writable=!0;var f=o();c.write=function(e){f.push(e),u()};var p=a(),m=!1,g=!1;return c.end=function(){g=!0},c.pipe=l.prototype.pipe,Object.getOwnPropertyNames(s.prototype).forEach((function(e){c[e]=s.prototype[e]})),c},t.parse=function(e){var t=d((function(i,s){return function(o){if(r+i<=e.length){var a=e.slice(r,r+i);r+=i,n.set(o,s(a))}else n.set(o,null);return t}})),r=0,n=a();return t.vars=n.store,t.tap=function(e){return e.call(t,n.store),t},t.into=function(e,r){n.get(e)||n.set(e,{});var i=n;return n=a(i.get(e)),r.call(t,n.store),n=i,t},t.loop=function(e){for(var r=!1,i=function(){r=!0};!1===r;)e.call(t,i,n.store);return t},t.buffer=function(i,s){"string"==typeof s&&(s=n.get(s));var o=e.slice(r,Math.min(e.length,r+s));return r+=s,n.set(i,o),t},t.skip=function(e){return"string"==typeof e&&(e=n.get(e)),r+=e,t},t.scan=function(i,s){if("string"==typeof s)s=new Buffer(s);else if(!Buffer.isBuffer(s))throw new Error("search must be a Buffer or a string");n.set(i,null);for(var o=0;o+r<=e.length-s.length+1;o++){for(var a=0;a<s.length&&e[r+o+a]===s[a];a++);if(a===s.length)break}return n.set(i,e.slice(r,r+o)),r+=o+s.length,t},t.peek=function(e){var i=r;return e.call(t,n.store),r=i,t},t.flush=function(){return n.store={},t},t.eof=function(){return r>=e.length},t}}(vF,vF.exports);var AF,NF,IF,PF=vF.exports,FF={exports:{}},DF={exports:{}};function jF(){if(AF)return DF.exports;AF=1;var e=function(){return void 0===this}();if(e)DF.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!(r&&!r.writable&&!r.set)}};else{var t={}.hasOwnProperty,r={}.toString,n={}.constructor.prototype,i=function(e){var r=[];for(var n in e)t.call(e,n)&&r.push(n);return r};DF.exports={isArray:function(e){try{return"[object Array]"===r.call(e)}catch(e){return!1}},keys:i,names:i,defineProperty:function(e,t,r){return e[t]=r.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return n}},isES5:e,propertyIsWritable:function(){return!0}}}return DF.exports}function MF(){if(IF)return NF;IF=1;var e,t=jF(),r="undefined"==typeof navigator,n={e:{}},i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==p||void 0!==p?p:null;function s(){try{var t=e;return e=null,t.apply(this,arguments)}catch(e){return n.e=e,n}}function o(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function a(e,r,n){if(o(e))return e;var i={value:n,configurable:!0,enumerable:!1,writable:!0};return t.defineProperty(e,r,i),e}var l=function(){var e=[Array.prototype,Object.prototype,Function.prototype],r=function(t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1};if(t.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var i=[],s=Object.create(null);null!=e&&!r(e);){var o;try{o=n(e)}catch(e){return i}for(var a=0;a<o.length;++a){var l=o[a];if(!s[l]){s[l]=!0;var h=Object.getOwnPropertyDescriptor(e,l);null!=h&&null==h.get&&null==h.set&&i.push(l)}}e=t.getPrototypeOf(e)}return i}}var i={}.hasOwnProperty;return function(t){if(r(t))return[];var n=[];e:for(var s in t)if(i.call(t,s))n.push(s);else{for(var o=0;o<e.length;++o)if(i.call(e[o],s))continue e;n.push(s)}return n}}(),h=/this\s*\.\s*\S+\s*=/;var u=/^[a-z$_][a-z$_0-9]*$/i;function c(e){try{return e+""}catch(e){return"[no string representation]"}}function f(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function d(e){return f(e)&&t.propertyIsWritable(e,"stack")}var m="stack"in new Error?function(e){return d(e)?e:new Error(c(e))}:function(e){if(d(e))return e;try{throw new Error(c(e))}catch(e){return e}};function g(e){return{}.toString.call(e)}var y=function(e){return t.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var v="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,r=[],n=e[Symbol.iterator]();!(t=n.next()).done;)r.push(t.value);return r};y=function(e){return t.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?v(e):null}}var _="undefined"!=typeof process&&"[object process]"===g(process).toLowerCase(),b="undefined"!=typeof process&&void 0!==process.env;var w={isClass:function(e){try{if("function"==typeof e){var r=t.names(e.prototype),n=t.isES5&&r.length>1,i=r.length>0&&!(1===r.length&&"constructor"===r[0]),s=h.test(e+"")&&t.names(e).length>0;if(n||i||s)return!0}return!1}catch(e){return!1}},isIdentifier:function(e){return u.test(e)},inheritedDataKeys:l,getDataPropertyOrDefault:function(e,r,n){if(!t.isES5)return{}.hasOwnProperty.call(e,r)?e[r]:void 0;var i=Object.getOwnPropertyDescriptor(e,r);return null!=i?null==i.get&&null==i.set?i.value:n:void 0},thrower:function(e){throw e},isArray:t.isArray,asArray:y,notEnumerableProp:a,isPrimitive:o,isObject:function(e){return"function"==typeof e||"object"==typeof e&&null!==e},isError:f,canEvaluate:r,errorObj:n,tryCatch:function(t){return e=t,s},inherits:function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype},withAppended:function(e,t){var r,n=e.length,i=new Array(n+1);for(r=0;r<n;++r)i[r]=e[r];return i[r]=t,i},maybeWrapAsError:function(e){return o(e)?new Error(c(e)):e},toFastProperties:function(e){return e},filledRange:function(e,t,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=t+i+r;return n},toString:c,canAttachTrace:d,ensureErrorObject:m,originatesFromRejection:function(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)},markAsOriginatingFromRejection:function(e){try{a(e,"isOperational",!0)}catch(e){}},classString:g,copyDescriptors:function(e,r,n){for(var i=t.names(e),s=0;s<i.length;++s){var o=i[s];if(n(o))try{t.defineProperty(r,o,t.getDescriptor(e,o))}catch(e){}}},hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:_,hasEnvVariables:b,env:function(e){return b?process.env[e]:void 0},global:i,getNativePromise:function(){if("function"==typeof Promise)try{var e=new Promise((function(){}));if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}},domainBind:function(e,t){return e.bind(t)}};w.isRecentNode=w.isNode&&function(){var e=process.versions.node.split(".").map(Number);return 0===e[0]&&e[1]>10||e[0]>0}(),w.isNode&&w.toFastProperties(process);try{throw new Error}catch(e){w.lastLineError=e}return NF=w}var LF,BF,zF,$F,HF,UF,VF,WF,qF,XF,ZF,GF,YF,KF,QF,JF,eD,tD,rD,nD,iD,sD,oD,aD,lD,hD,uD,cD,fD,dD,pD,mD,gD,yD,vD,_D,bD,wD,xD,kD,SD,ED,TD,CD,OD,RD,AD,ND,ID,PD,FD,DD,jD,MD,LD,BD,zD,$D,HD,UD,VD,WD,qD,XD,ZD={exports:{}};function GD(){if(BF)return LF;BF=1;var e,t=MF(),r=t.getNativePromise();if(t.isNode&&"undefined"==typeof MutationObserver){var n=p.setImmediate,i=process.nextTick;e=t.isRecentNode?function(e){n.call(p,e)}:function(e){i.call(process,e)}}else if("function"==typeof r&&"function"==typeof r.resolve){var s=r.resolve();e=function(e){s.then(e)}}else e="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){e.classList.toggle("foo"),r=!1})).observe(n,t);return function(i){var s=new MutationObserver((function(){s.disconnect(),i()}));s.observe(e,t),r||(r=!0,n.classList.toggle("foo"))}}();return LF=e}function YD(){if(HF)return ZD.exports;var e;HF=1;try{throw new Error}catch(t){e=t}var t=GD(),r=function(){if($F)return zF;function e(e){this._capacity=e,this._length=0,this._front=0}return $F=1,e.prototype._willBeOverCapacity=function(e){return this._capacity<e},e.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},e.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(e),this._pushOne(t),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var s=this._capacity-1;this[i+0&s]=e,this[i+1&s]=t,this[i+2&s]=r,this._length=n},e.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,r,n,i){for(var s=0;s<i;++s)r[s+n]=e[s+t],e[s+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},zF=e}(),n=MF();function i(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new r(16),this._normalQueue=new r(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=t}function s(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function o(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function a(e){this._normalQueue._pushOne(e),this._queueTick()}return i.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},i.prototype.hasCustomScheduler=function(){return this._customScheduler},i.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},i.prototype.disableTrampolineIfNecessary=function(){n.hasDevTools&&(this._trampolineEnabled=!1)},i.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},i.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},i.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout((function(){e(t)}),0);else try{this._schedule((function(){e(t)}))}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},n.hasDevTools?(i.prototype.invokeLater=function(e,t,r){this._trampolineEnabled?s.call(this,e,t,r):this._schedule((function(){setTimeout((function(){e.call(t,r)}),100)}))},i.prototype.invoke=function(e,t,r){this._trampolineEnabled?o.call(this,e,t,r):this._schedule((function(){e.call(t,r)}))},i.prototype.settlePromises=function(e){this._trampolineEnabled?a.call(this,e):this._schedule((function(){e._settlePromises()}))}):(i.prototype.invokeLater=s,i.prototype.invoke=o,i.prototype.settlePromises=a),i.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if("function"==typeof t){var r=e.shift(),n=e.shift();t.call(r,n)}else t._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},ZD.exports=i,ZD.exports.firstLineError=e,ZD.exports}function KD(){if(VF)return UF;VF=1;var e,t,r=jF(),n=r.freeze,i=MF(),s=i.inherits,o=i.notEnumerableProp;function a(e,t){function r(n){if(!(this instanceof r))return new r(n);o(this,"message","string"==typeof n?n:t),o(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return s(r,Error),r}var l=a("Warning","warning"),h=a("CancellationError","cancellation error"),u=a("TimeoutError","timeout error"),c=a("AggregateError","aggregate error");try{e=TypeError,t=RangeError}catch(r){e=a("TypeError","type error"),t=a("RangeError","range error")}for(var f="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),d=0;d<f.length;++d)"function"==typeof Array.prototype[f[d]]&&(c.prototype[f[d]]=Array.prototype[f[d]]);r.defineProperty(c.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),c.prototype.isOperational=!0;var p=0;function m(e){if(!(this instanceof m))return new m(e);o(this,"name","OperationalError"),o(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(o(this,"message",e.message),o(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}c.prototype.toString=function(){var e=Array(4*p+1).join(" "),t="\n"+e+"AggregateError of:\n";p++,e=Array(4*p+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),s=0;s<i.length;++s)i[s]=e+i[s];t+=(n=i.join("\n"))+"\n"}return p--,t},s(m,Error);var g=Error.__BluebirdErrorTypes__;return g||(g=n({CancellationError:h,TimeoutError:u,OperationalError:m,RejectionError:m,AggregateError:c}),r.defineProperty(Error,"__BluebirdErrorTypes__",{value:g,writable:!1,enumerable:!1,configurable:!1})),UF={Error:Error,TypeError:e,RangeError:t,CancellationError:g.CancellationError,OperationalError:g.OperationalError,TimeoutError:g.TimeoutError,AggregateError:g.AggregateError,Warning:l}}function QD(){return qF||(qF=1,WF=function(e,t){var r=MF(),n=r.errorObj,i=r.isObject;var s={}.hasOwnProperty;return function(o,a){if(i(o)){if(o instanceof e)return o;var l=function(e){try{return function(e){return e.then}(e)}catch(e){return n.e=e,n}}(o);if(l===n){a&&a._pushContext();var h=e.reject(l.e);return a&&a._popContext(),h}if("function"==typeof l){if(function(e){try{return s.call(e,"_promise0")}catch(e){return!1}}(o)){h=new e(t);return o._then(h._fulfill,h._reject,void 0,h,null),h}return function(i,s,o){var a=new e(t),l=a;o&&o._pushContext();a._captureStackTrace(),o&&o._popContext();var h=!0,u=r.tryCatch(s).call(i,c,f);h=!1,a&&u===n&&(a._rejectCallback(u.e,!0,!0),a=null);function c(e){a&&(a._resolveCallback(e),a=null)}function f(e){a&&(a._rejectCallback(e,h,!0),a=null)}return l}(o,l,a)}}return o}}),WF}function JD(){return QF||(QF=1,KF=function(e,t){var r,n,i,s=e._getDomain,o=e._async,a=KD().Warning,l=MF(),h=l.canAttachTrace,u=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,c=/\((?:timers\.js):\d+:\d+\)/,f=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,d=null,p=null,m=!1,g=!(0==l.env("BLUEBIRD_DEBUG")||!l.env("BLUEBIRD_DEBUG")&&"development"!==l.env("NODE_ENV")),y=!(0==l.env("BLUEBIRD_WARNINGS")||!g&&!l.env("BLUEBIRD_WARNINGS")),v=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!g&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),_=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(y||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){$("rejectionHandled",r,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),$("unhandledRejection",n,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(e,t,r){return M(e,t,r||this)},e.onPossiblyUnhandledRejection=function(e){var t=s();n="function"==typeof e?null===t?e:l.domainBind(t,e):void 0},e.onUnhandledRejectionHandled=function(e){var t=s();r="function"==typeof e?null===t?e:l.domainBind(t,e):void 0};var b=function(){};e.longStackTraces=function(){if(o.haveItemsQueued()&&!G.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!G.longStackTraces&&U()){var r=e.prototype._captureStackTrace,n=e.prototype._attachExtraTrace;G.longStackTraces=!0,b=function(){if(o.haveItemsQueued()&&!G.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=r,e.prototype._attachExtraTrace=n,t.deactivateLongStackTraces(),o.enableTrampoline(),G.longStackTraces=!1},e.prototype._captureStackTrace=D,e.prototype._attachExtraTrace=j,t.activateLongStackTraces(),o.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return G.longStackTraces&&U()};var w=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!l.global.dispatchEvent(r)}}if("function"==typeof Event){e=new Event("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r=new Event(e.toLowerCase(),{cancelable:!0});return r.detail=t,!l.global.dispatchEvent(r)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(e),function(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e.toLowerCase(),!1,!0,t),!l.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),x=l.isNode?function(){return process.emit.apply(process,arguments)}:l.global?function(e){var t="on"+e.toLowerCase(),r=l.global[t];return!!r&&(r.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function k(e,t){return{promise:t}}var S={promiseCreated:k,promiseFulfilled:k,promiseRejected:k,promiseResolved:k,promiseCancelled:k,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:k},E=function(e){var t=!1;try{t=x.apply(null,arguments)}catch(e){o.throwLater(e),t=!0}var r=!1;try{r=w(e,S[e].apply(null,arguments))}catch(e){o.throwLater(e),r=!0}return r||t};function T(){return!1}function C(e,t,r){var n=this;try{e(t,r,(function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+l.toString(e));n._attachCancellationCallback(e)}))}catch(e){return e}}function O(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?l.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function R(){return this._onCancelField}function A(e){this._onCancelField=e}function N(){this._cancellationParent=void 0,this._onCancelField=void 0}function I(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&b()),"warnings"in t){var r=t.warnings;G.warnings=!!r,_=G.warnings,l.isObject(r)&&"wForgottenReturn"in r&&(_=!!r.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!G.cancellation){if(o.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=N,e.prototype._propagateFrom=I,e.prototype._onCancel=R,e.prototype._setOnCancel=A,e.prototype._attachCancellationCallback=O,e.prototype._execute=C,P=I,G.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!G.monitoring?(G.monitoring=!0,e.prototype._fireEvent=E):!t.monitoring&&G.monitoring&&(G.monitoring=!1,e.prototype._fireEvent=T)),e},e.prototype._fireEvent=T,e.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};var P=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function F(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function D(){this._trace=new X(this._peekContext())}function j(e,t){if(h(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=B(e);l.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),l.notEnumerableProp(e,"__stackCleaned__",!0)}}}function M(t,r,n){if(G.warnings){var i,s=new a(t);if(r)n._attachExtraTrace(s);else if(G.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(s);else{var o=B(s);s.stack=o.message+"\n"+o.stack.join("\n")}E("warning",s)||z(s,"",!0)}}function L(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],i=" (No stack trace)"===n||d.test(n),s=i&&V(n);i&&!s&&(m&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function B(e){var t=e.stack,r=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r<t.length;++r){var n=t[r];if(" (No stack trace)"===n||d.test(n))break}return r>0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:L(t)}}function z(e,t,r){if("undefined"!=typeof console){var n;if(l.isObject(e)){var s=e.stack;n=t+p(s,e)}else n=t+String(e);"function"==typeof i&&i(n,r)}}function $(e,t,r,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){o.throwLater(e)}"unhandledRejection"===e?E(e,r,n)||i||z(r,"Unhandled rejection "):E(e,n)}function H(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():l.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){var t=41;if(e.length<t)return e;return e.substr(0,t-3)+"..."}(t)+">, no stack trace)"}function U(){return"function"==typeof Z}var V=function(){return!1},W=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function q(e){var t=e.match(W);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function X(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Z(this,X),t>32&&this.uncycle()}l.inherits(X,Error),t.CapturedTrace=X,X.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var s=t[n].stack;void 0===r[s]&&(r[s]=n)}for(n=0;n<e;++n){var o=r[t[n].stack];if(void 0!==o&&o!==n){o>0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var a=n>0?t[n-1]:this;o<e-1?(a._parent=t[o+1],a._parent.uncycle(),a._length=a._parent._length+1):(a._parent=void 0,a._length=1);for(var l=a._length+1,h=n-2;h>=0;--h)t[h]._length=l,l++;return}}}},X.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=B(e),r=t.message,n=[t.stack],i=this;void 0!==i;)n.push(L(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],r=1;r<e.length;++r){for(var n=e[r],i=t.length-1,s=t[i],o=-1,a=n.length-1;a>=0;--a)if(n[a]===s){o=a;break}for(a=o;a>=0;--a){var l=n[a];if(t[i]!==l)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),l.notEnumerableProp(e,"stack",function(e,t){for(var r=0;r<t.length-1;++r)t[r].push("From previous event:"),t[r]=t[r].join("\n");return r<t.length&&(t[r]=t[r].join("\n")),e+"\n"+t.join("\n")}(r,n)),l.notEnumerableProp(e,"__stackCleaned__",!0)}};var Z=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():H(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,d=e,p=t;var r=Error.captureStackTrace;return V=function(e){return u.test(e)},function(e,t){Error.stackTraceLimit+=6,r(e,t),Error.stackTraceLimit-=6}}var n,i=new Error;if("string"==typeof i.stack&&i.stack.split("\n")[0].indexOf("stackDetection@")>=0)return d=/@/,p=t,m=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return!("stack"in i)&&n&&"number"==typeof Error.stackTraceLimit?(d=e,p=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(p=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?H(t):t.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(i=function(e){},l.isNode&&process.stderr.isTTY?i=function(e,t){}:l.isNode||"string"!=typeof(new Error).stack||(i=function(e,t){}));var G={warnings:y,longStackTraces:!1,cancellation:!1,monitoring:!1};return v&&e.longStackTraces(),{longStackTraces:function(){return G.longStackTraces},warnings:function(){return G.warnings},cancellation:function(){return G.cancellation},monitoring:function(){return G.monitoring},propagateFromFunction:function(){return P},boundValueFunction:function(){return F},checkForgottenReturns:function(e,t,r,n,i){if(void 0===e&&null!==t&&_){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var s="",o="";if(t._trace){for(var a=t._trace.stack.split("\n"),l=L(a),h=l.length-1;h>=0;--h){var u=l[h];if(!c.test(u)){var d=u.match(f);d&&(s="at "+d[1]+":"+d[2]+":"+d[3]+" ");break}}if(l.length>0){var p=l[0];for(h=0;h<a.length;++h)if(a[h]===p){h>0&&(o="\n"+a[h-1]);break}}}var m="a promise was created in a "+r+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(m,!0,t)}},setBounds:function(e,t){if(U()){for(var r,n,i=e.stack.split("\n"),s=t.stack.split("\n"),o=-1,a=-1,l=0;l<i.length;++l){if(h=q(i[l])){r=h.fileName,o=h.line;break}}for(l=0;l<s.length;++l){var h;if(h=q(s[l])){n=h.fileName,a=h.line;break}}o<0||a<0||!r||!n||r!==n||o>=a||(V=function(e){if(u.test(e))return!0;var t=q(e);return!!(t&&t.fileName===r&&o<=t.line&&t.line<=a)})}},warn:M,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),M(r)},CapturedTrace:X,fireDomEvent:w,fireGlobalEvent:x}}),KF}function ej(){if(iD)return nD;iD=1;var e=MF(),t=e.maybeWrapAsError,r=KD().OperationalError,n=jF();var i=/^(?:name|message|stack|cause)$/;function s(t){var s;if(function(e){return e instanceof Error&&n.getPrototypeOf(e)===Error.prototype}(t)){(s=new r(t)).name=t.name,s.message=t.message,s.stack=t.stack;for(var o=n.keys(t),a=0;a<o.length;++a){var l=o[a];i.test(l)||(s[l]=t[l])}return s}return e.markAsOriginatingFromRejection(t),t}return nD=function(e,r){return function(n,i){if(null!==e){if(n){var o=s(t(n));e._attachExtraTrace(o),e._reject(o)}else if(r){for(var a=arguments.length,l=new Array(Math.max(a-1,0)),h=1;h<a;++h)l[h-1]=arguments[h];e._fulfill(l)}else e._fulfill(i);e=null}}},nD}function tj(){return pD||(pD=1,dD=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},s=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return s.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}),dD}function rj(){return vD||(vD=1,yD=function(e,t,r,n,i,s){var o=e._getDomain,a=MF(),l=a.tryCatch,h=a.errorObj,u=e._async;function c(e,t,r,n){this.constructor$(e),this._promise._captureStackTrace();var s=o();this._callback=null===s?t:a.domainBind(s,t),this._preservedValues=n===i?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],u.invoke(this._asyncInit,this,void 0)}function f(t,n,i,s){if("function"!=typeof n)return r("expecting a function but got "+a.classString(n));var o=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+a.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+a.classString(i.concurrency)));o=i.concurrency}return new c(t,n,o="number"==typeof o&&isFinite(o)&&o>=1?o:0,s).promise()}a.inherits(c,t),c.prototype._asyncInit=function(){this._init$(void 0,-2)},c.prototype._init=function(){},c.prototype._promiseFulfilled=function(t,r){var i=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(r<0){if(i[r=-1*r-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return i[r]=t,this._queue.push(r),!1;null!==a&&(a[r]=t);var c=this._promise,f=this._callback,d=c._boundValue();c._pushContext();var p=l(f).call(d,t,r,o),m=c._popContext();if(s.checkForgottenReturns(p,m,null!==a?"Promise.filter":"Promise.map",c),p===h)return this._reject(p.e),!0;var g=n(p,this._promise);if(g instanceof e){var y=(g=g._target())._bitField;if(0==(50397184&y))return u>=1&&this._inFlight++,i[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&y))return 0!=(16777216&y)?(this._reject(g._reason()),!0):(this._cancel(),!0);p=g._value()}i[r]=p}return++this._totalResolved>=o&&(null!==a?this._filter(i,a):this._resolve(i),!0)},c.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var n=e.pop();this._promiseFulfilled(r[n],n)}},c.prototype._filter=function(e,t){for(var r=t.length,n=new Array(r),i=0,s=0;s<r;++s)e[s]&&(n[i++]=t[s]);n.length=i,this._resolve(n)},c.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(e,t){return f(this,e,t,null)},e.map=function(e,t,r,n){return f(e,t,r,n)}}),yD}function nj(){return xD||(xD=1,wD=function(e,t,r,n,i,s){var o=MF(),a=KD().TypeError,l=MF().inherits,h=o.errorObj,u=o.tryCatch,c={};function f(e){setTimeout((function(){throw e}),0)}function d(t,n){var s=0,o=t.length,a=new e(i);return function i(){if(s>=o)return a._fulfill();var l=function(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(t[s++]);if(l instanceof e&&l._isDisposable()){try{l=r(l._getDisposer().tryDispose(n),t.promise)}catch(e){return f(e)}if(l instanceof e)return l._then(i,f,null,null,null)}i()}(),a}function p(e,t,r){this._data=e,this._promise=t,this._context=r}function m(e,t,r){this.constructor$(e,t,r)}function g(e){return p.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function y(e){this.length=e,this.promise=null,this[e-1]=null}p.prototype.data=function(){return this._data},p.prototype.promise=function(){return this._promise},p.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():c},p.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==c?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},p.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},l(m,p),m.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},y.prototype._resultCancelled=function(){for(var t=this.length,r=0;r<t;++r){var n=this[r];n instanceof e&&n.cancel()}},e.using=function(){var n=arguments.length;if(n<2)return t("you must pass at least 2 arguments to Promise.using");var i,a=arguments[n-1];if("function"!=typeof a)return t("expecting a function but got "+o.classString(a));var l=!0;2===n&&Array.isArray(arguments[0])?(n=(i=arguments[0]).length,l=!1):(i=arguments,n--);for(var c=new y(n),f=0;f<n;++f){var m=i[f];if(p.isDisposer(m)){var v=m;(m=m.promise())._setDisposable(v)}else{var _=r(m);_ instanceof e&&(m=_._then(g,null,null,{resources:c,index:f},void 0))}c[f]=m}var b=new Array(c.length);for(f=0;f<b.length;++f)b[f]=e.resolve(c[f]).reflect();var w=e.all(b).then((function(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.isRejected())return h.e=r.error(),h;if(!r.isFulfilled())return void w.cancel();e[t]=r.value()}x._pushContext(),a=u(a);var n=l?a.apply(void 0,e):a(e),i=x._popContext();return s.checkForgottenReturns(n,i,"Promise.using",x),n})),x=w.lastly((function(){var t=new e.PromiseInspection(w);return d(c,t)}));return c.promise=x,x._setOnCancel(c),x},e.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(e){if("function"==typeof e)return new m(e,this,n());throw new a}}),wD}function ij(){return SD||(SD=1,kD=function(e,t,r){var n=MF(),i=e.TimeoutError;function s(e){this.handle=e}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var o=function(e){return a(+this).thenReturn(e)},a=e.delay=function(n,i){var a,l;return void 0!==i?(a=e.resolve(i)._then(o,null,null,n,void 0),r.cancellation()&&i instanceof e&&a._setOnCancel(i)):(a=new e(t),l=setTimeout((function(){a._fulfill()}),+n),r.cancellation()&&a._setOnCancel(new s(l)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(e){return a(e,this)};function l(e){return clearTimeout(this.handle),e}function h(e){throw clearTimeout(this.handle),e}e.prototype.timeout=function(e,t){var o,a;e=+e;var u=new s(setTimeout((function(){o.isPending()&&function(e,t,r){var s;s="string"!=typeof t?t instanceof Error?t:new i("operation timed out"):new i(t),n.markAsOriginatingFromRejection(s),e._attachExtraTrace(s),e._reject(s),null!=r&&r.cancel()}(o,t,a)}),e));return r.cancellation()?(a=this.then(),(o=a._then(l,h,void 0,u,void 0))._setOnCancel(u)):o=this._then(l,h,void 0,u,void 0),o}}),kD}function sj(){return TD||(TD=1,ED=function(e,t,r,n,i,s){var o=KD().TypeError,a=MF(),l=a.errorObj,h=a.tryCatch,u=[];function c(t,n,i,o){if(s.cancellation()){var a=new e(r),l=this._finallyPromise=new e(r);this._promise=a.lastly((function(){return l})),a._captureStackTrace(),a._setOnCancel(this)}else{(this._promise=new e(r))._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(u):u,this._yieldedPromise=null,this._cancellationPhase=!1}a.inherits(c,i),c.prototype._isResolved=function(){return null===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},c.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=h(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=h(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},c.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=h(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},c.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=h(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},c.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},c.prototype._continue=function(t){var r=this._promise;if(t===l)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(t.e,!1);var i=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(i);var s=n(i,this._promise);if(s instanceof e||(s=function(t,r,i){for(var s=0;s<r.length;++s){i._pushContext();var o=h(r[s])(t);if(i._popContext(),o===l){i._pushContext();var a=e.reject(l.e);return i._popContext(),a}var u=n(o,i);if(u instanceof e)return u}return null}(s,this._yieldHandlers,this._promise),null!==s)){var a=(s=s._target())._bitField;0==(50397184&a)?(this._yieldedPromise=s,s._proxy(this,null)):0!=(33554432&a)?e._async.invoke(this._promiseFulfilled,this,s._value()):0!=(16777216&a)?e._async.invoke(this._promiseRejected,this,s._reason()):this._promiseCancelled()}else this._promiseRejected(new o("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",i)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(e,t){if("function"!=typeof e)throw new o("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(t).yieldHandler,n=c,i=(new Error).stack;return function(){var t=e.apply(this,arguments),s=new n(void 0,void 0,r,i),o=s.promise();return s._generator=t,s._promiseFulfilled(void 0),o}},e.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new o("expecting a function but got "+a.classString(e));u.push(e)},e.spawn=function(r){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return t("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new c(r,this),i=n.promise();return n._run(e.spawn),i}}),ED}function oj(){return AD||(AD=1,RD=function(e,t){var r={},n=MF(),i=ej(),s=n.withAppended,o=n.maybeWrapAsError,a=n.canEvaluate,l=KD().TypeError,h={__isPromisified__:!0},u=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),c=function(e){return n.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function f(e){return!u.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function p(e,t,r){var i=n.getDataPropertyOrDefault(e,t+r,h);return!!i&&d(i)}function m(e,t,r,i){for(var s=n.inheritedDataKeys(e),o=[],a=0;a<s.length;++a){var h=s[a],u=e[h],f=i===c||c(h);"function"!=typeof u||d(u)||p(e,h,t)||!i(h,u,e,f)||o.push(h,u)}return function(e,t,r){for(var n=0;n<e.length;n+=2){var i=e[n];if(r.test(i))for(var s=i.replace(r,""),o=0;o<e.length;o+=2)if(e[o]===s)throw new l("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(o,t,r),o}var g;g=function(a,l,h,u,c,f){var d=Math.max(0,function(e){return"number"==typeof e.length?Math.max(Math.min(e.length,1024),0):0}(u)-1),p=function(e){for(var t=[e],r=Math.max(0,e-1-3),n=e-1;n>=r;--n)t.push(n);for(n=e+1;n<=3;++n)t.push(n);return t}(d),m="string"==typeof a||l===r;function g(e){var t,r=(t=e,n.filledRange(t,"_arg","")).join(", "),i=e>0?", ":"";return(m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===l?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",i)}var y="string"==typeof a?"this != null ? this['"+a+"'] : fn":"fn",v="'use strict'; \n\t var ret = function (Parameters) { \n\t 'use strict'; \n\t var len = arguments.length; \n\t var promise = new Promise(INTERNAL); \n\t promise._captureStackTrace(); \n\t var nodeback = nodebackForPromise(promise, "+f+"); \n\t var ret; \n\t var callback = tryCatch([GetFunctionCode]); \n\t switch(len) { \n\t [CodeForSwitchCase] \n\t } \n\t if (ret === errorObj) { \n\t promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\t } \n\t if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\t return promise; \n\t }; \n\t notEnumerableProp(ret, '__isPromisified__', true); \n\t return ret; \n\t ".replace("[CodeForSwitchCase]",function(){for(var e="",t=0;t<p.length;++t)e+="case "+p[t]+":"+g(p[t]);return e+=" \n\t default: \n\t var args = new Array(len + 1); \n\t var i = 0; \n\t for (var i = 0; i < len; ++i) { \n\t args[i] = arguments[i]; \n\t } \n\t args[i] = nodeback; \n\t [CodeForCall] \n\t break; \n\t ".replace("[CodeForCall]",m?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",y);return v=v.replace("Parameters",function(e){return n.filledRange(Math.max(e,3),"_arg","")}(d)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",v)(e,u,l,s,o,i,n.tryCatch,n.errorObj,n.notEnumerableProp,t)};var y=a?g:function(a,l,h,u,c,f){var d=function(){return this}(),p=a;function m(){var n=l;l===r&&(n=this);var h=new e(t);h._captureStackTrace();var u="string"==typeof p&&this!==d?this[p]:a,c=i(h,f);try{u.apply(n,s(arguments,c))}catch(e){h._rejectCallback(o(e),!0,!0)}return h._isFateSealed()||h._setAsyncGuaranteed(),h}return"string"==typeof p&&(a=u),n.notEnumerableProp(m,"__isPromisified__",!0),m};function v(e,t,i,s,o){for(var a=new RegExp(t.replace(/([$])/,"\\$")+"$"),l=m(e,t,a,i),h=0,u=l.length;h<u;h+=2){var c=l[h],f=l[h+1],d=c+t;if(s===y)e[d]=y(c,r,c,f,t,o);else{var p=s(f,(function(){return y(c,r,c,f,t,o)}));n.notEnumerableProp(p,"__isPromisified__",!0),e[d]=p}}return n.toFastProperties(e),e}e.promisify=function(e,t){if("function"!=typeof e)throw new l("expecting a function but got "+n.classString(e));if(d(e))return e;var i=function(e,t,r){return y(e,t,void 0,e,null,r)}(e,void 0===(t=Object(t)).context?r:t.context,!!t.multiArgs);return n.copyDescriptors(e,i,f),i},e.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new l("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(t=Object(t)).multiArgs,i=t.suffix;"string"!=typeof i&&(i="Async");var s=t.filter;"function"!=typeof s&&(s=c);var o=t.promisifier;if("function"!=typeof o&&(o=y),!n.isIdentifier(i))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var a=n.inheritedDataKeys(e),h=0;h<a.length;++h){var u=e[a[h]];"constructor"!==a[h]&&n.isClass(u)&&(v(u.prototype,i,s,o,r),v(u,i,s,o,r))}return v(e,i,s,o,r)}}),RD}function aj(){return ID||(ID=1,ND=function(e,t,r,n){var i,s=MF(),o=s.isObject,a=jF();"function"==typeof Map&&(i=Map);var l=function(){var e=0,t=0;function r(r,n){this[e]=r,this[e+t]=n,e++}return function(n){t=n.size,e=0;var i=new Array(2*n.size);return n.forEach(r,i),i}}();function h(e){var t,r=!1;if(void 0!==i&&e instanceof i)t=l(e),r=!0;else{var n=a.keys(e),s=n.length;t=new Array(2*s);for(var o=0;o<s;++o){var h=n[o];t[o]=e[h],t[o+s]=h}}this.constructor$(t),this._isMap=r,this._init$(void 0,-3)}function u(t){var i,s=r(t);return o(s)?(i=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new h(s).promise(),s instanceof e&&i._propagateFrom(s,2),i):n("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}s.inherits(h,t),h.prototype._init=function(){},h.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(e){for(var t=new i,r=e.length/2|0,n=0;n<r;++n){var s=e[r+n],o=e[n];t.set(s,o)}return t}(this._values);else{r={};for(var n=this.length(),s=0,o=this.length();s<o;++s)r[this._values[s+n]]=this._values[s]}return this._resolve(r),!0}return!1},h.prototype.shouldCopyValues=function(){return!1},h.prototype.getActualLength=function(e){return e>>1},e.prototype.props=function(){return u(this)},e.props=function(e){return u(e)}}),ND}function lj(){return FD||(FD=1,PD=function(e,t,r,n){var i=MF();function s(o,a){var l=r(o);if(l instanceof e)return function(e){return e.then((function(t){return s(t,e)}))}(l);if(null===(o=i.asArray(o)))return n("expecting an array or an iterable object but got "+i.classString(o));var h=new e(t);void 0!==a&&h._propagateFrom(a,3);for(var u=h._fulfill,c=h._reject,f=0,d=o.length;f<d;++f){var p=o[f];(void 0!==p||f in o)&&e.cast(p)._then(u,c,void 0,h,null)}return h}e.race=function(e){return s(e,void 0)},e.prototype.race=function(){return s(this,void 0)}}),PD}!function(e){e.exports=function(){var t=function(){return new f("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},r=function(){return new C.PromiseInspection(this._target())},n=function(e){return C.reject(new f(e))};function i(){}var s,o={},a=MF();s=a.isNode?function(){var e=process.domain;return void 0===e&&(e=null),e}:function(){return null},a.notEnumerableProp(C,"_getDomain",s);var l=jF(),h=YD(),u=new h;l.defineProperty(C,"_async",{value:u});var c=KD(),f=C.TypeError=c.TypeError;C.RangeError=c.RangeError;var d=C.CancellationError=c.CancellationError;C.TimeoutError=c.TimeoutError,C.OperationalError=c.OperationalError,C.RejectionError=c.OperationalError,C.AggregateError=c.AggregateError;var p=function(){},m={},g={},y=QD()(C,p),v=(ZF||(ZF=1,XF=function(e,t,r,n,i){var s=MF();function o(r){var n=this._promise=new e(t);r instanceof e&&n._propagateFrom(r,3),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return s.isArray,s.inherits(o,i),o.prototype.length=function(){return this._length},o.prototype.promise=function(){return this._promise},o.prototype._init=function t(i,o){var a=r(this._values,this._promise);if(a instanceof e){var l=(a=a._target())._bitField;if(this._values=a,0==(50397184&l))return this._promise._setAsyncGuaranteed(),a._then(t,this._reject,void 0,this,o);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=s.asArray(a)))0!==a.length?this._iterate(a):-5===o?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{}}}(o));else{var h=n("expecting an array or an iterable object but got "+s.classString(a)).reason();this._promise._rejectCallback(h,!1)}},o.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,s=!1,o=null,a=0;a<n;++a){var l=r(t[a],i);o=l instanceof e?(l=l._target())._bitField:null,s?null!==o&&l.suppressUnhandledRejections():null!==o?0==(50397184&o)?(l._proxy(this,a),this._values[a]=l):s=0!=(33554432&o)?this._promiseFulfilled(l._value(),a):0!=(16777216&o)?this._promiseRejected(l._reason(),a):this._promiseCancelled(a):s=this._promiseFulfilled(l,a)}s||i._setAsyncGuaranteed()},o.prototype._isResolved=function(){return null===this._values},o.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},o.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},o.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},o.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseCancelled=function(){return this._cancel(),!0},o.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},o.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r<t.length;++r)t[r]instanceof e&&t[r].cancel()}},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(e){return e},o}),XF)(C,p,y,n,i),_=(YF?GF:(YF=1,GF=function(e){var t=!1,r=[];function n(){this._trace=new n.CapturedTrace(i())}function i(){var e=r.length-1;if(e>=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,s=e.prototype._popContext,o=e._peekContext,a=e.prototype._peekContext,l=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=s,e._peekContext=o,e.prototype._peekContext=a,e.prototype._promiseCreated=l,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}))(C),b=_.create,w=JD()(C,_);w.CapturedTrace;var x=(eD||(eD=1,JF=function(e,t){var r=MF(),n=e.CancellationError,i=r.errorObj;function s(e,t,r){this.promise=e,this.type=t,this.handler=r,this.called=!1,this.cancelPromise=null}function o(e){this.finallyHandler=e}function a(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function l(){return u.call(this,this.promise._target()._settledValue())}function h(e){if(!a(this,e))return i.e=e,i}function u(r){var s=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(s._boundValue()):u.call(s._boundValue(),r);if(void 0!==c){s._setReturnedNonUndefined();var f=t(c,s);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new n("late cancellation observer");return s._attachExtraTrace(d),i.e=d,i}f.isPending()&&f._attachCancellationCallback(new o(this))}return f._then(l,h,void 0,this,void 0)}}}return s.isRejected()?(a(this),i.e=r,i):(a(this),r)}return s.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},e.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new s(this,t,e),void 0)},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,u,u)},e.prototype.tap=function(e){return this._passThrough(e,1,u)},s}),JF)(C,y),k=(rD||(rD=1,tD=function(e){var t=MF(),r=jF().keys,n=t.tryCatch,i=t.errorObj;return function(s,o,a){return function(l){var h=a._boundValue();e:for(var u=0;u<s.length;++u){var c=s[u];if(c===Error||null!=c&&c.prototype instanceof Error){if(l instanceof c)return n(o).call(h,l)}else if("function"==typeof c){var f=n(c).call(h,l);if(f===i)return f;if(f)return n(o).call(h,l)}else if(t.isObject(l)){for(var d=r(c),p=0;p<d.length;++p){var m=d[p];if(c[m]!=l[m])continue e}return n(o).call(h,l)}}return e}}}),tD)(g),S=ej(),E=a.errorObj,T=a.tryCatch;function C(e){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,e!==p&&(!function(e,t){if("function"!=typeof t)throw new f("expecting a function but got "+a.classString(t));if(e.constructor!==C)throw new f("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}(this,e),this._resolveFromExecutor(e)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function O(e){this.promise._resolveCallback(e)}function R(e){this.promise._rejectCallback(e,!1)}function A(e){var t=new C(p);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(e){var t=arguments.length;if(t>1){var r,i=new Array(t-1),s=0;for(r=0;r<t-1;++r){var o=arguments[r];if(!a.isObject(o))return n("expecting an object but got A catch statement predicate "+a.classString(o));i[s++]=o}return i.length=s,e=arguments[r],this.then(void 0,k(i,e,this))}return this.then(void 0,e)},C.prototype.reflect=function(){return this._then(r,r,void 0,this,void 0)},C.prototype.then=function(e,t){if(w.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+a.classString(e);arguments.length>1&&(r+=", "+a.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},C.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},C.prototype.spread=function(e){return"function"!=typeof e?n("expecting a function but got "+a.classString(e)):this.all()._then(e,void 0,void 0,m,void 0)},C.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},C.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new v(this).promise()},C.prototype.error=function(e){return this.caught(a.originatesFromRejection,e)},C.getNewLibraryCopy=e.exports,C.is=function(e){return e instanceof C},C.fromNode=C.fromCallback=function(e){var t=new C(p);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=T(e)(S(t,r));return n===E&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},C.all=function(e){return new v(e).promise()},C.cast=function(e){var t=y(e);return t instanceof C||((t=new C(p))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(e){var t=new C(p);return t._captureStackTrace(),t._rejectCallback(e,!0),t},C.setScheduler=function(e){if("function"!=typeof e)throw new f("expecting a function but got "+a.classString(e));return u.setScheduler(e)},C.prototype._then=function(e,t,r,n,i){var o=void 0!==i,l=o?i:new C(p),h=this._target(),c=h._bitField;o||(l._propagateFrom(this,3),l._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():h===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,l));var f=s();if(0!=(50397184&c)){var m,g,y=h._settlePromiseCtx;0!=(33554432&c)?(g=h._rejectionHandler0,m=e):0!=(16777216&c)?(g=h._fulfillmentHandler0,m=t,h._unsetRejectionIsUnhandled()):(y=h._settlePromiseLateCancellationObserver,g=new d("late cancellation observer"),h._attachExtraTrace(g),m=t),u.invoke(y,h,{handler:null===f?m:"function"==typeof m&&a.domainBind(f,m),promise:l,receiver:n,value:g})}else h._addCallbacks(e,t,l,n,f);return l},C.prototype._length=function(){return 65535&this._bitField},C.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},C.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},C.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},C.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},C.prototype._isFinal=function(){return(4194304&this._bitField)>0},C.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},C.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},C.prototype._setAsyncGuaranteed=function(){u.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},C.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==o)return void 0===t&&this._isBound()?this._boundValue():t},C.prototype._promiseAt=function(e){return this[4*e-4+2]},C.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},C.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=o),this._addCallbacks(t,r,n,i,null)},C.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),s=e._receiverAt(t);void 0===s&&(s=o),this._addCallbacks(r,n,i,s,null)},C.prototype._addCallbacks=function(e,t,r,n,i){var s=this._length();if(s>=65531&&(s=0,this._setLength(0)),0===s)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:a.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:a.domainBind(i,t));else{var o=4*s-4;this[o+2]=r,this[o+3]=n,"function"==typeof e&&(this[o+0]=null===i?e:a.domainBind(i,e)),"function"==typeof t&&(this[o+1]=null===i?t:a.domainBind(i,t))}return this._setLength(s+1),s},C.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},C.prototype._resolveCallback=function(e,r){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(t(),!1);var n=y(e,this);if(!(n instanceof C))return this._fulfill(e);r&&this._propagateFrom(n,2);var i=n._target();if(i!==this){var s=i._bitField;if(0==(50397184&s)){var o=this._length();o>0&&i._migrateCallback0(this);for(var a=1;a<o;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!=(33554432&s))this._fulfill(i._value());else if(0!=(16777216&s))this._reject(i._reason());else{var l=new d("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}else this._reject(t())}},C.prototype._rejectCallback=function(e,t,r){var n=a.ensureErrorObject(e),i=n===e;if(!i&&!r&&w.warnings()){var s="a promise was rejected with a non-error: "+a.classString(e);this._warn(s,!0)}this._attachExtraTrace(n,!!t&&i),this._reject(e)},C.prototype._resolveFromExecutor=function(e){var t=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(e,(function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e,r)}));r=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)},C.prototype._settlePromiseFromHandler=function(e,t,r,n){var i=n._bitField;if(0==(65536&i)){var s;n._pushContext(),t===m?r&&"number"==typeof r.length?s=T(e).apply(this._boundValue(),r):(s=E).e=new f("cannot .spread() a non-array: "+a.classString(r)):s=T(e).call(t,r);var o=n._popContext();0==(65536&(i=n._bitField))&&(s===g?n._reject(r):s===E?n._rejectCallback(s.e,!1):(w.checkForgottenReturns(s,o,"",n,this),n._resolveCallback(s)))}},C.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},C.prototype._followee=function(){return this._rejectionHandler0},C.prototype._setFollowee=function(e){this._rejectionHandler0=e},C.prototype._settlePromise=function(e,t,n,s){var o=e instanceof C,a=this._bitField,l=0!=(134217728&a);0!=(65536&a)?(o&&e._invokeInternalOnCancel(),n instanceof x&&n.isFinallyHandler()?(n.cancelPromise=e,T(t).call(n,s)===E&&e._reject(E.e)):t===r?e._fulfill(r.call(n)):n instanceof i?n._promiseCancelled(e):o||e instanceof v?e._cancel():n.cancel()):"function"==typeof t?o?(l&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,n,s,e)):t.call(n,s,e):n instanceof i?n._isResolved()||(0!=(33554432&a)?n._promiseFulfilled(s,e):n._promiseRejected(s,e)):o&&(l&&e._setAsyncGuaranteed(),0!=(33554432&a)?e._fulfill(s):e._reject(s))},C.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,r=e.promise,n=e.receiver,i=e.value;"function"==typeof t?r instanceof C?this._settlePromiseFromHandler(t,n,i,r):t.call(n,i,r):r instanceof C&&r._reject(i)},C.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},C.prototype._settlePromise0=function(e,t,r){var n=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,i,t)},C.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},C.prototype._fulfill=function(e){var r=this._bitField;if(!((117506048&r)>>>16)){if(e===this){var n=t();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&r)>0&&(0!=(134217728&r)?this._settlePromises():u.settlePromises(this))}},C.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return u.fatalError(e,a.isNode);(65535&t)>0?u.settlePromises(this):this._ensurePossibleRejectionHandled()}},C.prototype._fulfillPromises=function(e,t){for(var r=1;r<e;r++){var n=this._fulfillmentHandlerAt(r),i=this._promiseAt(r),s=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,s,t)}},C.prototype._rejectPromises=function(e,t){for(var r=1;r<e;r++){var n=this._rejectionHandlerAt(r),i=this._promiseAt(r),s=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,s,t)}},C.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},C.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},C.defer=C.pending=function(){return w.deprecated("Promise.defer","new Promise"),{promise:new C(p),resolve:O,reject:R}},a.notEnumerableProp(C,"_makeSelfResolutionError",t),(oD||(oD=1,sD=function(e,t,r,n,i){var s=MF(),o=s.tryCatch;e.method=function(r){if("function"!=typeof r)throw new e.TypeError("expecting a function but got "+s.classString(r));return function(){var n=new e(t);n._captureStackTrace(),n._pushContext();var s=o(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(s,a,"Promise.method",n),n._resolveFromSyncValue(s),n}},e.attempt=e.try=function(r){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a,l=new e(t);if(l._captureStackTrace(),l._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var h=arguments[1],u=arguments[2];a=s.isArray(h)?o(r).apply(u,h):o(r).call(u,h)}else a=o(r)();var c=l._popContext();return i.checkForgottenReturns(a,c,"Promise.try",l),l._resolveFromSyncValue(a),l},e.prototype._resolveFromSyncValue=function(e){e===s.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}),sD)(C,p,y,n,w),(lD||(lD=1,aD=function(e,t,r,n){var i=!1,s=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(s,s,null,this,e)},a=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},l=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(s){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var h=r(s),u=new e(t);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(h),h instanceof e){var f={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:h};c._then(t,o,void 0,u,f),h._then(a,l,void 0,u,f),u._setOnCancel(h)}else u._resolveCallback(c);return u},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}),aD)(C,p,y,w),(uD||(uD=1,hD=function(e,t,r,n){var i=MF(),s=i.tryCatch,o=i.errorObj,a=e._async;e.prototype.break=e.prototype.cancel=function(){if(!n.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),a.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var r=0;r<e.length;++r)this._doInvokeOnCancel(e[r],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=s(e).call(this._boundValue());n===o&&(this._attachExtraTrace(n.e),a.throwLater(n.e))}}else e._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),a.invoke(this._doInvokeOnCancel,this,e)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}),hD)(C,v,n,w),(fD||(fD=1,cD=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,(function(){throw t}))},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];return n instanceof e&&n.suppressUnhandledRejections(),this.caught(r,(function(){return n}))}}),cD)(C),tj()(C),(gD||(gD=1,mD=function(e,t,r,n,i,s){var o,a=MF(),l=a.canEvaluate,h=a.tryCatch,u=a.errorObj;if(l){for(var c=function(e){return new Function("value","holder"," \n\t 'use strict'; \n\t holder.pIndex = value; \n\t holder.checkFulfillment(this); \n\t ".replace(/Index/g,e))},f=function(e){return new Function("promise","holder"," \n\t 'use strict'; \n\t holder.pIndex = promise; \n\t ".replace(/Index/g,e))},d=function(t){for(var r=new Array(t),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var s=r.join(" = ")+" = null;",o="var promise;\n"+r.map((function(e){return" \n\t promise = "+e+"; \n\t if (promise instanceof Promise) { \n\t promise.cancel(); \n\t } \n\t "})).join("\n"),a=r.join(", "),l="Holder$"+t,c="return function(tryCatch, errorObj, Promise, async) { \n\t 'use strict'; \n\t function [TheName](fn) { \n\t [TheProperties] \n\t this.fn = fn; \n\t this.asyncNeeded = true; \n\t this.now = 0; \n\t } \n\t \n\t [TheName].prototype._callFunction = function(promise) { \n\t promise._pushContext(); \n\t var ret = tryCatch(this.fn)([ThePassedArguments]); \n\t promise._popContext(); \n\t if (ret === errorObj) { \n\t promise._rejectCallback(ret.e, false); \n\t } else { \n\t promise._resolveCallback(ret); \n\t } \n\t }; \n\t \n\t [TheName].prototype.checkFulfillment = function(promise) { \n\t var now = ++this.now; \n\t if (now === [TheTotal]) { \n\t if (this.asyncNeeded) { \n\t async.invoke(this._callFunction, this, promise); \n\t } else { \n\t this._callFunction(promise); \n\t } \n\t \n\t } \n\t }; \n\t \n\t [TheName].prototype._resultCancelled = function() { \n\t [CancellationCode] \n\t }; \n\t \n\t return [TheName]; \n\t }(tryCatch, errorObj, Promise, async); \n\t ";return c=c.replace(/\[TheName\]/g,l).replace(/\[TheTotal\]/g,t).replace(/\[ThePassedArguments\]/g,a).replace(/\[TheProperties\]/g,s).replace(/\[CancellationCode\]/g,o),new Function("tryCatch","errorObj","Promise","async",c)(h,u,e,i)},p=[],m=[],g=[],y=0;y<8;++y)p.push(d(y+1)),m.push(c(y+1)),g.push(f(y+1));o=function(e){this._reject(e)}}e.join=function(){var i,h=arguments.length-1;if(h>0&&"function"==typeof arguments[h]&&(i=arguments[h],h<=8&&l)){(x=new e(n))._captureStackTrace();for(var u=new(0,p[h-1])(i),c=m,f=0;f<h;++f){var d=r(arguments[f],x);if(d instanceof e){var y=(d=d._target())._bitField;0==(50397184&y)?(d._then(c[f],o,void 0,x,u),g[f](d,u),u.asyncNeeded=!1):0!=(33554432&y)?c[f].call(x,d._value(),u):0!=(16777216&y)?x._reject(d._reason()):x._cancel()}else c[f].call(x,d,u)}if(!x._isFateSealed()){if(u.asyncNeeded){var v=s();null!==v&&(u.fn=a.domainBind(v,u.fn))}x._setAsyncGuaranteed(),x._setOnCancel(u)}return x}for(var _=arguments.length,b=new Array(_),w=0;w<_;++w)b[w]=arguments[w];i&&b.pop();var x=new t(b).promise();return void 0!==i?x.spread(i):x}}),mD)(C,v,y,p,u,s),C.Promise=C,C.version="3.4.7",rj()(C,v,n,y,p,w),function(){if(bD)return _D;bD=1;var e=Object.create;if(e){var t=e(null),r=e(null);t[" size"]=r[" size"]=0}return _D=function(e){var n,i,s=MF(),o=s.canEvaluate,a=s.isIdentifier,l=function(e){return new Function("ensureMethod"," \n\t return function(obj) { \n\t 'use strict' \n\t var len = this.length; \n\t ensureMethod(obj, 'methodName'); \n\t switch(len) { \n\t case 1: return obj.methodName(this[0]); \n\t case 2: return obj.methodName(this[0], this[1]); \n\t case 3: return obj.methodName(this[0], this[1], this[2]); \n\t case 0: return obj.methodName(); \n\t default: \n\t return obj.methodName.apply(obj, this); \n\t } \n\t }; \n\t ".replace(/methodName/g,e))(c)},h=function(e){return new Function("obj"," \n\t 'use strict'; \n\t return obj.propertyName; \n\t ".replace("propertyName",e))},u=function(e,t,r){var n=r[e];if("function"!=typeof n){if(!a(e))return null;if(n=t(e),r[e]=n,r[" size"]++,r[" size"]>512){for(var i=Object.keys(r),s=0;s<256;++s)delete r[i[s]];r[" size"]=i.length-256}}return n};function c(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+s.classString(t)+" has no method '"+s.toString(r)+"'";throw new e.TypeError(i)}return n}function f(e){return c(e,this.pop()).apply(e,this)}function d(e){return e[this]}function p(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}n=function(e){return u(e,l,t)},i=function(e){return u(e,h,r)},e.prototype.call=function(e){for(var t=arguments.length,r=new Array(Math.max(t-1,0)),i=1;i<t;++i)r[i-1]=arguments[i];if(o){var s=n(e);if(null!==s)return this._then(s,void 0,void 0,r,void 0)}return r.push(e),this._then(f,void 0,void 0,r,void 0)},e.prototype.get=function(e){var t;if("number"==typeof e)t=p;else if(o){var r=i(e);t=null!==r?r:d}else t=d;return this._then(t,void 0,void 0,e,void 0)}},_D}()(C),nj()(C,n,y,b,p,w),ij()(C,p,w),sj()(C,n,p,y,i,w),(OD||(OD=1,CD=function(e){var t=MF(),r=e._async,n=t.tryCatch,i=t.errorObj;function s(e,s){if(!t.isArray(e))return o.call(this,e,s);var a=n(s).apply(this._boundValue(),[null].concat(e));a===i&&r.throwLater(a.e)}function o(e,t){var s=this._boundValue(),o=void 0===e?n(t).call(s,null):n(t).call(s,null,e);o===i&&r.throwLater(o.e)}function a(e,t){if(!e){var s=new Error(e+"");s.cause=e,e=s}var o=n(t).call(this._boundValue(),e);o===i&&r.throwLater(o.e)}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if("function"==typeof e){var r=o;void 0!==t&&Object(t).spread&&(r=s),this._then(r,a,void 0,this,e)}return this}}),CD)(C),oj()(C,p),aj()(C,v,y,n),lj()(C,p,y,n),(jD||(jD=1,DD=function(e,t,r,n,i,s){var o=e._getDomain,a=MF(),l=a.tryCatch;function h(t,r,n,s){this.constructor$(t);var l=o();this._fn=null===l?r:a.domainBind(l,r),void 0!==n&&(n=e.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=s===i?Array(this._length):0===s?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function u(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function c(e,t,n,i){return"function"!=typeof t?r("expecting a function but got "+a.classString(t)):new h(e,t,n,i).promise()}function f(t){this.accum=t,this.array._gotAccum(t);var r=n(this.value,this.array._promise);return r instanceof e?(this.array._currentCancellable=r,r._then(d,void 0,void 0,this,void 0)):d.call(this,r)}function d(t){var r,n=this.array,i=n._promise,o=l(n._fn);i._pushContext(),(r=void 0!==n._eachValues?o.call(i._boundValue(),t,this.index,this.length):o.call(i._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(n._currentCancellable=r);var a=i._popContext();return s.checkForgottenReturns(r,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",i),r}a.inherits(h,t),h.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},h.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},h.prototype._init=function(){},h.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},h.prototype.shouldCopyValues=function(){return!1},h.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},h.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},h.prototype._iterate=function(t){var r,n;this._values=t;var i=t.length;if(void 0!==this._initialValue?(r=this._initialValue,n=0):(r=e.resolve(t[0]),n=1),this._currentCancellable=r,!r.isRejected())for(;n<i;++n){var s={accum:null,value:t[n],index:n,length:i,array:this};r=r._then(f,void 0,void 0,s,void 0)}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(u,u,void 0,r,this)},e.prototype.reduce=function(e,t){return c(this,e,t,null)},e.reduce=function(e,t,r,n){return c(e,t,r,n)}}),DD)(C,v,n,y,p,w),(LD||(LD=1,MD=function(e,t,r){var n=e.PromiseInspection;function i(e){this.constructor$(e)}MF().inherits(i,t),i.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var r=new n;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},i.prototype._promiseRejected=function(e,t){var r=new n;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new i(e).promise()},e.prototype.settle=function(){return e.settle(this)}}),MD)(C,v,w),(zD||(zD=1,BD=function(e,t,r){var n=MF(),i=KD().RangeError,s=KD().AggregateError,o=n.isArray,a={};function l(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function h(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new l(e),i=n.promise();return n.setHowMany(t),n.init(),i}n.inherits(l,t),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(e){this._howMany=e},l.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(a),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new s,t=this.length();t<this._values.length;++t)this._values[t]!==a&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(e){this._values.push(e)},l.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new i(t)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(e,t){return h(e,t)},e.prototype.some=function(e){return h(this,e)},e._SomePromiseArray=l}),BD)(C,v,n),(HD?$D:(HD=1,$D=function(e,t){var r=e.map;e.prototype.filter=function(e,n){return r(this,e,n,t)},e.filter=function(e,n,i){return r(e,n,i,t)}}))(C,p),(VD?UD:(VD=1,UD=function(e,t){var r=e.reduce,n=e.all;function i(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}))(C,p),(qD||(qD=1,WD=function(e){var t=e._SomePromiseArray;function r(e){var r=new t(e),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}e.any=function(e){return r(e)},e.prototype.any=function(){return r(this)}}),WD)(C),a.toFastProperties(C),a.toFastProperties(C.prototype),A({a:1}),A({b:2}),A({c:3}),A(1),A((function(){})),A(void 0),A(!1),A(new C(p)),w.setBounds(h.firstLineError,a.lastLineError),C}}(FF),"undefined"!=typeof Promise&&(XD=Promise);var hj=(0,FF.exports)();hj.noConflict=function(){try{Promise===hj&&(Promise=XD)}catch(e){}return hj};var uj=hj,cj=s.Buffer;void 0===cj.from&&(cj.from=function(e,t,r){return new cj(e,t,r)},cj.alloc=cj.from);var fj=cj,dj=n,pj=uj,mj=o,gj=fj;function yj(){if(!(this instanceof yj))return new yj;dj.Duplex.call(this,{decodeStrings:!1,objectMode:!0}),this.buffer=gj.from("");var e=this;e.on("finish",(function(){e.finished=!0,e.emit("chunk",!1)}))}dj.Writable&&dj.Writable.prototype.destroy||(dj=At()),mj.inherits(yj,dj.Duplex),yj.prototype._write=function(e,t,r){this.buffer=gj.concat([this.buffer,e]),this.cb=r,this.emit("chunk")},yj.prototype.stream=function(e,t){var r,n=dj.PassThrough(),i=this;function s(){if("function"==typeof i.cb){var e=i.cb;return i.cb=void 0,e()}}function o(){var a;if(i.buffer&&i.buffer.length){if("number"==typeof e)a=i.buffer.slice(0,e),i.buffer=i.buffer.slice(e),e-=a.length,r=!e;else{var l=i.buffer.indexOf(e);if(-1!==l)i.match=l,t&&(l+=e.length),a=i.buffer.slice(0,l),i.buffer=i.buffer.slice(l),r=!0;else{var h=i.buffer.length-e.length;h<=0?s():(a=i.buffer.slice(0,h),i.buffer=i.buffer.slice(h))}}a&&n.write(a,(function(){(0===i.buffer.length||e.length&&i.buffer.length<=e.length)&&s()}))}if(r)i.removeListener("chunk",o),n.end();else if(i.finished)return i.removeListener("chunk",o),void i.emit("error",new Error("FILE_ENDED"))}return i.on("chunk",o),o(),n},yj.prototype.pull=function(e,t){if(0===e)return pj.resolve("");if(!isNaN(e)&&this.buffer.length>e){var r=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),pj.resolve(r)}var n,i,s=gj.from(""),o=this,a=dj.Transform();return a._transform=function(e,t,r){s=gj.concat([s,e]),r()},new pj((function(r,l){if(n=l,i=function(e){o.__emittedError=e,l(e)},o.finished)return l(new Error("FILE_ENDED"));o.once("error",i),o.stream(e,t).on("error",l).pipe(a).on("finish",(function(){r(s)})).on("error",l)})).finally((function(){o.removeListener("error",n),o.removeListener("error",i)}))},yj.prototype._read=function(){};var vj=yj,_j=n,bj=o;function wj(){if(!(this instanceof wj))return new wj;_j.Transform.call(this)}_j.Writable&&_j.Writable.prototype.destroy||(_j=At()),bj.inherits(wj,_j.Transform),wj.prototype._transform=function(e,t,r){r()};var xj=wj,kj=uj,Sj=n,Ej=fj;Sj.Writable&&Sj.Writable.prototype.destroy||(Sj=At());var Tj=function(e){return new kj((function(t,r){var n=[],i=Sj.Transform().on("finish",(function(){t(Ej.concat(n))})).on("error",r);i._transform=function(e,t,r){n.push(e),r()},e.on("error",r).pipe(i)}))},Cj=PF,Oj=function(e,t){for(var r;!r&&e&&e.length;){var n=Cj.parse(e).word16lu("signature").word16lu("partsize").word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offset").word64lu("disknum").vars;1===n.signature?r=n:e=e.slice(n.partsize+4)}return r=r||{},4294967295===t.compressedSize&&(t.compressedSize=r.compressedSize),4294967295===t.uncompressedSize&&(t.uncompressedSize=r.uncompressedSize),4294967295===t.offsetToLocalFileHeader&&(t.offsetToLocalFileHeader=r.offset),r},Rj=function(e,t){const r=31&e,n=e>>5&15,i=1980+(e>>9&127),s=t?2*(31&t):0,o=t?t>>5&63:0,a=t?t>>11:0;return new Date(Date.UTC(i,n-1,r,a,o,s))},Aj=o,Nj=c,Ij=n,Pj=PF,Fj=uj,Dj=vj,jj=xj,Mj=Tj,Lj=Oj,Bj=fj,zj=Rj;Ij.Writable&&Ij.Writable.prototype.destroy||(Ij=At());var $j=Bj.alloc(4);function Hj(e){if(!(this instanceof Hj))return new Hj(e);var t=this;t._opts=e||{verbose:!1},Dj.call(t,t._opts),t.on("finish",(function(){t.emit("end"),t.emit("close")})),t._readRecord().catch((function(e){t.__emittedError&&t.__emittedError===e||t.emit("error",e)}))}$j.writeUInt32LE(101010256,0),Aj.inherits(Hj,Dj),Hj.prototype._readRecord=function(){var e=this;return e.pull(4).then((function(t){if(0!==t.length){var r=t.readUInt32LE(0);if(875721283===r)return e._readCrxHeader();if(67324752===r)return e._readFile();if(33639248===r)return e.reachedCD=!0,e._readCentralDirectoryFileHeader();if(101010256===r)return e._readEndOfCentralDirectoryRecord();if(e.reachedCD){return e.pull($j,!0).then((function(){return e._readEndOfCentralDirectoryRecord()}))}e.emit("error",new Error("invalid signature: 0x"+r.toString(16)))}}))},Hj.prototype._readCrxHeader=function(){var e=this;return e.pull(12).then((function(t){return e.crxHeader=Pj.parse(t).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars,e.pull(e.crxHeader.pubKeyLength+e.crxHeader.signatureLength)})).then((function(t){return e.crxHeader.publicKey=t.slice(0,e.crxHeader.pubKeyLength),e.crxHeader.signature=t.slice(e.crxHeader.pubKeyLength),e.emit("crx-header",e.crxHeader),e._readRecord()}))},Hj.prototype._readFile=function(){var e=this;return e.pull(26).then((function(t){var r=Pj.parse(t).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return r.lastModifiedDateTime=zj(r.lastModifiedDate,r.lastModifiedTime),e.crxHeader&&(r.crxHeader=e.crxHeader),e.pull(r.fileNameLength).then((function(t){var n=t.toString("utf8"),i=Ij.PassThrough(),s=!1;return i.autodrain=function(){s=!0;var e=i.pipe(jj());return e.promise=function(){return new Fj((function(t,r){e.on("finish",t),e.on("error",r)}))},e},i.buffer=function(){return Mj(i)},i.path=n,i.props={},i.props.path=n,i.props.pathBuffer=t,i.props.flags={isUnicode:0!=(2048&r.flags)},i.type=0===r.uncompressedSize&&/[\/\\]$/.test(n)?"Directory":"File",e._opts.verbose&&("Directory"===i.type||"File"===i.type&&r.compressionMethod),e.pull(r.extraFieldLength).then((function(t){var n=Lj(t,r);i.vars=r,i.extra=n,e._opts.forceStream?e.push(i):(e.emit("entry",i),(e._readableState.pipesCount||e._readableState.pipes&&e._readableState.pipes.length)&&e.push(i)),e._opts.verbose;var o,a=!(8&r.flags)||r.compressedSize>0;i.__autodraining=s;var l=r.compressionMethod&&!s?Nj.createInflateRaw():Ij.PassThrough();return a?(i.size=r.uncompressedSize,o=r.compressedSize):(o=Bj.alloc(4)).writeUInt32LE(134695760,0),new Fj((function(t,r){e.stream(o).pipe(l).on("error",(function(t){e.emit("error",t)})).pipe(i).on("finish",(function(){return a?e._readRecord().then(t).catch(r):e._processDataDescriptor(i).then(t).catch(r)}))}))}))}))}))},Hj.prototype._processDataDescriptor=function(e){var t=this;return t.pull(16).then((function(r){var n=Pj.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;return e.size=n.uncompressedSize,t._readRecord()}))},Hj.prototype._readCentralDirectoryFileHeader=function(){var e=this;return e.pull(42).then((function(t){var r=Pj.parse(t).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return e.pull(r.fileNameLength).then((function(t){return r.fileName=t.toString("utf8"),e.pull(r.extraFieldLength)})).then((function(t){return e.pull(r.fileCommentLength)})).then((function(t){return e._readRecord()}))}))},Hj.prototype._readEndOfCentralDirectoryRecord=function(){var e=this;return e.pull(18).then((function(t){var r=Pj.parse(t).word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;return e.pull(r.commentLength).then((function(t){t=t.toString("utf8"),e.end(),e.push(null)}))}))},Hj.prototype.promise=function(){var e=this;return new Fj((function(t,r){e.on("finish",t),e.on("error",r)}))};var Uj=Hj,Vj={exports:{}},Wj=At();function qj(e,t,r){void 0===r&&(r=t,t=e,e=null),Wj.Duplex.call(this,e),"function"!=typeof r.read&&(r=new Wj.Readable(e).wrap(r)),this._writable=t,this._readable=r,this._waiting=!1;var n=this;t.once("finish",(function(){n.end()})),this.once("finish",(function(){t.end()})),r.on("readable",(function(){n._waiting&&(n._waiting=!1,n._read())})),r.once("end",(function(){n.push(null)})),e&&void 0!==e.bubbleErrors&&!e.bubbleErrors||(t.on("error",(function(e){n.emit("error",e)})),r.on("error",(function(e){n.emit("error",e)})))}qj.prototype=Object.create(Wj.Duplex.prototype,{constructor:{value:qj}}),qj.prototype._write=function(e,t,r){this._writable.write(e,t,r)},qj.prototype._read=function(){for(var e,t=0;null!==(e=this._readable.read());)this.push(e),t++;0===t&&(this._waiting=!0)},Vj.exports=function(e,t,r){return new qj(e,t,r)},Vj.exports.DuplexWrapper=qj;var Xj=Vj.exports,Zj=n,Gj=Uj,Yj=Xj,Kj=Tj;Zj.Writable&&Zj.Writable.prototype.destroy||(Zj=At());var Qj=function(e,t){var r,n=Zj.PassThrough({objectMode:!0}),i=Zj.PassThrough(),s=Zj.Transform({objectMode:!0}),o=e instanceof RegExp?e:e&&new RegExp(e);s._transform=function(e,t,n){if(r||o&&!o.exec(e.path))return e.autodrain(),n();r=!0,a.emit("entry",e),e.on("error",(function(e){i.emit("error",e)})),e.pipe(i).on("error",(function(e){n(e)})).on("finish",(function(e){n(null,e)}))},n.pipe(Gj(t)).on("error",(function(e){i.emit("error",e)})).pipe(s).on("error",Object).on("finish",(function(){r?i.end():i.emit("error",new Error("PATTERN_NOT_FOUND"))}));var a=Yj(n,i);return a.buffer=function(){return Kj(i)},a},Jj={},eM=rM,tM=n.Stream;function rM(){tM.call(this)}function nM(e,t,r){return e instanceof Error||(e=new Error(e)),e.code=e.code||t,e.path=e.path||r.path,e.fstream_type=e.fstream_type||r.type,e.fstream_path=e.fstream_path||r.path,r._path!==r.path&&(e.fstream_unc_path=e.fstream_unc_path||r._path),r.linkpath&&(e.fstream_linkpath=e.fstream_linkpath||r.linkpath),e.fstream_class=e.fstream_class||r.constructor.name,e.fstream_stack=e.fstream_stack||(new Error).stack.split(/\n/).slice(3).map((function(e){return e.replace(/^ {4}at /,"")})),e}rt()(rM,tM),rM.prototype.on=function(e,t){return"ready"===e&&this.ready?process.nextTick(t.bind(this)):tM.prototype.on.call(this,e,t),this},rM.prototype.abort=function(){this._aborted=!0,this.emit("abort")},rM.prototype.destroy=function(){},rM.prototype.warn=function(e,t){var r=this,n=nM(e,t,r);r.listeners("warn")&&r.emit("warn",n)},rM.prototype.info=function(e,t){this.emit("info",e,t)},rM.prototype.error=function(e,t,r){var n=nM(e,t,this);if(r)throw n;this.emit("error",n)};var iM,sM,oM,aM,lM,hM,uM,cM,fM,dM,pM,mM,gM=function(e){var t,r=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"];if(e.type&&-1!==r.indexOf(e.type))return e[e.type]=!0,e.type;for(var n=0,i=r.length;n<i;n++){var s=e[t=r[n]]||e["is"+t];if("function"==typeof s&&(s=s.call(e)),s)return e[t]=!0,e.type=t,t}return null};function yM(){if(sM)return iM;sM=1,iM=n;var e=eT,t=rt(),r=wM();function n(e){if(!(this instanceof n))throw new Error("LinkReader must be called as constructor.");if(!("Link"===e.type&&e.Link||"SymbolicLink"===e.type&&e.SymbolicLink))throw new Error("Non-link type "+e.type);r.call(this,e)}return t(n,r),n.prototype._stat=function(t){var n=this;e.readlink(n._path,(function(e,i){if(e)return n.error(e);n.linkpath=n.props.linkpath=i,n.emit("linkpath",i),r.prototype._stat.call(n,t)}))},n.prototype._read=function(){var e=this;e._paused||e._ended||(e.emit("end"),e.emit("close"),e._ended=!0)},iM}function vM(){if(aM)return oM;aM=1,oM=s;var e=eT,t=rt(),r=l,n=wM(),i=u.ok;function s(e){var t=this;if(!(t instanceof s))throw new Error("DirReader must be called as constructor.");if("Directory"!==e.type||!e.Directory)throw new Error("Non-directory type "+e.type);t.entries=null,t._index=-1,t._paused=!1,t._length=-1,e.sort&&(this.sort=e.sort),n.call(this,e)}return t(s,n),s.prototype._getEntries=function(){var t=this;t._gotEntries||(t._gotEntries=!0,e.readdir(t._path,(function(e,r){if(e)return t.error(e);function n(){t._length=t.entries.length,"function"==typeof t.sort&&(t.entries=t.entries.sort(t.sort.bind(t))),t._read()}t.entries=r,t.emit("entries",r),t._paused?t.once("resume",n):n()})))},s.prototype._read=function(){var t=this;if(!t.entries)return t._getEntries();if(!(t._paused||t._currentEntry||t._aborted))if(t._index++,t._index>=t.entries.length)t._ended||(t._ended=!0,t.emit("end"),t.emit("close"));else{var s=r.resolve(t._path,t.entries[t._index]);i(s!==t._path),i(t.entries[t._index]),t._currentEntry=s,e[t.props.follow?"stat":"lstat"](s,(function(e,i){if(e)return t.error(e);var o=t._proxy||t;i.path=s,i.basename=r.basename(s),i.dirname=r.dirname(s);var a=t.getChildProps.call(o,i);a.path=s,a.basename=r.basename(s),a.dirname=r.dirname(s);var l=n(a,i);t._currentEntry=l,l.on("pause",(function(e){t._paused||l._disowned||t.pause(e)})),l.on("resume",(function(e){t._paused&&!l._disowned&&t.resume(e)})),l.on("stat",(function(e){t.emit("_entryStat",l,e),l._aborted||(l._paused?l.once("resume",(function(){t.emit("entryStat",l,e)})):t.emit("entryStat",l,e))})),l.on("ready",(function e(){if(t._paused)return l.pause(t),t.once("resume",e);"Socket"===l.type?t.emit("socket",l):t.emitEntry(l)}));var h=!1;function u(){h||(h=!0,t.emit("childEnd",l),t.emit("entryEnd",l),t._currentEntry=null,t._paused||t._read())}l.on("close",u),l.on("disown",u),l.on("error",(function(e){l._swallowErrors?(t.warn(e),l.emit("end"),l.emit("close")):t.emit("error",e)})),["child","childEnd","warn"].forEach((function(e){l.on(e,t.emit.bind(t,e))}))}))}},s.prototype.disown=function(e){e.emit("beforeDisown"),e._disowned=!0,e.parent=e.root=null,e===this._currentEntry&&(this._currentEntry=null),e.emit("disown")},s.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}},s.prototype.pause=function(e){var t=this;t._paused||(e=e||t,t._paused=!0,t._currentEntry&&t._currentEntry.pause&&t._currentEntry.pause(e),t.emit("pause",e))},s.prototype.resume=function(e){var t=this;t._paused&&(e=e||t,t._paused=!1,t.emit("resume",e),t._paused||(t._currentEntry?t._currentEntry.resume&&t._currentEntry.resume(e):t._read()))},s.prototype.emitEntry=function(e){this.emit("entry",e),this.emit("child",e)},oM}function _M(){if(hM)return lM;hM=1,lM=s;var e=eT,t=rt(),r=wM(),n={EOF:!0},i={CLOSE:!0};function s(e){var t=this;if(!(t instanceof s))throw new Error("FileReader must be called as constructor.");if(!("Link"===e.type&&e.Link||"File"===e.type&&e.File))throw new Error("Non-file type "+e.type);t._buffer=[],t._bytesEmitted=0,r.call(t,e)}return t(s,r),s.prototype._getStream=function(){var t=this,r=t._stream=e.createReadStream(t._path,t.props);t.props.blksize&&(r.bufferSize=t.props.blksize),r.on("open",t.emit.bind(t,"open")),r.on("data",(function(e){t._bytesEmitted+=e.length,e.length&&(t._paused||t._buffer.length?(t._buffer.push(e),t._read()):t.emit("data",e))})),r.on("end",(function(){t._paused||t._buffer.length?(t._buffer.push(n),t._read()):t.emit("end"),t._bytesEmitted!==t.props.size&&t.error("Didn't get expected byte count\nexpect: "+t.props.size+"\nactual: "+t._bytesEmitted)})),r.on("close",(function(){t._paused||t._buffer.length?(t._buffer.push(i),t._read()):t.emit("close")})),r.on("error",(function(e){t.emit("error",e)})),t._read()},s.prototype._read=function(){var e=this;if(!e._paused){if(!e._stream)return e._getStream();if(e._buffer.length){for(var t=e._buffer,r=0,s=t.length;r<s;r++){var o=t[r];if(o===n?e.emit("end"):o===i?e.emit("close"):e.emit("data",o),e._paused)return void(e._buffer=t.slice(r))}e._buffer.length=0}}},s.prototype.pause=function(e){var t=this;t._paused||(e=e||t,t._paused=!0,t._stream&&t._stream.pause(),t.emit("pause",e))},s.prototype.resume=function(e){var t=this;t._paused&&(e=e||t,t.emit("resume",e),t._paused=!1,t._stream&&t._stream.resume(),t._read())},lM}function bM(){if(dM)return fM;dM=1,fM=i;var e=wM(),t=gM,r=rt(),n=eT;function i(t){var r=this;if(!(r instanceof i))throw new Error("ProxyReader must be called as constructor.");r.props=t,r._buffer=[],r.ready=!1,e.call(r,t)}return r(i,e),i.prototype._stat=function(){var r=this,i=r.props,s=i.follow?"stat":"lstat";n[s](i.path,(function(n,s){var o;o=n||!s?"File":t(s),i[o]=!0,i.type=r.type=o,r._old=s,r._addProxy(e(i,s))}))},i.prototype._addProxy=function(e){var t=this;if(t._proxyTarget)return t.error("proxy already set");t._proxyTarget=e,e._proxy=t,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach((function(r){e.on(r,t.emit.bind(t,r))})),t.emit("proxy",e),e.on("ready",(function(){t.ready=!0,t.emit("ready")}));var r=t._buffer;t._buffer.length=0,r.forEach((function(t){e[t[0]].apply(e,t[1])}))},i.prototype.pause=function(){return!!this._proxyTarget&&this._proxyTarget.pause()},i.prototype.resume=function(){return!!this._proxyTarget&&this._proxyTarget.resume()},fM}function wM(){if(mM)return pM;mM=1,pM=u;var e=eT,t=n.Stream,r=rt(),i=l,s=gM,o=u.hardLinks={},a=eM;r(u,a);var h=yM();function u(e,t){var r,n,o=this;if(!(o instanceof u))return new u(e,t);switch("string"==typeof e&&(e={path:e}),e.type&&"function"==typeof e.type?n=r=e.type:(r=s(e),n=u),t&&!r&&(e[r=s(t)]=!0,e.type=r),r){case"Directory":n=vM();break;case"Link":case"File":n=_M();break;case"SymbolicLink":n=h;break;case"Socket":n=function(){if(cM)return uM;cM=1,uM=r;var e=rt(),t=wM();function r(e){if(!(this instanceof r))throw new Error("SocketReader must be called as constructor.");if("Socket"!==e.type||!e.Socket)throw new Error("Non-socket type "+e.type);t.call(this,e)}return e(r,t),r.prototype._read=function(){var e=this;e._paused||e._ended||(e.emit("end"),e.emit("close"),e._ended=!0)},uM}();break;case null:n=bM()}if(!(o instanceof n))return new n(e);a.call(o),e.path||o.error("Must provide a path",null,!0),o.readable=!0,o.writable=!1,o.type=r,o.props=e,o.depth=e.depth=e.depth||0,o.parent=e.parent||null,o.root=e.root||e.parent&&e.parent.root||o,o._path=o.path=i.resolve(e.path),"win32"===process.platform&&(o.path=o._path=o.path.replace(/\?/g,"_"),o._path.length>=260&&(o._swallowErrors=!0,o._path="\\\\?\\"+o.path.replace(/\//g,"\\"))),o.basename=e.basename=i.basename(o.path),o.dirname=e.dirname=i.dirname(o.path),e.parent=e.root=null,o.size=e.size,o.filter="function"==typeof e.filter?e.filter:null,"alpha"===e.sort&&(e.sort=c),o._stat(t)}function c(e,t){return e===t?0:e.toLowerCase()>t.toLowerCase()?1:e.toLowerCase()<t.toLowerCase()?-1:e>t?1:-1}return u.prototype._stat=function(t){var r=this,n=r.props,i=n.follow?"stat":"lstat";function a(e,t){if(e)return r.error(e);if(Object.keys(t).forEach((function(e){n[e]=t[e]})),void 0!==r.size&&n.size!==r.size)return r.error("incorrect size");r.size=n.size;var i=s(n);if(!1!==n.hardlinks&&"Directory"!==i&&n.nlink&&n.nlink>1){var a=n.dev+":"+n.ino;o[a]!==r._path&&o[a]?(i=r.type=r.props.type="Link",r.Link=r.props.Link=!0,r.linkpath=r.props.linkpath=o[a],r._stat=r._read=h.prototype._read):o[a]=r._path}if(r.type&&r.type!==i&&r.error("Unexpected type: "+i),r.filter){var l=r._proxy||r;if(!r.filter.call(l,l,n))return void(r._disowned||(r.abort(),r.emit("end"),r.emit("close")))}var u=["_stat","stat","ready"],c=0;!function e(){if(r._aborted)return r.emit("end"),void r.emit("close");if(r._paused&&"Directory"!==r.type)r.once("resume",e);else{var t=u[c++];if(!t)return r._read();r.emit(t,n),e()}}()}t?process.nextTick(a.bind(null,null,t)):e[i](r._path,a)},u.prototype.pipe=function(e){var r=this;return"function"==typeof e.add&&r.on("entry",(function(t){!1===e.add(t)&&r.pause()})),t.prototype.pipe.apply(this,arguments)},u.prototype.pause=function(e){this._paused=!0,e=e||this,this.emit("pause",e),this._stream&&this._stream.pause(e)},u.prototype.resume=function(e){this._paused=!1,e=e||this,this.emit("resume",e),this._stream&&this._stream.resume(e),this._read()},u.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)},pM}var xM=IM;IM.sync=MM;var kM=u,SM=l,EM=r,TM=void 0;try{TM=jR()}catch(e){}var CM=parseInt("666",8),OM={nosort:!0,silent:!0},RM=0,AM="win32"===process.platform;function NM(e){if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((function(t){e[t]=e[t]||EM[t],e[t+="Sync"]=e[t]||EM[t]})),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),!0!==e.disableGlob&&void 0===TM)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||OM}function IM(e,t,r){"function"==typeof t&&(r=t,t={}),kM(e,"rimraf: missing path"),kM(t,"rimraf: invalid options argument provided"),NM(t);var n=0,i=null,s=0;if(t.disableGlob||!TM.hasMagic(e))return o(null,[e]);function o(e,o){return e?r(e):0===(s=o.length)?r():void o.forEach((function(e){PM(e,t,(function o(a){if(a){if(("EBUSY"===a.code||"ENOTEMPTY"===a.code||"EPERM"===a.code)&&n<t.maxBusyTries)return n++,setTimeout((function(){PM(e,t,o)}),100*n);if("EMFILE"===a.code&&RM<t.emfileWait)return setTimeout((function(){PM(e,t,o)}),RM++);"ENOENT"===a.code&&(a=null)}RM=0,function(e){i=i||e,0==--s&&r(i)}(a)}))}))}t.lstat(e,(function(r,n){if(!r)return o(null,[e]);TM(e,t.glob,o)}))}function PM(e,t,r){kM(e),kM(t),kM("function"==typeof r),t.lstat(e,(function(n,i){return n&&"ENOENT"===n.code?r(null):(n&&"EPERM"===n.code&&AM&&FM(e,t,n,r),i&&i.isDirectory()?jM(e,t,n,r):void t.unlink(e,(function(n){if(n){if("ENOENT"===n.code)return r(null);if("EPERM"===n.code)return AM?FM(e,t,n,r):jM(e,t,n,r);if("EISDIR"===n.code)return jM(e,t,n,r)}return r(n)})))}))}function FM(e,t,r,n){kM(e),kM(t),kM("function"==typeof n),r&&kM(r instanceof Error),t.chmod(e,CM,(function(i){i?n("ENOENT"===i.code?null:r):t.stat(e,(function(i,s){i?n("ENOENT"===i.code?null:r):s.isDirectory()?jM(e,t,r,n):t.unlink(e,n)}))}))}function DM(e,t,r){kM(e),kM(t),r&&kM(r instanceof Error);try{t.chmodSync(e,CM)}catch(e){if("ENOENT"===e.code)return;throw r}try{var n=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw r}n.isDirectory()?LM(e,t,r):t.unlinkSync(e)}function jM(e,t,r,n){kM(e),kM(t),r&&kM(r instanceof Error),kM("function"==typeof n),t.rmdir(e,(function(i){!i||"ENOTEMPTY"!==i.code&&"EEXIST"!==i.code&&"EPERM"!==i.code?i&&"ENOTDIR"===i.code?n(r):n(i):function(e,t,r){kM(e),kM(t),kM("function"==typeof r),t.readdir(e,(function(n,i){if(n)return r(n);var s,o=i.length;if(0===o)return t.rmdir(e,r);i.forEach((function(n){IM(SM.join(e,n),t,(function(n){if(!s)return n?r(s=n):void(0==--o&&t.rmdir(e,r))}))}))}))}(e,t,n)}))}function MM(e,t){var r;if(NM(t=t||{}),kM(e,"rimraf: missing path"),kM(t,"rimraf: missing options"),t.disableGlob||!TM.hasMagic(e))r=[e];else try{t.lstatSync(e),r=[e]}catch(n){r=TM.sync(e,t.glob)}if(r.length)for(var n=0;n<r.length;n++){e=r[n];try{var i=t.lstatSync(e)}catch(r){if("ENOENT"===r.code)return;"EPERM"===r.code&&AM&&DM(e,t,r)}try{i&&i.isDirectory()?LM(e,t,null):t.unlinkSync(e)}catch(r){if("ENOENT"===r.code)return;if("EPERM"===r.code)return AM?DM(e,t,r):LM(e,t,r);if("EISDIR"!==r.code)throw r;LM(e,t,r)}}}function LM(e,t,r){kM(e),kM(t),r&&kM(r instanceof Error);try{t.rmdirSync(e)}catch(n){if("ENOENT"===n.code)return;if("ENOTDIR"===n.code)throw r;"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code||function(e,t){kM(e),kM(t),t.readdirSync(e).forEach((function(r){MM(SM.join(e,r),t)}));var r=AM?100:1,n=0;for(;;){var i=!0;try{var s=t.rmdirSync(e,t);return i=!1,s}finally{if(++n<r&&i)continue}}}(e,t)}}var BM=l,zM=r,$M=parseInt("0777",8),HM=UM.mkdirp=UM.mkdirP=UM;function UM(e,t,r,n){"function"==typeof t?(r=t,t={}):t&&"object"==typeof t||(t={mode:t});var i=t.mode,s=t.fs||zM;void 0===i&&(i=$M),n||(n=null);var o=r||function(){};e=BM.resolve(e),s.mkdir(e,i,(function(r){if(!r)return o(null,n=n||e);if("ENOENT"===r.code){if(BM.dirname(e)===e)return o(r);UM(BM.dirname(e),t,(function(r,n){r?o(r,n):UM(e,t,o,n)}))}else s.stat(e,(function(e,t){e||!t.isDirectory()?o(r,n):o(null,n)}))}))}UM.sync=function e(t,r,n){r&&"object"==typeof r||(r={mode:r});var i=r.mode,s=r.fs||zM;void 0===i&&(i=$M),n||(n=null),t=BM.resolve(t);try{s.mkdirSync(t,i),n=n||t}catch(i){if("ENOENT"===i.code)n=e(BM.dirname(t),r,n),e(t,r,n);else{var o;try{o=s.statSync(t)}catch(e){throw i}if(!o.isDirectory())throw i}}return n};var VM,WM,qM,XM,ZM,GM,YM,KM,QM,JM,eL=function e(t){if(t._collected)return;if(t._paused)return t.on("resume",e.bind(null,t));t._collected=!0,t.pause(),t.on("data",n),t.on("end",n);var r=[];function n(e){"string"==typeof e&&(e=new Buffer(e)),Buffer.isBuffer(e)&&!e.length||r.push(e)}t.on("entry",s);var i=[];function s(t){e(t),i.push(t)}t.on("proxy",(function(e){e.pause()})),t.pipe=(o=t.pipe,function(e){var a=0;return function l(){var h=i[a++];if(!h)return t.removeListener("entry",s),t.removeListener("data",n),t.removeListener("end",n),t.pipe=o,e&&t.pipe(e),r.forEach((function(e){e?t.emit("data",e):t.emit("end")})),void t.resume();h.on("end",l),e?e.add(h):t.emit("entry",h)}(),e});var o};function tL(){if(WM)return VM;WM=1,VM=s;var e=sL(),t=rt(),r=HM,n=l,i=eL;function s(t){var r=this;r instanceof s||r.error("DirWriter must be called as constructor.",null,!0),"Directory"===t.type&&t.Directory||r.error("Non-directory type "+t.type+" "+JSON.stringify(t),null,!0),e.call(this,t)}return t(s,e),s.prototype._create=function(){var t=this;r(t._path,e.dirmode,(function(e){if(e)return t.error(e);t.ready=!0,t.emit("ready"),t._process()}))},s.prototype.write=function(){return!0},s.prototype.end=function(){this._ended=!0,this._process()},s.prototype.add=function(e){var t=this;return i(e),!t.ready||t._currentEntry?(t._buffer.push(e),!1):t._ended?t.error("add after end"):(t._buffer.push(e),t._process(),0===this._buffer.length)},s.prototype._process=function(){var t=this;if(!t._processing){var r=t._buffer.shift();if(!r)return t.emit("drain"),void(t._ended&&t._finish());t._processing=!0,t.emit("entry",r);var i,s=r;do{if((i=s._path||s.path)===t.root._path||i===t._path||i&&0===i.indexOf(t._path))return t._processing=!1,r._collected&&r.pipe(),t._process();s=s.parent}while(s);var o={parent:t,root:t.root||t,type:r.type,depth:t.depth+1};i=r._path||r.path||r.props.path,r.parent&&(i=i.substr(r.parent._path.length+1)),o.path=n.join(t.path,n.join("/",i)),o.filter=t.filter,Object.keys(r.props).forEach((function(e){o.hasOwnProperty(e)||(o[e]=r.props[e])}));var a=t._currentChild=new e(o);a.on("ready",(function(){r.pipe(a),r.resume()})),a.on("error",(function(e){a._swallowErrors?(t.warn(e),a.emit("end"),a.emit("close")):t.emit("error",e)})),a.on("close",(function(){if(l)return;l=!0,t._currentChild=null,t._processing=!1,t._process()}));var l=!1}},VM}function rL(){if(XM)return qM;XM=1,qM=s;var e=eT,t=sL(),r=rt(),n=l,i=xM;function s(e){if(!(this instanceof s))throw new Error("LinkWriter must be called as constructor.");if(!("Link"===e.type&&e.Link||"SymbolicLink"===e.type&&e.SymbolicLink))throw new Error("Non-link type "+e.type);""===e.linkpath&&(e.linkpath="."),e.linkpath||this.error("Need linkpath property to create "+e.type),t.call(this,e)}function o(t,r,n){i(t._path,(function(i){if(i)return t.error(i);!function(t,r,n){e[n](r,t._path,(function(e){if(e){if("ENOENT"!==e.code&&"EACCES"!==e.code&&"EPERM"!==e.code||"win32"!==process.platform)return t.error(e);t.ready=!0,t.emit("ready"),t.emit("end"),t.emit("close"),t.end=t._finish=function(){}}a(t)}))}(t,r,n)}))}function a(e){e.ready=!0,e.emit("ready"),e._ended&&!e._finished&&e._finish()}return r(s,t),s.prototype._create=function(){var t=this,r="Link"===t.type||"win32"===process.platform,i=r?"link":"symlink",s=r?n.resolve(t.dirname,t.linkpath):t.linkpath;if(r)return o(t,s,i);e.readlink(t._path,(function(e,r){if(r&&r===s)return a(t);o(t,s,i)}))},s.prototype.end=function(){this._ended=!0,this.ready&&(this._finished=!0,this._finish())},qM}function nL(){if(GM)return ZM;GM=1,ZM=i;var e=eT,t=sL(),r=rt(),n={};function i(e){var r=this;if(!(r instanceof i))throw new Error("FileWriter must be called as constructor.");if("File"!==e.type||!e.File)throw new Error("Non-file type "+e.type);r._buffer=[],r._bytesWritten=0,t.call(this,e)}return r(i,t),i.prototype._create=function(){var r=this;if(!r._stream){var i={};r.props.flags&&(i.flags=r.props.flags),i.mode=t.filemode,r._old&&r._old.blksize&&(i.bufferSize=r._old.blksize),r._stream=e.createWriteStream(r._path,i),r._stream.on("open",(function(){r.ready=!0,r._buffer.forEach((function(e){e===n?r._stream.end():r._stream.write(e)})),r.emit("ready"),r.emit("drain")})),r._stream.on("error",(function(e){r.emit("error",e)})),r._stream.on("drain",(function(){r.emit("drain")})),r._stream.on("close",(function(){r._finish()}))}},i.prototype.write=function(e){var t=this;if(t._bytesWritten+=e.length,!t.ready){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new Error("invalid write data");return t._buffer.push(e),!1}var r=t._stream.write(e);return!1===r&&t._stream._queue?t._stream._queue.length<=2:r},i.prototype.end=function(e){var t=this;return e&&t.write(e),t.ready?t._stream.end():(t._buffer.push(n),!1)},i.prototype._finish=function(){var e=this;"number"==typeof e.size&&e._bytesWritten!==e.size&&e.error("Did not get expected byte count.\nexpect: "+e.size+"\nactual: "+e._bytesWritten),t.prototype._finish.call(e)},ZM}function iL(){if(KM)return YM;KM=1,YM=o;var e=sL(),t=gM,n=rt(),i=eL,s=r;function o(t){var r=this;if(!(r instanceof o))throw new Error("ProxyWriter must be called as constructor.");r.props=t,r._needDrain=!1,e.call(r,t)}return n(o,e),o.prototype._stat=function(){var r=this,n=r.props,i=n.follow?"stat":"lstat";s[i](n.path,(function(i,s){var o;o=i||!s?"File":t(s),n[o]=!0,n.type=r.type=o,r._old=s,r._addProxy(e(n,s))}))},o.prototype._addProxy=function(e){var t=this;if(t._proxy)return t.error("proxy already set");t._proxy=e,["ready","error","close","pipe","drain","warn"].forEach((function(r){e.on(r,t.emit.bind(t,r))})),t.emit("proxy",e),t._buffer.forEach((function(t){e[t[0]].apply(e,t[1])})),t._buffer.length=0,t._needsDrain&&t.emit("drain")},o.prototype.add=function(e){return i(e),this._proxy?this._proxy.add(e):(this._buffer.push(["add",[e]]),this._needDrain=!0,!1)},o.prototype.write=function(e){return this._proxy?this._proxy.write(e):(this._buffer.push(["write",[e]]),this._needDrain=!0,!1)},o.prototype.end=function(e){return this._proxy?this._proxy.end(e):(this._buffer.push(["end",[e]]),!1)},YM}function sL(){if(JM)return QM;JM=1,QM=d;var e=eT,t=rt(),r=xM,n=HM,i=l,s="win32"===process.platform?0:process.umask(),o=gM,a=eM;t(d,a),d.dirmode=parseInt("0777",8)&~s,d.filemode=parseInt("0666",8)&~s;var h=tL(),u=rL(),c=nL(),f=iL();function d(e,t){var r=this;"string"==typeof e&&(e={path:e});var n=d;switch(o(e)){case"Directory":n=h;break;case"File":n=c;break;case"Link":case"SymbolicLink":n=u;break;default:n=f}if(!(r instanceof n))return new n(e);a.call(r),e.path||r.error("Must provide a path",null,!0),r.type=e.type,r.props=e,r.depth=e.depth||0,r.clobber=!1!==e.clobber||e.clobber,r.parent=e.parent||null,r.root=e.root||e.parent&&e.parent.root||r,r._path=r.path=i.resolve(e.path),"win32"===process.platform&&(r.path=r._path=r.path.replace(/\?/g,"_"),r._path.length>=260&&(r._swallowErrors=!0,r._path="\\\\?\\"+r.path.replace(/\//g,"\\"))),r.basename=i.basename(e.path),r.dirname=i.dirname(e.path),r.linkpath=e.linkpath||null,e.parent=e.root=null,r.size=e.size,"string"==typeof e.mode&&(e.mode=parseInt(e.mode,8)),r.readable=!1,r.writable=!0,r._buffer=[],r.ready=!1,r.filter="function"==typeof e.filter?e.filter:null,r._stat(t)}function p(e){n(i.dirname(e._path),d.dirmode,(function(t,r){return t?e.error(t):(e._madeDir=r,e._create())}))}function m(t,r,n,i,s){var o=r.mode,a=r.follow||"SymbolicLink"!==t.type?"chmod":"lchmod";if(!e[a])return s();if("number"!=typeof o)return s();var l=n.mode&parseInt("0777",8);if((o&=parseInt("0777",8))===l)return s();e[a](i,o,s)}function g(t,r,n,i,s){if("win32"===process.platform)return s();if(!process.getuid||0!==process.getuid())return s();if("number"!=typeof r.uid&&"number"!=typeof r.gid)return s();if(n.uid===r.uid&&n.gid===r.gid)return s();var o=t.props.follow||"SymbolicLink"!==t.type?"chown":"lchown";if(!e[o])return s();"number"!=typeof r.uid&&(r.uid=n.uid),"number"!=typeof r.gid&&(r.gid=n.gid),e[o](i,r.uid,r.gid,s)}function y(t,r,n,i,s){if(!e.utimes||"win32"===process.platform)return s();var o=r.follow||"SymbolicLink"!==t.type?"utimes":"lutimes";if("lutimes"!==o||e[o]||(o="utimes"),!e[o])return s();var a=n.atime,l=n.mtime,h=r.atime,u=r.mtime;if(void 0===h&&(h=a),void 0===u&&(u=l),_(h)||(h=new Date(h)),_(u)||(h=new Date(u)),h.getTime()===a.getTime()&&u.getTime()===l.getTime())return s();e[o](i,h,u,s)}function v(t,r,n){var s=t._madeDir,o=i.dirname(r);!function(t,r,n){var i={};Object.keys(t.props).forEach((function(e){i[e]=t.props[e],"mode"===e&&"Directory"!==t.type&&(i[e]=i[e]|parseInt("0111",8))}));var s=3,o=null;function a(e){if(!o)return e?n(o=e):0==--s?n():void 0}e.stat(r,(function(e,s){if(e)return n(o=e);m(t,i,s,r,a),g(t,i,s,r,a),y(t,i,s,r,a)}))}(t,o,(function(e){return e?n(e):o===s?n():void v(t,o,n)}))}function _(e){return"object"==typeof e&&"[object Date]"===function(e){return Object.prototype.toString.call(e)}(e)}return d.prototype._create=function(){var t=this;e[t.props.follow?"stat":"lstat"](t._path,(function(e){if(e)return t.warn("Cannot create "+t._path+"\nUnsupported type: "+t.type,"ENOTSUP");t._finish()}))},d.prototype._stat=function(t){var n=this,i=n.props.follow?"stat":"lstat",s=n._proxy||n;function a(e,t){return n.filter&&!n.filter.call(s,s,t)?(n._aborted=!0,n.emit("end"),void n.emit("close")):e||!t?p(n):(n._old=t,o(t)!==n.type||"File"===n.type&&t.nlink>1?r(n._path,(function(e){if(e)return n.error(e);n._old=null,p(n)})):void p(n))}t?a(null,t):e[i](n._path,a)},d.prototype._finish=function(){var t=this;if(t._finishing);else{t._finishing=!0;var r=0,n=null,i=!1;if(t._old)t._old.atime=new Date(0),t._old.mtime=new Date(0),o(t._old);else{var s=t.props.follow?"stat":"lstat";e[s](t._path,(function(e,r){if(e)return"ENOENT"!==e.code||"Link"!==t.type&&"SymbolicLink"!==t.type||"win32"!==process.platform?t.error(e):(t.ready=!0,t.emit("ready"),t.emit("end"),t.emit("close"),void(t.end=t._finish=function(){}));o(t._old=r)}))}}function o(e){r+=3,m(t,t.props,e,t._path,a("chmod")),g(t,t.props,e,t._path,a("chown")),y(t,t.props,e,t._path,a("utimes"))}function a(e){return function(s){if(!n){if(s)return s.fstream_finish_call=e,t.error(n=s);if(!(--r>0||i)){if(i=!0,!t._madeDir)return o();v(t,t._path,o)}}function o(e){if(e)return e.fstream_finish_call="setupMadeDir",t.error(e);t.emit("end"),t.emit("close")}}}},d.prototype.pipe=function(){this.error("Can't pipe from writable stream")},d.prototype.add=function(){this.error("Can't add to non-Directory type")},d.prototype.write=function(){return!0},QM}!function(e){e.Abstract=eM,e.Reader=wM(),e.Writer=sL(),e.File={Reader:_M(),Writer:nL()},e.Dir={Reader:vM(),Writer:tL()},e.Link={Reader:yM(),Writer:rL()},e.Proxy={Reader:bM(),Writer:iL()},e.Reader.Dir=e.DirReader=e.Dir.Reader,e.Reader.File=e.FileReader=e.File.Reader,e.Reader.Link=e.LinkReader=e.Link.Reader,e.Reader.Proxy=e.ProxyReader=e.Proxy.Reader,e.Writer.Dir=e.DirWriter=e.Dir.Writer,e.Writer.File=e.FileWriter=e.File.Writer,e.Writer.Link=e.LinkWriter=e.Link.Writer,e.Writer.Proxy=e.ProxyWriter=e.Proxy.Writer,e.collect=eL}(Jj);var oL=function(e){e.path=hL.resolve(hL.normalize(e.path));var t=new aL(e),r=new uL.Writable({objectMode:!0});r._write=function(t,r,n){if("Directory"==t.type)return n();var i=hL.join(e.path,t.path);if(0!=i.indexOf(e.path))return n();const s=e.getWriter?e.getWriter({path:i}):lL({path:i});t.pipe(s).on("error",n).on("close",n)};var n=cL(t,r);return t.once("crx-header",(function(e){n.crxHeader=e})),t.pipe(r).on("finish",(function(){n.emit("close")})),n.promise=function(){return new fL((function(e,t){n.on("close",e),n.on("error",t)}))},n},aL=Uj,lL=Jj.Writer,hL=l,uL=n,cL=Xj,fL=uj;var dL={exports:{}};!function(e){var t=function(e){var r=1e7,n=7,i=9007199254740992,s=d(i),o="0123456789abcdefghijklmnopqrstuvwxyz",a="function"==typeof BigInt;function l(e,t,r,n){return void 0===e?l[0]:void 0!==t&&(10!=+t||r)?q(e,t,r,n):K(e)}function h(e,t){this.value=e,this.sign=t,this.isSmall=!1}function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}function c(e){this.value=e}function f(e){return-i<e&&e<i}function d(e){return e<1e7?[e]:e<1e14?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/1e14)]}function p(e){m(e);var t=e.length;if(t<4&&N(e,s)<0)switch(t){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*r;default:return e[0]+(e[1]+e[2]*r)*r}return e}function m(e){for(var t=e.length;0===e[--t];);e.length=t+1}function g(e){for(var t=new Array(e),r=-1;++r<e;)t[r]=0;return t}function y(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,t){var n,i,s=e.length,o=t.length,a=new Array(s),l=0,h=r;for(i=0;i<o;i++)l=(n=e[i]+t[i]+l)>=h?1:0,a[i]=n-l*h;for(;i<s;)l=(n=e[i]+l)===h?1:0,a[i++]=n-l*h;return l>0&&a.push(l),a}function _(e,t){return e.length>=t.length?v(e,t):v(t,e)}function b(e,t){var n,i,s=e.length,o=new Array(s),a=r;for(i=0;i<s;i++)n=e[i]-a+t,t=Math.floor(n/a),o[i]=n-t*a,t+=1;for(;t>0;)o[i++]=t%a,t=Math.floor(t/a);return o}function w(e,t){var n,i,s=e.length,o=t.length,a=new Array(s),l=0,h=r;for(n=0;n<o;n++)(i=e[n]-l-t[n])<0?(i+=h,l=1):l=0,a[n]=i;for(n=o;n<s;n++){if(!((i=e[n]-l)<0)){a[n++]=i;break}i+=h,a[n]=i}for(;n<s;n++)a[n]=e[n];return m(a),a}function x(e,t,n){var i,s,o=e.length,a=new Array(o),l=-t,c=r;for(i=0;i<o;i++)s=e[i]+l,l=Math.floor(s/c),s%=c,a[i]=s<0?s+c:s;return"number"==typeof(a=p(a))?(n&&(a=-a),new u(a)):new h(a,n)}function k(e,t){var n,i,s,o,a=e.length,l=t.length,h=g(a+l),u=r;for(s=0;s<a;++s){o=e[s];for(var c=0;c<l;++c)n=o*t[c]+h[s+c],i=Math.floor(n/u),h[s+c]=n-i*u,h[s+c+1]+=i}return m(h),h}function S(e,t){var n,i,s=e.length,o=new Array(s),a=r,l=0;for(i=0;i<s;i++)n=e[i]*t+l,l=Math.floor(n/a),o[i]=n-l*a;for(;l>0;)o[i++]=l%a,l=Math.floor(l/a);return o}function E(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function T(e,t){var r=Math.max(e.length,t.length);if(r<=30)return k(e,t);r=Math.ceil(r/2);var n=e.slice(r),i=e.slice(0,r),s=t.slice(r),o=t.slice(0,r),a=T(i,o),l=T(n,s),h=T(_(i,n),_(o,s)),u=_(_(a,E(w(w(h,a),l),r)),E(l,2*r));return m(u),u}function C(e,t,n){return new h(e<r?S(t,e):k(t,d(e)),n)}function O(e){var t,n,i,s,o=e.length,a=g(o+o),l=r;for(i=0;i<o;i++){n=0-(s=e[i])*s;for(var h=i;h<o;h++)t=s*e[h]*2+a[i+h]+n,n=Math.floor(t/l),a[i+h]=t-n*l;a[i+o]=n}return m(a),a}function R(e,t){var n,i,s,o,a=e.length,l=g(a),h=r;for(s=0,n=a-1;n>=0;--n)s=(o=s*h+e[n])-(i=y(o/t))*t,l[n]=0|i;return[l,0|s]}function A(e,t){var n,i=K(t);if(a)return[new c(e.value/i.value),new c(e.value%i.value)];var s,o=e.value,f=i.value;if(0===f)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new u(y(o/f)),new u(o%f)]:[l[0],e];if(i.isSmall){if(1===f)return[e,l[0]];if(-1==f)return[e.negate(),l[0]];var v=Math.abs(f);if(v<r){s=p((n=R(o,v))[0]);var _=n[1];return e.sign&&(_=-_),"number"==typeof s?(e.sign!==i.sign&&(s=-s),[new u(s),new u(_)]):[new h(s,e.sign!==i.sign),new u(_)]}f=d(v)}var b=N(o,f);if(-1===b)return[l[0],e];if(0===b)return[l[e.sign===i.sign?1:-1],l[0]];n=o.length+f.length<=200?function(e,t){var n,i,s,o,a,l,h,u=e.length,c=t.length,f=r,d=g(t.length),m=t[c-1],y=Math.ceil(f/(2*m)),v=S(e,y),_=S(t,y);for(v.length<=u&&v.push(0),_.push(0),m=_[c-1],i=u-c;i>=0;i--){for(n=f-1,v[i+c]!==m&&(n=Math.floor((v[i+c]*f+v[i+c-1])/m)),s=0,o=0,l=_.length,a=0;a<l;a++)s+=n*_[a],h=Math.floor(s/f),o+=v[i+a]-(s-h*f),s=h,o<0?(v[i+a]=o+f,o=-1):(v[i+a]=o,o=0);for(;0!==o;){for(n-=1,s=0,a=0;a<l;a++)(s+=v[i+a]-f+_[a])<0?(v[i+a]=s+f,s=0):(v[i+a]=s,s=1);o+=s}d[i]=n}return v=R(v,y)[0],[p(d),p(v)]}(o,f):function(e,t){for(var n,i,s,o,a,l=e.length,h=t.length,u=[],c=[],f=r;l;)if(c.unshift(e[--l]),m(c),N(c,t)<0)u.push(0);else{s=c[(i=c.length)-1]*f+c[i-2],o=t[h-1]*f+t[h-2],i>h&&(s=(s+1)*f),n=Math.ceil(s/o);do{if(N(a=S(t,n),c)<=0)break;n--}while(n);u.push(n),c=w(c,a)}return u.reverse(),[p(u),p(c)]}(o,f),s=n[0];var x=e.sign!==i.sign,k=n[1],E=e.sign;return"number"==typeof s?(x&&(s=-s),s=new u(s)):s=new h(s,x),"number"==typeof k?(E&&(k=-k),k=new u(k)):k=new h(k,E),[s,k]}function N(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var r=e.length-1;r>=0;r--)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return 0}function I(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function P(e,r){for(var n,i,s,o=e.prev(),a=o,l=0;a.isEven();)a=a.divide(2),l++;e:for(i=0;i<r.length;i++)if(!e.lesser(r[i])&&!(s=t(r[i]).modPow(a,e)).isUnit()&&!s.equals(o)){for(n=l-1;0!=n;n--){if((s=s.square().mod(e)).isUnit())return!1;if(s.equals(o))continue e}return!1}return!0}h.prototype=Object.create(l.prototype),u.prototype=Object.create(l.prototype),c.prototype=Object.create(l.prototype),h.prototype.add=function(e){var t=K(e);if(this.sign!==t.sign)return this.subtract(t.negate());var r=this.value,n=t.value;return t.isSmall?new h(b(r,Math.abs(n)),this.sign):new h(_(r,n),this.sign)},h.prototype.plus=h.prototype.add,u.prototype.add=function(e){var t=K(e),r=this.value;if(r<0!==t.sign)return this.subtract(t.negate());var n=t.value;if(t.isSmall){if(f(r+n))return new u(r+n);n=d(Math.abs(n))}return new h(b(n,Math.abs(r)),r<0)},u.prototype.plus=u.prototype.add,c.prototype.add=function(e){return new c(this.value+K(e).value)},c.prototype.plus=c.prototype.add,h.prototype.subtract=function(e){var t=K(e);if(this.sign!==t.sign)return this.add(t.negate());var r=this.value,n=t.value;return t.isSmall?x(r,Math.abs(n),this.sign):function(e,t,r){var n;return N(e,t)>=0?n=w(e,t):(n=w(t,e),r=!r),"number"==typeof(n=p(n))?(r&&(n=-n),new u(n)):new h(n,r)}(r,n,this.sign)},h.prototype.minus=h.prototype.subtract,u.prototype.subtract=function(e){var t=K(e),r=this.value;if(r<0!==t.sign)return this.add(t.negate());var n=t.value;return t.isSmall?new u(r-n):x(n,Math.abs(r),r>=0)},u.prototype.minus=u.prototype.subtract,c.prototype.subtract=function(e){return new c(this.value-K(e).value)},c.prototype.minus=c.prototype.subtract,h.prototype.negate=function(){return new h(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},c.prototype.negate=function(){return new c(-this.value)},h.prototype.abs=function(){return new h(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},c.prototype.abs=function(){return new c(this.value>=0?this.value:-this.value)},h.prototype.multiply=function(e){var t,n,i,s=K(e),o=this.value,a=s.value,u=this.sign!==s.sign;if(s.isSmall){if(0===a)return l[0];if(1===a)return this;if(-1===a)return this.negate();if((t=Math.abs(a))<r)return new h(S(o,t),u);a=d(t)}return n=o.length,i=a.length,new h(-.012*n-.012*i+15e-6*n*i>0?T(o,a):k(o,a),u)},h.prototype.times=h.prototype.multiply,u.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new u(e.value*this.value):C(Math.abs(e.value),d(Math.abs(this.value)),this.sign!==e.sign)},h.prototype._multiplyBySmall=function(e){return 0===e.value?l[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return K(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,c.prototype.multiply=function(e){return new c(this.value*K(e).value)},c.prototype.times=c.prototype.multiply,h.prototype.square=function(){return new h(O(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return f(e)?new u(e):new h(O(d(Math.abs(this.value))),!1)},c.prototype.square=function(e){return new c(this.value*this.value)},h.prototype.divmod=function(e){var t=A(this,e);return{quotient:t[0],remainder:t[1]}},c.prototype.divmod=u.prototype.divmod=h.prototype.divmod,h.prototype.divide=function(e){return A(this,e)[0]},c.prototype.over=c.prototype.divide=function(e){return new c(this.value/K(e).value)},u.prototype.over=u.prototype.divide=h.prototype.over=h.prototype.divide,h.prototype.mod=function(e){return A(this,e)[1]},c.prototype.mod=c.prototype.remainder=function(e){return new c(this.value%K(e).value)},u.prototype.remainder=u.prototype.mod=h.prototype.remainder=h.prototype.mod,h.prototype.pow=function(e){var t,r,n,i=K(e),s=this.value,o=i.value;if(0===o)return l[1];if(0===s)return l[0];if(1===s)return l[1];if(-1===s)return i.isEven()?l[1]:l[-1];if(i.sign)return l[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&f(t=Math.pow(s,o)))return new u(y(t));for(r=this,n=l[1];!0&o&&(n=n.times(r),--o),0!==o;)o/=2,r=r.square();return n},u.prototype.pow=h.prototype.pow,c.prototype.pow=function(e){var t=K(e),r=this.value,n=t.value,i=BigInt(0),s=BigInt(1),o=BigInt(2);if(n===i)return l[1];if(r===i)return l[0];if(r===s)return l[1];if(r===BigInt(-1))return t.isEven()?l[1]:l[-1];if(t.isNegative())return new c(i);for(var a=this,h=l[1];(n&s)===s&&(h=h.times(a),--n),n!==i;)n/=o,a=a.square();return h},h.prototype.modPow=function(e,t){if(e=K(e),(t=K(t)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=l[1],n=this.mod(t);for(e.isNegative()&&(e=e.multiply(l[-1]),n=n.modInv(t));e.isPositive();){if(n.isZero())return l[0];e.isOdd()&&(r=r.multiply(n).mod(t)),e=e.divide(2),n=n.square().mod(t)}return r},c.prototype.modPow=u.prototype.modPow=h.prototype.modPow,h.prototype.compareAbs=function(e){var t=K(e),r=this.value,n=t.value;return t.isSmall?1:N(r,n)},u.prototype.compareAbs=function(e){var t=K(e),r=Math.abs(this.value),n=t.value;return t.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},c.prototype.compareAbs=function(e){var t=this.value,r=K(e).value;return(t=t>=0?t:-t)===(r=r>=0?r:-r)?0:t>r?1:-1},h.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=K(e),r=this.value,n=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:N(r,n)*(this.sign?-1:1)},h.prototype.compareTo=h.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=K(e),r=this.value,n=t.value;return t.isSmall?r==n?0:r>n?1:-1:r<0!==t.sign?r<0?-1:1:r<0?1:-1},u.prototype.compareTo=u.prototype.compare,c.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,r=K(e).value;return t===r?0:t>r?1:-1},c.prototype.compareTo=c.prototype.compare,h.prototype.equals=function(e){return 0===this.compare(e)},c.prototype.eq=c.prototype.equals=u.prototype.eq=u.prototype.equals=h.prototype.eq=h.prototype.equals,h.prototype.notEquals=function(e){return 0!==this.compare(e)},c.prototype.neq=c.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=h.prototype.neq=h.prototype.notEquals,h.prototype.greater=function(e){return this.compare(e)>0},c.prototype.gt=c.prototype.greater=u.prototype.gt=u.prototype.greater=h.prototype.gt=h.prototype.greater,h.prototype.lesser=function(e){return this.compare(e)<0},c.prototype.lt=c.prototype.lesser=u.prototype.lt=u.prototype.lesser=h.prototype.lt=h.prototype.lesser,h.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},c.prototype.geq=c.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=h.prototype.geq=h.prototype.greaterOrEquals,h.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},c.prototype.leq=c.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=h.prototype.leq=h.prototype.lesserOrEquals,h.prototype.isEven=function(){return 0==(1&this.value[0])},u.prototype.isEven=function(){return 0==(1&this.value)},c.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},h.prototype.isOdd=function(){return 1==(1&this.value[0])},u.prototype.isOdd=function(){return 1==(1&this.value)},c.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},h.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},c.prototype.isPositive=u.prototype.isPositive,h.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},c.prototype.isNegative=u.prototype.isNegative,h.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return 1===Math.abs(this.value)},c.prototype.isUnit=function(){return this.abs().value===BigInt(1)},h.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return 0===this.value},c.prototype.isZero=function(){return this.value===BigInt(0)},h.prototype.isDivisibleBy=function(e){var t=K(e);return!t.isZero()&&(!!t.isUnit()||(0===t.compareAbs(2)?this.isEven():this.mod(t).isZero()))},c.prototype.isDivisibleBy=u.prototype.isDivisibleBy=h.prototype.isDivisibleBy,h.prototype.isPrime=function(r){var n=I(this);if(n!==e)return n;var i=this.abs(),s=i.bitLength();if(s<=64)return P(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*s.toJSNumber(),a=Math.ceil(!0===r?2*Math.pow(o,2):o),l=[],h=0;h<a;h++)l.push(t(h+2));return P(i,l)},c.prototype.isPrime=u.prototype.isPrime=h.prototype.isPrime,h.prototype.isProbablePrime=function(r,n){var i=I(this);if(i!==e)return i;for(var s=this.abs(),o=r===e?5:r,a=[],l=0;l<o;l++)a.push(t.randBetween(2,s.minus(2),n));return P(s,a)},c.prototype.isProbablePrime=u.prototype.isProbablePrime=h.prototype.isProbablePrime,h.prototype.modInv=function(e){for(var r,n,i,s=t.zero,o=t.one,a=K(e),l=this.abs();!l.isZero();)r=a.divide(l),n=s,i=a,s=o,a=l,o=n.subtract(r.multiply(o)),l=i.subtract(r.multiply(l));if(!a.isUnit())throw new Error(this.toString()+" and "+e.toString()+" are not co-prime");return-1===s.compare(0)&&(s=s.add(e)),this.isNegative()?s.negate():s},c.prototype.modInv=u.prototype.modInv=h.prototype.modInv,h.prototype.next=function(){var e=this.value;return this.sign?x(e,1,this.sign):new h(b(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<i?new u(e+1):new h(s,!1)},c.prototype.next=function(){return new c(this.value+BigInt(1))},h.prototype.prev=function(){var e=this.value;return this.sign?new h(b(e,1),!0):x(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-i?new u(e-1):new h(s,!0)},c.prototype.prev=function(){return new c(this.value-BigInt(1))};for(var F=[1];2*F[F.length-1]<=r;)F.push(2*F[F.length-1]);var D=F.length,j=F[D-1];function M(e){return Math.abs(e)<=r}function L(e,r,n){r=K(r);for(var i=e.isNegative(),s=r.isNegative(),o=i?e.not():e,a=s?r.not():r,l=0,h=0,u=null,c=null,f=[];!o.isZero()||!a.isZero();)l=(u=A(o,j))[1].toJSNumber(),i&&(l=j-1-l),h=(c=A(a,j))[1].toJSNumber(),s&&(h=j-1-h),o=u[0],a=c[0],f.push(n(l,h));for(var d=0!==n(i?1:0,s?1:0)?t(-1):t(0),p=f.length-1;p>=0;p-=1)d=d.multiply(j).add(t(f[p]));return d}h.prototype.shiftLeft=function(e){var t=K(e).toJSNumber();if(!M(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftRight(-t);var r=this;if(r.isZero())return r;for(;t>=D;)r=r.multiply(j),t-=D-1;return r.multiply(F[t])},c.prototype.shiftLeft=u.prototype.shiftLeft=h.prototype.shiftLeft,h.prototype.shiftRight=function(e){var t,r=K(e).toJSNumber();if(!M(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=D;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(t=A(n,j))[1].isNegative()?t[0].prev():t[0],r-=D-1}return(t=A(n,F[r]))[1].isNegative()?t[0].prev():t[0]},c.prototype.shiftRight=u.prototype.shiftRight=h.prototype.shiftRight,h.prototype.not=function(){return this.negate().prev()},c.prototype.not=u.prototype.not=h.prototype.not,h.prototype.and=function(e){return L(this,e,(function(e,t){return e&t}))},c.prototype.and=u.prototype.and=h.prototype.and,h.prototype.or=function(e){return L(this,e,(function(e,t){return e|t}))},c.prototype.or=u.prototype.or=h.prototype.or,h.prototype.xor=function(e){return L(this,e,(function(e,t){return e^t}))},c.prototype.xor=u.prototype.xor=h.prototype.xor;var B=1<<30,z=(r&-r)*(r&-r)|B;function $(e){var t=e.value,n="number"==typeof t?t|B:"bigint"==typeof t?t|BigInt(B):t[0]+t[1]*r|z;return n&-n}function H(e,r){if(r.compareTo(e)<=0){var n=H(e,r.square(r)),i=n.p,s=n.e,o=i.multiply(r);return o.compareTo(e)<=0?{p:o,e:2*s+1}:{p:i,e:2*s}}return{p:t(1),e:0}}function U(e,t){return e=K(e),t=K(t),e.greater(t)?e:t}function V(e,t){return e=K(e),t=K(t),e.lesser(t)?e:t}function W(e,t){if(e=K(e).abs(),t=K(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var r,n,i=l[1];e.isEven()&&t.isEven();)r=V($(e),$(t)),e=e.divide(r),t=t.divide(r),i=i.multiply(r);for(;e.isEven();)e=e.divide($(e));do{for(;t.isEven();)t=t.divide($(t));e.greater(t)&&(n=t,t=e,e=n),t=t.subtract(e)}while(!t.isZero());return i.isUnit()?e:e.multiply(i)}h.prototype.bitLength=function(){var e=this;return e.compareTo(t(0))<0&&(e=e.negate().subtract(t(1))),0===e.compareTo(t(0))?t(0):t(H(e,t(2)).e).add(t(1))},c.prototype.bitLength=u.prototype.bitLength=h.prototype.bitLength;var q=function(e,t,r,n){r=r||o,e=String(e),n||(e=e.toLowerCase(),r=r.toLowerCase());var i,s=e.length,a=Math.abs(t),l={};for(i=0;i<r.length;i++)l[r[i]]=i;for(i=0;i<s;i++){if("-"!==(c=e[i])&&(c in l&&l[c]>=a)){if("1"===c&&1===a)continue;throw new Error(c+" is not a valid digit in base "+t+".")}}t=K(t);var h=[],u="-"===e[0];for(i=u?1:0;i<e.length;i++){var c;if((c=e[i])in l)h.push(K(l[c]));else{if("<"!==c)throw new Error(c+" is not a valid character");var f=i;do{i++}while(">"!==e[i]&&i<e.length);h.push(K(e.slice(f+1,i)))}}return X(h,t,u)};function X(e,t,r){var n,i=l[0],s=l[1];for(n=e.length-1;n>=0;n--)i=i.add(e[n].times(s)),s=s.times(t);return r?i.negate():i}function Z(e,r){if((r=t(r)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(r.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var n=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return n.unshift([1]),{value:[].concat.apply([],n),isNegative:!1}}var i=!1;if(e.isNegative()&&r.isPositive()&&(i=!0,e=e.abs()),r.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var s,o=[],a=e;a.isNegative()||a.compareAbs(r)>=0;){s=a.divmod(r),a=s.quotient;var l=s.remainder;l.isNegative()&&(l=r.minus(l).abs(),a=a.next()),o.push(l.toJSNumber())}return o.push(a.toJSNumber()),{value:o.reverse(),isNegative:i}}function G(e,t,r){var n=Z(e,t);return(n.isNegative?"-":"")+n.value.map((function(e){return function(e,t){return e<(t=t||o).length?t[e]:"<"+e+">"}(e,r)})).join("")}function Y(e){if(f(+e)){var t=+e;if(t===y(t))return a?new c(BigInt(t)):new u(t);throw new Error("Invalid integer: "+e)}var r="-"===e[0];r&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(2===i.length){var s=i[1];if("+"===s[0]&&(s=s.slice(1)),(s=+s)!==y(s)||!f(s))throw new Error("Invalid integer: "+s+" is not a valid exponent.");var o=i[0],l=o.indexOf(".");if(l>=0&&(s-=o.length-l-1,o=o.slice(0,l)+o.slice(l+1)),s<0)throw new Error("Cannot include negative exponent part for integers");e=o+=new Array(s+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(a)return new c(BigInt(r?"-"+e:e));for(var d=[],p=e.length,g=n,v=p-g;p>0;)d.push(+e.slice(v,p)),(v-=g)<0&&(v=0),p-=g;return m(d),new h(d,r)}function K(e){return"number"==typeof e?function(e){if(a)return new c(BigInt(e));if(f(e)){if(e!==y(e))throw new Error(e+" is not an integer.");return new u(e)}return Y(e.toString())}(e):"string"==typeof e?Y(e):"bigint"==typeof e?new c(e):e}h.prototype.toArray=function(e){return Z(this,e)},u.prototype.toArray=function(e){return Z(this,e)},c.prototype.toArray=function(e){return Z(this,e)},h.prototype.toString=function(t,r){if(t===e&&(t=10),10!==t||r)return G(this,t,r);for(var n,i=this.value,s=i.length,o=String(i[--s]);--s>=0;)n=String(i[s]),o+="0000000".slice(n.length)+n;return(this.sign?"-":"")+o},u.prototype.toString=function(t,r){return t===e&&(t=10),10!=t||r?G(this,t,r):String(this.value)},c.prototype.toString=u.prototype.toString,c.prototype.toJSON=h.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},h.prototype.valueOf=function(){return parseInt(this.toString(),10)},h.prototype.toJSNumber=h.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var Q=0;Q<1e3;Q++)l[Q]=K(Q),Q>0&&(l[-Q]=K(-Q));return l.one=l[1],l.zero=l[0],l.minusOne=l[-1],l.max=U,l.min=V,l.gcd=W,l.lcm=function(e,t){return e=K(e).abs(),t=K(t).abs(),e.divide(W(e,t)).multiply(t)},l.isInstance=function(e){return e instanceof h||e instanceof u||e instanceof c},l.randBetween=function(e,t,n){e=K(e),t=K(t);var i=n||Math.random,s=V(e,t),o=U(e,t).subtract(s).add(1);if(o.isSmall)return s.add(Math.floor(i()*o));for(var a=Z(o,r).value,h=[],u=!0,c=0;c<a.length;c++){var f=u?a[c]+(c+1<a.length?a[c+1]/r:0):r,d=y(i()*f);h.push(d),d<a[c]&&(u=!1)}return s.add(l.fromArray(h,r,!1))},l.fromArray=function(e,t,r){return X(e.map(K),K(t||10),r)},l}();e.hasOwnProperty("exports")&&(e.exports=t)}(dL);var pL,mL=dL.exports,gL=n;function yL(e,t){return pL||function(){var e,t,r;for(pL=[],t=0;t<256;t++){for(e=t,r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>=1;pL[t]=e>>>0}}(),e.charCodeAt&&(e=e.charCodeAt(0)),mL(t).shiftRight(8).and(16777215).xor(pL[mL(t).xor(e).and(255)]).value}function vL(){if(!(this instanceof vL))return new vL;this.key0=305419896,this.key1=591751049,this.key2=878082192}gL.Writable&&gL.Writable.prototype.destroy||(gL=At()),vL.prototype.update=function(e){this.key0=yL(e,this.key0),this.key1=mL(this.key0).and(255).and(4294967295).add(this.key1),this.key1=mL(this.key1).multiply(134775813).add(1).and(4294967295).value,this.key2=yL(mL(this.key1).shiftRight(24).and(255),this.key2)},vL.prototype.decryptByte=function(e){var t=mL(this.key2).or(2);return e^=mL(t).multiply(mL(1^t)).shiftRight(8).and(255),this.update(e),e},vL.prototype.stream=function(){var e=gL.Transform(),t=this;return e._transform=function(e,r,n){for(var i=0;i<e.length;i++)e[i]=t.decryptByte(e[i]);this.push(e),n()},e};var _L=uj,bL=vL,wL=vj,xL=n,kL=PF,SL=c,EL=Oj,TL=fj,CL=Rj;xL.Writable&&xL.Writable.prototype.destroy||(xL=At());var OL=PF,RL=vj,AL=function(e,t,r,n){var i=wL(),s=xL.PassThrough(),o=e.stream(t);return o.pipe(i).on("error",(function(e){s.emit("error",e)})),s.vars=i.pull(30).then((function(e){var t=kL.parse(e).word32lu("signature").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return t.lastModifiedDateTime=CL(t.lastModifiedDate,t.lastModifiedTime),i.pull(t.fileNameLength).then((function(e){return t.fileName=e.toString("utf8"),i.pull(t.extraFieldLength)})).then((function(e){var o;return t.extra=EL(e,t),n&&n.compressedSize&&(t=n),1&t.flags&&(o=i.pull(12).then((function(e){if(!r)throw new Error("MISSING_PASSWORD");var n=bL();String(r).split("").forEach((function(e){n.update(e)}));for(var i=0;i<e.length;i++)e[i]=n.decryptByte(e[i]);t.decrypt=n,t.compressedSize-=12;var s=8&t.flags?t.lastModifiedTime>>8&255:t.crc32>>24&255;if(e[11]!==s)throw new Error("BAD_PASSWORD");return t}))),_L.resolve(o).then((function(){return s.emit("vars",t),t}))}))})),s.vars.then((function(e){var t,r=!(8&e.flags)||e.compressedSize>0,n=e.compressionMethod?SL.createInflateRaw():xL.PassThrough();r?(s.size=e.uncompressedSize,t=e.compressedSize):(t=TL.alloc(4)).writeUInt32LE(134695760,0);var a=i.stream(t);e.decrypt&&(a=a.pipe(e.decrypt.stream())),a.pipe(n).on("error",(function(e){s.emit("error",e)})).pipe(s).on("finish",(function(){o.destroy?o.destroy():o.abort?o.abort():o.close?o.close():o.push&&o.push()}))})).catch((function(e){s.emit("error",e)})),s},NL=uj,IL=Tj,PL=Oj,FL=l,DL=Jj.Writer,jL=Rj,ML=fj.alloc(4);ML.writeUInt32LE(101010256,0);var LL=eT,BL=uj,zL=function(e,t){var r,n,i,s,o=RL(),a=RL(),l=t&&t.tailSize||80;return t&&t.crx&&(n=function(e){var t=e.stream(0).pipe(RL());return t.pull(4).then((function(e){var r;if(875721283===e.readUInt32LE(0))return t.pull(12).then((function(e){r=OL.parse(e).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars})).then((function(){return t.pull(r.pubKeyLength+r.signatureLength)})).then((function(e){return r.publicKey=e.slice(0,r.pubKeyLength),r.signature=e.slice(r.pubKeyLength),r.size=16+r.pubKeyLength+r.signatureLength,r}))}))}(e)),e.size().then((function(t){return r=t,e.stream(Math.max(0,t-l)).on("error",(function(e){o.emit("error",e)})).pipe(o),o.pull(ML)})).then((function(){return NL.props({directory:o.pull(22),crxHeader:n})})).then((function(t){var n=t.directory;if(i=t.crxHeader&&t.crxHeader.size||0,65535==(s=OL.parse(n).word32lu("signature").word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars).numberOfRecords||65535==s.numberOfRecords||4294967295==s.offsetToStartOfCentralDirectory){const t=20,n=r-(l-o.match+t),i=RL();return e.stream(n).pipe(i),i.pull(t).then((function(t){return function(e,t){var r=OL.parse(t).word32lu("signature").word32lu("diskNumber").word64lu("offsetToStartOfCentralDirectory").word32lu("numberOfDisks").vars;if(117853008!=r.signature)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+r.signature.toString(16));var n=RL();return e.stream(r.offsetToStartOfCentralDirectory).pipe(n),n.pull(56)}(e,t)})).then((function(e){s=function(e){var t=OL.parse(e).word32lu("signature").word64lu("sizeOfCentralDirectory").word16lu("version").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskStart").word64lu("numberOfRecordsOnDisk").word64lu("numberOfRecords").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;if(101075792!=t.signature)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+t.signature.toString(16));return t}(e)}))}s.offsetToStartOfCentralDirectory+=i})).then((function(){if(s.commentLength)return o.pull(s.commentLength).then((function(e){s.comment=e.toString("utf8")}))})).then((function(){return e.stream(s.offsetToStartOfCentralDirectory).pipe(a),s.extract=function(e){if(!e||!e.path)throw new Error("PATH_MISSING");return e.path=FL.resolve(FL.normalize(e.path)),s.files.then((function(t){return NL.map(t,(function(t){if("Directory"!=t.type){var r=FL.join(e.path,t.path);if(0==r.indexOf(e.path)){var n=e.getWriter?e.getWriter({path:r}):DL({path:r});return new NL((function(r,i){t.stream(e.password).on("error",i).pipe(n).on("close",r).on("error",i)}))}}}),{concurrency:e.concurrency>1?e.concurrency:1})}))},s.files=NL.mapSeries(Array(s.numberOfRecords),(function(){return a.pull(46).then((function(t){var r=OL.parse(t).word32lu("signature").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return r.offsetToLocalFileHeader+=i,r.lastModifiedDateTime=jL(r.lastModifiedDate,r.lastModifiedTime),a.pull(r.fileNameLength).then((function(e){return r.pathBuffer=e,r.path=e.toString("utf8"),r.isUnicode=0!=(2048&r.flags),a.pull(r.extraFieldLength)})).then((function(e){return r.extra=PL(e,r),a.pull(r.fileCommentLength)})).then((function(t){return r.comment=t,r.type=0===r.uncompressedSize&&/[\/\\]$/.test(r.path)?"Directory":"File",r.stream=function(t){return AL(e,r.offsetToLocalFileHeader,t,r)},r.buffer=function(e){return IL(r.stream(e))},r}))}))})),NL.props(s)}))},$L=n;$L.Writable&&$L.Writable.prototype.destroy||($L=At());var HL={buffer:function(e,t){var r={stream:function(t,r){var n=$L.PassThrough();return n.end(e.slice(t,r)),n},size:function(){return BL.resolve(e.length)}};return zL(r,t)},file:function(e,t){var r={stream:function(t,r){return LL.createReadStream(e,{start:t,end:r&&t+r})},size:function(){return new BL((function(t,r){LL.stat(e,(function(e,n){e?r(e):t(n.size)}))}))}};return zL(r,t)},url:function(e,t,r){if("string"==typeof t&&(t={url:t}),!t.url)throw"URL missing";t.headers=t.headers||{};var n={stream:function(r,n){var i=Object.create(t);return i.headers=Object.create(t.headers),i.headers.range="bytes="+r+"-"+(n||""),e(i)},size:function(){return new BL((function(r,n){var i=e(t);i.on("response",(function(e){i.abort(),e.headers["content-length"]?r(e.headers["content-length"]):n(new Error("Missing content length header"))})).on("error",n)}))}};return zL(n,r)},s3:function(e,t,r){var n={size:function(){return new BL((function(r,n){e.headObject(t,(function(e,t){e?n(e):r(t.ContentLength)}))}))},stream:function(r,n){var i={};for(var s in t)i[s]=t[s];return i.Range="bytes="+r+"-"+(n||""),e.getObject(i).createReadStream()}};return zL(n,r)},custom:function(e,t){return zL(e,t)}};mF.Parse=Uj,mF.ParseOne=Qj,mF.Extract=oL,mF.Open=HL;var UL={exports:{}};const VL=u,WL=l,qL=r;let XL;try{XL=jR()}catch(e){}const ZL={nosort:!0,silent:!0};let GL=0;const YL="win32"===process.platform,KL=e=>{if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||qL[t],e[t+="Sync"]=e[t]||qL[t]})),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),!0!==e.disableGlob&&void 0===XL)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||ZL},QL=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),VL(e,"rimraf: missing path"),VL(t,"rimraf: invalid options argument provided"),KL(t);let n=0,i=null,s=0;const o=(e,o)=>e?r(e):(s=o.length,0===s?r():void o.forEach((e=>{const o=a=>{if(a){if(("EBUSY"===a.code||"ENOTEMPTY"===a.code||"EPERM"===a.code)&&n<t.maxBusyTries)return n++,setTimeout((()=>JL(e,t,o)),100*n);if("EMFILE"===a.code&&GL<t.emfileWait)return setTimeout((()=>JL(e,t,o)),GL++);"ENOENT"===a.code&&(a=null)}GL=0,(e=>{i=i||e,0==--s&&r(i)})(a)};JL(e,t,o)})));if(t.disableGlob||!XL.hasMagic(e))return o(null,[e]);t.lstat(e,((r,n)=>{if(!r)return o(null,[e]);XL(e,t.glob,o)}))},JL=(e,t,r)=>{VL(e),VL(t),VL("function"==typeof r),t.lstat(e,((n,i)=>n&&"ENOENT"===n.code?r(null):(n&&"EPERM"===n.code&&YL&&eB(e,t,n,r),i&&i.isDirectory()?rB(e,t,n,r):void t.unlink(e,(n=>{if(n){if("ENOENT"===n.code)return r(null);if("EPERM"===n.code)return YL?eB(e,t,n,r):rB(e,t,n,r);if("EISDIR"===n.code)return rB(e,t,n,r)}return r(n)})))))},eB=(e,t,r,n)=>{VL(e),VL(t),VL("function"==typeof n),t.chmod(e,438,(i=>{i?n("ENOENT"===i.code?null:r):t.stat(e,((i,s)=>{i?n("ENOENT"===i.code?null:r):s.isDirectory()?rB(e,t,r,n):t.unlink(e,n)}))}))},tB=(e,t,r)=>{VL(e),VL(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw r}let n;try{n=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw r}n.isDirectory()?sB(e,t,r):t.unlinkSync(e)},rB=(e,t,r,n)=>{VL(e),VL(t),VL("function"==typeof n),t.rmdir(e,(i=>{!i||"ENOTEMPTY"!==i.code&&"EEXIST"!==i.code&&"EPERM"!==i.code?i&&"ENOTDIR"===i.code?n(r):n(i):nB(e,t,n)}))},nB=(e,t,r)=>{VL(e),VL(t),VL("function"==typeof r),t.readdir(e,((n,i)=>{if(n)return r(n);let s,o=i.length;if(0===o)return t.rmdir(e,r);i.forEach((n=>{QL(WL.join(e,n),t,(n=>{if(!s)return n?r(s=n):void(0==--o&&t.rmdir(e,r))}))}))}))},iB=(e,t)=>{let r;if(KL(t=t||{}),VL(e,"rimraf: missing path"),VL(t,"rimraf: missing options"),t.disableGlob||!XL.hasMagic(e))r=[e];else try{t.lstatSync(e),r=[e]}catch(n){r=XL.sync(e,t.glob)}if(r.length)for(let e=0;e<r.length;e++){const n=r[e];let i;try{i=t.lstatSync(n)}catch(e){if("ENOENT"===e.code)return;"EPERM"===e.code&&YL&&tB(n,t,e)}try{i&&i.isDirectory()?sB(n,t,null):t.unlinkSync(n)}catch(e){if("ENOENT"===e.code)return;if("EPERM"===e.code)return YL?tB(n,t,e):sB(n,t,e);if("EISDIR"!==e.code)throw e;sB(n,t,e)}}},sB=(e,t,r)=>{VL(e),VL(t);try{t.rmdirSync(e)}catch(n){if("ENOENT"===n.code)return;if("ENOTDIR"===n.code)throw r;"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code||oB(e,t)}},oB=(e,t)=>{VL(e),VL(t),t.readdirSync(e).forEach((r=>iB(WL.join(e,r),t)));const r=YL?100:1;let n=0;for(;;){let i=!0;try{const r=t.rmdirSync(e,t);return i=!1,r}finally{if(++n<r&&i)continue}}};var aB=QL;QL.sync=iB,
85
+ /*!
86
+ * Tmp
87
+ *
88
+ * Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
89
+ *
90
+ * MIT Licensed
91
+ */
92
+ function(e){const n=r,i=f,s=l,o=t,a={fs:n.constants,os:i.constants},h=aB,u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c=/XXXXXX/,d=3,p=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),m="win32"===i.platform(),g=a.EBADF||a.os.errno.EBADF,y=a.ENOENT||a.os.errno.ENOENT,v=[],_=n.rmdirSync.bind(n),b=h.sync;let w=!1;function x(e,t){const r=I(e,t),i=r[0],s=r[1];try{F(i)}catch(e){return s(e)}let o=i.tries;!function e(){try{const t=P(i);n.stat(t,(function(r){if(!r)return o-- >0?e():s(new Error("Could not get a unique tmp filename, max tries reached "+t));s(null,t)}))}catch(e){s(e)}}()}function k(e){const t=I(e)[0];F(t);let r=t.tries;do{const e=P(t);try{n.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function S(e,t){const r=function(e){if(e&&!L(e))return t(e);t()};0<=e[0]?n.close(e[0],(function(){n.unlink(e[1],r)})):n.unlink(e[1],r)}function E(e){let t=null;try{0<=e[0]&&n.closeSync(e[0])}catch(e){if(!function(e){return B(e,-g,"EBADF")}(e)&&!L(e))throw e}finally{try{n.unlinkSync(e[1])}catch(e){L(e)||(t=e)}}if(null!==t)throw t}function T(e,t,r,n){const i=O(E,[t,e],n),s=O(S,[t,e],n,i);return r.keep||v.unshift(i),n?i:s}function C(e,t,r){const i=t.unsafeCleanup?h:n.rmdir.bind(n),s=O(t.unsafeCleanup?b:_,e,r),o=O(i,e,r,s);return t.keep||v.unshift(s),r?s:o}function O(e,t,r,n){let i=!1;return function s(o){if(!i){const a=n||s,l=v.indexOf(a);return l>=0&&v.splice(l,1),i=!0,r||e===_||e===b?e(t):e(t,o||function(){})}}}function R(e){let t=[],r=null;try{r=o.randomBytes(e)}catch(t){r=o.pseudoRandomBytes(e)}for(var n=0;n<e;n++)t.push(u[r[n]%u.length]);return t.join("")}function A(e){return null===e||N(e)||!e.trim()}function N(e){return void 0===e}function I(e,t){if("function"==typeof e)return[{},e];if(N(e))return[{},t];const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=e[t];return[r,t]}function P(e){const t=e.tmpdir;if(!N(e.name))return s.join(t,e.dir,e.name);if(!N(e.template))return s.join(t,e.dir,e.template).replace(c,R(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",R(12),e.postfix?"-"+e.postfix:""].join("");return s.join(t,e.dir,r)}function F(e){e.tmpdir=z(e);const t=e.tmpdir;if(N(e.name)||M(e.name,"name",t),N(e.dir)||M(e.dir,"dir",t),!N(e.template)&&(M(e.template,"template",t),!e.template.match(c)))throw new Error(`Invalid template, found "${e.template}".`);if(!N(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=N(e.name)?e.tries||d:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.dir=N(e.dir)?"":s.relative(t,D(e.dir,t)),e.template=N(e.template)?void 0:s.relative(t,D(e.template,t)),e.template=A(e.template)?void 0:s.relative(e.dir,e.template),e.name=N(e.name)?void 0:j(e.name),e.prefix=N(e.prefix)?"":e.prefix,e.postfix=N(e.postfix)?"":e.postfix}function D(e,t){const r=j(e);return r.startsWith(t)?s.resolve(r):s.resolve(s.join(t,r))}function j(e){return A(e)?e:e.replace(/["']/g,"")}function M(e,t,r){if("name"===t){if(s.isAbsolute(e))throw new Error(`${t} option must not contain an absolute path, found "${e}".`);let r=s.basename(e);if(".."===r||"."===r||r!==e)throw new Error(`${t} option must not contain a path, found "${e}".`)}else{if(s.isAbsolute(e)&&!e.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${e}".`);let n=D(e,r);if(!n.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${n}".`)}}function L(e){return B(e,-y,"ENOENT")}function B(e,t,r){return m?e.code===r:e.code===r&&e.errno===t}function z(e){return s.resolve(j(e&&e.tmpdir||i.tmpdir()))}process.addListener("exit",(function(){if(w)for(;v.length;)try{v[0]()}catch(e){}})),Object.defineProperty(e.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return z()}}),e.exports.dir=function(e,t){const r=I(e,t),i=r[0],s=r[1];x(i,(function(e,t){if(e)return s(e);n.mkdir(t,i.mode||448,(function(e){if(e)return s(e);s(null,t,C(t,i,!1))}))}))},e.exports.dirSync=function(e){const t=I(e)[0],r=k(t);return n.mkdirSync(r,t.mode||448),{name:r,removeCallback:C(r,t,!0)}},e.exports.file=function(e,t){const r=I(e,t),i=r[0],s=r[1];x(i,(function(e,t){if(e)return s(e);n.open(t,p,i.mode||384,(function(e,r){if(e)return s(e);if(i.discardDescriptor)return n.close(r,(function(e){return s(e,t,void 0,T(t,-1,i,!1))}));{const e=i.discardDescriptor||i.detachDescriptor;s(null,t,r,T(t,e?-1:r,i,!1))}}))}))},e.exports.fileSync=function(e){const t=I(e)[0],r=t.discardDescriptor||t.detachDescriptor,i=k(t);var s=n.openSync(i,p,t.mode||384);return t.discardDescriptor&&(n.closeSync(s),s=void 0),{name:i,fd:s,removeCallback:T(i,r?-1:s,t,!0)}},e.exports.tmpName=x,e.exports.tmpNameSync=k,e.exports.setGracefulCleanup=function(){w=!0}}(UL);var lB=UL.exports;function hB(e,t){return new Promise((r=>{let n=!1;const i=()=>{n||(n=!0,e.removeListener(t,i),r())};e.addListener(t,i)}))}const{EventEmitter:uB}=i,cB=Uh,fB=k,dB=Cl,pB=T,mB=O,gB=Z,yB=Q;let vB=class extends uB{constructor(e){let{workbook:t,id:r,iterator:n,options:i}=e;super(),this.workbook=t,this.id=r,this.iterator=n,this.options=i||{},this.name=`Sheet${this.id}`,this._columns=null,this._keys={},this._dimensions=new mB}destroy(){throw new Error("Invalid Operation: destroy")}get dimensions(){return this._dimensions}get columns(){return this._columns}getColumn(e){if("string"==typeof e){const t=this._keys[e];if(t)return t;e=pB.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new yB(this,t++))}return this._columns[e-1]}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){fB.each(this._keys,e)}async read(){try{for await(const e of this.parse())for(const{eventType:t,value:r}of e)this.emit(t,r);this.emit("finished")}catch(e){this.emit("error",e)}}async*[Symbol.asyncIterator](){for await(const e of this.parse())for(const{eventType:t,value:r}of e)"row"===t&&(yield r)}async*parse(){const{iterator:e,options:t}=this;let r=!1,n=!1,i=null;if("emit"===t.worksheets)r=!0;switch(t.hyperlinks){case"emit":n=!0;break;case"cache":this.hyperlinks=i={}}if(!r&&!n&&!i)return;const{sharedStrings:s,styles:o,properties:a}=this.workbook;let l=!1,h=!1,u=!1,c=null,f=null,d=null,p=null;for await(const t of cB(e)){const e=[];for(const{eventType:m,value:g}of t)if("opentag"===m){const t=g;if(r)switch(t.name){case"cols":l=!0,c=[];break;case"sheetData":h=!0;break;case"col":l&&c.push({min:parseInt(t.attributes.min,10),max:parseInt(t.attributes.max,10),width:parseFloat(t.attributes.width),styleId:parseInt(t.attributes.style||"0",10)});break;case"row":if(h){const e=parseInt(t.attributes.r,10);if(f=new gB(this,e),t.attributes.ht&&(f.height=parseFloat(t.attributes.ht)),t.attributes.s){const e=parseInt(t.attributes.s,10),r=o.getStyleModel(e);r&&(f.style=r)}}break;case"c":f&&(d={ref:t.attributes.r,s:parseInt(t.attributes.s,10),t:t.attributes.t});break;case"f":d&&(p=d.f={text:""});break;case"v":case"is":case"t":d&&(p=d.v={text:""})}if(n||i)switch(t.name){case"hyperlinks":u=!0;break;case"hyperlink":if(u){const r={ref:t.attributes.ref,rId:t.attributes["r:id"]};n?e.push({eventType:"hyperlink",value:r}):i[r.ref]=r}}}else if("text"===m)r&&p&&(p.text+=g);else if("closetag"===m){const t=g;if(r)switch(t.name){case"cols":l=!1,this._columns=yB.fromModel(c);break;case"sheetData":h=!1;break;case"row":this._dimensions.expandRow(f),e.push({eventType:"row",value:f}),f=null;break;case"c":if(f&&d){const e=pB.decodeAddress(d.ref),t=f.getCell(e.col);if(d.s){const e=o.getStyleModel(d.s);e&&(t.style=e)}if(d.f){const e={formula:d.f.text};d.v&&("str"===d.t?e.result=dB.xmlDecode(d.v.text):e.result=parseFloat(d.v.text)),t.value=e}else if(d.v)switch(d.t){case"s":{const e=parseInt(d.v.text,10);t.value=s?s[e]:{sharedString:e};break}case"inlineStr":case"str":t.value=dB.xmlDecode(d.v.text);break;case"e":t.value={error:d.v.text};break;case"b":t.value=0!==parseInt(d.v.text,10);break;default:dB.isDateFmt(t.numFmt)?t.value=dB.excelToDate(parseFloat(d.v.text),a.model&&a.model.date1904):t.value=parseFloat(d.v.text)}if(i){const e=i[d.ref];e&&(t.text=t.value,t.value=void 0,t.hyperlink=e)}d=null}}if((n||i)&&"hyperlinks"===t.name)u=!1}e.length>0&&(yield e)}}};var _B=vB;const{EventEmitter:bB}=i,wB=Uh,xB=R,kB=$f;var SB=class extends bB{constructor(e){let{workbook:t,id:r,iterator:n,options:i}=e;super(),this.workbook=t,this.id=r,this.iterator=n,this.options=i}get count(){return this.hyperlinks&&this.hyperlinks.length||0}each(e){return this.hyperlinks.forEach(e)}async read(){const{iterator:e,options:t}=this;let r=!1,n=null;switch(t.hyperlinks){case"emit":r=!0;break;case"cache":this.hyperlinks=n={}}if(r||n)try{for await(const t of wB(e))for(const{eventType:e,value:i}of t)if("opentag"===e){const e=i;if("Relationship"===e.name){const t=e.attributes.Id;if(e.attributes.Type===kB.Hyperlink){const i={type:xB.RelationshipType.Styles,rId:t,target:e.attributes.Target,targetMode:e.attributes.TargetMode};r?this.emit("hyperlink",i):n[i.rId]=i}}}this.emit("finished")}catch(e){this.emit("error",e)}else this.emit("finished")}};const EB=r,{EventEmitter:TB}=i,{PassThrough:CB,Readable:OB}=kl,RB=n,AB=mF,NB=lB,IB=async function*(e){const t=[];let r;e.on("data",(e=>t.push(e)));const n=new Promise((e=>r=e));let i=!1;e.on("end",(()=>{i=!0,r()}));let s=!1;for(e.on("error",(e=>{s=e,r()}));!i||t.length>0;){if(0===t.length)e.resume(),await Promise.race([hB(e,"data"),n]);else{e.pause();const r=t.shift();yield r}if(s)throw s}r()},PB=Uh,FB=mc,DB=zf,jB=Kc,MB=_B,LB=SB;NB.setGracefulCleanup();class BB extends TB{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.input=e,this.options={worksheets:"emit",sharedStrings:"cache",hyperlinks:"ignore",styles:"ignore",entries:"ignore",...t},this.styles=new FB,this.styles.init()}_getStream(e){if(e instanceof RB.Readable||e instanceof OB)return e;if("string"==typeof e)return EB.createReadStream(e);throw new Error(`Could not recognise input: ${e}`)}async read(e,t){try{for await(const{eventType:r,value:n}of this.parse(e,t))switch(r){case"shared-strings":case"hyperlinks":this.emit(r,n);break;case"worksheet":this.emit(r,n),await n.read()}this.emit("end"),this.emit("finished")}catch(e){this.emit("error",e)}}async*[Symbol.asyncIterator](){for await(const{eventType:e,value:t}of this.parse())"worksheet"===e&&(yield t)}async*parse(e,t){t&&(this.options=t);const r=this.stream=this._getStream(e||this.input),n=AB.Parse({forceStream:!0});r.pipe(n);const i=[];for await(const e of IB(n)){let t,r;switch(e.path){case"_rels/.rels":break;case"xl/_rels/workbook.xml.rels":await this._parseRels(e);break;case"xl/workbook.xml":await this._parseWorkbook(e);break;case"xl/sharedStrings.xml":yield*this._parseSharedStrings(e);break;case"xl/styles.xml":await this._parseStyles(e);break;default:e.path.match(/xl\/worksheets\/sheet\d+[.]xml/)?(t=e.path.match(/xl\/worksheets\/sheet(\d+)[.]xml/),r=t[1],this.sharedStrings&&this.workbookRels?yield*this._parseWorksheet(IB(e),r):await new Promise(((t,n)=>{NB.file(((s,o,a,l)=>{if(s)return n(s);i.push({sheetNo:r,path:o,tempFileCleanupCallback:l});const h=EB.createWriteStream(o);return h.on("error",n),e.pipe(h),h.on("finish",(()=>t()))}))}))):e.path.match(/xl\/worksheets\/_rels\/sheet\d+[.]xml.rels/)&&(t=e.path.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),r=t[1],yield*this._parseHyperlinks(IB(e),r))}e.autodrain()}for(const{sheetNo:e,path:t,tempFileCleanupCallback:r}of i){let n=EB.createReadStream(t);n[Symbol.asyncIterator]||(n=n.pipe(new CB)),yield*this._parseWorksheet(n,e),r()}}_emitEntry(e){"emit"===this.options.entries&&this.emit("entry",e)}async _parseRels(e){const t=new jB;this.workbookRels=await t.parseStream(IB(e))}async _parseWorkbook(e){this._emitEntry({type:"workbook"});const t=new DB;await t.parseStream(IB(e)),this.properties=t.map.workbookPr,this.model=t.model}async*_parseSharedStrings(e){switch(this._emitEntry({type:"shared-strings"}),this.options.sharedStrings){case"cache":this.sharedStrings=[];break;case"emit":break;default:return}let t=null,r=[],n=0,i=null;for await(const s of PB(IB(e)))for(const{eventType:e,value:o}of s)if("opentag"===e){const e=o;switch(e.name){case"b":i=i||{},i.bold=!0;break;case"charset":i=i||{},i.charset=parseInt(e.attributes.charset,10);break;case"color":i=i||{},i.color={},e.attributes.rgb&&(i.color.argb=e.attributes.argb),e.attributes.val&&(i.color.argb=e.attributes.val),e.attributes.theme&&(i.color.theme=e.attributes.theme);break;case"family":i=i||{},i.family=parseInt(e.attributes.val,10);break;case"i":i=i||{},i.italic=!0;break;case"outline":i=i||{},i.outline=!0;break;case"rFont":i=i||{},i.name=e.value;break;case"si":i=null,r=[],t=null;break;case"sz":i=i||{},i.size=parseInt(e.attributes.val,10);break;case"strike":break;case"t":t=null;break;case"u":i=i||{},i.underline=!0;break;case"vertAlign":i=i||{},i.vertAlign=e.attributes.val}}else if("text"===e)t=t?t+o:o;else if("closetag"===e){switch(o.name){case"r":r.push({font:i,text:t}),i=null,t=null;break;case"si":"cache"===this.options.sharedStrings?this.sharedStrings.push(r.length?{richText:r}:t):"emit"===this.options.sharedStrings&&(yield{index:n++,text:r.length?{richText:r}:t}),r=[],i=null,t=null}}}async _parseStyles(e){this._emitEntry({type:"styles"}),"cache"===this.options.styles&&(this.styles=new FB,await this.styles.parseStream(IB(e)))}*_parseWorksheet(e,t){this._emitEntry({type:"worksheet",id:t});const r=new MB({workbook:this,id:t,iterator:e,options:this.options}),n=(this.workbookRels||[]).find((e=>e.Target===`worksheets/sheet${t}.xml`)),i=n&&(this.model.sheets||[]).find((e=>e.rId===n.Id));i&&(r.id=i.id,r.name=i.name,r.state=i.state),"emit"===this.options.worksheets&&(yield{eventType:"worksheet",value:r})}*_parseHyperlinks(e,t){this._emitEntry({type:"hyperlinks",id:t});const r=new LB({workbook:this,id:t,iterator:e,options:this.options});"emit"===this.options.hyperlinks&&(yield{eventType:"hyperlinks",value:r})}}BB.Options={worksheets:["emit","ignore"],sharedStrings:["cache","emit","ignore"],hyperlinks:["cache","emit","ignore"],styles:["cache","ignore"],entries:["emit","ignore"]};const zB={Workbook:bx,ModelContainer:xx,stream:{xlsx:{WorkbookWriter:pF,WorkbookReader:BB}}};Object.assign(zB,R);var $B=zB;if(parseInt(process.versions.node.split(".")[0],10)<10)throw new Error("For node versions older than 10, please use the ES5 Import: https://github.com/exceljs/exceljs#es5-imports");var HB=m($B);function UB(e,t){let r="";for(let t=e+1;t>0;t=Math.floor((t-1)/26))r=String.fromCharCode((t-1)%26+65)+r;return r+(t+1)}function VB(e){if(e.startsWith("#")){let t=e.substring(1);3===t.length&&(t=t.replace(/(.)/g,"$1$1"));return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}if(e.startsWith("rgb(")){return e.substring(4,e.length-1).split(",").map(Number)}if(e.startsWith("rgba(")){return e.substring(5,e.length-1).split(",").map(Number)}if(XB[e])return[(t=XB[e])>>16,t>>8&255,255&t,1];if(qB[e])return function(e){return[e>>>24,e>>>16&255,e>>>8&255,255&e]}(qB[e]);var t;throw new Error("Unsupported color format")}function WB(e){if(3===e.length&&e.push(1),4!==e.length)throw new Error("Invalid RGBA array");const[t,r,n,i]=e.map(Math.round);return`${Math.round(255*i).toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}const qB={transparent:4294967040},XB={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ZB(e,t){return{name:GB(e.fontFamily)||"Arial",size:e.fontSize||10,bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,color:ez("link"===t?e._linkColor:e.color),underline:e.underline}}function GB(e){return e.split(",").map((e=>e.trim()))[0]}function YB(e){return{type:"pattern",pattern:"solid",fgColor:ez(e.bgColor)}}function KB(e){const{borderColor:t,borderLineWidth:r,borderLineDash:n,_strokeArrayWidth:i,_strokeArrayColor:s}=e;if(s||i){const e={};return s&&!s[0]||i&&!i[0]||(e.top={style:QB(i?.[0]??r,n),color:ez(s?.[0]??t)}),s&&!s[1]||i&&!i[1]||(e.right={style:QB(i?.[1]??r,n),color:ez(s?.[1])}),s&&!s[2]||i&&!i[2]||(e.bottom={style:QB(i?.[2]??r,n),color:ez(s?.[2])}),s&&!s[3]||i&&!i[3]||(e.left={style:QB(i?.[3]??r,n),color:ez(s?.[3])}),e}if(0===r)return{};const o={style:QB(r,n),color:ez(t)};return{top:o,left:o,bottom:o,right:o}}function QB(e,t){return t&&t.length?e<=2?"dashed":"mediumDashed":e<=.5?"hair":e<=1?"thin":e<=2?"medium":"thick"}function JB(e){return{horizontal:e.textAlign||"left",vertical:e.textBaseline||"middle",wrapText:e.autoWrapText||!1}}function ez(e){return{argb:WB(VB(e))}}function tz(e,t){return"link"===t?{text:e,hyperlink:e,tooltip:e}:e}e.downloadCsv=function(e,t){const r=new Blob([`\ufeff${e}`],{type:"text/csv;charset=utf-8"});v.saveAs(r,`${t}.csv`)},e.downloadExcel=function(e,t){const r=new Blob([e],{type:"application/octet-stream"});v.saveAs(r,`${t}.xlsx`)},e.exportVTableToCsv=function(e){const t=e.rowCount-1,r=e.colCount-1;let n="";for(let i=0;i<=t;i++){for(let t=0;t<=r;t++){const r=d(t,i,e);if("undefined"!=typeof Promise&&r instanceof Promise);else{const e=`${r}`;/^\[object .*\]$/.exec(e)||(n+=e)}n+=","}n+="\r\n"}return n},e.exportVTableToExcel=async function(e){const t=new HB.Workbook,r=t.addWorksheet("sheet1");r.properties.defaultRowHeight=40;const n=[],i=e.rowCount-1,s=e.colCount-1,o=[],a=new Set;for(let t=0;t<=s;t++){const s=e.getColWidth(t);n[t]={width:s/6};for(let n=0;n<=i;n++){if(0===t){const t=e.getRowHeight(n);r.getRow(n+1).height=t}const i=e.getCellValue(t,n),s=e.getCellStyle(t,n),l=e.getCellType(t,n),h=r.getCell(UB(t,n));h.value=tz(i,l),h.font=ZB(s,l),h.fill=YB(s),h.border=KB(s),h.alignment=JB(s);const u=e.getCellRange(t,n);if(u.start.col!==u.end.col||u.start.row!==u.end.row){const e=`${u.start.col},${u.start.row}:${u.end.col},${u.end.row}}`;a.has(e)||(a.add(e),o.push(u))}}}r.columns=n,o.forEach((e=>{r.mergeCells(e.start.row+1,e.start.col+1,e.end.row+1,e.end.col+1)}));const l=[];return e.frozenRowCount>0&&l.push({state:"frozen",ySplit:e.frozenRowCount,topLeftCell:UB(0,e.frozenRowCount)}),e.frozenColCount>0&&l.push({state:"frozen",xSplit:e.frozenColCount,topLeftCell:UB(e.frozenColCount,0)}),r.views=l,await t.xlsx.writeBuffer()}}));