import{i as e,t}from"./chunk-jRWAZmH_.js";var n=t(((t,n)=>{(function(e){typeof t==`object`&&n!==void 0?n.exports=e():typeof define==`function`&&define.amd?define([],e):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).ExcelJS=e()})((function(){return function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,(function(e){return a(n[s][1][e]||e)}),d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s{let a=this.workbook.addWorksheet(t.sheetName),o=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],c=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=o.reduce((t,n)=>{if(t)return t;let r=s(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=u[e];return r===void 0?e:r},l=i.parse(t.parserOptions).on(`data`,e=>{a.addRow(e.map(c))}).on(`end`,()=>{l.emit(`worksheet`,a)});l.on(`worksheet`,n).on(`error`,r),e.pipe(l)})}createInputStream(){throw Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(e,t){return new Promise((n,r)=>{t||={};let a=this.workbook.getWorksheet(t.sheetName||t.sheetId),o=i.format(t.formatterOptions);e.on(`finish`,()=>{n()}),o.on(`error`,r),o.pipe(e);let{dateFormat:c,dateUTC:l}=t,u=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return c?l?s.utc(e).format(c):s(e).format(c):l?s.utc(e).format():s(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),d=t.includeEmptyRows===void 0||t.includeEmptyRows,f=1;a&&a.eachRow((e,t)=>{if(d)for(;f++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=e,t)if(typeof t==`string`){let e=r.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else t.nativeCol===void 0?t.col===void 0?(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0):(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(e){return e instanceof i||e==null?e:new i(e)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e),this.nativeColOff=Math.floor((e-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e),this.nativeRowOff=Math.floor((e-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}}t.exports=i},{"../utils/col-cache":19}],3:[function(e,t,n){let r=e(`../utils/col-cache`),i=e(`../utils/under-dash`),a=e(`./enums`),{slideFormula:o}=e(`../utils/shared-formula`),s=e(`./note`);class c{constructor(e,t,n){if(!e||!t)throw Error(`A Cell needs a Row`);this._row=e,this._column=t,r.validateAddress(n),this._address=n,this._value=l.create(c.Types.Null,this),this.style=this._mergeStyle(e.style,t.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===c.Types.Merge}merge(e,t){this._value.release(),this._value=l.create(c.Types.Merge,this,e),t||(this.style=e.style)}unmerge(){this.type===c.Types.Merge&&(this._value.release(),this._value=l.create(c.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(e){return this._value.type===c.Types.Merge&&this._value.isMergedTo(e)}get master(){return this.type===c.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===c.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(e){this.type===c.Types.Merge?this._value.master.value=e:(this._value.release(),this._value=l.create(l.getType(e),this,e))}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new s(e)}get text(){return this._value.toString()}get html(){return i.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(e){this.type===c.Types.String&&(this._value=l.create(c.Types.Hyperlink,this,{text:this._value.value,hyperlink:e}))}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=l.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=s.fromModel(e.comment)}e.style?this.style=e.style:this.style={}}}c.Types=a.ValueType;let l={getType:e=>e==null?c.Types.Null:e instanceof String||typeof e==`string`?c.Types.String:typeof e==`number`?c.Types.Number:typeof e==`boolean`?c.Types.Boolean:e instanceof Date?c.Types.Date:e.text&&e.hyperlink?c.Types.Hyperlink:e.formula||e.sharedFormula?c.Types.Formula:e.richText?c.Types.RichText:e.sharedString?c.Types.SharedString:e.error?c.Types.Error:c.Types.JSON,types:[{t:c.Types.Null,f:class{constructor(e){this.model={address:e.address,type:c.Types.Null}}get value(){return null}set value(e){}get type(){return c.Types.Null}get effectiveType(){return c.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}}},{t:c.Types.Number,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Number}get effectiveType(){return c.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.String,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.String}get effectiveType(){return c.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,`""`)}"`}release(){}toString(){return this.model.value}}},{t:c.Types.Date,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Date}get effectiveType(){return c.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.Hyperlink,f:class{constructor(e,t){this.model={address:e.address,type:c.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,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 c.Types.Hyperlink}get effectiveType(){return c.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:c.Types.Formula,f:class{constructor(e,t){this.cell=e,this.model={address:e.address,type:c.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(l.getType(e)){case c.Types.Null:case c.Types.String:case c.Types.Number:case c.Types.Date:break;case c.Types.Hyperlink:case c.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?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return c.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?a.ValueType.Null:e instanceof String||typeof e==`string`?a.ValueType.String:typeof e==`number`?a.ValueType.Number:e instanceof Date?a.ValueType.Date:e.text&&e.hyperlink?a.ValueType.Hyperlink:e.formula?a.ValueType.Formula:a.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&&o(t.formula,t.address,this.model.address)}return this._translatedFormula}toCsvString(){return``+(this.model.result||``)}release(){}toString(){return this.model.result?this.model.result.toString():``}}},{t:c.Types.Merge,f:class{constructor(e,t){this.model={address:e.address,type:c.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 c?(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 c.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:c.Types.JSON,f:class{constructor(e,t){this.model={address:e.address,type:c.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 c.Types.String}get effectiveType(){return c.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:c.Types.SharedString,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.SharedString}get effectiveType(){return c.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.RichText,f:class{constructor(e,t){this.model={address:e.address,type:c.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 c.Types.RichText}get effectiveType(){return c.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}}},{t:c.Types.Boolean,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Boolean}get effectiveType(){return c.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.Error,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Error}get effectiveType(){return c.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw Error(`Could not create Value of type `+e);return new r(t,n)}};t.exports=c},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`./enums`),a=e(`../utils/col-cache`);class o{constructor(e,t,n){this._worksheet=e,this._number=t,!1!==n&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.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&&r.isEqual(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!==i.ValueType.Null&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;e.hasOwnProperty(`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.max=r+1:(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))}),t.length?t:void 0}static fromModel(e,t){let n=[],r=1,i=0;for(t=(t||=[]).sort((function(e,t){return e.min-t.min}));i{t.removeCellEx(e)})}forEach(e){r.each(this.matrixMap,(t,n)=>{t.forEach(t=>{e(n,t)})})}getNames(e){return this.getNamesEx(i.decodeEx(e))}getNamesEx(e){return r.map(this.matrixMap,(t,n)=>t.findCellEx(e)&&n).filter(Boolean)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new o(t.row,t.col,t.row,t.col,n),i,a;function s(i,a){let o=e.findCellAt(n,i,t.col);return!(!o||!o.mark)&&(r[a]=i,o.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(t,i){let o=[];for(a=r.top;a<=r.bottom;a++){let r=e.findCellAt(n,a,t);if(!r||!r.mark)return!1;o.push(r)}r[i]=t;for(let e=0;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=i.n2l(n)+t))})}spliceRows(e,t,n,i){r.each(this.matrixMap,r=>{r.spliceRows(e,t,n,i),this.normaliseMatrix(r,e)})}spliceColumns(e,t,n,i){r.each(this.matrixMap,r=>{r.spliceColumns(e,t,n,i),this.normaliseMatrix(r,e)})}get model(){return r.map(this.matrixMap,(e,t)=>this.getRanges(t,e)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new a;e.ranges.forEach(e=>{s.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,t,n){t.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`}}},{}],8:[function(e,t,n){let r=e(`../utils/col-cache`),i=e(`./anchor`);t.exports=class{constructor(e,t){this.worksheet=e,this.model=t}get model(){switch(this.type){case`background`:return{type:this.type,imageId:this.imageId};case`image`:return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error(`Invalid Image Type`)}}set model(e){let{type:t,imageId:n,range:a,hyperlinks:o}=e;if(this.type=t,this.imageId=n,t===`image`)if(typeof a==`string`){let e=r.decode(a);this.range={tl:new i(this.worksheet,{col:e.left,row:e.top},-1),br:new i(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`}}else this.range={tl:new i(this.worksheet,a.tl,0),br:a.br&&new i(this.worksheet,a.br,0),ext:a.ext,editAs:a.editAs,hyperlinks:o||a.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,t,n){let r=e(`../utils/under-dash`);class i{constructor(e){this.note=e}get model(){let e=null;switch(typeof this.note){case`string`:e={type:`note`,note:{texts:[{text:this.note}]}};break;default:e={type:`note`,note:this.note}}return r.deepMerge({},i.DEFAULT_CONFIGS,e)}set model(e){let{note:t}=e,{texts:n}=t;n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t}static fromModel(e){let t=new i;return t.model=e,t}}i.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`}},t.exports=i},{"../utils/under-dash":26}],10:[function(e,t,n){let r=e(`../utils/col-cache`);class i{constructor(){this.decode(arguments)}setTLBR(e,t,n,i,a){if(arguments.length<4){let i=r.decodeAddress(e),o=r.decodeAddress(t);this.model={top:Math.min(i.row,o.row),left:Math.min(i.col,o.col),bottom:Math.max(i.row,o.row),right:Math.max(i.col,o.col),sheetName:n},this.setTLBR(i.row,i.col,o.row,o.col,a)}else this.model={top:Math.min(e,n),left:Math.min(t,i),bottom:Math.max(e,n),right:Math.max(t,i),sheetName:a}}decode(e){switch(e.length){case 5:this.setTLBR(e[0],e[1],e[2],e[3],e[4]);break;case 4:this.setTLBR(e[0],e[1],e[2],e[3]);break;case 3:this.setTLBR(e[0],e[1],e[2]);break;case 2:this.setTLBR(e[0],e[1]);break;case 1:{let t=e[0];if(t instanceof i)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{let e=r.decodeEx(t);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() - `+e.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||ethis.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=r.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return r.n2l(this.left)+this.top}get $t$l(){return`$${r.n2l(this.left)}$${this.top}`}get br(){return r.n2l(this.right)+this.bottom}get $b$r(){return`$${r.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.bottomthis.bottom)&&!(e.rightthis.right)}contains(e){let t=r.decodeEx(e);return this.containsEx(t)}containsEx(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)e(r.encodeAddress(n,t),n,t)}}t.exports=i},{"../utils/col-cache":19}],11:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`./enums`),a=e(`../utils/col-cache`),o=e(`./cell`);t.exports=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 o(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){if(typeof e==`string`){let t=this._worksheet.getColumnKey(e);e=t?t.number:a.l2n(e)}return this._cells[e-1]||this.getCellEx({address:a.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,t){let n=e+t;var r=[...arguments].slice(2);let i=r.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+r.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>=n;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{e&&e.type!==i.ValueType.Null&&t(e,n+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,e-1)||0,i=Math.max(0,t-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!==i.ValueType.Null&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;e.hasOwnProperty(`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:a.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:a.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}get hasValues(){return r.some(this._cells,e=>e&&e.type!==i.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!==i.ValueType.Null&&((!e||e>n.col)&&(e=n.col),t0?{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{switch(e.type){case o.Types.Merge:break;default:{let n;if(e.address)n=a.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:a.encodeAddress(e,r),$col$row:`$${a.n2l(r)}$${e}`}}t=n,this.getCellEx(n).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))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,t,n){let r=e(`../utils/col-cache`);class i{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)}}t.exports=class{constructor(e,t){this.worksheet=e,t&&(this.table=t,this.validate(),this.store())}getFormula(e){switch(e.totalsRowFunction){case`none`:return null;case`average`:return`SUBTOTAL(101,${this.table.name}[${e.name}])`;case`countNums`:return`SUBTOTAL(102,${this.table.name}[${e.name}])`;case`count`:return`SUBTOTAL(103,${this.table.name}[${e.name}])`;case`max`:return`SUBTOTAL(104,${this.table.name}[${e.name}])`;case`min`:return`SUBTOTAL(105,${this.table.name}[${e.name}])`;case`stdDev`:return`SUBTOTAL(106,${this.table.name}[${e.name}])`;case`var`:return`SUBTOTAL(107,${this.table.name}[${e.name}])`;case`sum`:return`SUBTOTAL(109,${this.table.name}[${e.name}])`;case`custom`:return e.totalsRowFormula;default:throw 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}get tableHeight(){return this.filterHeight+ +!!this.table.totalsRow}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=r.decodeAddress(e.ref);let{row:i,col:a}=e.tl;n(i>0,`Table must be on valid row`),n(a>0,`Table must be on valid col`);let{width:o,filterHeight:s,tableHeight:c}=this;e.autoFilterRef=r.encode(i,a,i+s-1,a+o-1),e.tableRef=r.encode(i,a,i+c-1,a+o-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))})}store(){let e=(e,t)=>{t&&Object.keys(t).forEach(n=>{e[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:r.value=this.getFormula(t)?{formula:t.totalsRowFormula,result:t.totalsRowResult}: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)=>{a.getCell(r+t).value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+ i++);t.forEach((e,t)=>{a.getCell(r+t).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=r.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){let t=this.table.columns[e];return new i(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){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]: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.displyName||this.table.name}set displayNamename(e){this.table.displayName=e}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,`headerRow`,e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,`totalsRow`,e)}get theme(){return this.table.style.name}set theme(e){this.table.style.name=e}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(e){this.table.style.showFirstColumn=e}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(e){this.table.style.showLastColumn=e}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(e){this.table.style.showRowStripes=e}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(e){this.table.style.showColumnStripes=e}}},{"../utils/col-cache":19}],13:[function(e,t,n){let r=e(`./worksheet`),i=e(`./defined-names`),a=e(`../xlsx/xlsx`),o=e(`../csv/csv`);t.exports=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this._definedNames=new i}get xlsx(){return this._xlsx||=new a(this),this._xlsx}get csv(){return this._csv||=new o(this),this._csv}get nextId(){for(let e=1;e(t&&t.orderNo)>e?t.orderNo:e,0),a=new r(Object.assign({},t,{id:n,name:e,orderNo:i+1,workbook:this}));return this._worksheets[n]=a,a}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){return e===void 0?this._worksheets.find(Boolean):typeof e==`number`?this._worksheets[e]:typeof e==`string`?this._worksheets.find(t=>t&&t.name===e):void 0}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push(Object.assign({},e,{type:`image`})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:i,state:a}=t,o=e.sheets&&e.sheets.findIndex(e=>e.id===n);(this._worksheets[n]=new r({id:n,name:i,orderNo:o,state:a,workbook:this})).model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`../utils/col-cache`),a=e(`./range`),o=e(`./row`),s=e(`./column`),c=e(`./enums`),l=e(`./image`),u=e(`./table`),d=e(`./data-validations`),f=e(`../utils/encryptor`),{copyStyle:p}=e(`../utils/copy-style`);t.exports=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id,this.orderNo=e.orderNo,this.name=e.name,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new d,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(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&&(console.warn(`Worksheet name ${e} exceeds 31 chars. This will be truncated`),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 a;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 s(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){r.each(this._keys,e)}getColumn(e){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=i.l2n(e)}if(this._columns||=[],e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new s(this,t++))}return this._columns[e-1]}spliceColumns(e,t){let n=this._rows.length;var r=[...arguments].slice(2);if(r.length>0)for(let i=0;i{n.push(e[i]||null)});let a=this.getRow(i+1);a.splice.apply(a,n)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=r.length-t,a=e+t,o=this._columns.length;if(i<0)for(let t=e+r.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=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(n=>{let{col:r}=n;e[r]||(e[r]=!0,t++)})}),t}_commitRow(){}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 o(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r1&&arguments[1]!==void 0?arguments[1]:`n`,n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`n`,n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`n`;return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`n`;if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:`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){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.getRow(e),i=this.getRow(t);i.style=p(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=p(e.style)}),i.height=r.height}duplicateRow(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this._rows[e-1],i=Array(t).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n{t.getCell(n).style=e.style})}}spliceRows(e,t){let n=e+t;var r=[...arguments].slice(2);let i=r.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=n;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>=n;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{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=i.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=i.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(){let e=new a([...arguments]);this._mergeCellsInternal(e)}mergeCellsWithoutStyle(){let e=new a([...arguments]);this._mergeCellsInternal(e,!0)}_mergeCellsInternal(e,t){r.each(this._merges,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 r.some(this._merges,Boolean)}unMergeCells(){let e=new a([...arguments]);for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&(e.type===c.ValueType.Merge?this._unMergeMaster(e.master):this._merges[e.address]&&this._unMergeMaster(e))}}fillFormula(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`shared`,{top:a,left:o,bottom:s,right:c}=i.decode(e),l=c-o+1,u=i.encodeAddress(a,o),d=r===`shared`,f;f=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-a][t-o]:(e,t)=>n[(e-a)*l+(t-o)]:()=>{};let p=!0;for(let n=a;n<=s;n++)for(let i=o;i<=c;i++)p?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:f(n,i)},p=!1):this.getCell(n,i).value=d?{sharedFormula:u,result:f(n,i)}:f(n,i)}addImage(e,t){let n={type:`image`,imageId:e,range:t};this._media.push(new l(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:e};this._media.push(new l(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=f.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=f.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)}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):this.conditionalFormattings=e instanceof Function?this.conditionalFormattings.filter(e):[]}get tabColor(){return console.trace(`worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor`),this.properties.tabColor}set tabColor(e){console.trace(`worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor`),this.properties.tabColor=e}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),conditionalFormattings:this.conditionalFormattings};e.cols=s.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new a;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=[],r.each(this._merges,t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows.forEach(e=>{let t=new o(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){r.each(e.mergeCells,e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=s.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new d(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 l(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new u;return n.model=t,e[t.name]=n,e},{}),this.conditionalFormattings=e.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,t,n){e(`core-js/modules/es.promise`),e(`core-js/modules/es.promise.finally`),e(`core-js/modules/es.object.assign`),e(`core-js/modules/es.object.keys`),e(`core-js/modules/es.object.values`),e(`core-js/modules/es.symbol`),e(`core-js/modules/es.symbol.async-iterator`),e(`core-js/modules/es.array.iterator`),e(`core-js/modules/es.array.includes`),e(`core-js/modules/es.array.find-index`),e(`core-js/modules/es.array.find`),e(`core-js/modules/es.string.from-code-point`),e(`core-js/modules/es.string.includes`),e(`core-js/modules/es.number.is-nan`),e(`regenerator-runtime/runtime`);let r={Workbook:e(`./doc/workbook`)},i=e(`./doc/enums`);Object.keys(i).forEach(e=>{r[e]=i[e]}),t.exports=r},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,t,n){let r=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`);n.bufferToString=function(e){return typeof e==`string`?e:r?r.decode(e):e.toString()}},{}],17:[function(e,t,n){let r=typeof TextEncoder>`u`?null:new TextEncoder(`utf-8`),{Buffer:i}=e(`buffer`);n.stringToBuffer=function(e){return typeof e==`string`?r?i.from(r.encode(e).buffer):i.from(e):e}},{buffer:220}],18:[function(e,t,n){let r=e(`./under-dash`),i=e(`./col-cache`);t.exports=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(i.decodeEx(e))}getCell(e){return this.findCellEx(i.decodeEx(e),!0)}findCell(e){return this.findCellEx(i.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)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){let r=this.sheets[e]||(this.sheets[e]=[]),a=r[t]||(r[t]=[]);return a[n]||(a[n]={sheetName:e,address:i.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e);if(!t)return;let n=this.findSheetRow(t,e);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){r.each(this.sheets,(t,n)=>{this.forEachInSheet(n,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;return this.sheets[n]?this.sheets[n]:t?this.sheets[n]=[]:void 0}findSheetRow(e,t,n){let{row:r}=t;return e&&e[r]?e[r]:n?e[r]=[]:void 0}findRowCell(e,t,n){let{col:r}=t;return e&&e[r]?e[r]:n?e[r]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t:void 0}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t{r.splice(t,n,...e)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,t,n){let r=/^[A-Z]+\d+$/,i={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level:e=>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(!r.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,c=0;c=65&&t<=90)n=!0,r+=e[c],i=26*i+t-64;else if(t>=48&&t<=57)a=!0,o+=e[c],s=10*s+t-48;else if(a&&n&&t!==36)break;if(n){if(i>16384)throw Error(`Out of bounds. Invalid column letter: `+r)}else i=void 0;a||(s=void 0);let c={address:e=r+o,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)};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);return e=this.n2l(a)+r,t=this.n2l(s)+o,{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:e,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:t,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${e}:${t}`}}if(r.startsWith(`#`))return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress:(e,t)=>i.n2l(t)+e,encode(){switch(arguments.length){case 2:return i.encodeAddress(arguments[0],arguments[1]);case 4:return`${i.encodeAddress(arguments[0],arguments[1])}:${i.encodeAddress(arguments[2],arguments[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}};t.exports=i},{}],20:[function(e,t,n){let r=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),i=function(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];e[n]&&(t[n]=r(e[n],i))};n.copyStyle=e=>{if(!e)return e;if(t=e,Object.keys(t).length===0)return{};var t;let n={...e};return i(e,n,`font`,[`color`]),i(e,n,`alignment`),i(e,n,`protection`),e.border&&(i(e,n,`border`),i(e.border,n.border,`top`,[`color`]),i(e.border,n.border,`left`,[`color`]),i(e.border,n.border,`bottom`,[`color`]),i(e.border,n.border,`right`,[`color`]),i(e.border,n.border,`diagonal`,[`color`])),e.fill&&(i(e,n,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(n.fill.stops=e.fill.stops.map(e=>r(e,[`color`])))),n}},{}],21:[function(e,t,n){(function(n){(function(){let r=e(`crypto`);t.exports={hash(e){let t=r.createHash(e);var i=[...arguments].slice(1);return t.update(n.concat(i)),t.digest()},convertPasswordToHash(e,t,i,a){if(t=t.toLowerCase(),r.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let o=n.from(e,`utf16le`),s=this.hash(t,n.from(i,`base64`),o);for(let e=0;er.randomBytes(e)}}).call(this)}).call(this,e(`buffer`).Buffer)},{buffer:220,crypto:390}],22:[function(e,t,n){let{SaxesParser:r}=e(`saxes`),{PassThrough:i}=e(`readable-stream`),{bufferToString:a}=e(`./browser-buffer-decode`);t.exports=async function*(e){e.pipe&&!e[Symbol.asyncIterator]&&(e=e.pipe(new i));let t=new r,n;t.on(`error`,e=>{n=e});let o=[];t.on(`opentag`,e=>o.push({eventType:`opentag`,value:e})),t.on(`text`,e=>o.push({eventType:`text`,value:e})),t.on(`closetag`,e=>o.push({eventType:`closetag`,value:e}));for await(let r of e){if(t.write(a(r)),n)throw n;yield o,o=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,t,n){let r=e(`./col-cache`),i=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;t.exports={slideFormula:function(e,t,n){let o=r.decode(t),s=r.decode(n);return e.replace(i,(e,t,n,i,c)=>{if(c)return e;let l=a.exec(i);if(l){let n=l[1],i=l[2].toUpperCase(),a=l[3],c=l[4];if(i.length>3||i.length===3&&i>`XFD`)return e;let u=r.l2n(i),d=parseInt(c,10);return n||(u+=s.col-o.col),a||(d+=s.row-o.row),(t||``)+(n||``)+r.n2l(u)+(a||``)+d}return e})}}},{"./col-cache":19}],24:[function(e,t,n){(function(n,r){(function(){let i=e(`readable-stream`),a=e(`./utils`),o=e(`./string-buf`);class s{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||=r.from(this._data,this._encoding),this._buffer}}class c{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}}class l{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}}class u{constructor(e){this.size=e,this.buffer=r.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let e=r.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return e===0?null:e===void 0||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=r.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){let r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}}let d=function(e){e||={},this.bufSize=e.bufSize||1048576,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};a.inherits(d,i.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return r.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new u(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map((function(t){return new Promise(n=>{t.write(e.toBuffer(),()=>{n()})})})))},_writeToBuffers(e){let t=0,n=e.length;for(;t1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(u),n.nextTick(i)):(await this._pipe(u),i());else this.paused||this.emit(`data`,u.toBuffer()),this._writeToBuffers(u),this.emit(`readable`);return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){let r=e=>{e?n(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit(`finish`))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){let n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return r.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],r.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){this.pipes.push(e),!this.paused&&this.buffers.length&&this.end()},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw Error(`Not Implemented`)},wrap(){throw Error(`Not Implemented`)}}),t.exports=d}).call(this)}).call(this,e(`_process`),e(`buffer`).Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,t,n){(function(e){(function(){t.exports=class{constructor(t){this._buf=e.alloc(t&&t.size||16384),this._encoding=t&&t.encoding||`utf8`,this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=e.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e||=0,this._buffer=void 0,this._inPos=e}_grow(t){let n=2*this._buf.length;for(;n=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}}}).call(this)}).call(this,e(`buffer`).Buffer)},{buffer:220}],26:[function(e,t,n){let{toString:r}=Object.prototype,i=/["&<>]/,a={each:function(e,t){e&&(Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(n=>{t(e[n],n)}))},some:function(e,t){return!!e&&(Array.isArray(e)?e.some(t):Object.keys(e).some(n=>t(e[n],n)))},every:function(e,t){return!e||(Array.isArray(e)?e.every(t):Object.keys(e).every(n=>t(e[n],n)))},map:function(e,t){return e?Array.isArray(e)?e.map(t):Object.keys(e).map(n=>t(e[n],n)):[]},keyBy:(e,t)=>e.reduce((e,n)=>(e[n[t]]=n,e),{}),isEqual:function(e,t){let n=typeof e,r=typeof t,i=Array.isArray(e),o=Array.isArray(t),s;if(n!==r)return!1;switch(typeof e){case`object`:if(i||o)return!(!i||!o)&&e.length===t.length&&e.every((e,n)=>{let r=t[n];return a.isEqual(e,r)});if(e===null||t===null)return e===t;if(s=Object.keys(e),Object.keys(t).length!==s.length)return!1;for(let e of s)if(!t.hasOwnProperty(e))return!1;return a.every(e,(e,n)=>{let r=t[n];return a.isEqual(e,r)});default:return e===t}},escapeHtml(e){let t=i.exec(e);if(!t)return e;let n=``,r=``,a=0,o=t.index;for(;o`:r=`>`;break;default:continue}a!==o&&(n+=e.substring(a,o)),a=o+1,n+=r}return a===o?n:n+e.substring(a,o)},strcmp:(e,t)=>et),isUndefined:e=>r.call(e)===`[object Undefined]`,isObject:e=>r.call(e)===`[object Object]`,deepMerge(){let e=arguments[0]||{},{length:t}=arguments,n,r,i;function o(t,o){n=e[o],i=Array.isArray(t),a.isObject(t)||i?(i?(i=!1,r=n&&Array.isArray(n)?n:[]):r=n&&a.isObject(n)?n:{},e[o]=a.deepMerge(r,t)):a.isUndefined(t)||(e[o]=t)}for(let e=0;e&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,o={nop(){},promiseImmediate:e=>new Promise(t=>{n.setImmediate?r(()=>{t(e)}):setTimeout(()=>{t(e)},1)}),inherits: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)},dateToExcel:(e,t)=>25569+e.getTime()/864e5-(t?1462:0),excelToDate(e,t){let n=Math.round(24*(e-25569+(t?1462:0))*3600*1e3);return new Date(n)},parsePath(e){let t=e.lastIndexOf(`/`);return{path:e.substring(0,t),name:e.substring(t+1)}},getRelsPath(e){let t=o.parsePath(e);return`${t.path}/_rels/${t.name}.rels`},xmlEncode(e){let t=a.exec(e);if(!t)return e;let n=``,r=``,i=0,o=t.index;for(;o=11&&t!==13)){r=``;break}continue}i!==o&&(n+=e.substring(i,o)),i=o+1,r&&(n+=r)}return i===o?n:n+e.substring(i,o)},xmlDecode:e=>e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}}),validInt(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,``)).replace(/"[^"]*"/g,``)).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(t=>{i.access(e,i.constants.F_OK,e=>{t(!e)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>!0===e||e===`true`||e===1||e===`1`};t.exports=o}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{},e(`timers`).setImmediate)},{fs:216,timers:523}],28:[function(e,t,n){let r=e(`./under-dash`),i=e(`./utils`);function a(e,t,n){e.push(` ${t}="${i.xmlEncode(n.toString())}"`)}function o(e,t){if(t){let n=[];r.each(t,(e,t)=>{e!==void 0&&a(n,t,e)}),e.push(n.join(``))}}class s{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){let t=this._xml;t.push(` `)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),o(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&a(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);o(this._xml,e)}writeText(e){let t=this._xml;this.open&&=(t.push(`>`),!1),this.leaf=!1,t.push(i.xmlEncode(e.toString()))}writeXml(e){this.open&&=(this._xml.push(`>`),!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(``)),this.open=!1,this.leaf=!1}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join(``)}}s.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`},t.exports=s},{"./under-dash":26,"./utils":27}],29:[function(e,t,n){(function(n){(function(){let r=e(`events`),i=e(`jszip`),a=e(`./stream-buf`),{stringToBuffer:o}=e(`./browser-buffer-encode`);class s extends r.EventEmitter{constructor(e){super(),this.options=Object.assign({type:`nodebuffer`,compression:`DEFLATE`},e),this.zip=new i,this.stream=new a}append(e,t){t.hasOwnProperty(`base64`)&&t.base64?this.zip.file(t.name,e,{base64:!0}):(n.browser&&typeof e==`string`&&(e=o(e)),this.zip.file(t.name,e))}async finalize(){let e=await this.zip.generateAsync(this.options);this.stream.end(e),this.emit(`finish`)}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}}t.exports={ZipWriter:s}}).call(this)}).call(this,e(`_process`))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,t,n){t.exports={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy "h":mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00 ;(#,##0.00)`},40:{f:`#,##0.00 ;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}}},{}],31:[function(e,t,n){t.exports={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`}},{}],32:[function(e,t,n){let r=e(`../../utils/parse-sax`),i=e(`../../utils/xml-stream`);class a{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(e=>{e instanceof a?e.reset():e.xform&&e.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(let t of e)for(let{eventType:e,value:n}of t)if(e===`opentag`)this.parseOpen(n);else if(e===`text`)this.parseText(n);else if(e===`closetag`&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(e){return this.parse(r(e))}get xml(){return this.toXml(this.model)}toXml(e){let t=new i;return this.render(t,e),t.xml}static toAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}}t.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/col-cache`);function a(e){try{return i.decodeEx(e),!0}catch{return!1}}function o(e){let t=[],n=!1,r=``;return e.split(`,`).forEach(e=>{if(!e)return;let i=(e.match(/'/g)||[]).length;if(!i)return void(n?r+=e+`,`:a(e)&&t.push(e));let o=i%2==0;!n&&o&&a(e)?t.push(e):n&&!o?(n=!1,a(r+e)&&t.push(r+e),r=``):(n=!0,r+=e+`,`)}),t}t.exports=class extends r{render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:o(this._parsedText.join(``))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`);t.exports=class extends i{render(e,t){e.leafNode(`sheet`,{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`&&(this.model={name:r.xmlDecode(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes[`r:id`]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return e.name===`calcPr`&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`&&(this.model={date1904:e.attributes.date1904===`1`},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){let n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){let i=n===void 0?r:t[e]=n;i!==void 0&&(t[e]=i)},r=function(e,n,r){let i=n===void 0?r:t[e]=parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/col-cache`),a=e(`../../../utils/xml-stream`),o=e(`../base-xform`),s=e(`../static-xform`),c=e(`../list-xform`),l=e(`./defined-name-xform`),u=e(`./sheet-xform`),d=e(`./workbook-view-xform`),f=e(`./workbook-properties-xform`),p=e(`./workbook-calc-properties-xform`);class m extends o{constructor(){super(),this.map={fileVersion:m.STATIC_XFORMS.fileVersion,workbookPr:new f,bookViews:new c({tag:`bookViews`,count:!1,childXform:new d}),sheets:new c({tag:`sheets`,count:!1,childXform:new u}),definedNames:new c({tag:`definedNames`,count:!1,childXform:new l}),calcPr:new p}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:n};t.push(a)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(`workbook`,m.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(e),this.map.workbookPr.render(e,t.properties),this.map.bookViews.render(e,t.views),this.map.sheets.render(e,t.sheets),this.map.definedNames.render(e,t.definedNames),this.map.calcPr.render(e,t.calcProperties),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],a,o=0;(e.sheets||[]).forEach(r=>{let i=t[r.rId];i&&(a=e.worksheetHash[`xl/`+i.Target.replace(/^(\s|\/xl\/)+/,``)],a&&(a.name=r.name,a.id=r.id,a.state=r.state,n[o++]=a))});let s=[];r.each(e.definedNames,e=>{if(e.name===`_xlnm.Print_Area`){if(a=n[e.localSheetId],a){a.pageSetup||={};let t=i.decodeEx(e.ranges[0]);a.pageSetup.printArea=a.pageSetup.printArea?`${a.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(a=n[e.localSheetId],a){a.pageSetup||={};let t=e.ranges.join(`,`),n=/\$/g,r=t.match(/\$\d+:\$\d+/);if(r&&r.length){let e=r[0];a.pageSetup.printTitlesRow=e.replace(n,``)}let i=t.match(/\$[A-Z]+:\$[A-Z]+/);if(i&&i.length){let e=i[0];a.pageSetup.printTitlesColumn=e.replace(n,``)}}}else s.push(e)}),e.definedNames=s,e.media.forEach((e,t)=>{e.index=t})}}m.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},m.STATIC_XFORMS={fileVersion:new s({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})},t.exports=m},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,t,n){let r=e(`../strings/rich-text-xform`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o=t.exports=function(e){this.model=e};i.inherits(o,a,{get tag(){return`r`},get richTextXform(){return this._richTextXform||=new r,this._richTextXform},render(e,t){t||=this.model,e.openNode(`comment`,{ref:t.ref,authorId:0}),e.openNode(`text`),t&&t.note&&t.note.texts&&t.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o=e(`./comment-xform`),s=t.exports=function(){this.map={comment:new o}};i.inherits(s,a,{COMMENTS_ATTRIBUTES:{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}},{render(e,t){t||=this.model,e.openXml(r.StdDocAttributes),e.openNode(`comments`,s.COMMENTS_ATTRIBUTES),e.openNode(`authors`),e.leafNode(`author`,null,`Author`),e.closeNode(),e.openNode(`commentList`),t.comments.forEach(t=>{this.map.comment.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t,n){(t===n[2]||this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor(68*(e.left-t)),r=Math.floor(e.top),i=Math.floor(18*(e.top-r)),a=Math.floor(e.right),o=Math.floor(68*(e.right-a)),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor(18*(e.bottom-s))]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,t,n){let r=e(`../base-xform`),i=e(`./vml-anchor-xform`),a=e(`./style/vml-protection-xform`),o=e(`./style/vml-position-xform`),s=[`twoCells`,`oneCells`,`absolute`];t.exports=class extends r{constructor(){super(),this.map={"x:Anchor":new i,"x:Locked":new a({tag:`x:Locked`}),"x:LockText":new a({tag:`x:LockText`}),"x:SizeWithCells":new o({tag:`x:SizeWithCells`}),"x:MoveWithCells":new o({tag:`x:MoveWithCells`})}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,s),this.map[`x:SizeWithCells`].render(e,r,s),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=s[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./vml-shape-xform`);class o extends i{constructor(){super(),this.map={"v:shape":new a}}get tag(){return`xml`}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(this.tag,o.DRAWING_ATTRIBUTES),e.openNode(`o:shapelayout`,{"v:ext":`edit`}),e.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),e.closeNode(),e.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),e.leafNode(`v:stroke`,{joinstyle:`miter`}),e.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),e.closeNode(),t.comments.forEach((t,n)=>{this.map[`v:shape`].render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}}o.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`},t.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,t,n){let r=e(`../base-xform`),i=e(`./vml-textbox-xform`),a=e(`./vml-client-data-xform`);class o extends r{constructor(){super(),this.map={"v:textbox":new i,"x:ClientData":new a}}get tag(){return`v:shape`}render(e,t,n){e.openNode(`v:shape`,o.V_SHAPE_ATTRIBUTES(t,n)),e.leafNode(`v:fill`,{color2:`infoBackground [80]`}),e.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),e.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(e,t),this.map[`x:ClientData`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}}o.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s`+(1025+t),type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode}),t.exports=o},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${parseFloat(e)*t.toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins;Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(e,t,n){let r=e(`./base-xform`);t.exports=class extends r{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag&&(this.model=this.createNewModel(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}}},{"./base-xform":32}],49:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}}},{"../base-xform":32}],50:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}}},{"../base-xform":32}],51:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../simple/string-xform`),o=e(`./app-heading-pairs-xform`),s=e(`./app-titles-of-parts-xform`);class c extends i{constructor(){super(),this.map={Company:new a({tag:`Company`}),Manager:new a({tag:`Manager`}),HeadingPairs:new o,TitleOfParts:new s}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`Properties`,c.PROPERTY_ATTRIBUTES),e.leafNode(`Application`,void 0,`Microsoft Excel`),e.leafNode(`DocSecurity`,void 0,`0`),e.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(e,t.worksheets),this.map.TitleOfParts.render(e,t.worksheets),this.map.Company.render(e,t.company||``),this.map.Manager.render(e,t.manager),e.leafNode(`LinksUpToDate`,void 0,`false`),e.leafNode(`SharedDoc`,void 0,`false`),e.leafNode(`HyperlinksChanged`,void 0,`false`),e.leafNode(`AppVersion`,void 0,`16.0300`),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}c.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)},c.DateAttrs={"xsi:type":`dcterms:W3CDTF`},c.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`},t.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`);class a extends i{render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`Types`,a.PROPERTY_ATTRIBUTES);let n={};(t.media||[]).forEach(t=>{if(t.type===`image`){let r=t.extension;n[r]||(n[r]=!0,e.leafNode(`Default`,{Extension:r,ContentType:`image/`+r}))}}),e.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),e.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),e.leafNode(`Override`,{PartName:`/xl/workbook.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),t.worksheets.forEach(t=>{let n=`/xl/worksheets/sheet${t.id}.xml`;e.leafNode(`Override`,{PartName:n,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),e.leafNode(`Override`,{PartName:`/xl/theme/theme1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),e.leafNode(`Override`,{PartName:`/xl/styles.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),t.sharedStrings&&t.sharedStrings.count&&e.leafNode(`Override`,{PartName:`/xl/sharedStrings.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),t.tables&&t.tables.forEach(t=>{e.leafNode(`Override`,{PartName:`/xl/tables/`+t.target,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),t.drawings&&t.drawings.forEach(t=>{e.leafNode(`Override`,{PartName:`/xl/drawings/${t.name}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})}),t.commentRefs&&(e.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),t.commentRefs.forEach(t=>{let{commentName:n}=t;e.leafNode(`Override`,{PartName:`/xl/${n}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})})),e.leafNode(`Override`,{PartName:`/docProps/core.xml`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),e.leafNode(`Override`,{PartName:`/docProps/app.xml`,ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`},t.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../simple/date-xform`),o=e(`../simple/string-xform`),s=e(`../simple/integer-xform`);class c extends i{constructor(){super(),this.map={"dc:creator":new o({tag:`dc:creator`}),"dc:title":new o({tag:`dc:title`}),"dc:subject":new o({tag:`dc:subject`}),"dc:description":new o({tag:`dc:description`}),"dc:identifier":new o({tag:`dc:identifier`}),"dc:language":new o({tag:`dc:language`}),"cp:keywords":new o({tag:`cp:keywords`}),"cp:category":new o({tag:`cp:category`}),"cp:lastModifiedBy":new o({tag:`cp:lastModifiedBy`}),"cp:lastPrinted":new a({tag:`cp:lastPrinted`,format:c.DateFormat}),"cp:revision":new s({tag:`cp:revision`}),"cp:version":new o({tag:`cp:version`}),"cp:contentStatus":new o({tag:`cp:contentStatus`}),"cp:contentType":new o({tag:`cp:contentType`}),"dcterms:created":new a({tag:`dcterms:created`,attrs:c.DateAttrs,format:c.DateFormat}),"dcterms:modified":new a({tag:`dcterms:modified`,attrs:c.DateAttrs,format:c.DateFormat})}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`cp:coreProperties`,c.CORE_PROPERTY_ATTRIBUTES),this.map[`dc:creator`].render(e,t.creator),this.map[`dc:title`].render(e,t.title),this.map[`dc:subject`].render(e,t.subject),this.map[`dc:description`].render(e,t.description),this.map[`dc:identifier`].render(e,t.identifier),this.map[`dc:language`].render(e,t.language),this.map[`cp:keywords`].render(e,t.keywords),this.map[`cp:category`].render(e,t.category),this.map[`cp:lastModifiedBy`].render(e,t.lastModifiedBy),this.map[`cp:lastPrinted`].render(e,t.lastPrinted),this.map[`cp:revision`].render(e,t.revision),this.map[`cp:version`].render(e,t.version),this.map[`cp:contentStatus`].render(e,t.contentStatus),this.map[`cp:contentType`].render(e,t.contentType),this.map[`dcterms:created`].render(e,t.created),this.map[`dcterms:modified`].render(e,t.modified),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`cp:coreProperties`:case`coreProperties`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`cp:coreProperties`:case`coreProperties`:return this.model={creator:this.map[`dc:creator`].model,title:this.map[`dc:title`].model,subject:this.map[`dc:subject`].model,description:this.map[`dc:description`].model,identifier:this.map[`dc:identifier`].model,language:this.map[`dc:language`].model,keywords:this.map[`cp:keywords`].model,category:this.map[`cp:category`].model,lastModifiedBy:this.map[`cp:lastModifiedBy`].model,lastPrinted:this.map[`cp:lastPrinted`].model,revision:this.map[`cp:revision`].model,contentStatus:this.map[`cp:contentStatus`].model,contentType:this.map[`cp:contentType`].model,created:this.map[`dcterms:created`].model,modified:this.map[`dcterms:modified`].model},!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}c.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)},c.DateAttrs={"xsi:type":`dcterms:W3CDTF`},c.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`},t.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./relationship-xform`);class o extends i{constructor(){super(),this.map={Relationship:new a}}render(e,t){t||=this._values,e.openXml(r.StdDocAttributes),e.openNode(`Relationships`,o.RELATIONSHIPS_ATTRIBUTES),t.forEach(t=>{this.map.Relationship.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}o.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`},t.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs||`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){let e=n[1],r=t.mediaIndex[e];return t.media[r]}}}}},{"../base-xform":32}],57:[function(e,t,n){let r=e(`../base-xform`),i=e(`./blip-xform`);t.exports=class extends r{constructor(){super(),this.map={"a:blip":new i}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:blip`}render(e,t){e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(e,t,n){let r=e(`../base-xform`),i=e(`./hlink-click-xform`),a=e(`./ext-lst-xform`);t.exports=class extends r{constructor(){super(),this.map={"a:hlinkClick":new i,"a:extLst":new a}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture `+t.index}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,t,n){let r=e(`../base-xform`),i=e(`../simple/integer-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new i({tag:`xdr:col`,zero:!0}),"xdr:colOff":new i({tag:`xdr:colOff`,zero:!0}),"xdr:row":new i({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new i({tag:`xdr:rowOff`,zero:!0})}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../../../utils/xml-stream`),a=e(`../base-xform`),o=e(`./two-cell-anchor-xform`),s=e(`./one-cell-anchor-xform`);class c extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new o,"xdr:oneCellAnchor":new s}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=function(e){return(typeof e.range==`string`?r.decode(e.range):e.range).br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`}(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(e,t){e.openXml(i.StdDocAttributes),e.openNode(this.tag,c.DRAWING_ATTRIBUTES),t.anchors.forEach(t=>{this.map[t.anchorType].render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}}c.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`},t.exports=c},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={}}render(e,t){e.openNode(this.tag);let n=Math.floor(9525*t.width),r=Math.floor(9525*t.height);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag&&(this.model={width:parseInt(e.attributes.cx||`0`,10)/9525,height:parseInt(e.attributes.cy||`0`,10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,t,n){let r=e(`../base-xform`),i=e(`./c-nv-pr-xform`),a=e(`./c-nv-pic-pr-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:cNvPr":new i,"xdr:cNvPicPr":new a}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,t,n){let r=e(`./base-cell-anchor-xform`),i=e(`../static-xform`),a=e(`./cell-position-xform`),o=e(`./ext-xform`),s=e(`./pic-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:`xdr:from`}),"xdr:ext":new o({tag:`xdr:ext`}),"xdr:pic":new s,"xdr:clientData":new i({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,t,n){let r=e(`../base-xform`),i=e(`../static-xform`),a=e(`./blip-fill-xform`),o=e(`./nv-pic-pr-xform`),s=e(`./sp-pr`);t.exports=class extends r{constructor(){super(),this.map={"xdr:nvPicPr":new o,"xdr:blipFill":new a,"xdr:spPr":new i(s)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,t),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,t,n){t.exports={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]}},{}],70:[function(e,t,n){let r=e(`./base-cell-anchor-xform`),i=e(`../static-xform`),a=e(`./cell-position-xform`),o=e(`./pic-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:`xdr:from`}),"xdr:to":new a({tag:`xdr:to`}),"xdr:pic":new o,"xdr:clientData":new i({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,t,n){let r=e(`./base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);let{childXform:n}=this;(t||[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(e)&&(this.parser=this.childXform,!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}}},{"./base-xform":32}],72:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:r.getAddress(e.row,e.column).address},i=n(t.from),a=n(t.to);i&&a&&e.leafNode(`autoFilter`,{ref:`${i}:${a}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`),a=e(`../../../doc/range`),o=e(`../../../doc/enums`),s=e(`../strings/rich-text-xform`);function c(e){if(e==null)return o.ValueType.Null;if(e instanceof String||typeof e==`string`)return o.ValueType.String;if(typeof e==`number`)return o.ValueType.Number;if(typeof e==`boolean`)return o.ValueType.Boolean;if(e instanceof Date)return o.ValueType.Date;if(e.text&&e.hyperlink)return o.ValueType.Hyperlink;if(e.formula)return o.ValueType.Formula;if(e.error)return o.ValueType.Error;throw Error(`I could not understand type of value`)}t.exports=class extends i{constructor(){super(),this.richTextXForm=new s}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},function(e){switch(e.type){case o.ValueType.Formula:return c(e.result);default:return e.type}}(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case o.ValueType.String:case o.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case o.ValueType.Date:t.date1904&&(e.date1904=!0);break;case o.ValueType.Hyperlink:t.sharedStrings&&e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case o.ValueType.Merge:t.merges.add(e);break;case o.ValueType.Formula:if(t.date1904&&(e.date1904=!0),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw Error(`Shared Formula master must exist above and or left of clone for cell `+e.address);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new a(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si})}switch(c(t.result)){case o.ValueType.Null:e.leafNode(`f`,n,t.formula);break;case o.ValueType.String:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case o.ValueType.Number:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case o.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,+!!t.result);break;case o.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case o.ValueType.Date:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,r.dateToExcel(t.result,t.date1904));break;default:throw Error(`I could not understand type of value`)}}render(e,t){if(t.type!==o.ValueType.Null||t.styleId){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.type){case o.ValueType.Null:break;case o.ValueType.Number:e.leafNode(`v`,null,t.value);break;case o.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case o.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case o.ValueType.String:case o.ValueType.RichText:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXForm.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case o.ValueType.Date:e.leafNode(`v`,null,r.dateToExcel(t.value,t.date1904));break;case o.ValueType.Hyperlink:t.ssId===void 0?(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case o.ValueType.Formula:this.renderFormula(e,t);break;case o.ValueType.Merge:}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXForm,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser)this.parser.parseText(e);else switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=o.ValueType.Formula,e.value&&=(this.t===`str`?e.result=r.xmlDecode(e.value):this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=o.ValueType.String,e.value=parseInt(e.value,10);break;case`str`:e.type=o.ValueType.String,e.value=r.xmlDecode(e.value);break;case`inlineStr`:e.type=o.ValueType.String;break;case`b`:e.type=o.ValueType.Boolean,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=o.ValueType.Error,e.value={error:e.value};break;default:e.type=o.ValueType.Number,e.value=parseFloat(e.value)}else e.styleId?e.type=o.ValueType.Null:e.type=o.ValueType.Merge;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(e),!0)}}reconcile(e,t){let n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case o.ValueType.String:typeof e.value==`number`&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=o.ValueType.RichText);break;case o.ValueType.Number:n&&r.isDateFmt(n.numFmt)&&(e.type=o.ValueType.Date,e.value=r.excelToDate(e.value,t.date1904));break;case o.ValueType.Formula:e.result!==void 0&&n&&r.isDateFmt(n.numFmt)&&(e.result=r.excelToDate(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si)}let i=t.hyperlinkMap[e.address];i&&(e.type===o.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=o.ValueType.Hyperlink,e.hyperlink=i);let a=t.commentsMap&&t.commentsMap[e.address];a&&(e.comment=a)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen(e){let{attributes:t}=e;this.model={iconSet:t.iconSet,iconId:r.toIntValue(t.iconId)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],75:[function(e,t,n){let{v4:r}=e(`uuid`),i=e(`../../base-xform`),a=e(`../../composite-xform`),o=e(`./databar-ext-xform`),s=e(`./icon-set-ext-xform`),c={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new o,"x14:iconSet":this.iconSetXform=new s}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?o.isExt(e):!(e.type!==`iconSet`||!e.custom&&!c[e.iconSet])}prepare(e){l.isExt(e)&&(e.x14Id=`{${r()}}`.toUpperCase())}render(e,t){if(l.isExt(t))switch(t.type){case`dataBar`:this.renderDataBar(e,t);break;case`iconSet`:this.renderIconSet(e,t)}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id||`{${r()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{type:t.type,x14Id:t.id,priority:i.toIntValue(t.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}}t.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./f-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"xm:f":this.fExtXform=new i}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./sqref-ext-xform`),a=e(`./cf-rule-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"xm:sqref":this.sqRef=new i,"x14:cfRule":this.cfRule=new a}}get tag(){return`x14:conditionalFormatting`}prepare(e,t){e.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(e,t){t.rules.some(a.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(a.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./cf-rule-ext-xform`),a=e(`./conditional-formatting-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(i.isExt))),e.hasExtContent}prepare(e,t){e.forEach(e=>{this.cfXform.prepare(e,t)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`../../style/color-xform`),o=e(`./cfvo-ext-xform`);t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"x14:borderColor":this.borderColorXform=new a(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new a(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new a(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new a(`x14:axisColor`)}}static isExt(e){return!e.gradient}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:r.toIntAttribute(t.minLength,0,!0),maxLength:r.toIntAttribute(t.maxLength,100,!0),border:r.toBoolAttribute(t.border,!1),gradient:r.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toAttribute(t.axisPosition,`auto`),direction:r.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],minLength:r.toIntValue(t.minLength,0),maxLength:r.toIntValue(t.maxLength,100),border:r.toBoolValue(t.border,!1),gradient:r.toBoolValue(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolValue(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolValue(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toStringValue(t.axisPosition,`auto`),direction:r.toStringValue(t.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],81:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`./cfvo-ext-xform`),o=e(`./cf-icon-ext-xform`);t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new o}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0),custom:r.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],iconSet:r.toStringValue(t.iconSet,`3TrafficLights`),reverse:r.toBoolValue(t.reverse,!1),showValue:r.toBoolValue(t.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],83:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`../../../../doc/range`),o=e(`./databar-xform`),s=e(`./ext-lst-ref-xform`),c=e(`./formula-xform`),l=e(`./color-scale-xform`),u=e(`./icon-set-xform`),d={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},f=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};class p extends i{constructor(){super(),this.map={dataBar:this.databarXform=new o,extLst:this.extLstRefXform=new s,formula:this.formulaXform=new c,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new u}}get tag(){return`cfRule`}static isPrimitive(e){return e.type!==`iconSet`||!e.custom&&!d[e.iconSet]}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t)}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:r.toBoolAttribute(t.percent,!1),bottom:r.toBoolAttribute(t.bottom,!1),rank:r.toIntValue(t.rank,10,!0)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:r.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(e,t){p.isPrimitive(t)&&(e.openNode(this.tag,{type:`iconSet`,priority:t.priority}),this.iconSetXform.render(e,t),e.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:r.toStringAttribute(t.operator,`containsText`)});let n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new a(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new a(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{...f(t),dxfId:r.toIntValue(t.dxfId),priority:r.toIntValue(t.priority),timePeriod:t.timePeriod,percent:r.toBoolValue(t.percent),bottom:r.toBoolValue(t.bottom),rank:r.toIntValue(t.rank),aboveAverage:r.toBoolValue(t.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model)}}}t.exports=p},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:r.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],85:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`../../style/color-xform`),a=e(`./cfvo-xform`);t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./cf-rule-xform`);t.exports=class extends r{constructor(){super(),this.map={cfRule:new i}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(i.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{i.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel(e){let{attributes:t}=e;return{ref:t.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,t,n){let r=e(`../../base-xform`),i=e(`./conditional-formatting-xform`);t.exports=class extends r{constructor(){super(),this.cfXform=new i}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(!!this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`../../style/color-xform`),a=e(`./cfvo-xform`);t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`);class a extends r{get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class o extends i{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}}t.exports=class extends i{constructor(){super(),this.map={ext:new o}}get tag(){return`extLst`}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],91:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`./cfvo-xform`);t.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{iconSet:r.toStringValue(t.iconSet,`3TrafficLights`),reverse:r.toBoolValue(t.reverse),showValue:r.toBoolValue(t.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min||`0`,10),max:parseInt(e.attributes.max||`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width||`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),r.parseBoolean(e.attributes.hidden)&&(t.hidden=!0),r.parseBoolean(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),r.parseBoolean(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/utils`),a=e(`../../../utils/col-cache`),o=e(`../base-xform`),s=e(`../../../doc/range`);function c(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function l(e,t,n,r){let a=t[n];a===void 0?r!==void 0&&(e[n]=r):e[n]=i.parseBoolean(a)}t.exports=class extends o{get tag(){return`dataValidations`}render(e,t){let n=function(e){let t=r.map(e,(e,t)=>({address:t,dataValidation:e,marked:!1})).sort((e,t)=>r.strcmp(e.address,t.address)),n=r.keyBy(t,`address`),i=(t,n,i)=>{for(let o=0;o{if(!t.marked){let o=a.decodeEx(t.address);if(o.dimensions)return n[o.dimensions].marked=!0,{...t.dataValidation,sqref:t.address};let s=1,c=a.encodeAddress(o.row+s,o.col);for(;e[c]&&r.isEqual(t.dataValidation,e[c]);)s++,c=a.encodeAddress(o.row+s,o.col);let l=1;for(;i(o,s,o.col+l);)l++;for(let e=0;e1||l>1){let e=o.row+(s-1),n=o.col+(l-1);return{...t.dataValidation,sqref:`${t.address}:${a.encodeAddress(e,n)}`}}return{...t.dataValidation,sqref:t.address}}return null}).filter(Boolean)}(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae||[]).forEach((n,r)=>{e.openNode(`formula`+(r+1)),t.type===`date`?e.writeText(i.dateToExcel(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type||`any`,formulae:[]};switch(e.attributes.type&&l(t,e.attributes,`allowBlank`),l(t,e.attributes,`showInputMessage`),l(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:c(t,e.attributes,`operator`,`between`)}return c(t,e.attributes,`promptTitle`),c(t,e.attributes,`prompt`),c(t,e.attributes,`errorStyle`),c(t,e.attributes,`errorTitle`),c(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{e.includes(`:`)?new s(e).forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=i.excelToDate(parseFloat(e))}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,t,n){let r=e(`../composite-xform`),i=e(`./cf-ext/conditional-formattings-ext-xform`);class a extends r{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new i}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,t){this.conditionalFormattings.prepare(e.conditionalFormattings,t)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}}t.exports=class extends r{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e,t)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`headerFooter`}render(e,t){if(t){e.addRollback();let n=!1;e.openNode(`headerFooter`),t.differentFirst&&(e.addAttribute(`differentFirst`,`1`),n=!0),t.differentOddEven&&(e.addAttribute(`differentOddEven`,`1`),n=!0),t.oddHeader&&typeof t.oddHeader==`string`&&(e.leafNode(`oddHeader`,null,t.oddHeader),n=!0),t.oddFooter&&typeof t.oddFooter==`string`&&(e.leafNode(`oddFooter`,null,t.oddFooter),n=!0),t.evenHeader&&typeof t.evenHeader==`string`&&(e.leafNode(`evenHeader`,null,t.evenHeader),n=!0),t.evenFooter&&typeof t.evenFooter==`string`&&(e.leafNode(`evenFooter`,null,t.evenFooter),n=!0),t.firstHeader&&typeof t.firstHeader==`string`&&(e.leafNode(`firstHeader`,null,t.firstHeader),n=!0),t.firstFooter&&typeof t.firstFooter==`string`&&(e.leafNode(`firstFooter`,null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=e;break;case`oddFooter`:this.model.oddFooter=e;break;case`evenHeader`:this.model.evenHeader=e;break;case`evenFooter`:this.model.evenFooter=e;break;case`firstHeader`:this.model.firstHeader=e;break;case`firstFooter`:this.model.firstFooter=e}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`hyperlink`}render(e,t){this.isInternalLink(t)?e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return e.name===`hyperlink`&&(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(e){return e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target)}}},{"../base-xform":32}],99:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../doc/range`),a=e(`../../../utils/col-cache`),o=e(`../../../doc/enums`);t.exports=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new i(t)}}get mergeCells(){return r.map(this.merges,e=>e.range)}reconcile(e,t){r.each(e,e=>{let n=a.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===o.ValueType.Merge&&(i.master=n.tl):r.cells[t]={type:o.ValueType.Null,address:a.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,t,n){let r=e(`../base-xform`),i=e=>e!==void 0;t.exports=class extends r{get tag(){return`outlinePr`}render(e,t){return!(!t||!i(t.summaryBelow)&&!i(t.summaryRight))&&(e.leafNode(this.tag,{summaryBelow:i(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:i(t.summaryRight)?Number(t.summaryRight):void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={summaryBelow:i(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:i(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){return e.name===`brk`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`pageSetUpPr`}render(e,t){return!(!t||!t.fitToPage)&&(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={fitToPage:e.attributes.fitToPage===`1`},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e){return e?`1`:void 0}function o(e){switch(e){case`overThenDown`:return e;default:return}}function s(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function c(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}t.exports=class extends i{get tag(){return`pageSetup`}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:o(t.pageOrder),blackAndWhite:a(t.blackAndWhite),draft:a(t.draft),cellComments:s(t.cellComments),errors:c(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:a(t.firstPageNumber),usePrinterDefaults:a(t.usePrinterDefaults),copies:t.copies};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:(t=e.attributes.paperSize,t===void 0?void 0:parseInt(t,10)),orientation:e.attributes.orientation||`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi||`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi||`4294967295`,10),pageOrder:e.attributes.pageOrder||`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments||`None`,errors:e.attributes.errors||`displayed`,scale:parseInt(e.attributes.scale||`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth||`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight||`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber||`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies||`1`,10)},!0;default:return!1}var t}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e){return e?`1`:void 0}t.exports=class extends i{get tag(){return`printOptions`}render(e,t){if(t){let n={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,t,n){let r=e(`./page-breaks-xform`),i=e(`../list-xform`);t.exports=class extends i{constructor(){super({tag:`rowBreaks`,count:!0,childXform:new r})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length));let{childXform:n}=this;t.forEach(t=>{n.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/utils`),a=e(`./cell-xform`);t.exports=class extends r{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new a}}get tag(){return`row`}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){e.openNode(`row`),e.addAttribute(`r`,t.number),t.height&&(e.addAttribute(`ht`,t.height),e.addAttribute(`customHeight`,`1`)),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),e.addAttribute(`x14ac:dyDescent`,`0.25`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1;let t=e.attributes.spans?e.attributes.spans.split(`:`).map(e=>parseInt(e,10)):[void 0,void 0],n=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),i.parseBoolean(e.attributes.hidden)&&(n.hidden=!0),i.parseBoolean(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),i.parseBoolean(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),t.defaultRowHeight&&t.defaultRowHeight===15||(n.customHeight=`1`),r.some(n,e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`&&(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||`0`),dyDescent:parseFloat(e.attributes[`x14ac:dyDescent`]||`0`),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,t,n){let r=e(`../base-xform`),i=e(`../style/color-xform`),a=e(`./page-setup-properties-xform`),o=e(`./outline-properties-xform`);t.exports=class extends r{constructor(){super(),this.map={tabColor:new i(`tabColor`),pageSetUpPr:new a,outlinePr:new o}}get tag(){return`sheetPr`}render(e,t){if(t){e.addRollback(),e.openNode(`sheetPr`);let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e,t){return e?t:void 0}function o(e,t){return e===t||void 0}t.exports=class extends i{get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:a(t.sheet,`1`),selectLockedCells:!1===t.selectLockedCells?`1`:void 0,selectUnlockedCells:!1===t.selectUnlockedCells?`1`:void 0,formatCells:a(t.formatCells,`0`),formatColumns:a(t.formatColumns,`0`),formatRows:a(t.formatRows,`0`),insertColumns:a(t.insertColumns,`0`),insertRows:a(t.insertRows,`0`),insertHyperlinks:a(t.insertHyperlinks,`0`),deleteColumns:a(t.deleteColumns,`0`),deleteRows:a(t.deleteRows,`0`),sort:a(t.sort,`0`),autoFilter:a(t.autoFilter,`0`),pivotTables:a(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=a(!1===t.objects,`1`),n.scenarios=a(!1===t.scenarios,`1`)),r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:o(e.attributes.sheet,`1`),objects:e.attributes.objects!==`1`&&void 0,scenarios:e.attributes.scenarios!==`1`&&void 0,selectLockedCells:e.attributes.selectLockedCells!==`1`&&void 0,selectUnlockedCells:e.attributes.selectUnlockedCells!==`1`&&void 0,formatCells:o(e.attributes.formatCells,`0`),formatColumns:o(e.attributes.formatColumns,`0`),formatRows:o(e.attributes.formatRows,`0`),insertColumns:o(e.attributes.insertColumns,`0`),insertRows:o(e.attributes.insertRows,`0`),insertHyperlinks:o(e.attributes.insertHyperlinks,`0`),deleteColumns:o(e.attributes.deleteColumns,`0`),deleteRows:o(e.attributes.deleteRows,`0`),sort:o(e.attributes.sort,`0`),autoFilter:o(e.attributes.autoFilter,`0`),pivotTables:o(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../base-xform`),a={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};t.exports=class extends i{get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`}}render(e,t){e.openNode(`sheetView`,{workbookViewId:t.workbookViewId||0});let n=function(t,n,r){r&&e.addAttribute(t,n)},i,a,o,s;switch(n(`rightToLeft`,`1`,!0===t.rightToLeft),n(`tabSelected`,`1`,t.tabSelected),n(`showRuler`,`0`,!1===t.showRuler),n(`showRowColHeaders`,`0`,!1===t.showRowColHeaders),n(`showGridLines`,`0`,!1===t.showGridLines),n(`zoomScale`,t.zoomScale,t.zoomScale),n(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal),n(`view`,t.style,t.style),t.state){case`frozen`:a=t.xSplit||0,o=t.ySplit||0,i=t.topLeftCell||r.getAddress(o+1,a+1).address,s=(t.xSplit&&t.ySplit?`bottomRight`:t.xSplit&&`topRight`)||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:i,activePane:s,state:`frozen`}),e.leafNode(`selection`,{pane:s,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell})}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale||`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit||`0`,10),ySplit:parseInt(e.attributes.ySplit||`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane||`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/col-cache`),a=e(`../../../utils/xml-stream`),o=e(`../../rel-type`),s=e(`./merges`),c=e(`../base-xform`),l=e(`../list-xform`),u=e(`./row-xform`),d=e(`./col-xform`),f=e(`./dimension-xform`),p=e(`./hyperlink-xform`),m=e(`./merge-cell-xform`),h=e(`./data-validations-xform`),g=e(`./sheet-properties-xform`),_=e(`./sheet-format-properties-xform`),v=e(`./sheet-view-xform`),y=e(`./sheet-protection-xform`),b=e(`./page-margins-xform`),x=e(`./page-setup-xform`),S=e(`./print-options-xform`),C=e(`./auto-filter-xform`),w=e(`./picture-xform`),T=e(`./drawing-xform`),E=e(`./table-part-xform`),D=e(`./row-breaks-xform`),O=e(`./header-footer-xform`),k=e(`./cf/conditional-formattings-xform`),A=e(`./ext-lst-xform`),j=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?((e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})})(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};class M extends c{constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new g,dimension:new f,sheetViews:new l({tag:`sheetViews`,count:!1,childXform:new v}),sheetFormatPr:new _,cols:new l({tag:`cols`,count:!1,childXform:new d}),sheetData:new l({tag:`sheetData`,count:!1,empty:!0,childXform:new u({maxItems:n}),maxItems:t}),autoFilter:new C,mergeCells:new l({tag:`mergeCells`,count:!0,childXform:new m}),rowBreaks:new D,hyperlinks:new l({tag:`hyperlinks`,count:!1,childXform:new p}),pageMargins:new b,dataValidations:new h,pageSetup:new x,headerFooter:new O,printOptions:new S,picture:new w,drawing:new T,sheetProtection:new y,tableParts:new l({tag:`tableParts`,count:!0,childXform:new E}),conditionalFormatting:new k,extLst:new A}}prepare(e,t){t.merges=new s,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId`+(e.length+1)}if(e.hyperlinks.forEach(e=>{let t=r(n);e.rId=t,n.push({Id:t,Type:o.Hyperlink,Target:e.target,TargetMode:`External`})}),e.comments.length>0){let a={Id:r(n),Type:o.Comments,Target:`../comments${e.id}.xml`};n.push(a);let s={Id:r(n),Type:o.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};n.push(s),e.comments.forEach(e=>{e.refAddress=i.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments`+e.id,vmlDrawing:`vmlDrawing`+e.id})}let a=[],c;e.media.forEach(i=>{if(i.type===`background`){let a=r(n);c=t.media[i.imageId],n.push({Id:a,Type:o.Image,Target:`../media/${c.name}.${c.extension}`}),e.background={rId:a},e.image=t.media[i.imageId]}else if(i.type===`image`){let{drawing:s}=e;c=t.media[i.imageId],s||(s=e.drawing={rId:r(n),name:`drawing`+ ++t.drawingsCount,anchors:[],rels:[]},t.drawings.push(s),n.push({Id:s.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/${s.name}.xml`}));let l=this.preImageId===i.imageId?a[i.imageId]:a[s.rels.length];l||(l=r(s.rels),a[s.rels.length]=l,s.rels.push({Id:l,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/${c.name}.${c.extension}`}));let u={picture:{rId:l},range:i.range};if(i.hyperlinks&&i.hyperlinks.hyperlink){let e=r(s.rels);a[s.rels.length]=e,u.picture.hyperlinks={tooltip:i.hyperlinks.tooltip,rId:e},s.rels.push({Id:e,Type:o.Hyperlink,Target:i.hyperlinks.hyperlink,TargetMode:`External`})}this.preImageId=i.imageId,s.anchors.push(u)}}),e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:o.Table,Target:`../tables/`+e.target}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),this.map.extLst.prepare(e,t)}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(`worksheet`,M.WORKSHEET_ATTRIBUTES);let n=t.properties?{defaultRowHeight:t.properties.defaultRowHeight,dyDescent:t.properties.dyDescent,outlineLevelCol:t.properties.outlineLevelCol,outlineLevelRow:t.properties.outlineLevelRow}:void 0;t.properties&&t.properties.defaultColWidth&&(n.defaultColWidth=t.properties.defaultColWidth);let r={outlineProperties:t.properties&&t.properties.outlineProperties,tabColor:t.properties&&t.properties.tabColor,pageSetup:t.pageSetup&&t.pageSetup.fitToPage?{fitToPage:t.pageSetup.fitToPage}:void 0},i=t.pageSetup&&t.pageSetup.margins,s={showRowColHeaders:t.pageSetup&&t.pageSetup.showRowColHeaders,showGridLines:t.pageSetup&&t.pageSetup.showGridLines,horizontalCentered:t.pageSetup&&t.pageSetup.horizontalCentered,verticalCentered:t.pageSetup&&t.pageSetup.verticalCentered},c=t.sheetProtection;this.map.sheetPr.render(e,r),this.map.dimension.render(e,t.dimensions),this.map.sheetViews.render(e,t.views),this.map.sheetFormatPr.render(e,n),this.map.cols.render(e,t.cols),this.map.sheetData.render(e,t.rows),this.map.sheetProtection.render(e,c),this.map.autoFilter.render(e,t.autoFilter),this.map.mergeCells.render(e,t.mergeCells),this.map.conditionalFormatting.render(e,t.conditionalFormattings),this.map.dataValidations.render(e,t.dataValidations),this.map.hyperlinks.render(e,t.hyperlinks),this.map.printOptions.render(e,s),this.map.pageMargins.render(e,i),this.map.pageSetup.render(e,t.pageSetup),this.map.headerFooter.render(e,t.headerFooter),this.map.rowBreaks.render(e,t.rowBreaks),this.map.drawing.render(e,t.drawing),this.map.picture.render(e,t.background),this.map.tableParts.render(e,t.tables),this.map.extLst.render(e,t),t.rels&&t.rels.forEach(t=>{t.Type===o.VmlDrawing&&e.leafNode(`legacyDrawing`,{"r:id":t.Id})}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(r.each(this.map,e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=j(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=(e.relationships||[]).reduce((n,r)=>{if(n[r.Id]=r,r.Type===o.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===o.VmlDrawing&&e.comments&&e.comments.length){let n=t.vmlDrawings[r.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,n[t])})}return n},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1];t.drawings[n].anchors.forEach(t=>{if(t.medium){let n={type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}})}}let r=e.background&&n[e.background.rId];if(r){let n=r.Target.split(`/media/`)[1],i=t.mediaIndex&&t.mediaIndex[n];i!==void 0&&e.media.push({type:`background`,imageId:i})}e.tables=(e.tables||[]).map(e=>{let r=n[e.rId];return t.tables[r.Target]}),delete e.relationships,delete e.hyperlinks,delete e.comments}}M.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`},t.exports=M},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}}},{"../base-xform":32}],118:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag&&(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0)}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||0,10)),!1}}},{"../base-xform":32}],119:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}}},{"../base-xform":32}],120:[function(e,t,n){let r=e(`./base-xform`),i=e(`../../utils/xml-stream`);t.exports=class extends r{constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new i;(function e(t,n){t.openNode(n.tag,n.$),n.c&&n.c.forEach(n=>{e(t,n)}),n.t&&t.writeText(n.t),t.closeNode()})(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,t,n){let r=e(`./text-xform`),i=e(`./rich-text-xform`),a=e(`../base-xform`);t.exports=class extends a{constructor(){super(),this.map={r:new i,t:new r}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty(`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,t,n){let r=e(`./text-xform`),i=e(`../style/font-xform`),a=e(`../base-xform`);class o extends a{constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new r}get fontXform(){return this._fontXform||=new i(o.FONT_OPTIONS)}render(e,t){t||=this.model,e.openNode(`r`),t.font&&this.fontXform.render(e,t.font),this.textXform.render(e,t.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}o.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`},t.exports=o},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,t,n){let r=e(`./text-xform`),i=e(`./rich-text-xform`),a=e(`./phonetic-text-xform`),o=e(`../base-xform`);t.exports=class extends o{constructor(e){super(),this.model=e,this.map={r:new i,t:new r,rPh:new a}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&t.hasOwnProperty(`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./shared-string-xform`);t.exports=class extends i{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new a}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){t||=this._values,e.openXml(r.StdDocAttributes),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:t.count,uniqueCount:t.values.length});let n=this.sharedStringXform;t.values.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(t),e.closeNode()}get model(){return this._text.join(``).replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseOpen(e){switch(e.name){case`t`:return this._text=[],!0;default:return!1}}parseText(e){this._text.push(e)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,t,n){let r=e(`../../../doc/enums`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case`vertical`:return e;default:return(e=i.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=i.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case`ltr`:return r.ReadingOrder.LeftToRight;case`rtl`:return r.ReadingOrder.RightToLeft;default:return}}},s={toXml(e){if(e=o.textRotation(e)){if(e===`vertical`)return 255;let t=Math.round(e);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(e){let t=i.validInt(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};t.exports=class extends a{get tag(){return`alignment`}render(e,t){e.addRollback(),e.openNode(`alignment`);let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r(`horizontal`,o.horizontal(t.horizontal)),r(`vertical`,o.vertical(t.vertical)),r(`wrapText`,!!o.wrapText(t.wrapText)&&`1`),r(`shrinkToFit`,!!o.shrinkToFit(t.shrinkToFit)&&`1`),r(`indent`,o.indent(t.indent)),r(`textRotation`,s.toXml(t.textRotation)),r(`readingOrder`,o.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,i.parseBoolean(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,i.parseBoolean(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,s.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/utils`),a=e(`./color-xform`);class o extends r{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return this.model=t?{style:t}:void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(e){return o.validStyleValues[e]}}o.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{}),t.exports=class extends r{constructor(){super(),this.map={top:new o(`top`),left:new o(`left`),bottom:new o(`bottom`),right:new o(`right`),diagonal:new o(`diagonal`)}}render(e,t){let{color:n}=t;function r(r,i){r&&!r.color&&t.color&&(r={...r,color:t.color}),i.render(e,r,n)}e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`)),r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=i.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=i.parseBoolean(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e=this.model={},t=function(t,n,r){n&&(r&&Object.assign(n,r),e[t]=n)};t(`left`,this.map.left.model),t(`right`,this.map.right.model),t(`top`,this.map.top.model),t(`bottom`,this.map.bottom.model),t(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.name=e||`color`}get tag(){return this.name}render(e,t){return!!t&&(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0)}parseOpen(e){return e.name===this.name&&(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,t,n){let r=e(`../base-xform`),i=e(`./alignment-xform`),a=e(`./border-xform`),o=e(`./fill-xform`),s=e(`./font-xform`),c=e(`./numfmt-xform`),l=e(`./protection-xform`);t.exports=class extends r{constructor(){super(),this.map={alignment:new i,border:new a,fill:new o,font:new s,numFmt:new c,protection:new l}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,t,n){let r=e(`../base-xform`),i=e(`./color-xform`);class a extends r{constructor(){super(),this.map={color:new i}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class o extends r{constructor(){super(),this.map={fgColor:new i(`fgColor`),bgColor:new i(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0)}}class s extends r{constructor(){super(),this.map={stop:new a}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom)}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class c extends r{constructor(){super(),this.map={patternFill:new o,gradientFill:new s}}get tag(){return`fill`}render(e,t){switch(e.addRollback(),e.openNode(`fill`),t.type){case`pattern`:this.map.patternFill.render(e,t);break;case`gradient`:this.map.gradientFill.render(e,t);break;default:e.rollback();return}e.closeNode(),e.commit()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(e){return c.validPatternValues[e]}}c.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{}),c.StopXform=a,c.PatternFillXform=o,c.GradientFillXform=s,t.exports=c},{"../base-xform":32,"./color-xform":128}],131:[function(e,t,n){let r=e(`./color-xform`),i=e(`../simple/boolean-xform`),a=e(`../simple/integer-xform`),o=e(`../simple/string-xform`),s=e(`./underline-xform`),c=e(`../../../utils/under-dash`),l=e(`../base-xform`);class u extends l{constructor(e){super(),this.options=e||u.OPTIONS,this.map={b:{prop:`bold`,xform:new i({tag:`b`,attr:`val`})},i:{prop:`italic`,xform:new i({tag:`i`,attr:`val`})},u:{prop:`underline`,xform:new s},charset:{prop:`charset`,xform:new a({tag:`charset`,attr:`val`})},color:{prop:`color`,xform:new r},condense:{prop:`condense`,xform:new i({tag:`condense`,attr:`val`})},extend:{prop:`extend`,xform:new i({tag:`extend`,attr:`val`})},family:{prop:`family`,xform:new a({tag:`family`,attr:`val`})},outline:{prop:`outline`,xform:new i({tag:`outline`,attr:`val`})},vertAlign:{prop:`vertAlign`,xform:new o({tag:`vertAlign`,attr:`val`})},scheme:{prop:`scheme`,xform:new o({tag:`scheme`,attr:`val`})},shadow:{prop:`shadow`,xform:new i({tag:`shadow`,attr:`val`})},strike:{prop:`strike`,xform:new i({tag:`strike`,attr:`val`})},sz:{prop:`size`,xform:new a({tag:`sz`,attr:`val`})}},this.map[this.options.fontNameTag]={prop:`name`,xform:new o({tag:this.options.fontNameTag,attr:`val`})}}get tag(){return this.options.tagName}render(e,t){let{map:n}=this;e.openNode(this.options.tagName),c.each(this.map,(r,i)=>{n[i].xform.render(e,t[r.prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}}u.OPTIONS={tagName:`font`,fontNameTag:`name`},t.exports=u},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../defaultnumformats`),a=e(`../base-xform`),o=function(){let e={};return r.each(i,(t,n)=>{t.f&&(e[t.f]=parseInt(n,10))}),e}();class s extends a{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}}s.getDefaultFmtId=function(e){return o[e]},s.getDefaultFmtCode=function(e){return i[e]&&i[e].f},t.exports=s},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,t,n){let r=e(`../base-xform`),i={boolean:(e,t)=>e===void 0?t:e};t.exports=class extends r{get tag(){return`protection`}render(e,t){e.addRollback(),e.openNode(`protection`);let n=!1;function r(t,r){r!==void 0&&(e.addAttribute(t,r),n=!0)}r(`locked`,i.boolean(t.locked,!0)?void 0:`0`),r(`hidden`,i.boolean(t.hidden,!1)?`1`:void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`},n=!t.locked||t.hidden;this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,t,n){let r=e(`../base-xform`),i=e(`./alignment-xform`),a=e(`./protection-xform`);t.exports=class extends r{constructor(e){super(),this.xfId=!(!e||!e.xfId),this.map={alignment:new i,protection:new a}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute(`xfId`,t.xfId||0),t.numFmtId&&e.addAttribute(`applyNumberFormat`,`1`),t.fontId&&e.addAttribute(`applyFont`,`1`),t.fillId&&e.addAttribute(`applyFill`,`1`),t.borderId&&e.addAttribute(`applyBorder`,`1`),t.alignment&&e.addAttribute(`applyAlignment`,`1`),t.protection&&e.addAttribute(`applyProtection`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,t,n){let r=e(`../../../doc/enums`),i=e(`../../../utils/xml-stream`),a=e(`../base-xform`),o=e(`../static-xform`),s=e(`../list-xform`),c=e(`./font-xform`),l=e(`./fill-xform`),u=e(`./border-xform`),d=e(`./numfmt-xform`),f=e(`./style-xform`),p=e(`./dxf-xform`);class m extends a{constructor(e){super(),this.map={numFmts:new s({tag:`numFmts`,count:!0,childXform:new d}),fonts:new s({tag:`fonts`,count:!0,childXform:new c,$:{"x14ac:knownFonts":1}}),fills:new s({tag:`fills`,count:!0,childXform:new l}),borders:new s({tag:`borders`,count:!0,childXform:new u}),cellStyleXfs:new s({tag:`cellStyleXfs`,count:!0,childXform:new f}),cellXfs:new s({tag:`cellXfs`,count:!0,childXform:new f({xfId:!0})}),dxfs:new s({tag:`dxfs`,always:!0,count:!0,childXform:new p}),numFmt:new d,font:new c,fill:new l,border:new u,style:new f({xfId:!0}),cellStyles:m.STATIC_XFORMS.cellStyles,tableStyles:m.STATIC_XFORMS.tableStyles,extLst:m.STATIC_XFORMS.extLst},e&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap}render(e,t){t||=this.model,e.openXml(i.StdDocAttributes),e.openNode(`styleSheet`,m.STYLESHEET_ATTRIBUTES),this.index?(t.numFmts&&t.numFmts.length&&(e.openNode(`numFmts`,{count:t.numFmts.length}),t.numFmts.forEach(t=>{e.writeXml(t)}),e.closeNode()),t.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),e.openNode(`fonts`,{count:t.fonts.length,"x14ac:knownFonts":1}),t.fonts.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode(`fills`,{count:t.fills.length}),t.fills.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode(`borders`,{count:t.borders.length}),t.borders.forEach(t=>{e.writeXml(t)}),e.closeNode(),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),e.openNode(`cellXfs`,{count:t.styles.length}),t.styles.forEach(t=>{e.writeXml(t)}),e.closeNode()):(this.map.numFmts.render(e,t.numFmts),this.map.fonts.render(e,t.fonts),this.map.fills.render(e,t.fills),this.map.borders.render(e,t.borders),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(e,t.styles)),m.STATIC_XFORMS.cellStyles.render(e),this.map.dxfs.render(e,t.dxfs),m.STATIC_XFORMS.tableStyles.render(e),m.STATIC_XFORMS.extLst.render(e),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let n={};if(t||=r.ValueType.Number,e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(t){case r.ValueType.Number:n.numFmtId=this._addNumFmtStr(`General`);break;case r.ValueType.Date:n.numFmtId=this._addNumFmtStr(`mm-dd-yy`)}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);let i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||d.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}return r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=d.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}}m.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`},m.STATIC_XFORMS={cellStyles:new o({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new o({tag:`dxfs`,$:{count:0}}),tableStyles:new o({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new o({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})},m.Mock=class extends m{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case r.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:d.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}},t.exports=m},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,t,n){let r=e(`../base-xform`);class i extends r{constructor(e){super(),this.model=e}get tag(){return`u`}render(e,t){if(!0===(t||=this.model))e.leafNode(`u`);else{let n=i.Attributes[t];n&&e.leafNode(`u`,n)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}}i.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}},t.exports=i},{"../base-xform":32}],137:[function(e,t,n){let r=e(`../base-xform`),i=e(`./filter-column-xform`);t.exports=class extends r{constructor(){super(),this.map={filterColumn:new i}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){return e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode(),!0}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val,operator:e.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,t,n){let r=e(`../base-xform`),i=e(`../list-xform`),a=e(`./custom-filter-xform`),o=e(`./filter-xform`);t.exports=class extends r{constructor(){super(),this.map={customFilters:new i({tag:`customFilters`,count:!1,empty:!0,childXform:new a}),filters:new i({tag:`filters`,count:!1,empty:!0,childXform:new o})}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){return t.customFilters?(e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}render(e,t){return e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId}),!0}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tableStyleInfo`}render(e,t){return e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`}),!0}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../list-xform`),o=e(`./auto-filter-xform`),s=e(`./table-column-xform`),c=e(`./table-style-info-xform`);class l extends i{constructor(){super(),this.map={autoFilter:new o,tableColumns:new a({tag:`tableColumns`,count:!0,empty:!0,childXform:new s}),tableStyleInfo:new c}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:t.id,name:t.name,displayName:t.displayName||t.name,ref:t.tableRef,totalsRowCount:t.totalsRow?`1`:void 0,totalsRowShown:t.totalsRow?void 0:`1`,headerRowCount:t.headerRow?`1`:`0`}),this.map.autoFilter.render(e,t),this.map.tableColumns.render(e,t.columns),this.map.tableStyleInfo.render(e,t.style),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount===`1`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`},t.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,t,n){(function(n,r){(function(){let i=e(`fs`),a=e(`jszip`),{PassThrough:o}=e(`readable-stream`),s=e(`../utils/zip-stream`),c=e(`../utils/stream-buf`),l=e(`../utils/utils`),u=e(`../utils/xml-stream`),{bufferToString:d}=e(`../utils/browser-buffer-decode`),f=e(`./xform/style/styles-xform`),p=e(`./xform/core/core-xform`),m=e(`./xform/strings/shared-strings-xform`),h=e(`./xform/core/relationships-xform`),g=e(`./xform/core/content-types-xform`),_=e(`./xform/core/app-xform`),v=e(`./xform/book/workbook-xform`),y=e(`./xform/sheet/worksheet-xform`),b=e(`./xform/drawing/drawing-xform`),x=e(`./xform/table/table-xform`),S=e(`./xform/comment/comments-xform`),C=e(`./xform/comment/vml-notes-xform`),w=e(`./xml/theme1`);class T{constructor(e){this.workbook=e}async readFile(e,t){if(!await l.fs.exists(e))throw Error(`File not found: `+e);let n=i.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return new h().parseStream(e)}parseWorkbook(e){return new v().parseStream(e)}parseSharedStrings(e){return new m().parseStream(e)}reconcile(e,t){let n=new v,r=new y(t),i=new b,a=new x;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)});let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,n,r,i){let a=await new y(r).parseStream(e);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new S().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new x().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new h().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=new c;s.on(`finish`,()=>{t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer()};t.media.push(e),r()}),e.on(`error`,e=>{o(e)}),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new b().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new h().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new C().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=new c;e.on(`error`,i),a.on(`error`,i),a.on(`finish`,()=>{t.themes[n]=a.read().toString(),r()}),e.pipe(a)})}createInputStream(){throw Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(e,t){!e[Symbol.asyncIterator]&&e.pipe&&(e=e.pipe(new o));let n=[];for await(let t of e)n.push(t);return this.load(r.concat(n),t)}async load(e,t){let i;i=t&&t.base64?r.from(e.toString(),`base64`):e;let s={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},c=await a.loadAsync(i);for(let e of Object.values(c.files))if(!e.dir){let r,i=e.name;if(i[0]===`/`&&(i=i.substr(1)),i.match(/xl\/media\//)||i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))r=new o,r.write(await e.async(`nodebuffer`));else{let t;r=new o({writableObjectMode:!0,readableObjectMode:!0}),t=n.browser?d(await e.async(`nodebuffer`)):await e.async(`string`);let i=16384;for(let e=0;e{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await function(e,t){return new Promise((n,r)=>{i.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new b,r=new h;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i,{});let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new x;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/`+t.target})})})}async addContentTypes(e,t){let n=new g().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new _().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new p;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:w};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(e){let t=new h().toXml([{Id:`rId1`,Type:T.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:T.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:T.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);e.append(t,{name:`_rels/.rels`})}async addWorkbookRels(e,t){let n=1,r=[{Id:`rId`+ n++,Type:T.RelType.Styles,Target:`styles.xml`},{Id:`rId`+ n++,Type:T.RelType.Theme,Target:`theme/theme1.xml`}];t.sharedStrings.count&&r.push({Id:`rId`+ n++,Type:T.RelType.SharedStrings,Target:`sharedStrings.xml`}),t.worksheets.forEach(e=>{e.rId=`rId`+ n++,r.push({Id:e.rId,Type:T.RelType.Worksheet,Target:`worksheets/sheet${e.id}.xml`})});let i=new h().toXml(r);e.append(i,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new v;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new y,r=new h,i=new S,a=new C;t.worksheets.forEach(t=>{let o=new u;n.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new u,r.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new u,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new u,a.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelJS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelJS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0||t.useSharedStrings,e.useStyles=t.useStyles===void 0||t.useStyles,e.sharedStrings=new m,e.styles=e.useStyles?new f(!0):new f.Mock;let n=new v,r=new y;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t||={};let{model:n}=this.workbook,r=new s.ZipWriter(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),await this.addDrawings(r,n),await this.addTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=i.createWriteStream(e);return new Promise((e,r)=>{n.on(`finish`,()=>{e()}),n.on(`error`,e=>{r(e)}),this.write(n,t).then(()=>{n.end()}).catch(e=>{r(e)})})}async writeBuffer(e){let t=new c;return await this.write(t,e),t.read()}}T.RelType=e(`./rel-type`),t.exports=T}).call(this)}).call(this,e(`_process`),e(`buffer`).Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,t,n){t.exports=` `},{}],146:[function(e,t,n){(function(t){(function(){Object.defineProperty(n,`__esModule`,{value:!0}),n.CsvFormatterStream=void 0;let r=e(`stream`),i=e(`./formatter`);class a extends r.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new i.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||=(this.push(this.formatterOptions.BOM),!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.from(e,`utf8`))}),e()))}}n.CsvFormatterStream=a}).call(this)}).call(this,e(`buffer`).Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.FormatterOptions=void 0,n.FormatterOptions=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;this.objectMode=!0,this.delimiter=`,`,this.rowDelimiter=` `,this.quote=`"`,this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM=``,this.alwaysWriteHeaders=!1,Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),!0===e?.quote?this.quote=`"`:!1===e?.quote&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((t=e.writeHeaders)==null||t),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,`__esModule`,{value:!0}),n.FieldFormatter=void 0;let i=r(e(`lodash.isboolean`)),a=r(e(`lodash.isnil`)),o=r(e(`lodash.escaperegexp`));n.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${o.default(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let n=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return i.default(n)?n:Array.isArray(n)?n[e]:this._headers!==null&&n[this._headers[e]]}format(e,t,n){let r=(``+(a.default(e)?``:e)).replace(/\0/g,``),{formatterOptions:i}=this;return i.quote!==``&&r.indexOf(i.quote)!==-1?this.quoteField(r.replace(this.REPLACE_REGEXP,i.escapedQuote)):r.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(r):r}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,`__esModule`,{value:!0}),n.RowFormatter=void 0;let i=r(e(`lodash.isfunction`)),a=r(e(`lodash.isequal`)),o=e(`./FieldFormatter`),s=e(`../types`);class c{constructor(e){this.rowCount=0,this.formatterOptions=e,this.fieldFormatter=new o.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}static isRowHashArray(e){return!!Array.isArray(e)&&Array.isArray(e[0])&&e[0].length===2}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(e){return c.isRowHashArray(e)?e.map(e=>e[0]):Array.isArray(e)?e:Object.keys(e)}static createTransform(e){return s.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}set rowTransform(e){if(!i.default(e))throw TypeError(`The transform should be a function`);this._rowTransform=c.createTransform(e)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(e){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let t=c.gatherHeaders(e);return this.headers=t,this.fieldFormatter.headers=t,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(t,e),headers:t}:{shouldFormatColumns:!0,headers:null}}gatherColumns(e){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(e)?c.isRowHashArray(e)?this.headers.map((t,n)=>{let r=e[n];return r?r[1]:``}):c.isRowArray(e)&&!this.shouldWriteHeaders?e:this.headers.map((t,n)=>e[n]):this.headers.map(t=>e[t])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}n.RowFormatter=c},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.FieldFormatter=n.RowFormatter=void 0;var r=e(`./RowFormatter`);Object.defineProperty(n,`RowFormatter`,{enumerable:!0,get:function(){return r.RowFormatter}});var i=e(`./FieldFormatter`);Object.defineProperty(n,`FieldFormatter`,{enumerable:!0,get:function(){return i.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,t,n){(function(t){(function(){var r=Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!==`default`&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=function(e,t){for(var n in e)n===`default`||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,`__esModule`,{value:!0}),n.writeToPath=n.writeToString=n.writeToBuffer=n.writeToStream=n.write=n.format=n.FormatterOptions=n.CsvFormatterStream=void 0;let s=e(`util`),c=e(`stream`),l=a(e(`fs`)),u=e(`./FormatterOptions`),d=e(`./CsvFormatterStream`);o(e(`./types`),n);var f=e(`./CsvFormatterStream`);Object.defineProperty(n,`CsvFormatterStream`,{enumerable:!0,get:function(){return f.CsvFormatterStream}});var p=e(`./FormatterOptions`);Object.defineProperty(n,`FormatterOptions`,{enumerable:!0,get:function(){return p.FormatterOptions}}),n.format=e=>new d.CsvFormatterStream(new u.FormatterOptions(e)),n.write=(e,t)=>{let r=n.format(t),i=s.promisify((e,t)=>{r.write(e,void 0,t)});return e.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>r.end()).catch(e=>{r.emit(`error`,e)}),r},n.writeToStream=(e,t,r)=>n.write(t,r).pipe(e),n.writeToBuffer=function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[],a=new c.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.concat(i))),n.write(e,r).pipe(a)})},n.writeToString=(e,t)=>n.writeToBuffer(e,t).then(e=>e.toString()),n.writeToPath=(e,t,r)=>{let i=l.createWriteStream(e,{encoding:`utf8`});return n.write(t,r).pipe(i)}}).call(this)}).call(this,e(`buffer`).Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.isSyncTransform=void 0,n.isSyncTransform=e=>e.length===1},{}],153:[function(e,t,n){(function(t){(function(){Object.defineProperty(n,`__esModule`,{value:!0}),n.CsvParserStream=void 0;let r=e(`string_decoder`),i=e(`stream`),a=e(`./transforms`),o=e(`./parser`);class s extends i.Transform{constructor(e){super({objectMode:e.objectMode}),this.lines=``,this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=e,this.parser=new o.Parser(e),this.headerTransformer=new a.HeaderTransformer(e),this.decoder=new r.StringDecoder(e.encoding),this.rowTransformerValidator=new a.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e){if(e===`end`)return this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1;var t=[...arguments].slice(1);return super.emit(e,...t)}_transform(e,t,n){if(this.hasHitRowLimit)return n();let r=s.wrapDoneCallback(n);try{let{lines:t}=this,n=t+this.decoder.write(e),i=this.parse(n,!0);return this.processRows(i,r)}catch(e){return r(e)}}_flush(e){let t=s.wrapDoneCallback(e);if(this.hasHitRowLimit)return t();try{let e=this.lines+this.decoder.end(),n=this.parse(e,!1);return this.processRows(n,t)}catch(e){return t(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,n){let r=e.length,i=a=>{let o=e=>e?n(e):a%100==0?void t(()=>i(a+1)):i(a+1);if(this.checkAndEmitHeaders(),a>=r||this.hasHitRowLimit)return n();if(this.parsedLineCount+=1,this.shouldSkipLine)return o();let s=e[a];this.rowCount+=1,this.parsedRowCount+=1;let c=this.rowCount;return this.transformRow(s,(e,t)=>{if(e)return--this.rowCount,o(e);if(!t)return o(Error(`expected transform result`));if(t.isValid){if(t.row)return this.pushRow(t.row,o)}else this.emit(`data-invalid`,t.row,c,t.reason);return o()})};i(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return function(n){if(n){if(t)throw n;t=!0,e(n);return}e(...[...arguments].slice(1))}}}n.CsvParserStream=s}).call(this)}).call(this,e(`timers`).setImmediate)},{"./parser":165,"./transforms":168,stream:505,string_decoder:218,timers:523}],154:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,`__esModule`,{value:!0}),n.ParserOptions=void 0;let i=r(e(`lodash.escaperegexp`)),a=r(e(`lodash.isnil`));n.ParserOptions=class{constructor(e){if(this.objectMode=!0,this.delimiter=`,`,this.ignoreEmpty=!1,this.quote=`"`,this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn=`\r`,this.encoding=`utf8`,this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=i.default(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,t,n){var r=Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!==`default`&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=function(e,t){for(var n in e)n===`default`||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,`__esModule`,{value:!0}),n.parseString=n.parseFile=n.parseStream=n.parse=n.ParserOptions=n.CsvParserStream=void 0;let s=a(e(`fs`)),c=e(`stream`),l=e(`./ParserOptions`),u=e(`./CsvParserStream`);o(e(`./types`),n);var d=e(`./CsvParserStream`);Object.defineProperty(n,`CsvParserStream`,{enumerable:!0,get:function(){return d.CsvParserStream}});var f=e(`./ParserOptions`);Object.defineProperty(n,`ParserOptions`,{enumerable:!0,get:function(){return f.ParserOptions}}),n.parse=e=>new u.CsvParserStream(new l.ParserOptions(e)),n.parseStream=(e,t)=>e.pipe(new u.CsvParserStream(new l.ParserOptions(t))),n.parseFile=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s.createReadStream(e).pipe(new u.CsvParserStream(new l.ParserOptions(t)))},n.parseString=(e,t)=>{let n=new c.Readable;return n.push(e),n.push(null),n.pipe(new u.CsvParserStream(new l.ParserOptions(t)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.Parser=void 0;let r=e(`./Scanner`),i=e(`./RowParser`),a=e(`./Token`);class o{constructor(e){this.parserOptions=e,this.rowParser=new i.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,t){let n=new r.Scanner({line:o.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:t});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let r=e.nextCharacterToken;r!==null;r=e.nextCharacterToken)if(a.Token.isTokenComment(r,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let n=this.rowParser.parse(e);return n!==null&&(this.parserOptions.ignoreEmpty&&i.RowParser.isEmptyRow(n)||t.push(n),!0)}}n.Parser=o},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.RowParser=void 0;let r=e(`./column`),i=e(`./Token`);n.RowParser=class{constructor(e){this.parserOptions=e,this.columnParser=new r.ColumnParser(e)}static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parse(e){let{parserOptions:t}=this,{hasMoreData:n}=e,r=e,a=[],o=this.getStartToken(r,a);for(;o;){if(i.Token.isTokenRowDelimiter(o))return r.advancePastToken(o),!r.hasMoreCharacters&&i.Token.isTokenCarriageReturn(o,t)&&n?null:(r.truncateToCursor(),a);if(!this.shouldSkipColumnParse(r,o,a)){let e=this.columnParser.parse(r);if(e===null)return null;a.push(e)}o=r.nextNonSpaceToken}return n?null:(r.truncateToCursor(),a)}getStartToken(e,t){let n=e.nextNonSpaceToken;return n!==null&&i.Token.isTokenDelimiter(n,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):n}shouldSkipColumnParse(e,t,n){let{parserOptions:r}=this;if(i.Token.isTokenDelimiter(t,r)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&i.Token.isTokenRowDelimiter(a)||a!==null&&i.Token.isTokenDelimiter(a,r))return n.push(``),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.Scanner=void 0;let r=e(`./Token`),i=/((?:\r\n)|\n|\r)/;n.Scanner=class{constructor(e){this.cursor=0,this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,t=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(t)===-1)return null;let n=t.exec(e);if(n==null)return null;let i=n[1],a=this.cursor+(n.index||0);return new r.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:t}=this;return t<=e?null:new r.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=i.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.Token=void 0,n.Token=class{constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===` `||t===`\r `}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}}},{}],160:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.ColumnFormatter=void 0,n.ColumnFormatter=class{constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}},{}],161:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.ColumnParser=void 0;let r=e(`./NonQuotedColumnParser`),i=e(`./QuotedColumnParser`),a=e(`../Token`);n.ColumnParser=class{constructor(e){this.parserOptions=e,this.quotedColumnParser=new i.QuotedColumnParser(e),this.nonQuotedColumnParser=new r.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.NonQuotedColumnParser=void 0;let r=e(`./ColumnFormatter`),i=e(`../Token`);n.NonQuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,n=[],r=e.nextCharacterToken;for(;r&&!i.Token.isTokenDelimiter(r,t)&&!i.Token.isTokenRowDelimiter(r);r=e.nextCharacterToken)n.push(r.token),e.advancePastToken(r);return this.columnFormatter.format(n.join(``))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.QuotedColumnParser=void 0;let r=e(`./ColumnFormatter`),i=e(`../Token`);n.QuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,n=!1,r=!1,a=[],o=e.nextCharacterToken;for(;!r&&o!==null;o=e.nextCharacterToken){let s=i.Token.isTokenQuote(o,t);if(!n&&s)n=!0;else if(n)if(i.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let n=e.nextCharacterToken;n!==null&&(i.Token.isTokenQuote(n,t)||i.Token.isTokenEscapeCharacter(n,t))?(a.push(n.token),o=n):s?r=!0:a.push(o.token)}else s?r=!0:a.push(o.token);e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:r}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:n}=e;if(n){let r=i.Token.isTokenDelimiter(n,t),a=i.Token.isTokenRowDelimiter(n);if(!r&&!a){let r=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${n.token}'. at '${r}`)}e.advanceToToken(n)}else e.hasMoreData||e.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.ColumnFormatter=n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=void 0;var r=e(`./ColumnParser`);Object.defineProperty(n,`ColumnParser`,{enumerable:!0,get:function(){return r.ColumnParser}});var i=e(`./NonQuotedColumnParser`);Object.defineProperty(n,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return i.NonQuotedColumnParser}});var a=e(`./QuotedColumnParser`);Object.defineProperty(n,`QuotedColumnParser`,{enumerable:!0,get:function(){return a.QuotedColumnParser}});var o=e(`./ColumnFormatter`);Object.defineProperty(n,`ColumnFormatter`,{enumerable:!0,get:function(){return o.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=n.Token=n.Scanner=n.RowParser=n.Parser=void 0;var r=e(`./Parser`);Object.defineProperty(n,`Parser`,{enumerable:!0,get:function(){return r.Parser}});var i=e(`./RowParser`);Object.defineProperty(n,`RowParser`,{enumerable:!0,get:function(){return i.RowParser}});var a=e(`./Scanner`);Object.defineProperty(n,`Scanner`,{enumerable:!0,get:function(){return a.Scanner}});var o=e(`./Token`);Object.defineProperty(n,`Token`,{enumerable:!0,get:function(){return o.Token}});var s=e(`./column`);Object.defineProperty(n,`ColumnParser`,{enumerable:!0,get:function(){return s.ColumnParser}}),Object.defineProperty(n,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return s.NonQuotedColumnParser}}),Object.defineProperty(n,`QuotedColumnParser`,{enumerable:!0,get:function(){return s.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,`__esModule`,{value:!0}),n.HeaderTransformer=void 0;let i=r(e(`lodash.isundefined`)),a=r(e(`lodash.isfunction`)),o=r(e(`lodash.uniq`)),s=r(e(`lodash.groupby`));n.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,!0===e.headers?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length!!e);if(o.default(t).length!==t.length){let e=s.default(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found `+JSON.stringify(n))}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,`__esModule`,{value:!0}),n.RowTransformerValidator=void 0;let i=r(e(`lodash.isfunction`)),a=e(`../types`);class o{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return a.isSyncValidate(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):n(null,r?{row:t,isValid:r,reason:i}:{row:t,isValid:!1,reason:i}))}}set rowTransform(e){if(!i.default(e))throw TypeError(`The transform should be a function`);this._rowTransform=o.createTransform(e)}set rowValidator(e){if(!i.default(e))throw TypeError(`The validate should be a function`);this._rowValidator=o.createValidator(e)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}n.RowTransformerValidator=o},{"../types":169,"lodash.isfunction":446}],168:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.HeaderTransformer=n.RowTransformerValidator=void 0;var r=e(`./RowTransformerValidator`);Object.defineProperty(n,`RowTransformerValidator`,{enumerable:!0,get:function(){return r.RowTransformerValidator}});var i=e(`./HeaderTransformer`);Object.defineProperty(n,`HeaderTransformer`,{enumerable:!0,get:function(){return i.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.isSyncValidate=n.isSyncTransform=void 0,n.isSyncTransform=e=>e.length===1,n.isSyncValidate=e=>e.length===1},{}],170:[function(e,t,n){let r=n;r.bignum=e(`bn.js`),r.define=e(`./asn1/api`).define,r.base=e(`./asn1/base`),r.constants=e(`./asn1/constants`),r.decoders=e(`./asn1/decoders`),r.encoders=e(`./asn1/encoders`)},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,t,n){let r=e(`./encoders`),i=e(`./decoders`),a=e(`inherits`);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}n.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){let t=this.name;function n(e){this._initNamed(e,t)}return a(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},o.prototype._getDecoder=function(e){return e||=`der`,this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},o.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},o.prototype._getEncoder=function(e){return e||=`der`,this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r[e])),this.encoders[e]},o.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,t,n){let r=e(`inherits`),i=e(`../base/reporter`).Reporter,a=e(`safer-buffer`).Buffer;function o(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error(`Input not Buffer`)}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e}),this);else if(typeof e==`number`){if(!(0<=e&&e<=255))return t.error(`non-byte EncoderBuffer value`);this.value=e,this.length=1}else if(typeof e==`string`)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error(`Unsupported type: `+typeof e);this.value=e,this.length=e.length}}r(o,i),n.DecoderBuffer=o,o.isDecoderBuffer=function(e){return e instanceof o?!0:typeof e==`object`&&a.isBuffer(e.base)&&e.constructor.name===`DecoderBuffer`&&typeof e.offset==`number`&&typeof e.length==`number`&&typeof e.save==`function`&&typeof e.restore==`function`&&typeof e.isEmpty==`function`&&typeof e.readUInt8==`function`&&typeof e.skip==`function`&&typeof e.raw==`function`},o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(e){let t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||`DecoderBuffer overrun`)},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||`DecoderBuffer overrun`);let n=new o(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},n.EncoderBuffer=s,s.isEncoderBuffer=function(e){return e instanceof s?!0:typeof e==`object`&&e.constructor.name===`EncoderBuffer`&&typeof e.length==`number`&&typeof e.join==`function`},s.prototype.join=function(e,t){return e||=a.alloc(this.length),t||=0,this.length===0||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):(typeof this.value==`number`?e[t]=this.value:typeof this.value==`string`?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,t,n){let r=n;r.Reporter=e(`./reporter`).Reporter,r.DecoderBuffer=e(`./buffer`).DecoderBuffer,r.EncoderBuffer=e(`./buffer`).EncoderBuffer,r.Node=e(`./node`)},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,t,n){let r=e(`../base/reporter`).Reporter,i=e(`../base/buffer`).EncoderBuffer,a=e(`../base/buffer`).DecoderBuffer,o=e(`minimalistic-assert`),s=`seq.seqof.set.setof.objid.bool.gentime.utctime.null_.enum.int.objDesc.bitstr.bmpstr.charstr.genstr.graphstr.ia5str.iso646str.numstr.octstr.printstr.t61str.unistr.utf8str.videostr`.split(`.`),c=[`key`,`obj`,`use`,`optional`,`explicit`,`implicit`,`def`,`choice`,`any`,`contains`].concat(s);function l(e,t,n){let r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=l;let u=[`enc`,`parent`,`children`,`tag`,`args`,`reverseArgs`,`choice`,`optional`,`any`,`obj`,`use`,`alteredUse`,`key`,`default`,`explicit`,`implicit`,`contains`];l.prototype.clone=function(){let e=this._baseState,t={};u.forEach((function(n){t[n]=e[n]}));let n=new this.constructor(t.parent);return n._baseState=t,n},l.prototype._wrap=function(){let e=this._baseState;c.forEach((function(t){this[t]=function(){let n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},l.prototype._init=function(e){let t=this._baseState;o(t.parent===null),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),o.equal(t.children.length,1,`Root node can have only one child`)},l.prototype._useArgs=function(e){let t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),n.length!==0&&(o(t.children===null),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),e.length!==0&&(o(t.args===null),t.args=e,t.reverseArgs=e.map((function(e){if(typeof e!=`object`||e.constructor!==Object)return e;let t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);let r=e[n];t[r]=n})),t})))},[`_peekTag`,`_decodeTag`,`_use`,`_decodeStr`,`_decodeObjid`,`_decodeTime`,`_decodeNull`,`_decodeInt`,`_decodeBool`,`_decodeList`,`_encodeComposite`,`_encodeStr`,`_encodeObjid`,`_encodeTime`,`_encodeNull`,`_encodeInt`,`_encodeBool`].forEach((function(e){l.prototype[e]=function(){let t=this._baseState;throw Error(e+` not implemented for encoding: `+t.enc)}})),s.forEach((function(e){l.prototype[e]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return o(t.tag===null),t.tag=e,this._useArgs(n),this}})),l.prototype.use=function(e){o(e);let t=this._baseState;return o(t.use===null),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){let t=this._baseState;return o(t.default===null),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){let t=this._baseState;return o(t.explicit===null&&t.implicit===null),t.explicit=e,this},l.prototype.implicit=function(e){let t=this._baseState;return o(t.explicit===null&&t.implicit===null),t.implicit=e,this},l.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this},l.prototype.key=function(e){let t=this._baseState;return o(t.key===null),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){let t=this._baseState;return o(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){let t=this._baseState;return o(t.use===null),t.contains=e,this},l.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let r,i=n.default,o=!0,s=null;if(n.key!==null&&(s=e.enterKey(n.key)),n.optional){let r=null;if(n.explicit===null?n.implicit===null?n.tag!==null&&(r=n.tag):r=n.implicit:r=n.explicit,r!==null||n.any){if(o=this._peekTag(e,r,n.any),e.isError(o))return o}else{let r=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),o=!0}catch{o=!1}e.restore(r)}}if(n.obj&&o&&(r=e.enterObject()),o){if(n.explicit!==null){let t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}let r=e.offset;if(n.use===null&&n.choice===null){let t;n.any&&(t=e.save());let r=this._decodeTag(e,n.implicit===null?n.tag:n.implicit,n.any);if(e.isError(r))return r;n.any?i=e.raw(t):e=r}if(t&&t.track&&n.tag!==null&&t.track(e.path(),r,e.length,`tagged`),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,`content`),n.any||(i=n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||n.choice!==null||n.children===null||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&(n.tag===`octstr`||n.tag===`bitstr`)){let r=new a(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&o&&(i=e.leaveObject(r)),n.key===null||i===null&&!0!==o?s!==null&&e.exitKey(s):e.leaveKey(s,n.key,i),i},l.prototype._decodeGeneric=function(e,t,n){let r=this._baseState;return e===`seq`||e===`set`?null:e===`seqof`||e===`setof`?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e===`objid`&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):e===`objid`?this._decodeObjid(t,null,null,n):e===`gentime`||e===`utctime`?this._decodeTime(t,e,n):e===`null_`?this._decodeNull(t,n):e===`bool`?this._decodeBool(t,n):e===`objDesc`?this._decodeStr(t,e,n):e===`int`||e===`enum`?this._decodeInt(t,r.args&&r.args[0],n):r.use===null?t.error(`unknown tag: `+e):this._getUse(r.use,t._reporterState.obj)._decode(t,n)},l.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),o(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},l.prototype._decodeChoice=function(e,t){let n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(a){let o=e.save(),s=n.choice[a];try{let n=s._decode(e,t);if(e.isError(n))return!1;r={type:a,value:n},i=!0}catch{return e.restore(o),!1}return!0}),this),i?r:e.error(`Choice not matched`)},l.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},l.prototype._encode=function(e,t,n){let r=this._baseState;if(r.default!==null&&r.default===e)return;let i=this._encodeValue(e,t,n);return i===void 0||this._skipDefault(i,t,n)?void 0:i},l.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new r);let a=null;if(this.reporter=t,i.optional&&e===void 0){if(i.default===null)return;e=i.default}let o=null,s=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),s=!0;else if(i.children)o=i.children.map((function(n){if(n._baseState.tag===`null_`)return n._encode(null,t,e);if(n._baseState.key===null)return t.error(`Child should have a key`);let r=t.enterKey(n._baseState.key);if(typeof e!=`object`)return t.error(`Child expected, but input is not object`);let i=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),i}),this).filter((function(e){return e})),o=this._createEncoderBuffer(o);else if(i.tag===`seqof`||i.tag===`setof`){if(!i.args||i.args.length!==1)return t.error(`Too many args for : `+i.tag);if(!Array.isArray(e))return t.error(`seqof/setof, but data is not Array`);let n=this.clone();n._baseState.implicit=null,o=this._createEncoderBuffer(e.map((function(n){let r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else i.use===null?(o=this._encodePrimitive(i.tag,e),s=!0):a=this._getUse(i.use,n)._encode(e,t);if(!i.any&&i.choice===null){let e=i.implicit===null?i.tag:i.implicit,n=i.implicit===null?`universal`:`context`;e===null?i.use===null&&t.error(`Tag could be omitted only for .use()`):i.use===null&&(a=this._encodeComposite(e,s,n,o))}return i.explicit!==null&&(a=this._encodeComposite(i.explicit,!1,`context`,a)),a},l.prototype._encodeChoice=function(e,t){let n=this._baseState,r=n.choice[e.type];return r||o(!1,e.type+` not found in `+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e===`objid`&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e===`objid`)return this._encodeObjid(t,null,null);if(e===`gentime`||e===`utctime`)return this._encodeTime(t,e);if(e===`null_`)return this._encodeNull();if(e===`int`||e===`enum`)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e===`bool`)return this._encodeBool(t);if(e===`objDesc`)return this._encodeStr(t,e);throw Error(`Unsupported tag: `+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,t,n){let r=e(`inherits`);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}n.Reporter=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){let r=this._reporterState;this.exitKey(e),r.obj!==null&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join(`/`)},i.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){let t,n=this._reporterState,r=e instanceof a;if(t=r?e:new a(n.path.map((function(e){return`[`+JSON.stringify(e)+`]`})).join(``),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},i.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(a,Error),a.prototype.rethrow=function(e){if(this.message=e+` at: `+(this.path||`(shallow)`),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:440}],176:[function(e,t,n){function r(e){let t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);let r=e[n];t[r]=n})),t}n.tagClass={0:`universal`,1:`application`,2:`context`,3:`private`},n.tagClassByName=r(n.tagClass),n.tag={0:`end`,1:`bool`,2:`int`,3:`bitstr`,4:`octstr`,5:`null_`,6:`objid`,7:`objDesc`,8:`external`,9:`real`,10:`enum`,11:`embed`,12:`utf8str`,13:`relativeOid`,16:`seq`,17:`set`,18:`numstr`,19:`printstr`,20:`t61str`,21:`videostr`,22:`ia5str`,23:`utctime`,24:`gentime`,25:`graphstr`,26:`iso646str`,27:`genstr`,28:`unistr`,29:`charstr`,30:`bmpstr`},n.tagByName=r(n.tag)},{}],177:[function(e,t,n){let r=n;r._reverse=function(e){let t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);let r=e[n];t[r]=n})),t},r.der=e(`./der`)},{"./der":176}],178:[function(e,t,n){let r=e(`inherits`),i=e(`bn.js`),a=e(`../base/buffer`).DecoderBuffer,o=e(`../base/node`),s=e(`../constants/der`);function c(e){this.enc=`der`,this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){o.call(this,`der`,e)}function u(e,t){let n=e.readUInt8(t);if(e.isError(n))return n;let r=s.tagClass[n>>6],i=(32&n)==0;if((31&n)==31){let r=n;for(n=0;(128&r)==128;){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:s.tag[n]}}function d(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&r===128)return null;if(!(128&r))return r;let i=127&r;if(i>4)return e.error(`length octect is too long`);r=0;for(let t=0;t=31?r.error(`Multi-octet tag encoding unsupported`):(t||(i|=32),i|=o.tagClassByName[n||`universal`]<<6,i)}(e,t,n,this.reporter);if(r.length<128){let e=i.alloc(2);return e[0]=a,e[1]=r.length,this._createEncoderBuffer([e,r])}let s=1;for(let e=r.length;e>=256;e>>=8)s++;let c=i.alloc(2+s);c[0]=a,c[1]=128|s;for(let e=1+s,t=r.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,r])},c.prototype._encodeStr=function(e,t){if(t===`bitstr`)return this._createEncoderBuffer([0|e.unused,e.data]);if(t===`bmpstr`){let t=i.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error(`Second objid identifier OOB`);e.splice(0,2,40*e[0]+e[1])}let r=0;for(let t=0;t=128;n>>=7)r++}let a=i.alloc(r),o=a.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(a[o--]=127&n;(n>>=7)>0;)a[o--]=128|127&n}return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){let n,r=new Date(e);return t===`gentime`?n=[l(r.getUTCFullYear()),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),`Z`].join(``):t===`utctime`?n=[l(r.getUTCFullYear()%100),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),`Z`].join(``):this.reporter.error(`Encoding `+t+` time is not supported yet`),this._encodeStr(n,`octstr`)},c.prototype._encodeNull=function(){return this._createEncoderBuffer(``)},c.prototype._encodeInt=function(e,t){if(typeof e==`string`){if(!t)return this.reporter.error(`String int or enum given, but no values map`);if(!t.hasOwnProperty(e))return this.reporter.error(`Values map doesn't contain: `+JSON.stringify(e));e=t[e]}if(typeof e!=`number`&&!i.isBuffer(e)){let t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;e.length===0&&t++;let n=i.alloc(t);return e.copy(n),e.length===0&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;let r=Array(n);for(let t=r.length-1;t>=0;t--)r[t]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(i.from(r))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return typeof e==`function`&&(e=e(t)),e._getEncoder(`der`).tree},c.prototype._skipDefault=function(e,t,n){let r=this._baseState,i;if(r.default===null)return!1;let a=e.join();if(r.defaultBuffer===void 0&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),a.length!==r.defaultBuffer.length)return!1;for(i=0;i=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||typeof e==`object`&&!!e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;(e=e.toString().replace(/\s+/g,``))[0]===`-`&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(n===`le`)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?``};var u=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`),d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var l=1;l>>26,d=67108863&c,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;u+=(o=(i=0|e.words[m])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[l]=0|d,c=0|u}return c===0?n.length--:n.words[l]=0|c,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,(e||=10)===16||e===`hex`){n=``;for(var i=0,a=0,o=0;o>>24-i&16777215)!=0||o!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,o--)}for(a!==0&&(n=a.toString(16)+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],p=f[e];n=``;var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?h+n:u[l-h.length]+h+n}for(this.isZero()&&(n=`0`+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}r(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=67108864*this.words[1]:this.length===3&&this.words[2]===1?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(o!==void 0),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,`byte array longer than desired length`),r(a>0,`Requested array length <= 0`),this.strip();var o,s,c=t===`le`,l=new e(a),u=this.clone();if(c){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),l[s]=o;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return!(8191&t)&&(n+=13,t>>>=13),!(127&t)&&(n+=7,t>>>=7),!(15&t)&&(n+=4,t>>>=4),!(3&t)&&(n+=2,t>>>=2),!(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e==`number`&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r(typeof e==`number`&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;i!==0&&a>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;a!==0&&o>26,this.words[o]=67108863&t;if(a===0&&o>>13,p=0|o[1],m=8191&p,h=p>>>13,g=0|o[2],_=8191&g,v=g>>>13,y=0|o[3],b=8191&y,x=y>>>13,S=0|o[4],C=8191&S,w=S>>>13,T=0|o[5],E=8191&T,D=T>>>13,O=0|o[6],k=8191&O,A=O>>>13,j=0|o[7],M=8191&j,N=j>>>13,ee=0|o[8],P=8191&ee,F=ee>>>13,te=0|o[9],I=8191&te,L=te>>>13,ne=0|s[0],R=8191&ne,z=ne>>>13,re=0|s[1],B=8191&re,V=re>>>13,ie=0|s[2],H=8191&ie,U=ie>>>13,ae=0|s[3],W=8191&ae,G=ae>>>13,oe=0|s[4],K=8191&oe,q=oe>>>13,se=0|s[5],J=8191&se,Y=se>>>13,ce=0|s[6],X=8191&ce,Z=ce>>>13,le=0|s[7],Q=8191&le,$=le>>>13,ue=0|s[8],de=8191&ue,fe=ue>>>13,pe=0|s[9],me=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(l+(r=Math.imul(d,R))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(f,R)|0))<<13)|0;l=((a=Math.imul(f,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(m,R),i=(i=Math.imul(m,z))+Math.imul(h,R)|0,a=Math.imul(h,z);var _e=(l+(r=r+Math.imul(d,B)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,B)|0))<<13)|0;l=((a=a+Math.imul(f,V)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(_,R),i=(i=Math.imul(_,z))+Math.imul(v,R)|0,a=Math.imul(v,z),r=r+Math.imul(m,B)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(h,B)|0,a=a+Math.imul(h,V)|0;var ve=(l+(r=r+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(f,H)|0))<<13)|0;l=((a=a+Math.imul(f,U)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,R),i=(i=Math.imul(b,z))+Math.imul(x,R)|0,a=Math.imul(x,z),r=r+Math.imul(_,B)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(v,B)|0,a=a+Math.imul(v,V)|0,r=r+Math.imul(m,H)|0,i=(i=i+Math.imul(m,U)|0)+Math.imul(h,H)|0,a=a+Math.imul(h,U)|0;var ye=(l+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,W)|0))<<13)|0;l=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(C,R),i=(i=Math.imul(C,z))+Math.imul(w,R)|0,a=Math.imul(w,z),r=r+Math.imul(b,B)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(x,B)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(_,H)|0,i=(i=i+Math.imul(_,U)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,U)|0,r=r+Math.imul(m,W)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(h,W)|0,a=a+Math.imul(h,G)|0;var be=(l+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,K)|0))<<13)|0;l=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,R),i=(i=Math.imul(E,z))+Math.imul(D,R)|0,a=Math.imul(D,z),r=r+Math.imul(C,B)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(w,B)|0,a=a+Math.imul(w,V)|0,r=r+Math.imul(b,H)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(x,H)|0,a=a+Math.imul(x,U)|0,r=r+Math.imul(_,W)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,G)|0,r=r+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(h,K)|0,a=a+Math.imul(h,q)|0;var xe=(l+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,J)|0))<<13)|0;l=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(k,R),i=(i=Math.imul(k,z))+Math.imul(A,R)|0,a=Math.imul(A,z),r=r+Math.imul(E,B)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(D,B)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(C,H)|0,i=(i=i+Math.imul(C,U)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,U)|0,r=r+Math.imul(b,W)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,G)|0,r=r+Math.imul(_,K)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,q)|0,r=r+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(h,J)|0,a=a+Math.imul(h,Y)|0;var Se=(l+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,X)|0))<<13)|0;l=((a=a+Math.imul(f,Z)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(M,R),i=(i=Math.imul(M,z))+Math.imul(N,R)|0,a=Math.imul(N,z),r=r+Math.imul(k,B)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(A,B)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(E,H)|0,i=(i=i+Math.imul(E,U)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,U)|0,r=r+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(w,W)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,Y)|0,r=r+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(h,X)|0,a=a+Math.imul(h,Z)|0;var Ce=(l+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,Q)|0))<<13)|0;l=((a=a+Math.imul(f,$)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(P,R),i=(i=Math.imul(P,z))+Math.imul(F,R)|0,a=Math.imul(F,z),r=r+Math.imul(M,B)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,B)|0,a=a+Math.imul(N,V)|0,r=r+Math.imul(k,H)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,U)|0,r=r+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,Z)|0,r=r+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(h,Q)|0,a=a+Math.imul(h,$)|0;var we=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;l=((a=a+Math.imul(f,fe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,R),i=(i=Math.imul(I,z))+Math.imul(L,R)|0,a=Math.imul(L,z),r=r+Math.imul(P,B)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(F,B)|0,a=a+Math.imul(F,V)|0,r=r+Math.imul(M,H)|0,i=(i=i+Math.imul(M,U)|0)+Math.imul(N,H)|0,a=a+Math.imul(N,U)|0,r=r+Math.imul(k,W)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,G)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,Y)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(x,X)|0,a=a+Math.imul(x,Z)|0,r=r+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,$)|0,r=r+Math.imul(m,de)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(h,de)|0,a=a+Math.imul(h,fe)|0;var Te=(l+(r=r+Math.imul(d,me)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(f,me)|0))<<13)|0;l=((a=a+Math.imul(f,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(I,B),i=(i=Math.imul(I,V))+Math.imul(L,B)|0,a=Math.imul(L,V),r=r+Math.imul(P,H)|0,i=(i=i+Math.imul(P,U)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,U)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,G)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,$)|0,r=r+Math.imul(_,de)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(v,de)|0,a=a+Math.imul(v,fe)|0;var Ee=(l+(r=r+Math.imul(m,me)|0)|0)+((8191&(i=(i=i+Math.imul(m,he)|0)+Math.imul(h,me)|0))<<13)|0;l=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(I,H),i=(i=Math.imul(I,U))+Math.imul(L,H)|0,a=Math.imul(L,U),r=r+Math.imul(P,W)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,G)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,q)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,$)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,fe)|0;var De=(l+(r=r+Math.imul(_,me)|0)|0)+((8191&(i=(i=i+Math.imul(_,he)|0)+Math.imul(v,me)|0))<<13)|0;l=((a=a+Math.imul(v,he)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,G))+Math.imul(L,W)|0,a=Math.imul(L,G),r=r+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(F,K)|0,a=a+Math.imul(F,q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,$)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,fe)|0;var Oe=(l+(r=r+Math.imul(b,me)|0)|0)+((8191&(i=(i=i+Math.imul(b,he)|0)+Math.imul(x,me)|0))<<13)|0;l=((a=a+Math.imul(x,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,q))+Math.imul(L,K)|0,a=Math.imul(L,q),r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,Y)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(N,X)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,$)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,fe)|0;var ke=(l+(r=r+Math.imul(C,me)|0)|0)+((8191&(i=(i=i+Math.imul(C,he)|0)+Math.imul(w,me)|0))<<13)|0;l=((a=a+Math.imul(w,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,Y))+Math.imul(L,J)|0,a=Math.imul(L,Y),r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(F,X)|0,a=a+Math.imul(F,Z)|0,r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,$)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,fe)|0;var Ae=(l+(r=r+Math.imul(E,me)|0)|0)+((8191&(i=(i=i+Math.imul(E,he)|0)+Math.imul(D,me)|0))<<13)|0;l=((a=a+Math.imul(D,he)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Z))+Math.imul(L,X)|0,a=Math.imul(L,Z),r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(F,Q)|0,a=a+Math.imul(F,$)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,fe)|0;var je=(l+(r=r+Math.imul(k,me)|0)|0)+((8191&(i=(i=i+Math.imul(k,he)|0)+Math.imul(A,me)|0))<<13)|0;l=((a=a+Math.imul(A,he)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,$))+Math.imul(L,Q)|0,a=Math.imul(L,$),r=r+Math.imul(P,de)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(F,de)|0,a=a+Math.imul(F,fe)|0;var Me=(l+(r=r+Math.imul(M,me)|0)|0)+((8191&(i=(i=i+Math.imul(M,he)|0)+Math.imul(N,me)|0))<<13)|0;l=((a=a+Math.imul(N,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(I,de),i=(i=Math.imul(I,fe))+Math.imul(L,de)|0,a=Math.imul(L,fe);var Ne=(l+(r=r+Math.imul(P,me)|0)|0)+((8191&(i=(i=i+Math.imul(P,he)|0)+Math.imul(F,me)|0))<<13)|0;l=((a=a+Math.imul(F,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(r=Math.imul(I,me))|0)+((8191&(i=(i=Math.imul(I,he))+Math.imul(L,me)|0))<<13)|0;return l=((a=Math.imul(L,he))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,c[0]=ge,c[1]=_e,c[2]=ve,c[3]=ye,c[4]=be,c[5]=xe,c[6]=Se,c[7]=Ce,c[8]=we,c[9]=Te,c[10]=Ee,c[11]=De,c[12]=Oe,c[13]=ke,c[14]=Ae,c[15]=je,c[16]=Me,c[17]=Ne,c[18]=Pe,l!==0&&(c[19]=l,n.length++),n};function h(e,t,n){return new g().mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=p),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return this.length===10&&e.length===10?m(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n.strip()}(this,e,t):h(this,e,t)},g.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return t!==0&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),n=0;n>>i}return t}(e);if(t.length===0)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(n!==0){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(i!==0){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(u!==0||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(this.negative===0),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r(typeof e==`number`),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(s===0)return this.strip();for(r(s===-1),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];(n=26-this._countBits(o))!=0&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if(t!==`mod`){(s=new a(null)).length=c+1,s.words=Array(s.length);for(var l=0;l=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)==0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o});var i,o,s},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)==0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(n.words[0]&h)==0&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i,o=new a(1),s=new a(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;(t.words[0]&u)==0&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;(n.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=t.cmpn(1)===0?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e==`number`);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t,n=e<0;if(this.negative!==0&&!n)return-1;if(this.negative===0&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,`Number is too big`);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new C(e)},a.prototype.toRed=function(e){return r(!this.red,`Already a number in reduction context`),r(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}function b(){v.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}function x(){v.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}function S(){v.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}function C(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}function w(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength();while(t>this.n);var r=t0?n.isub(this.p):n.strip===void 0?n._strip():n.strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,i===0&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(_[e])return _[e];var t;if(e===`k256`)t=new y;else if(e===`p224`)t=new b;else if(e===`p192`)t=new x;else{if(e!==`p25519`)throw Error(`Unknown prime `+e);t=new S}return _[e]=t,t},C.prototype._verify1=function(e){r(e.negative===0,`red works only with positives`),r(e.red,`red works only with red numbers`)},C.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,`red works only with positives`),r(e.red&&e.red===t.red,`red works only with red numbers`)},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),t===3){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();r(g=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;i!==n[0]&&(i=this.sqr(i)),d!==0||o!==0?(o<<=1,o|=d,(++s===4||r===0&&u===0)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}c=26}return i},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new w(e)},i(w,C),w.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},w.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},w.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},w.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},w.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t)},{buffer:188}],185:[function(e,t,n){n.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=l(e),o=r[0],s=r[1],c=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),u=0,d=s>0?o-4:o;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return s===2&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,c[u++]=255&t),s===1&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;os?s:o+16383));return i===1?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+`==`)):i===2&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+`=`)),a.join(``)};for(var r=[],i=[],a=typeof Uint8Array<`u`?Uint8Array:Array,o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,s=0,c=o.length;s0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);return n===-1&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join(``)}i[45]=62,i[95]=63},{}],186:[function(e,t,n){(function(t,n){function r(e,t){if(!e)throw Error(t||`Assertion failed`)}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&(t!==`le`&&t!==`be`||(n=t,t=10),this._init(e||0,t||10,n||`be`))}var o;typeof t==`object`?t.exports=a:(void 0).BN=a,a.BN=a,a.wordSize=26;try{o=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:e(`buffer`).Buffer}catch{}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,`Invalid character in `+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),c=t;c=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&o0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;(e=e.toString().replace(/\s+/g,``))[0]===`-`&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(n===`le`)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<`u`&&typeof Symbol.for==`function`)try{a.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=d}catch{a.prototype.inspect=d}else a.prototype.inspect=d;function d(){return(this.red?``}var f=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`),p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){var n;if(t=0|t||1,(e||=10)===16||e===`hex`){n=``;for(var i=0,a=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=a!==0||o!==this.length-1?f[6-c.length]+c+n:c+n}for(a!==0&&(n=a.toString(16)+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],u=m[e];n=``;var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(u).toString(e);n=(d=d.idivn(u)).isZero()?h+n:f[l-h.length]+h+n}for(this.isZero()&&(n=`0`+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}r(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=67108864*this.words[1]:this.length===3&&this.words[2]===1?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var l=1;l>>26,d=67108863&c,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;u+=(o=(i=0|e.words[m])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[l]=0|d,c=0|u}return c===0?n.length--:n.words[l]=0|c,n._strip()}a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,`byte array longer than desired length`),r(a>0,`Requested array length <= 0`);var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this[`_toArrayLike`+(t===`le`?`LE`:`BE`)](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),a===6?(n>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),a===6?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return!(8191&t)&&(n+=13,t>>>=13),!(127&t)&&(n+=7,t>>>=7),!(15&t)&&(n+=4,t>>>=4),!(3&t)&&(n+=2,t>>>=2),!(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e==`number`&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r(typeof e==`number`&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;i!==0&&a>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;a!==0&&o>26,this.words[o]=67108863&t;if(a===0&&o>>13,p=0|o[1],m=8191&p,h=p>>>13,g=0|o[2],_=8191&g,v=g>>>13,y=0|o[3],b=8191&y,x=y>>>13,S=0|o[4],C=8191&S,w=S>>>13,T=0|o[5],E=8191&T,D=T>>>13,O=0|o[6],k=8191&O,A=O>>>13,j=0|o[7],M=8191&j,N=j>>>13,ee=0|o[8],P=8191&ee,F=ee>>>13,te=0|o[9],I=8191&te,L=te>>>13,ne=0|s[0],R=8191&ne,z=ne>>>13,re=0|s[1],B=8191&re,V=re>>>13,ie=0|s[2],H=8191&ie,U=ie>>>13,ae=0|s[3],W=8191&ae,G=ae>>>13,oe=0|s[4],K=8191&oe,q=oe>>>13,se=0|s[5],J=8191&se,Y=se>>>13,ce=0|s[6],X=8191&ce,Z=ce>>>13,le=0|s[7],Q=8191&le,$=le>>>13,ue=0|s[8],de=8191&ue,fe=ue>>>13,pe=0|s[9],me=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(l+(r=Math.imul(d,R))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(f,R)|0))<<13)|0;l=((a=Math.imul(f,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(m,R),i=(i=Math.imul(m,z))+Math.imul(h,R)|0,a=Math.imul(h,z);var _e=(l+(r=r+Math.imul(d,B)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,B)|0))<<13)|0;l=((a=a+Math.imul(f,V)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(_,R),i=(i=Math.imul(_,z))+Math.imul(v,R)|0,a=Math.imul(v,z),r=r+Math.imul(m,B)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(h,B)|0,a=a+Math.imul(h,V)|0;var ve=(l+(r=r+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(f,H)|0))<<13)|0;l=((a=a+Math.imul(f,U)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,R),i=(i=Math.imul(b,z))+Math.imul(x,R)|0,a=Math.imul(x,z),r=r+Math.imul(_,B)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(v,B)|0,a=a+Math.imul(v,V)|0,r=r+Math.imul(m,H)|0,i=(i=i+Math.imul(m,U)|0)+Math.imul(h,H)|0,a=a+Math.imul(h,U)|0;var ye=(l+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,W)|0))<<13)|0;l=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(C,R),i=(i=Math.imul(C,z))+Math.imul(w,R)|0,a=Math.imul(w,z),r=r+Math.imul(b,B)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(x,B)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(_,H)|0,i=(i=i+Math.imul(_,U)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,U)|0,r=r+Math.imul(m,W)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(h,W)|0,a=a+Math.imul(h,G)|0;var be=(l+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,K)|0))<<13)|0;l=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,R),i=(i=Math.imul(E,z))+Math.imul(D,R)|0,a=Math.imul(D,z),r=r+Math.imul(C,B)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(w,B)|0,a=a+Math.imul(w,V)|0,r=r+Math.imul(b,H)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(x,H)|0,a=a+Math.imul(x,U)|0,r=r+Math.imul(_,W)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,G)|0,r=r+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(h,K)|0,a=a+Math.imul(h,q)|0;var xe=(l+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,J)|0))<<13)|0;l=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(k,R),i=(i=Math.imul(k,z))+Math.imul(A,R)|0,a=Math.imul(A,z),r=r+Math.imul(E,B)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(D,B)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(C,H)|0,i=(i=i+Math.imul(C,U)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,U)|0,r=r+Math.imul(b,W)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,G)|0,r=r+Math.imul(_,K)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,q)|0,r=r+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(h,J)|0,a=a+Math.imul(h,Y)|0;var Se=(l+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,X)|0))<<13)|0;l=((a=a+Math.imul(f,Z)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(M,R),i=(i=Math.imul(M,z))+Math.imul(N,R)|0,a=Math.imul(N,z),r=r+Math.imul(k,B)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(A,B)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(E,H)|0,i=(i=i+Math.imul(E,U)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,U)|0,r=r+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(w,W)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,Y)|0,r=r+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(h,X)|0,a=a+Math.imul(h,Z)|0;var Ce=(l+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,Q)|0))<<13)|0;l=((a=a+Math.imul(f,$)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(P,R),i=(i=Math.imul(P,z))+Math.imul(F,R)|0,a=Math.imul(F,z),r=r+Math.imul(M,B)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,B)|0,a=a+Math.imul(N,V)|0,r=r+Math.imul(k,H)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,U)|0,r=r+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,Z)|0,r=r+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(h,Q)|0,a=a+Math.imul(h,$)|0;var we=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;l=((a=a+Math.imul(f,fe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,R),i=(i=Math.imul(I,z))+Math.imul(L,R)|0,a=Math.imul(L,z),r=r+Math.imul(P,B)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(F,B)|0,a=a+Math.imul(F,V)|0,r=r+Math.imul(M,H)|0,i=(i=i+Math.imul(M,U)|0)+Math.imul(N,H)|0,a=a+Math.imul(N,U)|0,r=r+Math.imul(k,W)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,G)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,Y)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(x,X)|0,a=a+Math.imul(x,Z)|0,r=r+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,$)|0,r=r+Math.imul(m,de)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(h,de)|0,a=a+Math.imul(h,fe)|0;var Te=(l+(r=r+Math.imul(d,me)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(f,me)|0))<<13)|0;l=((a=a+Math.imul(f,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(I,B),i=(i=Math.imul(I,V))+Math.imul(L,B)|0,a=Math.imul(L,V),r=r+Math.imul(P,H)|0,i=(i=i+Math.imul(P,U)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,U)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,G)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,$)|0,r=r+Math.imul(_,de)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(v,de)|0,a=a+Math.imul(v,fe)|0;var Ee=(l+(r=r+Math.imul(m,me)|0)|0)+((8191&(i=(i=i+Math.imul(m,he)|0)+Math.imul(h,me)|0))<<13)|0;l=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(I,H),i=(i=Math.imul(I,U))+Math.imul(L,H)|0,a=Math.imul(L,U),r=r+Math.imul(P,W)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,G)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,q)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,$)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,fe)|0;var De=(l+(r=r+Math.imul(_,me)|0)|0)+((8191&(i=(i=i+Math.imul(_,he)|0)+Math.imul(v,me)|0))<<13)|0;l=((a=a+Math.imul(v,he)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,G))+Math.imul(L,W)|0,a=Math.imul(L,G),r=r+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(F,K)|0,a=a+Math.imul(F,q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,$)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,fe)|0;var Oe=(l+(r=r+Math.imul(b,me)|0)|0)+((8191&(i=(i=i+Math.imul(b,he)|0)+Math.imul(x,me)|0))<<13)|0;l=((a=a+Math.imul(x,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,q))+Math.imul(L,K)|0,a=Math.imul(L,q),r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,Y)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(N,X)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,$)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,fe)|0;var ke=(l+(r=r+Math.imul(C,me)|0)|0)+((8191&(i=(i=i+Math.imul(C,he)|0)+Math.imul(w,me)|0))<<13)|0;l=((a=a+Math.imul(w,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,Y))+Math.imul(L,J)|0,a=Math.imul(L,Y),r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(F,X)|0,a=a+Math.imul(F,Z)|0,r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,$)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,fe)|0;var Ae=(l+(r=r+Math.imul(E,me)|0)|0)+((8191&(i=(i=i+Math.imul(E,he)|0)+Math.imul(D,me)|0))<<13)|0;l=((a=a+Math.imul(D,he)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Z))+Math.imul(L,X)|0,a=Math.imul(L,Z),r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(F,Q)|0,a=a+Math.imul(F,$)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,fe)|0;var je=(l+(r=r+Math.imul(k,me)|0)|0)+((8191&(i=(i=i+Math.imul(k,he)|0)+Math.imul(A,me)|0))<<13)|0;l=((a=a+Math.imul(A,he)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,$))+Math.imul(L,Q)|0,a=Math.imul(L,$),r=r+Math.imul(P,de)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(F,de)|0,a=a+Math.imul(F,fe)|0;var Me=(l+(r=r+Math.imul(M,me)|0)|0)+((8191&(i=(i=i+Math.imul(M,he)|0)+Math.imul(N,me)|0))<<13)|0;l=((a=a+Math.imul(N,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(I,de),i=(i=Math.imul(I,fe))+Math.imul(L,de)|0,a=Math.imul(L,fe);var Ne=(l+(r=r+Math.imul(P,me)|0)|0)+((8191&(i=(i=i+Math.imul(P,he)|0)+Math.imul(F,me)|0))<<13)|0;l=((a=a+Math.imul(F,he)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(r=Math.imul(I,me))|0)+((8191&(i=(i=Math.imul(I,he))+Math.imul(L,me)|0))<<13)|0;return l=((a=Math.imul(L,he))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,c[0]=ge,c[1]=_e,c[2]=ve,c[3]=ye,c[4]=be,c[5]=xe,c[6]=Se,c[7]=Ce,c[8]=we,c[9]=Te,c[10]=Ee,c[11]=De,c[12]=Oe,c[13]=ke,c[14]=Ae,c[15]=je,c[16]=Me,c[17]=Ne,c[18]=Pe,l!==0&&(c[19]=l,n.length++),n};function _(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n._strip()}function v(e,t,n){return _(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=h),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return this.length===10&&e.length===10?g(this,e,t):n<63?h(this,e,t):n<1024?_(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return n!==0&&(this.words[i]=n,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(t.length===0)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(n!==0){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(i!==0){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(u!==0||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(this.negative===0),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r(typeof e==`number`),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(s===0)return this._strip();for(r(s===-1),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];(n=26-this._countBits(o))!=0&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if(t!==`mod`){(s=new a(null)).length=c+1,s.words=Array(s.length);for(var l=0;l=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s._strip(),r._strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)==0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o});var i,o,s},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)==0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(n.words[0]&h)==0&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i,o=new a(1),s=new a(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;(t.words[0]&u)==0&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;(n.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=t.cmpn(1)===0?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e==`number`);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t,n=e<0;if(this.negative!==0&&!n)return-1;if(this.negative===0&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,`Number is too big`);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return r(!this.red,`Already a number in reduction context`),r(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){x.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}function C(){x.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}function w(){x.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}function T(){x.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}function E(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}function D(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength();while(t>this.n);var r=t0?n.isub(this.p):n.strip===void 0?n._strip():n.strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(S,x),S.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,i===0&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if(e===`k256`)t=new S;else if(e===`p224`)t=new C;else if(e===`p192`)t=new w;else{if(e!==`p25519`)throw Error(`Unknown prime `+e);t=new T}return b[e]=t,t},E.prototype._verify1=function(e){r(e.negative===0,`red works only with positives`),r(e.red,`red works only with red numbers`)},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,`red works only with positives`),r(e.red&&e.red===t.red,`red works only with red numbers`)},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),t===3){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();r(g=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;i!==n[0]&&(i=this.sqr(i)),d!==0||o!==0?(o<<=1,o|=d,(++s===4||r===0&&u===0)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new D(e)},i(D,E),D.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},D.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},D.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},D.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},D.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t)},{buffer:188}],187:[function(e,t,n){var r;function i(e){this.rand=e}if(t.exports=function(e){return r||=new i(null),r.generate(e)},t.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n>>24]^u[m>>>16&255]^d[h>>>8&255]^f[255&g]^t[_++],o=l[m>>>24]^u[h>>>16&255]^d[g>>>8&255]^f[255&p]^t[_++],s=l[h>>>24]^u[g>>>16&255]^d[p>>>8&255]^f[255&m]^t[_++],c=l[g>>>24]^u[p>>>16&255]^d[m>>>8&255]^f[255&h]^t[_++],p=a,m=o,h=s,g=c;return a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[h>>>8&255]<<8|r[255&g])^t[_++],o=(r[m>>>24]<<24|r[h>>>16&255]<<16|r[g>>>8&255]<<8|r[255&p])^t[_++],s=(r[h>>>24]<<24|r[g>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[_++],c=(r[g>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&h])^t[_++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],a=[[],[],[],[]],o=0,s=0,c=0;c<256;++c){var l=s^s<<1^s<<2^s<<3^s<<4;l=l>>>8^255&l^99,n[o]=l,r[l]=o;var u=e[o],d=e[u],f=e[d],p=257*e[l]^16843008*l;i[0][o]=p<<24|p>>>8,i[1][o]=p<<16|p>>>16,i[2][o]=p<<8|p>>>24,i[3][o]=p,p=16843009*f^65537*d^257*u^16843008*o,a[0][l]=p<<24|p>>>8,a[1][l]=p<<16|p>>>16,a[2][l]=p<<8|p>>>24,a[3][l]=p,o===0?o=s=1:(o=u^e[e[e[f^u]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:a}}();function l(e){this._key=i(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],a=0;a>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=s[a/t|0]<<24):t>6&&a%t==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),i[a]=i[a-t]^o}for(var l=[],u=0;u>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return o(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},l.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=o(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),a=r.allocUnsafe(16);return a.writeUInt32BE(n[0],0),a.writeUInt32BE(n[3],4),a.writeUInt32BE(n[2],8),a.writeUInt32BE(n[1],12),a},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=l},{"safe-buffer":494}],190:[function(e,t,n){var r=e(`./aes`),i=e(`safe-buffer`).Buffer,a=e(`cipher-base`),o=e(`inherits`),s=e(`./ghash`),c=e(`buffer-xor`),l=e(`./incr32`);function u(e,t,n,o){a.call(this);var c=i.alloc(4,0);this._cipher=new r.AES(t);var u=this._cipher.encryptBlock(c);this._ghash=new s(u),n=function(e,t,n){if(t.length===12)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var r=new s(n),a=t.length,o=a%16;r.update(t),o&&(o=16-o,r.update(i.alloc(o,0))),r.update(i.alloc(8,0));var c=8*a,u=i.alloc(8);u.writeUIntBE(c,0,8),r.update(u),e._finID=r.state;var d=i.from(e._finID);return l(d),d}(this,n,u),this._prev=i.from(n),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(u,a),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw Error(`Unsupported state or unable to authenticate data`);var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),i=0;i16)throw Error(`unable to decrypt data`);for(var n=-1;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},n.createDecipher=function(e,t){var n=a[e.toLowerCase()];if(!n)throw TypeError(`invalid suite type`);var r=l(t,!1,n.key,n.iv);return f(e,r.key,r.iv)},n.createDecipheriv=f},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,t,n){var r=e(`./modes`),i=e(`./authCipher`),a=e(`safe-buffer`).Buffer,o=e(`./streamCipher`),s=e(`cipher-base`),c=e(`./aes`),l=e(`evp_bytestokey`);function u(e,t,n){s.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=a.from(n),this._mode=e,this._autopadding=!0}e(`inherits`)(u,s),u.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return a.concat(r)};var d=a.alloc(16,16);function f(){this.cache=a.allocUnsafe(0)}function p(e,t,n){var s=r[e.toLowerCase()];if(!s)throw TypeError(`invalid suite type`);if(typeof t==`string`&&(t=a.from(t)),t.length!==s.key/8)throw TypeError(`invalid key length `+t.length);if(typeof n==`string`&&(n=a.from(n)),s.mode!==`GCM`&&n.length!==s.iv)throw TypeError(`invalid iv length `+n.length);return s.type===`stream`?new o(s.module,t,n):s.type===`auth`?new i(s.module,t,n):new u(s.module,t,n)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),Error(`data not multiple of block length`)},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=a.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),n=-1;++n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]>>>=1,n&&(r[0]^=225<<24)}this.state=a(i)},o.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":494}],195:[function(e,t,n){t.exports=function(e){for(var t,n=e.length;n--;){if((t=e.readUInt8(n))!==255){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},{}],196:[function(e,t,n){var r=e(`buffer-xor`);n.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;return e._prev=t,r(e._cipher.decryptBlock(t),n)}},{"buffer-xor":219}],197:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`buffer-xor`);function a(e,t,n){var a=t.length,o=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=r.concat([e._prev,n?t:o]),o}n.encrypt=function(e,t,n){for(var i,o=r.allocUnsafe(0);t.length;){if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){o=r.concat([o,a(e,t,n)]);break}i=e._cache.length,o=r.concat([o,a(e,t.slice(0,i),n)]),t=t.slice(i)}return o}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,t,n){var r=e(`safe-buffer`).Buffer;function i(e,t,n){for(var r,i,o=-1,s=0;++o<8;)r=t&1<<7-o?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^r))>>o%8,e._prev=a(e._prev,n?r:i);return s}function a(e,t){var n=e.length,i=-1,a=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i>7;return a}n.encrypt=function(e,t,n){for(var a=t.length,o=r.allocUnsafe(a),s=-1;++s=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var i=function(e){var t=a(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),s=new r(e).mul(i.blinder).umod(t.modulus),c=s.toRed(r.mont(t.prime1)),l=s.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,f=t.prime2,p=c.redPow(t.exponent1).fromRed(),m=l.redPow(t.exponent2).fromRed(),h=p.isub(m).imul(u).umod(d).imul(f);return m.iadd(h).imul(i.unblinder).umod(t.modulus).toArrayLike(n,`be`,o)}o.getr=a,t.exports=o}).call(this)}).call(this,e(`buffer`).Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,t,n){t.exports=e(`./browser/algorithms.json`)},{"./browser/algorithms.json":211}],211:[function(e,t,n){t.exports={sha224WithRSAEncryption:{sign:`rsa`,hash:`sha224`,id:`302d300d06096086480165030402040500041c`},"RSA-SHA224":{sign:`ecdsa/rsa`,hash:`sha224`,id:`302d300d06096086480165030402040500041c`},sha256WithRSAEncryption:{sign:`rsa`,hash:`sha256`,id:`3031300d060960864801650304020105000420`},"RSA-SHA256":{sign:`ecdsa/rsa`,hash:`sha256`,id:`3031300d060960864801650304020105000420`},sha384WithRSAEncryption:{sign:`rsa`,hash:`sha384`,id:`3041300d060960864801650304020205000430`},"RSA-SHA384":{sign:`ecdsa/rsa`,hash:`sha384`,id:`3041300d060960864801650304020205000430`},sha512WithRSAEncryption:{sign:`rsa`,hash:`sha512`,id:`3051300d060960864801650304020305000440`},"RSA-SHA512":{sign:`ecdsa/rsa`,hash:`sha512`,id:`3051300d060960864801650304020305000440`},"RSA-SHA1":{sign:`rsa`,hash:`sha1`,id:`3021300906052b0e03021a05000414`},"ecdsa-with-SHA1":{sign:`ecdsa`,hash:`sha1`,id:``},sha256:{sign:`ecdsa`,hash:`sha256`,id:``},sha224:{sign:`ecdsa`,hash:`sha224`,id:``},sha384:{sign:`ecdsa`,hash:`sha384`,id:``},sha512:{sign:`ecdsa`,hash:`sha512`,id:``},"DSA-SHA":{sign:`dsa`,hash:`sha1`,id:``},"DSA-SHA1":{sign:`dsa`,hash:`sha1`,id:``},DSA:{sign:`dsa`,hash:`sha1`,id:``},"DSA-WITH-SHA224":{sign:`dsa`,hash:`sha224`,id:``},"DSA-SHA224":{sign:`dsa`,hash:`sha224`,id:``},"DSA-WITH-SHA256":{sign:`dsa`,hash:`sha256`,id:``},"DSA-SHA256":{sign:`dsa`,hash:`sha256`,id:``},"DSA-WITH-SHA384":{sign:`dsa`,hash:`sha384`,id:``},"DSA-SHA384":{sign:`dsa`,hash:`sha384`,id:``},"DSA-WITH-SHA512":{sign:`dsa`,hash:`sha512`,id:``},"DSA-SHA512":{sign:`dsa`,hash:`sha512`,id:``},"DSA-RIPEMD160":{sign:`dsa`,hash:`rmd160`,id:``},ripemd160WithRSA:{sign:`rsa`,hash:`rmd160`,id:`3021300906052b2403020105000414`},"RSA-RIPEMD160":{sign:`rsa`,hash:`rmd160`,id:`3021300906052b2403020105000414`},md5WithRSAEncryption:{sign:`rsa`,hash:`md5`,id:`3020300c06082a864886f70d020505000410`},"RSA-MD5":{sign:`rsa`,hash:`md5`,id:`3020300c06082a864886f70d020505000410`}}},{}],212:[function(e,t,n){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`}},{}],213:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`create-hash`),a=e(`readable-stream`),o=e(`inherits`),s=e(`./sign`),c=e(`./verify`),l=e(`./algorithms.json`);function u(e){a.Writable.call(this);var t=l[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){a.Writable.call(this);var t=l[e];if(!t)throw Error(`Unknown message digest`);this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new u(e)}function p(e){return new d(e)}Object.keys(l).forEach((function(e){l[e].id=r.from(l[e].id,`hex`),l[e.toLowerCase()]=l[e]})),o(u,a.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return typeof e==`string`&&(e=r.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var n=s(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(d,a.Writable),d.prototype._write=function(e,t,n){this._hash.update(e),n()},d.prototype.update=function(e,t){return typeof e==`string`&&(e=r.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,n){typeof t==`string`&&(t=r.from(t,n)),this.end();var i=this._hash.digest();return c(t,i,e,this._signType,this._tag)},t.exports={Sign:f,Verify:p,createSign:f,createVerify:p}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`create-hmac`),a=e(`browserify-rsa`),o=e(`elliptic`).ec,s=e(`bn.js`),c=e(`parse-asn1`),l=e(`./curves.json`);function u(e,t,n,a){if((e=r.from(e.toArray())).length0&&n.ishrn(r),n}function f(e,t,n){var a,o;do{for(a=r.alloc(0);8*a.length=t)throw Error(`invalid sig`)}t.exports=function(e,t,n,l,u){var d=o(n);if(d.type===`ec`){if(l!==`ecdsa`&&l!==`ecdsa/rsa`)throw Error(`wrong public key type`);return function(e,t,n){var r=s[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var i=new a(r),o=n.data.subjectPrivateKey.data;return i.verify(t,e,o)}(e,t,d)}if(d.type===`dsa`){if(l!==`dsa`)throw Error(`wrong public key type`);return function(e,t,n){var r=n.data.p,a=n.data.q,s=n.data.g,l=n.data.pub_key,u=o.signature.decode(e,`der`),d=u.s,f=u.r;c(d,a),c(f,a);var p=i.mont(r),m=d.invm(a);return s.toRed(p).redPow(new i(t).mul(m).mod(a)).fromRed().mul(l.toRed(p).redPow(f.mul(m).mod(a)).fromRed()).mod(r).mod(a).cmp(f)===0}(e,t,d)}if(l!==`rsa`&&l!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=r.concat([u,t]);for(var f=d.modulus.byteLength(),p=[1],m=0;t.length+p.length+2>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,`�`}}(this,e);return n===void 0?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length)):n}function c(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function u(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):``}n.StringDecoder=a,a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if((t=this.fillLast(e))===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":217}],219:[function(e,t,n){(function(e){(function(){t.exports=function(t,n){for(var r=Math.min(t.length,n.length),i=new e(r),a=0;a2147483647)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(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 c(e)}return o(e,t,n)}function o(e,t,n){if(typeof e==`string`)return function(e,t){if(typeof t==`string`&&t!==``||(t=`utf8`),!a.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=0|d(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return l(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(I(e,ArrayBuffer)||e&&I(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=2147483647)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes`);return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||I(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&&!0===arguments[2];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 P(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return 2*n;case`hex`:return n>>>1;case`base64`:return F(e).length;default:if(i)return r?-1:P(e).length;t=(``+t).toLowerCase(),i=!0}}function f(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))return``;for(e||=`utf8`;;)switch(e){case`hex`:return E(this,t,n);case`utf8`:case`utf-8`:return C(this,t,n);case`ascii`:return w(this,t,n);case`latin1`:case`binary`:return T(this,t,n);case`base64`:return S(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return D(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(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),L(n=+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)return-1;n=0}if(typeof t==`string`&&(t=a.from(t,r)),a.isBuffer(t))return t.length===0?-1:h(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):h(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function h(e,t,n,r,i){var a,o=1,s=e.length,c=t.length;if(r!==void 0&&((r=String(r).toLowerCase())===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function l(e,t){return o===1?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=n;as&&(n=s-c),a=n;a>=0;a--){for(var d=!0,f=0;fi&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function S(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:(192&(a=e[i+1]))==128&&(c=(31&l)<<6|63&a)>127&&(u=c);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(c=(15&l)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}u===null?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r`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."),Object.defineProperty(a.prototype,`parent`,{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,`offset`,{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),typeof Symbol<`u`&&Symbol.species!=null&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return o(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0||t===void 0?i(e):typeof n==`string`?i(e).fill(t,n):i(e).fill(t)}(e,t,n)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return e!=null&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(I(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),I(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.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,o=Math.min(n,r);it&&(e+=` ... `),``},a.prototype.compare=function(e,t,n,r,i){if(I(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.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(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),c=Math.min(o,s),l=this.slice(r,i),u=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0)}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 g(this,e,t,n);case`utf8`:case`utf-8`:return _(this,e,t,n);case`ascii`:return v(this,e,t,n);case`latin1`:case`binary`:return y(this,e,t,n);case`base64`:return b(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return x(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function w(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i=``,a=t;an)throw RangeError(`Trying to access beyond buffer length`)}function k(e,t,n,r,i,o){if(!a.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||te.length)throw RangeError(`Index out of range`)}function A(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function j(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function M(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=t===void 0?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=2**(8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=2**(8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||k(this,e,t,n,2**(8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r)||k(this,e,t,n,2**(8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);k(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);k(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--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},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(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]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.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=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=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},a.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`&&!a.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);if(t<0||this.length>>=0,n=n===void 0?this.length:n>>>0,e||=0,typeof e==`number`)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}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=65536+(i-55296<<10|n-56320)}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,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw Error(`Invalid code point`);if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function F(e){return t.toByteArray(function(e){if((e=(e=e.split(`=`)[0]).trim().replace(N,``)).length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}(e))}function te(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function I(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function L(e){return e!=e}}).call(this)}).call(this,e(`buffer`).Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`stream`).Transform,a=e(`string_decoder`).StringDecoder;function o(e){i.call(this),this.hashMode=typeof e==`string`,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&=(this.__final=this._final,null),this._decoder=null,this._encoding=null}e(`inherits`)(o,i),o.prototype.update=function(e,t,n){typeof e==`string`&&(e=r.from(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw Error(`trying to get auth tag in unsupported state`)},o.prototype.setAuthTag=function(){throw Error(`trying to set auth tag in unsupported state`)},o.prototype.setAAD=function(){throw Error(`trying to set aad in unsupported state`)},o.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw Error(`can't switch encodings`);var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},t.exports=o},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,t,n){var r=e(`../internals/is-callable`),i=e(`../internals/try-to-string`),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a function`)}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,t,n){var r=e(`../internals/is-constructor`),i=e(`../internals/try-to-string`),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a constructor`)}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,t,n){var r=e(`../internals/is-callable`),i=String,a=TypeError;t.exports=function(e){if(typeof e==`object`||r(e))return e;throw new a(`Can't set `+i(e)+` as a prototype`)}},{"../internals/is-callable":285}],225:[function(e,t,n){var r=e(`../internals/well-known-symbol`),i=e(`../internals/object-create`),a=e(`../internals/object-define-property`).f,o=r(`unscopables`),s=Array.prototype;s[o]===void 0&&a(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,t,n){var r=e(`../internals/object-is-prototype-of`),i=TypeError;t.exports=function(e,t){if(r(t,e))return e;throw new i(`Incorrect invocation`)}},{"../internals/object-is-prototype-of":314}],227:[function(e,t,n){var r=e(`../internals/is-object`),i=String,a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not an object`)}},{"../internals/is-object":289}],228:[function(e,t,n){var r=e(`../internals/to-indexed-object`),i=e(`../internals/to-absolute-index`),a=e(`../internals/length-of-array-like`),o=function(e){return function(t,n,o){var s,c=r(t),l=a(c),u=i(o,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,t,n){var r=e(`../internals/function-bind-context`),i=e(`../internals/function-uncurry-this`),a=e(`../internals/indexed-object`),o=e(`../internals/to-object`),s=e(`../internals/length-of-array-like`),c=e(`../internals/array-species-create`),l=i([].push),u=function(e){var t=e===1,n=e===2,i=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g,_){for(var v,y,b=o(m),x=a(b),S=r(h,g),C=s(x),w=0,T=_||c,E=t?T(m,C):n||f?T(m,0):void 0;C>w;w++)if((p||w in x)&&(y=S(v=x[w],w,b),e))if(t)E[w]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:l(E,v)}else switch(e){case 4:return!1;case 7:l(E,v)}return d?-1:i||u?u:E}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,t,n){var r=e(`../internals/to-absolute-index`),i=e(`../internals/length-of-array-like`),a=e(`../internals/create-property`),o=Array,s=Math.max;t.exports=function(e,t,n){for(var c=i(e),l=r(t,c),u=r(n===void 0?c:n,c),d=o(s(u-l,0)),f=0;l0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,t,n){t.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]},{}],259:[function(e,t,n){var r=e(`../internals/global`),i=e(`../internals/object-get-own-property-descriptor`).f,a=e(`../internals/create-non-enumerable-property`),o=e(`../internals/define-built-in`),s=e(`../internals/define-global-property`),c=e(`../internals/copy-constructor-properties`),l=e(`../internals/is-forced`);t.exports=function(e,t){var n,u,d,f,p,m=e.target,h=e.global,g=e.stat;if(n=h?r:g?r[m]||s(m,{}):(r[m]||{}).prototype)for(u in t){if(f=t[u],d=e.dontCallGetSet?(p=i(n,u))&&p.value:n[u],!l(h?u:m+(g?`.`:`#`)+u,e.forced)&&d!==void 0){if(typeof f==typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&a(f,`sham`,!0),o(n,u,f,e)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,t,n){t.exports=function(e){try{return!!e()}catch{return!0}}},{}],261:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype,a=i.apply,o=i.call;t.exports=typeof Reflect==`object`&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,t,n){var r=e(`../internals/function-uncurry-this-clause`),i=e(`../internals/a-callable`),a=e(`../internals/function-bind-native`),o=r(r.bind);t.exports=function(e,t){return i(e),t===void 0?e:a?o(e,t):function(){return e.apply(t,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,t,n){t.exports=!e(`../internals/fails`)((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}))},{"../internals/fails":260}],264:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,t,n){var r=e(`../internals/descriptors`),i=e(`../internals/has-own-property`),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,`name`);t.exports={EXISTS:s,PROPER:s&&function(){}.name===`something`,CONFIGURABLE:s&&(!r||r&&o(a,`name`).configurable)}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/a-callable`);t.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,t,n){var r=e(`../internals/classof-raw`),i=e(`../internals/function-uncurry-this`);t.exports=function(e){if(r(e)===`Function`)return i(e)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);t.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,t,n){var r=e(`../internals/global`),i=e(`../internals/is-callable`),a=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?a(r[e]):r[e]&&r[e][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,t,n){var r=e(`../internals/classof`),i=e(`../internals/get-method`),a=e(`../internals/is-null-or-undefined`),o=e(`../internals/iterators`),s=e(`../internals/well-known-symbol`)(`iterator`);t.exports=function(e){if(!a(e))return i(e,s)||i(e,`@@iterator`)||o[r(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,t,n){var r=e(`../internals/function-call`),i=e(`../internals/a-callable`),a=e(`../internals/an-object`),o=e(`../internals/try-to-string`),s=e(`../internals/get-iterator-method`),c=TypeError;t.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return a(r(n,e));throw new c(o(e)+` is not iterable`)}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/is-array`),a=e(`../internals/is-callable`),o=e(`../internals/classof-raw`),s=e(`../internals/to-string`),c=r([].push);t.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;rv;v++)if((b=A(e[v]))&&l(h,b))return b;return new m(!1)}g=u(e,_)}for(x=T?e.next:g.next;!(S=i(x,g)).done;){try{b=A(S.value)}catch(e){f(g,`throw`,e)}if(typeof b==`object`&&b&&l(h,b))return b}return new m(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,t,n){var r=e(`../internals/function-call`),i=e(`../internals/an-object`),a=e(`../internals/get-method`);t.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,`return`))){if(t===`throw`)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw n;if(s)throw o;return i(o),n}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,t,n){var r=e(`../internals/iterators-core`).IteratorPrototype,i=e(`../internals/object-create`),a=e(`../internals/create-property-descriptor`),o=e(`../internals/set-to-string-tag`),s=e(`../internals/iterators`),c=function(){return this};t.exports=function(e,t,n,l){var u=t+` Iterator`;return e.prototype=i(r,{next:a(+!l,n)}),o(e,u,!1,!0),s[u]=c,e}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,t,n){var r=e(`../internals/export`),i=e(`../internals/function-call`),a=e(`../internals/is-pure`),o=e(`../internals/function-name`),s=e(`../internals/is-callable`),c=e(`../internals/iterator-create-constructor`),l=e(`../internals/object-get-prototype-of`),u=e(`../internals/object-set-prototype-of`),d=e(`../internals/set-to-string-tag`),f=e(`../internals/create-non-enumerable-property`),p=e(`../internals/define-built-in`),m=e(`../internals/well-known-symbol`),h=e(`../internals/iterators`),g=e(`../internals/iterators-core`),_=o.PROPER,v=o.CONFIGURABLE,y=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,x=m(`iterator`),S=function(){return this};t.exports=function(e,t,n,o,m,g,C){c(n,t,o);var w,T,E,D=function(e){if(e===m&&M)return M;if(!b&&e&&e in A)return A[e];switch(e){case`keys`:case`values`:case`entries`:return function(){return new n(this,e)}}return function(){return new n(this)}},O=t+` Iterator`,k=!1,A=e.prototype,j=A[x]||A[`@@iterator`]||m&&A[m],M=!b&&j||D(m),N=t===`Array`&&A.entries||j;if(N&&(w=l(N.call(new e)))!==Object.prototype&&w.next&&(a||l(w)===y||(u?u(w,y):s(w[x])||p(w,x,S)),d(w,O,!0,!0),a&&(h[O]=S)),_&&m===`values`&&j&&j.name!==`values`&&(!a&&v?f(A,`name`,`values`):(k=!0,M=function(){return i(j,this)})),m)if(T={values:D(`values`),keys:g?M:D(`keys`),entries:D(`entries`)},C)for(E in T)(b||k||!(E in A))&&p(A,E,T[E]);else r({target:t,proto:!0,forced:b||k},T);return a&&!C||A[x]===M||p(A,x,M,{name:m}),h[t]=M,T}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,t,n){var r,i,a,o=e(`../internals/fails`),s=e(`../internals/is-callable`),c=e(`../internals/is-object`),l=e(`../internals/object-create`),u=e(`../internals/object-get-prototype-of`),d=e(`../internals/define-built-in`),f=e(`../internals/well-known-symbol`),p=e(`../internals/is-pure`),m=f(`iterator`),h=!1;[].keys&&(`next`in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(r=i):h=!0),!c(r)||o((function(){var e={};return r[m].call(e)!==e}))?r={}:p&&(r=l(r)),s(r[m])||d(r,m,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,t,n){arguments[4][276][0].apply(n,arguments)},{dup:276}],299:[function(e,t,n){var r=e(`../internals/to-length`);t.exports=function(e){return r(e.length)}},{"../internals/to-length":343}],300:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/fails`),a=e(`../internals/is-callable`),o=e(`../internals/has-own-property`),s=e(`../internals/descriptors`),c=e(`../internals/function-name`).CONFIGURABLE,l=e(`../internals/inspect-source`),u=e(`../internals/internal-state`),d=u.enforce,f=u.get,p=String,m=Object.defineProperty,h=r(``.slice),g=r(``.replace),_=r([].join),v=s&&!i((function(){return m((function(){}),`length`,{value:8}).length!==8})),y=String(String).split(`String`),b=t.exports=function(e,t,n){h(p(t),0,7)===`Symbol(`&&(t=`[`+g(p(t),/^Symbol\(([^)]*)\)/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!o(e,`name`)||c&&e.name!==t)&&(s?m(e,`name`,{value:t,configurable:!0}):e.name=t),v&&n&&o(n,`arity`)&&e.length!==n.arity&&m(e,`length`,{value:n.arity});try{n&&o(n,`constructor`)&&n.constructor?s&&m(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=d(e);return o(r,`source`)||(r.source=_(y,typeof t==`string`?t:``)),e};Function.prototype.toString=b((function(){return a(this)&&f(this).source||l(this)}),`toString`)},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}},{}],302:[function(e,t,n){var r,i,a,o,s,c=e(`../internals/global`),l=e(`../internals/function-bind-context`),u=e(`../internals/object-get-own-property-descriptor`).f,d=e(`../internals/task`).set,f=e(`../internals/queue`),p=e(`../internals/engine-is-ios`),m=e(`../internals/engine-is-ios-pebble`),h=e(`../internals/engine-is-webos-webkit`),g=e(`../internals/engine-is-node`),_=c.MutationObserver||c.WebKitMutationObserver,v=c.document,y=c.process,b=c.Promise,x=u(c,`queueMicrotask`),S=x&&x.value;if(!S){var C=new f,w=function(){var e,t;for(g&&(e=y.domain)&&e.exit();t=C.get();)try{t()}catch(e){throw C.head&&r(),e}e&&e.enter()};p||g||h||!_||!v?!m&&b&&b.resolve?((o=b.resolve(void 0)).constructor=b,s=l(o.then,o),r=function(){s(w)}):g?r=function(){y.nextTick(w)}:(d=l(d,c),r=function(){d(w)}):(i=!0,a=v.createTextNode(``),new _(w).observe(a,{characterData:!0}),r=function(){a.data=i=!i}),S=function(e){C.head||r(),C.add(e)}}t.exports=S},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,t,n){var r=e(`../internals/a-callable`),i=TypeError,a=function(e){var t,n;this.promise=new e((function(e,r){if(t!==void 0||n!==void 0)throw new i(`Bad Promise constructor`);t=e,n=r})),this.resolve=r(t),this.reject=r(n)};t.exports.f=function(e){return new a(e)}},{"../internals/a-callable":222}],304:[function(e,t,n){var r=e(`../internals/is-regexp`),i=TypeError;t.exports=function(e){if(r(e))throw new i(`The method doesn't accept regular expressions`);return e}},{"../internals/is-regexp":291}],305:[function(e,t,n){var r=e(`../internals/descriptors`),i=e(`../internals/function-uncurry-this`),a=e(`../internals/function-call`),o=e(`../internals/fails`),s=e(`../internals/object-keys`),c=e(`../internals/object-get-own-property-symbols`),l=e(`../internals/object-property-is-enumerable`),u=e(`../internals/to-object`),d=e(`../internals/indexed-object`),f=Object.assign,p=Object.defineProperty,m=i([].concat);t.exports=!f||o((function(){if(r&&f({b:1},f(p({},`a`,{enumerable:!0,get:function(){p(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`);return e[n]=7,`abcdefghijklmnopqrst`.split(``).forEach((function(e){t[e]=e})),f({},e)[n]!==7||s(f({},t)).join(``)!==`abcdefghijklmnopqrst`}))?function(e,t){for(var n=u(e),i=arguments.length,o=1,f=c.f,p=l.f;i>o;)for(var h,g=d(arguments[o++]),_=f?m(s(g),f(g)):s(g),v=_.length,y=0;v>y;)h=_[y++],r&&!a(p,g,h)||(n[h]=g[h]);return n}:f},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,t,n){var r,i=e(`../internals/an-object`),a=e(`../internals/object-define-properties`),o=e(`../internals/enum-bug-keys`),s=e(`../internals/hidden-keys`),c=e(`../internals/html`),l=e(`../internals/document-create-element`),u=e(`../internals/shared-key`)(`IE_PROTO`),d=function(){},f=function(e){return`