@cj-tech-master/excelts 1.4.4 → 1.4.5
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.
- package/dist/browser/excelts.iife.js +8548 -8542
- package/dist/browser/excelts.iife.js.map +1 -1
- package/dist/browser/excelts.iife.min.js +3 -3
- package/dist/cjs/doc/column.js +1 -1
- package/dist/cjs/doc/row.js +9 -4
- package/dist/cjs/doc/worksheet.js +9 -4
- package/dist/esm/doc/column.js +1 -1
- package/dist/esm/doc/row.js +9 -4
- package/dist/esm/doc/worksheet.js +9 -4
- package/dist/types/doc/cell.d.ts +10 -6
- package/dist/types/doc/column.d.ts +8 -4
- package/dist/types/doc/row.d.ts +9 -8
- package/dist/types/doc/worksheet.d.ts +2 -2
- package/package.json +8 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v1.4.
|
|
2
|
+
* @cj-tech-master/excelts v1.4.5
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
6
6
|
*/
|
|
7
|
-
var ExcelTS=(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&&n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>o.call(e,`module.exports`)?e[`module.exports`]:u(n({},`__esModule`,{value:!0}),e);let p=/^[A-Z]+\d+$/,m={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level(e){return e<=26?1:e<=676?2:3},_fill(e){let t,n,r,i,a,o=1;if(e>=4)throw 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;)n=o-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)n=o-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],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 Error(`Out of bounds. Invalid column letter: ${e}`);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw 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(!p.test(e))throw Error(`Invalid Address: ${e}`);return!0},decodeAddress(e){let t=e.length<5&&this._hash[e];if(t)return t;let n=!1,r=``,i=0,a=!1,o=``,s=0;for(let t=0,c;t<e.length;t++)if(c=e.charCodeAt(t),!a&&c>=65&&c<=90)n=!0,r+=e[t],i=i*26+c-64;else if(c>=48&&c<=57)a=!0,o+=e[t],s=s*10+c-48;else if(a&&n&&c!==36)break;if(!n)i=void 0;else if(i>16384)throw Error(`Out of bounds. Invalid column letter: ${r}`);a||(s=void 0),e=r+o;let c={address:e,col:i,row:s,$col$row:`$${r}$${o}`};return i<=100&&s<=100&&(this._hash[e]=c,this._hash[c.$col$row]=c),c},getAddress(e,t){if(t){let n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){let t=e.split(`:`);if(t.length===2){let e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col),tl:``,br:``,dimensions:``};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions=`${r.tl}:${r.br}`,r}return this.decodeAddress(e)},decodeEx(e){let t=e.match(/^(?:(?:(?:'((?:[^']|'')+?)')|([^'^ !]+?))!)?(.*)$/),n=t[1]||t[2],r=t[3],i=r.split(`:`);if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]),r=Math.min(e.row,t.row),a=Math.min(e.col,t.col),o=Math.max(e.row,t.row),s=Math.max(e.col,t.col),c=this.n2l(a)+r,l=this.n2l(s)+o;return{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:c,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:l,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${c}:${l}`}}if(r.indexOf(`#`)===0)return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress(e,t){return m.n2l(t)+e},encode(...e){switch(e.length){case 2:return m.encodeAddress(e[0],e[1]);case 4:return`${m.encodeAddress(e[0],e[1])}:${m.encodeAddress(e[2],e[3])}`;default:throw Error(`Can only encode with 2 or 4 arguments`)}},inRange(e,t){let[n,r,,i,a]=e,[o,s]=t;return o>=n&&o<=i&&s>=r&&s<=a}};var h=class e{constructor(...e){this.decode(e)}setTLBR(e,t,n,r,i){if(arguments.length<4){let r=m.decodeAddress(e),a=m.decodeAddress(t);this.model={top:Math.min(r.row,a.row),left:Math.min(r.col,a.col),bottom:Math.max(r.row,a.row),right:Math.max(r.col,a.col),sheetName:n},this.setTLBR(r.row,r.col,a.row,a.col,i)}else this.model={top:Math.min(e,n),left:Math.min(t,r),bottom:Math.max(e,n),right:Math.max(t,r),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:{let n=t[0];if(n instanceof e)this.model={top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right,sheetName:n.sheetName};else if(n instanceof Array)this.decode(n);else if(n.top&&n.left&&n.bottom&&n.right)this.model={top:n.top,left:n.left,bottom:n.bottom,right:n.right,sheetName:n.sheetName};else{let e=m.decodeEx(n);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 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(){let{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?`${e}!`:`'${e}'!`:``}expand(e,t,n,r){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||n>this.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){let{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){let t=m.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return m.n2l(this.left)+this.top}get $t$l(){return`$${m.n2l(this.left)}$${this.top}`}get br(){return m.n2l(this.right)+this.bottom}get $b$r(){return`$${m.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){let t=m.decodeEx(e);return this.containsEx(t)}containsEx(e){return e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName?!1: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 n=this.top;n<=this.bottom;n++)e(m.encodeAddress(n,t),n,t)}};let g=function(e){return e[e.Null=0]=`Null`,e[e.Merge=1]=`Merge`,e[e.Number=2]=`Number`,e[e.String=3]=`String`,e[e.Date=4]=`Date`,e[e.Hyperlink=5]=`Hyperlink`,e[e.Formula=6]=`Formula`,e[e.SharedString=7]=`SharedString`,e[e.RichText=8]=`RichText`,e[e.Boolean=9]=`Boolean`,e[e.Error=10]=`Error`,e[e.JSON=11]=`JSON`,e}({}),_=function(e){return e[e.None=0]=`None`,e[e.Master=1]=`Master`,e[e.Shared=2]=`Shared`,e}({}),v=function(e){return e[e.None=0]=`None`,e[e.OfficeDocument=1]=`OfficeDocument`,e[e.Worksheet=2]=`Worksheet`,e[e.CalcChain=3]=`CalcChain`,e[e.SharedStrings=4]=`SharedStrings`,e[e.Styles=5]=`Styles`,e[e.Theme=6]=`Theme`,e[e.Hyperlink=7]=`Hyperlink`,e}({}),y=function(e){return e[e.Xlsx=1]=`Xlsx`,e}({}),b=function(e){return e[e.LeftToRight=1]=`LeftToRight`,e[e.RightToLeft=2]=`RightToLeft`,e}({}),x={NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`},S={ValueType:g,FormulaType:_,RelationshipType:v,DocumentType:y,ReadingOrder:b,ErrorValue:x},{toString:C}=Object.prototype,w=/["&<>]/;function T(e,t){let n=typeof e,r=typeof t,i=Array.isArray(e),a=Array.isArray(t),o;if(n!==r)return!1;switch(typeof e){case`object`:if(i||a)return i&&a?e.length===t.length&&e.every((e,n)=>{let r=t[n];return T(e,r)}):!1;if(e===null||t===null)return e===t;if(o=Object.keys(e),Object.keys(t).length!==o.length)return!1;for(let e of o)if(!Object.prototype.hasOwnProperty.call(t,e))return!1;return o.every(n=>{let r=e[n],i=t[n];return T(r,i)});default:return e===t}}function E(e){let t=w.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){switch(e.charAt(a)){case`"`:r=`"`;break;case`&`:r=`&`;break;case`<`:r=`<`;break;case`>`:r=`>`;break;default:continue}i!==a&&(n+=e.substring(i,a)),i=a+1,n+=r}return i===a?n:n+e.substring(i,a)}function D(e){return C.call(e)===`[object Undefined]`}function O(e){return C.call(e)===`[object Object]`}function k(...e){let t=e[0]||{},{length:n}=e,r,i,a;function o(e,n){r=t[n],a=Array.isArray(e),O(e)||a?(a?(a=!1,i=r&&Array.isArray(r)?r:[]):i=r&&O(r)?r:{},t[n]=k(i,e)):D(e)||(t[n]=e)}for(let t=0;t<n;t++){let n=e[t];n&&(Array.isArray(n)?n.forEach((e,t)=>o(e,t)):Object.entries(n).forEach(([e,t])=>{e===`__proto__`||e===`constructor`||e===`prototype`||o(t,e)}))}return t}var A=class e{static{this.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`},type:`note`}}constructor(e){this.note=e}get model(){let t=null;switch(typeof this.note){case`string`:t={type:`note`,note:{texts:[{text:this.note}]}};break;default:t={type:`note`,note:this.note};break}return k({},e.DEFAULT_CONFIGS,t)}set model(e){let{note:t}=e,{texts:n}=t;n&&n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t}static fromModel(t){let n=new e;return n.model=t,n}};let ee=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,j=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function M(e,t,n){let r=m.decode(t),i=m.decode(n);return e.replace(ee,(e,t,n,a,o)=>{if(o)return e;let s=j.exec(a);if(s){let n=s[1],a=s[2].toUpperCase(),o=s[3],c=s[4];if(a.length>3||a.length===3&&a>`XFD`)return e;let l=m.l2n(a),u=parseInt(c,10);return n||(l+=i.col-r.col),o||(u+=i.row-r.row),(t||``)+(n||``)+m.n2l(l)+(o||``)+u}return e})}var N=class e{static{this.Types=S.ValueType}constructor(t,n,r){if(!t||!n)throw Error(`A Cell needs a Row`);this._row=t,this._column=n,m.validateAddress(r),this._address=r,this._value=V.create(e.Types.Null,this),this.style=this._mergeStyle(t.style,n.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,n){let r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);let i=e&&e.font||t&&t.font;i&&(n.font=i);let a=e&&e.alignment||t&&t.alignment;a&&(n.alignment=a);let o=e&&e.border||t&&t.border;o&&(n.border=o);let s=e&&e.fill||t&&t.fill;s&&(n.fill=s);let c=e&&e.protection||t&&t.protection;return c&&(n.protection=c),n}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,n){this._value.release(),this._value=V.create(e.Types.Merge,this,t),n||(this.style=t.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=V.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):!1}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){if(this.type===e.Types.Merge){this._value.master.value=t;return}this._value.release(),this._value=V.create(V.getType(t),this,t)}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new A(e)}get text(){return this._value.toString()}get html(){return E(this.text)}toString(){return this.text}_upgradeToHyperlink(t){this.type===e.Types.String&&(this._value=V.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(){let{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){let{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(){let{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=V.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=A.fromModel(e.comment);break}e.style?this.style=e.style:this.style={}}},P=class{constructor(e){this.model={address:e.address,type:N.Types.Null}}get value(){return null}set value(e){}get type(){return N.Types.Null}get effectiveType(){return N.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}},F=class{constructor(e,t){this.model={address:e.address,type:N.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Number}get effectiveType(){return N.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()}},te=class{constructor(e,t){this.model={address:e.address,type:N.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.String}get effectiveType(){return N.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}},I=class{constructor(e,t){this.model={address:e.address,type:N.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 N.Types.RichText}get effectiveType(){return N.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}get text(){return this.toString()}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}},L=class{constructor(e,t){this.model={address:e.address,type:N.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Date}get effectiveType(){return N.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()}},ne=class{constructor(e,t){this.model={address:e.address,type:N.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){let 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,this.model.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 N.Types.Hyperlink}get effectiveType(){return N.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||``}},R=class{constructor(e,t){this.model={address:e.address,type:N.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 N?(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 N.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()}},z=class{constructor(e,t){this.cell=e,this.model={address:e.address,type:N.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){let t={},n=n=>{let r=e[n];r&&(t[n]=r)};return n(`formula`),n(`result`),n(`ref`),n(`shareType`),n(`sharedFormula`),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(V.getType(e)){case N.Types.Null:case N.Types.String:case N.Types.Number:case N.Types.Date:break;case N.Types.Hyperlink:case N.Types.Formula:default:throw 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?S.FormulaType.Master:this.model.sharedFormula?S.FormulaType.Shared:S.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return N.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?S.ValueType.Null:e instanceof String||typeof e==`string`?S.ValueType.String:typeof e==`number`?S.ValueType.Number:e instanceof Date?S.ValueType.Date:e.text&&e.hyperlink?S.ValueType.Hyperlink:e.formula?S.ValueType.Formula:S.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&M(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():``}},re=class{constructor(e,t){this.model={address:e.address,type:N.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.SharedString}get effectiveType(){return N.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()}},B=class{constructor(e,t){this.model={address:e.address,type:N.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Boolean}get effectiveType(){return N.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()}},ie=class{constructor(e,t){this.model={address:e.address,type:N.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Error}get effectiveType(){return N.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()}},ae=class{constructor(e,t){this.model={address:e.address,type:N.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 N.Types.String}get effectiveType(){return N.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}};let V={getType(e){return e==null?N.Types.Null:e instanceof String||typeof e==`string`?N.Types.String:typeof e==`number`?N.Types.Number:typeof e==`boolean`?N.Types.Boolean:e instanceof Date?N.Types.Date:e.text&&e.hyperlink?N.Types.Hyperlink:e.formula||e.sharedFormula?N.Types.Formula:e.richText?N.Types.RichText:e.sharedString?N.Types.SharedString:e.error?N.Types.Error:N.Types.JSON},types:[{t:N.Types.Null,f:P},{t:N.Types.Number,f:F},{t:N.Types.String,f:te},{t:N.Types.Date,f:L},{t:N.Types.Hyperlink,f:ne},{t:N.Types.Formula,f:z},{t:N.Types.Merge,f:R},{t:N.Types.JSON,f:ae},{t:N.Types.SharedString,f:re},{t:N.Types.RichText,f:I},{t:N.Types.Boolean,f:B},{t:N.Types.Error,f:ie}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw Error(`Could not create Value of type ${e}`);return new r(t,n)}};var oe=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){let n=this._worksheet.getColumn(e.col);t=new N(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){let t;if(typeof e==`string`){let n=this._worksheet.getColumnKey(e);t=n?n.number:m.l2n(e)}else t=e;return this._cells[t-1]||this.getCellEx({address:m.encodeAddress(this._number,t),row:this._number,col:t})}splice(e,t,...n){let r=e+t,i=n.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+n.length;o<=a;o++)c=this._cells[o-1],s=this._cells[o-i-1],s?(c=this.getCell(o),c.value=s.value,c.style=s.style,c._comment=s._comment):c&&(c.value=null,c.style={},c._comment=void 0);else if(i>0)for(o=a;o>=r;o--)s=this._cells[o-1],s?(c=this.getCell(o+i),c.value=s.value,c.style=s.style,c._comment=s._comment):this._cells[o+i-1]=void 0;for(o=0;o<n.length;o++)c=this.getCell(e+o),c.value=n[o],c.style={},c._comment=void 0}eachCell(e,t){if(t||(t=e,e=null),e&&e.includeEmpty){let e=this._cells.length;for(let n=1;n<=e;n++)t(this.getCell(n),n)}else this._cells.forEach((e,n)=>{e&&e.type!==S.ValueType.Null&&t(e,n+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e||0)-1)||0,i=Math.max(0,(t||0)-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){let e=[];return this._cells.forEach(t=>{t&&t.type!==S.ValueType.Null&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:m.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)})}else this._worksheet.eachColumnKey((t,n)=>{e[n]!==void 0&&(this.getCellEx({address:m.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}get hasValues(){return this._cells.some(e=>e&&e.type!==S.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(n=>{n&&n.type!==S.ValueType.Null&&((!e||e>n.col)&&(e=n.col),t<n.col&&(t=n.col))}),e>0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach(n=>{n&&(n[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(){let e=[],t=0,n=0;return this._cells.forEach(r=>{if(r){let i=r.model;i&&((!t||t>r.col)&&(t=r.col),n<r.col&&(n=r.col),e.push(i))}}),this.height||e.length?{cells:e,number:this.number,min:t,max:n,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 Error(`Invalid row number in model`);this._cells=[];let t;e.cells.forEach(e=>{switch(e.type){case N.Types.Merge:break;default:{let n;if(e.address)n=m.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:m.encodeAddress(e,r),$col$row:`$${m.n2l(r)}$${e}`}}t=n;let r=this.getCellEx(n);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))||{}}},se=class e{constructor(e,t,n){this._worksheet=e,this._number=t,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return m.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}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=e.width===void 0?9:e.width,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){e===void 0?this._header=void 0:(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))}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&&T(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;let 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){let n=this.number;t||(t=e,e=null),this._worksheet.eachRow(e,(e,r)=>{t(e.getCell(n),r)})}get values(){let e=[];return this.eachCell((t,n)=>{t&&t.type!==S.ValueType.Null&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(n=1),e.forEach((e,r)=>{this._worksheet.getCell(r+n,t).value=e})}_applyStyle(e,t){return this.style[e]=t,this.eachCell(n=>{n[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){let t=[],n=null;return e&&e.forEach((e,r)=>{e.isDefault?n&&=null:!n||!e.equivalentTo(n)?(n={min:r+1,max:r+1,width:e.width===void 0?9:e.width,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(n)):n.max=r+1}),t.length?t:void 0}static fromModel(t,n){n||=[];let r=[],i=1,a=0;for(n=n.sort(function(e,t){return e.min-t.min});a<n.length;){let o=n[a++];for(;i<o.min;)r.push(new e(t,i++));for(;i<=o.max;)r.push(new e(t,i++,o))}return r.length?r:null}},H=class e{constructor(e,t,n=0){if(this.worksheet=e,!t)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof t==`string`){let e=m.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else if(t.nativeCol!==void 0){let e=t;this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0}else if(t.col!==void 0){let e=t;this.col=e.col+n,this.row=e.row+n}else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(t){return t instanceof e||t==null?t:new e(void 0,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(this.worksheet.getColumn(this.nativeCol+1).width*1e4):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):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}},ce=class{constructor(e,t){this.worksheet=e,t&&(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 Error(`Invalid Image Type`)}}set model({type:e,imageId:t,range:n,hyperlinks:r}){if(this.type=e,this.imageId=t,e===`image`)if(typeof n==`string`){let e=m.decode(n);this.range={tl:new H(this.worksheet,{col:e.left,row:e.top},-1),br:new H(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`}}else this.range={tl:new H(this.worksheet,n.tl,0),br:n.br&&new H(this.worksheet,n.br,0),ext:n.ext,editAs:n.editAs,hyperlinks:r||n.hyperlinks}}},le=class{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_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)}},U=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||null;default:throw 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(){let{table:e}=this,t=(e,t,n)=>{e[t]===void 0&&(e[t]=n)};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);let n=(e,t)=>{if(!e)throw Error(t)};n(!!e.ref,`Table must have ref`),n(!!e.columns,`Table must have column definitions`),n(!!e.rows,`Table must have row definitions`),e.tl=m.decodeAddress(e.ref);let{row:r,col:i}=e.tl;n(r>0,`Table must be on valid row`),n(i>0,`Table must be on valid col`);let{width:a,filterHeight:o,tableHeight:s}=this;e.autoFilterRef=m.encode(r,i,r+o-1,i+a-1),e.tableRef=m.encode(r,i,r+s-1,i+a-1),e.columns.forEach((e,r)=>{n(!!e.name,`Column ${r} must have a name`),r===0?t(e,`totalsRowLabel`,`Total`):(t(e,`totalsRowFunction`,`none`),e.totalsRowFormula=this.getFormula(e)||void 0)})}store(){let e=(e,t)=>{t&&Object.keys(t).forEach(n=>{e.style[n]=t[n]})},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl,a=0;if(n.headerRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let{style:r,name:a}=t,s=o.getCell(i+n);s.value=a,e(s,r)})}if(n.rows.forEach(o=>{let s=t.getRow(r+ a++);o.forEach((t,r)=>{let a=s.getCell(i+r);a.value=t,e(a,n.columns[r].style)})}),n.totalsRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let r=o.getCell(i+n);n===0?r.value=t.totalsRowLabel:this.getFormula(t)?r.value={formula:t.totalsRowFormula,result:t.totalsRowResult}:r.value=null,e(r,t.style)})}}load(e){let{table:t}=this,{row:n,col:r}=t.tl,i=0;if(t.headerRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+ i++);t.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e})}),t.totalsRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);t===0?n.value=e.totalsRowLabel:this.getFormula(e)&&(n.value={formula:e.totalsRowFormula,result:e.totalsRowResult})})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let e=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}for(let t=0;t<this.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}}this.store()}addRow(e,t){this.cacheState(),t===void 0?this.table.rows.push(e):this.table.rows.splice(t,0,e)}removeRows(e,t=1){this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){let t=this.table.columns[e];return new le(this,t,e)}addColumn(e,t,n){this.cacheState(),n===void 0?(this.table.columns.push(e),this.table.rows.forEach((e,n)=>{e.push(t[n])})):(this.table.columns.splice(n,0,e),this.table.rows.forEach((e,r)=>{e.splice(n,0,t[r])}))}removeColumns(e,t=1){this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(n=>{n.splice(e,t)})}_assign(e,t,n){this.cacheState(),e[t]=n}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.displayName||this.table.name}set displayName(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}},W=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){let t=this.model[e];if(t!==void 0)return t;let n=Object.keys(this.model).filter(e=>e.startsWith(`range:`));if(n.length===0)return;let r=m.decodeAddress(e);for(let e of n){let t=e.slice(6),n=m.decodeEx(t);if(n.dimensions){let t=n.tl,i=n.br;if(r.row>=t.row&&r.row<=i.row&&r.col>=t.col&&r.col<=i.col)return this.model[e]}}}remove(e){this.model[e]=void 0}},ue=c((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),de=c((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),G=c((e=>{var t=ue(),n=de(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(se(e,ArrayBuffer)||e&&se(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(se(e,SharedArrayBuffer)||e&&se(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);var i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){for(var t=e.length<0?0:_(e.length)|0,n=o(t),r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(se(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);var r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n);return Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){var t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||H(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),se(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(se(a,Uint8Array))i+a.length>r.length?s.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else if(s.isBuffer(a))a.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=a.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||se(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var i=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return B(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return V(e).length;default:if(i)return r?-1:B(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return P(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return M(this,t,n);case`latin1`:case`binary`:return N(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return F(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(var t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(var t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(var t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){var t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n),d=0;d<c;++d)if(l[d]!==u[d]){a=l[d],o=u[d];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,H(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){var a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}var l;if(i){var u=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===s)return u*a}else u!==-1&&(l-=l-u),u=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){for(var d=!0,f=0;f<s;f++)if(c(e,l+f)!==c(t,f)){d=!1;break}if(d)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(o*2,2),16);if(H(s))return o;e[n+o]=s}return o}function T(e,t,n,r){return oe(B(t,e.length-n),e,n,r)}function E(e,t,n,r){return oe(ie(t),e,n,r)}function D(e,t,n,r){return oe(V(t),e,n,r)}function O(e,t,n,r){return oe(ae(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;for(var a=!1;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var c,l,u,d;switch(s){case 1:a<128&&(o=a);break;case 2:c=e[i+1],(c&192)==128&&(d=(a&31)<<6|c&63,d>127&&(o=d));break;case 3:c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(d=(a&15)<<12|(c&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(d=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=s}return j(r)}var ee=4096;function j(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function M(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function N(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i=``,a=t;a<n;++a)i+=ce[e[a]];return i}function F(e,t,n){for(var r=e.slice(t,n),i=``,a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function te(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||te(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||te(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||te(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||te(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||te(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||te(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||te(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||te(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||te(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||te(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||te(e,8,this.length),n.read(this,e,!1,52,8)};function I(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;I(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=e&255;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;I(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=e&255;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);I(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=e&255;++a<n&&(o*=256);)e<0&&s===0&&this[t+a-1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);I(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=e&255;--a>=0&&(o*=256);)e<0&&s===0&&this[t+a+1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function L(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function ne(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return ne(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return ne(this,e,t,!1,n)};function R(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;var a;if(typeof e==`number`)for(a=t;a<n;++a)this[a]=e;else{var o=s.isBuffer(e)?e:s.from(e,r),c=o.length;if(c===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(a=0;a<n-t;++a)this[a+t]=o[a%c]}return this};var z=/[^+/0-9A-Za-z-_]/g;function re(e){if(e=e.split(`=`)[0],e=e.trim().replace(z,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function B(e,t){t||=1/0;for(var n,r=e.length,i=null,a=[],o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function ie(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ae(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function V(e){return t.toByteArray(re(e))}function oe(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function se(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function H(e){return e!==e}var ce=(function(){for(var e=`0123456789abcdef`,t=Array(256),n=0;n<16;++n)for(var r=n*16,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t})()}));function fe(){throw Error(`setTimeout has not been defined`)}function K(){throw Error(`clearTimeout has not been defined`)}function q(e){if(_e===setTimeout)return setTimeout(e,0);if((_e===fe||!_e)&&setTimeout)return _e=setTimeout,setTimeout(e,0);try{return _e(e,0)}catch{try{return _e.call(null,e,0)}catch{return _e.call(this,e,0)}}}function J(e){if(ve===clearTimeout)return clearTimeout(e);if((ve===K||!ve)&&clearTimeout)return ve=clearTimeout,clearTimeout(e);try{return ve(e)}catch{try{return ve.call(null,e)}catch{return ve.call(this,e)}}}function Y(){!be||!xe||(be=!1,xe.length?ye=xe.concat(ye):Se=-1,ye.length&&pe())}function pe(){if(!be){var e=q(Y);be=!0;for(var t=ye.length;t;){for(xe=ye,ye=[];++Se<t;)xe&&xe[Se].run();Se=-1,t=ye.length}xe=null,be=!1,J(e)}}function me(e,t){this.fun=e,this.array=t}function he(){}function ge(){}var X,Z,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Q,Re=s((()=>{X={exports:{}},Z=X.exports={},(function(){try{_e=typeof setTimeout==`function`?setTimeout:fe}catch{_e=fe}try{ve=typeof clearTimeout==`function`?clearTimeout:K}catch{ve=K}})(),ye=[],be=!1,Se=-1,Z.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ye.push(new me(e,t)),ye.length===1&&!be&&q(pe)},me.prototype.run=function(){this.fun.apply(null,this.array)},Z.title=`browser`,Z.browser=!0,Z.env={},Z.argv=[],Z.version=``,Z.versions={},Z.on=he,Z.addListener=he,Z.once=he,Z.off=he,Z.removeListener=he,Z.removeAllListeners=he,Z.emit=he,Z.prependListener=he,Z.prependOnceListener=he,Z.listeners=function(e){return[]},Z.binding=function(e){throw Error(`process.binding is not supported`)},Z.cwd=function(){return`/`},Z.chdir=function(e){throw Error(`process.chdir is not supported`)},Z.umask=function(){return 0},Ce=X.exports.browser,we=ge,Te=X.exports.binding,Ee=ge,De=1,Oe={},ke=ge,Ae=ge,je=ge,Me=ge,Ne=ge,Pe=`browser`,Fe=`browser`,Ie=`browser`,Le=[],Q={nextTick:X.exports.nextTick,title:X.exports.title,browser:Ce,env:X.exports.env,argv:X.exports.argv,version:X.exports.version,versions:X.exports.versions,on:X.exports.on,addListener:X.exports.addListener,once:X.exports.once,off:X.exports.off,removeListener:X.exports.removeListener,removeAllListeners:X.exports.removeAllListeners,emit:X.exports.emit,emitWarning:we,prependListener:X.exports.prependListener,prependOnceListener:X.exports.prependOnceListener,listeners:X.exports.listeners,binding:Te,cwd:X.exports.cwd,chdir:X.exports.chdir,umask:X.exports.umask,exit:Ee,pid:De,features:Oe,kill:ke,dlopen:Ae,uptime:je,memoryUsage:Me,uvCounters:Ne,platform:Pe,arch:Fe,execPath:Ie,execArgv:Le},X.exports.addListener,X.exports.argv,X.exports.chdir,X.exports.cwd,X.exports.emit,X.exports.env,X.exports.listeners,X.exports.nextTick,X.exports.off,X.exports.on,X.exports.once,X.exports.prependListener,X.exports.prependOnceListener,X.exports.removeAllListeners,X.exports.removeListener,X.exports.title,X.exports.umask,X.exports.version,X.exports.versions})),ze=c(((e,t)=>{
|
|
7
|
+
var ExcelTS=(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&&n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>o.call(e,`module.exports`)?e[`module.exports`]:u(n({},`__esModule`,{value:!0}),e);let p=/^[A-Z]+\d+$/,m={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level(e){return e<=26?1:e<=676?2:3},_fill(e){let t,n,r,i,a,o=1;if(e>=4)throw 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;)n=o-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)n=o-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],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 Error(`Out of bounds. Invalid column letter: ${e}`);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw 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(!p.test(e))throw Error(`Invalid Address: ${e}`);return!0},decodeAddress(e){let t=e.length<5&&this._hash[e];if(t)return t;let n=!1,r=``,i=0,a=!1,o=``,s=0;for(let t=0,c;t<e.length;t++)if(c=e.charCodeAt(t),!a&&c>=65&&c<=90)n=!0,r+=e[t],i=i*26+c-64;else if(c>=48&&c<=57)a=!0,o+=e[t],s=s*10+c-48;else if(a&&n&&c!==36)break;if(!n)i=void 0;else if(i>16384)throw Error(`Out of bounds. Invalid column letter: ${r}`);a||(s=void 0),e=r+o;let c={address:e,col:i,row:s,$col$row:`$${r}$${o}`};return i<=100&&s<=100&&(this._hash[e]=c,this._hash[c.$col$row]=c),c},getAddress(e,t){if(t){let n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){let t=e.split(`:`);if(t.length===2){let e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col),tl:``,br:``,dimensions:``};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions=`${r.tl}:${r.br}`,r}return this.decodeAddress(e)},decodeEx(e){let t=e.match(/^(?:(?:(?:'((?:[^']|'')+?)')|([^'^ !]+?))!)?(.*)$/),n=t[1]||t[2],r=t[3],i=r.split(`:`);if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]),r=Math.min(e.row,t.row),a=Math.min(e.col,t.col),o=Math.max(e.row,t.row),s=Math.max(e.col,t.col),c=this.n2l(a)+r,l=this.n2l(s)+o;return{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:c,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:l,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${c}:${l}`}}if(r.indexOf(`#`)===0)return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress(e,t){return m.n2l(t)+e},encode(...e){switch(e.length){case 2:return m.encodeAddress(e[0],e[1]);case 4:return`${m.encodeAddress(e[0],e[1])}:${m.encodeAddress(e[2],e[3])}`;default:throw Error(`Can only encode with 2 or 4 arguments`)}},inRange(e,t){let[n,r,,i,a]=e,[o,s]=t;return o>=n&&o<=i&&s>=r&&s<=a}};var h=class e{constructor(...e){this.decode(e)}setTLBR(e,t,n,r,i){if(arguments.length<4){let r=m.decodeAddress(e),a=m.decodeAddress(t);this.model={top:Math.min(r.row,a.row),left:Math.min(r.col,a.col),bottom:Math.max(r.row,a.row),right:Math.max(r.col,a.col),sheetName:n},this.setTLBR(r.row,r.col,a.row,a.col,i)}else this.model={top:Math.min(e,n),left:Math.min(t,r),bottom:Math.max(e,n),right:Math.max(t,r),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:{let n=t[0];if(n instanceof e)this.model={top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right,sheetName:n.sheetName};else if(n instanceof Array)this.decode(n);else if(n.top&&n.left&&n.bottom&&n.right)this.model={top:n.top,left:n.left,bottom:n.bottom,right:n.right,sheetName:n.sheetName};else{let e=m.decodeEx(n);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 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(){let{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?`${e}!`:`'${e}'!`:``}expand(e,t,n,r){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||n>this.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){let{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){let t=m.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return m.n2l(this.left)+this.top}get $t$l(){return`$${m.n2l(this.left)}$${this.top}`}get br(){return m.n2l(this.right)+this.bottom}get $b$r(){return`$${m.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){let t=m.decodeEx(e);return this.containsEx(t)}containsEx(e){return e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName?!1: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 n=this.top;n<=this.bottom;n++)e(m.encodeAddress(n,t),n,t)}};let g=function(e){return e[e.Null=0]=`Null`,e[e.Merge=1]=`Merge`,e[e.Number=2]=`Number`,e[e.String=3]=`String`,e[e.Date=4]=`Date`,e[e.Hyperlink=5]=`Hyperlink`,e[e.Formula=6]=`Formula`,e[e.SharedString=7]=`SharedString`,e[e.RichText=8]=`RichText`,e[e.Boolean=9]=`Boolean`,e[e.Error=10]=`Error`,e[e.JSON=11]=`JSON`,e}({}),_=function(e){return e[e.None=0]=`None`,e[e.Master=1]=`Master`,e[e.Shared=2]=`Shared`,e}({}),v=function(e){return e[e.None=0]=`None`,e[e.OfficeDocument=1]=`OfficeDocument`,e[e.Worksheet=2]=`Worksheet`,e[e.CalcChain=3]=`CalcChain`,e[e.SharedStrings=4]=`SharedStrings`,e[e.Styles=5]=`Styles`,e[e.Theme=6]=`Theme`,e[e.Hyperlink=7]=`Hyperlink`,e}({}),y=function(e){return e[e.Xlsx=1]=`Xlsx`,e}({}),b=function(e){return e[e.LeftToRight=1]=`LeftToRight`,e[e.RightToLeft=2]=`RightToLeft`,e}({}),x={NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`},S={ValueType:g,FormulaType:_,RelationshipType:v,DocumentType:y,ReadingOrder:b,ErrorValue:x},{toString:C}=Object.prototype,w=/["&<>]/;function T(e,t){let n=typeof e,r=typeof t,i=Array.isArray(e),a=Array.isArray(t),o;if(n!==r)return!1;switch(typeof e){case`object`:if(i||a)return i&&a?e.length===t.length&&e.every((e,n)=>{let r=t[n];return T(e,r)}):!1;if(e===null||t===null)return e===t;if(o=Object.keys(e),Object.keys(t).length!==o.length)return!1;for(let e of o)if(!Object.prototype.hasOwnProperty.call(t,e))return!1;return o.every(n=>{let r=e[n],i=t[n];return T(r,i)});default:return e===t}}function E(e){let t=w.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){switch(e.charAt(a)){case`"`:r=`"`;break;case`&`:r=`&`;break;case`<`:r=`<`;break;case`>`:r=`>`;break;default:continue}i!==a&&(n+=e.substring(i,a)),i=a+1,n+=r}return i===a?n:n+e.substring(i,a)}function D(e){return C.call(e)===`[object Undefined]`}function O(e){return C.call(e)===`[object Object]`}function k(...e){let t=e[0]||{},{length:n}=e,r,i,a;function o(e,n){r=t[n],a=Array.isArray(e),O(e)||a?(a?(a=!1,i=r&&Array.isArray(r)?r:[]):i=r&&O(r)?r:{},t[n]=k(i,e)):D(e)||(t[n]=e)}for(let t=0;t<n;t++){let n=e[t];n&&(Array.isArray(n)?n.forEach((e,t)=>o(e,t)):Object.entries(n).forEach(([e,t])=>{e===`__proto__`||e===`constructor`||e===`prototype`||o(t,e)}))}return t}var A=class e{static{this.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`},type:`note`}}constructor(e){this.note=e}get model(){let t=null;switch(typeof this.note){case`string`:t={type:`note`,note:{texts:[{text:this.note}]}};break;default:t={type:`note`,note:this.note};break}return k({},e.DEFAULT_CONFIGS,t)}set model(e){let{note:t}=e,{texts:n}=t;n&&n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t}static fromModel(t){let n=new e;return n.model=t,n}};let ee=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,j=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function M(e,t,n){let r=m.decode(t),i=m.decode(n);return e.replace(ee,(e,t,n,a,o)=>{if(o)return e;let s=j.exec(a);if(s){let n=s[1],a=s[2].toUpperCase(),o=s[3],c=s[4];if(a.length>3||a.length===3&&a>`XFD`)return e;let l=m.l2n(a),u=parseInt(c,10);return n||(l+=i.col-r.col),o||(u+=i.row-r.row),(t||``)+(n||``)+m.n2l(l)+(o||``)+u}return e})}var N=class e{static{this.Types=S.ValueType}constructor(t,n,r){if(!t||!n)throw Error(`A Cell needs a Row`);this._row=t,this._column=n,m.validateAddress(r),this._address=r,this._value=V.create(e.Types.Null,this),this.style=this._mergeStyle(t.style,n.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,n){let r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);let i=e&&e.font||t&&t.font;i&&(n.font=i);let a=e&&e.alignment||t&&t.alignment;a&&(n.alignment=a);let o=e&&e.border||t&&t.border;o&&(n.border=o);let s=e&&e.fill||t&&t.fill;s&&(n.fill=s);let c=e&&e.protection||t&&t.protection;return c&&(n.protection=c),n}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,n){this._value.release(),this._value=V.create(e.Types.Merge,this,t),n||(this.style=t.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=V.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):!1}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){if(this.type===e.Types.Merge){this._value.master.value=t;return}this._value.release(),this._value=V.create(V.getType(t),this,t)}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new A(e)}get text(){return this._value.toString()}get html(){return E(this.text)}toString(){return this.text}_upgradeToHyperlink(t){this.type===e.Types.String&&(this._value=V.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(){let{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){let{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(){let{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=V.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=A.fromModel(e.comment);break}e.style?this.style=e.style:this.style={}}},P=class{constructor(e){this.model={address:e.address,type:N.Types.Null}}get value(){return null}set value(e){}get type(){return N.Types.Null}get effectiveType(){return N.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}},F=class{constructor(e,t){this.model={address:e.address,type:N.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Number}get effectiveType(){return N.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()}},te=class{constructor(e,t){this.model={address:e.address,type:N.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.String}get effectiveType(){return N.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}},I=class{constructor(e,t){this.model={address:e.address,type:N.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 N.Types.RichText}get effectiveType(){return N.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}get text(){return this.toString()}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}},L=class{constructor(e,t){this.model={address:e.address,type:N.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Date}get effectiveType(){return N.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()}},ne=class{constructor(e,t){this.model={address:e.address,type:N.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){let 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,this.model.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 N.Types.Hyperlink}get effectiveType(){return N.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||``}},R=class{constructor(e,t){this.model={address:e.address,type:N.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 N?(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 N.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()}},z=class{constructor(e,t){this.cell=e,this.model={address:e.address,type:N.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){let t={},n=n=>{let r=e[n];r&&(t[n]=r)};return n(`formula`),n(`result`),n(`ref`),n(`shareType`),n(`sharedFormula`),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(V.getType(e)){case N.Types.Null:case N.Types.String:case N.Types.Number:case N.Types.Date:break;case N.Types.Hyperlink:case N.Types.Formula:default:throw 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?S.FormulaType.Master:this.model.sharedFormula?S.FormulaType.Shared:S.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return N.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?S.ValueType.Null:e instanceof String||typeof e==`string`?S.ValueType.String:typeof e==`number`?S.ValueType.Number:e instanceof Date?S.ValueType.Date:e.text&&e.hyperlink?S.ValueType.Hyperlink:e.formula?S.ValueType.Formula:S.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&M(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():``}},re=class{constructor(e,t){this.model={address:e.address,type:N.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.SharedString}get effectiveType(){return N.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()}},B=class{constructor(e,t){this.model={address:e.address,type:N.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Boolean}get effectiveType(){return N.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()}},ie=class{constructor(e,t){this.model={address:e.address,type:N.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return N.Types.Error}get effectiveType(){return N.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()}},ae=class{constructor(e,t){this.model={address:e.address,type:N.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 N.Types.String}get effectiveType(){return N.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}};let V={getType(e){return e==null?N.Types.Null:e instanceof String||typeof e==`string`?N.Types.String:typeof e==`number`?N.Types.Number:typeof e==`boolean`?N.Types.Boolean:e instanceof Date?N.Types.Date:e.text&&e.hyperlink?N.Types.Hyperlink:e.formula||e.sharedFormula?N.Types.Formula:e.richText?N.Types.RichText:e.sharedString?N.Types.SharedString:e.error?N.Types.Error:N.Types.JSON},types:[{t:N.Types.Null,f:P},{t:N.Types.Number,f:F},{t:N.Types.String,f:te},{t:N.Types.Date,f:L},{t:N.Types.Hyperlink,f:ne},{t:N.Types.Formula,f:z},{t:N.Types.Merge,f:R},{t:N.Types.JSON,f:ae},{t:N.Types.SharedString,f:re},{t:N.Types.RichText,f:I},{t:N.Types.Boolean,f:B},{t:N.Types.Error,f:ie}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw Error(`Could not create Value of type ${e}`);return new r(t,n)}};var oe=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){let n=this._worksheet.getColumn(e.col);t=new N(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){let t;if(typeof e==`string`){let n=this._worksheet.getColumnKey(e);t=n?n.number:m.l2n(e)}else t=e;return this._cells[t-1]||this.getCellEx({address:m.encodeAddress(this._number,t),row:this._number,col:t})}splice(e,t,...n){let r=e+t,i=n.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+n.length;o<=a;o++)c=this._cells[o-1],s=this._cells[o-i-1],s?(c=this.getCell(o),c.value=s.value,c.style=s.style,c._comment=s._comment):c&&(c.value=null,c.style={},c._comment=void 0);else if(i>0)for(o=a;o>=r;o--)s=this._cells[o-1],s?(c=this.getCell(o+i),c.value=s.value,c.style=s.style,c._comment=s._comment):this._cells[o+i-1]=void 0;for(o=0;o<n.length;o++)c=this.getCell(e+o),c.value=n[o],c.style={},c._comment=void 0}eachCell(e,t){let n=null,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._cells.length;for(let t=1;t<=e;t++)r(this.getCell(t),t)}else this._cells.forEach((e,t)=>{e&&e.type!==S.ValueType.Null&&r(e,t+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e||0)-1)||0,i=Math.max(0,(t||0)-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){let e=[];return this._cells.forEach(t=>{t&&t.type!==S.ValueType.Null&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:m.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)})}else this._worksheet.eachColumnKey((t,n)=>{e[n]!==void 0&&(this.getCellEx({address:m.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}get hasValues(){return this._cells.some(e=>e&&e.type!==S.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(n=>{n&&n.type!==S.ValueType.Null&&((!e||e>n.col)&&(e=n.col),t<n.col&&(t=n.col))}),e>0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach(n=>{n&&(n[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(){let e=[],t=0,n=0;return this._cells.forEach(r=>{if(r){let i=r.model;i&&((!t||t>r.col)&&(t=r.col),n<r.col&&(n=r.col),e.push(i))}}),this.height||e.length?{cells:e,number:this.number,min:t,max:n,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 Error(`Invalid row number in model`);this._cells=[];let t;e.cells.forEach(e=>{switch(e.type){case N.Types.Merge:break;default:{let n;if(e.address)n=m.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:m.encodeAddress(e,r),$col$row:`$${m.n2l(r)}$${e}`}}t=n;let r=this.getCellEx(n);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))||{}}},se=class e{constructor(e,t,n){this._worksheet=e,this._number=t,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return m.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}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=e.width===void 0?9:e.width,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){e===void 0?this._header=void 0:(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))}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&&T(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;let 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){let n=this.number;t||(t=e,e={}),this._worksheet.eachRow(e,(e,r)=>{t(e.getCell(n),r)})}get values(){let e=[];return this.eachCell((t,n)=>{t&&t.type!==S.ValueType.Null&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(n=1),e.forEach((e,r)=>{this._worksheet.getCell(r+n,t).value=e})}_applyStyle(e,t){return this.style[e]=t,this.eachCell(n=>{n[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){let t=[],n=null;return e&&e.forEach((e,r)=>{e.isDefault?n&&=null:!n||!e.equivalentTo(n)?(n={min:r+1,max:r+1,width:e.width===void 0?9:e.width,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(n)):n.max=r+1}),t.length?t:void 0}static fromModel(t,n){n||=[];let r=[],i=1,a=0;for(n=n.sort(function(e,t){return e.min-t.min});a<n.length;){let o=n[a++];for(;i<o.min;)r.push(new e(t,i++));for(;i<=o.max;)r.push(new e(t,i++,o))}return r.length?r:null}},H=class e{constructor(e,t,n=0){if(this.worksheet=e,!t)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof t==`string`){let e=m.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else if(t.nativeCol!==void 0){let e=t;this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0}else if(t.col!==void 0){let e=t;this.col=e.col+n,this.row=e.row+n}else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(t){return t instanceof e||t==null?t:new e(void 0,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(this.worksheet.getColumn(this.nativeCol+1).width*1e4):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):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}},ce=class{constructor(e,t){this.worksheet=e,t&&(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 Error(`Invalid Image Type`)}}set model({type:e,imageId:t,range:n,hyperlinks:r}){if(this.type=e,this.imageId=t,e===`image`)if(typeof n==`string`){let e=m.decode(n);this.range={tl:new H(this.worksheet,{col:e.left,row:e.top},-1),br:new H(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`}}else this.range={tl:new H(this.worksheet,n.tl,0),br:n.br&&new H(this.worksheet,n.br,0),ext:n.ext,editAs:n.editAs,hyperlinks:r||n.hyperlinks}}},le=class{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_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)}},U=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||null;default:throw 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(){let{table:e}=this,t=(e,t,n)=>{e[t]===void 0&&(e[t]=n)};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);let n=(e,t)=>{if(!e)throw Error(t)};n(!!e.ref,`Table must have ref`),n(!!e.columns,`Table must have column definitions`),n(!!e.rows,`Table must have row definitions`),e.tl=m.decodeAddress(e.ref);let{row:r,col:i}=e.tl;n(r>0,`Table must be on valid row`),n(i>0,`Table must be on valid col`);let{width:a,filterHeight:o,tableHeight:s}=this;e.autoFilterRef=m.encode(r,i,r+o-1,i+a-1),e.tableRef=m.encode(r,i,r+s-1,i+a-1),e.columns.forEach((e,r)=>{n(!!e.name,`Column ${r} must have a name`),r===0?t(e,`totalsRowLabel`,`Total`):(t(e,`totalsRowFunction`,`none`),e.totalsRowFormula=this.getFormula(e)||void 0)})}store(){let e=(e,t)=>{t&&Object.keys(t).forEach(n=>{e.style[n]=t[n]})},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl,a=0;if(n.headerRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let{style:r,name:a}=t,s=o.getCell(i+n);s.value=a,e(s,r)})}if(n.rows.forEach(o=>{let s=t.getRow(r+ a++);o.forEach((t,r)=>{let a=s.getCell(i+r);a.value=t,e(a,n.columns[r].style)})}),n.totalsRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let r=o.getCell(i+n);n===0?r.value=t.totalsRowLabel:this.getFormula(t)?r.value={formula:t.totalsRowFormula,result:t.totalsRowResult}:r.value=null,e(r,t.style)})}}load(e){let{table:t}=this,{row:n,col:r}=t.tl,i=0;if(t.headerRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+ i++);t.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e})}),t.totalsRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);t===0?n.value=e.totalsRowLabel:this.getFormula(e)&&(n.value={formula:e.totalsRowFormula,result:e.totalsRowResult})})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let e=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}for(let t=0;t<this.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}}this.store()}addRow(e,t){this.cacheState(),t===void 0?this.table.rows.push(e):this.table.rows.splice(t,0,e)}removeRows(e,t=1){this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){let t=this.table.columns[e];return new le(this,t,e)}addColumn(e,t,n){this.cacheState(),n===void 0?(this.table.columns.push(e),this.table.rows.forEach((e,n)=>{e.push(t[n])})):(this.table.columns.splice(n,0,e),this.table.rows.forEach((e,r)=>{e.splice(n,0,t[r])}))}removeColumns(e,t=1){this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(n=>{n.splice(e,t)})}_assign(e,t,n){this.cacheState(),e[t]=n}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.displayName||this.table.name}set displayName(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}},W=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){let t=this.model[e];if(t!==void 0)return t;let n=Object.keys(this.model).filter(e=>e.startsWith(`range:`));if(n.length===0)return;let r=m.decodeAddress(e);for(let e of n){let t=e.slice(6),n=m.decodeEx(t);if(n.dimensions){let t=n.tl,i=n.br;if(r.row>=t.row&&r.row<=i.row&&r.col>=t.col&&r.col<=i.col)return this.model[e]}}}remove(e){this.model[e]=void 0}},ue=c((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),de=c((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),G=c((e=>{var t=ue(),n=de(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(se(e,ArrayBuffer)||e&&se(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(se(e,SharedArrayBuffer)||e&&se(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);var i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){for(var t=e.length<0?0:_(e.length)|0,n=o(t),r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(se(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);var r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n);return Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){var t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||H(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),se(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(se(a,Uint8Array))i+a.length>r.length?s.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else if(s.isBuffer(a))a.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=a.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||se(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var i=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return B(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return V(e).length;default:if(i)return r?-1:B(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return P(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return M(this,t,n);case`latin1`:case`binary`:return N(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return F(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(var t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(var t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(var t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){var t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n),d=0;d<c;++d)if(l[d]!==u[d]){a=l[d],o=u[d];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,H(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){var a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}var l;if(i){var u=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===s)return u*a}else u!==-1&&(l-=l-u),u=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){for(var d=!0,f=0;f<s;f++)if(c(e,l+f)!==c(t,f)){d=!1;break}if(d)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(o*2,2),16);if(H(s))return o;e[n+o]=s}return o}function T(e,t,n,r){return oe(B(t,e.length-n),e,n,r)}function E(e,t,n,r){return oe(ie(t),e,n,r)}function D(e,t,n,r){return oe(V(t),e,n,r)}function O(e,t,n,r){return oe(ae(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;for(var a=!1;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var c,l,u,d;switch(s){case 1:a<128&&(o=a);break;case 2:c=e[i+1],(c&192)==128&&(d=(a&31)<<6|c&63,d>127&&(o=d));break;case 3:c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(d=(a&15)<<12|(c&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(d=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=s}return j(r)}var ee=4096;function j(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function M(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function N(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i=``,a=t;a<n;++a)i+=ce[e[a]];return i}function F(e,t,n){for(var r=e.slice(t,n),i=``,a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function te(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||te(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||te(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||te(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||te(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||te(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||te(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||te(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||te(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||te(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||te(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||te(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||te(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||te(e,8,this.length),n.read(this,e,!1,52,8)};function I(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;I(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=e&255;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;I(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=e&255;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);I(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=e&255;++a<n&&(o*=256);)e<0&&s===0&&this[t+a-1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);I(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=e&255;--a>=0&&(o*=256);)e<0&&s===0&&this[t+a+1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function L(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function ne(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return ne(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return ne(this,e,t,!1,n)};function R(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;var a;if(typeof e==`number`)for(a=t;a<n;++a)this[a]=e;else{var o=s.isBuffer(e)?e:s.from(e,r),c=o.length;if(c===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(a=0;a<n-t;++a)this[a+t]=o[a%c]}return this};var z=/[^+/0-9A-Za-z-_]/g;function re(e){if(e=e.split(`=`)[0],e=e.trim().replace(z,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function B(e,t){t||=1/0;for(var n,r=e.length,i=null,a=[],o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function ie(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ae(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function V(e){return t.toByteArray(re(e))}function oe(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function se(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function H(e){return e!==e}var ce=(function(){for(var e=`0123456789abcdef`,t=Array(256),n=0;n<16;++n)for(var r=n*16,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t})()}));function fe(){throw Error(`setTimeout has not been defined`)}function K(){throw Error(`clearTimeout has not been defined`)}function q(e){if(_e===setTimeout)return setTimeout(e,0);if((_e===fe||!_e)&&setTimeout)return _e=setTimeout,setTimeout(e,0);try{return _e(e,0)}catch{try{return _e.call(null,e,0)}catch{return _e.call(this,e,0)}}}function J(e){if(ve===clearTimeout)return clearTimeout(e);if((ve===K||!ve)&&clearTimeout)return ve=clearTimeout,clearTimeout(e);try{return ve(e)}catch{try{return ve.call(null,e)}catch{return ve.call(this,e)}}}function Y(){!be||!xe||(be=!1,xe.length?ye=xe.concat(ye):Se=-1,ye.length&&pe())}function pe(){if(!be){var e=q(Y);be=!0;for(var t=ye.length;t;){for(xe=ye,ye=[];++Se<t;)xe&&xe[Se].run();Se=-1,t=ye.length}xe=null,be=!1,J(e)}}function me(e,t){this.fun=e,this.array=t}function he(){}function ge(){}var X,Z,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Q,Re=s((()=>{X={exports:{}},Z=X.exports={},(function(){try{_e=typeof setTimeout==`function`?setTimeout:fe}catch{_e=fe}try{ve=typeof clearTimeout==`function`?clearTimeout:K}catch{ve=K}})(),ye=[],be=!1,Se=-1,Z.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ye.push(new me(e,t)),ye.length===1&&!be&&q(pe)},me.prototype.run=function(){this.fun.apply(null,this.array)},Z.title=`browser`,Z.browser=!0,Z.env={},Z.argv=[],Z.version=``,Z.versions={},Z.on=he,Z.addListener=he,Z.once=he,Z.off=he,Z.removeListener=he,Z.removeAllListeners=he,Z.emit=he,Z.prependListener=he,Z.prependOnceListener=he,Z.listeners=function(e){return[]},Z.binding=function(e){throw Error(`process.binding is not supported`)},Z.cwd=function(){return`/`},Z.chdir=function(e){throw Error(`process.chdir is not supported`)},Z.umask=function(){return 0},Ce=X.exports.browser,we=ge,Te=X.exports.binding,Ee=ge,De=1,Oe={},ke=ge,Ae=ge,je=ge,Me=ge,Ne=ge,Pe=`browser`,Fe=`browser`,Ie=`browser`,Le=[],Q={nextTick:X.exports.nextTick,title:X.exports.title,browser:Ce,env:X.exports.env,argv:X.exports.argv,version:X.exports.version,versions:X.exports.versions,on:X.exports.on,addListener:X.exports.addListener,once:X.exports.once,off:X.exports.off,removeListener:X.exports.removeListener,removeAllListeners:X.exports.removeAllListeners,emit:X.exports.emit,emitWarning:we,prependListener:X.exports.prependListener,prependOnceListener:X.exports.prependOnceListener,listeners:X.exports.listeners,binding:Te,cwd:X.exports.cwd,chdir:X.exports.chdir,umask:X.exports.umask,exit:Ee,pid:De,features:Oe,kill:ke,dlopen:Ae,uptime:je,memoryUsage:Me,uvCounters:Ne,platform:Pe,arch:Fe,execPath:Ie,execArgv:Le},X.exports.addListener,X.exports.argv,X.exports.chdir,X.exports.cwd,X.exports.emit,X.exports.env,X.exports.listeners,X.exports.nextTick,X.exports.off,X.exports.on,X.exports.once,X.exports.prependListener,X.exports.prependOnceListener,X.exports.removeAllListeners,X.exports.removeListener,X.exports.title,X.exports.umask,X.exports.version,X.exports.versions})),ze=c(((e,t)=>{
|
|
8
8
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9
9
|
var n=G(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Be=c(((e,t)=>{Re();var n=65536,r=4294967295;function i(){throw Error(`Secure random number generation is not supported by this browser.
|
|
10
10
|
Use Chrome, Firefox or Internet Explorer 11`)}var a=ze().Buffer,o=global.crypto||global.msCrypto;o&&o.getRandomValues?t.exports=s:t.exports=i;function s(e,t){if(e>r)throw RangeError(`requested too many random bytes`);var i=a.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;s<e;s+=n)o.getRandomValues(i.slice(s,s+n));else o.getRandomValues(i);return typeof t==`function`?Q.nextTick(function(){t(null,i)}):i}})),Ve=c(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),He=c(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),Ue=c(((e,t)=>{t.exports=He().EventEmitter})),We=c(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),Ge=c(((e,t)=>{var n=We();t.exports=function(){return n()&&!!Symbol.toStringTag}})),Ke=c(((e,t)=>{t.exports=Object})),qe=c(((e,t)=>{t.exports=Error})),Je=c(((e,t)=>{t.exports=EvalError})),Ye=c(((e,t)=>{t.exports=RangeError})),Xe=c(((e,t)=>{t.exports=ReferenceError})),Ze=c(((e,t)=>{t.exports=SyntaxError})),Qe=c(((e,t)=>{t.exports=TypeError})),$e=c(((e,t)=>{t.exports=URIError})),et=c(((e,t)=>{t.exports=Math.abs})),tt=c(((e,t)=>{t.exports=Math.floor})),nt=c(((e,t)=>{t.exports=Math.max})),rt=c(((e,t)=>{t.exports=Math.min})),it=c(((e,t)=>{t.exports=Math.pow})),at=c(((e,t)=>{t.exports=Math.round})),ot=c(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),st=c(((e,t)=>{var n=ot();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),ct=c(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),lt=c(((e,t)=>{var n=ct();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),ut=c(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),dt=c(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=We();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),ft=c(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),pt=c(((e,t)=>{t.exports=Ke().getPrototypeOf||null})),mt=c(((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}})),ht=c(((e,t)=>{var n=mt();t.exports=Function.prototype.bind||n})),gt=c(((e,t)=>{t.exports=Function.prototype.call})),_t=c(((e,t)=>{t.exports=Function.prototype.apply})),vt=c(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),yt=c(((e,t)=>{var n=ht(),r=_t(),i=gt();t.exports=vt()||n.call(i,r)})),bt=c(((e,t)=>{var n=ht(),r=Qe(),i=gt(),a=yt();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),xt=c(((e,t)=>{var n=bt(),r=lt(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),St=c(((e,t)=>{var n=ft(),r=pt(),i=xt();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),Ct=c(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=ht().call(n,r)})),wt=c(((e,t)=>{var n,r=Ke(),i=qe(),a=Je(),o=Ye(),s=Xe(),c=Ze(),l=Qe(),u=$e(),d=et(),f=tt(),p=nt(),m=rt(),h=it(),g=at(),_=st(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=lt(),x=ut(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=dt()(),T=St(),E=pt(),D=ft(),O=_t(),k=gt(),A={},ee=typeof Uint8Array>`u`||!T?n:T(Uint8Array),j={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":ee,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){j[`%Error.prototype%`]=T(T(e))}var M=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return j[t]=n,n},N={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},P=ht(),F=Ct(),te=P.call(k,Array.prototype.concat),I=P.call(O,Array.prototype.splice),L=P.call(k,String.prototype.replace),ne=P.call(k,String.prototype.slice),R=P.call(k,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,B=function(e){var t=ne(e,0,1),n=ne(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return L(e,z,function(e,t,n,i){r[r.length]=n?L(i,re,`$1`):t||e}),r},ie=function(e,t){var n=e,r;if(F(N,n)&&(r=N[n],n=`%`+r[0]+`%`),F(j,n)){var i=j[n];if(i===A&&(i=M(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(R(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=B(e),r=n.length>0?n[0]:``,i=ie(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],I(n,te([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=ne(p,0,1),h=ne(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,F(j,a))o=j[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=F(o,p),o=o[p];f&&!s&&(j[a]=o)}}return o}})),Tt=c(((e,t)=>{var n=wt(),r=bt(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),Et=c(((e,t)=>{var n=Ge()(),r=Tt()(`Object.prototype.toString`),i=function(e){return n&&e&&typeof e==`object`&&Symbol.toStringTag in e?!1:r(e)===`[object Arguments]`},a=function(e){return i(e)?!0:typeof e==`object`&&!!e&&`length`in e&&typeof e.length==`number`&&e.length>=0&&r(e)!==`[object Array]`&&`callee`in e&&r(e.callee)===`[object Function]`},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a})),Dt=c(((e,t)=>{var n=Tt(),r=Ge()(),i=Ct(),a=lt(),o;if(r){var s=n(`RegExp.prototype.exec`),c={},l=function(){throw c},u={toString:l,valueOf:l};typeof Symbol.toPrimitive==`symbol`&&(u[Symbol.toPrimitive]=l),o=function(e){if(!e||typeof e!=`object`)return!1;var t=a(e,`lastIndex`);if(!(t&&i(t,`value`)))return!1;try{s(e,u)}catch(e){return e===c}}}else{var d=n(`Object.prototype.toString`),f=`[object RegExp]`;o=function(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:d(e)===f}}t.exports=o})),Ot=c(((e,t)=>{var n=Tt(),r=Dt(),i=n(`RegExp.prototype.exec`),a=Qe();t.exports=function(e){if(!r(e))throw new a("`regex` must be a RegExp");return function(t){return i(e,t)!==null}}})),kt=c(((e,t)=>{let n=function*(){}.constructor;t.exports=()=>n})),At=c(((e,t)=>{var n=Tt(),r=Ot()(/^\s*(?:function)?\*/),i=Ge()(),a=St(),o=n(`Object.prototype.toString`),s=n(`Function.prototype.toString`),c=kt();t.exports=function(e){if(typeof e!=`function`)return!1;if(r(s(e)))return!0;if(!i)return o(e)===`[object GeneratorFunction]`;if(!a)return!1;var t=c();return t&&a(e)===t.prototype}})),jt=c(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},`length`,{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),Mt=c(((e,t)=>{var n=jt(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;r<a;r++)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))},o=function(e,t,n){for(var r=0,i=e.length;r<i;r++)n==null?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))};function c(e){return r.call(e)===`[object Array]`}t.exports=function(e,t,r){if(!n(t))throw TypeError(`iterator must be a function`);var i;arguments.length>=3&&(i=r),c(e)?a(e,t,i):typeof e==`string`?o(e,t,i):s(e,t,i)}})),Nt=c(((e,t)=>{t.exports=[`Float16Array`,`Float32Array`,`Float64Array`,`Int8Array`,`Int16Array`,`Int32Array`,`Uint8Array`,`Uint8ClampedArray`,`Uint16Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`]})),Pt=c(((e,t)=>{var n=Nt(),r=typeof globalThis>`u`?global:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)typeof r[n[t]]==`function`&&(e[e.length]=n[t]);return e}})),Ft=c(((e,t)=>{var n=ut(),r=Ze(),i=Qe(),a=lt();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),It=c(((e,t)=>{var n=ut(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),Lt=c(((e,t)=>{var n=wt(),r=Ft(),i=It()(),a=lt(),o=Qe(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),Rt=c(((e,t)=>{var n=ht(),r=_t(),i=yt();t.exports=function(){return i(n,r,arguments)}})),zt=c(((e,t)=>{var n=Lt(),r=ut(),i=bt(),a=Rt();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),Bt=c(((e,t)=>{var n=Mt(),r=Pt(),i=zt(),a=Tt(),o=lt(),s=St(),c=a(`Object.prototype.toString`),l=Ge()(),u=typeof globalThis>`u`?global:globalThis,d=r(),f=a(`String.prototype.slice`),p=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};l&&o&&s?n(d,function(e){var t=new u[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=o(n,Symbol.toStringTag);!r&&n&&(r=o(s(n),Symbol.toStringTag)),m[`$`+e]=i(r.get)}}):n(d,function(e){var t=new u[e],n=t.slice||t.set;n&&(m[`$`+e]=i(n))});var h=function(e){var t=!1;return n(m,function(n,r){if(!t)try{`$`+n(e)===r&&(t=f(r,1))}catch{}}),t},g=function(e){var t=!1;return n(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch{}}),t};t.exports=function(e){if(!e||typeof e!=`object`)return!1;if(!l){var t=f(c(e),8,-1);return p(d,t)>-1?t:t===`Object`?g(e):!1}return o?h(e):null}})),Vt=c(((e,t)=>{var n=Bt();t.exports=function(e){return!!n(e)}})),Ht=c((e=>{var t=Et(),n=At(),r=Bt(),i=Vt();function a(e){return e.call.bind(e)}var o=typeof BigInt<`u`,s=typeof Symbol<`u`,c=a(Object.prototype.toString),l=a(Number.prototype.valueOf),u=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(o)var f=a(BigInt.prototype.valueOf);if(s)var p=a(Symbol.prototype.valueOf);function m(e,t){if(typeof e!=`object`)return!1;try{return t(e),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function h(e){return typeof Promise<`u`&&e instanceof Promise||typeof e==`object`&&!!e&&typeof e.then==`function`&&typeof e.catch==`function`}e.isPromise=h;function g(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||L(e)}e.isArrayBufferView=g;function _(e){return r(e)===`Uint8Array`}e.isUint8Array=_;function v(e){return r(e)===`Uint8ClampedArray`}e.isUint8ClampedArray=v;function y(e){return r(e)===`Uint16Array`}e.isUint16Array=y;function b(e){return r(e)===`Uint32Array`}e.isUint32Array=b;function x(e){return r(e)===`Int8Array`}e.isInt8Array=x;function S(e){return r(e)===`Int16Array`}e.isInt16Array=S;function C(e){return r(e)===`Int32Array`}e.isInt32Array=C;function w(e){return r(e)===`Float32Array`}e.isFloat32Array=w;function T(e){return r(e)===`Float64Array`}e.isFloat64Array=T;function E(e){return r(e)===`BigInt64Array`}e.isBigInt64Array=E;function D(e){return r(e)===`BigUint64Array`}e.isBigUint64Array=D;function O(e){return c(e)===`[object Map]`}O.working=typeof Map<`u`&&O(new Map);function k(e){return typeof Map>`u`?!1:O.working?O(e):e instanceof Map}e.isMap=k;function A(e){return c(e)===`[object Set]`}A.working=typeof Set<`u`&&A(new Set);function ee(e){return typeof Set>`u`?!1:A.working?A(e):e instanceof Set}e.isSet=ee;function j(e){return c(e)===`[object WeakMap]`}j.working=typeof WeakMap<`u`&&j(new WeakMap);function M(e){return typeof WeakMap>`u`?!1:j.working?j(e):e instanceof WeakMap}e.isWeakMap=M;function N(e){return c(e)===`[object WeakSet]`}N.working=typeof WeakSet<`u`&&N(new WeakSet);function P(e){return N(e)}e.isWeakSet=P;function F(e){return c(e)===`[object ArrayBuffer]`}F.working=typeof ArrayBuffer<`u`&&F(new ArrayBuffer);function te(e){return typeof ArrayBuffer>`u`?!1:F.working?F(e):e instanceof ArrayBuffer}e.isArrayBuffer=te;function I(e){return c(e)===`[object DataView]`}I.working=typeof ArrayBuffer<`u`&&typeof DataView<`u`&&I(new DataView(new ArrayBuffer(1),0,1));function L(e){return typeof DataView>`u`?!1:I.working?I(e):e instanceof DataView}e.isDataView=L;var ne=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:void 0;function R(e){return c(e)===`[object SharedArrayBuffer]`}function z(e){return ne===void 0?!1:(R.working===void 0&&(R.working=R(new ne)),R.working?R(e):e instanceof ne)}e.isSharedArrayBuffer=z;function re(e){return c(e)===`[object AsyncFunction]`}e.isAsyncFunction=re;function B(e){return c(e)===`[object Map Iterator]`}e.isMapIterator=B;function ie(e){return c(e)===`[object Set Iterator]`}e.isSetIterator=ie;function ae(e){return c(e)===`[object Generator]`}e.isGeneratorObject=ae;function V(e){return c(e)===`[object WebAssembly.Module]`}e.isWebAssemblyCompiledModule=V;function oe(e){return m(e,l)}e.isNumberObject=oe;function se(e){return m(e,u)}e.isStringObject=se;function H(e){return m(e,d)}e.isBooleanObject=H;function ce(e){return o&&m(e,f)}e.isBigIntObject=ce;function le(e){return s&&m(e,p)}e.isSymbolObject=le;function U(e){return oe(e)||se(e)||H(e)||ce(e)||le(e)}e.isBoxedPrimitive=U;function W(e){return typeof Uint8Array<`u`&&(te(e)||z(e))}e.isAnyArrayBuffer=W,[`isProxy`,`isExternal`,`isModuleNamespaceObject`].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+` is not supported in userland`)}})})})),Ut=c(((e,t)=>{t.exports=function(e){return e&&typeof e==`object`&&typeof e.copy==`function`&&typeof e.fill==`function`&&typeof e.readUInt8==`function`}})),Wt=c((e=>{Re();var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},n=/%[sdj%]/g;e.format=function(e){if(!x(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(` `)}for(var r=1,i=arguments,a=i.length,s=String(e).replace(n,function(e){if(e===`%%`)return`%`;if(r>=a)return e;switch(e){case`%s`:return String(i[r++]);case`%d`:return Number(i[r++]);case`%j`:try{return JSON.stringify(i[r++])}catch{return`[Circular]`}default:return e}}),c=i[r];r<a;c=i[++r])v(c)||!T(c)?s+=` `+c:s+=` `+o(c);return s},e.deprecate=function(t,n){if(Q!==void 0&&Q.noDeprecation===!0)return t;if(Q===void 0)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;function i(){if(!r){if(Q.throwDeprecation)throw Error(n);Q.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}return i};var r={},i=/^$/;if(Q.env.NODE_DEBUG){var a=Q.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`).replace(/,/g,`$|^`).toUpperCase(),i=RegExp(`^`+a+`$`,`i`)}e.debuglog=function(t){if(t=t.toUpperCase(),!r[t])if(i.test(t)){var n=Q.pid;r[t]=function(){var r=e.format.apply(e,arguments);console.error(`%s %d: %s`,t,n,r)}}else r[t]=function(){};return r[t]};function o(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_(n)?r.showHidden=n:n&&e._extend(r,n),C(r.showHidden)&&(r.showHidden=!1),C(r.depth)&&(r.depth=2),C(r.colors)&&(r.colors=!1),C(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),u(r,t,r.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:`cyan`,number:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,date:`magenta`,regexp:`red`};function s(e,t){var n=o.styles[t];return n?`\x1B[`+o.colors[n][0]+`m`+e+`\x1B[`+o.colors[n][1]+`m`:e}function c(e,t){return e}function l(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&!(n.constructor&&n.constructor.prototype===n)){var i=n.inspect(r,t);return x(i)||(i=u(t,i,r)),i}var a=d(t,n);if(a)return a;var o=Object.keys(n),s=l(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),D(n)&&(o.indexOf(`message`)>=0||o.indexOf(`description`)>=0))return f(n);if(o.length===0){if(O(n)){var c=n.name?`: `+n.name:``;return t.stylize(`[Function`+c+`]`,`special`)}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),`regexp`);if(E(n))return t.stylize(Date.prototype.toString.call(n),`date`);if(D(n))return f(n)}var _=``,v=!1,y=[`{`,`}`];if(g(n)&&(v=!0,y=[`[`,`]`]),O(n)&&(_=` [Function`+(n.name?`: `+n.name:``)+`]`),w(n)&&(_=` `+RegExp.prototype.toString.call(n)),E(n)&&(_=` `+Date.prototype.toUTCString.call(n)),D(n)&&(_=` `+f(n)),o.length===0&&(!v||n.length==0))return y[0]+_+y[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),`regexp`):t.stylize(`[Object]`,`special`);t.seen.push(n);var b=v?p(t,n,r,s,o):o.map(function(e){return m(t,n,r,s,e,v)});return t.seen.pop(),h(b,_,y)}function d(e,t){if(C(t))return e.stylize(`undefined`,`undefined`);if(x(t)){var n=`'`+JSON.stringify(t).replace(/^"|"$/g,``).replace(/'/g,`\\'`).replace(/\\"/g,`"`)+`'`;return e.stylize(n,`string`)}if(b(t))return e.stylize(``+t,`number`);if(_(t))return e.stylize(``+t,`boolean`);if(v(t))return e.stylize(`null`,`null`)}function f(e){return`[`+Error.prototype.toString.call(e)+`]`}function p(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)N(t,String(o))?a.push(m(e,t,n,r,String(o),!0)):a.push(``);return i.forEach(function(i){i.match(/^\d+$/)||a.push(m(e,t,n,r,i,!0))}),a}function m(e,t,n,r,i,a){var o,s,c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]};if(c.get?s=c.set?e.stylize(`[Getter/Setter]`,`special`):e.stylize(`[Getter]`,`special`):c.set&&(s=e.stylize(`[Setter]`,`special`)),N(r,i)||(o=`[`+i+`]`),s||(e.seen.indexOf(c.value)<0?(s=v(n)?u(e,c.value,null):u(e,c.value,n-1),s.indexOf(`
|
|
@@ -22,7 +22,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var a=ze().Buffer,o=global.crypto|
|
|
|
22
22
|
`)}})),Ci=c((e=>{var t=e;t.der=xi(),t.pem=Si()})),wi=c((e=>{var t=e;t.bignum=Tr(),t.define=di().define,t.base=hi(),t.constants=_i(),t.decoders=bi(),t.encoders=Ci()})),Ti=c(((e,t)=>{var n=wi(),r=n.define(`Time`,function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=n.define(`AttributeTypeValue`,function(){this.seq().obj(this.key(`type`).objid(),this.key(`value`).any())}),a=n.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`parameters`).optional(),this.key(`curve`).objid().optional())}),o=n.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(a),this.key(`subjectPublicKey`).bitstr())}),s=n.define(`RelativeDistinguishedName`,function(){this.setof(i)}),c=n.define(`RDNSequence`,function(){this.seqof(s)}),l=n.define(`Name`,function(){this.choice({rdnSequence:this.use(c)})}),u=n.define(`Validity`,function(){this.seq().obj(this.key(`notBefore`).use(r),this.key(`notAfter`).use(r))}),d=n.define(`Extension`,function(){this.seq().obj(this.key(`extnID`).objid(),this.key(`critical`).bool().def(!1),this.key(`extnValue`).octstr())}),f=n.define(`TBSCertificate`,function(){this.seq().obj(this.key(`version`).explicit(0).int().optional(),this.key(`serialNumber`).int(),this.key(`signature`).use(a),this.key(`issuer`).use(l),this.key(`validity`).use(u),this.key(`subject`).use(l),this.key(`subjectPublicKeyInfo`).use(o),this.key(`issuerUniqueID`).implicit(1).bitstr().optional(),this.key(`subjectUniqueID`).implicit(2).bitstr().optional(),this.key(`extensions`).explicit(3).seqof(d).optional())});t.exports=n.define(`X509Certificate`,function(){this.seq().obj(this.key(`tbsCertificate`).use(f),this.key(`signatureAlgorithm`).use(a),this.key(`signatureValue`).bitstr())})})),Ei=c((e=>{var t=wi();e.certificate=Ti(),e.RSAPrivateKey=t.define(`RSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`modulus`).int(),this.key(`publicExponent`).int(),this.key(`privateExponent`).int(),this.key(`prime1`).int(),this.key(`prime2`).int(),this.key(`exponent1`).int(),this.key(`exponent2`).int(),this.key(`coefficient`).int())}),e.RSAPublicKey=t.define(`RSAPublicKey`,function(){this.seq().obj(this.key(`modulus`).int(),this.key(`publicExponent`).int())});var n=t.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`none`).null_().optional(),this.key(`curve`).objid().optional(),this.key(`params`).seq().obj(this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int()).optional())});e.PublicKey=t.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(n),this.key(`subjectPublicKey`).bitstr())}),e.PrivateKey=t.define(`PrivateKeyInfo`,function(){this.seq().obj(this.key(`version`).int(),this.key(`algorithm`).use(n),this.key(`subjectPrivateKey`).octstr())}),e.EncryptedPrivateKey=t.define(`EncryptedPrivateKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).seq().obj(this.key(`id`).objid(),this.key(`decrypt`).seq().obj(this.key(`kde`).seq().obj(this.key(`id`).objid(),this.key(`kdeparams`).seq().obj(this.key(`salt`).octstr(),this.key(`iters`).int())),this.key(`cipher`).seq().obj(this.key(`algo`).objid(),this.key(`iv`).octstr()))),this.key(`subjectPrivateKey`).octstr())}),e.DSAPrivateKey=t.define(`DSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int(),this.key(`pub_key`).int(),this.key(`priv_key`).int())}),e.DSAparam=t.define(`DSAparam`,function(){this.int()});var r=t.define(`ECParameters`,function(){this.choice({namedCurve:this.objid()})});e.ECPrivateKey=t.define(`ECPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`privateKey`).octstr(),this.key(`parameters`).optional().explicit(0).use(r),this.key(`publicKey`).optional().explicit(1).bitstr())}),e.signature=t.define(`signature`,function(){this.seq().obj(this.key(`r`).int(),this.key(`s`).int())})})),Di=c(((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":`aes-128-ecb`,"2.16.840.1.101.3.4.1.2":`aes-128-cbc`,"2.16.840.1.101.3.4.1.3":`aes-128-ofb`,"2.16.840.1.101.3.4.1.4":`aes-128-cfb`,"2.16.840.1.101.3.4.1.21":`aes-192-ecb`,"2.16.840.1.101.3.4.1.22":`aes-192-cbc`,"2.16.840.1.101.3.4.1.23":`aes-192-ofb`,"2.16.840.1.101.3.4.1.24":`aes-192-cfb`,"2.16.840.1.101.3.4.1.41":`aes-256-ecb`,"2.16.840.1.101.3.4.1.42":`aes-256-cbc`,"2.16.840.1.101.3.4.1.43":`aes-256-ofb`,"2.16.840.1.101.3.4.1.44":`aes-256-cfb`}})),Oi=c(((e,t)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=yr(),o=Sr(),s=ze().Buffer;t.exports=function(e,t){var c=e.toString(),l=c.match(n),u;if(l){var d=`aes`+l[1],f=s.from(l[2],`hex`),p=s.from(l[3].replace(/[\r\n]/g,``),`base64`),m=a(t,f.slice(0,8),parseInt(l[1],10)).key,h=[],g=o.createDecipheriv(d,m,f);h.push(g.update(p)),h.push(g.final()),u=s.concat(h)}else{var _=c.match(i);u=s.from(_[2].replace(/[\r\n]/g,``),`base64`)}return{tag:c.match(r)[1],data:u}}})),ki=c(((e,t)=>{var n=Ei(),r=Di(),i=Oi(),a=Sr(),o=Yn().pbkdf2Sync,s=ze().Buffer;function c(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=r[e.algorithm.decrypt.cipher.algo.join(`.`)],l=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,d=o(t,n,i,parseInt(c.split(`-`)[1],10)/8,`sha1`),f=a.createDecipheriv(c,d,l),p=[];return p.push(f.update(u)),p.push(f.final()),s.concat(p)}function l(e){var t;typeof e==`object`&&!s.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e==`string`&&(e=s.from(e));var r=i(e,t),a=r.tag,o=r.data,l,u;switch(a){case`CERTIFICATE`:u=n.certificate.decode(o,`der`).tbsCertificate.subjectPublicKeyInfo;case`PUBLIC KEY`:switch(u||=n.PublicKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPublicKey.decode(u.subjectPublicKey.data,`der`);case`1.2.840.10045.2.1`:return u.subjectPrivateKey=u.subjectPublicKey,{type:`ec`,data:u};case`1.2.840.10040.4.1`:return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,`der`),{type:`dsa`,data:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`ENCRYPTED PRIVATE KEY`:o=n.EncryptedPrivateKey.decode(o,`der`),o=c(o,t);case`PRIVATE KEY`:switch(u=n.PrivateKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPrivateKey.decode(u.subjectPrivateKey,`der`);case`1.2.840.10045.2.1`:return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,`der`).privateKey};case`1.2.840.10040.4.1`:return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,`der`),{type:`dsa`,params:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`RSA PUBLIC KEY`:return n.RSAPublicKey.decode(o,`der`);case`RSA PRIVATE KEY`:return n.RSAPrivateKey.decode(o,`der`);case`DSA PRIVATE KEY`:return{type:`dsa`,params:n.DSAPrivateKey.decode(o,`der`)};case`EC PRIVATE KEY`:return o=n.ECPrivateKey.decode(o,`der`),{curve:o.parameters.value,privateKey:o.privateKey};default:throw Error(`unknown key type `+a)}}l.signature=n.signature,t.exports=l})),Ai=c(((e,t)=>{t.exports={"1.3.132.0.10":`secp256k1`,"1.3.132.0.33":`p224`,"1.2.840.10045.3.1.1":`p192`,"1.2.840.10045.3.1.7":`p256`,"1.3.132.0.34":`p384`,"1.3.132.0.35":`p521`}})),ji=c(((e,t)=>{var n=ze().Buffer,r=Vn(),i=Nr(),a=li().ec,o=Mr(),s=ki(),c=Ai(),l=1;function u(e,t,r,a,o){var c=s(t);if(c.curve){if(a!==`ecdsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);return d(e,c)}else if(c.type===`dsa`){if(a!==`dsa`)throw Error(`wrong private key type`);return f(e,c,r)}if(a!==`rsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);if(t.padding!==void 0&&t.padding!==l)throw Error(`illegal or unsupported padding mode`);e=n.concat([o,e]);for(var u=c.modulus.byteLength(),p=[0,1];e.length+p.length+1<u;)p.push(255);p.push(0);for(var m=-1;++m<e.length;)p.push(e[m]);return i(p,c)}function d(e,t){var r=c[t.curve.join(`.`)];if(!r)throw Error(`unknown curve `+t.curve.join(`.`));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}function f(e,t,n){for(var r=t.params.priv_key,i=t.params.p,a=t.params.q,s=t.params.g,c=new o(0),l,u=h(e,a).mod(a),d=!1,f=m(r,a,e,n);d===!1;)l=_(a,f,n),c=v(s,l,i,a),d=l.invm(a).imul(u.add(r.mul(c))).mod(a),d.cmpn(0)===0&&(d=!1,c=new o(0));return p(c,d)}function p(e,t){e=e.toArray(),t=t.toArray(),e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}function m(e,t,i,a){if(e=n.from(e.toArray()),e.length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var s=i.length,c=g(i,t),l=n.alloc(s);l.fill(1);var u=n.alloc(s);return u=r(a,u).update(l).update(n.from([0])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),u=r(a,u).update(l).update(n.from([1])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),{k:u,v:l}}function h(e,t){var n=new o(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function g(e,t){e=h(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}function _(e,t,i){var a,o;do{for(a=n.alloc(0);a.length*8<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),a=n.concat([a,t.v]);o=h(a,e),t.k=r(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(o.cmp(e)!==-1);return o}function v(e,t,n,r){return e.toRed(o.mont(n)).redPow(t).fromRed().mod(r)}t.exports=u,t.exports.getKey=m,t.exports.makeKey=_})),Mi=c(((e,t)=>{var n=ze().Buffer,r=Mr(),i=li().ec,a=ki(),o=Ai();function s(e,t,i,o,s){var u=a(i);if(u.type===`ec`){if(o!==`ecdsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);return c(e,t,u)}else if(u.type===`dsa`){if(o!==`dsa`)throw Error(`wrong public key type`);return l(e,t,u)}if(o!==`rsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=n.concat([s,t]);for(var d=u.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<d;)f.push(255),p+=1;f.push(0);for(var m=-1;++m<t.length;)f.push(t[m]);f=n.from(f);var h=r.mont(u.modulus);e=new r(e).toRed(h),e=e.redPow(new r(u.publicExponent)),e=n.from(e.fromRed().toArray());var g=p<8?1:0;for(d=Math.min(e.length,f.length),e.length!==f.length&&(g=1),m=-1;++m<d;)g|=e[m]^f[m];return g===0}function c(e,t,n){var r=o[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var a=new i(r),s=n.data.subjectPrivateKey.data;return a.verify(t,e,s)}function l(e,t,n){var i=n.data.p,o=n.data.q,s=n.data.g,c=n.data.pub_key,l=a.signature.decode(e,`der`),d=l.s,f=l.r;u(d,o),u(f,o);var p=r.mont(i),m=d.invm(o);return s.toRed(p).redPow(new r(t).mul(m).mod(o)).fromRed().mul(c.toRed(p).redPow(f.mul(m).mod(o)).fromRed()).mod(i).mod(o).cmp(f)===0}function u(e,t){if(e.cmpn(0)<=0||e.cmp(t)>=0)throw Error(`invalid sig`)}t.exports=s})),Ni=c(((e,t)=>{var n=ze().Buffer,r=Rn(),i=En(),a=Ve(),o=ji(),s=Mi(),c=Hn();Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,`hex`),c[e.toLowerCase()]=c[e]});function l(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(l,i.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},l.prototype.sign=function(e,t){this.end();var n=o(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n};function u(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(u,i.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},u.prototype.verify=function(e,t,r){var i=typeof t==`string`?n.from(t,r):t;return this.end(),s(i,this._hash.digest(),e,this._signType,this._tag)};function d(e){return new l(e)}function f(e){return new u(e)}t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}})),Pi=c(((e,t)=>{var n=G(),r=li(),i=Tr();t.exports=function(e){return new o(e)};var a={secp256k1:{name:`secp256k1`,byteLength:32},secp224r1:{name:`p224`,byteLength:28},prime256v1:{name:`p256`,byteLength:32},prime192v1:{name:`p192`,byteLength:24},ed25519:{name:`ed25519`,byteLength:32},secp384r1:{name:`p384`,byteLength:48},secp521r1:{name:`p521`,byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1;function o(e){this.curveType=a[e],this.curveType||={name:e},this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,r){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic(t===`compressed`,!0);return t===`hybrid`&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,e)},o.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t));var r=new i(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function s(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n.Buffer(e);if(r&&i.length<r){var a=new n.Buffer(r-i.length);a.fill(0),i=n.Buffer.concat([a,i])}return t?i.toString(t):i}})),Fi=c(((e,t)=>{var n=Rn(),r=ze().Buffer;t.exports=function(e,t){for(var a=r.alloc(0),o=0,s;a.length<t;)s=i(o++),a=r.concat([a,n(`sha1`).update(e).update(s).digest()]);return a.slice(0,t)};function i(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}})),Ii=c(((e,t)=>{t.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}})),Li=c(((e,t)=>{var n=Tr(),r=ze().Buffer;function i(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}t.exports=i})),Ri=c(((e,t)=>{var n=ki(),r=Be(),i=Rn(),a=Fi(),o=Ii(),s=Tr(),c=Li(),l=Nr(),u=ze().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,a=n(e),o;if(i===4)o=d(a,t);else if(i===1)o=f(a,t,r);else if(i===3){if(o=new s(t),o.cmp(a.modulus)>=0)throw Error(`data too long for modulus`)}else throw Error(`unknown padding`);return r?l(o,a):c(o,a)};function d(e,t){var n=e.modulus.byteLength(),c=t.length,l=i(`sha1`).update(u.alloc(0)).digest(),d=l.length,f=2*d;if(c>n-f-2)throw Error(`message too long`);var p=u.alloc(n-c-f-2),m=n-d-1,h=r(d),g=o(u.concat([l,p,u.alloc(1,1),t],m),a(h,m)),_=o(h,a(g,d));return new s(u.concat([u.alloc(1),_,g],n))}function f(e,t,n){var r=t.length,i=e.modulus.byteLength();if(r>i-11)throw Error(`message too long`);var a=n?u.alloc(i-r-3,255):p(i-r-3);return new s(u.concat([u.from([0,n?1:2]),a,u.alloc(1),t],i))}function p(e){for(var t=u.allocUnsafe(e),n=0,i=r(e*2),a=0,o;n<e;)a===i.length&&(i=r(e*2),a=0),o=i[a++],o&&(t[n++]=o);return t}})),zi=c(((e,t)=>{var n=ki(),r=Fi(),i=Ii(),a=Tr(),o=Nr(),s=Rn(),c=Li(),l=ze().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,s=n(e),f=s.modulus.byteLength();if(t.length>f||new a(t).cmp(s.modulus)>=0)throw Error(`decryption error`);var p=r?c(new a(t),s):o(t,s),m=l.alloc(f-p.length);if(p=l.concat([m,p],f),i===4)return u(s,p);if(i===1)return d(s,p,r);if(i===3)return p;throw Error(`unknown padding`)};function u(e,t){var n=e.modulus.byteLength(),a=s(`sha1`).update(l.alloc(0)).digest(),o=a.length;if(t[0]!==0)throw Error(`decryption error`);var c=t.slice(1,o+1),u=t.slice(o+1),d=i(u,r(i(c,r(u,o)),n-o-1));if(f(a,d.slice(0,o)))throw Error(`decryption error`);for(var p=o;d[p]===0;)p++;if(d[p++]!==1)throw Error(`decryption error`);return d.slice(p)}function d(e,t,n){for(var r=t.slice(0,2),i=2,a=0;t[i++]!==0;)if(i>=t.length){a++;break}var o=t.slice(2,i-1);if((r.toString(`hex`)!==`0002`&&!n||r.toString(`hex`)!==`0001`&&n)&&a++,o.length<8&&a++,a)throw Error(`decryption error`);return t.slice(i)}function f(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));for(var i=-1;++i<r;)n+=e[i]^t[i];return n}})),Bi=c((e=>{e.publicEncrypt=Ri(),e.privateDecrypt=zi(),e.privateEncrypt=function(t,n){return e.publicEncrypt(t,n,!0)},e.publicDecrypt=function(t,n){return e.privateDecrypt(t,n,!0)}})),Vi=c((e=>{Re();function t(){throw Error(`secure random number generation not supported by this browser
|
|
23
23
|
use chrome, FireFox or Internet Explorer 11`)}var n=ze(),r=Be(),i=n.Buffer,a=n.kMaxLength,o=global.crypto||global.msCrypto,s=2**32-1;function c(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`offset must be a number`);if(e>s||e<0)throw TypeError(`offset must be a uint32`);if(e>a||e>t)throw RangeError(`offset out of range`)}function l(e,t,n){if(typeof e!=`number`||e!==e)throw TypeError(`size must be a number`);if(e>s||e<0)throw TypeError(`size must be a uint32`);if(e+t>n||e>a)throw RangeError(`buffer too small`)}o&&o.getRandomValues||!Q.browser?(e.randomFill=u,e.randomFillSync=f):(e.randomFill=t,e.randomFillSync=t);function u(e,t,n,r){if(!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);if(typeof t==`function`)r=t,t=0,n=e.length;else if(typeof n==`function`)r=n,n=e.length-t;else if(typeof r!=`function`)throw TypeError(`"cb" argument must be a function`);return c(t,e.length),l(n,t,e.length),d(e,t,n,r)}function d(e,t,n,i){if(Q.browser){var a=e.buffer,s=new Uint8Array(a,t,n);if(o.getRandomValues(s),i){Q.nextTick(function(){i(null,e)});return}return e}if(i){r(n,function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)});return}return r(n).copy(e,t),e}function f(e,t,n){if(t===void 0&&(t=0),!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);return c(t,e.length),n===void 0&&(n=e.length-t),l(n,t,e.length),d(e,t,n)}})),Hi=c((e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=Be(),e.createHash=e.Hash=Rn(),e.createHmac=e.Hmac=Vn();var t=Un(),n=Object.keys(t),r=[`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`md5`,`rmd160`].concat(n);e.getHashes=function(){return r};var i=Yn();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var a=wr();e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var o=jr();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var s=Ni();e.createSign=s.createSign,e.Sign=s.Sign,e.createVerify=s.createVerify,e.Verify=s.Verify,e.createECDH=Pi();var c=Bi();e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var l=Vi();e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
24
24
|
we accept pull requests
|
|
25
|
-
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Ui=G(),Wi=d(Hi(),1);let Gi={hash(e,...t){let n=Wi.createHash(e);return n.update(Ui.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Wi.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Ui.Buffer.from(e,`utf16le`),a=this.hash(t,Ui.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Ui.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Wi.randomBytes(e)}};var Ki=l({default:()=>qi}),qi,Ji=s((()=>{qi=null}));Ji();function Yi(){}let Xi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function Zi(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function Qi(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let $i=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function ea(e){let t=$i.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ta(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function na(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function ra(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function ia(e){return new Promise(t=>{qi.access(e,qi.constants.F_OK,e=>{t(!e)})})}function aa(e){return e===!0||e===`true`||e===1||e===`1`}function*oa(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function sa(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ca(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}let la=new TextDecoder(`utf-8`);function ua(e){return typeof e==`string`?e:la.decode(e)}function da(e,t){fa(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=pa(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function fa(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ca(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function pa(e,t){let n=e.getRow(1).values,r=ca(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return sa(new Set(n))},a=[];for(let e of oa(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let ma=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),ha=(e,t,n,r=[])=>{e[n]&&(t[n]=ma(e[n],r))},ga=e=>Object.keys(e).length===0,_a=e=>{if(!e)return e;if(ga(e))return{};let t={...e};return ha(e,t,`font`,[`color`]),ha(e,t,`alignment`),ha(e,t,`protection`),e.border&&(ha(e,t,`border`),ha(e.border,t.border,`top`,[`color`]),ha(e.border,t.border,`left`,[`color`]),ha(e.border,t.border,`bottom`,[`color`]),ha(e.border,t.border,`right`,[`color`]),ha(e.border,t.border,`diagonal`,[`color`])),e.fill&&(ha(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>ma(e,[`color`])))),t};var va=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,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 W,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw 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 Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=t.header&&1||t.headers&&t.headers.length||0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=[e,t];n.forEach(e=>{r.push(e[i]||null)}),this.getRow(i+1).splice(...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,n.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(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)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||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=_a(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=_a(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t._value.constructor.name===`MergeValue`){let e=this.getRow(t._row._number+i).getCell(n),r=t._value._master,a=this.getRow(r._row._number+i).getCell(r._column._number);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){let e=this._rows.length;for(let n=1;n<=e;n++)t(this.getRow(n),n)}else this._rows.forEach(e=>{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)f?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1):this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new ce(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new ce(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{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=Gi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=Gi.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),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new U(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)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
25
|
+
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Ui=G(),Wi=d(Hi(),1);let Gi={hash(e,...t){let n=Wi.createHash(e);return n.update(Ui.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Wi.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Ui.Buffer.from(e,`utf16le`),a=this.hash(t,Ui.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Ui.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Wi.randomBytes(e)}};var Ki=l({default:()=>qi}),qi,Ji=s((()=>{qi=null}));Ji();function Yi(){}let Xi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function Zi(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function Qi(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let $i=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function ea(e){let t=$i.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ta(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function na(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function ra(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function ia(e){return new Promise(t=>{qi.access(e,qi.constants.F_OK,e=>{t(!e)})})}function aa(e){return e===!0||e===`true`||e===1||e===`1`}function*oa(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function sa(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ca(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}let la=new TextDecoder(`utf-8`);function ua(e){return typeof e==`string`?e:la.decode(e)}function da(e,t){fa(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=pa(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function fa(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ca(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function pa(e,t){let n=e.getRow(1).values,r=ca(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return sa(new Set(n))},a=[];for(let e of oa(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let ma=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),ha=(e,t,n,r=[])=>{e[n]&&(t[n]=ma(e[n],r))},ga=e=>Object.keys(e).length===0,_a=e=>{if(!e)return e;if(ga(e))return{};let t={...e};return ha(e,t,`font`,[`color`]),ha(e,t,`alignment`),ha(e,t,`protection`),e.border&&(ha(e,t,`border`),ha(e.border,t.border,`top`,[`color`]),ha(e.border,t.border,`left`,[`color`]),ha(e.border,t.border,`bottom`,[`color`]),ha(e.border,t.border,`right`,[`color`]),ha(e.border,t.border,`diagonal`,[`color`])),e.fill&&(ha(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>ma(e,[`color`])))),t};var va=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,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 W,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw 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 Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=t.header&&1||t.headers&&t.headers.length||0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=[e,t];n.forEach(e=>{r.push(e[i]||null)}),this.getRow(i+1).splice(...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,n.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(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)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||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=_a(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=_a(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t._value.constructor.name===`MergeValue`){let e=this.getRow(t._row._number+i).getCell(n),r=t._value._master,a=this.getRow(r._row._number+i).getCell(r._column._number);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)f?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1):this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new ce(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new ce(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{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=Gi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=Gi.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),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new U(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)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
26
26
|
Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);let t=da(this,e);return this.pivotTables.push(t),this.workbook.pivotTables.push(t),t}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):e instanceof Function?this.conditionalFormattings=this.conditionalFormattings.filter(e):this.conditionalFormattings=[]}get model(){let 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),pivotTables:this.pivotTables,conditionalFormattings:this.conditionalFormattings};e.cols=se.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new h;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],Object.values(this._merges).forEach(t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new oe(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){e.mergeCells&&e.mergeCells.forEach(e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=se.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new W(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 ce(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new U(this,t);return n.model=t,e[t.name]=n,e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings}};function ya(e){return typeof e==`number`?!0:e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function ba(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>ba(e));let t={};for(let n of Object.keys(e))ya(n)&&(t[n]=ba(e[n]));return t}var xa=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(m.decodeEx(e))}getCell(e){return this.findCellEx(m.decodeEx(e),!0)}findCell(e){return this.findCellEx(m.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top!==void 0)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){if(!ya(e))throw Error(`Invalid sheet name: ${e}`);let r=this.sheets[e]||(this.sheets[e]=[]),i=r[t]||(r[t]=[]);return i[n]||(i[n]={sheetName:e,address:m.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e,!1);if(!t)return;let n=this.findSheetRow(t,e,!1);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){Object.keys(this.sheets).forEach(t=>{this.forEachInSheet(t,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;if(!ya(n))throw Error(`Invalid sheet name: ${n}`);if(Object.prototype.hasOwnProperty.call(this.sheets,n))return this.sheets[n];if(t)return this.sheets[n]=[]}findSheetRow(e,t,n){let{row:r}=t;if(!ya(r))throw Error(`Invalid row: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let{col:r}=t;if(!ya(r))throw Error(`Invalid column: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...ba(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push([]);i.splice(t,n,...e)}}spliceColumns(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push(null);Object.values(i).forEach(r=>{r.splice(t,n,...e)})}}};let Sa=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var Ca=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new xa)}add(e,t){let n=m.decodeEx(e);this.addEx(n,t)}addEx(e,t){let n=this.getMatrix(t);if(e.top)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}remove(e,t){let n=m.decodeEx(e);this.removeEx(n,t)}removeEx(e,t){this.getMatrix(t).removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{n.forEach(n=>{e(t,n)})})}getNames(e){return this.getNamesEx(m.decodeEx(e))}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&t).filter(Boolean)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new h(t.row,t.col,t.row,t.col,n),i,a;function o(i,a){let o=e.findCellAt(n,i,t.col);return!o||!o.mark?!1:(r[a]=i,o.mark=!1,!0)}for(a=t.row-1;o(a,`top`);a--);for(a=t.row+1;o(a,`bottom`);a++);function s(t,i){let o=[];for(a=r.top;a<=r.bottom;a++){let r=e.findCellAt(n,a,t);if(r&&r.mark)o.push(r);else return!1}r[i]=t;for(let e=0;e<o.length;e++)o[e].mark=!1;return!0}for(i=t.col-1;s(i,`left`);i--);for(i=t.col+1;s(i,`right`);i++);return r}getRanges(e,t){return t||=this.matrixMap[e],t?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row!==t||e.col!==n)&&(e.row=t,e.col=n,e.address=m.n2l(n)+t)})}spliceRows(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceRows(e,t,n,r),this.normaliseMatrix(i,e)})}spliceColumns(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceColumns(e,t,n,r),this.normaliseMatrix(i,e)})}get model(){return Object.entries(this.matrixMap).map(([e,t])=>this.getRanges(e,t)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new xa;e.ranges.forEach(e=>{Sa.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}},wa=Uint8Array,Ta=Uint16Array,Ea=Int32Array,Da=new wa([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,0,0,0]),Oa=new wa([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,0,0]),ka=new wa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Aa=function(e,t){for(var n=new Ta(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Ea(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},ja=Aa(Da,2),Ma=ja.b,Na=ja.r;Ma[28]=258,Na[258]=28;var Pa=Aa(Oa,0),Fa=Pa.b;Pa.r;for(var Ia=new Ta(32768),La=0;La<32768;++La){var Ra=(La&43690)>>1|(La&21845)<<1;Ra=(Ra&52428)>>2|(Ra&13107)<<2,Ra=(Ra&61680)>>4|(Ra&3855)<<4,Ia[La]=((Ra&65280)>>8|(Ra&255)<<8)>>1}for(var za=(function(e,t,n){for(var r=e.length,i=0,a=new Ta(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new Ta(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new Ta(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Ia[d]>>c]=l}else for(s=new Ta(r),i=0;i<r;++i)e[i]&&(s[i]=Ia[o[e[i]-1]++]>>15-e[i]);return s}),Ba=new wa(288),La=0;La<144;++La)Ba[La]=8;for(var La=144;La<256;++La)Ba[La]=9;for(var La=256;La<280;++La)Ba[La]=7;for(var La=280;La<288;++La)Ba[La]=8;for(var Va=new wa(32),La=0;La<32;++La)Va[La]=5;var Ha=za(Ba,9,1),Ua=za(Va,5,1),Wa=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ga=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ka=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},qa=function(e){return(e+7)/8|0},Ja=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new wa(e.subarray(t,n))},Ya=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],Xa=function(e,t,n){var r=Error(t||Ya[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Xa),!n)throw r;return r},Za=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new wa(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new wa(i*3));var l=function(e){var t=n.length;if(e>t){var r=new wa(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=Ga(e,d,1);var v=Ga(e,d+1,3);if(d+=3,v)if(v==1)p=Ha,m=Ua,h=9,g=5;else if(v==2){var y=Ga(e,d,31)+257,b=Ga(e,d+10,15)+4,x=y+Ga(e,d+5,31)+1;d+=14;for(var S=new wa(x),C=new wa(19),w=0;w<b;++w)C[ka[w]]=Ga(e,d+w*3,7);d+=b*3;for(var T=Wa(C),E=(1<<T)-1,D=za(C,T,1),w=0;w<x;){var O=D[Ga(e,d,E)];d+=O&15;var k=O>>4;if(k<16)S[w++]=k;else{var A=0,ee=0;for(k==16?(ee=3+Ga(e,d,3),d+=2,A=S[w-1]):k==17?(ee=3+Ga(e,d,7),d+=3):k==18&&(ee=11+Ga(e,d,127),d+=7);ee--;)S[w++]=A}}var j=S.subarray(0,y),M=S.subarray(y);h=Wa(j),g=Wa(M),p=za(j,h,1),m=za(M,g,1)}else Xa(1);else{var k=qa(d)+4,N=e[k-4]|e[k-3]<<8,P=k+N;if(P>i){c&&Xa(0);break}s&&l(f+N),n.set(e.subarray(k,P),f),t.b=f+=N,t.p=d=P*8,t.f=u;continue}if(d>_){c&&Xa(0);break}}s&&l(f+131072);for(var F=(1<<h)-1,te=(1<<g)-1,I=d;;I=d){var A=p[Ka(e,d)&F],L=A>>4;if(d+=A&15,d>_){c&&Xa(0);break}if(A||Xa(2),L<256)n[f++]=L;else if(L==256){I=d,p=null;break}else{var ne=L-254;if(L>264){var w=L-257,R=Da[w];ne=Ga(e,d,(1<<R)-1)+Ma[w],d+=R}var z=m[Ka(e,d)&te],re=z>>4;z||Xa(3),d+=z&15;var M=Fa[re];if(re>3){var R=Oa[re];M+=Ka(e,d)&(1<<R)-1,d+=R}if(d>_){c&&Xa(0);break}s&&l(f+131072);var B=f+ne;if(f<M){var ie=a-M,ae=Math.min(M,B);for(ie+f<0&&Xa(3);f<ae;++f)n[f]=r[ie+f]}for(;f<B;++f)n[f]=n[f-M]}}t.l=p,t.p=I,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Ja(n,0,f):n.subarray(0,f)},Qa=new wa(0),$a=function(e,t){return e[t]|e[t+1]<<8},eo=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},to=function(e,t){return eo(e,t)+eo(e,t+4)*4294967296},no=function(){function e(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new wa(32768),this.p=new wa(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||Xa(5),this.d&&Xa(4),!this.p.length)this.p=e;else if(e.length){var t=new wa(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=Za(this.p,this.s,this.o);this.ondata(Ja(n,t,this.s.b),this.d),this.o=Ja(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ja(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ro=typeof TextDecoder<`u`&&new TextDecoder;try{ro.decode(Qa,{stream:!0})}catch{}var io=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Ja(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function ao(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else if(ro)return ro.decode(e);else{var i=io(e),a=i.s,n=i.r;return n.length&&Xa(8),a}}var oo=function(e,t){for(;$a(e,t)!=1;t+=4+$a(e,t+2));return[to(e,t+12),to(e,t+4),to(e,t+20)]},so=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),co=function(){function e(){var e=this;this.i=new no(function(t,n){e.ondata(null,t,n)})}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),lo=function(){function e(e){this.onfile=e,this.k=[],this.o={0:so},this.p=Qa}return e.prototype.push=function(e,t){var n=this;if(this.onfile||Xa(5),this.p||Xa(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),e=e.subarray(r),e.length)return this.push(e,t)}else{var a=0,o=0,s=void 0,c=void 0;this.p.length?e.length?(c=new wa(this.p.length+e.length),c.set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var l=c.length,u=this.c,d=u&&this.d,f=function(){var e,t=eo(c,o);if(t==67324752){a=1,s=o,p.d=null,p.c=0;var r=$a(c,o+6),i=$a(c,o+8),d=r&2048,f=r&8,m=$a(c,o+26),h=$a(c,o+28);if(l>o+30+m+h){var g=[];p.k.unshift(g),a=2;var _=eo(c,o+18),v=eo(c,o+22),y=ao(c.subarray(o+30,o+=30+m),!d);_==4294967295?(e=f?[-2]:oo(c,o),_=e[0],v=e[1]):f&&(_=-1),o+=h,p.c=_;var b,x={name:y,compression:i,start:function(){if(x.ondata||Xa(5),!_)x.ondata(null,Qa,!0);else{var e=n.o[i];e||x.ondata(Xa(14,`unknown compression type `+i,1),null,!1),b=_<0?new e(y):new e(y,_,v),b.ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var a=r[t];b.push(a,!1)}n.k[0]==g&&n.c?n.d=b:b.push(Qa,!0)}},terminate:function(){b&&b.terminate&&b.terminate()}};_>=0&&(x.size=_,x.originalSize=v),p.onfile(x)}return`break`}else if(u){if(t==134695760)return s=o+=12+(u==-2&&8),a=3,p.c=0,`break`;if(t==33639248)return s=o-=4,a=3,p.c=0,`break`}},p=this;o<l-4&&f()!==`break`;++o);if(this.p=Qa,u<0){var m=a?c.subarray(0,s-12-(u==-2&&8)-(eo(c,s-16)==134695760&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(a==2)].push(m)}if(a&2)return this.push(c.subarray(o),t);this.p=c.subarray(o)}t&&(this.c&&Xa(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),uo=c(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=p();return function(){var n=m(e),r;if(t){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&(n(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return f(e)}function f(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function p(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var h={},g,_;function v(e,t,n){n||=Error;function r(e,n,r){return typeof t==`string`?t:t(e,n,r)}h[e]=function(t){c(a,t);var n=u(a);function a(t,i,o){var c;return s(this,a),c=n.call(this,r(t,i,o)),c.code=e,c}return i(a)}(n)}function y(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function b(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function x(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function S(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}v(`ERR_AMBIGUOUS_ARGUMENT`,`The "%s" argument is ambiguous. %s`,TypeError),v(`ERR_INVALID_ARG_TYPE`,function(e,t,r){g===void 0&&(g=ko()),g(typeof e==`string`,`'name' must be a string`);var i;typeof t==`string`&&b(t,`not `)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`;var a=x(e,` argument`)?`The ${e} ${i} ${y(t,`type`)}`:`The "${e}" ${S(e,`.`)?`property`:`argument`} ${i} ${y(t,`type`)}`;return a+=`. Received type ${n(r)}`,a},TypeError),v(`ERR_INVALID_ARG_VALUE`,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`is invalid`;_===void 0&&(_=Wt());var r=_.inspect(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The argument '${e}' ${n}. Received ${r}`},TypeError,RangeError),v(`ERR_INVALID_RETURN_VALUE`,function(e,t,r){return`Expected ${e} to be returned from the "${t}" function but got ${r&&r.constructor&&r.constructor.name?`instance of ${r.constructor.name}`:`type ${n(r)}`}.`},TypeError),v(`ERR_MISSING_ARGS`,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g===void 0&&(g=ko()),g(t.length>0,`At least one arg needs to be specified`);var r=`The `,i=t.length;switch(t=t.map(function(e){return`"${e}"`}),i){case 1:r+=`${t[0]} argument`;break;case 2:r+=`${t[0]} and ${t[1]} arguments`;break;default:r+=t.slice(0,i-1).join(`, `),r+=`, and ${t[i-1]} arguments`;break}return`${r} must be specified`},TypeError),t.exports.codes=h})),fo=c(((e,t)=>{Re();function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function c(e){var t=l(e,`string`);return b(t)===`symbol`?t:String(t)}function l(e,t){if(b(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&v(e,t)}function d(e){var t=g();return function(){var n=y(e),r;if(t){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&(b(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return p(e)}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function m(e){var t=typeof Map==`function`?new Map:void 0;return m=function(e){if(e===null||!_(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},m(e)}function h(e,t,n){return h=g()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},h.apply(null,arguments)}function g(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e){"@babel/helpers - typeof";return b=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b(e)}var x=Wt().inspect,S=uo().codes.ERR_INVALID_ARG_TYPE;function C(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function w(e,t){if(t=Math.floor(t),e.length==0||t==0)return``;var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,n-e.length),e}var T=``,E=``,D=``,O=``,k={deepStrictEqual:`Expected values to be strictly deep-equal:`,strictEqual:`Expected values to be strictly equal:`,strictEqualObject:`Expected "actual" to be reference-equal to "expected":`,deepEqual:`Expected values to be loosely deep-equal:`,equal:`Expected values to be loosely equal:`,notDeepStrictEqual:`Expected "actual" not to be strictly deep-equal to:`,notStrictEqual:`Expected "actual" to be strictly unequal to:`,notStrictEqualObject:`Expected "actual" not to be reference-equal to "expected":`,notDeepEqual:`Expected "actual" not to be loosely deep-equal to:`,notEqual:`Expected "actual" to be loosely unequal to:`,notIdentical:`Values identical but not reference-equal:`},A=10;function ee(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,`message`,{value:e.message}),n}function j(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(e,t,n){var r=``,i=``,a=0,o=``,s=!1,c=j(e),l=c.split(`
|
|
27
27
|
`),u=j(t).split(`
|
|
28
28
|
`),d=0,f=``;if(n===`strictEqual`&&b(e)===`object`&&b(t)===`object`&&e!==null&&t!==null&&(n=`strictEqualObject`),l.length===1&&u.length===1&&l[0]!==u[0]){var p=l[0].length+u[0].length;if(p<=A){if((b(e)!==`object`||e===null)&&(b(t)!==`object`||t===null)&&(e!==0||t!==0))return`${k[n]}
|