var Lr=Object.defineProperty,zr=Object.defineProperties;var Ur=Object.getOwnPropertyDescriptors;var _r=Object.getOwnPropertySymbols;var $r=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable;var pr=(ot,lt)=>(lt=Symbol[ot])?lt:Symbol.for("Symbol."+ot);var xr=(ot,lt,s)=>lt in ot?Lr(ot,lt,{enumerable:!0,configurable:!0,writable:!0,value:s}):ot[lt]=s,At=(ot,lt)=>{for(var s in lt||(lt={}))$r.call(lt,s)&&xr(ot,s,lt[s]);if(_r)for(var s of _r(lt))Hr.call(lt,s)&&xr(ot,s,lt[s]);return ot},Ae=(ot,lt)=>zr(ot,Ur(lt));var ne=(ot,lt,s)=>new Promise((C,_)=>{var p=r=>{try{o(s.next(r))}catch(t){_(t)}},a=r=>{try{o(s.throw(r))}catch(t){_(t)}},o=r=>r.done?C(r.value):Promise.resolve(r.value).then(p,a);o((s=s.apply(ot,lt)).next())}),nr=function(ot,lt){this[0]=ot,this[1]=lt},kr=(ot,lt,s)=>{var C=(a,o,r,t)=>{try{var e=s[a](o),l=(o=e.value)instanceof nr,i=e.done;Promise.resolve(l?o[0]:o).then(n=>l?C(a==="return"?a:"next",o[1]?{done:n.done,value:n.value}:n,r,t):r({value:n,done:i})).catch(n=>C("throw",n,r,t))}catch(n){t(n)}},_=a=>p[a]=o=>new Promise((r,t)=>C(a,o,r,t)),p={};return s=s.apply(ot,lt),p[pr("asyncIterator")]=()=>p,_("next"),_("throw"),_("return"),p};var ir=(ot,lt,s)=>(lt=ot[pr("asyncIterator")])?lt.call(ot):(ot=ot[pr("iterator")](),lt={},s=(C,_)=>(_=ot[C])&&(lt[C]=p=>new Promise((a,o,r)=>(p=_.call(ot,p),r=p.done,Promise.resolve(p.value).then(t=>a({value:t,done:r}),o)))),s("next"),s("return"),lt);import{ae as Vr,af as Wr,D as qr,ag as yr,ah as Yt,ai as Xr,R as Yr,M as Kr,h as Zr,aj as Gr,ak as sr,V as Jr,w as Qr}from"./entry/index-DShbtsWl.js";import{o as tn,E as Rr,ar as en,as as rn,W as nn,ao as sn,at as on,al as an,a3 as ln,ap as un,av as cn,aw as Ye,ax as hn,aI as fn,b as jr,c as Qt}from"./antd-BmrhB3rb.js";import{d as dn,f as pn,w as mn,c as mr,k as Sr,ac as bn,i as gn,l as de,a7 as Ue}from"./vue-BjERyvPm.js";import{_ as yn,a as vn}from"./componentMap-D7_wXCrD.js";import"./helper-3Z_qR1GZ.js";import"./BasicForm.vue_vue_type_style_index_0_lang-CcmMJY8X.js";import"./index-wJ08BCMi.js";const wn=Ae(At({},Vr),{columns:Array,pagerConfig:{type:Object,default:()=>({})},proxyConfig:{type:Object,default:()=>({})},toolbarConfig:{type:Object,default:()=>({})},formConfig:{type:Object,default:()=>({})},zoomConfig:{type:Object,default:()=>({})},printConfig:{type:Object,default:()=>({})},exportConfig:{type:Object,default:()=>({})},importConfig:{type:Object,default:()=>({})},size:String,tableClass:{type:String,default:""},tableStyle:{type:Object,default:()=>({})}}),_n=["tableClass","tableStyle"],xn=["AInput","ATextarea"],Cr=[...Wr,"page-change","form-submit","form-submit-invalid","form-reset","form-collapse","form-toggle-collapse","toolbar-button-click","toolbar-tool-click","zoom"],kn=["getRefMaps","getComputeMaps","dispatchEvent","commitProxy","getFormItems","getPendingRecords","zoom","isMaximized","maximize","revert","getProxyInfo","clearAll","syncData","updateData","loadData","reloadData","reloadRow","loadColumn","reloadColumn","getRowNode","getColumnNode","getRowIndex","getVTRowIndex","getVMRowIndex","getColumnIndex","getVTColumnIndex","getVMColumnIndex","createData","createRow","revertData","clearData","isInsertByRow","isUpdateByRow","getColumns","getColumnById","getColumnByField","getTableColumn","getData","getCheckboxRecords","getParentRow","getRowSeq","getRowById","getRowid","getTableData","hideColumn","showColumn","resetColumn","refreshColumn","refreshScroll","recalculate","closeTooltip","isAllCheckboxChecked","isAllCheckboxIndeterminate","getCheckboxIndeterminateRecords","setCheckboxRow","isCheckedByCheckboxRow","isIndeterminateByCheckboxRow","toggleCheckboxRow","setAllCheckboxRow","getRadioReserveRecord","clearRadioReserve","getCheckboxReserveRecords","clearCheckboxReserve","toggleAllCheckboxRow","clearCheckboxRow","setCurrentRow","isCheckedByRadioRow","setRadioRow","clearCurrentRow","clearRadioRow","getCurrentRecord","getRadioRecord","getCurrentColumn","setCurrentColumn","clearCurrentColumn","sort","clearSort","isSort","getSortColumns","closeFilter","isFilter","isRowExpandLoaded","clearRowExpandLoaded","reloadRowExpand","reloadRowExpand","toggleRowExpand","setAllRowExpand","setRowExpand","isExpandByRow","clearRowExpand","clearRowExpandReserve","getRowExpandRecords","getTreeExpandRecords","isTreeExpandLoaded","clearTreeExpandLoaded","reloadTreeExpand","reloadTreeChilds","toggleTreeExpand","setAllTreeExpand","setTreeExpand","isTreeExpandByRow","clearTreeExpand","clearTreeExpandReserve","getScroll","scrollTo","scrollToRow","scrollToColumn","clearScroll","updateFooter","updateStatus","setMergeCells","removeInsertRow","removeMergeCells","getMergeCells","clearMergeCells","setMergeFooterItems","removeMergeFooterItems","getMergeFooterItems","clearMergeFooterItems","openTooltip","focus","blur","connect","insert","insertAt","insertNextAt","remove","removeCheckboxRow","removeRadioRow","removeCurrentRow","getRecordset","getInsertRecords","getRemoveRecords","getUpdateRecords","getEditRecord","getSelectedCell","clearSelected","isEditByRow","setEditRow","setEditCell","setSelectCell","clearEdit","clearValidate","fullValidate","validate"];function Sn(ot){return typeof ot=="function"||Object.prototype.toString.call(ot)==="[object Object]"&&!gn(ot)}const Cn=dn({name:"VxeBasicTable",props:wn,emits:Cr,setup(ot,{emit:lt,attrs:s}){const C=pn(),_={},{getDarkMode:p}=qr();mn(()=>p.value,()=>{yr.setTheme(p.value)},{immediate:!0});const o=(i=>{const n={};return i.forEach(c=>{n[c]=(...h)=>{const u=C.value;if(u&&u[c])return u[c](...h)}}),n})(kn);Cr.forEach(i=>{const n=Yt.camelCase(`on-${i}`);_[n]=(...c)=>lt(i,...c)});const r=mr(()=>At(At({},s),ot)),t=mr(()=>{const i=tn(r.value,_n);return At(At({},i),l)}),e=mr(()=>[s.class]),l=At({},_);return At({getWrapperClass:e,getBindGridValues:t,tableElRef:C},o)},render(){let ot;const{tableClass:lt,tableStyle:s}=this.$props;return Sr("div",{class:`h-full flex flex-col bg-white ${this.getWrapperClass}`},[Sr(Xr,bn({ref:"tableElRef",class:`vxe-grid_scrollbar px-6 py-4 ${lt}`,style:s},this.getBindGridValues),Sn(ot=Yr(this.$slots))?ot:{default:()=>[ot]})])}}),ge=new Map;ge.set("AButton",Kr);ge.set("AInput",Rr);ge.set("AInputSearch",Rr.Search);ge.set("AInputNumber",en);ge.set("AAutoComplete",rn);ge.set("ASelect",nn);ge.set("ATreeSelect",sn);ge.set("ASwitch",on);ge.set("ARadioGroup",an.Group);ge.set("ACheckboxGroup",ln.Group);ge.set("ACascader",un);ge.set("ARate",cn);ge.set("ADatePicker",Ye);ge.set("AMonthPicker",Ye.MonthPicker);ge.set("ARangePicker",Ye.RangePicker);ge.set("AWeekPicker",Ye.WeekPicker);ge.set("AYearPicker",Ye.YearPicker);ge.set("ATimePicker",hn);ge.set("AApiSelect",yn);ge.set("AApiTreeSelect",vn);ge.set("AEmpty",fn);const{t:or}=Zr();function Tn(ot){if(ot)return ot.includes("RangePicker")?[or("common.chooseText"),or("common.chooseText")]:ot.includes("Input")||ot.includes("Complete")||ot.includes("Rate")?or("common.inputText"):or("common.chooseText")}function En(ot,lt){return xn.includes(ot)?Yt.trim(lt):lt}function Re(ot){const lt=ge.get(ot);if(!lt)throw`您还没注册此组件 ${ot}`;return lt}function cr(ot){return ot==null||ot===""}function gr(ot){return""+(cr(ot)?"":ot)}function hr(ot){return[gr(ot)]}function ar(ot){return"on"+ot.substring(0,1).toLocaleUpperCase()+ot.substring(1)}function Mn(ot){let lt="value";switch(ot.name){case"ASwitch":lt="checked";break}return lt}function An(ot){let lt="update:value";switch(ot.name){case"ASwitch":lt="update:checked";break}return lt}function Rn(){return"change"}function jn(){return"click"}function Te(ot,lt,s,C,_){const{events:p}=ot,a=An(ot),o=Rn(),r=jn(),t=o===a,e={};return Yt.objectEach(p,(l,i)=>{e[ar(i)]=function(...n){l(lt,...n)}}),s&&(e[ar(a)]=function(l){s(l),p&&p[a]&&p[a](lt,l),t&&C&&C(l)}),!t&&C&&(e[ar(o)]=function(...l){C(...l),p&&p[o]&&p[o](lt,...l)}),_&&(e[ar(r)]=function(...l){_(...l),p&&p[r]&&p[r](lt,...l)}),e}function Ee(ot,lt,s){const C=ot.name;return Yt.assign({placeholder:Tn(C),allowClear:!0},s,ot.props,{[Mn(ot)]:lt})}function Le(ot,lt){return function(s,C){var i;const{row:_,column:p,$table:a}=C,{name:o,attrs:r}=s,t=Yt.get(_,p.field),e=(i=lt&<(s,C))!=null?i:{},l=Re(o);return[de(l,At(At(At(At({},r),Ee(s,t,ot)),e),Te(s,C,n=>Yt.set(_,p.field,n),()=>a.updateStatus(C))))]}}function ke(ot,lt){return function(s,C){var i;const{row:_,column:p,$table:a}=C,{name:o,attrs:r}=s,t=Yt.get(_,p.field),e=(i=lt&<(s,C))!=null?i:{},l=Re(o);return[de(l,At(At(At(At({},r),Ee(s,t,ot)),e),Te(s,C,n=>Yt.set(_,p.field,n),()=>a.updateStatus(C))))]}}function Ke(ot,lt){return function(s,C){var t;const{column:_}=C,{name:p,attrs:a}=s,o=(t=lt&<(s,C))!=null?t:{},r=Re(p);return[de("div",{class:"vxe-table--filter-antd-wrapper"},_.filters.map((e,l)=>{const i=e.data,n=!!e.data;return de(r,At(At(At(At({key:l},a),Ee(s,i,ot)),o),Te(s,C,c=>{e.data=c},()=>{const{$panel:c}=C;c.changeOption(null,n,e)})))}))]}}function qe(){return function(ot){const{option:lt,row:s,column:C}=ot,{data:_}=lt;return Yt.get(s,C.field)===_}}function _e(ot,lt){return function(s,C){var i;const _=(i=lt&<(s,C))!=null?i:{},{data:p,property:a,$form:o}=C,{name:r}=s,{attrs:t}=s,e=Yt.get(p,a),l=Re(r);return[de(l,At(At(At(At({},t),Ee(s,e,ot)),_),Te(s,C,n=>{Yt.set(p,a,En(r,n))},()=>{o.updateStatus(Ae(At({},C),{field:a}))})))]}}function Ne(ot,lt){return function(s,C){var o;const _=(o=lt&<(s,C))!=null?o:[],p=ot&&ot(s,C,..._),{placeholder:a}=s;return[de("span",{class:"vxe-cell--label"},a&&cr(p)?[de("span",{class:"vxe-cell--placeholder"},gr(a))]:gr(p))]}}function Pe(ot,lt){return function(s){var o;const{row:C,column:_,options:p}=s,a=(o=lt&<(s))!=null?o:[];return p&&p.original?Yt.get(C,_.field):ot(_.editRender||_.cellRender,s,...a)}}function On(ot,lt){return function(s,C){var r;const{name:_,attrs:p}=s,a=(r=lt&<(s,C))!=null?r:{},o=Re(_);return[de(o,At(At(At(At({},p),Ee(s,null,ot)),a),Te(s,C)))]}}const In={tableAutoFocus:"input.ant-input",renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter:Ke(),tableFilterDefaultMethod:qe(),renderFormItemContent:_e()},Nn={tableAutoFocus:"input.ant-input",renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter:Ke(),tableFilterDefaultMethod:qe(),renderFormItemContent:_e()},Pn={tableAutoFocus:"input.ant-input-number-input",renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter:Ke(),tableFilterDefaultMethod:qe(),renderFormItemContent:_e()};function ur(ot,lt){const s=lt.label||"label",C=lt.value||"value";return Yt.map(ot,(_,p)=>de(Ue("a-select-option"),{key:p,value:_[C],disabled:_.disabled},{default:()=>hr(_[s])}))}function Dn(){return function(ot,lt){const{options:s=[],optionGroups:C,optionProps:_={},optionGroupProps:p={}}=ot,{row:a,column:o,$table:r}=lt,{attrs:t}=ot,e=Yt.get(a,o.field),l=Ee(ot,e),i=Te(ot,lt,n=>{Yt.set(a,o.field,n)},()=>{r.updateStatus(lt)});if(C){const n=p.options||"options",c=p.label||"label";return[de(Ue("a-select"),At(At(At({},t),l),i),{default:()=>Yt.map(C,(h,u)=>de(Ue("a-select-opt-group"),{key:u},{label:()=>de("span",{},h[c]),default:()=>ur(h[n],_)}))})]}return[de(Ue("a-select"),At(At(At({},l),t),i),{default:()=>ur(s,_)})]}}function Tr(ot,lt){const{options:s=[],optionGroups:C,props:_={},optionProps:p={},optionGroupProps:a={}}=ot,{row:o,column:r}=lt,t=p.label||"label",e=p.value||"value",l=a.options||"options",i=Yt.get(o,r.field);return cr(i)?"":Yt.map(_.mode==="multiple"?i:[i],C?n=>{let c;for(let h=0;hu[e]===n),!c);h++);return c?c[t]:n}:n=>{const c=Yt.find(s,h=>h[e]===n);return c?c[t]:n}).join(", ")}function Bn(){return function(ot,lt){const{options:s=[],optionGroups:C,optionProps:_={},optionGroupProps:p={}}=ot,a=p.options||"options",o=p.label||"label",{column:r}=lt,{attrs:t}=ot;return[de("div",{class:"vxe-table--filter-antd-wrapper"},C?r.filters.map((e,l)=>{const i=e.data,n=Ee(ot,i);return de(Ue("a-select"),At(At(At({key:l},t),n),Te(ot,lt,c=>{e.data=c},()=>{const{$panel:c}=lt;c.changeOption(null,n.mode==="multiple"?e.data&&e.data.length>0:!Yt.eqNull(e.data),e)})),{default:()=>Yt.map(C,(c,h)=>de(Ue("a-select-opt-group"),{key:h},{label:()=>de("span",{},c[o]),default:()=>ur(c[a],_)}))})}):r.filters.map((e,l)=>{const i=e.data,n=Ee(ot,i);return de(Ue("a-select"),At(At(At({key:l},t),n),Te(ot,lt,c=>{e.data=c},()=>{const{$panel:c}=lt;c.changeOption(null,n.mode==="multiple"?e.data&&e.data.length>0:!Yt.eqNull(e.data),e)})),{default:()=>ur(s,_)})}))]}}const Fn={renderTableEdit:Dn(),renderTableCell:Ne(Tr),renderTableFilter:Bn(),tableFilterDefaultMethod(ot){const{option:lt,row:s,column:C}=ot,{data:_}=lt,{field:p,filterRender:a}=C,{props:o={}}=a,r=Yt.get(s,p);return o.mode==="multiple"?Yt.isArray(r)?Yt.includeArrays(r,_):_.indexOf(r)>-1:r==_},renderFormItemContent:_e(),tableExportMethod:Pe(Tr)};function Or(ot,lt,s,C){const _=s[ot];lt&&s.length>ot&&Yt.each(lt,p=>{p.value===_&&(C.push(p.label),Or(++ot,p.children,s,C))})}function Er(ot,lt){const{props:s={}}=ot,{row:C,column:_}=lt,a=Yt.get(C,_.field)||[],o=[];return Or(0,s.options,a,o),(s.showAllLevels===!1?o.slice(o.length-1,o.length):o).join(` ${s.separator||"/"} `)}const Ln={renderTableEdit:ke(),renderTableCell:Ne(Er),renderFormItemContent:_e(),tableExportMethod:Pe(Er)};function Oe(ot,lt,s){const{props:C={}}=ot,{row:_,column:p}=lt;let a=Yt.get(_,p.field);return a&&(a=a.format(C.format||s)),a}const zn={renderTableEdit:ke(),renderTableCell:Ne(Oe,()=>["YYYY-MM-DD"]),renderFormItemContent:_e(),tableExportMethod:Pe(Oe,()=>["YYYY-MM-DD"])},Un={renderTableEdit:ke(),renderTableCell:Ne(Oe,()=>["YYYY-MM"]),renderFormItemContent:_e(),tableExportMethod:Pe(Oe,()=>["YYYY-MM"])};function Mr(ot,lt){const{props:s={}}=ot,{row:C,column:_}=lt;let p=Yt.get(C,_.field);return p&&(p=Yt.map(p,a=>a.format(s.format||"YYYY-MM-DD")).join(" ~ ")),p}const $n={renderTableEdit:ke(),renderTableCell:Ne(Mr),renderFormItemContent:_e(),tableExportMethod:Pe(Mr)},Hn={renderTableEdit:ke(),renderTableCell:Ne(Oe,()=>["YYYY-WW周"]),renderFormItemContent:_e(),tableExportMethod:Pe(Oe,()=>["YYYY-WW周"])};function Ar(ot,lt){const{props:s={}}=ot,{treeData:C,treeCheckable:_}=s,{row:p,column:a}=lt,o=Yt.get(p,a.field);return cr(o)?o:Yt.map(_?o:[o],r=>{const t=Yt.findTree(C,e=>e.value===r,{children:"children"});return t?t.item.title:r}).join(", ")}const Vn={renderTableEdit:ke(),renderTableCell:Ne(Ar),renderFormItemContent:_e(),tableExportMethod:Pe(Ar)},Wn={renderTableEdit:ke(),renderTableCell:Ne(Oe,()=>["HH:mm:ss"]),renderFormItemContent:_e(),tableExportMethod:Pe(Oe,()=>["HH:mm:ss"])},qn={renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter:Ke(),tableFilterDefaultMethod:qe(),renderFormItemContent:_e()},Xn={renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter(ot,lt){const{column:s}=lt,{name:C,attrs:_}=ot,p=Re(C);return[de("div",{class:"vxe-table--filter-antd-wrapper"},s.filters.map((a,o)=>{const r=a.data;return de(p,At(At(At({key:o},_),Ee(ot,r)),Te(ot,lt,t=>{a.data=t},()=>{const{$panel:t}=lt;t.changeOption(null,Yt.isBoolean(a.data),a)})))}))]},tableFilterDefaultMethod:qe(),renderFormItemContent:_e()},Yn={renderFormItemContent:_e()},Kn={renderFormItemContent:_e()},fr="AButton";function Ir(){return function(ot,lt){const{attrs:s}=ot,C=Re(fr);return[de(C,At(At(At({},s),Ee(ot,null)),Te(ot,lt)))]}}function Nr(){return function(ot,lt){const{attrs:s}=ot,C=Re(fr);return[de(C,At(At(At({},s),Ee(ot,null)),Te(ot,lt)),hr(ot.content))]}}function Pr(){return function(ot,lt){const{attrs:s,content:C}=ot,{property:_,$form:p,data:a}=lt,o=Ee(ot,null),r=Re(fr);return[de(r,At(At(At({},s),o),Te(ot,lt,t=>{Yt.set(a,_,t)},()=>{p.updateStatus(Ae(At({},lt),{field:_}))})),{default:()=>hr(C||o.content)})]}}function Zn(){return function(ot,lt){const{attrs:s}=ot,{button:C}=lt,_=Ee(ot,null),p=Re(fr);return[de(p,At(At(At({},s),_),Te(ot,lt)),{default:()=>hr((C==null?void 0:C.content)||_.content)})]}}const Gn={renderTableEdit:Ir(),renderTableDefault:Nr(),renderFormItemContent:Pr(),renderToolbarButton:Zn()};function Jn(){return function(ot,lt){const s=Ir(),{children:C}=ot;return C?C.map(_=>s(_,lt)[0]):[]}}function Qn(){return function(ot,lt){const s=Nr(),{children:C}=ot;return C?C.map(_=>s(_,lt)[0]):[]}}function ti(){return function(ot,lt){const s=Pr(),{children:C}=ot;return C?C.map(_=>s(_,lt)[0]):[]}}const ei={renderTableEdit:Jn(),renderTableDefault:Qn(),renderFormItemContent:ti()},ri={renderTableDefault:Le({},(ot,lt)=>({params:Yt.get(lt,"row")})),renderTableEdit:ke({},(ot,lt)=>({params:Yt.get(lt,"row")})),renderFormItemContent:_e({},(ot,lt)=>({params:Yt.get(lt,"row")}))},ni={renderTableDefault:Le({},(ot,lt)=>({params:Yt.get(lt,"row")})),renderTableEdit:ke({},(ot,lt)=>({params:Yt.get(lt,"row")})),renderFormItemContent:_e({},(ot,lt)=>({params:Yt.get(lt,"row")}))};function ii(){return function(ot){const{name:lt,attrs:s,props:C}=ot,_=Re(lt);return[de("div",{class:"flex items-center justify-center"},de(_,At(At({},s),C)))]}}const si={renderTableEmptyView:ii()},oi={renderTableDefault:Le(),renderTableEdit:ke(),renderTableFilter:Ke(),tableFilterDefaultMethod:qe(),renderFormItemContent:_e(),renderToolbarTool:On()},ai={renderTableEdit:ke(),renderTableCell:Ne(Oe,()=>["YYYY"]),renderFormItemContent:_e(),tableExportMethod:Pe(Oe,()=>["YYYY"])};function lr(ot,lt,s){let C,_=ot.target;for(;_&&_.nodeType&&_!==document;){if(s&&_.className&&_.className.split&&_.className.split(" ").indexOf(s)>-1)C=_;else if(_===lt)return{flag:s?!!C:!0,container:lt,targetElem:C};_=_.parentNode}return{flag:!1}}function br(ot){const{$event:lt}=ot,s=document.body;if(lr(lt,s,"ant-select-dropdown").flag||lr(lt,s,"ant-cascader-menus").flag||lr(lt,s,"ant-calendar-picker-container").flag||lr(lt,s,"ant-time-picker-panel").flag)return!1}const Dr={install(ot){const{interceptor:lt,renderer:s}=ot,C={AAutoComplete:In,AInput:Nn,AInputNumber:Pn,ASelect:Fn,ACascader:Ln,ADatePicker:zn,AMonthPicker:Un,ARangePicker:$n,AWeekPicker:Hn,ATimePicker:Wn,ATreeSelect:Vn,ARate:qn,ASwitch:Xn,ARadioGroup:Yn,ACheckboxGroup:Kn,AButton:Gn,AButtonGroup:ei,AApiSelect:ri,AApiTreeSelect:ni,AEmpty:si,AInputSearch:oi,AYearPicker:ai};Object.keys(C).forEach(_=>{s.get(_)||s.add(_,C[_])}),lt.add("event.clearFilter",br),lt.add("event.clearEdit",br),lt.add("event.clearAreas",br)}};typeof window!="undefined"&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(Dr);var Br={};(function(ot){Object.defineProperty(ot,"__esModule",{value:!0}),ot.default=ot.VXETablePluginExportXLSX=void 0;var lt=s(Gr);function s(O){return O&&O.__esModule?O:{default:O}}var C,_,p="f8f8f9",a="606266",o="thin",r="e8eaec";function t(O,P){if(P){if(O.type==="seq")return lt.default.toValueString(P);switch(O.cellType){case"string":return lt.default.toValueString(P);case"number":if(!isNaN(P))return Number(P);break;default:if(P.length<12&&!isNaN(P))return Number(P);break}}return P}function e(O,P){var D=O.footerFilterMethod;return D?P.filter(function(U,B){return D({items:U,$rowIndex:B})}):P}function l(O,P,D,U){var B=t(U,D[O.getVMColumnIndex(U)]);return B}function i(O){var P=O.childNodes,D=P&&P.length;return D?i(P[0]):O}function n(O,P){P&&(O.height=lt.default.floor(P*.75,12))}function c(O,P){O.protection={locked:!1},O.alignment={vertical:"middle",horizontal:P||"left"}}function h(){return{top:{style:o,color:{argb:r}},left:{style:o,color:{argb:r}},bottom:{style:o,color:{argb:r}},right:{style:o,color:{argb:r}}}}function u(O){var P="xlsx",D=C,U=D.modal,B=D.t,k=O.$table,E=O.options,v=O.columns,m=O.colgroups,b=O.datas,g=k.props,y=k.reactData,S=k.getComputeMaps(),R=S.computeColumnOpts,I=g.headerAlign,z=g.align,$=g.footerAlign,W=y.rowHeight,j=E.message,H=E.sheetName,M=E.isHeader,T=E.isFooter,F=E.isMerge,V=E.isColgroup,Y=E.original,q=E.useStyle,K=E.sheetMethod,Q=R.value,et=E._isCustomColumn,X=j!==!1,J=k.getMergeCells(),G=[],nt=[],rt=[],it=[],ut=0;if(v.forEach(function(wt){var Tt=wt.id,mt=wt.renderWidth;rt.push({key:Tt,width:lt.default.ceil(mt/8,1)})}),M){if(V&&m)m.forEach(function(wt,Tt){var mt={};v.forEach(function(ft){mt[ft.id]=null}),wt.forEach(function(ft){var gt=ft._colSpan,Mt=ft._rowSpan,Et=i(ft),Ht=v.indexOf(Et),Zt=ft.headerExportMethod||Q.headerExportMethod;mt[Et.id]=Zt?Zt({column:ft,options:E,$table:k}):Y?Et.field:ft.getTitle(),(gt>1||Mt>1)&&it.push({s:{r:Tt,c:Ht},e:{r:Tt+Mt-1,c:Ht+gt-1}})}),G.push(mt)});else{var ct={};v.forEach(function(wt){var Tt=wt.id,mt=wt.field,ft=wt.headerExportMethod||Q.headerExportMethod;ct[Tt]=ft?ft({column:wt,options:E,$table:k}):Y?mt:wt.getTitle()}),G.push(ct)}ut+=G.length}F&&!et&&J.forEach(function(wt){var Tt=wt.row,mt=wt.rowspan,ft=wt.col,gt=wt.colspan;it.push({s:{r:Tt+ut,c:ft},e:{r:Tt+ut+mt-1,c:ft+gt-1}})});var pt=b.map(function(wt){var Tt={};return v.forEach(function(mt){Tt[mt.id]=t(mt,wt[mt.id])}),Tt});if(ut+=pt.length,T){var Ct=k.getTableData(),kt=Ct.footerData,vt=e(E,kt),Ot=k.getMergeFooterItems();F&&!et&&Ot.forEach(function(wt){var Tt=wt.row,mt=wt.rowspan,ft=wt.col,gt=wt.colspan;it.push({s:{r:Tt+ut,c:ft},e:{r:Tt+ut+mt-1,c:ft+gt-1}})}),vt.forEach(function(wt){var Tt={};v.forEach(function(mt){Tt[mt.id]=l(k,E,wt,mt)}),nt.push(Tt)})}var Rt=function(){var Tt=new(_||window.ExcelJS).Workbook,mt=Tt.addWorksheet(H);Tt.creator="vxe-table",mt.columns=rt,M&&mt.addRows(G).forEach(function(ft){q&&n(ft,W),ft.eachCell(function(gt){var Mt=mt.getColumn(gt.col),Et=k.getColumnById(Mt.key),Ht=Et.headerAlign,Zt=Et.align;c(gt,Ht||Zt||I||z),q&&Object.assign(gt,{font:{bold:!0,color:{argb:a}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:p}},border:h()})})}),mt.addRows(pt).forEach(function(ft){q&&n(ft,W),ft.eachCell(function(gt){var Mt=mt.getColumn(gt.col),Et=k.getColumnById(Mt.key);if(Et){var Ht=Et.align;c(gt,Ht||z),q&&Object.assign(gt,{font:{color:{argb:a}},border:h()})}})}),T&&mt.addRows(nt).forEach(function(ft){q&&n(ft,W),ft.eachCell(function(gt){var Mt=mt.getColumn(gt.col),Et=k.getColumnById(Mt.key);if(Et){var Ht=Et.footerAlign,Zt=Et.align;c(gt,Ht||Zt||$||z),q&&Object.assign(gt,{font:{color:{argb:a}},border:h()})}})}),K&&K({options:E,workbook:Tt,worksheet:mt,columns:v,colgroups:m,datas:b,$table:k}),it.forEach(function(ft){var gt=ft.s,Mt=ft.e;mt.mergeCells(gt.r+1,gt.c+1,Mt.r+1,Mt.c+1)}),Tt.xlsx.writeBuffer().then(function(ft){var gt=new Blob([ft],{type:"application/octet-stream"});d(O,gt,E),X&&U&&(U.close(P),U.message({content:B("vxe.table.expSuccess"),status:"success"}))})};X&&U?(U.message({id:P,content:B("vxe.table.expLoading"),status:"loading",duration:-1}),setTimeout(Rt,1500)):Rt()}function d(O,P,D){var U=C,B=U.modal,k=U.t,E=D.message,v=D.filename,m=D.type,b=E!==!1;if(window.Blob)if(navigator.msSaveBlob)navigator.msSaveBlob(P,"".concat(v,".").concat(m));else{var g=document.createElement("a");g.target="_blank",g.download="".concat(v,".").concat(m),g.href=URL.createObjectURL(P),document.body.appendChild(g),g.click(),document.body.removeChild(g)}else b&&B&&B.alert({content:k("vxe.error.notExp"),status:"error"})}function f(O,P){return P.some(function(D){return O.indexOf(D)>-1})}function w(O){var P=C,D=P.modal,U=P.t,B=O.$table,k=O.options,E=B.internalData,v=E._importReject,m=k.message!==!1;m&&D&&D.message({content:U("vxe.error.impFields"),status:"error"}),v&&v({status:!1})}function x(O){var P=C,D=P.modal,U=P.t,B=O.$table,k=O.columns,E=O.options,v=O.file,m=B.internalData,b=m._importResolve,g=E.message!==!1,y=new FileReader;y.onerror=function(){w(O)},y.onload=function(S){var R=[];k.forEach(function($){var W=$.field;W&&R.push(W)});var I=new(_||window.ExcelJS).Workbook,z=S.target;z?I.xlsx.load(z.result).then(function($){var W=$.worksheets[0];if(W){var j=W.getSheetValues(),H=lt.default.findIndexOf(j,function(V){return V&&V.length>0}),M=j[H],T=f(R,M);if(T){var F=j.slice(H).map(function(V){var Y={};V.forEach(function(K,Q){Y[M[Q]]=K});var q={};return R.forEach(function(K){q[K]=lt.default.isUndefined(Y[K])?null:Y[K]}),q});B.createData(F).then(function(V){var Y;return E.mode==="insert"?Y=B.insertAt(V,-1):Y=B.reloadData(V),Y.then(function(){b&&b({status:!0})})}),g&&D&&D.message({content:U("vxe.table.impSuccess",[F.length]),status:"success"})}else w(O)}else w(O)}):w(O)},y.readAsArrayBuffer(v)}function A(O){if(O.options.type==="xlsx")return x(O),!1}function N(O){if(O.options.type==="xlsx")return u(O),!1}var L=ot.VXETablePluginExportXLSX={install:function(P,D){!/^(4)\./.test(P.version)&&/v4/i.test(P.v),C=P,_=D?D.ExcelJS:null;var U=P.setConfig||P.config;U({table:{importConfig:{_typeMaps:{xlsx:1}},exportConfig:{_typeMaps:{xlsx:1}}},export:{types:{xlsx:0}}}),P.interceptor.mixin({"event.import":A,"event.export":N})}};typeof window!="undefined"&&window.VXETable&&window.VXETable.use&&window.VXETable.use(L),ot.default=L})(Br);const li=jr(Br);var Fr={exports:{}};/*! ExcelJS 19-10-2023 */(function(ot,lt){(function(s){ot.exports=s()})(function(){return function s(C,_,p){function a(t,e){if(!_[t]){if(!C[t]){var l=typeof sr=="function"&&sr;if(!e&&l)return l(t,!0);if(o)return o(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=_[t]={exports:{}};C[t][0].call(n.exports,function(c){return a(C[t][1][c]||c)},n,n.exports,s,C,_,p)}return _[t].exports}for(var o=typeof sr=="function"&&sr,r=0;r{const d=this.workbook.addWorksheet(c.sheetName),f=c.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=c.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=f.reduce((P,D)=>{if(P)return P;const U=t(A,D,!0);return U.isValid()?U:null},null);if(L)return new Date(L.valueOf());const O=i[A];return O!==void 0?O:A},x=a.parse(c.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{x.emit("worksheet",d)});x.on("worksheet",h).on("error",u),n.pipe(x)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(n,c){return new Promise((h,u)=>{c=c||{};const d=this.workbook.getWorksheet(c.sheetName||c.sheetId),f=a.format(c.formatterOptions);n.on("finish",()=>{h()}),f.on("error",u),f.pipe(n);const{dateFormat:w,dateUTC:x}=c,A=c.map||(O=>{if(O){if(O.text||O.hyperlink)return O.hyperlink||O.text||"";if(O.formula||O.result)return O.result||"";if(O instanceof Date)return w?x?t.utc(O).format(w):t(O).format(w):x?t.utc(O).format():t(O).format();if(O.error)return O.error;if(typeof O=="object")return JSON.stringify(O)}return O}),N=c.includeEmptyRows===void 0||c.includeEmptyRows;let L=1;d&&d.eachRow((O,P)=>{if(N)for(;L++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){const l=p.decodeAddress(t);this.nativeCol=l.col+e,this.nativeColOff=0,this.nativeRow=l.row+e,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+e,this.row=t.row+e):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(r){return r instanceof a||r==null?r:new a(r)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(r){this.nativeCol=Math.floor(r),this.nativeColOff=Math.floor((r-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(r){this.nativeRow=Math.floor(r),this.nativeRowOff=Math.floor((r-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(r){this.nativeCol=r.nativeCol,this.nativeColOff=r.nativeColOff,this.nativeRow=r.nativeRow,this.nativeRowOff=r.nativeRowOff}}C.exports=a},{"../utils/col-cache":19}],3:[function(s,C,_){const p=s("../utils/col-cache"),a=s("../utils/under-dash"),o=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(n,c,h){if(!n||!c)throw new Error("A Cell needs a Row");this._row=n,this._column=c,p.validateAddress(h),this._address=h,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(n.style,c.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(n){this.style.numFmt=n}get font(){return this.style.font}set font(n){this.style.font=n}get alignment(){return this.style.alignment}set alignment(n){this.style.alignment=n}get border(){return this.style.border}set border(n){this.style.border=n}get fill(){return this.style.fill}set fill(n){this.style.fill=n}get protection(){return this.style.protection}set protection(n){this.style.protection=n}_mergeStyle(n,c,h){const u=n&&n.numFmt||c&&c.numFmt;u&&(h.numFmt=u);const d=n&&n.font||c&&c.font;d&&(h.font=d);const f=n&&n.alignment||c&&c.alignment;f&&(h.alignment=f);const w=n&&n.border||c&&c.border;w&&(h.border=w);const x=n&&n.fill||c&&c.fill;x&&(h.fill=x);const A=n&&n.protection||c&&c.protection;return A&&(h.protection=A),h}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===e.Types.Merge}merge(n,c){this._value.release(),this._value=l.create(e.Types.Merge,this,n),c||(this.style=n.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(n){return this._value.type===e.Types.Merge&&this._value.isMergedTo(n)}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(n){this.type!==e.Types.Merge?(this._value.release(),this._value=l.create(l.getType(n),this,n)):this._value.master.value=n}get note(){return this._comment&&this._comment.note}set note(n){this._comment=new t(n)}get text(){return this._value.toString()}get html(){return a.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(n){this.type===e.Types.String&&(this._value=l.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:n}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:n}=this._row;return{sheetName:n.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(n){this.names=[n]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(n){const{definedNames:c}=this.workbook;c.removeAllNames(this.fullAddress),n.forEach(h=>{c.addEx(this.fullAddress,h)})}addName(n){this.workbook.definedNames.addEx(this.fullAddress,n)}removeName(n){this.workbook.definedNames.removeEx(this.fullAddress,n)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(n){this._dataValidations.add(this.address,n)}get model(){const{model:n}=this._value;return n.style=this.style,this._comment&&(n.comment=this._comment.model),n}set model(n){if(this._value.release(),this._value=l.create(n.type,this),this._value.model=n,n.comment)switch(n.comment.type){case"note":this._comment=t.fromModel(n.comment)}n.style?this.style=n.style:this.style={}}}e.Types=o.ValueType;const l={getType:i=>i==null?e.Types.Null:i instanceof String||typeof i=="string"?e.Types.String:typeof i=="number"?e.Types.Number:typeof i=="boolean"?e.Types.Boolean:i instanceof Date?e.Types.Date:i.text&&i.hyperlink?e.Types.Hyperlink:i.formula||i.sharedFormula?e.Types.Formula:i.richText?e.Types.RichText:i.sharedString?e.Types.SharedString:i.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(i){this.model={address:i.address,type:e.Types.Null}}get value(){return null}set value(i){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Number,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Date,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Hyperlink,text:n?n.text:void 0,hyperlink:n?n.hyperlink:void 0},n&&n.tooltip&&(this.model.tooltip=n.tooltip)}get value(){const i={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(i.tooltip=this.model.tooltip),i}set value(i){this.model={text:i.text,hyperlink:i.hyperlink},i.tooltip&&(this.model.tooltip=i.tooltip)}get text(){return this.model.text}set text(i){this.model.text=i}get hyperlink(){return this.model.hyperlink}set hyperlink(i){this.model.hyperlink=i}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(i,n){this.cell=i,this.model={address:i.address,type:e.Types.Formula,shareType:n?n.shareType:void 0,ref:n?n.ref:void 0,formula:n?n.formula:void 0,sharedFormula:n?n.sharedFormula:void 0,result:n?n.result:void 0}}_copyModel(i){const n={},c=h=>{const u=i[h];u&&(n[h]=u)};return c("formula"),c("result"),c("ref"),c("shareType"),c("sharedFormula"),n}get value(){return this._copyModel(this.model)}set value(i){this.model=this._copyModel(i)}validate(i){switch(l.getType(i)){case e.Types.Null:case e.Types.String:case e.Types.Number:case e.Types.Date:break;case e.Types.Hyperlink:case e.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(i){this.model.formula=i}get formulaType(){return this.model.formula?o.FormulaType.Master:this.model.sharedFormula?o.FormulaType.Shared:o.FormulaType.None}get result(){return this.model.result}set result(i){this.model.result=i}get type(){return e.Types.Formula}get effectiveType(){const i=this.model.result;return i==null?o.ValueType.Null:i instanceof String||typeof i=="string"?o.ValueType.String:typeof i=="number"?o.ValueType.Number:i instanceof Date?o.ValueType.Date:i.text&&i.hyperlink?o.ValueType.Hyperlink:i.formula?o.ValueType.Formula:o.ValueType.Null}get address(){return this.model.address}set address(i){this.model.address=i}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:i}=this.cell,n=i.findCell(this.model.sharedFormula);this._translatedFormula=n&&r(n.formula,n.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:e.Types.Merge,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Merge,master:n?n.address:void 0},this._master=n,n&&n.addMergeRef()}get value(){return this._master.value}set value(i){i instanceof e?(this._master&&this._master.releaseMergeRef(),i.addMergeRef(),this._master=i):this._master.value=i}isMergedTo(i){return i===this._master}get master(){return this._master}get type(){return e.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:JSON.stringify(n),rawValue:n}}get value(){return this.model.rawValue}set value(i){this.model.rawValue=i,this.model.value=JSON.stringify(i)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.SharedString,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}toString(){return this.model.value.richText.map(i=>i.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Boolean,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Error,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((i,n)=>(i[n.t]=n.f,i),[]),create(i,n,c){const h=this.types[i];if(!h)throw new Error("Could not create Value of type "+i);return new h(n,c)}};C.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(s,C,_){const p=s("../utils/under-dash"),a=s("./enums"),o=s("../utils/col-cache");class r{constructor(e,l,i){this._worksheet=e,this._number=l,i!==!1&&(this.defn=i)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return o.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?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){e!==void 0?(this._header=e,this.headers.forEach((l,i)=>{this._worksheet.getCell(i+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&p.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,l){const i=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(n,c)=>{l(n.getCell(i),c)})}get values(){const e=[];return this.eachCell((l,i)=>{l&&l.type!==a.ValueType.Null&&(e[i]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let i=0;e.hasOwnProperty("0")&&(i=1),e.forEach((n,c)=>{this._worksheet.getCell(c+i,l).value=n})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(i=>{i[e]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const l=[];let i=null;return e&&e.forEach((n,c)=>{n.isDefault?i&&(i=null):i&&n.equivalentTo(i)?i.max=c+1:(i={min:c+1,max:c+1,width:n.width!==void 0?n.width:9,style:n.style,isCustomWidth:n.isCustomWidth,hidden:n.hidden,outlineLevel:n.outlineLevel,collapsed:n.collapsed},l.push(i))}),l.length?l:void 0}static fromModel(e,l){const i=[];let n=1,c=0;for(l=(l=l||[]).sort(function(h,u){return h.min-u.min});c{l.removeCellEx(e)})}forEach(e){p.each(this.matrixMap,(l,i)=>{l.forEach(n=>{e(i,n)})})}getNames(e){return this.getNamesEx(a.decodeEx(e))}getNamesEx(e){return p.map(this.matrixMap,(l,i)=>l.findCellEx(e)&&i).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:i}=l,n=new r(l.row,l.col,l.row,l.col,i);let c,h;function u(f,w){const x=e.findCellAt(i,f,l.col);return!(!x||!x.mark)&&(n[w]=f,x.mark=!1,!0)}for(h=l.row-1;u(h,"top");h--);for(h=l.row+1;u(h,"bottom");h++);function d(f,w){const x=[];for(h=n.top;h<=n.bottom;h++){const A=e.findCellAt(i,h,f);if(!A||!A.mark)return!1;x.push(A)}n[w]=f;for(let A=0;A{i.mark=!0}),{name:e,ranges:l.map(i=>i.mark&&this._explore(l,i)).filter(Boolean).map(i=>i.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(i,n,c)=>{i&&(i.row===n&&i.col===c||(i.row=n,i.col=c,i.address=a.n2l(c)+n))})}spliceRows(e,l,i,n){p.each(this.matrixMap,c=>{c.spliceRows(e,l,i,n),this.normaliseMatrix(c,e)})}spliceColumns(e,l,i,n){p.each(this.matrixMap,c=>{c.spliceColumns(e,l,i,n),this.normaliseMatrix(c,e)})}get model(){return p.map(this.matrixMap,(e,l)=>this.getRanges(l,e)).filter(e=>e.ranges.length)}set model(e){const l=this.matrixMap={};e.forEach(i=>{const n=l[i.name]=new o;i.ranges.forEach(c=>{t.test(c.split("!").pop()||"")&&n.addCell(c)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(s,C,_){C.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(s,C,_){const p=s("../utils/col-cache"),a=s("./anchor");C.exports=class{constructor(o,r){this.worksheet=o,this.model=r}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(o){let{type:r,imageId:t,range:e,hyperlinks:l}=o;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const i=p.decode(e);this.range={tl:new a(this.worksheet,{col:i.left,row:i.top},-1),br:new a(this.worksheet,{col:i.right,row:i.bottom},0),editAs:"oneCell"}}else this.range={tl:new a(this.worksheet,e.tl,0),br:e.br&&new a(this.worksheet,e.br,0),ext:e.ext,editAs:e.editAs,hyperlinks:l||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(s,C,_){const p=s("../utils/under-dash");class a{constructor(r){this.note=r}get model(){let r=null;switch(typeof this.note){case"string":r={type:"note",note:{texts:[{text:this.note}]}};break;default:r={type:"note",note:this.note}}return p.deepMerge({},a.DEFAULT_CONFIGS,r)}set model(r){const{note:t}=r,{texts:e}=t;e.length===1&&Object.keys(e[0]).length===1?this.note=e[0].text:this.note=t}static fromModel(r){const t=new a;return t.model=r,t}}a.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},C.exports=a},{"../utils/under-dash":26}],10:[function(s,C,_){const p=s("../utils/col-cache");class a{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,i){if(arguments.length<4){const n=p.decodeAddress(r),c=p.decodeAddress(t);this.model={top:Math.min(n.row,c.row),left:Math.min(n.col,c.col),bottom:Math.max(n.row,c.row),right:Math.max(n.col,c.col),sheetName:e},this.setTLBR(n.row,n.col,c.row,c.col,i)}else this.model={top:Math.min(r,e),left:Math.min(t,l),bottom:Math.max(r,e),right:Math.max(t,l),sheetName:i}}decode(r){switch(r.length){case 5:this.setTLBR(r[0],r[1],r[2],r[3],r[4]);break;case 4:this.setTLBR(r[0],r[1],r[2],r[3]);break;case 3:this.setTLBR(r[0],r[1],r[2]);break;case 2:this.setTLBR(r[0],r[1]);break;case 1:{const t=r[0];if(t instanceof a)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{const e=p.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 new Error("Invalid number of arguments to _getDimensions() - "+r.length)}}get top(){return this.model.top||1}set top(r){this.model.top=r}get left(){return this.model.left||1}set left(r){this.model.left=r}get bottom(){return this.model.bottom||1}set bottom(r){this.model.bottom=r}get right(){return this.model.right||1}set right(r){this.model.right=r}get sheetName(){return this.model.sheetName}set sheetName(r){this.model.sheetName=r}get _serialisedSheetName(){const{sheetName:r}=this.model;return r?/^[a-zA-Z0-9]*$/.test(r)?r+"!":`'${r}'!`:""}expand(r,t,e,l){(!this.model.top||rthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=p.decodeEx(r);this.expand(t.row,t.col,t.row,t.col)}get tl(){return p.n2l(this.left)+this.top}get $t$l(){return`$${p.n2l(this.left)}$${this.top}`}get br(){return p.n2l(this.right)+this.bottom}get $b$r(){return`$${p.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(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&!(r.bottomthis.bottom)&&!(r.rightthis.right)}contains(r){const t=p.decodeEx(r);return this.containsEx(t)}containsEx(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&r.row>=this.top&&r.row<=this.bottom&&r.col>=this.left&&r.col<=this.right}forEachAddress(r){for(let t=this.left;t<=this.right;t++)for(let e=this.top;e<=this.bottom;e++)r(p.encodeAddress(e,t),e,t)}}C.exports=a},{"../utils/col-cache":19}],11:[function(s,C,_){const p=s("../utils/under-dash"),a=s("./enums"),o=s("../utils/col-cache"),r=s("./cell");C.exports=class{constructor(t,e){this._worksheet=t,this._number=e,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(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const l=this._worksheet.getColumn(t.col);e=new r(this,l,t.address),this._cells[t.col-1]=e}return e}getCell(t){if(typeof t=="string"){const e=this._worksheet.getColumnKey(t);t=e?e.number:o.l2n(t)}return this._cells[t-1]||this.getCellEx({address:o.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var i=arguments.length,n=new Array(i>2?i-2:0),c=2;c0)for(d=u;d>=l;d--)f=this._cells[d-1],f?(w=this.getCell(d+h),w.value=f.value,w.style=f.style,w._comment=f._comment):this._cells[d+h-1]=void 0;for(d=0;d{l&&l.type!==a.ValueType.Null&&e(l,i+1)})}addPageBreak(t,e){const l=this._worksheet,i=Math.max(0,t-1)||0,n=Math.max(0,e-1)||16838,c={id:this._number,max:n,man:1};i&&(c.min=i),l.rowBreaks.push(c)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==a.ValueType.Null&&(t[e.col]=e.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let e=0;t.hasOwnProperty("0")&&(e=1),t.forEach((l,i)=>{l!==void 0&&(this.getCellEx({address:o.encodeAddress(this._number,i+e),row:this._number,col:i+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:o.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[l])})}get hasValues(){return p.some(this._cells,t=>t&&t.type!==a.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,e=0;return this._cells.forEach(l=>{l&&l.type!==a.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[t]=e)}),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,l=0;return this._cells.forEach(i=>{if(i){const n=i.model;n&&((!e||e>i.col)&&(e=i.col),l{switch(l.type){case r.Types.Merge:break;default:{let i;if(l.address)i=o.decodeAddress(l.address);else if(e){const{row:n}=e,c=e.col+1;i={row:n,col:c,address:o.encodeAddress(n,c),$col$row:`$${o.n2l(c)}$${n}`}}e=i,this.getCellEx(i).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(s,C,_){const p=s("../utils/col-cache");class a{constructor(r,t,e){this.table=r,this.column=t,this.index=e}_set(r,t){this.table.cacheState(),this.column[r]=t}get name(){return this.column.name}set name(r){this._set("name",r)}get filterButton(){return this.column.filterButton}set filterButton(r){this.column.filterButton=r}get style(){return this.column.style}set style(r){this.column.style=r}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(r){this._set("totalsRowLabel",r)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(r){this._set("totalsRowFunction",r)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(r){this._set("totalsRowResult",r)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(r){this._set("totalsRowFormula",r)}}C.exports=class{constructor(o,r){this.worksheet=o,r&&(this.table=r,this.validate(),this.store())}getFormula(o){switch(o.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${o.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${o.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${o.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${o.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${o.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${o.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${o.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${o.name}])`;case"custom":return o.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+o.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:o}=this,r=(h,u,d)=>{h[u]===void 0&&(h[u]=d)};r(o,"headerRow",!0),r(o,"totalsRow",!1),r(o,"style",{}),r(o.style,"theme","TableStyleMedium2"),r(o.style,"showFirstColumn",!1),r(o.style,"showLastColumn",!1),r(o.style,"showRowStripes",!1),r(o.style,"showColumnStripes",!1);const t=(h,u)=>{if(!h)throw new Error(u)};t(o.ref,"Table must have ref"),t(o.columns,"Table must have column definitions"),t(o.rows,"Table must have row definitions"),o.tl=p.decodeAddress(o.ref);const{row:e,col:l}=o.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:i,filterHeight:n,tableHeight:c}=this;o.autoFilterRef=p.encode(e,l,e+n-1,l+i-1),o.tableRef=p.encode(e,l,e+c-1,l+i-1),o.columns.forEach((h,u)=>{t(h.name,`Column ${u} must have a name`),u===0?r(h,"totalsRowLabel","Total"):(r(h,"totalsRowFunction","none"),h.totalsRowFormula=this.getFormula(h))})}store(){const o=(n,c)=>{c&&Object.keys(c).forEach(h=>{n[h]=c[h]})},{worksheet:r,table:t}=this,{row:e,col:l}=t.tl;let i=0;if(t.headerRow){const n=r.getRow(e+i++);t.columns.forEach((c,h)=>{const{style:u,name:d}=c,f=n.getCell(l+h);f.value=d,o(f,u)})}if(t.rows.forEach(n=>{const c=r.getRow(e+i++);n.forEach((h,u)=>{const d=c.getCell(l+u);d.value=h,o(d,t.columns[u].style)})}),t.totalsRow){const n=r.getRow(e+i++);t.columns.forEach((c,h)=>{const u=n.getCell(l+h);if(h===0)u.value=c.totalsRowLabel;else{const d=this.getFormula(c);u.value=d?{formula:c.totalsRowFormula,result:c.totalsRowResult}:null}o(u,c.style)})}}load(o){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const i=o.getRow(t+l++);r.columns.forEach((n,c)=>{i.getCell(e+c).value=n.name})}if(r.rows.forEach(i=>{const n=o.getRow(t+l++);i.forEach((c,h)=>{n.getCell(e+h).value=c})}),r.totalsRow){const i=o.getRow(t+l++);r.columns.forEach((n,c)=>{const h=i.getCell(e+c);c===0?h.value=n.totalsRowLabel:this.getFormula(n)&&(h.value={formula:n.totalsRowFormula,result:n.totalsRowResult})})}}get model(){return this.table}set model(o){this.table=o}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const o=p.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(o,r)}getColumn(o){const r=this.table.columns[o];return new a(this,r,o)}addColumn(o,r,t){this.cacheState(),t===void 0?(this.table.columns.push(o),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,o),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(o,r),this.table.rows.forEach(t=>{t.splice(o,r)})}_assign(o,r,t){this.cacheState(),o[r]=t}get ref(){return this.table.ref}set ref(o){this._assign(this.table,"ref",o)}get name(){return this.table.name}set name(o){this.table.name=o}get displayName(){return this.table.displyName||this.table.name}set displayNamename(o){this.table.displayName=o}get headerRow(){return this.table.headerRow}set headerRow(o){this._assign(this.table,"headerRow",o)}get totalsRow(){return this.table.totalsRow}set totalsRow(o){this._assign(this.table,"totalsRow",o)}get theme(){return this.table.style.name}set theme(o){this.table.style.name=o}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(o){this.table.style.showFirstColumn=o}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(o){this.table.style.showLastColumn=o}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(o){this.table.style.showRowStripes=o}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(o){this.table.style.showColumnStripes=o}}},{"../utils/col-cache":19}],13:[function(s,C,_){const p=s("./worksheet"),a=s("./defined-names"),o=s("../xlsx/xlsx"),r=s("../csv/csv");C.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 a}get xlsx(){return this._xlsx||(this._xlsx=new o(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>h?u.orderNo:h,0),n=Object.assign({},e,{id:l,name:t,orderNo:i+1,workbook:this}),c=new p(n);return this._worksheets[l]=c,c}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(e=>e&&e.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,e)=>t.orderNo-e.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(e=>{t(e,e.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}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(t=>t.model),sheets:this.worksheets.map(t=>t.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(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(e=>{const{id:l,name:i,state:n}=e,c=t.sheets&&t.sheets.findIndex(h=>h.id===l);(this._worksheets[l]=new p({id:l,name:i,orderNo:c,state:n,workbook:this})).model=e}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(s,C,_){const p=s("../utils/under-dash"),a=s("../utils/col-cache"),o=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),i=s("./table"),n=s("./data-validations"),c=s("../utils/encryptor"),{copyStyle:h}=s("../utils/copy-style");C.exports=class{constructor(u){u=u||{},this._workbook=u.workbook,this.id=u.id,this.orderNo=u.orderNo,this.name=u.name,this.state=u.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},u.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:!(!u.pageSetup||!u.pageSetup.fitToWidth&&!u.pageSetup.fitToHeight||u.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},u.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},u.headerFooter),this.dataValidations=new n,this.views=u.views||[],this.autoFilter=u.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(u){if(u===void 0&&(u="sheet"+this.id),this._name!==u){if(typeof u!="string")throw new Error("The name has to be a string.");if(u==="")throw new Error("The name can't be empty.");if(u==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(u))throw new Error(`Worksheet name ${u} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(u))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+u);if(u&&u.length>31&&(u=u.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const u=new o;return this._rows.forEach(d=>{if(d){const f=d.dimensions;f&&u.expand(d.number,f.min,d.number,f.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((w,x)=>{const A=(x.header?1:x.headers&&x.headers.length)||0;return Math.max(w,A)},0);let d=1;const f=this._columns=[];u.forEach(w=>{const x=new t(this,d++,!1);f.push(x),x.defn=w})}getColumnKey(u){return this._keys[u]}setColumnKey(u,d){this._keys[u]=d}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){p.each(this._keys,u)}getColumn(u){if(typeof u=="string"){const d=this._keys[u];if(d)return d;u=a.l2n(u)}if(this._columns||(this._columns=[]),u>this._columns.length){let d=this._columns.length+1;for(;d<=u;)this._columns.push(new t(this,d++))}return this._columns[u-1]}spliceColumns(u,d){const f=this._rows.length;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A0)for(let P=0;P{D.push(B[P]||null)});const U=this.getRow(P+1);U.splice.apply(U,D)}else this._rows.forEach(P=>{P&&P.splice(u,d)});const N=x.length-d,L=u+d,O=this._columns.length;if(N<0)for(let P=u+x.length;P<=O;P++)this.getColumn(P).defn=this.getColumn(P-N).defn;else if(N>0)for(let P=O;P>=L;P--)this.getColumn(P+N).defn=this.getColumn(P).defn;for(let P=u;P{u=Math.max(u,d.cellCount)}),u}get actualColumnCount(){const u=[];let d=0;return this.eachRow(f=>{f.eachCell(w=>{let{col:x}=w;u[x]||(u[x]=!0,d++)})}),d}_commitRow(){}get _lastRowNumber(){const u=this._rows;let d=u.length;for(;d>0&&u[d-1]===void 0;)d--;return d}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(u){return this._rows[u-1]}findRows(u,d){return this._rows.slice(u-1,u-1+d)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let u=0;return this.eachRow(()=>{u++}),u}getRow(u){let d=this._rows[u-1];return d||(d=this._rows[u-1]=new r(this,u)),d}getRows(u,d){if(d<1)return;const f=[];for(let w=u;w1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,w=this.getRow(f);return w.values=u,this._setStyleOption(f,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return u.forEach(w=>{f.push(this.addRow(w,d))}),f}insertRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,f),this.getRow(u)}insertRows(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),f!=="n")for(let w=0;w1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,d[1]==="+"):d[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,d[1]==="+")}_copyStyle(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),x=this.getRow(d);x.style=h(w.style),w.eachCell({includeEmpty:f},(A,N)=>{x.getCell(N).style=h(A.style)}),x.height=w.height}duplicateRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this._rows[u-1],x=new Array(d).fill(w.values);this.spliceRows(u+1,f?0:d,...x);for(let A=0;A{N.getCell(O).style=L.style})}}spliceRows(u,d){const f=u+d;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A{U.getCell(k).style=B.style}),this._rows[P-1]=void 0}else this._rows[P+L-1]=void 0;else if(L>0)for(P=O;P>=f;P--)if(D=this._rows[P-1],D){const U=this.getRow(P+L);U.values=D.values,U.style=D.style,U.height=D.height,D.eachCell({includeEmpty:!0},(B,k)=>{if(U.getCell(k).style=B.style,B._value.constructor.name==="MergeValue"){const E=this.getRow(B._row._number+N).getCell(k),v=B._value._master,m=this.getRow(v._row._number+N).getCell(v._column._number);E.merge(m)}})}else this._rows[P+L-1]=void 0;for(P=0;P{f&&f.hasValues&&d(f,f.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const f=a.getAddress(u,d),w=this._rows[f.row-1];return w?w.findCell(f.col):void 0}getCell(u,d){const f=a.getAddress(u,d);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const f=this.getCell(u.top,u.left);for(let w=u.top;w<=u.bottom;w++)for(let x=u.left;x<=u.right;x++)(w>u.top||x>u.left)&&this.getCell(w,x).merge(f,d);this._merges[f.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let f=d.top;f<=d.bottom;f++)for(let w=d.left;w<=d.right;w++)this.getCell(f,w).unmerge();delete this._merges[u.address]}}get hasMerges(){return p.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const x=a.decode(u),{top:A,left:N,bottom:L,right:O}=x,P=O-N+1,D=a.encodeAddress(A,N),U=w==="shared";let B;B=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(E,v)=>f[E-A][v-N]:(E,v)=>f[(E-A)*P+(v-N)]:()=>{};let k=!0;for(let E=A;E<=L;E++)for(let v=N;v<=O;v++)k?(this.getCell(E,v).value={shareType:w,formula:d,ref:u,result:B(E,v)},k=!1):this.getCell(E,v).value=U?{sharedFormula:D,result:B(E,v)}:B(E,v)}addImage(u,d){const f={type:"image",imageId:u,range:d};this._media.push(new l(this,f))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){const d={type:"background",imageId:u};this._media.push(new l(this,d))}getBackgroundImageId(){const u=this._media.find(d=>d.type==="background");return u&&u.imageId}protect(u,d){return new Promise(f=>{this.sheetProtection={sheet:!0},d&&"spinCount"in d&&(d.spinCount=Number.isFinite(d.spinCount)?Math.round(Math.max(0,d.spinCount)):1e5),u&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=c.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=c.convertPasswordToHash(u,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),d&&(this.sheetProtection=Object.assign(this.sheetProtection,d),!u&&"spinCount"in d&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(u){const d=new i(this,u);return this.tables[u.name]=d,d}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return this.properties.tabColor}set tabColor(u){this.properties.tabColor=u}get model(){const u={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(w=>w.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(w=>w.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const d=u.rows=[],f=u.dimensions=new o;return this._rows.forEach(w=>{const x=w&&w.model;x&&(f.expand(x.number,x.min,x.number,x.max),d.push(x))}),u.merges=[],p.each(this._merges,w=>{u.merges.push(w.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(d=>{const f=new r(this,d.number);this._rows[f.number-1]=f,f.model=d})}_parseMergeCells(u){p.each(u.mergeCells,d=>{this.mergeCellsWithoutStyle(d)})}set model(u){this.name=u.name,this._columns=t.fromModel(this,u.cols),this._parseRows(u),this._parseMergeCells(u),this.dataValidations=new n(u.dataValidations),this.properties=u.properties,this.pageSetup=u.pageSetup,this.headerFooter=u.headerFooter,this.views=u.views,this.autoFilter=u.autoFilter,this._media=u.media.map(d=>new l(this,d)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((d,f)=>{const w=new i;return w.model=f,d[f.name]=w,d},{}),this.conditionalFormattings=u.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(s,C,_){s("core-js/modules/es.promise"),s("core-js/modules/es.promise.finally"),s("core-js/modules/es.object.assign"),s("core-js/modules/es.object.keys"),s("core-js/modules/es.object.values"),s("core-js/modules/es.symbol"),s("core-js/modules/es.symbol.async-iterator"),s("core-js/modules/es.array.iterator"),s("core-js/modules/es.array.includes"),s("core-js/modules/es.array.find-index"),s("core-js/modules/es.array.find"),s("core-js/modules/es.string.from-code-point"),s("core-js/modules/es.string.includes"),s("core-js/modules/es.number.is-nan"),s("regenerator-runtime/runtime");const p={Workbook:s("./doc/workbook")},a=s("./doc/enums");Object.keys(a).forEach(o=>{p[o]=a[o]}),C.exports=p},{"./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(s,C,_){const p=typeof TextDecoder=="undefined"?null:new TextDecoder("utf-8");_.bufferToString=function(a){return typeof a=="string"?a:p?p.decode(a):a.toString()}},{}],17:[function(s,C,_){const p=typeof TextEncoder=="undefined"?null:new TextEncoder("utf-8"),{Buffer:a}=s("buffer");_.stringToBuffer=function(o){return typeof o!="string"?o:p?a.from(p.encode(o).buffer):a.from(o)}},{buffer:220}],18:[function(s,C,_){const p=s("./under-dash"),a=s("./col-cache");C.exports=class{constructor(o){this.template=o,this.sheets={}}addCell(o){this.addCellEx(a.decodeEx(o))}getCell(o){return this.findCellEx(a.decodeEx(o),!0)}findCell(o){return this.findCellEx(a.decodeEx(o),!1)}findCellAt(o,r,t){const e=this.sheets[o],l=e&&e[r];return l&&l[t]}addCellEx(o){if(o.top)for(let r=o.top;r<=o.bottom;r++)for(let t=o.left;t<=o.right;t++)this.getCellAt(o.sheetName,r,t);else this.findCellEx(o,!0)}getCellEx(o){return this.findCellEx(o,!0)}findCellEx(o,r){const t=this.findSheet(o,r),e=this.findSheetRow(t,o,r);return this.findRowCell(e,o,r)}getCellAt(o,r,t){const e=this.sheets[o]||(this.sheets[o]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:o,address:a.n2l(t)+r,row:r,col:t})}removeCellEx(o){const r=this.findSheet(o);if(!r)return;const t=this.findSheetRow(r,o);t&&delete t[o.col]}forEachInSheet(o,r){const t=this.sheets[o];t&&t.forEach((e,l)=>{e&&e.forEach((i,n)=>{i&&r(i,l,n)})})}forEach(o){p.each(this.sheets,(r,t)=>{this.forEachInSheet(t,o)})}map(o){const r=[];return this.forEach(t=>{r.push(o(t))}),r}findSheet(o,r){const t=o.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(o,r,t){const{row:e}=r;return o&&o[e]?o[e]:t?o[e]=[]:void 0}findRowCell(o,r,t){const{col:e}=r;return o&&o[e]?o[e]:t?o[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(o,r,t,e){const l=this.sheets[o];if(l){const i=[];for(let n=0;n{n.splice(r,t,...i)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,C,_){const p=/^[A-Z]+\d+$/,a={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:o=>o<=26?1:o<=676?2:3,_fill(o){let r,t,e,l,i,n=1;if(o>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&o>=1){for(;n<=26;)r=this._dictionary[n-1],this._n2l[n]=r,this._l2n[r]=n,n++;this._l2nFill=1}if(this._l2nFill<2&&o>=2){for(n=27;n<=702;)t=n-27,e=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[e],this._n2l[n]=r,this._l2n[r]=n,n++;this._l2nFill=2}if(this._l2nFill<3&&o>=3){for(n=703;n<=16384;)t=n-703,e=t%26,l=Math.floor(t/26)%26,i=Math.floor(t/676),r=this._dictionary[i]+this._dictionary[l]+this._dictionary[e],this._n2l[n]=r,this._l2n[r]=n,n++;this._l2nFill=3}},l2n(o){if(this._l2n[o]||this._fill(o.length),!this._l2n[o])throw new Error("Out of bounds. Invalid column letter: "+o);return this._l2n[o]},n2l(o){if(o<1||o>16384)throw new Error(o+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[o]||this._fill(this._level(o)),this._n2l[o]},_hash:{},validateAddress(o){if(!p.test(o))throw new Error("Invalid Address: "+o);return!0},decodeAddress(o){const r=o.length<5&&this._hash[o];if(r)return r;let t=!1,e="",l=0,i=!1,n="",c=0;for(let u,d=0;d=65&&u<=90)t=!0,e+=o[d],l=26*l+u-64;else if(u>=48&&u<=57)i=!0,n+=o[d],c=10*c+u-48;else if(i&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;i||(c=void 0);const h={address:o=e+n,col:l,row:c,$col$row:`$${e}$${n}`};return l<=100&&c<=100&&(this._hash[o]=h,this._hash[h.$col$row]=h),h},getAddress(o,r){if(r){const t=this.n2l(r)+o;return this.decodeAddress(t)}return this.decodeAddress(o)},decode(o){const r=o.split(":");if(r.length===2){const t=this.decodeAddress(r[0]),e=this.decodeAddress(r[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(o)},decodeEx(o){const r=o.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let n=this.decodeAddress(l[0]),c=this.decodeAddress(l[1]);const h=Math.min(n.row,c.row),u=Math.min(n.col,c.col),d=Math.max(n.row,c.row),f=Math.max(n.col,c.col);return n=this.n2l(u)+h,c=this.n2l(f)+d,{top:h,left:u,bottom:d,right:f,sheetName:t,tl:{address:n,col:u,row:h,$col$row:`$${this.n2l(u)}$${h}`,sheetName:t},br:{address:c,col:f,row:d,$col$row:`$${this.n2l(f)}$${d}`,sheetName:t},dimensions:`${n}:${c}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const i=this.decodeAddress(e);return t?At({sheetName:t},i):i},encodeAddress:(o,r)=>a.n2l(r)+o,encode(){switch(arguments.length){case 2:return a.encodeAddress(arguments[0],arguments[1]);case 4:return`${a.encodeAddress(arguments[0],arguments[1])}:${a.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(o,r){const[t,e,,l,i]=o,[n,c]=r;return n>=t&&n<=l&&c>=e&&c<=i}};C.exports=a},{}],20:[function(s,C,_){const p=(o,r)=>At(At({},o),r.reduce((t,e)=>(o[e]&&(t[e]=At({},o[e])),t),{})),a=function(o,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];o[t]&&(r[t]=p(o[t],e))};_.copyStyle=o=>{if(!o)return o;if(r=o,Object.keys(r).length===0)return{};var r;const t=At({},o);return a(o,t,"font",["color"]),a(o,t,"alignment"),a(o,t,"protection"),o.border&&(a(o,t,"border"),a(o.border,t.border,"top",["color"]),a(o.border,t.border,"left",["color"]),a(o.border,t.border,"bottom",["color"]),a(o.border,t.border,"right",["color"]),a(o.border,t.border,"diagonal",["color"])),o.fill&&(a(o,t,"fill",["fgColor","bgColor","center"]),o.fill.stops&&(t.fill.stops=o.fill.stops.map(e=>p(e,["color"])))),t}},{}],21:[function(s,C,_){(function(p){(function(){const a=s("crypto"),o={hash(r){const t=a.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),i=1;ia.randomBytes(r)};C.exports=o}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,C,_){const{SaxesParser:p}=s("saxes"),{PassThrough:a}=s("readable-stream"),{bufferToString:o}=s("./browser-buffer-decode");C.exports=function(r){return kr(this,null,function*(){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new a));const t=new p;let e;t.on("error",u=>{e=u});let l=[];t.on("opentag",u=>l.push({eventType:"opentag",value:u})),t.on("text",u=>l.push({eventType:"text",value:u})),t.on("closetag",u=>l.push({eventType:"closetag",value:u}));try{for(var i=ir(r),n,c,h;n=!(c=yield new nr(i.next())).done;n=!1){const u=c.value;if(t.write(o(u)),e)throw e;yield l,l=[]}}catch(c){h=[c]}finally{try{n&&(c=i.return)&&(yield new nr(c.call(i)))}finally{if(h)throw h[0]}}})}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,C,_){const p=s("./col-cache"),a=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,o=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;C.exports={slideFormula:function(r,t,e){const l=p.decode(t),i=p.decode(e);return r.replace(a,(n,c,h,u,d)=>{if(d)return n;const f=o.exec(u);if(f){const w=f[1],x=f[2].toUpperCase(),A=f[3],N=f[4];if(x.length>3||x.length===3&&x>"XFD")return n;let L=p.l2n(x),O=parseInt(N,10);return w||(L+=i.col-l.col),A||(O+=i.row-l.row),(c||"")+(w||"")+p.n2l(L)+(A||"")+O}return n})}}},{"./col-cache":19}],24:[function(s,C,_){(function(p,a){(function(){const o=s("readable-stream"),r=s("./utils"),t=s("./string-buf");class e{constructor(d,f){this._data=d,this._encoding=f}get length(){return this.toBuffer().length}copy(d,f,w,x){return this.toBuffer().copy(d,f,w,x)}toBuffer(){return this._buffer||(this._buffer=a.from(this._data,this._encoding)),this._buffer}}class l{constructor(d){this._data=d}get length(){return this._data.length}copy(d,f,w,x){return this._data._buf.copy(d,f,w,x)}toBuffer(){return this._data.toBuffer()}}class i{constructor(d){this._data=d}get length(){return this._data.length}copy(d,f,w,x){this._data.copy(d,f,w,x)}toBuffer(){return this._data}}class n{constructor(d){this.size=d,this.buffer=a.alloc(d),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const d=a.alloc(this.iWrite-this.iRead);return this.buffer.copy(d,0,this.iRead,this.iWrite),d}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(d){let f;return d===0?null:d===void 0||d>=this.length?(f=this.toBuffer(),this.iRead=this.iWrite,f):(f=a.alloc(d),this.buffer.copy(f,0,this.iRead,d),this.iRead+=d,f)}write(d,f,w){const x=Math.min(w,this.size-this.iWrite);return d.copy(this.buffer,this.iWrite,f,f+x),this.iWrite+=x,x}}const c=function(u){u=u||{},this.bufSize=u.bufSize||1048576,this.buffers=[],this.batch=u.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(c,o.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return a.concat(this.buffers.map(u=>u.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const d=this.buffers[this.buffers.length-1];if(!d.full)return d}const u=new n(this.bufSize);return this.buffers.push(u),u},_pipe(u){return ne(this,null,function*(){yield Promise.all(this.pipes.map(function(d){return new Promise(f=>{d.write(u.toBuffer(),()=>{f()})})}))})},_writeToBuffers(u){let d=0;const f=u.length;for(;d1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(w),p.nextTick(f)):(yield this._pipe(w),f());else this.paused||this.emit("data",w.toBuffer()),this._writeToBuffers(w),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(u,d,f){const w=x=>{x?f(x):(this._flush(),this.pipes.forEach(A=>{A.end()}),this.emit("finish"))};u?this.write(u,d,w):w()},read(u){let d;if(u){for(d=[];u&&this.buffers.length&&!this.buffers[0].eod;){const f=this.buffers[0],w=f.read(u);u-=w.length,d.push(w),f.eod&&f.full&&this.buffers.shift()}return a.concat(d)}return d=this.buffers.map(f=>f.toBuffer()).filter(Boolean),this.buffers=[],a.concat(d)},setEncoding(u){this.encoding=u},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(u){this.pipes.push(u),!this.paused&&this.buffers.length&&this.end()},unpipe(u){this.pipes=this.pipes.filter(d=>d!==u)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),C.exports=c}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(s,C,_){(function(p){(function(){C.exports=class{constructor(a){this._buf=p.alloc(a&&a.size||16384),this._encoding=a&&a.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=p.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(a){a=a||0,this._buffer=void 0,this._inPos=a}_grow(a){let o=2*this._buf.length;for(;o=this._buf.length-4;)this._grow(this._inPos+a.length),o=this._inPos+this._buf.write(a,this._inPos,this._encoding);this._inPos=o}addStringBuf(a){a.length&&(this._buffer=void 0,this.length+a.length>this.capacity&&this._grow(this.length+a.length),a._buf.copy(this._buf,this._inPos,0,a.length),this._inPos+=a.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,C,_){const{toString:p}=Object.prototype,a=/["&<>]/,o={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(e=>{t(r[e],e)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(e=>t(r[e],e)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(e=>t(r[e],e)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(e=>t(r[e],e)):[]},keyBy:(r,t)=>r.reduce((e,l)=>(e[l[t]]=l,e),{}),isEqual:function(r,t){const e=typeof r,l=typeof t,i=Array.isArray(r),n=Array.isArray(t);let c;if(e!==l)return!1;switch(typeof r){case"object":if(i||n)return!(!i||!n)&&r.length===t.length&&r.every((h,u)=>{const d=t[u];return o.isEqual(h,d)});if(r===null||t===null)return r===t;if(c=Object.keys(r),Object.keys(t).length!==c.length)return!1;for(const h of c)if(!t.hasOwnProperty(h))return!1;return o.every(r,(h,u)=>{const d=t[u];return o.isEqual(h,d)});default:return r===t}},escapeHtml(r){const t=a.exec(r);if(!t)return r;let e="",l="",i=0,n=t.index;for(;n":l=">";break;default:continue}i!==n&&(e+=r.substring(i,n)),i=n+1,e+=l}return i!==n?e+r.substring(i,n):e},strcmp:(r,t)=>rt?1:0,isUndefined:r=>p.call(r)==="[object Undefined]",isObject:r=>p.call(r)==="[object Object]",deepMerge(){const r=arguments[0]||{},{length:t}=arguments;let e,l,i;function n(c,h){e=r[h],i=Array.isArray(c),o.isObject(c)||i?(i?(i=!1,l=e&&Array.isArray(e)?e:[]):l=e&&o.isObject(e)?e:{},r[h]=o.deepMerge(l,c)):o.isUndefined(c)||(r[h]=c)}for(let c=0;c&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{p.setImmediate?a(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,i,n){e.super_=l,n||(n=i,i=null),i&&Object.keys(i).forEach(h=>{Object.defineProperty(e,h,Object.getOwnPropertyDescriptor(i,h))});const c={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};n&&Object.keys(n).forEach(h=>{c[h]=Object.getOwnPropertyDescriptor(n,h)}),e.prototype=Object.create(l.prototype,c)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const i=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(i)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=r.exec(e);if(!l)return e;let i="",n="",c=0,h=l.index;for(;h=11&&u!==13)){n="";break}continue}c!==h&&(i+=e.substring(c,h)),c=h+1,n&&(i+=n)}return c!==h?i+e.substring(c,h):i},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{o.access(e,o.constants.F_OK,i=>{l(!i)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>e===!0||e==="true"||e===1||e==="1"};C.exports=t}).call(this)}).call(this,typeof Qt!="undefined"?Qt:typeof self!="undefined"?self:typeof window!="undefined"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,C,_){const p=s("./under-dash"),a=s("./utils");function o(e,l,i){e.push(` ${l}="${a.xmlEncode(i.toString())}"`)}function r(e,l){if(l){const i=[];p.each(l,(n,c)=>{n!==void 0&&o(i,c,n)}),e.push(i.join(""))}}class t{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(l){const i=this._xml;i.push(" `)}openNode(l,i){const n=this.tos,c=this._xml;n&&this.open&&c.push(">"),this._stack.push(l),c.push("<"),c.push(l),r(c,i),this.leaf=!0,this.open=!0}addAttribute(l,i){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");i!==void 0&&o(this._xml,l,i)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){const i=this._xml;this.open&&(i.push(">"),this.open=!1),this.leaf=!1,i.push(a.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),i=this._xml;this.leaf?i.push("/>"):(i.push("")),this.open=!1,this.leaf=!1}leafNode(l,i,n){this.openNode(l,i),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(){const l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},C.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,C,_){(function(p){(function(){const a=s("events"),o=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends a.EventEmitter{constructor(i){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},i),this.zip=new o,this.stream=new r}append(i,n){n.hasOwnProperty("base64")&&n.base64?this.zip.file(n.name,i,{base64:!0}):(p.browser&&typeof i=="string"&&(i=t(i)),this.zip.file(n.name,i))}finalize(){return ne(this,null,function*(){const i=yield this.zip.generateAsync(this.options);this.stream.end(i),this.emit("finish")})}read(i){return this.stream.read(i)}setEncoding(i){return this.stream.setEncoding(i)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(i,n){return this.stream.pipe(i,n)}unpipe(i){return this.stream.unpipe(i)}unshift(i){return this.stream.unshift(i)}wrap(i){return this.stream.wrap(i)}}C.exports={ZipWriter:e}}).call(this)}).call(this,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,C,_){C.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(s,C,_){C.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(s,C,_){const p=s("../../utils/parse-sax"),a=s("../../utils/xml-stream");class o{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof o?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}parse(t){return ne(this,null,function*(){try{for(var e=ir(t),l,i,n;l=!(i=yield e.next()).done;l=!1){const c=i.value;for(const{eventType:h,value:u}of c)if(h==="opentag")this.parseOpen(u);else if(h==="text")this.parseText(u);else if(h==="closetag"&&!this.parseClose(u.name))return this.model}}catch(i){n=[i]}finally{try{l&&(i=e.return)&&(yield i.call(e))}finally{if(n)throw n[0]}}return this.model})}parseStream(t){return ne(this,null,function*(){return this.parse(p(t))})}get xml(){return this.toXml(this.model)}toXml(t){const e=new a;return this.render(e,t),e.xml}static toAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t.toString()}static toStringAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return o.toAttribute(t,e,l)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return o.toAttribute(t,e,l)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return o.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}C.exports=o},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,C,_){const p=s("../base-xform"),a=s("../../../utils/col-cache");function o(t){try{return a.decodeEx(t),!0}catch(e){return!1}}function r(t){const e=[];let l=!1,i="";return t.split(",").forEach(n=>{if(!n)return;const c=(n.match(/'/g)||[]).length;if(!c)return void(l?i+=n+",":o(n)&&e.push(n));const h=c%2==0;!l&&h&&o(n)?e.push(n):l&&!h?(l=!1,o(i+n)&&e.push(i+n),i=""):(l=!0,i+=n+",")}),e}C.exports=class extends p{render(t,e){t.openNode("definedName",{name:e.name,localSheetId:e.localSheetId}),t.writeText(e.ranges.join(",")),t.closeNode()}parseOpen(t){switch(t.name){case"definedName":return this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(s,C,_){const p=s("../../../utils/utils"),a=s("../base-xform");C.exports=class extends a{render(o,r){o.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(o){return o.name==="sheet"&&(this.model={name:p.xmlDecode(o.attributes.name),id:parseInt(o.attributes.sheetId,10),state:o.attributes.state,rId:o.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){a.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:o.fullCalcOnLoad?1:void 0})}parseOpen(a){return a.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){a.leafNode("workbookPr",{date1904:o.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(a){return a.name==="workbookPr"&&(this.model={date1904:a.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){const r={xWindow:o.x||0,yWindow:o.y||0,windowWidth:o.width||12e3,windowHeight:o.height||24e3,firstSheet:o.firstSheet,activeTab:o.activeTab};o.visibility&&o.visibility!=="visible"&&(r.visibility=o.visibility),a.leafNode("workbookView",r)}parseOpen(a){if(a.name==="workbookView"){const o=this.model={},r=function(e,l,i){const n=l!==void 0?o[e]=l:i;n!==void 0&&(o[e]=n)},t=function(e,l,i){const n=l!==void 0?o[e]=parseInt(l,10):i;n!==void 0&&(o[e]=n)};return t("x",a.attributes.xWindow,0),t("y",a.attributes.yWindow,0),t("width",a.attributes.windowWidth,25e3),t("height",a.attributes.windowHeight,1e4),r("visibility",a.attributes.visibility,"visible"),t("activeTab",a.attributes.activeTab,void 0),t("firstSheet",a.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),r=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),i=s("./sheet-xform"),n=s("./workbook-view-xform"),c=s("./workbook-properties-xform"),h=s("./workbook-calc-properties-xform");class u extends r{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new c,bookViews:new e({tag:"bookViews",count:!1,childXform:new n}),sheets:new e({tag:"sheets",count:!1,childXform:new i}),definedNames:new e({tag:"definedNames",count:!1,childXform:new l}),calcPr:new h}}prepare(f){f.sheets=f.worksheets;const w=[];let x=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(N=>{const L=N.split(":"),O={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${L[0]}:$${L[1]}`],localSheetId:x};w.push(O)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const N=[];if(A.pageSetup.printTitlesColumn){const O=A.pageSetup.printTitlesColumn.split(":");N.push(`'${A.name}'!$${O[0]}:$${O[1]}`)}if(A.pageSetup.printTitlesRow){const O=A.pageSetup.printTitlesRow.split(":");N.push(`'${A.name}'!$${O[0]}:$${O[1]}`)}const L={name:"_xlnm.Print_Titles",ranges:N,localSheetId:x};w.push(L)}x++}),w.length&&(f.definedNames=f.definedNames.concat(w)),(f.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(f,w){f.openXml(o.StdDocAttributes),f.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,w.properties),this.map.bookViews.render(f,w.views),this.map.sheets.render(f,w.sheets),this.map.definedNames.render(f,w.definedNames),this.map.calcPr.render(f,w.calcProperties),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"workbook":return!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){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(f){const w=(f.workbookRels||[]).reduce((O,P)=>(O[P.Id]=P,O),{}),x=[];let A,N=0;(f.sheets||[]).forEach(O=>{const P=w[O.rId];P&&(A=f.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=O.name,A.id=O.id,A.state=O.state,x[N++]=A))});const L=[];p.each(f.definedNames,O=>{if(O.name==="_xlnm.Print_Area"){if(A=x[O.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=a.decodeEx(O.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(O.name==="_xlnm.Print_Titles"){if(A=x[O.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=O.ranges.join(","),D=/\$/g,U=/\$\d+:\$\d+/,B=P.match(U);if(B&&B.length){const v=B[0];A.pageSetup.printTitlesRow=v.replace(D,"")}const k=/\$[A-Z]+:\$[A-Z]+/,E=P.match(k);if(E&&E.length){const v=E[0];A.pageSetup.printTitlesColumn=v.replace(D,"")}}}else L.push(O)}),f.definedNames=L,f.media.forEach((O,P)=>{O.index=P})}}u.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"},u.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},C.exports=u},{"../../../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(s,C,_){const p=s("../strings/rich-text-xform"),a=s("../../../utils/utils"),o=s("../base-xform"),r=C.exports=function(t){this.model=t};a.inherits(r,o,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new p),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model=At({type:"note",note:{texts:[]}},t.attributes),!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){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(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../../../utils/utils"),o=s("../base-xform"),r=s("./comment-xform"),t=C.exports=function(){this.map={comment:new r}};a.inherits(t,o,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,l){l=l||this.model,e.openXml(p.StdDocAttributes),e.openNode("comments",t.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),l.comments.forEach(i=>{this.map.comment.render(e,i)}),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(s,C,_){const p=s("../../base-xform");C.exports=class extends p{constructor(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o,r){(o===r[2]||this.tag==="x:SizeWithCells"&&o===r[1])&&a.leafNode(this.tag)}parseOpen(a){switch(a.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(s,C,_){const p=s("../../base-xform");C.exports=class extends p{constructor(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(a){switch(a.name){case this.tag:return this.text="",!0;default:return!1}}parseText(a){this.text=a}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"x:Anchor"}getAnchorRect(a){const o=Math.floor(a.left),r=Math.floor(68*(a.left-o)),t=Math.floor(a.top),e=Math.floor(18*(a.top-t)),l=Math.floor(a.right),i=Math.floor(68*(a.right-l)),n=Math.floor(a.bottom);return[o,r,t,e,l,i,n,Math.floor(18*(a.bottom-n))]}getDefaultRect(a){const o=a.col,r=Math.max(a.row-2,0);return[o,6,r,14,o+2,2,r+4,16]}render(a,o){const r=o.anchor?this.getAnchorRect(o.anchor):this.getDefaultRect(o.refAddress);a.leafNode("x:Anchor",null,r.join(", "))}parseOpen(a){switch(a.name){case this.tag:return this.text="",!0;default:return!1}}parseText(a){this.text=a}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,C,_){const p=s("../base-xform"),a=s("./vml-anchor-xform"),o=s("./style/vml-protection-xform"),r=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];C.exports=class extends p{constructor(){super(),this.map={"x:Anchor":new a,"x:Locked":new o({tag:"x:Locked"}),"x:LockText":new o({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:i,editAs:n}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,n,t),this.map["x:SizeWithCells"].render(e,n,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,i.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,i.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.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(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],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(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./vml-shape-xform");class r extends a{constructor(){super(),this.map={"v:shape":new o}}get tag(){return"xml"}render(e,l){e.openXml(p.StdDocAttributes),e.openNode(this.tag,r.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(),l.comments.forEach((i,n)=>{this.map["v:shape"].render(e,i,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,l){e.anchors.forEach(i=>{i.br?this.map["xdr:twoCellAnchor"].reconcile(i,l):this.map["xdr:oneCellAnchor"].reconcile(i,l)})}}r.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"},C.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(s,C,_){const p=s("../base-xform"),a=s("./vml-textbox-xform"),o=s("./vml-client-data-xform");class r extends p{constructor(){super(),this.map={"v:textbox":new a,"x:ClientData":new o}}get tag(){return"v:shape"}render(e,l,i){e.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,i)),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,l),this.map["x:ClientData"].render(e,l),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}}}r.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),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":t.note.margins&&t.note.margins.insetmode}),C.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"v:textbox"}conversionUnit(a,o,r){return`${parseFloat(a)*o.toFixed(2)}${r}`}reverseConversionUnit(a){return(a||"").split(",").map(o=>Number(parseFloat(this.conversionUnit(parseFloat(o),.1,"")).toFixed(2)))}render(a,o){const r={style:"mso-direction-alt:auto"};if(o&&o.note){let{inset:t}=o.note&&o.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}a.openNode("v:textbox",r),a.leafNode("div",{style:"text-align:left"}),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:return this.model={inset:this.reverseConversionUnit(a.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(a){switch(a){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(s,C,_){const p=s("./base-xform");C.exports=class extends p{createNewModel(a){return{}}parseOpen(a){return this.parser=this.parser||this.map[a.name],this.parser?(this.parser.parseOpen(a),!0):a.name===this.tag&&(this.model=this.createNewModel(a),!0)}parseText(a){this.parser&&this.parser.parseText(a)}onParserClose(a,o){this.model[a]=o.model}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.onParserClose(a,this.parser),this.parser=void 0),!0):a!==this.tag}}},{"./base-xform":32}],49:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){a.openNode("HeadingPairs"),a.openNode("vt:vector",{size:2,baseType:"variant"}),a.openNode("vt:variant"),a.leafNode("vt:lpstr",void 0,"Worksheets"),a.closeNode(),a.openNode("vt:variant"),a.leafNode("vt:i4",void 0,o.length),a.closeNode(),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="HeadingPairs"}parseText(){}parseClose(a){return a!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){a.openNode("TitlesOfParts"),a.openNode("vt:vector",{size:o.length,baseType:"lpstr"}),o.forEach(r=>{a.leafNode("vt:lpstr",void 0,r.name)}),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="TitlesOfParts"}parseText(){}parseClose(a){return a!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends a{constructor(){super(),this.map={Company:new o({tag:"Company"}),Manager:new o({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(i,n){i.openXml(p.StdDocAttributes),i.openNode("Properties",e.PROPERTY_ATTRIBUTES),i.leafNode("Application",void 0,"Microsoft Excel"),i.leafNode("DocSecurity",void 0,"0"),i.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(i,n.worksheets),this.map.TitleOfParts.render(i,n.worksheets),this.map.Company.render(i,n.company||""),this.map.Manager.render(i,n.manager),i.leafNode("LinksUpToDate",void 0,"false"),i.leafNode("SharedDoc",void 0,"false"),i.leafNode("HyperlinksChanged",void 0,"false"),i.leafNode("AppVersion",void 0,"16.0300"),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"Properties":return!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},C.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform");class o extends a{render(t,e){t.openXml(p.StdDocAttributes),t.openNode("Types",o.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(i=>{if(i.type==="image"){const n=i.extension;l[n]||(l[n]=!0,t.leafNode("Default",{Extension:n,ContentType:"image/"+n}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(i=>{const n=`/xl/worksheets/sheet${i.id}.xml`;t.leafNode("Override",{PartName:n,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach(i=>{t.leafNode("Override",{PartName:"/xl/tables/"+i.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(i=>{t.leafNode("Override",{PartName:`/xl/drawings/${i.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach(i=>{let{commentName:n}=i;t.leafNode("Override",{PartName:`/xl/${n}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}o.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},C.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends a{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new o({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new o({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new o({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(i,n){i.openXml(p.StdDocAttributes),i.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(i,n.creator),this.map["dc:title"].render(i,n.title),this.map["dc:subject"].render(i,n.subject),this.map["dc:description"].render(i,n.description),this.map["dc:identifier"].render(i,n.identifier),this.map["dc:language"].render(i,n.language),this.map["cp:keywords"].render(i,n.keywords),this.map["cp:category"].render(i,n.category),this.map["cp:lastModifiedBy"].render(i,n.lastModifiedBy),this.map["cp:lastPrinted"].render(i,n.lastPrinted),this.map["cp:revision"].render(i,n.revision),this.map["cp:version"].render(i,n.version),this.map["cp:contentStatus"].render(i,n.contentStatus),this.map["cp:contentType"].render(i,n.contentType),this.map["dcterms:created"].render(i,n.created),this.map["dcterms:modified"].render(i,n.modified),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[i.name],this.parser)return this.parser.parseOpen(i),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(i))}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+i)}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.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"},C.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{render(a,o){a.leafNode("Relationship",o)}parseOpen(a){switch(a.name){case"Relationship":return this.model=a.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./relationship-xform");class r extends a{constructor(){super(),this.map={Relationship:new o}}render(e,l){l=l||this._values,e.openXml(p.StdDocAttributes),e.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(i=>{this.map.Relationship.render(e,i)}),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 new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},C.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset(),this.model={range:{editAs:a.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}reconcilePicture(a,o){if(a&&a.rId){const r=o.rels[a.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=o.mediaIndex[t];return o.media[e]}}}}},{"../base-xform":32}],57:[function(s,C,_){const p=s("../base-xform"),a=s("./blip-xform");C.exports=class extends p{constructor(){super(),this.map={"a:blip":new a}}get tag(){return"xdr:blipFill"}render(o,r){o.openNode(this.tag),this.map["a:blip"].render(o,r),o.openNode("a:stretch"),o.leafNode("a:fillRect"),o.closeNode(),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset();break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(){}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.parser=void 0),!0;switch(o){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"a:blip"}render(a,o){a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":o.rId,cstate:"print"})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(a){switch(a){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"xdr:cNvPicPr"}render(a){a.openNode(this.tag),a.leafNode("a:picLocks",{noChangeAspect:"1"}),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){switch(a){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,C,_){const p=s("../base-xform"),a=s("./hlink-click-xform"),o=s("./ext-lst-xform");C.exports=class extends p{constructor(){super(),this.map={"a:hlinkClick":new a,"a:extLst":new o}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,C,_){const p=s("../base-xform"),a=s("../simple/integer-xform");C.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.map={"xdr:col":new a({tag:"xdr:col",zero:!0}),"xdr:colOff":new a({tag:"xdr:colOff",zero:!0}),"xdr:row":new a({tag:"xdr:row",zero:!0}),"xdr:rowOff":new a({tag:"xdr:rowOff",zero:!0})}}render(o,r){o.openNode(this.tag),this.map["xdr:col"].render(o,r.nativeCol),this.map["xdr:colOff"].render(o,r.nativeColOff),this.map["xdr:row"].render(o,r.nativeRow),this.map["xdr:rowOff"].render(o,r.nativeRowOff),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset();break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.parser=void 0),!0;switch(o){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(s,C,_){const p=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),o=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends o{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(i){i.anchors.forEach((n,c)=>{n.anchorType=function(h){return(typeof h.range=="string"?p.decode(h.range):h.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(n),this.map[n.anchorType].prepare(n,{index:c})})}get tag(){return"xdr:wsDr"}render(i,n){i.openXml(a.StdDocAttributes),i.openNode(this.tag,e.DRAWING_ATTRIBUTES),n.anchors.forEach(c=>{this.map[c.anchorType].render(i,c)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(i){case this.tag:return!1;default:return!0}}reconcile(i,n){i.anchors.forEach(c=>{c.br?this.map["xdr:twoCellAnchor"].reconcile(c,n):this.map["xdr:oneCellAnchor"].reconcile(c,n)})}}e.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},C.exports=e},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"a:extLst"}render(a){a.openNode(this.tag),a.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),a.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),a.closeNode(),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){switch(a){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.map={}}render(a,o){a.openNode(this.tag);const r=Math.floor(9525*o.width),t=Math.floor(9525*o.height);a.addAttribute("cx",r),a.addAttribute("cy",t),a.closeNode()}parseOpen(a){return a.name===this.tag&&(this.model={width:parseInt(a.attributes.cx||"0",10)/9525,height:parseInt(a.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"a:hlinkClick"}render(a,o){o.hyperlinks&&o.hyperlinks.rId&&a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":o.hyperlinks.rId,tooltip:o.hyperlinks.tooltip})}parseOpen(a){switch(a.name){case this.tag:return this.model={hyperlinks:{rId:a.attributes["r:id"],tooltip:a.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,C,_){const p=s("../base-xform"),a=s("./c-nv-pr-xform"),o=s("./c-nv-pic-pr-xform");C.exports=class extends p{constructor(){super(),this.map={"xdr:cNvPr":new a,"xdr:cNvPicPr":new o}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,C,_){const p=s("./base-cell-anchor-xform"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");C.exports=class extends p{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new a({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,l){this.map["xdr:pic"].prepare(e.picture,l)}render(e,l){e.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,l.range.tl),this.map["xdr:ext"].render(e,l.range.ext),this.map["xdr:pic"].render(e,l.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,l){e.medium=this.reconcilePicture(e.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(s,C,_){const p=s("../base-xform"),a=s("../static-xform"),o=s("./blip-fill-xform"),r=s("./nv-pic-pr-xform"),t=s("./sp-pr");C.exports=class extends p{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new o,"xdr:spPr":new a(t)}}get tag(){return"xdr:pic"}prepare(e,l){e.index=l.index+1}render(e,l){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,l),this.map["xdr:blipFill"].render(e,l),this.map["xdr:spPr"].render(e,l),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(s,C,_){C.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(s,C,_){const p=s("./base-cell-anchor-xform"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./pic-xform");C.exports=class extends p{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:to":new o({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new a({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:to"].render(t,e.range.br),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(s,C,_){const p=s("./base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.always=!!a.always,this.count=a.count,this.empty=a.empty,this.$count=a.$count||"count",this.$=a.$,this.childXform=a.childXform,this.maxItems=a.maxItems}prepare(a,o){const{childXform:r}=this;a&&a.forEach((t,e)=>{o.index=e,r.prepare(t,o)})}render(a,o){if(this.always||o&&o.length){a.openNode(this.tag,this.$),this.count&&a.addAttribute(this.$count,o&&o.length||0);const{childXform:r}=this;(o||[]).forEach((t,e)=>{r.render(a,t,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(a)&&(this.parser=this.childXform,!0)}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser){if(!this.parser.parseClose(a)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(a,o){if(a){const{childXform:r}=this;a.forEach(t=>{r.reconcile(t,o)})}}}},{"./base-xform":32}],72:[function(s,C,_){const p=s("../../../utils/col-cache"),a=s("../base-xform");C.exports=class extends a{get tag(){return"autoFilter"}render(o,r){if(r)if(typeof r=="string")o.leafNode("autoFilter",{ref:r});else{const t=function(i){return typeof i=="string"?i:p.getAddress(i.row,i.column).address},e=t(r.from),l=t(r.to);e&&l&&o.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(o){o.name==="autoFilter"&&(this.model=o.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,C,_){const p=s("../../../utils/utils"),a=s("../base-xform"),o=s("../../../doc/range"),r=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}C.exports=class extends a{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,i){const n=i.styles.addStyleModel(l.style||{},function(c){switch(c.type){case r.ValueType.Formula:return e(c.result);default:return c.type}}(l));switch(n&&(l.styleId=n),l.comment&&i.comments.push(Ae(At({},l.comment),{ref:l.address})),l.type){case r.ValueType.String:case r.ValueType.RichText:i.sharedStrings&&(l.ssId=i.sharedStrings.add(l.value));break;case r.ValueType.Date:i.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:i.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=i.sharedStrings.add(l.text)),i.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:i.merges.add(l);break;case r.ValueType.Formula:if(i.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=i.siFormulae++),l.formula)i.formulae[l.address]=l;else if(l.sharedFormula){const c=i.formulae[l.sharedFormula];if(!c)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);c.si===void 0?(c.shareType="shared",c.si=i.siFormulae++,c.range=new o(c.address,l.address)):c.range&&c.range.expandToAddress(l.address),l.si=c.si}}}renderFormula(l,i){let n=null;switch(i.shareType){case"shared":n={t:"shared",ref:i.ref||i.range.range,si:i.si};break;case"array":n={t:"array",ref:i.ref};break;default:i.si!==void 0&&(n={t:"shared",si:i.si})}switch(e(i.result)){case r.ValueType.Null:l.leafNode("f",n,i.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",n,i.formula),l.leafNode("v",null,i.result);break;case r.ValueType.Number:l.leafNode("f",n,i.formula),l.leafNode("v",null,i.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",n,i.formula),l.leafNode("v",null,i.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",n,i.formula),l.leafNode("v",null,i.result.error);break;case r.ValueType.Date:l.leafNode("f",n,i.formula),l.leafNode("v",null,p.dateToExcel(i.result,i.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,i){if(i.type!==r.ValueType.Null||i.styleId){switch(l.openNode("c"),l.addAttribute("r",i.address),i.styleId&&l.addAttribute("s",i.styleId),i.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,i.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,i.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,i.value.error);break;case r.ValueType.String:case r.ValueType.RichText:i.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,i.ssId)):i.value&&i.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),i.value.richText.forEach(n=>{this.richTextXForm.render(l,n)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,i.value));break;case r.ValueType.Date:l.leafNode("v",null,p.dateToExcel(i.value,i.date1904));break;case r.ValueType.Hyperlink:i.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,i.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,i.text));break;case r.ValueType.Formula:this.renderFormula(l,i);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.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(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;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+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:i}=this;if(i.formula||i.shareType)i.type=r.ValueType.Formula,i.value&&(this.t==="str"?i.result=p.xmlDecode(i.value):this.t==="b"?i.result=parseInt(i.value,10)!==0:this.t==="e"?i.result={error:i.value}:i.result=parseFloat(i.value),i.value=void 0);else if(i.value!==void 0)switch(this.t){case"s":i.type=r.ValueType.String,i.value=parseInt(i.value,10);break;case"str":i.type=r.ValueType.String,i.value=p.xmlDecode(i.value);break;case"inlineStr":i.type=r.ValueType.String;break;case"b":i.type=r.ValueType.Boolean,i.value=parseInt(i.value,10)!==0;break;case"e":i.type=r.ValueType.Error,i.value={error:i.value};break;default:i.type=r.ValueType.Number,i.value=parseFloat(i.value)}else i.styleId?i.type=r.ValueType.Null:i.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!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(l),!0)}}reconcile(l,i){const n=l.styleId&&i.styles&&i.styles.getStyleModel(l.styleId);switch(n&&(l.style=n),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&i.sharedStrings&&(l.value=i.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:n&&p.isDateFmt(n.numFmt)&&(l.type=r.ValueType.Date,l.value=p.excelToDate(l.value,i.date1904));break;case r.ValueType.Formula:l.result!==void 0&&n&&p.isDateFmt(n.numFmt)&&(l.result=p.excelToDate(l.result,i.date1904)),l.shareType==="shared"&&(l.ref?i.formulae[l.si]=l.address:(l.sharedFormula=i.formulae[l.si],delete l.shareType),delete l.si)}const c=i.hyperlinkMap[l.address];c&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=c);const h=i.commentsMap&&i.commentsMap[l.address];h&&(l.comment=h)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(s,C,_){const p=s("../../base-xform");C.exports=class extends p{get tag(){return"x14:cfIcon"}render(a,o){a.leafNode(this.tag,{iconSet:o.iconSet,iconId:o.iconId})}parseOpen(a){let{attributes:o}=a;this.model={iconSet:o.iconSet,iconId:p.toIntValue(o.iconId)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],75:[function(s,C,_){const{v4:p}=s("uuid"),a=s("../../base-xform"),o=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends o{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(n){return n.type==="dataBar"?r.isExt(n):!(n.type!=="iconSet"||!n.custom&&!e[n.iconSet])}prepare(n){l.isExt(n)&&(n.x14Id=`{${p()}}`.toUpperCase())}render(n,c){if(l.isExt(c))switch(c.type){case"dataBar":this.renderDataBar(n,c);break;case"iconSet":this.renderIconSet(n,c)}}renderDataBar(n,c){n.openNode(this.tag,{type:"dataBar",id:c.x14Id}),this.databarXform.render(n,c),n.closeNode()}renderIconSet(n,c){n.openNode(this.tag,{type:"iconSet",priority:c.priority,id:c.x14Id||`{${p()}}`}),this.iconSetXform.render(n,c),n.closeNode()}createNewModel(n){let{attributes:c}=n;return{type:c.type,x14Id:c.id,priority:a.toIntValue(c.priority)}}onParserClose(n,c){Object.assign(this.model,c.model)}}C.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(s,C,_){const p=s("../../composite-xform"),a=s("./f-ext-xform");C.exports=class extends p{constructor(){super(),this.map={"xm:f":this.fExtXform=new a}}get tag(){return"x14:cfvo"}render(o,r){o.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(o,r.value),o.closeNode()}createNewModel(o){return{type:o.attributes.type}}onParserClose(o,r){switch(o){case"xm:f":this.model.value=r.model?parseFloat(r.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,C,_){const p=s("../../composite-xform"),a=s("./sqref-ext-xform"),o=s("./cf-rule-ext-xform");C.exports=class extends p{constructor(){super(),this.map={"xm:sqref":this.sqRef=new a,"x14:cfRule":this.cfRule=new o}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(o.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(o.isExt).forEach(e=>this.cfRule.render(r,e)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){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(s,C,_){const p=s("../../composite-xform"),a=s("./cf-rule-ext-xform"),o=s("./conditional-formatting-ext-xform");C.exports=class extends p{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new o}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(a.isExt))),r.hasExtContent}prepare(r,t){r.forEach(e=>{this.cfXform.prepare(e,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(e=>this.cfXform.render(r,e)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(s,C,_){const p=s("../../base-xform"),a=s("../../composite-xform"),o=s("../../style/color-xform"),r=s("./cfvo-ext-xform");C.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new o("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new o("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new o("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new o("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:p.toIntAttribute(e.minLength,0,!0),maxLength:p.toIntAttribute(e.maxLength,100,!0),border:p.toBoolAttribute(e.border,!1),gradient:p.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toAttribute(e.axisPosition,"auto"),direction:p.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:p.toIntValue(e.minLength,0),maxLength:p.toIntValue(e.maxLength,100),border:p.toBoolValue(e.border,!1),gradient:p.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toStringValue(e.axisPosition,"auto"),direction:p.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(s,C,_){const p=s("../../base-xform");C.exports=class extends p{get tag(){return"xm:f"}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],81:[function(s,C,_){const p=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");C.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"x14:cfIcon":this.cfIconXform=new r}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:p.toStringAttribute(e.iconSet),reverse:p.toBoolAttribute(e.reverse,!1),showValue:p.toBoolAttribute(e.showValue,!0),custom:p.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),e.icons&&e.icons.forEach((l,i)=>{l.iconId=i,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:p.toStringValue(e.iconSet,"3TrafficLights"),reverse:p.toBoolValue(e.reverse,!1),showValue:p.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(s,C,_){const p=s("../../base-xform");C.exports=class extends p{get tag(){return"xm:sqref"}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],83:[function(s,C,_){const p=s("../../base-xform"),a=s("../../composite-xform"),o=s("../../../../doc/range"),r=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),i=s("./icon-set-xform"),n={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},c=u=>{const{type:d,operator:f}=u;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:f}}};class h extends a{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new i}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!n[d.iconSet]}render(d,f){switch(f.type){case"expression":this.renderExpression(d,f);break;case"cellIs":this.renderCellIs(d,f);break;case"top10":this.renderTop10(d,f);break;case"aboveAverage":this.renderAboveAverage(d,f);break;case"dataBar":this.renderDataBar(d,f);break;case"colorScale":this.renderColorScale(d,f);break;case"iconSet":this.renderIconSet(d,f);break;case"containsText":this.renderText(d,f);break;case"timePeriod":this.renderTimePeriod(d,f)}}renderExpression(d,f){d.openNode(this.tag,{type:"expression",dxfId:f.dxfId,priority:f.priority}),this.formulaXform.render(d,f.formulae[0]),d.closeNode()}renderCellIs(d,f){d.openNode(this.tag,{type:"cellIs",dxfId:f.dxfId,priority:f.priority,operator:f.operator}),f.formulae.forEach(w=>{this.formulaXform.render(d,w)}),d.closeNode()}renderTop10(d,f){d.leafNode(this.tag,{type:"top10",dxfId:f.dxfId,priority:f.priority,percent:p.toBoolAttribute(f.percent,!1),bottom:p.toBoolAttribute(f.bottom,!1),rank:p.toIntValue(f.rank,10,!0)})}renderAboveAverage(d,f){d.leafNode(this.tag,{type:"aboveAverage",dxfId:f.dxfId,priority:f.priority,aboveAverage:p.toBoolAttribute(f.aboveAverage,!0)})}renderDataBar(d,f){d.openNode(this.tag,{type:"dataBar",priority:f.priority}),this.databarXform.render(d,f),this.extLstRefXform.render(d,f),d.closeNode()}renderColorScale(d,f){d.openNode(this.tag,{type:"colorScale",priority:f.priority}),this.colorScaleXform.render(d,f),d.closeNode()}renderIconSet(d,f){h.isPrimitive(f)&&(d.openNode(this.tag,{type:"iconSet",priority:f.priority}),this.iconSetXform.render(d,f),d.closeNode())}renderText(d,f){d.openNode(this.tag,{type:f.operator,dxfId:f.dxfId,priority:f.priority,operator:p.toStringAttribute(f.operator,"containsText")});const w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new o(x.ref),{tl:N}=A;switch(x.operator){case"containsText":return`NOT(ISERROR(SEARCH("${x.text}",${N})))`;case"containsBlanks":return`LEN(TRIM(${N}))=0`;case"notContainsBlanks":return`LEN(TRIM(${N}))>0`;case"containsErrors":return`ISERROR(${N})`;case"notContainsErrors":return`NOT(ISERROR(${N}))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}renderTimePeriod(d,f){d.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new o(x.ref),{tl:N}=A;switch(x.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${N},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${N},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${N},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${N},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${N},1)=TODAY()-1`;case"today":return`FLOOR(${N},1)=TODAY()`;case"tomorrow":return`FLOOR(${N},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${N},1)<=6,FLOOR(${N},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0-1)),YEAR(${N})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${N})=MONTH(TODAY()),YEAR(${N})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0+1)),YEAR(${N})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}createNewModel(d){let{attributes:f}=d;return Ae(At({},c(f)),{dxfId:p.toIntValue(f.dxfId),priority:p.toIntValue(f.priority),timePeriod:f.timePeriod,percent:p.toBoolValue(f.percent),bottom:p.toBoolValue(f.bottom),rank:p.toIntValue(f.rank),aboveAverage:p.toBoolValue(f.aboveAverage)})}onParserClose(d,f){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,f.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(f.model)}}}C.exports=h},{"../../../../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(s,C,_){const p=s("../../base-xform");C.exports=class extends p{get tag(){return"cfvo"}render(a,o){a.leafNode(this.tag,{type:o.type,val:o.value})}parseOpen(a){this.model={type:a.attributes.type,value:p.toFloatValue(a.attributes.val)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],85:[function(s,C,_){const p=s("../../composite-xform"),a=s("../../style/color-xform"),o=s("./cfvo-xform");C.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),t.color.forEach(e=>{this.colorXform.render(r,e)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(s,C,_){const p=s("../../composite-xform"),a=s("./cf-rule-xform");C.exports=class extends p{constructor(){super(),this.map={cfRule:new a}}get tag(){return"conditionalFormatting"}render(o,r){r.rules.some(a.isPrimitive)&&(o.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{a.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(o,t))}),o.closeNode())}createNewModel(o){let{attributes:r}=o;return{ref:r.sqref,rules:[]}}onParserClose(o,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,C,_){const p=s("../../base-xform"),a=s("./conditional-formatting-xform");C.exports=class extends p{constructor(){super(),this.cfXform=new a}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(o,r){let t=o.reduce((e,l)=>Math.max(e,...l.rules.map(i=>i.priority||0)),1);o.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(o,r){r.forEach(t=>{this.cfXform.render(o,t)})}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(o),!0;default:return!1}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(!!this.parser.parseClose(o)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(o,r){o.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=r.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(s,C,_){const p=s("../../composite-xform"),a=s("../../style/color-xform"),o=s("./cfvo-xform");C.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){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(s,C,_){const p=s("../../base-xform"),a=s("../../composite-xform");class o extends p{get tag(){return"x14:id"}render(e,l){e.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class r extends a{constructor(){super(),this.map={"x14:id":this.idXform=new o}}get tag(){return"ext"}render(e,l){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,l.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,l){this.model.x14Id=l.model}}C.exports=class extends a{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(s,C,_){const p=s("../../base-xform");C.exports=class extends p{get tag(){return"formula"}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],91:[function(s,C,_){const p=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-xform");C.exports=class extends a{constructor(){super(),this.map={cfvo:this.cfvoXform=new o}}get tag(){return"iconSet"}render(r,t){r.openNode(this.tag,{iconSet:p.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:p.toBoolAttribute(t.reverse,!1),showValue:p.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:p.toStringValue(t.iconSet,"3TrafficLights"),reverse:p.toBoolValue(t.reverse),showValue:p.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,C,_){const p=s("../../../utils/utils"),a=s("../base-xform");C.exports=class extends a{get tag(){return"col"}prepare(o,r){const t=r.styles.addStyleModel(o.style||{});t&&(o.styleId=t)}render(o,r){o.openNode("col"),o.addAttribute("min",r.min),o.addAttribute("max",r.max),r.width&&o.addAttribute("width",r.width),r.styleId&&o.addAttribute("style",r.styleId),r.hidden&&o.addAttribute("hidden","1"),r.bestFit&&o.addAttribute("bestFit","1"),r.outlineLevel&&o.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&o.addAttribute("collapsed","1"),o.addAttribute("customWidth","1"),o.closeNode()}parseOpen(o){if(o.name==="col"){const r=this.model={min:parseInt(o.attributes.min||"0",10),max:parseInt(o.attributes.max||"0",10),width:o.attributes.width===void 0?void 0:parseFloat(o.attributes.width||"0")};return o.attributes.style&&(r.styleId=parseInt(o.attributes.style,10)),p.parseBoolean(o.attributes.hidden)&&(r.hidden=!0),p.parseBoolean(o.attributes.bestFit)&&(r.bestFit=!0),o.attributes.outlineLevel&&(r.outlineLevel=parseInt(o.attributes.outlineLevel,10)),p.parseBoolean(o.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(o,r){o.styleId&&(o.style=r.styles.getStyleModel(o.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../../../utils/utils"),o=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(i,n,c,h){const u=n[c];u!==void 0?i[c]=u:h!==void 0&&(i[c]=h)}function l(i,n,c,h){const u=n[c];u!==void 0?i[c]=a.parseBoolean(u):h!==void 0&&(i[c]=h)}C.exports=class extends r{get tag(){return"dataValidations"}render(i,n){const c=function(h){const u=p.map(h,(w,x)=>({address:x,dataValidation:w,marked:!1})).sort((w,x)=>p.strcmp(w.address,x.address)),d=p.keyBy(u,"address"),f=(w,x,A)=>{for(let N=0;N{if(!w.marked){const x=o.decodeEx(w.address);if(x.dimensions)return d[x.dimensions].marked=!0,Ae(At({},w.dataValidation),{sqref:w.address});let A=1,N=o.encodeAddress(x.row+A,x.col);for(;h[N]&&p.isEqual(w.dataValidation,h[N]);)A++,N=o.encodeAddress(x.row+A,x.col);let L=1;for(;f(x,A,x.col+L);)L++;for(let O=0;O1||L>1){const O=x.row+(A-1),P=x.col+(L-1);return Ae(At({},w.dataValidation),{sqref:`${w.address}:${o.encodeAddress(O,P)}`})}return Ae(At({},w.dataValidation),{sqref:w.address})}return null}).filter(Boolean)}(n);c.length&&(i.openNode("dataValidations",{count:c.length}),c.forEach(h=>{i.openNode("dataValidation"),h.type!=="any"&&(i.addAttribute("type",h.type),h.operator&&h.type!=="list"&&h.operator!=="between"&&i.addAttribute("operator",h.operator),h.allowBlank&&i.addAttribute("allowBlank","1")),h.showInputMessage&&i.addAttribute("showInputMessage","1"),h.promptTitle&&i.addAttribute("promptTitle",h.promptTitle),h.prompt&&i.addAttribute("prompt",h.prompt),h.showErrorMessage&&i.addAttribute("showErrorMessage","1"),h.errorStyle&&i.addAttribute("errorStyle",h.errorStyle),h.errorTitle&&i.addAttribute("errorTitle",h.errorTitle),h.error&&i.addAttribute("error",h.error),i.addAttribute("sqref",h.sqref),(h.formulae||[]).forEach((u,d)=>{i.openNode("formula"+(d+1)),h.type==="date"?i.writeText(a.dateToExcel(new Date(u))):i.writeText(u),i.closeNode()}),i.closeNode()}),i.closeNode())}parseOpen(i){switch(i.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=i.attributes.sqref;const n={type:i.attributes.type||"any",formulae:[]};switch(i.attributes.type&&l(n,i.attributes,"allowBlank"),l(n,i.attributes,"showInputMessage"),l(n,i.attributes,"showErrorMessage"),n.type){case"any":case"list":case"custom":break;default:e(n,i.attributes,"operator","between")}return e(n,i.attributes,"promptTitle"),e(n,i.attributes,"prompt"),e(n,i.attributes,"errorStyle"),e(n,i.attributes,"errorTitle"),e(n,i.attributes,"error"),this._dataValidation=n,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(i){this._formula&&this._formula.push(i)}parseClose(i){switch(i){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(n=>{n.includes(":")?new t(n).forEachAddress(c=>{this.model[c]=this._dataValidation}):this.model[n]=this._dataValidation}),!0;case"formula1":case"formula2":{let n=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":n=parseInt(n,10);break;case"decimal":n=parseFloat(n);break;case"date":n=a.excelToDate(parseFloat(n))}return this._dataValidation.formulae.push(n),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(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"dimension"}render(a,o){o&&a.leafNode("dimension",{ref:o})}parseOpen(a){return a.name==="dimension"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"drawing"}render(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,C,_){const p=s("../composite-xform"),a=s("./cf-ext/conditional-formattings-ext-xform");class o extends p{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new a}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,e){this.conditionalFormattings.prepare(t.conditionalFormattings,e)}render(t,e){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,e.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model[t]=e.model}}C.exports=class extends p{constructor(){super(),this.map={ext:this.ext=new o}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"headerFooter"}render(a,o){if(o){a.addRollback();let r=!1;a.openNode("headerFooter"),o.differentFirst&&(a.addAttribute("differentFirst","1"),r=!0),o.differentOddEven&&(a.addAttribute("differentOddEven","1"),r=!0),o.oddHeader&&typeof o.oddHeader=="string"&&(a.leafNode("oddHeader",null,o.oddHeader),r=!0),o.oddFooter&&typeof o.oddFooter=="string"&&(a.leafNode("oddFooter",null,o.oddFooter),r=!0),o.evenHeader&&typeof o.evenHeader=="string"&&(a.leafNode("evenHeader",null,o.evenHeader),r=!0),o.evenFooter&&typeof o.evenFooter=="string"&&(a.leafNode("evenFooter",null,o.evenFooter),r=!0),o.firstHeader&&typeof o.firstHeader=="string"&&(a.leafNode("firstHeader",null,o.firstHeader),r=!0),o.firstFooter&&typeof o.firstFooter=="string"&&(a.leafNode("firstFooter",null,o.firstFooter),r=!0),r?(a.closeNode(),a.commit()):a.rollback()}}parseOpen(a){switch(a.name){case"headerFooter":return this.model={},a.attributes.differentFirst&&(this.model.differentFirst=parseInt(a.attributes.differentFirst,0)===1),a.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(a.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(a){switch(this.currentNode){case"oddHeader":this.model.oddHeader=a;break;case"oddFooter":this.model.oddFooter=a;break;case"evenHeader":this.model.evenHeader=a;break;case"evenFooter":this.model.evenFooter=a;break;case"firstHeader":this.model.firstHeader=a;break;case"firstFooter":this.model.firstFooter=a}}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(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"hyperlink"}render(a,o){this.isInternalLink(o)?a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip,location:o.target}):a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip})}parseOpen(a){return a.name==="hyperlink"&&(this.model={address:a.attributes.ref,rId:a.attributes["r:id"],tooltip:a.attributes.tooltip},a.attributes.location&&(this.model.target=a.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(a){return a.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(a.target)}}},{"../base-xform":32}],99:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"mergeCell"}render(a,o){a.leafNode("mergeCell",{ref:o})}parseOpen(a){return a.name==="mergeCell"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../../../doc/range"),o=s("../../../utils/col-cache"),r=s("../../../doc/enums");C.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new a(e)}}get mergeCells(){return p.map(this.merges,t=>t.range)}reconcile(t,e){p.each(t,l=>{const i=o.decode(l);for(let n=i.top;n<=i.bottom;n++){const c=e[n-1];for(let h=i.left;h<=i.right;h++){const u=c.cells[h-1];u?u.type===r.ValueType.Merge&&(u.master=i.tl):c.cells[h]={type:r.ValueType.Null,address:o.encodeAddress(n,h)}}}})}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(s,C,_){const p=s("../base-xform"),a=o=>o!==void 0;C.exports=class extends p{get tag(){return"outlinePr"}render(o,r){return!(!r||!a(r.summaryBelow)&&!a(r.summaryRight))&&(o.leafNode(this.tag,{summaryBelow:a(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:a(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={summaryBelow:a(o.attributes.summaryBelow)?!!Number(o.attributes.summaryBelow):void 0,summaryRight:a(o.attributes.summaryRight)?!!Number(o.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"brk"}render(a,o){a.leafNode("brk",o)}parseOpen(a){return a.name==="brk"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../base-xform");C.exports=class extends a{get tag(){return"pageMargins"}render(o,r){if(r){const t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};p.some(t,e=>e!==void 0)&&o.leafNode(this.tag,t)}}parseOpen(o){switch(o.name){case this.tag:return this.model={left:parseFloat(o.attributes.left||.7),right:parseFloat(o.attributes.right||.7),top:parseFloat(o.attributes.top||.75),bottom:parseFloat(o.attributes.bottom||.75),header:parseFloat(o.attributes.header||.3),footer:parseFloat(o.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"pageSetUpPr"}render(a,o){return!(!o||!o.fitToPage)&&(a.leafNode(this.tag,{fitToPage:o.fitToPage?"1":void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={fitToPage:a.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../base-xform");function o(l){return l?"1":void 0}function r(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}C.exports=class extends a{get tag(){return"pageSetup"}render(l,i){if(i){const n={paperSize:i.paperSize,orientation:i.orientation,horizontalDpi:i.horizontalDpi,verticalDpi:i.verticalDpi,pageOrder:r(i.pageOrder),blackAndWhite:o(i.blackAndWhite),draft:o(i.draft),cellComments:t(i.cellComments),errors:e(i.errors),scale:i.scale,fitToWidth:i.fitToWidth,fitToHeight:i.fitToHeight,firstPageNumber:i.firstPageNumber,useFirstPageNumber:o(i.firstPageNumber),usePrinterDefaults:o(i.usePrinterDefaults),copies:i.copies};p.some(n,c=>c!==void 0)&&l.leafNode(this.tag,n)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(i=l.attributes.paperSize,i!==void 0?parseInt(i,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var i}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"picture"}render(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../base-xform");function o(r){return r?"1":void 0}C.exports=class extends a{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:o(t.showRowColHeaders),gridLines:o(t.showGridLines),horizontalCentered:o(t.horizontalCentered),verticalCentered:o(t.verticalCentered)};p.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){switch(r.name){case this.tag:return this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,C,_){const p=s("./page-breaks-xform"),a=s("../list-xform");C.exports=class extends a{constructor(){super({tag:"rowBreaks",count:!0,childXform:new p})}render(o,r){if(r&&r.length){o.openNode(this.tag,this.$),this.count&&(o.addAttribute(this.$count,r.length),o.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(o,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,C,_){const p=s("../base-xform"),a=s("../../../utils/utils"),o=s("./cell-xform");C.exports=class extends p{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new o}}get tag(){return"row"}prepare(r,t){const e=t.styles.addStyleModel(r.style);e&&(r.styleId=e);const l=this.map.c;r.cells.forEach(i=>{l.prepare(i,t)})}render(r,t,e){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(i=>{l.render(r,i,e)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;const t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],e=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(e.styleId=parseInt(r.attributes.s,10)),a.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),a.parseBoolean(r.attributes.bestFit)&&(e.bestFit=!0),r.attributes.ht&&(e.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(e.outlineLevel=parseInt(r.attributes.outlineLevel,10)),a.parseBoolean(r.attributes.collapsed)&&(e.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);const e=this.map.c;r.cells.forEach(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../base-xform");C.exports=class extends a{get tag(){return"sheetFormatPr"}render(o,r){if(r){const t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),p.some(t,e=>e!==void 0)&&o.leafNode("sheetFormatPr",t)}}parseOpen(o){return o.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(o.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(o.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(o.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(o.attributes.outlineLevelCol||"0",10)},o.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(o.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,C,_){const p=s("../base-xform"),a=s("../style/color-xform"),o=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");C.exports=class extends p{constructor(){super(),this.map={tabColor:new a("tabColor"),pageSetUpPr:new o,outlinePr:new r}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(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(s,C,_){const p=s("../../../utils/under-dash"),a=s("../base-xform");function o(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}C.exports=class extends a{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:o(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:o(e.formatCells,"0"),formatColumns:o(e.formatColumns,"0"),formatRows:o(e.formatRows,"0"),insertColumns:o(e.insertColumns,"0"),insertRows:o(e.insertRows,"0"),insertHyperlinks:o(e.insertHyperlinks,"0"),deleteColumns:o(e.deleteColumns,"0"),deleteRows:o(e.deleteRows,"0"),sort:o(e.sort,"0"),autoFilter:o(e.autoFilter,"0"),pivotTables:o(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=o(e.objects===!1,"1"),l.scenarios=o(e.scenarios===!1,"1")),p.some(l,i=>i!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,C,_){const p=s("../../../utils/col-cache"),a=s("../base-xform"),o={frozen:"frozen",frozenSplit:"frozen",split:"split"};C.exports=class extends a{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(h,u,d){d&&r.addAttribute(h,u)};let l,i,n,c;switch(e("rightToLeft","1",t.rightToLeft===!0),e("tabSelected","1",t.tabSelected),e("showRuler","0",t.showRuler===!1),e("showRowColHeaders","0",t.showRowColHeaders===!1),e("showGridLines","0",t.showGridLines===!1),e("zoomScale",t.zoomScale,t.zoomScale),e("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),e("view",t.style,t.style),t.state){case"frozen":i=t.xSplit||0,n=t.ySplit||0,l=t.topLeftCell||p.getAddress(n+1,i+1).address,c=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:c,state:"frozen"}),r.leafNode("selection",{pane:c,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{const t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,e;switch(r){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:o[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),e=this.selections[this.pane.activePane],e&&e.activeCell&&(t.activeCell=e.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},e=this.selections.topLeft,e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"tablePart"}render(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,C,_){const p=s("../../../utils/under-dash"),a=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),r=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),i=s("./row-xform"),n=s("./col-xform"),c=s("./dimension-xform"),h=s("./hyperlink-xform"),u=s("./merge-cell-xform"),d=s("./data-validations-xform"),f=s("./sheet-properties-xform"),w=s("./sheet-format-properties-xform"),x=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),N=s("./page-margins-xform"),L=s("./page-setup-xform"),O=s("./print-options-xform"),P=s("./auto-filter-xform"),D=s("./picture-xform"),U=s("./drawing-xform"),B=s("./table-part-xform"),k=s("./row-breaks-xform"),E=s("./header-footer-xform"),v=s("./cf/conditional-formattings-xform"),m=s("./ext-lst-xform"),b=(y,S)=>{if(!S||!S.length)return y;if(!y||!y.length)return S;const R={},I={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach($=>{const{x14Id:W}=$;W&&(I[W]=$)})}),S.forEach(z=>{z.rules.forEach($=>{const W=I[$.x14Id];W?((j,H)=>{Object.keys(H).forEach(M=>{const T=j[M],F=H[M];T===void 0&&F!==void 0&&(j[M]=F)})})(W,$):R[z.ref]?R[z.ref].rules.push($):y.push({ref:z.ref,rules:[$]})})}),y};class g extends e{constructor(S){super();const{maxRows:R,maxCols:I,ignoreNodes:z}=S||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new c,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new x}),sheetFormatPr:new w,cols:new l({tag:"cols",count:!1,childXform:new n}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new i({maxItems:I}),maxItems:R}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new k,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new h}),pageMargins:new N,dataValidations:new d,pageSetup:new L,headerFooter:new E,printOptions:new O,picture:new D,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new v,extLst:new m}}prepare(S,R){R.merges=new t,S.hyperlinks=R.hyperlinks=[],S.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(S.cols,R),this.map.sheetData.prepare(S.rows,R),this.map.conditionalFormatting.prepare(S.conditionalFormattings,R),S.mergeCells=R.merges.mergeCells;const I=S.rels=[];function z(j){return"rId"+(j.length+1)}if(S.hyperlinks.forEach(j=>{const H=z(I);j.rId=H,I.push({Id:H,Type:r.Hyperlink,Target:j.target,TargetMode:"External"})}),S.comments.length>0){const j={Id:z(I),Type:r.Comments,Target:`../comments${S.id}.xml`};I.push(j);const H={Id:z(I),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${S.id}.vml`};I.push(H),S.comments.forEach(M=>{M.refAddress=a.decodeAddress(M.ref)}),R.commentRefs.push({commentName:"comments"+S.id,vmlDrawing:"vmlDrawing"+S.id})}const $=[];let W;S.media.forEach(j=>{if(j.type==="background"){const H=z(I);W=R.media[j.imageId],I.push({Id:H,Type:r.Image,Target:`../media/${W.name}.${W.extension}`}),S.background={rId:H},S.image=R.media[j.imageId]}else if(j.type==="image"){let{drawing:H}=S;W=R.media[j.imageId],H||(H=S.drawing={rId:z(I),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push(H),I.push({Id:H.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${H.name}.xml`}));let M=this.preImageId===j.imageId?$[j.imageId]:$[H.rels.length];M||(M=z(H.rels),$[H.rels.length]=M,H.rels.push({Id:M,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${W.name}.${W.extension}`}));const T={picture:{rId:M},range:j.range};if(j.hyperlinks&&j.hyperlinks.hyperlink){const F=z(H.rels);$[H.rels.length]=F,T.picture.hyperlinks={tooltip:j.hyperlinks.tooltip,rId:F},H.rels.push({Id:F,Type:r.Hyperlink,Target:j.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=j.imageId,H.anchors.push(T)}}),S.tables.forEach(j=>{const H=z(I);j.rId=H,I.push({Id:H,Type:r.Table,Target:"../tables/"+j.target}),j.columns.forEach(M=>{const{style:T}=M;T&&(M.dxfId=R.styles.addDxfStyle(T))})}),this.map.extLst.prepare(S,R)}render(S,R){S.openXml(o.StdDocAttributes),S.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const I=R.properties?{defaultRowHeight:R.properties.defaultRowHeight,dyDescent:R.properties.dyDescent,outlineLevelCol:R.properties.outlineLevelCol,outlineLevelRow:R.properties.outlineLevelRow}:void 0;R.properties&&R.properties.defaultColWidth&&(I.defaultColWidth=R.properties.defaultColWidth);const z={outlineProperties:R.properties&&R.properties.outlineProperties,tabColor:R.properties&&R.properties.tabColor,pageSetup:R.pageSetup&&R.pageSetup.fitToPage?{fitToPage:R.pageSetup.fitToPage}:void 0},$=R.pageSetup&&R.pageSetup.margins,W={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},j=R.sheetProtection;this.map.sheetPr.render(S,z),this.map.dimension.render(S,R.dimensions),this.map.sheetViews.render(S,R.views),this.map.sheetFormatPr.render(S,I),this.map.cols.render(S,R.cols),this.map.sheetData.render(S,R.rows),this.map.sheetProtection.render(S,j),this.map.autoFilter.render(S,R.autoFilter),this.map.mergeCells.render(S,R.mergeCells),this.map.conditionalFormatting.render(S,R.conditionalFormattings),this.map.dataValidations.render(S,R.dataValidations),this.map.hyperlinks.render(S,R.hyperlinks),this.map.printOptions.render(S,W),this.map.pageMargins.render(S,$),this.map.pageSetup.render(S,R.pageSetup),this.map.headerFooter.render(S,R.headerFooter),this.map.rowBreaks.render(S,R.rowBreaks),this.map.drawing.render(S,R.drawing),this.map.picture.render(S,R.background),this.map.tableParts.render(S,R.tables),this.map.extLst.render(S,R),R.rels&&R.rels.forEach(H=>{H.Type===r.VmlDrawing&&S.leafNode("legacyDrawing",{"r:id":H.Id})}),S.closeNode()}parseOpen(S){return this.parser?(this.parser.parseOpen(S),!0):S.name==="worksheet"?(p.each(this.map,R=>{R.reset()}),!0):(this.map[S.name]&&!this.ignoreNodes.includes(S.name)&&(this.parser=this.map[S.name],this.parser.parseOpen(S)),!0)}parseText(S){this.parser&&this.parser.parseText(S)}parseClose(S){if(this.parser)return this.parser.parseClose(S)||(this.parser=void 0),!0;switch(S){case"worksheet":{const R=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(R.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(R.outlineProperties=this.map.sheetPr.model.outlineProperties);const I={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},z=Object.assign(I,this.map.pageSetup.model,this.map.printOptions.model),$=b(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:R,views:this.map.sheetViews.model,pageSetup:z,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:$},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(S,R){const I=(S.relationships||[]).reduce(($,W)=>{if($[W.Id]=W,W.Type===r.Comments&&(S.comments=R.comments[W.Target].comments),W.Type===r.VmlDrawing&&S.comments&&S.comments.length){const j=R.vmlDrawings[W.Target].comments;S.comments.forEach((H,M)=>{H.note=Object.assign({},H.note,j[M])})}return $},{});if(R.commentsMap=(S.comments||[]).reduce(($,W)=>(W.ref&&($[W.ref]=W),$),{}),R.hyperlinkMap=(S.hyperlinks||[]).reduce(($,W)=>(W.rId&&($[W.address]=I[W.rId].Target),$),{}),R.formulae={},S.rows=S.rows&&S.rows.filter(Boolean)||[],S.rows.forEach($=>{$.cells=$.cells&&$.cells.filter(Boolean)||[]}),this.map.cols.reconcile(S.cols,R),this.map.sheetData.reconcile(S.rows,R),this.map.conditionalFormatting.reconcile(S.conditionalFormattings,R),S.media=[],S.drawing){const $=I[S.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if($){const W=$[1];R.drawings[W].anchors.forEach(j=>{if(j.medium){const H={type:"image",imageId:j.medium.index,range:j.range,hyperlinks:j.picture.hyperlinks};S.media.push(H)}})}}const z=S.background&&I[S.background.rId];if(z){const $=z.Target.split("/media/")[1],W=R.mediaIndex&&R.mediaIndex[$];W!==void 0&&S.media.push({type:"background",imageId:W})}S.tables=(S.tables||[]).map($=>{const W=I[$.rId];return R.tables[W.Target]}),delete S.relationships,delete S.hyperlinks,delete S.comments}}g.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"},C.exports=g},{"../../../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(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.attr=a.attr}render(a,o){o&&(a.openNode(this.tag),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this._format=a.format||function(o){try{return Number.isNaN(o.getTime())?"":o.toISOString()}catch(r){return""}},this._parse=a.parse||function(o){return new Date(o)}}render(a,o){o&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,this._format(o)):a.writeText(this._format(o)),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=this._parse(a.attributes[this.attr]):this.text=[])}parseText(a){this.attr||this.text.push(a)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this.zero=a.zero}render(a,o){(o||this.zero)&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){return a.name===this.tag&&(this.attr?this.model=parseInt(a.attributes[this.attr],10):this.text=[],!0)}parseText(a){this.attr||this.text.push(a)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs}render(a,o){o!==void 0&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=a.attributes[this.attr]:this.text=[])}parseText(a){this.attr||this.text.push(a)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,C,_){const p=s("./base-xform"),a=s("../../utils/xml-stream");C.exports=class extends p{constructor(o){super(),this._model=o}render(o){if(!this._xml){const r=new a;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(i=>{t(e,i)}),l.t&&e.writeText(l.t),e.closeNode()})(r,this._model),this._xml=r.xml}o.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(o){switch(o){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,C,_){const p=s("./text-xform"),a=s("./rich-text-xform"),o=s("../base-xform");C.exports=class extends o{constructor(){super(),this.map={r:new a,t:new p}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:e}=this.map;t.richText.forEach(l=>{e.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){const{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,C,_){const p=s("./text-xform"),a=s("../style/font-xform"),o=s("../base-xform");class r extends o{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new p)}get fontXform(){return this._fontXform||(this._fontXform=new a(r.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.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}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},C.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,C,_){const p=s("./text-xform"),a=s("./rich-text-xform"),o=s("./phonetic-text-xform"),r=s("../base-xform");C.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new a,t:new p,rPh:new o}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):e!=null&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./shared-string-xform");C.exports=class extends a{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new o)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){const t=this.sharedStringXform.toXml(r);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,e}render(r,t){t=t||this._values,r.openXml(p.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(l=>{e.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(r){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"t"}render(a,o){a.openNode("t"),/^\s|\n|\s$/.test(o)&&a.addAttribute("xml:space","preserve"),a.writeText(o),a.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(a,o)=>String.fromCharCode(parseInt(o,16)))}parseOpen(a){switch(a.name){case"t":return this._text=[],!0;default:return!1}}parseText(a){this._text.push(a)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,C,_){const p=s("../../../doc/enums"),a=s("../../../utils/utils"),o=s("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!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=a.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=a.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return p.ReadingOrder.LeftToRight;case"rtl":return p.ReadingOrder.RightToLeft;default:return}}},t={toXml(e){if(e=r.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=a.validInt(e);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};C.exports=class extends o{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let i=!1;function n(c,h){h&&(e.addAttribute(c,h),i=!0)}n("horizontal",r.horizontal(l.horizontal)),n("vertical",r.vertical(l.vertical)),n("wrapText",!!r.wrapText(l.wrapText)&&"1"),n("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),n("indent",r.indent(l.indent)),n("textRotation",t.toXml(l.textRotation)),n("readingOrder",r.readingOrder(l.readingOrder)),e.closeNode(),i?e.commit():e.rollback()}parseOpen(e){const l={};let i=!1;function n(c,h,u){c&&(l[h]=u,i=!0)}n(e.attributes.horizontal,"horizontal",e.attributes.horizontal),n(e.attributes.vertical,"vertical",e.attributes.vertical==="center"?"middle":e.attributes.vertical),n(e.attributes.wrapText,"wrapText",a.parseBoolean(e.attributes.wrapText)),n(e.attributes.shrinkToFit,"shrinkToFit",a.parseBoolean(e.attributes.shrinkToFit)),n(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),n(e.attributes.textRotation,"textRotation",t.toModel(e.attributes.textRotation)),n(e.attributes.readingOrder,"readingOrder",e.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=i?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,C,_){const p=s("../base-xform"),a=s("../../../utils/utils"),o=s("./color-xform");class r extends p{constructor(e){super(),this.name=e,this.map={color:new o}}get tag(){return this.name}render(e,l,i){const n=l&&l.color||i||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),n&&this.map.color.render(e,n)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return r.validStyleValues[e]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,e)=>(t[e]=!0,t),{}),C.exports=class extends p{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,e){const{color:l}=e;function i(n,c){n&&!n.color&&e.color&&(n=Ae(At({},n),{color:e.color})),c.render(t,n,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),i(e.left,this.map.left),i(e.right,this.map.right),i(e.top,this.map.top),i(e.bottom,this.map.bottom),i(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=a.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=a.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0)}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if(t==="border"){const e=this.model={},l=function(i,n,c){n&&(c&&Object.assign(n,c),e[i]=n)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{constructor(a){super(),this.name=a||"color"}get tag(){return this.name}render(a,o){return!!o&&(a.openNode(this.name),o.argb?a.addAttribute("rgb",o.argb):o.theme!==void 0?(a.addAttribute("theme",o.theme),o.tint!==void 0&&a.addAttribute("tint",o.tint)):o.indexed!==void 0?a.addAttribute("indexed",o.indexed):a.addAttribute("auto","1"),a.closeNode(),!0)}parseOpen(a){return a.name===this.name&&(a.attributes.rgb?this.model={argb:a.attributes.rgb}:a.attributes.theme?(this.model={theme:parseInt(a.attributes.theme,10)},a.attributes.tint&&(this.model.tint=parseFloat(a.attributes.tint))):a.attributes.indexed?this.model={indexed:parseInt(a.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(s,C,_){const p=s("../base-xform"),a=s("./alignment-xform"),o=s("./border-xform"),r=s("./fill-xform"),t=s("./font-xform"),e=s("./numfmt-xform"),l=s("./protection-xform");C.exports=class extends p{constructor(){super(),this.map={alignment:new a,border:new o,fill:new r,font:new t,numFmt:new e,protection:new l}}get tag(){return"dxf"}render(i,n){if(i.openNode(this.tag),n.font&&this.map.font.render(i,n.font),n.numFmt&&n.numFmtId){const c={id:n.numFmtId,formatCode:n.numFmt};this.map.numFmt.render(i,c)}n.fill&&this.map.fill.render(i,n.fill),n.alignment&&this.map.alignment.render(i,n.alignment),n.border&&this.map.border.render(i,n.border),n.protection&&this.map.protection.render(i,n.protection),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i),!0}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return this.parser?(this.parser.parseClose(i)||(this.parser=void 0),!0):i!==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(s,C,_){const p=s("../base-xform"),a=s("./color-xform");class o extends p{constructor(){super(),this.map={color:new a}}get tag(){return"stop"}render(i,n){i.openNode("stop"),i.addAttribute("position",n.position),this.map.color.render(i,n.color),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"stop":return this.model={position:parseFloat(i.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(i),!0;default:return!1}}parseText(){}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends p{constructor(){super(),this.map={fgColor:new a("fgColor"),bgColor:new a("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(i,n){i.openNode("patternFill"),i.addAttribute("patternType",n.pattern),n.fgColor&&this.map.fgColor.render(i,n.fgColor),n.bgColor&&this.map.bgColor.render(i,n.bgColor),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"patternFill":return this.model={type:"pattern",pattern:i.attributes.patternType},!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.parser.model&&(this.model[i]=this.parser.model),this.parser=void 0),!0)}}class t extends p{constructor(){super(),this.map={stop:new o}}get name(){return"gradient"}get tag(){return"gradientFill"}render(i,n){switch(i.openNode("gradientFill"),n.gradient){case"angle":i.addAttribute("degree",n.degree);break;case"path":i.addAttribute("type","path"),n.center.left&&(i.addAttribute("left",n.center.left),n.center.right===void 0&&i.addAttribute("right",n.center.left)),n.center.right&&i.addAttribute("right",n.center.right),n.center.top&&(i.addAttribute("top",n.center.top),n.center.bottom===void 0&&i.addAttribute("bottom",n.center.top)),n.center.bottom&&i.addAttribute("bottom",n.center.bottom)}const c=this.map.stop;n.stops.forEach(h=>{c.render(i,h)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"gradientFill":{const n=this.model={stops:[]};return i.attributes.degree?(n.gradient="angle",n.degree=parseInt(i.attributes.degree,10)):i.attributes.type==="path"&&(n.gradient="path",n.center={left:i.attributes.left?parseFloat(i.attributes.left):0,top:i.attributes.top?parseFloat(i.attributes.top):0},i.attributes.right!==i.attributes.left&&(n.center.right=i.attributes.right?parseFloat(i.attributes.right):0),i.attributes.bottom!==i.attributes.top&&(n.center.bottom=i.attributes.bottom?parseFloat(i.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(i),!0;default:return!1}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends p{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(i,n){switch(i.addRollback(),i.openNode("fill"),n.type){case"pattern":this.map.patternFill.render(i,n);break;case"gradient":this.map.gradientFill.render(i,n);break;default:return void i.rollback()}i.closeNode(),i.commit()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"fill":return this.model={},!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(i){return e.validPatternValues[i]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,i)=>(l[i]=!0,l),{}),e.StopXform=o,e.PatternFillXform=r,e.GradientFillXform=t,C.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,C,_){const p=s("./color-xform"),a=s("../simple/boolean-xform"),o=s("../simple/integer-xform"),r=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class i extends l{constructor(c){super(),this.options=c||i.OPTIONS,this.map={b:{prop:"bold",xform:new a({tag:"b",attr:"val"})},i:{prop:"italic",xform:new a({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new o({tag:"charset",attr:"val"})},color:{prop:"color",xform:new p},condense:{prop:"condense",xform:new a({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new a({tag:"extend",attr:"val"})},family:{prop:"family",xform:new o({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new a({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new a({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new a({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new o({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(c,h){const{map:u}=this;c.openNode(this.options.tagName),e.each(this.map,(d,f)=>{u[f].xform.render(c,h[d.prop])}),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;if(this.map[c.name])return this.parser=this.map[c.name].xform,this.parser.parseOpen(c);switch(c.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser&&!this.parser.parseClose(c)){const h=this.map[c];return this.parser.model&&(this.model[h.prop]=this.parser.model),this.parser=void 0,!0}switch(c){case this.options.tagName:return!1;default:return!0}}}i.OPTIONS={tagName:"font",fontNameTag:"name"},C.exports=i},{"../../../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(s,C,_){const p=s("../../../utils/under-dash"),a=s("../../defaultnumformats"),o=s("../base-xform"),r=function(){const e={};return p.each(a,(l,i)=>{l.f&&(e[l.f]=parseInt(i,10))}),e}();class t extends o{constructor(l,i){super(),this.id=l,this.formatCode=i}get tag(){return"numFmt"}render(l,i){l.leafNode("numFmt",{numFmtId:i.id,formatCode:i.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return a[e]&&a[e].f},C.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,C,_){const p=s("../base-xform"),a={boolean:(o,r)=>o===void 0?r:o};C.exports=class extends p{get tag(){return"protection"}render(o,r){o.addRollback(),o.openNode("protection");let t=!1;function e(l,i){i!==void 0&&(o.addAttribute(l,i),t=!0)}e("locked",a.boolean(r.locked,!0)?void 0:"0"),e("hidden",a.boolean(r.hidden,!1)?"1":void 0),o.closeNode(),t?o.commit():o.rollback()}parseOpen(o){const r={locked:o.attributes.locked!=="0",hidden:o.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,C,_){const p=s("../base-xform"),a=s("./alignment-xform"),o=s("./protection-xform");C.exports=class extends p{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new a,protection:new o}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(s,C,_){const p=s("../../../doc/enums"),a=s("../../../utils/xml-stream"),o=s("../base-xform"),r=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),i=s("./border-xform"),n=s("./numfmt-xform"),c=s("./style-xform"),h=s("./dxf-xform");class u extends o{constructor(f){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new n}),fonts:new t({tag:"fonts",count:!0,childXform:new e,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new i}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new c}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new c({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new h}),numFmt:new n,font:new e,fill:new l,border:new i,style:new c({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},f&&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(f,w){w=w||this.model,f.openXml(a.StdDocAttributes),f.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(f.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(x=>{f.writeXml(x)}),f.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("fills",{count:w.fills.length}),w.fills.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("borders",{count:w.borders.length}),w.borders.forEach(x=>{f.writeXml(x)}),f.closeNode(),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),f.openNode("cellXfs",{count:w.styles.length}),w.styles.forEach(x=>{f.writeXml(x)}),f.closeNode()):(this.map.numFmts.render(f,w.numFmts),this.map.fonts.render(f,w.fonts),this.map.fills.render(f,w.fills),this.map.borders.render(f,w.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,w.styles)),u.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,w.dxfs),u.STATIC_XFORMS.tableStyles.render(f),u.STATIC_XFORMS.extLst.render(f),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"styleSheet":{this.model={};const w=(x,A)=>{A.model&&A.model.length&&(this.model[x]=A.model)};if(w("numFmts",this.map.numFmts),w("fonts",this.map.fonts),w("fills",this.map.fills),w("borders",this.map.borders),w("styles",this.map.cellXfs),w("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const x=this.index.numFmt;this.model.numFmts.forEach(A=>{x[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(f,w){if(!f)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(f))return this.weakMap.get(f);const x={};if(w=w||p.ValueType.Number,f.numFmt)x.numFmtId=this._addNumFmtStr(f.numFmt);else switch(w){case p.ValueType.Number:x.numFmtId=this._addNumFmtStr("General");break;case p.ValueType.Date:x.numFmtId=this._addNumFmtStr("mm-dd-yy")}f.font&&(x.fontId=this._addFont(f.font)),f.border&&(x.borderId=this._addBorder(f.border)),f.fill&&(x.fillId=this._addFill(f.fill)),f.alignment&&(x.alignment=f.alignment),f.protection&&(x.protection=f.protection);const A=this._addStyle(x);return this.weakMap&&this.weakMap.set(f,A),A}getStyleModel(f){const w=this.model.styles[f];if(!w)return null;let x=this.index.model[f];if(x)return x;if(x=this.index.model[f]={},w.numFmtId){const N=this.index.numFmt[w.numFmtId]||n.getDefaultFmtCode(w.numFmtId);N&&(x.numFmt=N)}function A(N,L,O){if(O||O===0){const P=L[O];P&&(x[N]=P)}}return A("font",this.model.fonts,w.fontId),A("border",this.model.borders,w.borderId),A("fill",this.model.fills,w.fillId),w.alignment&&(x.alignment=w.alignment),w.protection&&(x.protection=w.protection),x}addDxfStyle(f){return f.numFmt&&(f.numFmtId=this._addNumFmtStr(f.numFmt)),this.model.dxfs.push(f),this.model.dxfs.length-1}getDxfStyle(f){return this.model.dxfs[f]}_addStyle(f){const w=this.map.style.toXml(f);let x=this.index.style[w];return x===void 0&&(x=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),x}_addNumFmtStr(f){let w=n.getDefaultFmtId(f);if(w!==void 0||(w=this.index.numFmt[f],w!==void 0))return w;w=this.index.numFmt[f]=164+this.model.numFmts.length;const x=this.map.numFmt.toXml({id:w,formatCode:f});return this.model.numFmts.push(x),w}_addFont(f){const w=this.map.font.toXml(f);let x=this.index.font[w];return x===void 0&&(x=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),x}_addBorder(f){const w=this.map.border.toXml(f);let x=this.index.border[w];return x===void 0&&(x=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),x}_addFill(f){const w=this.map.fill.toXml(f);let x=this.index.fill[w];return x===void 0&&(x=this.index.fill[w]=this.model.fills.length,this.model.fills.push(w)),x}}u.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"},u.STATIC_XFORMS={cellStyles:new r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({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"}}]}]})},u.Mock=class extends u{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(d){return d.autodrain(),Promise.resolve()}addStyleModel(d,f){switch(f){case p.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const d={numFmtId:n.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(d)}return this._dateStyleId}getStyleModel(){return{}}},C.exports=u},{"../../../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(s,C,_){const p=s("../base-xform");class a extends p{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{const e=a.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}a.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},C.exports=a},{"../base-xform":32}],137:[function(s,C,_){const p=s("../base-xform"),a=s("./filter-column-xform");C.exports=class extends p{constructor(){super(),this.map={filterColumn:new a}}get tag(){return"autoFilter"}prepare(o){o.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(o,r){return o.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(o,t)}),o.closeNode(),!0}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model={autoFilterRef:o.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[o.name],this.parser)return this.parseOpen(o),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(o))}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(o){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+o)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"customFilter"}render(a,o){a.leafNode(this.tag,{val:o.val,operator:o.operator})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.attributes.val,operator:a.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,C,_){const p=s("../base-xform"),a=s("../list-xform"),o=s("./custom-filter-xform"),r=s("./filter-xform");C.exports=class extends p{constructor(){super(),this.map={customFilters:new a({tag:"customFilters",count:!1,empty:!0,childXform:new o}),filters:new a({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;switch(t.name){case this.tag:return this.model={filterButton:e.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"filter"}render(a,o){a.leafNode(this.tag,{val:o.val})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"tableColumn"}prepare(a,o){a.id=o.index+1}render(a,o){return a.leafNode(this.tag,{id:o.id.toString(),name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.dxfId}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(s,C,_){const p=s("../base-xform");C.exports=class extends p{get tag(){return"tableStyleInfo"}render(a,o){return a.leafNode(this.tag,{name:o.theme?o.theme:void 0,showFirstColumn:o.showFirstColumn?"1":"0",showLastColumn:o.showLastColumn?"1":"0",showRowStripes:o.showRowStripes?"1":"0",showColumnStripes:o.showColumnStripes?"1":"0"}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={theme:o.name?o.name:null,showFirstColumn:o.showFirstColumn==="1",showLastColumn:o.showLastColumn==="1",showRowStripes:o.showRowStripes==="1",showColumnStripes:o.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,C,_){const p=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends a{constructor(){super(),this.map={autoFilter:new r,tableColumns:new o({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(n,c){this.map.autoFilter.prepare(n),this.map.tableColumns.prepare(n.columns,c)}get tag(){return"table"}render(n,c){n.openXml(p.StdDocAttributes),n.openNode(this.tag,Ae(At({},l.TABLE_ATTRIBUTES),{id:c.id,name:c.name,displayName:c.displayName||c.name,ref:c.tableRef,totalsRowCount:c.totalsRow?"1":void 0,totalsRowShown:c.totalsRow?void 0:"1",headerRowCount:c.headerRow?"1":"0"})),this.map.autoFilter.render(n,c),this.map.tableColumns.render(n,c.columns),this.map.tableStyleInfo.render(n,c.style),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;const{name:c,attributes:h}=n;switch(c){case this.tag:this.reset(),this.model={name:h.name,displayName:h.displayName||h.name,tableRef:h.ref,totalsRow:h.totalsRowCount==="1",headerRow:h.headerRowCount==="1"};break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){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((c,h)=>{this.model.columns[h].filterButton=c.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(n,c){n.columns.forEach(h=>{h.dxfId!==void 0&&(h.style=c.styles.getDxfStyle(h.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"},C.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(s,C,_){(function(p,a){(function(){const o=s("fs"),r=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),i=s("../utils/utils"),n=s("../utils/xml-stream"),{bufferToString:c}=s("../utils/browser-buffer-decode"),h=s("./xform/style/styles-xform"),u=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),f=s("./xform/core/relationships-xform"),w=s("./xform/core/content-types-xform"),x=s("./xform/core/app-xform"),A=s("./xform/book/workbook-xform"),N=s("./xform/sheet/worksheet-xform"),L=s("./xform/drawing/drawing-xform"),O=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),D=s("./xform/comment/vml-notes-xform"),U=s("./xml/theme1");class B{constructor(E){this.workbook=E}readFile(E,v){return ne(this,null,function*(){if(!(yield i.fs.exists(E)))throw new Error("File not found: "+E);const m=o.createReadStream(E);try{const b=yield this.read(m,v);return m.close(),b}catch(b){throw m.close(),b}})}parseRels(E){return new f().parseStream(E)}parseWorkbook(E){return new A().parseStream(E)}parseSharedStrings(E){return new d().parseStream(E)}reconcile(E,v){const m=new A,b=new N(v),g=new L,y=new O;m.reconcile(E);const S={media:E.media,mediaIndex:E.mediaIndex};Object.keys(E.drawings).forEach(z=>{const $=E.drawings[z],W=E.drawingRels[z];W&&(S.rels=W.reduce((j,H)=>(j[H.Id]=H,j),{}),($.anchors||[]).forEach(j=>{const H=j.picture&&j.picture.hyperlinks;H&&S.rels[H.rId]&&(H.hyperlink=S.rels[H.rId].Target,delete H.rId)}),g.reconcile($,S))});const R={styles:E.styles};Object.values(E.tables).forEach(z=>{y.reconcile(z,R)});const I={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(z=>{z.relationships=E.worksheetRels[z.sheetNo],b.reconcile(z,I)}),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}_processWorksheetEntry(E,v,m,b,g){return ne(this,null,function*(){const y=new N(b),S=yield y.parseStream(E);S.sheetNo=m,v.worksheetHash[g]=S,v.worksheets.push(S)})}_processCommentEntry(E,v,m){return ne(this,null,function*(){const b=new P,g=yield b.parseStream(E);v.comments[`../${m}.xml`]=g})}_processTableEntry(E,v,m){return ne(this,null,function*(){const b=new O,g=yield b.parseStream(E);v.tables[`../tables/${m}.xml`]=g})}_processWorksheetRelsEntry(E,v,m){return ne(this,null,function*(){const b=new f,g=yield b.parseStream(E);v.worksheetRels[m]=g})}_processMediaEntry(E,v,m){return ne(this,null,function*(){const b=m.lastIndexOf(".");if(b>=1){const g=m.substr(b+1),y=m.substr(0,b);yield new Promise((S,R)=>{const I=new l;I.on("finish",()=>{v.mediaIndex[m]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:I.toBuffer()};v.media.push(z),S()}),E.on("error",z=>{R(z)}),E.pipe(I)})}})}_processDrawingEntry(E,v,m){return ne(this,null,function*(){const b=new L,g=yield b.parseStream(E);v.drawings[m]=g})}_processDrawingRelsEntry(E,v,m){return ne(this,null,function*(){const b=new f,g=yield b.parseStream(E);v.drawingRels[m]=g})}_processVmlDrawingEntry(E,v,m){return ne(this,null,function*(){const b=new D,g=yield b.parseStream(E);v.vmlDrawings[`../drawings/${m}.vml`]=g})}_processThemeEntry(E,v,m){return ne(this,null,function*(){yield new Promise((b,g)=>{const y=new l;E.on("error",g),y.on("error",g),y.on("finish",()=>{v.themes[m]=y.read().toString(),b()}),E.pipe(y)})})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}read(E,v){return ne(this,null,function*(){!E[Symbol.asyncIterator]&&E.pipe&&(E=E.pipe(new t));const m=[];try{for(var b=ir(E),g,y,S;g=!(y=yield b.next()).done;g=!1){const R=y.value;m.push(R)}}catch(y){S=[y]}finally{try{g&&(y=b.return)&&(yield y.call(b))}finally{if(S)throw S[0]}}return this.load(a.concat(m),v)})}load(E,v){return ne(this,null,function*(){let m;m=v&&v.base64?a.from(E.toString(),"base64"):E;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=yield r.loadAsync(m);for(const y of Object.values(g.files))if(!y.dir){let S,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))S=new t,S.write(yield y.async("nodebuffer"));else{let I;S=new t({writableObjectMode:!0,readableObjectMode:!0}),I=p.browser?c(yield y.async("nodebuffer")):yield y.async("string");const z=16384;for(let $=0;$ne(this,null,function*(){if(m.type==="image"){const b=`xl/media/${m.name}.${m.extension}`;if(m.filename){const g=yield function(y,S){return new Promise((R,I)=>{o.readFile(y,S,(z,$)=>{z?I(z):R($)})})}(m.filename);return E.append(g,{name:b})}if(m.buffer)return E.append(m.buffer,{name:b});if(m.base64){const g=m.base64,y=g.substring(g.indexOf(",")+1);return E.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")})))})}addDrawings(E,v){const m=new L,b=new f;v.worksheets.forEach(g=>{const{drawing:y}=g;if(y){m.prepare(y,{});let S=m.toXml(y);E.append(S,{name:`xl/drawings/${y.name}.xml`}),S=b.toXml(y.rels),E.append(S,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(E,v){const m=new O;v.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{m.prepare(y,{});const S=m.toXml(y);E.append(S,{name:"xl/tables/"+y.target})})})}addContentTypes(E,v){return ne(this,null,function*(){const m=new w().toXml(v);E.append(m,{name:"[Content_Types].xml"})})}addApp(E,v){return ne(this,null,function*(){const m=new x().toXml(v);E.append(m,{name:"docProps/app.xml"})})}addCore(E,v){return ne(this,null,function*(){const m=new u;E.append(m.toXml(v),{name:"docProps/core.xml"})})}addThemes(E,v){return ne(this,null,function*(){const m=v.themes||{theme1:U};Object.keys(m).forEach(b=>{const g=m[b],y=`xl/theme/${b}.xml`;E.append(g,{name:y})})})}addOfficeRels(E){return ne(this,null,function*(){const v=new f().toXml([{Id:"rId1",Type:B.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:B.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:B.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);E.append(v,{name:"_rels/.rels"})})}addWorkbookRels(E,v){return ne(this,null,function*(){let m=1;const b=[{Id:"rId"+m++,Type:B.RelType.Styles,Target:"styles.xml"},{Id:"rId"+m++,Type:B.RelType.Theme,Target:"theme/theme1.xml"}];v.sharedStrings.count&&b.push({Id:"rId"+m++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),v.worksheets.forEach(y=>{y.rId="rId"+m++,b.push({Id:y.rId,Type:B.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new f().toXml(b);E.append(g,{name:"xl/_rels/workbook.xml.rels"})})}addSharedStrings(E,v){return ne(this,null,function*(){v.sharedStrings&&v.sharedStrings.count&&E.append(v.sharedStrings.xml,{name:"xl/sharedStrings.xml"})})}addStyles(E,v){return ne(this,null,function*(){const{xml:m}=v.styles;m&&E.append(m,{name:"xl/styles.xml"})})}addWorkbook(E,v){return ne(this,null,function*(){const m=new A;E.append(m.toXml(v),{name:"xl/workbook.xml"})})}addWorksheets(E,v){return ne(this,null,function*(){const m=new N,b=new f,g=new P,y=new D;v.worksheets.forEach(S=>{let R=new n;m.render(R,S),E.append(R.xml,{name:`xl/worksheets/sheet${S.id}.xml`}),S.rels&&S.rels.length&&(R=new n,b.render(R,S.rels),E.append(R.xml,{name:`xl/worksheets/_rels/sheet${S.id}.xml.rels`})),S.comments.length>0&&(R=new n,g.render(R,S),E.append(R.xml,{name:`xl/comments${S.id}.xml`}),R=new n,y.render(R,S),E.append(R.xml,{name:`xl/drawings/vmlDrawing${S.id}.vml`}))})})}_finalize(E){return new Promise((v,m)=>{E.on("finish",()=>{v(this)}),E.on("error",m),E.finalize()})}prepareModel(E,v){E.creator=E.creator||"ExcelJS",E.lastModifiedBy=E.lastModifiedBy||"ExcelJS",E.created=E.created||new Date,E.modified=E.modified||new Date,E.useSharedStrings=v.useSharedStrings===void 0||v.useSharedStrings,E.useStyles=v.useStyles===void 0||v.useStyles,E.sharedStrings=new d,E.styles=E.useStyles?new h(!0):new h.Mock;const m=new A,b=new N;m.prepare(E);const g={sharedStrings:E.sharedStrings,styles:E.styles,date1904:E.properties.date1904,drawingsCount:0,media:E.media};g.drawings=E.drawings=[],g.commentRefs=E.commentRefs=[];let y=0;E.tables=[],E.worksheets.forEach(S=>{S.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,E.tables.push(R)}),b.prepare(S,g)})}write(E,v){return ne(this,null,function*(){v=v||{};const{model:m}=this.workbook,b=new e.ZipWriter(v.zip);return b.pipe(E),this.prepareModel(m,v),yield this.addContentTypes(b,m),yield this.addOfficeRels(b,m),yield this.addWorkbookRels(b,m),yield this.addWorksheets(b,m),yield this.addSharedStrings(b,m),yield this.addDrawings(b,m),yield this.addTables(b,m),yield Promise.all([this.addThemes(b,m),this.addStyles(b,m)]),yield this.addMedia(b,m),yield Promise.all([this.addApp(b,m),this.addCore(b,m)]),yield this.addWorkbook(b,m),this._finalize(b)})}writeFile(E,v){const m=o.createWriteStream(E);return new Promise((b,g)=>{m.on("finish",()=>{b()}),m.on("error",y=>{g(y)}),this.write(m,v).then(()=>{m.end()}).catch(y=>{g(y)})})}writeBuffer(E){return ne(this,null,function*(){const v=new l;return yield this.write(v,E),v.read()})}}B.RelType=s("./rel-type"),C.exports=B}).call(this)}).call(this,s("_process"),s("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(s,C,_){C.exports=` `},{}],146:[function(s,C,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvFormatterStream=void 0;const a=s("stream"),o=s("./formatter");class r extends a.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new o.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,l,i){let n=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(c,h)=>c?(n=!0,i(c)):(h&&h.forEach(u=>{this.push(p.from(u,"utf8"))}),n=!0,i()))}catch(c){if(n)throw c;i(c)}}_flush(e){this.rowFormatter.finish((l,i)=>l?e(l):(i&&i.forEach(n=>{this.push(p.from(n,"utf8"))}),e()))}}_.CsvFormatterStream=r}).call(this)}).call(this,s("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FormatterOptions=void 0,_.FormatterOptions=class{constructor(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var a;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="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,p||{}),(p==null?void 0:p.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(p==null?void 0:p.quote)===!0?this.quote='"':(p==null?void 0:p.quote)===!1&&(this.quote=""),typeof(p==null?void 0:p.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((a=p.writeHeaders)===null||a===void 0||a),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(s,C,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=void 0;const a=p(s("lodash.isboolean")),o=p(s("lodash.isnil")),r=p(s("lodash.escaperegexp"));_.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,t.headers!==null&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");const e=`[${t.delimiter}${r.default(t.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const l=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return a.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,e,l){const i=(""+(o.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:n}=this;return n.quote!==""&&i.indexOf(n.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,n.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(e,l)?this.quoteField(i):i}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(s,C,_){var p=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowFormatter=void 0;const a=p(s("lodash.isfunction")),o=p(s("lodash.isequal")),r=s("./FieldFormatter"),t=s("../types");class e{constructor(i){this.rowCount=0,this.formatterOptions=i,this.fieldFormatter=new r.FieldFormatter(i),this.headers=i.headers,this.shouldWriteHeaders=i.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),i.transform&&(this.rowTransform=i.transform)}static isRowHashArray(i){return!!Array.isArray(i)&&Array.isArray(i[0])&&i[0].length===2}static isRowArray(i){return Array.isArray(i)&&!this.isRowHashArray(i)}static gatherHeaders(i){return e.isRowHashArray(i)?i.map(n=>n[0]):Array.isArray(i)?i:Object.keys(i)}static createTransform(i){return t.isSyncTransform(i)?(n,c)=>{let h=null;try{h=i(n)}catch(u){return c(u)}return c(null,h)}:(n,c)=>{i(n,c)}}set rowTransform(i){if(!a.default(i))throw new TypeError("The transform should be a function");this._rowTransform=e.createTransform(i)}format(i,n){this.callTransformer(i,(c,h)=>{if(c)return n(c);if(!i)return n(null);const u=[];if(h){const{shouldFormatColumns:d,headers:f}=this.checkHeaders(h);if(this.shouldWriteHeaders&&f&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(f,!0)),this.hasWrittenHeaders=!0),d){const w=this.gatherColumns(h);u.push(this.formatColumns(w,!1))}}return n(null,u)})}finish(i){const n=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return i(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));n.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&n.push(this.formatterOptions.rowDelimiter),i(null,n)}checkHeaders(i){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const n=e.gatherHeaders(i);return this.headers=n,this.fieldFormatter.headers=n,this.shouldWriteHeaders?{shouldFormatColumns:!o.default(n,i),headers:n}:{shouldFormatColumns:!0,headers:null}}gatherColumns(i){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(i)?e.isRowHashArray(i)?this.headers.map((n,c)=>{const h=i[c];return h?h[1]:""}):e.isRowArray(i)&&!this.shouldWriteHeaders?i:this.headers.map((n,c)=>i[c]):this.headers.map(n=>i[n])}callTransformer(i,n){return this._rowTransform?this._rowTransform(i,n):n(null,i)}formatColumns(i,n){const c=i.map((u,d)=>this.fieldFormatter.format(u,d,n)).join(this.formatterOptions.delimiter),{rowCount:h}=this;return this.rowCount+=1,h?[this.formatterOptions.rowDelimiter,c].join(""):c}}_.RowFormatter=e},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=_.RowFormatter=void 0;var p=s("./RowFormatter");Object.defineProperty(_,"RowFormatter",{enumerable:!0,get:function(){return p.RowFormatter}});var a=s("./FieldFormatter");Object.defineProperty(_,"FieldFormatter",{enumerable:!0,get:function(){return a.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(s,C,_){(function(p){(function(){var a=Object.create?function(d,f,w,x){x===void 0&&(x=w),Object.defineProperty(d,x,{enumerable:!0,get:function(){return f[w]}})}:function(d,f,w,x){x===void 0&&(x=w),d[x]=f[w]},o=Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f},r=function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var w in d)w!=="default"&&Object.prototype.hasOwnProperty.call(d,w)&&a(f,d,w);return o(f,d),f},t=function(d,f){for(var w in d)w==="default"||Object.prototype.hasOwnProperty.call(f,w)||a(f,d,w)};Object.defineProperty(_,"__esModule",{value:!0}),_.writeToPath=_.writeToString=_.writeToBuffer=_.writeToStream=_.write=_.format=_.FormatterOptions=_.CsvFormatterStream=void 0;const e=s("util"),l=s("stream"),i=r(s("fs")),n=s("./FormatterOptions"),c=s("./CsvFormatterStream");t(s("./types"),_);var h=s("./CsvFormatterStream");Object.defineProperty(_,"CsvFormatterStream",{enumerable:!0,get:function(){return h.CsvFormatterStream}});var u=s("./FormatterOptions");Object.defineProperty(_,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),_.format=d=>new c.CsvFormatterStream(new n.FormatterOptions(d)),_.write=(d,f)=>{const w=_.format(f),x=e.promisify((A,N)=>{w.write(A,void 0,N)});return d.reduce((A,N)=>A.then(()=>x(N)),Promise.resolve()).then(()=>w.end()).catch(A=>{w.emit("error",A)}),w},_.writeToStream=(d,f,w)=>_.write(f,w).pipe(d),_.writeToBuffer=function(d){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=[],x=new l.Writable({write(A,N,L){w.push(A),L()}});return new Promise((A,N)=>{x.on("error",N).on("finish",()=>A(p.concat(w))),_.write(d,f).pipe(x)})},_.writeToString=(d,f)=>_.writeToBuffer(d,f).then(w=>w.toString()),_.writeToPath=(d,f,w)=>{const x=i.createWriteStream(d,{encoding:"utf8"});return _.write(f,w).pipe(x)}}).call(this)}).call(this,s("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1},{}],153:[function(s,C,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvParserStream=void 0;const a=s("string_decoder"),o=s("stream"),r=s("./transforms"),t=s("./parser");class e extends o.Transform{constructor(i){super({objectMode:i.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=i,this.parser=new t.Parser(i),this.headerTransformer=new r.HeaderTransformer(i),this.decoder=new a.StringDecoder(i.encoding),this.rowTransformerValidator=new r.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(i){return this.rowTransformerValidator.rowTransform=i,this}validate(i){return this.rowTransformerValidator.rowValidator=i,this}emit(i){if(i==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var n=arguments.length,c=new Array(n>1?n-1:0),h=1;h{const d=x=>x?n(x):u%100!=0?h(u+1):void p(()=>h(u+1));if(this.checkAndEmitHeaders(),u>=c||this.hasHitRowLimit)return n();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const f=i[u];this.rowCount+=1,this.parsedRowCount+=1;const w=this.rowCount;return this.transformRow(f,(x,A)=>{if(x)return this.rowCount-=1,d(x);if(!A)return d(new Error("expected transform result"));if(A.isValid){if(A.row)return this.pushRow(A.row,d)}else this.emit("data-invalid",A.row,w,A.reason);return d()})};h(0)}transformRow(i,n){try{this.headerTransformer.transform(i,(c,h)=>c?n(c):h?h.isValid?h.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(h.row,n):this.skipRow(n):(this.rowCount-=1,this.parsedRowCount-=1,n(null,{row:null,isValid:!0})):this.shouldEmitRows?n(null,{isValid:!1,row:i}):this.skipRow(n):n(new Error("Expected result from header transform")))}catch(c){n(c)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(i){return this.rowCount-=1,i(null,{row:null,isValid:!0})}pushRow(i,n){try{this.parserOptions.objectMode?this.push(i):this.push(JSON.stringify(i)),n()}catch(c){n(c)}}static wrapDoneCallback(i){let n=!1;return function(c){if(c){if(n)throw c;return n=!0,void i(c)}for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=a.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!o.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(s,C,_){var p=Object.create?function(h,u,d,f){f===void 0&&(f=d),Object.defineProperty(h,f,{enumerable:!0,get:function(){return u[d]}})}:function(h,u,d,f){f===void 0&&(f=d),h[f]=u[d]},a=Object.create?function(h,u){Object.defineProperty(h,"default",{enumerable:!0,value:u})}:function(h,u){h.default=u},o=function(h){if(h&&h.__esModule)return h;var u={};if(h!=null)for(var d in h)d!=="default"&&Object.prototype.hasOwnProperty.call(h,d)&&p(u,h,d);return a(u,h),u},r=function(h,u){for(var d in h)d==="default"||Object.prototype.hasOwnProperty.call(u,d)||p(u,h,d)};Object.defineProperty(_,"__esModule",{value:!0}),_.parseString=_.parseFile=_.parseStream=_.parse=_.ParserOptions=_.CsvParserStream=void 0;const t=o(s("fs")),e=s("stream"),l=s("./ParserOptions"),i=s("./CsvParserStream");r(s("./types"),_);var n=s("./CsvParserStream");Object.defineProperty(_,"CsvParserStream",{enumerable:!0,get:function(){return n.CsvParserStream}});var c=s("./ParserOptions");Object.defineProperty(_,"ParserOptions",{enumerable:!0,get:function(){return c.ParserOptions}}),_.parse=h=>new i.CsvParserStream(new l.ParserOptions(h)),_.parseStream=(h,u)=>h.pipe(new i.CsvParserStream(new l.ParserOptions(u))),_.parseFile=function(h){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(h).pipe(new i.CsvParserStream(new l.ParserOptions(u)))},_.parseString=(h,u)=>{const d=new e.Readable;return d.push(h),d.push(null),d.pipe(new i.CsvParserStream(new l.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Parser=void 0;const p=s("./Scanner"),a=s("./RowParser"),o=s("./Token");class r{constructor(e){this.parserOptions=e,this.rowParser=new a.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,l){const i=new p.Scanner({line:r.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(e){const l=[];let i=!0;for(;i;)i=this.parseRow(e,l);return{line:e.line,rows:l}}parseWithComments(e){const{parserOptions:l}=this,i=[];for(let n=e.nextCharacterToken;n!==null;n=e.nextCharacterToken)if(o.Token.isTokenComment(n,l)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows:i};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:i};e.truncateToCursor()}else if(!this.parseRow(e,i))break;return{line:e.line,rows:i}}parseRow(e,l){if(!e.nextNonSpaceToken)return!1;const i=this.rowParser.parse(e);return i!==null&&(this.parserOptions.ignoreEmpty&&a.RowParser.isEmptyRow(i)||l.push(i),!0)}}_.Parser=r},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.RowParser=void 0;const p=s("./column"),a=s("./Token");_.RowParser=class{constructor(o){this.parserOptions=o,this.columnParser=new p.ColumnParser(o)}static isEmptyRow(o){return o.join("").replace(/\s+/g,"")===""}parse(o){const{parserOptions:r}=this,{hasMoreData:t}=o,e=o,l=[];let i=this.getStartToken(e,l);for(;i;){if(a.Token.isTokenRowDelimiter(i))return e.advancePastToken(i),!e.hasMoreCharacters&&a.Token.isTokenCarriageReturn(i,r)&&t?null:(e.truncateToCursor(),l);if(!this.shouldSkipColumnParse(e,i,l)){const n=this.columnParser.parse(e);if(n===null)return null;l.push(n)}i=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),l)}getStartToken(o,r){const t=o.nextNonSpaceToken;return t!==null&&a.Token.isTokenDelimiter(t,this.parserOptions)?(r.push(""),o.nextNonSpaceToken):t}shouldSkipColumnParse(o,r,t){const{parserOptions:e}=this;if(a.Token.isTokenDelimiter(r,e)){o.advancePastToken(r);const l=o.nextCharacterToken;if(!o.hasMoreCharacters||l!==null&&a.Token.isTokenRowDelimiter(l)||l!==null&&a.Token.isTokenDelimiter(l,e))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Scanner=void 0;const p=s("./Token"),a=/((?:\r\n)|\n|\r)/;_.Scanner=class{constructor(o){this.cursor=0,this.line=o.line,this.lineLength=this.line.length,this.parserOptions=o.parserOptions,this.hasMoreData=o.hasMoreData,this.cursor=o.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:o}=this,r=this.parserOptions.NEXT_TOKEN_REGEXP;if(o.search(r)===-1)return null;const t=r.exec(o);if(t==null)return null;const e=t[1],l=this.cursor+(t.index||0);return new p.Token({token:e,startCursor:l,endCursor:l+e.length-1})}get nextCharacterToken(){const{cursor:o,lineLength:r}=this;return r<=o?null:new p.Token({token:this.line[o],startCursor:o,endCursor:o})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const o=a.exec(this.lineFromCursor);return o?(this.cursor+=(o.index||0)+o[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(o){return this.cursor=o,this}advanceToToken(o){return this.cursor=o.startCursor,this}advancePastToken(o){return this.cursor=o.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Token=void 0,_.Token=class{constructor(p){this.token=p.token,this.startCursor=p.startCursor,this.endCursor=p.endCursor}static isTokenRowDelimiter(p){const a=p.token;return a==="\r"||a===` `||a===`\r `}static isTokenCarriageReturn(p,a){return p.token===a.carriageReturn}static isTokenComment(p,a){return a.supportsComments&&!!p&&p.token===a.comment}static isTokenEscapeCharacter(p,a){return p.token===a.escapeChar}static isTokenQuote(p,a){return p.token===a.quote}static isTokenDelimiter(p,a){return p.token===a.delimiter}}},{}],160:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=void 0,_.ColumnFormatter=class{constructor(p){p.trim?this.format=a=>a.trim():p.ltrim?this.format=a=>a.trimLeft():p.rtrim?this.format=a=>a.trimRight():this.format=a=>a}}},{}],161:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnParser=void 0;const p=s("./NonQuotedColumnParser"),a=s("./QuotedColumnParser"),o=s("../Token");_.ColumnParser=class{constructor(r){this.parserOptions=r,this.quotedColumnParser=new a.QuotedColumnParser(r),this.nonQuotedColumnParser=new p.NonQuotedColumnParser(r)}parse(r){const{nextNonSpaceToken:t}=r;return t!==null&&o.Token.isTokenQuote(t,this.parserOptions)?(r.advanceToToken(t),this.quotedColumnParser.parse(r)):this.nonQuotedColumnParser.parse(r)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.NonQuotedColumnParser=void 0;const p=s("./ColumnFormatter"),a=s("../Token");_.NonQuotedColumnParser=class{constructor(o){this.parserOptions=o,this.columnFormatter=new p.ColumnFormatter(o)}parse(o){if(!o.hasMoreCharacters)return null;const{parserOptions:r}=this,t=[];let e=o.nextCharacterToken;for(;e&&!a.Token.isTokenDelimiter(e,r)&&!a.Token.isTokenRowDelimiter(e);e=o.nextCharacterToken)t.push(e.token),o.advancePastToken(e);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=void 0;const p=s("./ColumnFormatter"),a=s("../Token");_.QuotedColumnParser=class{constructor(o){this.parserOptions=o,this.columnFormatter=new p.ColumnFormatter(o)}parse(o){if(!o.hasMoreCharacters)return null;const r=o.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(o);if(!t){if(o.advanceTo(r),!o.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${o.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(o),e}gatherDataBetweenQuotes(o){const{parserOptions:r}=this;let t=!1,e=!1;const l=[];let i=o.nextCharacterToken;for(;!e&&i!==null;i=o.nextCharacterToken){const n=a.Token.isTokenQuote(i,r);if(!t&&n)t=!0;else if(t)if(a.Token.isTokenEscapeCharacter(i,r)){o.advancePastToken(i);const c=o.nextCharacterToken;c!==null&&(a.Token.isTokenQuote(c,r)||a.Token.isTokenEscapeCharacter(c,r))?(l.push(c.token),i=c):n?e=!0:l.push(i.token)}else n?e=!0:l.push(i.token);o.advancePastToken(i)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:e}}checkForMalformedColumn(o){const{parserOptions:r}=this,{nextNonSpaceToken:t}=o;if(t){const e=a.Token.isTokenDelimiter(t,r),l=a.Token.isTokenRowDelimiter(t);if(!e&&!l){const i=o.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${r.escapedDelimiter}' OR new line got: '${t.token}'. at '${i}`)}o.advanceToToken(t)}else o.hasMoreData||o.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=void 0;var p=s("./ColumnParser");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return p.ColumnParser}});var a=s("./NonQuotedColumnParser");Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return a.NonQuotedColumnParser}});var o=s("./QuotedColumnParser");Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return o.QuotedColumnParser}});var r=s("./ColumnFormatter");Object.defineProperty(_,"ColumnFormatter",{enumerable:!0,get:function(){return r.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=_.Token=_.Scanner=_.RowParser=_.Parser=void 0;var p=s("./Parser");Object.defineProperty(_,"Parser",{enumerable:!0,get:function(){return p.Parser}});var a=s("./RowParser");Object.defineProperty(_,"RowParser",{enumerable:!0,get:function(){return a.RowParser}});var o=s("./Scanner");Object.defineProperty(_,"Scanner",{enumerable:!0,get:function(){return o.Scanner}});var r=s("./Token");Object.defineProperty(_,"Token",{enumerable:!0,get:function(){return r.Token}});var t=s("./column");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(s,C,_){var p=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=void 0;const a=p(s("lodash.isundefined")),o=p(s("lodash.isfunction")),r=p(s("lodash.uniq")),t=p(s("lodash.groupby"));_.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):o.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,l){return this.shouldMapRow(e)?l(null,this.processRow(e)):l(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&e.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return l.strictColumnHandling&&e.length!!n);if(r.default(i).length!==i.length){const n=t.default(i),c=Object.keys(n).filter(h=>n[h].length>1);throw new Error("Duplicate headers found "+JSON.stringify(c))}this.headers=e,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(s,C,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowTransformerValidator=void 0;const a=p(s("lodash.isfunction")),o=s("../types");class r{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return o.isSyncTransform(e)?(l,i)=>{let n=null;try{n=e(l)}catch(c){return i(c)}return i(null,n)}:e}static createValidator(e){return o.isSyncValidate(e)?(l,i)=>{i(null,{row:l,isValid:e(l)})}:(l,i)=>{e(l,(n,c,h)=>n?i(n):i(null,c?{row:l,isValid:c,reason:h}:{row:l,isValid:!1,reason:h}))}}set rowTransform(e){if(!a.default(e))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(e)}set rowValidator(e){if(!a.default(e))throw new TypeError("The validate should be a function");this._rowValidator=r.createValidator(e)}transformAndValidate(e,l){return this.callTransformer(e,(i,n)=>i?l(i):n?this.callValidator(n,(c,h)=>c?l(c):h&&!h.isValid?l(null,{row:n,isValid:!1,reason:h.reason}):l(null,{row:n,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(e,l){return this._rowTransform?this._rowTransform(e,l):l(null,e)}callValidator(e,l){return this._rowValidator?this._rowValidator(e,l):l(null,{row:e,isValid:!0})}}_.RowTransformerValidator=r},{"../types":169,"lodash.isfunction":446}],168:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=_.RowTransformerValidator=void 0;var p=s("./RowTransformerValidator");Object.defineProperty(_,"RowTransformerValidator",{enumerable:!0,get:function(){return p.RowTransformerValidator}});var a=s("./HeaderTransformer");Object.defineProperty(_,"HeaderTransformer",{enumerable:!0,get:function(){return a.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(s,C,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncValidate=_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1,_.isSyncValidate=p=>p.length===1},{}],170:[function(s,C,_){const p=_;p.bignum=s("bn.js"),p.define=s("./asn1/api").define,p.base=s("./asn1/base"),p.constants=s("./asn1/constants"),p.decoders=s("./asn1/decoders"),p.encoders=s("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(s,C,_){const p=s("./encoders"),a=s("./decoders"),o=s("inherits");function r(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}_.define=function(t,e){return new r(t,e)},r.prototype._createNamed=function(t){const e=this.name;function l(i){this._initNamed(i,e)}return o(l,t),l.prototype._initNamed=function(i,n){t.call(this,i,n)},new l(this)},r.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(a[t])),this.decoders[t]},r.prototype.decode=function(t,e,l){return this._getDecoder(e).decode(t,l)},r.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(p[t])),this.encoders[t]},r.prototype.encode=function(t,e,l){return this._getEncoder(e).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(s,C,_){const p=s("inherits"),a=s("../base/reporter").Reporter,o=s("safer-buffer").Buffer;function r(e,l){a.call(this,l),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,l){if(Array.isArray(e))this.length=0,this.value=e.map(function(i){return t.isEncoderBuffer(i)||(i=new t(i,l)),this.length+=i.length,i},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return l.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return l.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}p(r,a),_.DecoderBuffer=r,r.isDecoderBuffer=function(e){return e instanceof r?!0:typeof e=="object"&&o.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"},r.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},r.prototype.restore=function(e){const l=new r(this.base);return l.offset=e.offset,l.length=this.offset,this.offset=e.offset,a.prototype.restore.call(this,e.reporter),l},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,l){if(!(this.offset+e<=this.length))return this.error(l||"DecoderBuffer overrun");const i=new r(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},_.EncoderBuffer=t,t.isEncoderBuffer=function(e){return e instanceof t?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"},t.prototype.join=function(e,l){return e||(e=o.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,l),l+=i.length}):(typeof this.value=="number"?e[l]=this.value:typeof this.value=="string"?e.write(this.value,l):o.isBuffer(this.value)&&this.value.copy(e,l),l+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(s,C,_){const p=_;p.Reporter=s("./reporter").Reporter,p.DecoderBuffer=s("./buffer").DecoderBuffer,p.EncoderBuffer=s("./buffer").EncoderBuffer,p.Node=s("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(s,C,_){const p=s("../base/reporter").Reporter,a=s("../base/buffer").EncoderBuffer,o=s("../base/buffer").DecoderBuffer,r=s("minimalistic-assert"),t=["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"],e=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(n,c,h){const u={};this._baseState=u,u.name=h,u.enc=n,u.parent=c||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}C.exports=l;const i=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const n=this._baseState,c={};i.forEach(function(u){c[u]=n[u]});const h=new this.constructor(c.parent);return h._baseState=c,h},l.prototype._wrap=function(){const n=this._baseState;e.forEach(function(c){this[c]=function(){const h=new this.constructor(this);return n.children.push(h),h[c].apply(h,arguments)}},this)},l.prototype._init=function(n){const c=this._baseState;r(c.parent===null),n.call(this),c.children=c.children.filter(function(h){return h._baseState.parent===this},this),r.equal(c.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(n){const c=this._baseState,h=n.filter(function(u){return u instanceof this.constructor},this);n=n.filter(function(u){return!(u instanceof this.constructor)},this),h.length!==0&&(r(c.children===null),c.children=h,h.forEach(function(u){u._baseState.parent=this},this)),n.length!==0&&(r(c.args===null),c.args=n,c.reverseArgs=n.map(function(u){if(typeof u!="object"||u.constructor!==Object)return u;const d={};return Object.keys(u).forEach(function(f){f==(0|f)&&(f|=0);const w=u[f];d[w]=f}),d}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(n){l.prototype[n]=function(){const c=this._baseState;throw new Error(n+" not implemented for encoding: "+c.enc)}}),t.forEach(function(n){l.prototype[n]=function(){const c=this._baseState,h=Array.prototype.slice.call(arguments);return r(c.tag===null),c.tag=n,this._useArgs(h),this}}),l.prototype.use=function(n){r(n);const c=this._baseState;return r(c.use===null),c.use=n,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(n){const c=this._baseState;return r(c.default===null),c.default=n,c.optional=!0,this},l.prototype.explicit=function(n){const c=this._baseState;return r(c.explicit===null&&c.implicit===null),c.explicit=n,this},l.prototype.implicit=function(n){const c=this._baseState;return r(c.explicit===null&&c.implicit===null),c.implicit=n,this},l.prototype.obj=function(){const n=this._baseState,c=Array.prototype.slice.call(arguments);return n.obj=!0,c.length!==0&&this._useArgs(c),this},l.prototype.key=function(n){const c=this._baseState;return r(c.key===null),c.key=n,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(n){const c=this._baseState;return r(c.choice===null),c.choice=n,this._useArgs(Object.keys(n).map(function(h){return n[h]})),this},l.prototype.contains=function(n){const c=this._baseState;return r(c.use===null),c.contains=n,this},l.prototype._decode=function(n,c){const h=this._baseState;if(h.parent===null)return n.wrapResult(h.children[0]._decode(n,c));let u,d=h.default,f=!0,w=null;if(h.key!==null&&(w=n.enterKey(h.key)),h.optional){let x=null;if(h.explicit!==null?x=h.explicit:h.implicit!==null?x=h.implicit:h.tag!==null&&(x=h.tag),x!==null||h.any){if(f=this._peekTag(n,x,h.any),n.isError(f))return f}else{const A=n.save();try{h.choice===null?this._decodeGeneric(h.tag,n,c):this._decodeChoice(n,c),f=!0}catch(N){f=!1}n.restore(A)}}if(h.obj&&f&&(u=n.enterObject()),f){if(h.explicit!==null){const A=this._decodeTag(n,h.explicit);if(n.isError(A))return A;n=A}const x=n.offset;if(h.use===null&&h.choice===null){let A;h.any&&(A=n.save());const N=this._decodeTag(n,h.implicit!==null?h.implicit:h.tag,h.any);if(n.isError(N))return N;h.any?d=n.raw(A):n=N}if(c&&c.track&&h.tag!==null&&c.track(n.path(),x,n.length,"tagged"),c&&c.track&&h.tag!==null&&c.track(n.path(),n.offset,n.length,"content"),h.any||(d=h.choice===null?this._decodeGeneric(h.tag,n,c):this._decodeChoice(n,c)),n.isError(d))return d;if(h.any||h.choice!==null||h.children===null||h.children.forEach(function(A){A._decode(n,c)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){const A=new o(d);d=this._getUse(h.contains,n._reporterState.obj)._decode(A,c)}}return h.obj&&f&&(d=n.leaveObject(u)),h.key===null||d===null&&f!==!0?w!==null&&n.exitKey(w):n.leaveKey(w,h.key,d),d},l.prototype._decodeGeneric=function(n,c,h){const u=this._baseState;return n==="seq"||n==="set"?null:n==="seqof"||n==="setof"?this._decodeList(c,n,u.args[0],h):/str$/.test(n)?this._decodeStr(c,n,h):n==="objid"&&u.args?this._decodeObjid(c,u.args[0],u.args[1],h):n==="objid"?this._decodeObjid(c,null,null,h):n==="gentime"||n==="utctime"?this._decodeTime(c,n,h):n==="null_"?this._decodeNull(c,h):n==="bool"?this._decodeBool(c,h):n==="objDesc"?this._decodeStr(c,n,h):n==="int"||n==="enum"?this._decodeInt(c,u.args&&u.args[0],h):u.use!==null?this._getUse(u.use,c._reporterState.obj)._decode(c,h):c.error("unknown tag: "+n)},l.prototype._getUse=function(n,c){const h=this._baseState;return h.useDecoder=this._use(n,c),r(h.useDecoder._baseState.parent===null),h.useDecoder=h.useDecoder._baseState.children[0],h.implicit!==h.useDecoder._baseState.implicit&&(h.useDecoder=h.useDecoder.clone(),h.useDecoder._baseState.implicit=h.implicit),h.useDecoder},l.prototype._decodeChoice=function(n,c){const h=this._baseState;let u=null,d=!1;return Object.keys(h.choice).some(function(f){const w=n.save(),x=h.choice[f];try{const A=x._decode(n,c);if(n.isError(A))return!1;u={type:f,value:A},d=!0}catch(A){return n.restore(w),!1}return!0},this),d?u:n.error("Choice not matched")},l.prototype._createEncoderBuffer=function(n){return new a(n,this.reporter)},l.prototype._encode=function(n,c,h){const u=this._baseState;if(u.default!==null&&u.default===n)return;const d=this._encodeValue(n,c,h);return d===void 0||this._skipDefault(d,c,h)?void 0:d},l.prototype._encodeValue=function(n,c,h){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(n,c||new p);let d=null;if(this.reporter=c,u.optional&&n===void 0){if(u.default===null)return;n=u.default}let f=null,w=!1;if(u.any)d=this._createEncoderBuffer(n);else if(u.choice)d=this._encodeChoice(n,c);else if(u.contains)f=this._getUse(u.contains,h)._encode(n,c),w=!0;else if(u.children)f=u.children.map(function(x){if(x._baseState.tag==="null_")return x._encode(null,c,n);if(x._baseState.key===null)return c.error("Child should have a key");const A=c.enterKey(x._baseState.key);if(typeof n!="object")return c.error("Child expected, but input is not object");const N=x._encode(n[x._baseState.key],c,n);return c.leaveKey(A),N},this).filter(function(x){return x}),f=this._createEncoderBuffer(f);else if(u.tag==="seqof"||u.tag==="setof"){if(!u.args||u.args.length!==1)return c.error("Too many args for : "+u.tag);if(!Array.isArray(n))return c.error("seqof/setof, but data is not Array");const x=this.clone();x._baseState.implicit=null,f=this._createEncoderBuffer(n.map(function(A){const N=this._baseState;return this._getUse(N.args[0],n)._encode(A,c)},x))}else u.use!==null?d=this._getUse(u.use,h)._encode(n,c):(f=this._encodePrimitive(u.tag,n),w=!0);if(!u.any&&u.choice===null){const x=u.implicit!==null?u.implicit:u.tag,A=u.implicit===null?"universal":"context";x===null?u.use===null&&c.error("Tag could be omitted only for .use()"):u.use===null&&(d=this._encodeComposite(x,w,A,f))}return u.explicit!==null&&(d=this._encodeComposite(u.explicit,!1,"context",d)),d},l.prototype._encodeChoice=function(n,c){const h=this._baseState,u=h.choice[n.type];return u||r(!1,n.type+" not found in "+JSON.stringify(Object.keys(h.choice))),u._encode(n.value,c)},l.prototype._encodePrimitive=function(n,c){const h=this._baseState;if(/str$/.test(n))return this._encodeStr(c,n);if(n==="objid"&&h.args)return this._encodeObjid(c,h.reverseArgs[0],h.args[1]);if(n==="objid")return this._encodeObjid(c,null,null);if(n==="gentime"||n==="utctime")return this._encodeTime(c,n);if(n==="null_")return this._encodeNull();if(n==="int"||n==="enum")return this._encodeInt(c,h.args&&h.reverseArgs[0]);if(n==="bool")return this._encodeBool(c);if(n==="objDesc")return this._encodeStr(c,n);throw new Error("Unsupported tag: "+n)},l.prototype._isNumstr=function(n){return/^[0-9 ]*$/.test(n)},l.prototype._isPrintstr=function(n){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(n)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(s,C,_){const p=s("inherits");function a(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function o(r,t){this.path=r,this.rethrow(t)}_.Reporter=a,a.prototype.isError=function(r){return r instanceof o},a.prototype.save=function(){const r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},a.prototype.restore=function(r){const t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},a.prototype.enterKey=function(r){return this._reporterState.path.push(r)},a.prototype.exitKey=function(r){const t=this._reporterState;t.path=t.path.slice(0,r-1)},a.prototype.leaveKey=function(r,t,e){const l=this._reporterState;this.exitKey(r),l.obj!==null&&(l.obj[t]=e)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){const r=this._reporterState,t=r.obj;return r.obj={},t},a.prototype.leaveObject=function(r){const t=this._reporterState,e=t.obj;return t.obj=r,e},a.prototype.error=function(r){let t;const e=this._reporterState,l=r instanceof o;if(t=l?r:new o(e.path.map(function(i){return"["+JSON.stringify(i)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return l||e.errors.push(t),t},a.prototype.wrapResult=function(r){const t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},p(o,Error),o.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(s,C,_){function p(a){const o={};return Object.keys(a).forEach(function(r){(0|r)==r&&(r|=0);const t=a[r];o[t]=r}),o}_.tagClass={0:"universal",1:"application",2:"context",3:"private"},_.tagClassByName=p(_.tagClass),_.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"},_.tagByName=p(_.tag)},{}],177:[function(s,C,_){const p=_;p._reverse=function(a){const o={};return Object.keys(a).forEach(function(r){(0|r)==r&&(r|=0);const t=a[r];o[t]=r}),o},p.der=s("./der")},{"./der":176}],178:[function(s,C,_){const p=s("inherits"),a=s("bn.js"),o=s("../base/buffer").DecoderBuffer,r=s("../base/node"),t=s("../constants/der");function e(c){this.enc="der",this.name=c.name,this.entity=c,this.tree=new l,this.tree._init(c.body)}function l(c){r.call(this,"der",c)}function i(c,h){let u=c.readUInt8(h);if(c.isError(u))return u;const d=t.tagClass[u>>6],f=(32&u)==0;if((31&u)==31){let w=u;for(u=0;(128&w)==128;){if(w=c.readUInt8(h),c.isError(w))return w;u<<=7,u|=127&w}}else u&=31;return{cls:d,primitive:f,tag:u,tagStr:t.tag[u]}}function n(c,h,u){let d=c.readUInt8(u);if(c.isError(d))return d;if(!h&&d===128)return null;if(!(128&d))return d;const f=127&d;if(f>4)return c.error("length octect is too long");d=0;for(let w=0;w=31?N.error("Multi-octet tag encoding unsupported"):(x||(L|=32),L|=r.tagClassByName[A||"universal"]<<6,L)}(i,n,c,this.reporter);if(h.length<128){const w=a.alloc(2);return w[0]=u,w[1]=h.length,this._createEncoderBuffer([w,h])}let d=1;for(let w=h.length;w>=256;w>>=8)d++;const f=a.alloc(2+d);f[0]=u,f[1]=128|d;for(let w=1+d,x=h.length;x>0;w--,x>>=8)f[w]=255&x;return this._createEncoderBuffer([f,h])},e.prototype._encodeStr=function(i,n){if(n==="bitstr")return this._createEncoderBuffer([0|i.unused,i.data]);if(n==="bmpstr"){const c=a.alloc(2*i.length);for(let h=0;h=40)return this.reporter.error("Second objid identifier OOB");i.splice(0,2,40*i[0]+i[1])}let h=0;for(let f=0;f=128;w>>=7)h++}const u=a.alloc(h);let d=u.length-1;for(let f=i.length-1;f>=0;f--){let w=i[f];for(u[d--]=127&w;(w>>=7)>0;)u[d--]=128|127&w}return this._createEncoderBuffer(u)},e.prototype._encodeTime=function(i,n){let c;const h=new Date(i);return n==="gentime"?c=[l(h.getUTCFullYear()),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):n==="utctime"?c=[l(h.getUTCFullYear()%100),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+n+" time is not supported yet"),this._encodeStr(c,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(i,n){if(typeof i=="string"){if(!n)return this.reporter.error("String int or enum given, but no values map");if(!n.hasOwnProperty(i))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(i));i=n[i]}if(typeof i!="number"&&!a.isBuffer(i)){const u=i.toArray();!i.sign&&128&u[0]&&u.unshift(0),i=a.from(u)}if(a.isBuffer(i)){let u=i.length;i.length===0&&u++;const d=a.alloc(u);return i.copy(d),i.length===0&&(d[0]=0),this._createEncoderBuffer(d)}if(i<128)return this._createEncoderBuffer(i);if(i<256)return this._createEncoderBuffer([0,i]);let c=1;for(let u=i;u>=256;u>>=8)c++;const h=new Array(c);for(let u=h.length-1;u>=0;u--)h[u]=255&i,i>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(a.from(h))},e.prototype._encodeBool=function(i){return this._createEncoderBuffer(i?255:0)},e.prototype._use=function(i,n){return typeof i=="function"&&(i=i(n)),i._getEncoder("der").tree},e.prototype._skipDefault=function(i,n,c){const h=this._baseState;let u;if(h.default===null)return!1;const d=i.join();if(h.defaultBuffer===void 0&&(h.defaultBuffer=this._encodeValue(h.default,n,c).join()),d.length!==h.defaultBuffer.length)return!1;for(u=0;u=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function i(k,E,v){var m=l(k,v);return v-1>=E&&(m|=l(k,v-1)<<4),m}function n(k,E,v,m){for(var b=0,g=Math.min(k.length,v),y=E;y=49?S-49+10:S>=17?S-17+10:S}return b}t.isBN=function(k){return k instanceof t||k!==null&&typeof k=="object"&&k.constructor.wordSize===t.wordSize&&Array.isArray(k.words)},t.max=function(k,E){return k.cmp(E)>0?k:E},t.min=function(k,E){return k.cmp(E)<0?k:E},t.prototype._init=function(k,E,v){if(typeof k=="number")return this._initNumber(k,E,v);if(typeof k=="object")return this._initArray(k,E,v);E==="hex"&&(E=16),o(E===(0|E)&&E>=2&&E<=36);var m=0;(k=k.toString().replace(/\s+/g,""))[0]==="-"&&(m++,this.negative=1),m=0;m-=3)g=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(v==="le")for(m=0,b=0;m>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(k,E,v){this.length=Math.ceil((k.length-E)/6),this.words=new Array(this.length);for(var m=0;m=E;m-=2)b=i(k,E,m)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(m=(k.length-E)%2==0?E+1:E;m=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(k,E,v){this.words=[0],this.length=1;for(var m=0,b=1;b<=67108863;b*=E)m++;m--,b=b/E|0;for(var g=k.length-v,y=g%m,S=Math.min(g,g-y)+v,R=0,I=v;I1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?""};var c=["","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"],h=[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],u=[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 d(k,E,v){v.negative=E.negative^k.negative;var m=k.length+E.length|0;v.length=m,m=m-1|0;var b=0|k.words[0],g=0|E.words[0],y=b*g,S=67108863&y,R=y/67108864|0;v.words[0]=S;for(var I=1;I>>26,$=67108863&R,W=Math.min(I,E.length-1),j=Math.max(0,I-k.length+1);j<=W;j++){var H=I-j|0;z+=(y=(b=0|k.words[H])*(g=0|E.words[j])+$)/67108864|0,$=67108863&y}v.words[I]=0|$,R=0|z}return R!==0?v.words[I]=0|R:v.length--,v.strip()}t.prototype.toString=function(k,E){var v;if(E=0|E||1,(k=k||10)===16||k==="hex"){v="";for(var m=0,b=0,g=0;g>>24-m&16777215)!==0||g!==this.length-1?c[6-S.length]+S+v:S+v,(m+=2)>=26&&(m-=26,g--)}for(b!==0&&(v=b.toString(16)+v);v.length%E!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(0|k)&&k>=2&&k<=36){var R=h[k],I=u[k];v="";var z=this.clone();for(z.negative=0;!z.isZero();){var $=z.modn(I).toString(k);v=(z=z.idivn(I)).isZero()?$+v:c[R-$.length]+$+v}for(this.isZero()&&(v="0"+v);v.length%E!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}o(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=67108864*this.words[1]:this.length===3&&this.words[2]===1?k+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(k,E){return o(e!==void 0),this.toArrayLike(e,k,E)},t.prototype.toArray=function(k,E){return this.toArrayLike(Array,k,E)},t.prototype.toArrayLike=function(k,E,v){var m=this.byteLength(),b=v||Math.max(1,m);o(m<=b,"byte array longer than desired length"),o(b>0,"Requested array length <= 0"),this.strip();var g,y,S=E==="le",R=new k(b),I=this.clone();if(S){for(y=0;!I.isZero();y++)g=I.andln(255),I.iushrn(8),R[y]=g;for(;y=4096&&(v+=13,E>>>=13),E>=64&&(v+=7,E>>>=7),E>=8&&(v+=4,E>>>=4),E>=2&&(v+=2,E>>>=2),v+E},t.prototype._zeroBits=function(k){if(k===0)return 26;var E=k,v=0;return!(8191&E)&&(v+=13,E>>>=13),!(127&E)&&(v+=7,E>>>=7),!(15&E)&&(v+=4,E>>>=4),!(3&E)&&(v+=2,E>>>=2),!(1&E)&&v++,v},t.prototype.bitLength=function(){var k=this.words[this.length-1],E=this._countBits(k);return 26*(this.length-1)+E},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,E=0;Ek.length?this.clone().ior(k):k.clone().ior(this)},t.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},t.prototype.iuand=function(k){var E;E=this.length>k.length?k:this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},t.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},t.prototype.iuxor=function(k){var E,v;this.length>k.length?(E=this,v=k):(E=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},t.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},t.prototype.inotn=function(k){o(typeof k=="number"&&k>=0);var E=0|Math.ceil(k/26),v=k%26;this._expand(E),v>0&&E--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},t.prototype.notn=function(k){return this.clone().inotn(k)},t.prototype.setn=function(k,E){o(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),this.words[v]=E?this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=v.length,b!==0)this.words[this.length]=b,this.length++;else if(v!==this)for(;gk.length?this.clone().iadd(k):k.clone().iadd(this)},t.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var E=this.iadd(k);return k.negative=1,E._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v,m,b=this.cmp(k);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(v=this,m=k):(v=k,m=this);for(var g=0,y=0;y>26,this.words[y]=67108863&E;for(;g!==0&&y>26,this.words[y]=67108863&E;if(g===0&&y>>13,j=0|y[1],H=8191&j,M=j>>>13,T=0|y[2],F=8191&T,V=T>>>13,Y=0|y[3],q=8191&Y,K=Y>>>13,Q=0|y[4],et=8191&Q,X=Q>>>13,J=0|y[5],G=8191&J,nt=J>>>13,rt=0|y[6],it=8191&rt,ut=rt>>>13,ct=0|y[7],pt=8191&ct,Ct=ct>>>13,kt=0|y[8],vt=8191&kt,Ot=kt>>>13,Rt=0|y[9],wt=8191&Rt,Tt=Rt>>>13,mt=0|S[0],ft=8191&mt,gt=mt>>>13,Mt=0|S[1],Et=8191&Mt,Ht=Mt>>>13,Zt=0|S[2],Nt=8191&Zt,ie=Zt>>>13,Gt=0|S[3],$t=8191&Gt,he=Gt>>>13,se=0|S[4],Ft=8191&se,te=se>>>13,ue=0|S[5],Lt=8191&ue,oe=ue>>>13,ce=0|S[6],Wt=8191&ce,tt=ce>>>13,st=0|S[7],ht=8191&st,xt=st>>>13,Pt=0|S[8],St=8191&Pt,zt=Pt>>>13,Dt=0|S[9],It=8191&Dt,Vt=Dt>>>13;v.negative=k.negative^E.negative,v.length=19;var Ut=(I+(m=Math.imul($,ft))|0)+((8191&(b=(b=Math.imul($,gt))+Math.imul(W,ft)|0))<<13)|0;I=((g=Math.imul(W,gt))+(b>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,m=Math.imul(H,ft),b=(b=Math.imul(H,gt))+Math.imul(M,ft)|0,g=Math.imul(M,gt);var Kt=(I+(m=m+Math.imul($,Et)|0)|0)+((8191&(b=(b=b+Math.imul($,Ht)|0)+Math.imul(W,Et)|0))<<13)|0;I=((g=g+Math.imul(W,Ht)|0)+(b>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,m=Math.imul(F,ft),b=(b=Math.imul(F,gt))+Math.imul(V,ft)|0,g=Math.imul(V,gt),m=m+Math.imul(H,Et)|0,b=(b=b+Math.imul(H,Ht)|0)+Math.imul(M,Et)|0,g=g+Math.imul(M,Ht)|0;var be=(I+(m=m+Math.imul($,Nt)|0)|0)+((8191&(b=(b=b+Math.imul($,ie)|0)+Math.imul(W,Nt)|0))<<13)|0;I=((g=g+Math.imul(W,ie)|0)+(b>>>13)|0)+(be>>>26)|0,be&=67108863,m=Math.imul(q,ft),b=(b=Math.imul(q,gt))+Math.imul(K,ft)|0,g=Math.imul(K,gt),m=m+Math.imul(F,Et)|0,b=(b=b+Math.imul(F,Ht)|0)+Math.imul(V,Et)|0,g=g+Math.imul(V,Ht)|0,m=m+Math.imul(H,Nt)|0,b=(b=b+Math.imul(H,ie)|0)+Math.imul(M,Nt)|0,g=g+Math.imul(M,ie)|0;var fe=(I+(m=m+Math.imul($,$t)|0)|0)+((8191&(b=(b=b+Math.imul($,he)|0)+Math.imul(W,$t)|0))<<13)|0;I=((g=g+Math.imul(W,he)|0)+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,m=Math.imul(et,ft),b=(b=Math.imul(et,gt))+Math.imul(X,ft)|0,g=Math.imul(X,gt),m=m+Math.imul(q,Et)|0,b=(b=b+Math.imul(q,Ht)|0)+Math.imul(K,Et)|0,g=g+Math.imul(K,Ht)|0,m=m+Math.imul(F,Nt)|0,b=(b=b+Math.imul(F,ie)|0)+Math.imul(V,Nt)|0,g=g+Math.imul(V,ie)|0,m=m+Math.imul(H,$t)|0,b=(b=b+Math.imul(H,he)|0)+Math.imul(M,$t)|0,g=g+Math.imul(M,he)|0;var ve=(I+(m=m+Math.imul($,Ft)|0)|0)+((8191&(b=(b=b+Math.imul($,te)|0)+Math.imul(W,Ft)|0))<<13)|0;I=((g=g+Math.imul(W,te)|0)+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,m=Math.imul(G,ft),b=(b=Math.imul(G,gt))+Math.imul(nt,ft)|0,g=Math.imul(nt,gt),m=m+Math.imul(et,Et)|0,b=(b=b+Math.imul(et,Ht)|0)+Math.imul(X,Et)|0,g=g+Math.imul(X,Ht)|0,m=m+Math.imul(q,Nt)|0,b=(b=b+Math.imul(q,ie)|0)+Math.imul(K,Nt)|0,g=g+Math.imul(K,ie)|0,m=m+Math.imul(F,$t)|0,b=(b=b+Math.imul(F,he)|0)+Math.imul(V,$t)|0,g=g+Math.imul(V,he)|0,m=m+Math.imul(H,Ft)|0,b=(b=b+Math.imul(H,te)|0)+Math.imul(M,Ft)|0,g=g+Math.imul(M,te)|0;var we=(I+(m=m+Math.imul($,Lt)|0)|0)+((8191&(b=(b=b+Math.imul($,oe)|0)+Math.imul(W,Lt)|0))<<13)|0;I=((g=g+Math.imul(W,oe)|0)+(b>>>13)|0)+(we>>>26)|0,we&=67108863,m=Math.imul(it,ft),b=(b=Math.imul(it,gt))+Math.imul(ut,ft)|0,g=Math.imul(ut,gt),m=m+Math.imul(G,Et)|0,b=(b=b+Math.imul(G,Ht)|0)+Math.imul(nt,Et)|0,g=g+Math.imul(nt,Ht)|0,m=m+Math.imul(et,Nt)|0,b=(b=b+Math.imul(et,ie)|0)+Math.imul(X,Nt)|0,g=g+Math.imul(X,ie)|0,m=m+Math.imul(q,$t)|0,b=(b=b+Math.imul(q,he)|0)+Math.imul(K,$t)|0,g=g+Math.imul(K,he)|0,m=m+Math.imul(F,Ft)|0,b=(b=b+Math.imul(F,te)|0)+Math.imul(V,Ft)|0,g=g+Math.imul(V,te)|0,m=m+Math.imul(H,Lt)|0,b=(b=b+Math.imul(H,oe)|0)+Math.imul(M,Lt)|0,g=g+Math.imul(M,oe)|0;var Se=(I+(m=m+Math.imul($,Wt)|0)|0)+((8191&(b=(b=b+Math.imul($,tt)|0)+Math.imul(W,Wt)|0))<<13)|0;I=((g=g+Math.imul(W,tt)|0)+(b>>>13)|0)+(Se>>>26)|0,Se&=67108863,m=Math.imul(pt,ft),b=(b=Math.imul(pt,gt))+Math.imul(Ct,ft)|0,g=Math.imul(Ct,gt),m=m+Math.imul(it,Et)|0,b=(b=b+Math.imul(it,Ht)|0)+Math.imul(ut,Et)|0,g=g+Math.imul(ut,Ht)|0,m=m+Math.imul(G,Nt)|0,b=(b=b+Math.imul(G,ie)|0)+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,ie)|0,m=m+Math.imul(et,$t)|0,b=(b=b+Math.imul(et,he)|0)+Math.imul(X,$t)|0,g=g+Math.imul(X,he)|0,m=m+Math.imul(q,Ft)|0,b=(b=b+Math.imul(q,te)|0)+Math.imul(K,Ft)|0,g=g+Math.imul(K,te)|0,m=m+Math.imul(F,Lt)|0,b=(b=b+Math.imul(F,oe)|0)+Math.imul(V,Lt)|0,g=g+Math.imul(V,oe)|0,m=m+Math.imul(H,Wt)|0,b=(b=b+Math.imul(H,tt)|0)+Math.imul(M,Wt)|0,g=g+Math.imul(M,tt)|0;var Z=(I+(m=m+Math.imul($,ht)|0)|0)+((8191&(b=(b=b+Math.imul($,xt)|0)+Math.imul(W,ht)|0))<<13)|0;I=((g=g+Math.imul(W,xt)|0)+(b>>>13)|0)+(Z>>>26)|0,Z&=67108863,m=Math.imul(vt,ft),b=(b=Math.imul(vt,gt))+Math.imul(Ot,ft)|0,g=Math.imul(Ot,gt),m=m+Math.imul(pt,Et)|0,b=(b=b+Math.imul(pt,Ht)|0)+Math.imul(Ct,Et)|0,g=g+Math.imul(Ct,Ht)|0,m=m+Math.imul(it,Nt)|0,b=(b=b+Math.imul(it,ie)|0)+Math.imul(ut,Nt)|0,g=g+Math.imul(ut,ie)|0,m=m+Math.imul(G,$t)|0,b=(b=b+Math.imul(G,he)|0)+Math.imul(nt,$t)|0,g=g+Math.imul(nt,he)|0,m=m+Math.imul(et,Ft)|0,b=(b=b+Math.imul(et,te)|0)+Math.imul(X,Ft)|0,g=g+Math.imul(X,te)|0,m=m+Math.imul(q,Lt)|0,b=(b=b+Math.imul(q,oe)|0)+Math.imul(K,Lt)|0,g=g+Math.imul(K,oe)|0,m=m+Math.imul(F,Wt)|0,b=(b=b+Math.imul(F,tt)|0)+Math.imul(V,Wt)|0,g=g+Math.imul(V,tt)|0,m=m+Math.imul(H,ht)|0,b=(b=b+Math.imul(H,xt)|0)+Math.imul(M,ht)|0,g=g+Math.imul(M,xt)|0;var at=(I+(m=m+Math.imul($,St)|0)|0)+((8191&(b=(b=b+Math.imul($,zt)|0)+Math.imul(W,St)|0))<<13)|0;I=((g=g+Math.imul(W,zt)|0)+(b>>>13)|0)+(at>>>26)|0,at&=67108863,m=Math.imul(wt,ft),b=(b=Math.imul(wt,gt))+Math.imul(Tt,ft)|0,g=Math.imul(Tt,gt),m=m+Math.imul(vt,Et)|0,b=(b=b+Math.imul(vt,Ht)|0)+Math.imul(Ot,Et)|0,g=g+Math.imul(Ot,Ht)|0,m=m+Math.imul(pt,Nt)|0,b=(b=b+Math.imul(pt,ie)|0)+Math.imul(Ct,Nt)|0,g=g+Math.imul(Ct,ie)|0,m=m+Math.imul(it,$t)|0,b=(b=b+Math.imul(it,he)|0)+Math.imul(ut,$t)|0,g=g+Math.imul(ut,he)|0,m=m+Math.imul(G,Ft)|0,b=(b=b+Math.imul(G,te)|0)+Math.imul(nt,Ft)|0,g=g+Math.imul(nt,te)|0,m=m+Math.imul(et,Lt)|0,b=(b=b+Math.imul(et,oe)|0)+Math.imul(X,Lt)|0,g=g+Math.imul(X,oe)|0,m=m+Math.imul(q,Wt)|0,b=(b=b+Math.imul(q,tt)|0)+Math.imul(K,Wt)|0,g=g+Math.imul(K,tt)|0,m=m+Math.imul(F,ht)|0,b=(b=b+Math.imul(F,xt)|0)+Math.imul(V,ht)|0,g=g+Math.imul(V,xt)|0,m=m+Math.imul(H,St)|0,b=(b=b+Math.imul(H,zt)|0)+Math.imul(M,St)|0,g=g+Math.imul(M,zt)|0;var dt=(I+(m=m+Math.imul($,It)|0)|0)+((8191&(b=(b=b+Math.imul($,Vt)|0)+Math.imul(W,It)|0))<<13)|0;I=((g=g+Math.imul(W,Vt)|0)+(b>>>13)|0)+(dt>>>26)|0,dt&=67108863,m=Math.imul(wt,Et),b=(b=Math.imul(wt,Ht))+Math.imul(Tt,Et)|0,g=Math.imul(Tt,Ht),m=m+Math.imul(vt,Nt)|0,b=(b=b+Math.imul(vt,ie)|0)+Math.imul(Ot,Nt)|0,g=g+Math.imul(Ot,ie)|0,m=m+Math.imul(pt,$t)|0,b=(b=b+Math.imul(pt,he)|0)+Math.imul(Ct,$t)|0,g=g+Math.imul(Ct,he)|0,m=m+Math.imul(it,Ft)|0,b=(b=b+Math.imul(it,te)|0)+Math.imul(ut,Ft)|0,g=g+Math.imul(ut,te)|0,m=m+Math.imul(G,Lt)|0,b=(b=b+Math.imul(G,oe)|0)+Math.imul(nt,Lt)|0,g=g+Math.imul(nt,oe)|0,m=m+Math.imul(et,Wt)|0,b=(b=b+Math.imul(et,tt)|0)+Math.imul(X,Wt)|0,g=g+Math.imul(X,tt)|0,m=m+Math.imul(q,ht)|0,b=(b=b+Math.imul(q,xt)|0)+Math.imul(K,ht)|0,g=g+Math.imul(K,xt)|0,m=m+Math.imul(F,St)|0,b=(b=b+Math.imul(F,zt)|0)+Math.imul(V,St)|0,g=g+Math.imul(V,zt)|0;var bt=(I+(m=m+Math.imul(H,It)|0)|0)+((8191&(b=(b=b+Math.imul(H,Vt)|0)+Math.imul(M,It)|0))<<13)|0;I=((g=g+Math.imul(M,Vt)|0)+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,m=Math.imul(wt,Nt),b=(b=Math.imul(wt,ie))+Math.imul(Tt,Nt)|0,g=Math.imul(Tt,ie),m=m+Math.imul(vt,$t)|0,b=(b=b+Math.imul(vt,he)|0)+Math.imul(Ot,$t)|0,g=g+Math.imul(Ot,he)|0,m=m+Math.imul(pt,Ft)|0,b=(b=b+Math.imul(pt,te)|0)+Math.imul(Ct,Ft)|0,g=g+Math.imul(Ct,te)|0,m=m+Math.imul(it,Lt)|0,b=(b=b+Math.imul(it,oe)|0)+Math.imul(ut,Lt)|0,g=g+Math.imul(ut,oe)|0,m=m+Math.imul(G,Wt)|0,b=(b=b+Math.imul(G,tt)|0)+Math.imul(nt,Wt)|0,g=g+Math.imul(nt,tt)|0,m=m+Math.imul(et,ht)|0,b=(b=b+Math.imul(et,xt)|0)+Math.imul(X,ht)|0,g=g+Math.imul(X,xt)|0,m=m+Math.imul(q,St)|0,b=(b=b+Math.imul(q,zt)|0)+Math.imul(K,St)|0,g=g+Math.imul(K,zt)|0;var jt=(I+(m=m+Math.imul(F,It)|0)|0)+((8191&(b=(b=b+Math.imul(F,Vt)|0)+Math.imul(V,It)|0))<<13)|0;I=((g=g+Math.imul(V,Vt)|0)+(b>>>13)|0)+(jt>>>26)|0,jt&=67108863,m=Math.imul(wt,$t),b=(b=Math.imul(wt,he))+Math.imul(Tt,$t)|0,g=Math.imul(Tt,he),m=m+Math.imul(vt,Ft)|0,b=(b=b+Math.imul(vt,te)|0)+Math.imul(Ot,Ft)|0,g=g+Math.imul(Ot,te)|0,m=m+Math.imul(pt,Lt)|0,b=(b=b+Math.imul(pt,oe)|0)+Math.imul(Ct,Lt)|0,g=g+Math.imul(Ct,oe)|0,m=m+Math.imul(it,Wt)|0,b=(b=b+Math.imul(it,tt)|0)+Math.imul(ut,Wt)|0,g=g+Math.imul(ut,tt)|0,m=m+Math.imul(G,ht)|0,b=(b=b+Math.imul(G,xt)|0)+Math.imul(nt,ht)|0,g=g+Math.imul(nt,xt)|0,m=m+Math.imul(et,St)|0,b=(b=b+Math.imul(et,zt)|0)+Math.imul(X,St)|0,g=g+Math.imul(X,zt)|0;var yt=(I+(m=m+Math.imul(q,It)|0)|0)+((8191&(b=(b=b+Math.imul(q,Vt)|0)+Math.imul(K,It)|0))<<13)|0;I=((g=g+Math.imul(K,Vt)|0)+(b>>>13)|0)+(yt>>>26)|0,yt&=67108863,m=Math.imul(wt,Ft),b=(b=Math.imul(wt,te))+Math.imul(Tt,Ft)|0,g=Math.imul(Tt,te),m=m+Math.imul(vt,Lt)|0,b=(b=b+Math.imul(vt,oe)|0)+Math.imul(Ot,Lt)|0,g=g+Math.imul(Ot,oe)|0,m=m+Math.imul(pt,Wt)|0,b=(b=b+Math.imul(pt,tt)|0)+Math.imul(Ct,Wt)|0,g=g+Math.imul(Ct,tt)|0,m=m+Math.imul(it,ht)|0,b=(b=b+Math.imul(it,xt)|0)+Math.imul(ut,ht)|0,g=g+Math.imul(ut,xt)|0,m=m+Math.imul(G,St)|0,b=(b=b+Math.imul(G,zt)|0)+Math.imul(nt,St)|0,g=g+Math.imul(nt,zt)|0;var _t=(I+(m=m+Math.imul(et,It)|0)|0)+((8191&(b=(b=b+Math.imul(et,Vt)|0)+Math.imul(X,It)|0))<<13)|0;I=((g=g+Math.imul(X,Vt)|0)+(b>>>13)|0)+(_t>>>26)|0,_t&=67108863,m=Math.imul(wt,Lt),b=(b=Math.imul(wt,oe))+Math.imul(Tt,Lt)|0,g=Math.imul(Tt,oe),m=m+Math.imul(vt,Wt)|0,b=(b=b+Math.imul(vt,tt)|0)+Math.imul(Ot,Wt)|0,g=g+Math.imul(Ot,tt)|0,m=m+Math.imul(pt,ht)|0,b=(b=b+Math.imul(pt,xt)|0)+Math.imul(Ct,ht)|0,g=g+Math.imul(Ct,xt)|0,m=m+Math.imul(it,St)|0,b=(b=b+Math.imul(it,zt)|0)+Math.imul(ut,St)|0,g=g+Math.imul(ut,zt)|0;var Jt=(I+(m=m+Math.imul(G,It)|0)|0)+((8191&(b=(b=b+Math.imul(G,Vt)|0)+Math.imul(nt,It)|0))<<13)|0;I=((g=g+Math.imul(nt,Vt)|0)+(b>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,m=Math.imul(wt,Wt),b=(b=Math.imul(wt,tt))+Math.imul(Tt,Wt)|0,g=Math.imul(Tt,tt),m=m+Math.imul(vt,ht)|0,b=(b=b+Math.imul(vt,xt)|0)+Math.imul(Ot,ht)|0,g=g+Math.imul(Ot,xt)|0,m=m+Math.imul(pt,St)|0,b=(b=b+Math.imul(pt,zt)|0)+Math.imul(Ct,St)|0,g=g+Math.imul(Ct,zt)|0;var Xt=(I+(m=m+Math.imul(it,It)|0)|0)+((8191&(b=(b=b+Math.imul(it,Vt)|0)+Math.imul(ut,It)|0))<<13)|0;I=((g=g+Math.imul(ut,Vt)|0)+(b>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,m=Math.imul(wt,ht),b=(b=Math.imul(wt,xt))+Math.imul(Tt,ht)|0,g=Math.imul(Tt,xt),m=m+Math.imul(vt,St)|0,b=(b=b+Math.imul(vt,zt)|0)+Math.imul(Ot,St)|0,g=g+Math.imul(Ot,zt)|0;var qt=(I+(m=m+Math.imul(pt,It)|0)|0)+((8191&(b=(b=b+Math.imul(pt,Vt)|0)+Math.imul(Ct,It)|0))<<13)|0;I=((g=g+Math.imul(Ct,Vt)|0)+(b>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(wt,St),b=(b=Math.imul(wt,zt))+Math.imul(Tt,St)|0,g=Math.imul(Tt,zt);var Bt=(I+(m=m+Math.imul(vt,It)|0)|0)+((8191&(b=(b=b+Math.imul(vt,Vt)|0)+Math.imul(Ot,It)|0))<<13)|0;I=((g=g+Math.imul(Ot,Vt)|0)+(b>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var ae=(I+(m=Math.imul(wt,It))|0)+((8191&(b=(b=Math.imul(wt,Vt))+Math.imul(Tt,It)|0))<<13)|0;return I=((g=Math.imul(Tt,Vt))+(b>>>13)|0)+(ae>>>26)|0,ae&=67108863,R[0]=Ut,R[1]=Kt,R[2]=be,R[3]=fe,R[4]=ve,R[5]=we,R[6]=Se,R[7]=Z,R[8]=at,R[9]=dt,R[10]=bt,R[11]=jt,R[12]=yt,R[13]=_t,R[14]=Jt,R[15]=Xt,R[16]=qt,R[17]=Bt,R[18]=ae,I!==0&&(R[19]=I,v.length++),v};function w(k,E,v){return new x().mulp(k,E,v)}function x(k,E){this.x=k,this.y=E}Math.imul||(f=d),t.prototype.mulTo=function(k,E){var v=this.length+k.length;return this.length===10&&k.length===10?f(this,k,E):v<63?d(this,k,E):v<1024?function(m,b,g){g.negative=b.negative^m.negative,g.length=m.length+b.length;for(var y=0,S=0,R=0;R>>26)|0)>>>26,I&=67108863}g.words[R]=z,y=I,I=S}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,k,E):w(this,k,E)},x.prototype.makeRBT=function(k){for(var E=new Array(k),v=t.prototype._countBits(k)-1,m=0;m>=1;return m},x.prototype.permute=function(k,E,v,m,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,v[2*g+1]=8191&b,b>>>=13;for(g=2*E;g>=26,E+=m/67108864|0,E+=b>>>26,this.words[v]=67108863&b}return E!==0&&(this.words[v]=E,this.length++),this},t.prototype.muln=function(k){return this.clone().imuln(k)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(k){var E=function(g){for(var y=new Array(g.bitLength()),S=0;S>>I}return y}(k);if(E.length===0)return new t(1);for(var v=this,m=0;m=0);var E,v=k%26,m=(k-v)/26,b=67108863>>>26-v<<26-v;if(v!==0){var g=0;for(E=0;E>>26-v}g&&(this.words[E]=g,this.length++)}if(m!==0){for(E=this.length-1;E>=0;E--)this.words[E+m]=this.words[E];for(E=0;E=0),m=E?(E-E%26)/26:0;var b=k%26,g=Math.min((k-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(I!==0||R>=m);R--){var z=0|this.words[R];this.words[R]=I<<26-b|z>>>b,I=z&y}return S&&I!==0&&(S.words[S.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(k,E,v){return o(this.negative===0),this.iushrn(k,E,v)},t.prototype.shln=function(k){return this.clone().ishln(k)},t.prototype.ushln=function(k){return this.clone().iushln(k)},t.prototype.shrn=function(k){return this.clone().ishrn(k)},t.prototype.ushrn=function(k){return this.clone().iushrn(k)},t.prototype.testn=function(k){o(typeof k=="number"&&k>=0);var E=k%26,v=(k-E)/26,m=1<=0);var E=k%26,v=(k-E)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(E!==0&&v++,this.length=Math.min(v,this.length),E!==0){var m=67108863^67108863>>>E<=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},t.prototype.isubn=function(k){if(o(typeof k=="number"),o(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E>26)-(S/67108864|0),this.words[m+v]=67108863&b}for(;m>26,this.words[m+v]=67108863&b;if(y===0)return this.strip();for(o(y===-1),y=0,m=0;m>26,this.words[m]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(k,E){var v=(this.length,k.length),m=this.clone(),b=k,g=0|b.words[b.length-1];(v=26-this._countBits(g))!==0&&(b=b.ushln(v),m.iushln(v),g=0|b.words[b.length-1]);var y,S=m.length-b.length;if(E!=="mod"){(y=new t(null)).length=S+1,y.words=new Array(y.length);for(var R=0;R=0;z--){var $=67108864*(0|m.words[b.length+z])+(0|m.words[b.length+z-1]);for($=Math.min($/g|0,67108863),m._ishlnsubmul(b,$,z);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(b,1,z),m.isZero()||(m.negative^=1);y&&(y.words[z]=$)}return y&&y.strip(),m.strip(),E!=="div"&&v!==0&&m.iushrn(v),{div:y||null,mod:m}},t.prototype.divmod=function(k,E,v){return o(!k.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&k.negative===0?(g=this.neg().divmod(k,E),E!=="mod"&&(m=g.div.neg()),E!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.iadd(k)),{div:m,mod:b}):this.negative===0&&k.negative!==0?(g=this.divmod(k.neg(),E),E!=="mod"&&(m=g.div.neg()),{div:m,mod:g.mod}):this.negative&k.negative?(g=this.neg().divmod(k.neg(),E),E!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.isub(k)),{div:g.div,mod:b}):k.length>this.length||this.cmp(k)<0?{div:new t(0),mod:this}:k.length===1?E==="div"?{div:this.divn(k.words[0]),mod:null}:E==="mod"?{div:null,mod:new t(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new t(this.modn(k.words[0]))}:this._wordDiv(k,E);var m,b,g},t.prototype.div=function(k){return this.divmod(k,"div",!1).div},t.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},t.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},t.prototype.divRound=function(k){var E=this.divmod(k);if(E.mod.isZero())return E.div;var v=E.div.negative!==0?E.mod.isub(k):E.mod,m=k.ushrn(1),b=k.andln(1),g=v.cmp(m);return g<0||b===1&&g===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},t.prototype.modn=function(k){o(k<=67108863);for(var E=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(E*v+(0|this.words[m]))%k;return v},t.prototype.idivn=function(k){o(k<=67108863);for(var E=0,v=this.length-1;v>=0;v--){var m=(0|this.words[v])+67108864*E;this.words[v]=m/k|0,E=m%k}return this.strip()},t.prototype.divn=function(k){return this.clone().idivn(k)},t.prototype.egcd=function(k){o(k.negative===0),o(!k.isZero());var E=this,v=k.clone();E=E.negative!==0?E.umod(k):E.clone();for(var m=new t(1),b=new t(0),g=new t(0),y=new t(1),S=0;E.isEven()&&v.isEven();)E.iushrn(1),v.iushrn(1),++S;for(var R=v.clone(),I=E.clone();!E.isZero();){for(var z=0,$=1;!(E.words[0]&$)&&z<26;++z,$<<=1);if(z>0)for(E.iushrn(z);z-- >0;)(m.isOdd()||b.isOdd())&&(m.iadd(R),b.isub(I)),m.iushrn(1),b.iushrn(1);for(var W=0,j=1;!(v.words[0]&j)&&W<26;++W,j<<=1);if(W>0)for(v.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(I)),g.iushrn(1),y.iushrn(1);E.cmp(v)>=0?(E.isub(v),m.isub(g),b.isub(y)):(v.isub(E),g.isub(m),y.isub(b))}return{a:g,b:y,gcd:v.iushln(S)}},t.prototype._invmp=function(k){o(k.negative===0),o(!k.isZero());var E=this,v=k.clone();E=E.negative!==0?E.umod(k):E.clone();for(var m,b=new t(1),g=new t(0),y=v.clone();E.cmpn(1)>0&&v.cmpn(1)>0;){for(var S=0,R=1;!(E.words[0]&R)&&S<26;++S,R<<=1);if(S>0)for(E.iushrn(S);S-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var I=0,z=1;!(v.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(v.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);E.cmp(v)>=0?(E.isub(v),b.isub(g)):(v.isub(E),g.isub(b))}return(m=E.cmpn(1)===0?b:g).cmpn(0)<0&&m.iadd(k),m},t.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var E=this.clone(),v=k.clone();E.negative=0,v.negative=0;for(var m=0;E.isEven()&&v.isEven();m++)E.iushrn(1),v.iushrn(1);for(;;){for(;E.isEven();)E.iushrn(1);for(;v.isEven();)v.iushrn(1);var b=E.cmp(v);if(b<0){var g=E;E=v,v=g}else if(b===0||v.cmpn(1)===0)break;E.isub(v)}return v.iushln(m)},t.prototype.invm=function(k){return this.egcd(k).a.umod(k)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(k){return this.words[0]&k},t.prototype.bincn=function(k){o(typeof k=="number");var E=k%26,v=(k-E)/26,m=1<>>26,y&=67108863,this.words[g]=y}return b!==0&&(this.words[g]=b,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(k){var E,v=k<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;if(this.strip(),this.length>1)E=1;else{v&&(k=-k),o(k<=67108863,"Number is too big");var m=0|this.words[0];E=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=0|this.words[v],b=0|k.words[v];if(m!==b){mb&&(E=1);break}}return E},t.prototype.gtn=function(k){return this.cmpn(k)===1},t.prototype.gt=function(k){return this.cmp(k)===1},t.prototype.gten=function(k){return this.cmpn(k)>=0},t.prototype.gte=function(k){return this.cmp(k)>=0},t.prototype.ltn=function(k){return this.cmpn(k)===-1},t.prototype.lt=function(k){return this.cmp(k)===-1},t.prototype.lten=function(k){return this.cmpn(k)<=0},t.prototype.lte=function(k){return this.cmp(k)<=0},t.prototype.eqn=function(k){return this.cmpn(k)===0},t.prototype.eq=function(k){return this.cmp(k)===0},t.red=function(k){return new U(k)},t.prototype.toRed=function(k){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},t.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(k){return this.red=k,this},t.prototype.forceRed=function(k){return o(!this.red,"Already a number in reduction context"),this._forceRed(k)},t.prototype.redAdd=function(k){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},t.prototype.redIAdd=function(k){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},t.prototype.redSub=function(k){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},t.prototype.redISub=function(k){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},t.prototype.redShl=function(k){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},t.prototype.redMul=function(k){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},t.prototype.redIMul=function(k){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},t.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(k){return o(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var A={k256:null,p224:null,p192:null,p25519:null};function N(k,E){this.name=k,this.p=new t(E,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function L(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function U(k){if(typeof k=="string"){var E=t._prime(k);this.m=E.p,this.prime=E}else o(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}function B(k){U.call(this,k),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(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)}N.prototype._tmp=function(){var k=new t(null);return k.words=new Array(Math.ceil(this.n/13)),k},N.prototype.ireduce=function(k){var E,v=k;do this.split(v,this.tmp),E=(v=(v=this.imulK(v)).iadd(this.tmp)).bitLength();while(E>this.n);var m=E0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},N.prototype.split=function(k,E){k.iushrn(this.n,0,E)},N.prototype.imulK=function(k){return k.imul(this.k)},r(L,N),L.prototype.split=function(k,E){for(var v=Math.min(k.length,9),m=0;m>>22,b=g}b>>>=22,k.words[m-10]=b,b===0&&k.length>10?k.length-=10:k.length-=9},L.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var E=0,v=0;v>>=26,k.words[v]=b,E=m}return E!==0&&(k.words[k.length++]=E),k},t._prime=function(k){if(A[k])return A[k];var E;if(k==="k256")E=new L;else if(k==="p224")E=new O;else if(k==="p192")E=new P;else{if(k!=="p25519")throw new Error("Unknown prime "+k);E=new D}return A[k]=E,E},U.prototype._verify1=function(k){o(k.negative===0,"red works only with positives"),o(k.red,"red works only with red numbers")},U.prototype._verify2=function(k,E){o((k.negative|E.negative)==0,"red works only with positives"),o(k.red&&k.red===E.red,"red works only with red numbers")},U.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},U.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},U.prototype.add=function(k,E){this._verify2(k,E);var v=k.add(E);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},U.prototype.iadd=function(k,E){this._verify2(k,E);var v=k.iadd(E);return v.cmp(this.m)>=0&&v.isub(this.m),v},U.prototype.sub=function(k,E){this._verify2(k,E);var v=k.sub(E);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},U.prototype.isub=function(k,E){this._verify2(k,E);var v=k.isub(E);return v.cmpn(0)<0&&v.iadd(this.m),v},U.prototype.shl=function(k,E){return this._verify1(k),this.imod(k.ushln(E))},U.prototype.imul=function(k,E){return this._verify2(k,E),this.imod(k.imul(E))},U.prototype.mul=function(k,E){return this._verify2(k,E),this.imod(k.mul(E))},U.prototype.isqr=function(k){return this.imul(k,k.clone())},U.prototype.sqr=function(k){return this.mul(k,k)},U.prototype.sqrt=function(k){if(k.isZero())return k.clone();var E=this.m.andln(3);if(o(E%2==1),E===3){var v=this.m.add(new t(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),b=0;!m.isZero()&&m.andln(1)===0;)b++,m.iushrn(1);o(!m.isZero());var g=new t(1).toRed(this),y=g.redNeg(),S=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new t(2*R*R).toRed(this);this.pow(R,S).cmp(y)!==0;)R.redIAdd(y);for(var I=this.pow(R,m),z=this.pow(k,m.addn(1).iushrn(1)),$=this.pow(k,m),W=b;$.cmp(g)!==0;){for(var j=$,H=0;j.cmp(g)!==0;H++)j=j.redSqr();o(H=0;m--){for(var R=E.words[m],I=S-1;I>=0;I--){var z=R>>I&1;b!==v[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||m===0&&I===0)&&(b=this.mul(b,v[g]),y=0,g=0)):y=0}S=26}return b},U.prototype.convertTo=function(k){var E=k.umod(this.m);return E===k?E.clone():E},U.prototype.convertFrom=function(k){var E=k.clone();return E.red=null,E},t.mont=function(k){return new B(k)},r(B,U),B.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},B.prototype.convertFrom=function(k){var E=this.imod(k.mul(this.rinv));return E.red=null,E},B.prototype.imul=function(k,E){if(k.isZero()||E.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(E),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.mul=function(k,E){if(k.isZero()||E.isZero())return new t(0)._forceRed(this);var v=k.mul(E),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.invm=function(k){return this.imod(k._invmp(this.m).mul(this.r2))._forceRed(this)}})(C===void 0||C)},{buffer:188}],185:[function(s,C,_){_.byteLength=function(n){var c=l(n),h=c[0],u=c[1];return 3*(h+u)/4-u},_.toByteArray=function(n){var c,h,u=l(n),d=u[0],f=u[1],w=new o(function(N,L,O){return 3*(L+O)/4-O}(0,d,f)),x=0,A=f>0?d-4:d;for(h=0;h>16&255,w[x++]=c>>8&255,w[x++]=255&c;return f===2&&(c=a[n.charCodeAt(h)]<<2|a[n.charCodeAt(h+1)]>>4,w[x++]=255&c),f===1&&(c=a[n.charCodeAt(h)]<<10|a[n.charCodeAt(h+1)]<<4|a[n.charCodeAt(h+2)]>>2,w[x++]=c>>8&255,w[x++]=255&c),w},_.fromByteArray=function(n){for(var c,h=n.length,u=h%3,d=[],f=0,w=h-u;fw?w:f+16383));return u===1?(c=n[h-1],d.push(p[c>>2]+p[c<<4&63]+"==")):u===2&&(c=(n[h-2]<<8)+n[h-1],d.push(p[c>>10]+p[c>>4&63]+p[c<<2&63]+"=")),d.join("")};for(var p=[],a=[],o=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var h=n.indexOf("=");return h===-1&&(h=c),[h,h===c?0:4-h%4]}function i(n,c,h){for(var u,d,f=[],w=c;w>18&63]+p[d>>12&63]+p[d>>6&63]+p[63&d]);return f.join("")}a[45]=62,a[95]=63},{}],186:[function(s,C,_){(function(p,a){function o(v,m){if(!v)throw new Error(m||"Assertion failed")}function r(v,m){v.super_=m;var b=function(){};b.prototype=m.prototype,v.prototype=new b,v.prototype.constructor=v}function t(v,m,b){if(t.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&(m!=="le"&&m!=="be"||(b=m,m=10),this._init(v||0,m||10,b||"be"))}var e;typeof p=="object"?p.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{e=typeof window!="undefined"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch(v){}function l(v,m){var b=v.charCodeAt(m);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void o(!1,"Invalid character in "+v)}function i(v,m,b){var g=l(v,b);return b-1>=m&&(g|=l(v,b-1)<<4),g}function n(v,m,b,g){for(var y=0,S=0,R=Math.min(v.length,b),I=m;I=49?z-49+10:z>=17?z-17+10:z,o(z>=0&&S0?v:m},t.min=function(v,m){return v.cmp(m)<0?v:m},t.prototype._init=function(v,m,b){if(typeof v=="number")return this._initNumber(v,m,b);if(typeof v=="object")return this._initArray(v,m,b);m==="hex"&&(m=16),o(m===(0|m)&&m>=2&&m<=36);var g=0;(v=v.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)S=v[g]|v[g-1]<<8|v[g-2]<<16,this.words[y]|=S<>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);else if(b==="le")for(g=0,y=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);return this._strip()},t.prototype._parseHex=function(v,m,b){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var g=0;g=m;g-=2)y=i(v,m,g)<=18?(S-=18,R+=1,this.words[R]|=y>>>26):S+=8;else for(g=(v.length-m)%2==0?m+1:m;g=18?(S-=18,R+=1,this.words[R]|=y>>>26):S+=8;this._strip()},t.prototype._parseBase=function(v,m,b){this.words=[0],this.length=1;for(var g=0,y=1;y<=67108863;y*=m)g++;g--,y=y/m|0;for(var S=v.length-b,R=S%g,I=Math.min(S,S-R)+b,z=0,$=b;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(v){t.prototype.inspect=h}else t.prototype.inspect=h;function h(){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"],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];t.prototype.toString=function(v,m){var b;if(m=0|m||1,(v=v||10)===16||v==="hex"){b="";for(var g=0,y=0,S=0;S>>24-g&16777215,(g+=2)>=26&&(g-=26,S--),b=y!==0||S!==this.length-1?u[6-I.length]+I+b:I+b}for(y!==0&&(b=y.toString(16)+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(v===(0|v)&&v>=2&&v<=36){var z=d[v],$=f[v];b="";var W=this.clone();for(W.negative=0;!W.isZero();){var j=W.modrn($).toString(v);b=(W=W.idivn($)).isZero()?j+b:u[z-j.length]+j+b}for(this.isZero()&&(b="0"+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}o(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=67108864*this.words[1]:this.length===3&&this.words[2]===1?v+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(v,m){return this.toArrayLike(e,v,m)}),t.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};function w(v,m,b){b.negative=m.negative^v.negative;var g=v.length+m.length|0;b.length=g,g=g-1|0;var y=0|v.words[0],S=0|m.words[0],R=y*S,I=67108863&R,z=R/67108864|0;b.words[0]=I;for(var $=1;$>>26,j=67108863&z,H=Math.min($,m.length-1),M=Math.max(0,$-v.length+1);M<=H;M++){var T=$-M|0;W+=(R=(y=0|v.words[T])*(S=0|m.words[M])+j)/67108864|0,j=67108863&R}b.words[$]=0|j,z=0|W}return z!==0?b.words[$]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(v,m,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);o(g<=y,"byte array longer than desired length"),o(y>0,"Requested array length <= 0");var S=function(R,I){return R.allocUnsafe?R.allocUnsafe(I):new R(I)}(v,y);return this["_toArrayLike"+(m==="le"?"LE":"BE")](S,g),S},t.prototype._toArrayLikeLE=function(v,m){for(var b=0,g=0,y=0,S=0;y>8&255),b>16&255),S===6?(b>24&255),g=0,S=0):(g=R>>>24,S+=2)}if(b=0&&(v[b--]=R>>8&255),b>=0&&(v[b--]=R>>16&255),S===6?(b>=0&&(v[b--]=R>>24&255),g=0,S=0):(g=R>>>24,S+=2)}if(b>=0)for(v[b--]=g;b>=0;)v[b--]=0},Math.clz32?t.prototype._countBits=function(v){return 32-Math.clz32(v)}:t.prototype._countBits=function(v){var m=v,b=0;return m>=4096&&(b+=13,m>>>=13),m>=64&&(b+=7,m>>>=7),m>=8&&(b+=4,m>>>=4),m>=2&&(b+=2,m>>>=2),b+m},t.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,b=0;return!(8191&m)&&(b+=13,m>>>=13),!(127&m)&&(b+=7,m>>>=7),!(15&m)&&(b+=4,m>>>=4),!(3&m)&&(b+=2,m>>>=2),!(1&m)&&b++,b},t.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return 26*(this.length-1)+m},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},t.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},t.prototype.iuand=function(v){var m;m=this.length>v.length?v:this;for(var b=0;bv.length?this.clone().iand(v):v.clone().iand(this)},t.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},t.prototype.iuxor=function(v){var m,b;this.length>v.length?(m=this,b=v):(m=v,b=this);for(var g=0;gv.length?this.clone().ixor(v):v.clone().ixor(this)},t.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},t.prototype.inotn=function(v){o(typeof v=="number"&&v>=0);var m=0|Math.ceil(v/26),b=v%26;this._expand(m),b>0&&m--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-b),this._strip()},t.prototype.notn=function(v){return this.clone().inotn(v)},t.prototype.setn=function(v,m){o(typeof v=="number"&&v>=0);var b=v/26|0,g=v%26;return this._expand(b+1),this.words[b]=m?this.words[b]|1<v.length?(b=this,g=v):(b=v,g=this);for(var y=0,S=0;S>>26;for(;y!==0&&S>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;Sv.length?this.clone().iadd(v):v.clone().iadd(this)},t.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var b,g,y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=v):(b=v,g=this);for(var S=0,R=0;R>26,this.words[R]=67108863&m;for(;S!==0&&R>26,this.words[R]=67108863&m;if(S===0&&R>>13,M=0|R[1],T=8191&M,F=M>>>13,V=0|R[2],Y=8191&V,q=V>>>13,K=0|R[3],Q=8191&K,et=K>>>13,X=0|R[4],J=8191&X,G=X>>>13,nt=0|R[5],rt=8191&nt,it=nt>>>13,ut=0|R[6],ct=8191&ut,pt=ut>>>13,Ct=0|R[7],kt=8191&Ct,vt=Ct>>>13,Ot=0|R[8],Rt=8191&Ot,wt=Ot>>>13,Tt=0|R[9],mt=8191&Tt,ft=Tt>>>13,gt=0|I[0],Mt=8191>,Et=gt>>>13,Ht=0|I[1],Zt=8191&Ht,Nt=Ht>>>13,ie=0|I[2],Gt=8191&ie,$t=ie>>>13,he=0|I[3],se=8191&he,Ft=he>>>13,te=0|I[4],ue=8191&te,Lt=te>>>13,oe=0|I[5],ce=8191&oe,Wt=oe>>>13,tt=0|I[6],st=8191&tt,ht=tt>>>13,xt=0|I[7],Pt=8191&xt,St=xt>>>13,zt=0|I[8],Dt=8191&zt,It=zt>>>13,Vt=0|I[9],Ut=8191&Vt,Kt=Vt>>>13;b.negative=v.negative^m.negative,b.length=19;var be=($+(g=Math.imul(j,Mt))|0)+((8191&(y=(y=Math.imul(j,Et))+Math.imul(H,Mt)|0))<<13)|0;$=((S=Math.imul(H,Et))+(y>>>13)|0)+(be>>>26)|0,be&=67108863,g=Math.imul(T,Mt),y=(y=Math.imul(T,Et))+Math.imul(F,Mt)|0,S=Math.imul(F,Et);var fe=($+(g=g+Math.imul(j,Zt)|0)|0)+((8191&(y=(y=y+Math.imul(j,Nt)|0)+Math.imul(H,Zt)|0))<<13)|0;$=((S=S+Math.imul(H,Nt)|0)+(y>>>13)|0)+(fe>>>26)|0,fe&=67108863,g=Math.imul(Y,Mt),y=(y=Math.imul(Y,Et))+Math.imul(q,Mt)|0,S=Math.imul(q,Et),g=g+Math.imul(T,Zt)|0,y=(y=y+Math.imul(T,Nt)|0)+Math.imul(F,Zt)|0,S=S+Math.imul(F,Nt)|0;var ve=($+(g=g+Math.imul(j,Gt)|0)|0)+((8191&(y=(y=y+Math.imul(j,$t)|0)+Math.imul(H,Gt)|0))<<13)|0;$=((S=S+Math.imul(H,$t)|0)+(y>>>13)|0)+(ve>>>26)|0,ve&=67108863,g=Math.imul(Q,Mt),y=(y=Math.imul(Q,Et))+Math.imul(et,Mt)|0,S=Math.imul(et,Et),g=g+Math.imul(Y,Zt)|0,y=(y=y+Math.imul(Y,Nt)|0)+Math.imul(q,Zt)|0,S=S+Math.imul(q,Nt)|0,g=g+Math.imul(T,Gt)|0,y=(y=y+Math.imul(T,$t)|0)+Math.imul(F,Gt)|0,S=S+Math.imul(F,$t)|0;var we=($+(g=g+Math.imul(j,se)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ft)|0)+Math.imul(H,se)|0))<<13)|0;$=((S=S+Math.imul(H,Ft)|0)+(y>>>13)|0)+(we>>>26)|0,we&=67108863,g=Math.imul(J,Mt),y=(y=Math.imul(J,Et))+Math.imul(G,Mt)|0,S=Math.imul(G,Et),g=g+Math.imul(Q,Zt)|0,y=(y=y+Math.imul(Q,Nt)|0)+Math.imul(et,Zt)|0,S=S+Math.imul(et,Nt)|0,g=g+Math.imul(Y,Gt)|0,y=(y=y+Math.imul(Y,$t)|0)+Math.imul(q,Gt)|0,S=S+Math.imul(q,$t)|0,g=g+Math.imul(T,se)|0,y=(y=y+Math.imul(T,Ft)|0)+Math.imul(F,se)|0,S=S+Math.imul(F,Ft)|0;var Se=($+(g=g+Math.imul(j,ue)|0)|0)+((8191&(y=(y=y+Math.imul(j,Lt)|0)+Math.imul(H,ue)|0))<<13)|0;$=((S=S+Math.imul(H,Lt)|0)+(y>>>13)|0)+(Se>>>26)|0,Se&=67108863,g=Math.imul(rt,Mt),y=(y=Math.imul(rt,Et))+Math.imul(it,Mt)|0,S=Math.imul(it,Et),g=g+Math.imul(J,Zt)|0,y=(y=y+Math.imul(J,Nt)|0)+Math.imul(G,Zt)|0,S=S+Math.imul(G,Nt)|0,g=g+Math.imul(Q,Gt)|0,y=(y=y+Math.imul(Q,$t)|0)+Math.imul(et,Gt)|0,S=S+Math.imul(et,$t)|0,g=g+Math.imul(Y,se)|0,y=(y=y+Math.imul(Y,Ft)|0)+Math.imul(q,se)|0,S=S+Math.imul(q,Ft)|0,g=g+Math.imul(T,ue)|0,y=(y=y+Math.imul(T,Lt)|0)+Math.imul(F,ue)|0,S=S+Math.imul(F,Lt)|0;var Z=($+(g=g+Math.imul(j,ce)|0)|0)+((8191&(y=(y=y+Math.imul(j,Wt)|0)+Math.imul(H,ce)|0))<<13)|0;$=((S=S+Math.imul(H,Wt)|0)+(y>>>13)|0)+(Z>>>26)|0,Z&=67108863,g=Math.imul(ct,Mt),y=(y=Math.imul(ct,Et))+Math.imul(pt,Mt)|0,S=Math.imul(pt,Et),g=g+Math.imul(rt,Zt)|0,y=(y=y+Math.imul(rt,Nt)|0)+Math.imul(it,Zt)|0,S=S+Math.imul(it,Nt)|0,g=g+Math.imul(J,Gt)|0,y=(y=y+Math.imul(J,$t)|0)+Math.imul(G,Gt)|0,S=S+Math.imul(G,$t)|0,g=g+Math.imul(Q,se)|0,y=(y=y+Math.imul(Q,Ft)|0)+Math.imul(et,se)|0,S=S+Math.imul(et,Ft)|0,g=g+Math.imul(Y,ue)|0,y=(y=y+Math.imul(Y,Lt)|0)+Math.imul(q,ue)|0,S=S+Math.imul(q,Lt)|0,g=g+Math.imul(T,ce)|0,y=(y=y+Math.imul(T,Wt)|0)+Math.imul(F,ce)|0,S=S+Math.imul(F,Wt)|0;var at=($+(g=g+Math.imul(j,st)|0)|0)+((8191&(y=(y=y+Math.imul(j,ht)|0)+Math.imul(H,st)|0))<<13)|0;$=((S=S+Math.imul(H,ht)|0)+(y>>>13)|0)+(at>>>26)|0,at&=67108863,g=Math.imul(kt,Mt),y=(y=Math.imul(kt,Et))+Math.imul(vt,Mt)|0,S=Math.imul(vt,Et),g=g+Math.imul(ct,Zt)|0,y=(y=y+Math.imul(ct,Nt)|0)+Math.imul(pt,Zt)|0,S=S+Math.imul(pt,Nt)|0,g=g+Math.imul(rt,Gt)|0,y=(y=y+Math.imul(rt,$t)|0)+Math.imul(it,Gt)|0,S=S+Math.imul(it,$t)|0,g=g+Math.imul(J,se)|0,y=(y=y+Math.imul(J,Ft)|0)+Math.imul(G,se)|0,S=S+Math.imul(G,Ft)|0,g=g+Math.imul(Q,ue)|0,y=(y=y+Math.imul(Q,Lt)|0)+Math.imul(et,ue)|0,S=S+Math.imul(et,Lt)|0,g=g+Math.imul(Y,ce)|0,y=(y=y+Math.imul(Y,Wt)|0)+Math.imul(q,ce)|0,S=S+Math.imul(q,Wt)|0,g=g+Math.imul(T,st)|0,y=(y=y+Math.imul(T,ht)|0)+Math.imul(F,st)|0,S=S+Math.imul(F,ht)|0;var dt=($+(g=g+Math.imul(j,Pt)|0)|0)+((8191&(y=(y=y+Math.imul(j,St)|0)+Math.imul(H,Pt)|0))<<13)|0;$=((S=S+Math.imul(H,St)|0)+(y>>>13)|0)+(dt>>>26)|0,dt&=67108863,g=Math.imul(Rt,Mt),y=(y=Math.imul(Rt,Et))+Math.imul(wt,Mt)|0,S=Math.imul(wt,Et),g=g+Math.imul(kt,Zt)|0,y=(y=y+Math.imul(kt,Nt)|0)+Math.imul(vt,Zt)|0,S=S+Math.imul(vt,Nt)|0,g=g+Math.imul(ct,Gt)|0,y=(y=y+Math.imul(ct,$t)|0)+Math.imul(pt,Gt)|0,S=S+Math.imul(pt,$t)|0,g=g+Math.imul(rt,se)|0,y=(y=y+Math.imul(rt,Ft)|0)+Math.imul(it,se)|0,S=S+Math.imul(it,Ft)|0,g=g+Math.imul(J,ue)|0,y=(y=y+Math.imul(J,Lt)|0)+Math.imul(G,ue)|0,S=S+Math.imul(G,Lt)|0,g=g+Math.imul(Q,ce)|0,y=(y=y+Math.imul(Q,Wt)|0)+Math.imul(et,ce)|0,S=S+Math.imul(et,Wt)|0,g=g+Math.imul(Y,st)|0,y=(y=y+Math.imul(Y,ht)|0)+Math.imul(q,st)|0,S=S+Math.imul(q,ht)|0,g=g+Math.imul(T,Pt)|0,y=(y=y+Math.imul(T,St)|0)+Math.imul(F,Pt)|0,S=S+Math.imul(F,St)|0;var bt=($+(g=g+Math.imul(j,Dt)|0)|0)+((8191&(y=(y=y+Math.imul(j,It)|0)+Math.imul(H,Dt)|0))<<13)|0;$=((S=S+Math.imul(H,It)|0)+(y>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(mt,Mt),y=(y=Math.imul(mt,Et))+Math.imul(ft,Mt)|0,S=Math.imul(ft,Et),g=g+Math.imul(Rt,Zt)|0,y=(y=y+Math.imul(Rt,Nt)|0)+Math.imul(wt,Zt)|0,S=S+Math.imul(wt,Nt)|0,g=g+Math.imul(kt,Gt)|0,y=(y=y+Math.imul(kt,$t)|0)+Math.imul(vt,Gt)|0,S=S+Math.imul(vt,$t)|0,g=g+Math.imul(ct,se)|0,y=(y=y+Math.imul(ct,Ft)|0)+Math.imul(pt,se)|0,S=S+Math.imul(pt,Ft)|0,g=g+Math.imul(rt,ue)|0,y=(y=y+Math.imul(rt,Lt)|0)+Math.imul(it,ue)|0,S=S+Math.imul(it,Lt)|0,g=g+Math.imul(J,ce)|0,y=(y=y+Math.imul(J,Wt)|0)+Math.imul(G,ce)|0,S=S+Math.imul(G,Wt)|0,g=g+Math.imul(Q,st)|0,y=(y=y+Math.imul(Q,ht)|0)+Math.imul(et,st)|0,S=S+Math.imul(et,ht)|0,g=g+Math.imul(Y,Pt)|0,y=(y=y+Math.imul(Y,St)|0)+Math.imul(q,Pt)|0,S=S+Math.imul(q,St)|0,g=g+Math.imul(T,Dt)|0,y=(y=y+Math.imul(T,It)|0)+Math.imul(F,Dt)|0,S=S+Math.imul(F,It)|0;var jt=($+(g=g+Math.imul(j,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(j,Kt)|0)+Math.imul(H,Ut)|0))<<13)|0;$=((S=S+Math.imul(H,Kt)|0)+(y>>>13)|0)+(jt>>>26)|0,jt&=67108863,g=Math.imul(mt,Zt),y=(y=Math.imul(mt,Nt))+Math.imul(ft,Zt)|0,S=Math.imul(ft,Nt),g=g+Math.imul(Rt,Gt)|0,y=(y=y+Math.imul(Rt,$t)|0)+Math.imul(wt,Gt)|0,S=S+Math.imul(wt,$t)|0,g=g+Math.imul(kt,se)|0,y=(y=y+Math.imul(kt,Ft)|0)+Math.imul(vt,se)|0,S=S+Math.imul(vt,Ft)|0,g=g+Math.imul(ct,ue)|0,y=(y=y+Math.imul(ct,Lt)|0)+Math.imul(pt,ue)|0,S=S+Math.imul(pt,Lt)|0,g=g+Math.imul(rt,ce)|0,y=(y=y+Math.imul(rt,Wt)|0)+Math.imul(it,ce)|0,S=S+Math.imul(it,Wt)|0,g=g+Math.imul(J,st)|0,y=(y=y+Math.imul(J,ht)|0)+Math.imul(G,st)|0,S=S+Math.imul(G,ht)|0,g=g+Math.imul(Q,Pt)|0,y=(y=y+Math.imul(Q,St)|0)+Math.imul(et,Pt)|0,S=S+Math.imul(et,St)|0,g=g+Math.imul(Y,Dt)|0,y=(y=y+Math.imul(Y,It)|0)+Math.imul(q,Dt)|0,S=S+Math.imul(q,It)|0;var yt=($+(g=g+Math.imul(T,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(T,Kt)|0)+Math.imul(F,Ut)|0))<<13)|0;$=((S=S+Math.imul(F,Kt)|0)+(y>>>13)|0)+(yt>>>26)|0,yt&=67108863,g=Math.imul(mt,Gt),y=(y=Math.imul(mt,$t))+Math.imul(ft,Gt)|0,S=Math.imul(ft,$t),g=g+Math.imul(Rt,se)|0,y=(y=y+Math.imul(Rt,Ft)|0)+Math.imul(wt,se)|0,S=S+Math.imul(wt,Ft)|0,g=g+Math.imul(kt,ue)|0,y=(y=y+Math.imul(kt,Lt)|0)+Math.imul(vt,ue)|0,S=S+Math.imul(vt,Lt)|0,g=g+Math.imul(ct,ce)|0,y=(y=y+Math.imul(ct,Wt)|0)+Math.imul(pt,ce)|0,S=S+Math.imul(pt,Wt)|0,g=g+Math.imul(rt,st)|0,y=(y=y+Math.imul(rt,ht)|0)+Math.imul(it,st)|0,S=S+Math.imul(it,ht)|0,g=g+Math.imul(J,Pt)|0,y=(y=y+Math.imul(J,St)|0)+Math.imul(G,Pt)|0,S=S+Math.imul(G,St)|0,g=g+Math.imul(Q,Dt)|0,y=(y=y+Math.imul(Q,It)|0)+Math.imul(et,Dt)|0,S=S+Math.imul(et,It)|0;var _t=($+(g=g+Math.imul(Y,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(Y,Kt)|0)+Math.imul(q,Ut)|0))<<13)|0;$=((S=S+Math.imul(q,Kt)|0)+(y>>>13)|0)+(_t>>>26)|0,_t&=67108863,g=Math.imul(mt,se),y=(y=Math.imul(mt,Ft))+Math.imul(ft,se)|0,S=Math.imul(ft,Ft),g=g+Math.imul(Rt,ue)|0,y=(y=y+Math.imul(Rt,Lt)|0)+Math.imul(wt,ue)|0,S=S+Math.imul(wt,Lt)|0,g=g+Math.imul(kt,ce)|0,y=(y=y+Math.imul(kt,Wt)|0)+Math.imul(vt,ce)|0,S=S+Math.imul(vt,Wt)|0,g=g+Math.imul(ct,st)|0,y=(y=y+Math.imul(ct,ht)|0)+Math.imul(pt,st)|0,S=S+Math.imul(pt,ht)|0,g=g+Math.imul(rt,Pt)|0,y=(y=y+Math.imul(rt,St)|0)+Math.imul(it,Pt)|0,S=S+Math.imul(it,St)|0,g=g+Math.imul(J,Dt)|0,y=(y=y+Math.imul(J,It)|0)+Math.imul(G,Dt)|0,S=S+Math.imul(G,It)|0;var Jt=($+(g=g+Math.imul(Q,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(Q,Kt)|0)+Math.imul(et,Ut)|0))<<13)|0;$=((S=S+Math.imul(et,Kt)|0)+(y>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,g=Math.imul(mt,ue),y=(y=Math.imul(mt,Lt))+Math.imul(ft,ue)|0,S=Math.imul(ft,Lt),g=g+Math.imul(Rt,ce)|0,y=(y=y+Math.imul(Rt,Wt)|0)+Math.imul(wt,ce)|0,S=S+Math.imul(wt,Wt)|0,g=g+Math.imul(kt,st)|0,y=(y=y+Math.imul(kt,ht)|0)+Math.imul(vt,st)|0,S=S+Math.imul(vt,ht)|0,g=g+Math.imul(ct,Pt)|0,y=(y=y+Math.imul(ct,St)|0)+Math.imul(pt,Pt)|0,S=S+Math.imul(pt,St)|0,g=g+Math.imul(rt,Dt)|0,y=(y=y+Math.imul(rt,It)|0)+Math.imul(it,Dt)|0,S=S+Math.imul(it,It)|0;var Xt=($+(g=g+Math.imul(J,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(J,Kt)|0)+Math.imul(G,Ut)|0))<<13)|0;$=((S=S+Math.imul(G,Kt)|0)+(y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,g=Math.imul(mt,ce),y=(y=Math.imul(mt,Wt))+Math.imul(ft,ce)|0,S=Math.imul(ft,Wt),g=g+Math.imul(Rt,st)|0,y=(y=y+Math.imul(Rt,ht)|0)+Math.imul(wt,st)|0,S=S+Math.imul(wt,ht)|0,g=g+Math.imul(kt,Pt)|0,y=(y=y+Math.imul(kt,St)|0)+Math.imul(vt,Pt)|0,S=S+Math.imul(vt,St)|0,g=g+Math.imul(ct,Dt)|0,y=(y=y+Math.imul(ct,It)|0)+Math.imul(pt,Dt)|0,S=S+Math.imul(pt,It)|0;var qt=($+(g=g+Math.imul(rt,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(rt,Kt)|0)+Math.imul(it,Ut)|0))<<13)|0;$=((S=S+Math.imul(it,Kt)|0)+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,g=Math.imul(mt,st),y=(y=Math.imul(mt,ht))+Math.imul(ft,st)|0,S=Math.imul(ft,ht),g=g+Math.imul(Rt,Pt)|0,y=(y=y+Math.imul(Rt,St)|0)+Math.imul(wt,Pt)|0,S=S+Math.imul(wt,St)|0,g=g+Math.imul(kt,Dt)|0,y=(y=y+Math.imul(kt,It)|0)+Math.imul(vt,Dt)|0,S=S+Math.imul(vt,It)|0;var Bt=($+(g=g+Math.imul(ct,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(ct,Kt)|0)+Math.imul(pt,Ut)|0))<<13)|0;$=((S=S+Math.imul(pt,Kt)|0)+(y>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(mt,Pt),y=(y=Math.imul(mt,St))+Math.imul(ft,Pt)|0,S=Math.imul(ft,St),g=g+Math.imul(Rt,Dt)|0,y=(y=y+Math.imul(Rt,It)|0)+Math.imul(wt,Dt)|0,S=S+Math.imul(wt,It)|0;var ae=($+(g=g+Math.imul(kt,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(kt,Kt)|0)+Math.imul(vt,Ut)|0))<<13)|0;$=((S=S+Math.imul(vt,Kt)|0)+(y>>>13)|0)+(ae>>>26)|0,ae&=67108863,g=Math.imul(mt,Dt),y=(y=Math.imul(mt,It))+Math.imul(ft,Dt)|0,S=Math.imul(ft,It);var pe=($+(g=g+Math.imul(Rt,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(Rt,Kt)|0)+Math.imul(wt,Ut)|0))<<13)|0;$=((S=S+Math.imul(wt,Kt)|0)+(y>>>13)|0)+(pe>>>26)|0,pe&=67108863;var ee=($+(g=Math.imul(mt,Ut))|0)+((8191&(y=(y=Math.imul(mt,Kt))+Math.imul(ft,Ut)|0))<<13)|0;return $=((S=Math.imul(ft,Kt))+(y>>>13)|0)+(ee>>>26)|0,ee&=67108863,z[0]=be,z[1]=fe,z[2]=ve,z[3]=we,z[4]=Se,z[5]=Z,z[6]=at,z[7]=dt,z[8]=bt,z[9]=jt,z[10]=yt,z[11]=_t,z[12]=Jt,z[13]=Xt,z[14]=qt,z[15]=Bt,z[16]=ae,z[17]=pe,z[18]=ee,$!==0&&(z[19]=$,b.length++),b};function A(v,m,b){b.negative=m.negative^v.negative,b.length=v.length+m.length;for(var g=0,y=0,S=0;S>>26)|0)>>>26,R&=67108863}b.words[S]=I,g=R,R=y}return g!==0?b.words[S]=g:b.length--,b._strip()}function N(v,m,b){return A(v,m,b)}Math.imul||(x=w),t.prototype.mulTo=function(v,m){var b=this.length+v.length;return this.length===10&&v.length===10?x(this,v,m):b<63?w(this,v,m):b<1024?A(this,v,m):N(this,v,m)},t.prototype.mul=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},t.prototype.mulf=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),N(this,v,m)},t.prototype.imul=function(v){return this.clone().mulTo(v,this)},t.prototype.imuln=function(v){var m=v<0;m&&(v=-v),o(typeof v=="number"),o(v<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=S>>>26,this.words[g]=67108863&S}return b!==0&&(this.words[g]=b,this.length++),m?this.ineg():this},t.prototype.muln=function(v){return this.clone().imuln(v)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(v){var m=function(S){for(var R=new Array(S.bitLength()),I=0;I>>$&1}return R}(v);if(m.length===0)return new t(1);for(var b=this,g=0;g=0);var m,b=v%26,g=(v-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var S=0;for(m=0;m>>26-b}S&&(this.words[m]=S,this.length++)}if(g!==0){for(m=this.length-1;m>=0;m--)this.words[m+g]=this.words[m];for(m=0;m=0),g=m?(m-m%26)/26:0;var y=v%26,S=Math.min((v-y)/26,this.length),R=67108863^67108863>>>y<S)for(this.length-=S,z=0;z=0&&($!==0||z>=g);z--){var W=0|this.words[z];this.words[z]=$<<26-y|W>>>y,$=W&R}return I&&$!==0&&(I.words[I.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(v,m,b){return o(this.negative===0),this.iushrn(v,m,b)},t.prototype.shln=function(v){return this.clone().ishln(v)},t.prototype.ushln=function(v){return this.clone().iushln(v)},t.prototype.shrn=function(v){return this.clone().ishrn(v)},t.prototype.ushrn=function(v){return this.clone().iushrn(v)},t.prototype.testn=function(v){o(typeof v=="number"&&v>=0);var m=v%26,b=(v-m)/26,g=1<=0);var m=v%26,b=(v-m)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(m!==0&&b++,this.length=Math.min(b,this.length),m!==0){var g=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},t.prototype.isubn=function(v){if(o(typeof v=="number"),o(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(I/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(o(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(v,m){var b=(this.length,v.length),g=this.clone(),y=v,S=0|y.words[y.length-1];(b=26-this._countBits(S))!==0&&(y=y.ushln(b),g.iushln(b),S=0|y.words[y.length-1]);var R,I=g.length-y.length;if(m!=="mod"){(R=new t(null)).length=I+1,R.words=new Array(R.length);for(var z=0;z=0;W--){var j=67108864*(0|g.words[y.length+W])+(0|g.words[y.length+W-1]);for(j=Math.min(j/S|0,67108863),g._ishlnsubmul(y,j,W);g.negative!==0;)j--,g.negative=0,g._ishlnsubmul(y,1,W),g.isZero()||(g.negative^=1);R&&(R.words[W]=j)}return R&&R._strip(),g._strip(),m!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(v,m,b){return o(!v.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&v.negative===0?(S=this.neg().divmod(v,m),m!=="mod"&&(g=S.div.neg()),m!=="div"&&(y=S.mod.neg(),b&&y.negative!==0&&y.iadd(v)),{div:g,mod:y}):this.negative===0&&v.negative!==0?(S=this.divmod(v.neg(),m),m!=="mod"&&(g=S.div.neg()),{div:g,mod:S.mod}):this.negative&v.negative?(S=this.neg().divmod(v.neg(),m),m!=="div"&&(y=S.mod.neg(),b&&y.negative!==0&&y.isub(v)),{div:S.div,mod:y}):v.length>this.length||this.cmp(v)<0?{div:new t(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new t(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new t(this.modrn(v.words[0]))}:this._wordDiv(v,m);var g,y,S},t.prototype.div=function(v){return this.divmod(v,"div",!1).div},t.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},t.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},t.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var b=m.div.negative!==0?m.mod.isub(v):m.mod,g=v.ushrn(1),y=v.andln(1),S=b.cmp(g);return S<0||y===1&&S===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},t.prototype.modrn=function(v){var m=v<0;m&&(v=-v),o(v<=67108863);for(var b=(1<<26)%v,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%v;return m?-g:g},t.prototype.modn=function(v){return this.modrn(v)},t.prototype.idivn=function(v){var m=v<0;m&&(v=-v),o(v<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/v|0,b=y%v}return this._strip(),m?this.ineg():this},t.prototype.divn=function(v){return this.clone().idivn(v)},t.prototype.egcd=function(v){o(v.negative===0),o(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g=new t(1),y=new t(0),S=new t(0),R=new t(1),I=0;m.isEven()&&b.isEven();)m.iushrn(1),b.iushrn(1),++I;for(var z=b.clone(),$=m.clone();!m.isZero();){for(var W=0,j=1;!(m.words[0]&j)&&W<26;++W,j<<=1);if(W>0)for(m.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub($)),g.iushrn(1),y.iushrn(1);for(var H=0,M=1;!(b.words[0]&M)&&H<26;++H,M<<=1);if(H>0)for(b.iushrn(H);H-- >0;)(S.isOdd()||R.isOdd())&&(S.iadd(z),R.isub($)),S.iushrn(1),R.iushrn(1);m.cmp(b)>=0?(m.isub(b),g.isub(S),y.isub(R)):(b.isub(m),S.isub(g),R.isub(y))}return{a:S,b:R,gcd:b.iushln(I)}},t.prototype._invmp=function(v){o(v.negative===0),o(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g,y=new t(1),S=new t(0),R=b.clone();m.cmpn(1)>0&&b.cmpn(1)>0;){for(var I=0,z=1;!(m.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(m.iushrn(I);I-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var $=0,W=1;!(b.words[0]&W)&&$<26;++$,W<<=1);if($>0)for(b.iushrn($);$-- >0;)S.isOdd()&&S.iadd(R),S.iushrn(1);m.cmp(b)>=0?(m.isub(b),y.isub(S)):(b.isub(m),S.isub(y))}return(g=m.cmpn(1)===0?y:S).cmpn(0)<0&&g.iadd(v),g},t.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),b=v.clone();m.negative=0,b.negative=0;for(var g=0;m.isEven()&&b.isEven();g++)m.iushrn(1),b.iushrn(1);for(;;){for(;m.isEven();)m.iushrn(1);for(;b.isEven();)b.iushrn(1);var y=m.cmp(b);if(y<0){var S=m;m=b,b=S}else if(y===0||b.cmpn(1)===0)break;m.isub(b)}return b.iushln(g)},t.prototype.invm=function(v){return this.egcd(v).a.umod(v)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(v){return this.words[0]&v},t.prototype.bincn=function(v){o(typeof v=="number");var m=v%26,b=(v-m)/26,g=1<>>26,R&=67108863,this.words[S]=R}return y!==0&&(this.words[S]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(v){var m,b=v<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;if(this._strip(),this.length>1)m=1;else{b&&(v=-v),o(v<=67108863,"Number is too big");var g=0|this.words[0];m=g===v?0:gv.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|v.words[b];if(g!==y){gy&&(m=1);break}}return m},t.prototype.gtn=function(v){return this.cmpn(v)===1},t.prototype.gt=function(v){return this.cmp(v)===1},t.prototype.gten=function(v){return this.cmpn(v)>=0},t.prototype.gte=function(v){return this.cmp(v)>=0},t.prototype.ltn=function(v){return this.cmpn(v)===-1},t.prototype.lt=function(v){return this.cmp(v)===-1},t.prototype.lten=function(v){return this.cmpn(v)<=0},t.prototype.lte=function(v){return this.cmp(v)<=0},t.prototype.eqn=function(v){return this.cmpn(v)===0},t.prototype.eq=function(v){return this.cmp(v)===0},t.red=function(v){return new k(v)},t.prototype.toRed=function(v){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},t.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(v){return this.red=v,this},t.prototype.forceRed=function(v){return o(!this.red,"Already a number in reduction context"),this._forceRed(v)},t.prototype.redAdd=function(v){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},t.prototype.redIAdd=function(v){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},t.prototype.redSub=function(v){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},t.prototype.redISub=function(v){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},t.prototype.redShl=function(v){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},t.prototype.redMul=function(v){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},t.prototype.redIMul=function(v){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},t.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(v){return o(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var L={k256:null,p224:null,p192:null,p25519:null};function O(v,m){this.name=v,this.p=new t(m,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function P(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function D(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function U(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(v){if(typeof v=="string"){var m=t._prime(v);this.m=m.p,this.prime=m}else o(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}function E(v){k.call(this,v),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(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)}O.prototype._tmp=function(){var v=new t(null);return v.words=new Array(Math.ceil(this.n/13)),v},O.prototype.ireduce=function(v){var m,b=v;do this.split(b,this.tmp),m=(b=(b=this.imulK(b)).iadd(this.tmp)).bitLength();while(m>this.n);var g=m0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},O.prototype.split=function(v,m){v.iushrn(this.n,0,m)},O.prototype.imulK=function(v){return v.imul(this.k)},r(P,O),P.prototype.split=function(v,m){for(var b=Math.min(v.length,9),g=0;g>>22,y=S}y>>>=22,v.words[g-10]=y,y===0&&v.length>10?v.length-=10:v.length-=9},P.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,b=0;b>>=26,v.words[b]=y,m=g}return m!==0&&(v.words[v.length++]=m),v},t._prime=function(v){if(L[v])return L[v];var m;if(v==="k256")m=new P;else if(v==="p224")m=new D;else if(v==="p192")m=new U;else{if(v!=="p25519")throw new Error("Unknown prime "+v);m=new B}return L[v]=m,m},k.prototype._verify1=function(v){o(v.negative===0,"red works only with positives"),o(v.red,"red works only with red numbers")},k.prototype._verify2=function(v,m){o((v.negative|m.negative)==0,"red works only with positives"),o(v.red&&v.red===m.red,"red works only with red numbers")},k.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(c(v,v.umod(this.m)._forceRed(this)),v)},k.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},k.prototype.add=function(v,m){this._verify2(v,m);var b=v.add(m);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},k.prototype.iadd=function(v,m){this._verify2(v,m);var b=v.iadd(m);return b.cmp(this.m)>=0&&b.isub(this.m),b},k.prototype.sub=function(v,m){this._verify2(v,m);var b=v.sub(m);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},k.prototype.isub=function(v,m){this._verify2(v,m);var b=v.isub(m);return b.cmpn(0)<0&&b.iadd(this.m),b},k.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},k.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},k.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},k.prototype.isqr=function(v){return this.imul(v,v.clone())},k.prototype.sqr=function(v){return this.mul(v,v)},k.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(o(m%2==1),m===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(v,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);o(!g.isZero());var S=new t(1).toRed(this),R=S.redNeg(),I=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,I).cmp(R)!==0;)z.redIAdd(R);for(var $=this.pow(z,g),W=this.pow(v,g.addn(1).iushrn(1)),j=this.pow(v,g),H=y;j.cmp(S)!==0;){for(var M=j,T=0;M.cmp(S)!==0;T++)M=M.redSqr();o(T=0;g--){for(var z=m.words[g],$=I-1;$>=0;$--){var W=z>>$&1;y!==b[0]&&(y=this.sqr(y)),W!==0||S!==0?(S<<=1,S|=W,(++R===4||g===0&&$===0)&&(y=this.mul(y,b[S]),R=0,S=0)):R=0}I=26}return y},k.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},k.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},t.mont=function(v){return new E(v)},r(E,k),E.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},E.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},E.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var b=v.imul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),S=y;return y.cmp(this.m)>=0?S=y.isub(this.m):y.cmpn(0)<0&&(S=y.iadd(this.m)),S._forceRed(this)},E.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new t(0)._forceRed(this);var b=v.mul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),S=y;return y.cmp(this.m)>=0?S=y.isub(this.m):y.cmpn(0)<0&&(S=y.iadd(this.m)),S._forceRed(this)},E.prototype.invm=function(v){return this.imod(v._invmp(this.m).mul(this.r2))._forceRed(this)}})(C===void 0||C)},{buffer:188}],187:[function(s,C,_){var p;function a(r){this.rand=r}if(C.exports=function(r){return p||(p=new a(null)),p.generate(r)},C.exports.Rand=a,a.prototype.generate=function(r){return this._rand(r)},a.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e>>24]^N[D>>>16&255]^L[U>>>8&255]^O[255&B]^n[k++],f=A[D>>>24]^N[U>>>16&255]^L[B>>>8&255]^O[255&P]^n[k++],w=A[U>>>24]^N[B>>>16&255]^L[P>>>8&255]^O[255&D]^n[k++],x=A[B>>>24]^N[P>>>16&255]^L[D>>>8&255]^O[255&U]^n[k++],P=d,D=f,U=w,B=x;return d=(h[P>>>24]<<24|h[D>>>16&255]<<16|h[U>>>8&255]<<8|h[255&B])^n[k++],f=(h[D>>>24]<<24|h[U>>>16&255]<<16|h[B>>>8&255]<<8|h[255&P])^n[k++],w=(h[U>>>24]<<24|h[B>>>16&255]<<16|h[P>>>8&255]<<8|h[255&D])^n[k++],x=(h[B>>>24]<<24|h[P>>>16&255]<<16|h[D>>>8&255]<<8|h[255&U])^n[k++],[d>>>=0,f>>>=0,w>>>=0,x>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var i=new Array(256),n=0;n<256;n++)i[n]=n<128?n<<1:n<<1^283;for(var c=[],h=[],u=[[],[],[],[]],d=[[],[],[],[]],f=0,w=0,x=0;x<256;++x){var A=w^w<<1^w<<2^w<<3^w<<4;A=A>>>8^255&A^99,c[f]=A,h[A]=f;var N=i[f],L=i[N],O=i[L],P=257*i[A]^16843008*A;u[0][f]=P<<24|P>>>8,u[1][f]=P<<16|P>>>16,u[2][f]=P<<8|P>>>24,u[3][f]=P,P=16843009*O^65537*L^257*N^16843008*f,d[0][A]=P<<24|P>>>8,d[1][A]=P<<16|P>>>16,d[2][A]=P<<8|P>>>24,d[3][A]=P,f===0?f=w=1:(f=N^i[i[i[O^N]]],w^=i[i[w]])}return{SBOX:c,INV_SBOX:h,SUB_MIX:u,INV_SUB_MIX:d}}();function l(i){this._key=a(i),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var i=this._key,n=i.length,c=n+6,h=4*(c+1),u=[],d=0;d>>24,f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f],f^=t[d/n|0]<<24):n>6&&d%n==4&&(f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f]),u[d]=u[d-n]^f}for(var w=[],x=0;x>>24]]^e.INV_SUB_MIX[1][e.SBOX[N>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[N>>>8&255]]^e.INV_SUB_MIX[3][e.SBOX[255&N]]}this._nRounds=c,this._keySchedule=u,this._invKeySchedule=w},l.prototype.encryptBlockRaw=function(i){return r(i=a(i),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(i){var n=this.encryptBlockRaw(i),c=p.allocUnsafe(16);return c.writeUInt32BE(n[0],0),c.writeUInt32BE(n[1],4),c.writeUInt32BE(n[2],8),c.writeUInt32BE(n[3],12),c},l.prototype.decryptBlock=function(i){var n=(i=a(i))[1];i[1]=i[3],i[3]=n;var c=r(i,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),h=p.allocUnsafe(16);return h.writeUInt32BE(c[0],0),h.writeUInt32BE(c[3],4),h.writeUInt32BE(c[2],8),h.writeUInt32BE(c[1],12),h},l.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},C.exports.AES=l},{"safe-buffer":494}],190:[function(s,C,_){var p=s("./aes"),a=s("safe-buffer").Buffer,o=s("cipher-base"),r=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function i(n,c,h,u){o.call(this);var d=a.alloc(4,0);this._cipher=new p.AES(c);var f=this._cipher.encryptBlock(d);this._ghash=new t(f),h=function(w,x,A){if(x.length===12)return w._finID=a.concat([x,a.from([0,0,0,1])]),a.concat([x,a.from([0,0,0,2])]);var N=new t(A),L=x.length,O=L%16;N.update(x),O&&(O=16-O,N.update(a.alloc(O,0))),N.update(a.alloc(8,0));var P=8*L,D=a.alloc(8);D.writeUIntBE(P,0,8),N.update(D),w._finID=N.state;var U=a.from(w._finID);return l(U),U}(this,h,f),this._prev=a.from(h),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=n,this._authTag=null,this._called=!1}r(i,o),i.prototype._update=function(n){if(!this._called&&this._alen){var c=16-this._alen%16;c<16&&(c=a.alloc(c,0),this._ghash.update(c))}this._called=!0;var h=this._mode.encrypt(this,n);return this._decrypt?this._ghash.update(n):this._ghash.update(h),this._len+=n.length,h},i.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var n=e(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(c,h){var u=0;c.length!==h.length&&u++;for(var d=Math.min(c.length,h.length),f=0;f16)throw new Error("unable to decrypt data");for(var f=-1;++f16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u}else if(this.cache.length>=16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u;return null},n.prototype.flush=function(){if(this.cache.length)return this.cache},_.createDecipher=function(h,u){var d=o[h.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var f=l(u,!1,d.key,d.iv);return c(h,f.key,f.iv)},_.createDecipheriv=c},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(s,C,_){var p=s("./modes"),a=s("./authCipher"),o=s("safe-buffer").Buffer,r=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function i(u,d,f){t.call(this),this._cache=new c,this._cipher=new e.AES(d),this._prev=o.from(f),this._mode=u,this._autopadding=!0}s("inherits")(i,t),i.prototype._update=function(u){var d,f;this._cache.add(u);for(var w=[];d=this._cache.get();)f=this._mode.encrypt(this,d),w.push(f);return o.concat(w)};var n=o.alloc(16,16);function c(){this.cache=o.allocUnsafe(0)}function h(u,d,f){var w=p[u.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=o.from(d)),d.length!==w.key/8)throw new TypeError("invalid key length "+d.length);if(typeof f=="string"&&(f=o.from(f)),w.mode!=="GCM"&&f.length!==w.iv)throw new TypeError("invalid iv length "+f.length);return w.type==="stream"?new r(w.module,d,f):w.type==="auth"?new a(w.module,d,f):new i(w.module,d,f)}i.prototype._final=function(){var u=this._cache.flush();if(this._autopadding)return u=this._mode.encrypt(this,u),this._cipher.scrub(),u;if(!u.equals(n))throw this._cipher.scrub(),new Error("data not multiple of block length")},i.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},c.prototype.add=function(u){this.cache=o.concat([this.cache,u])},c.prototype.get=function(){if(this.cache.length>15){var u=this.cache.slice(0,16);return this.cache=this.cache.slice(16),u}return null},c.prototype.flush=function(){for(var u=16-this.cache.length,d=o.allocUnsafe(u),f=-1;++f>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function r(t){this.h=t,this.state=p.alloc(16,0),this.cache=p.allocUnsafe(0)}r.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,l&&(i[0]=i[0]^225<<24)}this.state=o(n)},r.prototype.update=function(t){var e;for(this.cache=p.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},r.prototype.final=function(t,e){return this.cache.length&&this.ghash(p.concat([this.cache,a],16)),this.ghash(o([0,t,0,e])),this.state},C.exports=r},{"safe-buffer":494}],195:[function(s,C,_){C.exports=function(p){for(var a,o=p.length;o--;){if((a=p.readUInt8(o))!==255){a++,p.writeUInt8(a,o);break}p.writeUInt8(0,o)}}},{}],196:[function(s,C,_){var p=s("buffer-xor");_.encrypt=function(a,o){var r=p(o,a._prev);return a._prev=a._cipher.encryptBlock(r),a._prev},_.decrypt=function(a,o){var r=a._prev;a._prev=o;var t=a._cipher.decryptBlock(o);return p(t,r)}},{"buffer-xor":219}],197:[function(s,C,_){var p=s("safe-buffer").Buffer,a=s("buffer-xor");function o(r,t,e){var l=t.length,i=a(t,r._cache);return r._cache=r._cache.slice(l),r._prev=p.concat([r._prev,e?t:i]),i}_.encrypt=function(r,t,e){for(var l,i=p.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=p.allocUnsafe(0)),!(r._cache.length<=t.length)){i=p.concat([i,o(r,t,e)]);break}l=r._cache.length,i=p.concat([i,o(r,t.slice(0,l),e)]),t=t.slice(l)}return i}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,C,_){var p=s("safe-buffer").Buffer;function a(r,t,e){for(var l,i,n=-1,c=0;++n<8;)l=t&1<<7-n?128:0,c+=(128&(i=r._cipher.encryptBlock(r._prev)[0]^l))>>n%8,r._prev=o(r._prev,e?l:i);return c}function o(r,t){var e=r.length,l=-1,i=p.allocUnsafe(r.length);for(r=p.concat([r,p.from([t])]);++l>7;return i}_.encrypt=function(r,t,e){for(var l=t.length,i=p.allocUnsafe(l),n=-1;++n=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){var i=function(L){var O=r(L);return{blinder:O.toRed(a.mont(L.modulus)).redPow(new a(L.publicExponent)).fromRed(),unblinder:O.invm(L.modulus)}}(l),n=l.modulus.byteLength(),c=new a(e).mul(i.blinder).umod(l.modulus),h=c.toRed(a.mont(l.prime1)),u=c.toRed(a.mont(l.prime2)),d=l.coefficient,f=l.prime1,w=l.prime2,x=h.redPow(l.exponent1).fromRed(),A=u.redPow(l.exponent2).fromRed(),N=x.isub(A).imul(d).umod(f).imul(w);return A.iadd(N).imul(i.unblinder).umod(l.modulus).toArrayLike(p,"be",n)}t.getr=r,C.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,C,_){C.exports=s("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(s,C,_){C.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(s,C,_){C.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(s,C,_){var p=s("safe-buffer").Buffer,a=s("create-hash"),o=s("readable-stream"),r=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function i(u){o.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hashType=d.hash,this._hash=a(d.hash),this._tag=d.id,this._signType=d.sign}function n(u){o.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hash=a(d.hash),this._tag=d.id,this._signType=d.sign}function c(u){return new i(u)}function h(u){return new n(u)}Object.keys(l).forEach(function(u){l[u].id=p.from(l[u].id,"hex"),l[u.toLowerCase()]=l[u]}),r(i,o.Writable),i.prototype._write=function(u,d,f){this._hash.update(u),f()},i.prototype.update=function(u,d){return typeof u=="string"&&(u=p.from(u,d)),this._hash.update(u),this},i.prototype.sign=function(u,d){this.end();var f=this._hash.digest(),w=t(f,u,this._hashType,this._signType,this._tag);return d?w.toString(d):w},r(n,o.Writable),n.prototype._write=function(u,d,f){this._hash.update(u),f()},n.prototype.update=function(u,d){return typeof u=="string"&&(u=p.from(u,d)),this._hash.update(u),this},n.prototype.verify=function(u,d,f){typeof d=="string"&&(d=p.from(d,f)),this.end();var w=this._hash.digest();return e(d,w,u,this._signType,this._tag)},C.exports={Sign:c,Verify:h,createSign:c,createVerify:h}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(s,C,_){var p=s("safe-buffer").Buffer,a=s("create-hmac"),o=s("browserify-rsa"),r=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function i(u,d,f,w){if((u=p.from(u.toArray())).length0&&f.ishrn(w),f}function c(u,d,f){var w,x;do{for(w=p.alloc(0);8*w.length=i)throw new Error("invalid sig")}C.exports=function(l,i,n,c,h){var u=r(n);if(u.type==="ec"){if(c!=="ecdsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,O,P){var D=t[P.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var U=new o(D),B=P.data.subjectPrivateKey.data;return U.verify(O,L,B)}(l,i,u)}if(u.type==="dsa"){if(c!=="dsa")throw new Error("wrong public key type");return function(L,O,P){var D=P.data.p,U=P.data.q,B=P.data.g,k=P.data.pub_key,E=r.signature.decode(L,"der"),v=E.s,m=E.r;e(v,U),e(m,U);var b=a.mont(D),g=v.invm(U);return B.toRed(b).redPow(new a(O).mul(g).mod(U)).fromRed().mul(k.toRed(b).redPow(m.mul(g).mod(U)).fromRed()).mod(D).mod(U).cmp(m)===0}(l,i,u)}if(c!=="rsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");i=p.concat([h,i]);for(var d=u.modulus.byteLength(),f=[1],w=0;i.length+f.length+2>5==6?2:u>>4==14?3:u>>3==30?4:u>>6==2?-1:-2}function t(u){var d=this.lastTotal-this.lastNeed,f=function(w,x,A){if((192&x[0])!=128)return w.lastNeed=0,"�";if(w.lastNeed>1&&x.length>1){if((192&x[1])!=128)return w.lastNeed=1,"�";if(w.lastNeed>2&&x.length>2&&(192&x[2])!=128)return w.lastNeed=2,"�"}}(this,u);return f!==void 0?f:this.lastNeed<=u.length?(u.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(u.copy(this.lastChar,d,0,u.length),void(this.lastNeed-=u.length))}function e(u,d){if((u.length-d)%2==0){var f=u.toString("utf16le",d);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",d,u.length-1)}function l(u){var d=u&&u.length?this.write(u):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,f)}return d}function i(u,d){var f=(u.length-d)%3;return f===0?u.toString("base64",d):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",d,u.length-f))}function n(u){var d=u&&u.length?this.write(u):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function c(u){return u.toString(this.encoding)}function h(u){return u&&u.length?this.write(u):""}_.StringDecoder=o,o.prototype.write=function(u){if(u.length===0)return"";var d,f;if(this.lastNeed){if((d=this.fillLast(u))===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f=0?(O>0&&(x.lastNeed=O-1),O):--L=0?(O>0&&(x.lastNeed=O-2),O):--L=0?(O>0&&(O===2?O=0:x.lastNeed=O-3),O):0}(this,u,d);if(!this.lastNeed)return u.toString("utf8",d);this.lastTotal=f;var w=u.length-(f-this.lastNeed);return u.copy(this.lastChar,0,w),u.toString("utf8",d,w)},o.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length}},{"safe-buffer":217}],219:[function(s,C,_){(function(p){(function(){C.exports=function(a,o){for(var r=Math.min(a.length,o.length),t=new p(r),e=0;e2147483647)throw new RangeError('The value "'+M+'" is invalid for option "size"');var T=new Uint8Array(M);return T.__proto__=t.prototype,T}function t(M,T,F){if(typeof M=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(M)}return e(M,T,F)}function e(M,T,F){if(typeof M=="string")return function(q,K){if(typeof K=="string"&&K!==""||(K="utf8"),!t.isEncoding(K))throw new TypeError("Unknown encoding: "+K);var Q=0|h(q,K),et=r(Q),X=et.write(q,K);return X!==Q&&(et=et.slice(0,X)),et}(M,T);if(ArrayBuffer.isView(M))return n(M);if(M==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(j(M,ArrayBuffer)||M&&j(M.buffer,ArrayBuffer))return function(q,K,Q){if(K<0||q.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|M}function h(M,T){if(t.isBuffer(M))return M.length;if(ArrayBuffer.isView(M)||j(M,ArrayBuffer))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);var F=M.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&F===0)return 0;for(var Y=!1;;)switch(T){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return z(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return $(M).length;default:if(Y)return V?-1:z(M).length;T=(""+T).toLowerCase(),Y=!0}}function u(M,T,F){var V=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(T>>>=0))return"";for(M||(M="utf8");;)switch(M){case"hex":return E(this,T,F);case"utf8":case"utf-8":return U(this,T,F);case"ascii":return B(this,T,F);case"latin1":case"binary":return k(this,T,F);case"base64":return D(this,T,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,T,F);default:if(V)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),V=!0}}function d(M,T,F){var V=M[T];M[T]=M[F],M[F]=V}function f(M,T,F,V,Y){if(M.length===0)return-1;if(typeof F=="string"?(V=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),H(F=+F)&&(F=Y?0:M.length-1),F<0&&(F=M.length+F),F>=M.length){if(Y)return-1;F=M.length-1}else if(F<0){if(!Y)return-1;F=0}if(typeof T=="string"&&(T=t.from(T,V)),t.isBuffer(T))return T.length===0?-1:w(M,T,F,V,Y);if(typeof T=="number")return T&=255,typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(M,T,F):Uint8Array.prototype.lastIndexOf.call(M,T,F):w(M,[T],F,V,Y);throw new TypeError("val must be string, number or Buffer")}function w(M,T,F,V,Y){var q,K=1,Q=M.length,et=T.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(M.length<2||T.length<2)return-1;K=2,Q/=2,et/=2,F/=2}function X(rt,it){return K===1?rt[it]:rt.readUInt16BE(it*K)}if(Y){var J=-1;for(q=F;qQ&&(F=Q-et),q=F;q>=0;q--){for(var G=!0,nt=0;ntY&&(V=Y):V=Y;var q=T.length;V>q/2&&(V=q/2);for(var K=0;K>8,et=K%256,X.push(et),X.push(Q);return X}(T,M.length-F),M,F,V)}function D(M,T,F){return T===0&&F===M.length?a.fromByteArray(M):a.fromByteArray(M.slice(T,F))}function U(M,T,F){F=Math.min(M.length,F);for(var V=[],Y=T;Y239?4:X>223?3:X>191?2:1;if(Y+G<=F)switch(G){case 1:X<128&&(J=X);break;case 2:(192&(q=M[Y+1]))==128&&(et=(31&X)<<6|63&q)>127&&(J=et);break;case 3:q=M[Y+1],K=M[Y+2],(192&q)==128&&(192&K)==128&&(et=(15&X)<<12|(63&q)<<6|63&K)>2047&&(et<55296||et>57343)&&(J=et);break;case 4:q=M[Y+1],K=M[Y+2],Q=M[Y+3],(192&q)==128&&(192&K)==128&&(192&Q)==128&&(et=(15&X)<<18|(63&q)<<12|(63&K)<<6|63&Q)>65535&&et<1114112&&(J=et)}J===null?(J=65533,G=1):J>65535&&(J-=65536,V.push(J>>>10&1023|55296),J=56320|1023&J),V.push(J),Y+=G}return function(nt){var rt=nt.length;if(rt<=4096)return String.fromCharCode.apply(String,nt);for(var it="",ut=0;utT&&(M+=" ... "),""},t.prototype.compare=function(M,T,F,V,Y){if(j(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(M))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof M);if(T===void 0&&(T=0),F===void 0&&(F=M?M.length:0),V===void 0&&(V=0),Y===void 0&&(Y=this.length),T<0||F>M.length||V<0||Y>this.length)throw new RangeError("out of range index");if(V>=Y&&T>=F)return 0;if(V>=Y)return-1;if(T>=F)return 1;if(this===M)return 0;for(var q=(Y>>>=0)-(V>>>=0),K=(F>>>=0)-(T>>>=0),Q=Math.min(q,K),et=this.slice(V,Y),X=M.slice(T,F),J=0;J>>=0,isFinite(F)?(F>>>=0,V===void 0&&(V="utf8")):(V=F,F=void 0)}var Y=this.length-T;if((F===void 0||F>Y)&&(F=Y),M.length>0&&(F<0||T<0)||T>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var q=!1;;)switch(V){case"hex":return x(this,M,T,F);case"utf8":case"utf-8":return A(this,M,T,F);case"ascii":return N(this,M,T,F);case"latin1":case"binary":return L(this,M,T,F);case"base64":return O(this,M,T,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,M,T,F);default:if(q)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),q=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(M,T,F){var V="";F=Math.min(M.length,F);for(var Y=T;YV)&&(F=V);for(var Y="",q=T;qF)throw new RangeError("Trying to access beyond buffer length")}function b(M,T,F,V,Y,q){if(!t.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>Y||TM.length)throw new RangeError("Index out of range")}function g(M,T,F,V,Y,q){if(F+V>M.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function y(M,T,F,V,Y){return T=+T,F>>>=0,Y||g(M,0,F,4),o.write(M,T,F,V,23,4),F+4}function S(M,T,F,V,Y){return T=+T,F>>>=0,Y||g(M,0,F,8),o.write(M,T,F,V,52,8),F+8}t.prototype.slice=function(M,T){var F=this.length;(M=~~M)<0?(M+=F)<0&&(M=0):M>F&&(M=F),(T=T===void 0?F:~~T)<0?(T+=F)<0&&(T=0):T>F&&(T=F),T>>=0,T>>>=0,F||m(M,T,this.length);for(var V=this[M],Y=1,q=0;++q>>=0,T>>>=0,F||m(M,T,this.length);for(var V=this[M+--T],Y=1;T>0&&(Y*=256);)V+=this[M+--T]*Y;return V},t.prototype.readUInt8=function(M,T){return M>>>=0,T||m(M,1,this.length),this[M]},t.prototype.readUInt16LE=function(M,T){return M>>>=0,T||m(M,2,this.length),this[M]|this[M+1]<<8},t.prototype.readUInt16BE=function(M,T){return M>>>=0,T||m(M,2,this.length),this[M]<<8|this[M+1]},t.prototype.readUInt32LE=function(M,T){return M>>>=0,T||m(M,4,this.length),(this[M]|this[M+1]<<8|this[M+2]<<16)+16777216*this[M+3]},t.prototype.readUInt32BE=function(M,T){return M>>>=0,T||m(M,4,this.length),16777216*this[M]+(this[M+1]<<16|this[M+2]<<8|this[M+3])},t.prototype.readIntLE=function(M,T,F){M>>>=0,T>>>=0,F||m(M,T,this.length);for(var V=this[M],Y=1,q=0;++q=(Y*=128)&&(V-=Math.pow(2,8*T)),V},t.prototype.readIntBE=function(M,T,F){M>>>=0,T>>>=0,F||m(M,T,this.length);for(var V=T,Y=1,q=this[M+--V];V>0&&(Y*=256);)q+=this[M+--V]*Y;return q>=(Y*=128)&&(q-=Math.pow(2,8*T)),q},t.prototype.readInt8=function(M,T){return M>>>=0,T||m(M,1,this.length),128&this[M]?-1*(255-this[M]+1):this[M]},t.prototype.readInt16LE=function(M,T){M>>>=0,T||m(M,2,this.length);var F=this[M]|this[M+1]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt16BE=function(M,T){M>>>=0,T||m(M,2,this.length);var F=this[M+1]|this[M]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt32LE=function(M,T){return M>>>=0,T||m(M,4,this.length),this[M]|this[M+1]<<8|this[M+2]<<16|this[M+3]<<24},t.prototype.readInt32BE=function(M,T){return M>>>=0,T||m(M,4,this.length),this[M]<<24|this[M+1]<<16|this[M+2]<<8|this[M+3]},t.prototype.readFloatLE=function(M,T){return M>>>=0,T||m(M,4,this.length),o.read(this,M,!0,23,4)},t.prototype.readFloatBE=function(M,T){return M>>>=0,T||m(M,4,this.length),o.read(this,M,!1,23,4)},t.prototype.readDoubleLE=function(M,T){return M>>>=0,T||m(M,8,this.length),o.read(this,M,!0,52,8)},t.prototype.readDoubleBE=function(M,T){return M>>>=0,T||m(M,8,this.length),o.read(this,M,!1,52,8)},t.prototype.writeUIntLE=function(M,T,F,V){M=+M,T>>>=0,F>>>=0,V||b(this,M,T,F,Math.pow(2,8*F)-1,0);var Y=1,q=0;for(this[T]=255&M;++q>>=0,F>>>=0,V||b(this,M,T,F,Math.pow(2,8*F)-1,0);var Y=F-1,q=1;for(this[T+Y]=255&M;--Y>=0&&(q*=256);)this[T+Y]=M/q&255;return T+F},t.prototype.writeUInt8=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,1,255,0),this[T]=255&M,T+1},t.prototype.writeUInt16LE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,2,65535,0),this[T]=255&M,this[T+1]=M>>>8,T+2},t.prototype.writeUInt16BE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,2,65535,0),this[T]=M>>>8,this[T+1]=255&M,T+2},t.prototype.writeUInt32LE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,4,4294967295,0),this[T+3]=M>>>24,this[T+2]=M>>>16,this[T+1]=M>>>8,this[T]=255&M,T+4},t.prototype.writeUInt32BE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,4,4294967295,0),this[T]=M>>>24,this[T+1]=M>>>16,this[T+2]=M>>>8,this[T+3]=255&M,T+4},t.prototype.writeIntLE=function(M,T,F,V){if(M=+M,T>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,M,T,F,Y-1,-Y)}var q=0,K=1,Q=0;for(this[T]=255&M;++q>0)-Q&255;return T+F},t.prototype.writeIntBE=function(M,T,F,V){if(M=+M,T>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,M,T,F,Y-1,-Y)}var q=F-1,K=1,Q=0;for(this[T+q]=255&M;--q>=0&&(K*=256);)M<0&&Q===0&&this[T+q+1]!==0&&(Q=1),this[T+q]=(M/K>>0)-Q&255;return T+F},t.prototype.writeInt8=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,1,127,-128),M<0&&(M=255+M+1),this[T]=255&M,T+1},t.prototype.writeInt16LE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,2,32767,-32768),this[T]=255&M,this[T+1]=M>>>8,T+2},t.prototype.writeInt16BE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,2,32767,-32768),this[T]=M>>>8,this[T+1]=255&M,T+2},t.prototype.writeInt32LE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,4,2147483647,-2147483648),this[T]=255&M,this[T+1]=M>>>8,this[T+2]=M>>>16,this[T+3]=M>>>24,T+4},t.prototype.writeInt32BE=function(M,T,F){return M=+M,T>>>=0,F||b(this,M,T,4,2147483647,-2147483648),M<0&&(M=4294967295+M+1),this[T]=M>>>24,this[T+1]=M>>>16,this[T+2]=M>>>8,this[T+3]=255&M,T+4},t.prototype.writeFloatLE=function(M,T,F){return y(this,M,T,!0,F)},t.prototype.writeFloatBE=function(M,T,F){return y(this,M,T,!1,F)},t.prototype.writeDoubleLE=function(M,T,F){return S(this,M,T,!0,F)},t.prototype.writeDoubleBE=function(M,T,F){return S(this,M,T,!1,F)},t.prototype.copy=function(M,T,F,V){if(!t.isBuffer(M))throw new TypeError("argument should be a Buffer");if(F||(F=0),V||V===0||(V=this.length),T>=M.length&&(T=M.length),T||(T=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),M.length-T=0;--q)M[q+T]=this[q+F];else Uint8Array.prototype.set.call(M,this.subarray(F,V),T);return Y},t.prototype.fill=function(M,T,F,V){if(typeof M=="string"){if(typeof T=="string"?(V=T,T=0,F=this.length):typeof F=="string"&&(V=F,F=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!t.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(M.length===1){var Y=M.charCodeAt(0);(V==="utf8"&&Y<128||V==="latin1")&&(M=Y)}}else typeof M=="number"&&(M&=255);if(T<0||this.length>>=0,F=F===void 0?this.length:F>>>0,M||(M=0),typeof M=="number")for(q=T;q55295&&F<57344){if(!Y){if(F>56319){(T-=3)>-1&&q.push(239,191,189);continue}if(K+1===V){(T-=3)>-1&&q.push(239,191,189);continue}Y=F;continue}if(F<56320){(T-=3)>-1&&q.push(239,191,189),Y=F;continue}F=65536+(Y-55296<<10|F-56320)}else Y&&(T-=3)>-1&&q.push(239,191,189);if(Y=null,F<128){if((T-=1)<0)break;q.push(F)}else if(F<2048){if((T-=2)<0)break;q.push(F>>6|192,63&F|128)}else if(F<65536){if((T-=3)<0)break;q.push(F>>12|224,F>>6&63|128,63&F|128)}else{if(!(F<1114112))throw new Error("Invalid code point");if((T-=4)<0)break;q.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|128)}}return q}function $(M){return a.toByteArray(function(T){if((T=(T=T.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;T.length%4!=0;)T+="=";return T}(M))}function W(M,T,F,V){for(var Y=0;Y=T.length||Y>=M.length);++Y)T[Y+F]=M[Y];return Y}function j(M,T){return M instanceof T||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===T.name}function H(M){return M!=M}}).call(this)}).call(this,s("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(s,C,_){var p=s("safe-buffer").Buffer,a=s("stream").Transform,o=s("string_decoder").StringDecoder;function r(t){a.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}s("inherits")(r,a),r.prototype.update=function(t,e,l){typeof t=="string"&&(t=p.from(t,e));var i=this._update(t);return this.hashMode?this:(l&&(i=this._toString(i,l)),i)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,e,l){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){i=n}finally{l(i)}},r.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(l){e=l}t(e)},r.prototype._finalOrDigest=function(t){var e=this.__final()||p.alloc(0);return t&&(e=this._toString(e,t,!0)),e},r.prototype._toString=function(t,e,l){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return l&&(i+=this._decoder.end()),i},C.exports=r},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(s,C,_){var p=s("../internals/is-callable"),a=s("../internals/try-to-string"),o=TypeError;C.exports=function(r){if(p(r))return r;throw new o(a(r)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(s,C,_){var p=s("../internals/is-constructor"),a=s("../internals/try-to-string"),o=TypeError;C.exports=function(r){if(p(r))return r;throw new o(a(r)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(s,C,_){var p=s("../internals/is-callable"),a=String,o=TypeError;C.exports=function(r){if(typeof r=="object"||p(r))return r;throw new o("Can't set "+a(r)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(s,C,_){var p=s("../internals/well-known-symbol"),a=s("../internals/object-create"),o=s("../internals/object-define-property").f,r=p("unscopables"),t=Array.prototype;t[r]===void 0&&o(t,r,{configurable:!0,value:a(null)}),C.exports=function(e){t[r][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(s,C,_){var p=s("../internals/object-is-prototype-of"),a=TypeError;C.exports=function(o,r){if(p(r,o))return o;throw new a("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(s,C,_){var p=s("../internals/is-object"),a=String,o=TypeError;C.exports=function(r){if(p(r))return r;throw new o(a(r)+" is not an object")}},{"../internals/is-object":289}],228:[function(s,C,_){var p=s("../internals/to-indexed-object"),a=s("../internals/to-absolute-index"),o=s("../internals/length-of-array-like"),r=function(t){return function(e,l,i){var n,c=p(e),h=o(c),u=a(i,h);if(t&&l!=l){for(;h>u;)if((n=c[u++])!=n)return!0}else for(;h>u;u++)if((t||u in c)&&c[u]===l)return t||u||0;return!t&&-1}};C.exports={includes:r(!0),indexOf:r(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(s,C,_){var p=s("../internals/function-bind-context"),a=s("../internals/function-uncurry-this"),o=s("../internals/indexed-object"),r=s("../internals/to-object"),t=s("../internals/length-of-array-like"),e=s("../internals/array-species-create"),l=a([].push),i=function(n){var c=n===1,h=n===2,u=n===3,d=n===4,f=n===6,w=n===7,x=n===5||f;return function(A,N,L,O){for(var P,D,U=r(A),B=o(U),k=p(N,L),E=t(B),v=0,m=O||e,b=c?m(A,E):h||w?m(A,0):void 0;E>v;v++)if((x||v in B)&&(D=k(P=B[v],v,U),n))if(c)b[v]=D;else if(D)switch(n){case 3:return!0;case 5:return P;case 6:return v;case 2:l(b,P)}else switch(n){case 4:return!1;case 7:l(b,P)}return f?-1:u||d?d:b}};C.exports={forEach:i(0),map:i(1),filter:i(2),some:i(3),every:i(4),find:i(5),findIndex:i(6),filterReject:i(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(s,C,_){var p=s("../internals/to-absolute-index"),a=s("../internals/length-of-array-like"),o=s("../internals/create-property"),r=Array,t=Math.max;C.exports=function(e,l,i){for(var n=a(e),c=p(l,n),h=p(i===void 0?n:i,n),u=r(t(h-c,0)),d=0;c0&&p[0]<4?1:+(p[0]+p[1])),!a&&r&&(!(p=r.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=r.match(/Chrome\/(\d+)/))&&(a=+p[1]),C.exports=a},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(s,C,_){C.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(s,C,_){var p=s("../internals/global"),a=s("../internals/object-get-own-property-descriptor").f,o=s("../internals/create-non-enumerable-property"),r=s("../internals/define-built-in"),t=s("../internals/define-global-property"),e=s("../internals/copy-constructor-properties"),l=s("../internals/is-forced");C.exports=function(i,n){var c,h,u,d,f,w=i.target,x=i.global,A=i.stat;if(c=x?p:A?p[w]||t(w,{}):(p[w]||{}).prototype)for(h in n){if(d=n[h],u=i.dontCallGetSet?(f=a(c,h))&&f.value:c[h],!l(x?h:w+(A?".":"#")+h,i.forced)&&u!==void 0){if(typeof d==typeof u)continue;e(d,u)}(i.sham||u&&u.sham)&&o(d,"sham",!0),r(c,h,d,i)}}},{"../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(s,C,_){C.exports=function(p){try{return!!p()}catch(a){return!0}}},{}],261:[function(s,C,_){var p=s("../internals/function-bind-native"),a=Function.prototype,o=a.apply,r=a.call;C.exports=typeof Reflect=="object"&&Reflect.apply||(p?r.bind(o):function(){return r.apply(o,arguments)})},{"../internals/function-bind-native":263}],262:[function(s,C,_){var p=s("../internals/function-uncurry-this-clause"),a=s("../internals/a-callable"),o=s("../internals/function-bind-native"),r=p(p.bind);C.exports=function(t,e){return a(t),e===void 0?t:o?r(t,e):function(){return t.apply(e,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(s,C,_){var p=s("../internals/fails");C.exports=!p(function(){var a=function(){}.bind();return typeof a!="function"||a.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(s,C,_){var p=s("../internals/function-bind-native"),a=Function.prototype.call;C.exports=p?a.bind(a):function(){return a.apply(a,arguments)}},{"../internals/function-bind-native":263}],265:[function(s,C,_){var p=s("../internals/descriptors"),a=s("../internals/has-own-property"),o=Function.prototype,r=p&&Object.getOwnPropertyDescriptor,t=a(o,"name"),e=t&&function(){}.name==="something",l=t&&(!p||p&&r(o,"name").configurable);C.exports={EXISTS:t,PROPER:e,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(s,C,_){var p=s("../internals/function-uncurry-this"),a=s("../internals/a-callable");C.exports=function(o,r,t){try{return p(a(Object.getOwnPropertyDescriptor(o,r)[t]))}catch(e){}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(s,C,_){var p=s("../internals/classof-raw"),a=s("../internals/function-uncurry-this");C.exports=function(o){if(p(o)==="Function")return a(o)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(s,C,_){var p=s("../internals/function-bind-native"),a=Function.prototype,o=a.call,r=p&&a.bind.bind(o,o);C.exports=p?r:function(t){return function(){return o.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(s,C,_){var p=s("../internals/global"),a=s("../internals/is-callable"),o=function(r){return a(r)?r:void 0};C.exports=function(r,t){return arguments.length<2?o(p[r]):p[r]&&p[r][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(s,C,_){var p=s("../internals/classof"),a=s("../internals/get-method"),o=s("../internals/is-null-or-undefined"),r=s("../internals/iterators"),t=s("../internals/well-known-symbol")("iterator");C.exports=function(e){if(!o(e))return a(e,t)||a(e,"@@iterator")||r[p(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(s,C,_){var p=s("../internals/function-call"),a=s("../internals/a-callable"),o=s("../internals/an-object"),r=s("../internals/try-to-string"),t=s("../internals/get-iterator-method"),e=TypeError;C.exports=function(l,i){var n=arguments.length<2?t(l):i;if(a(n))return o(p(n,l));throw new e(r(l)+" 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(s,C,_){var p=s("../internals/function-uncurry-this"),a=s("../internals/is-array"),o=s("../internals/is-callable"),r=s("../internals/classof-raw"),t=s("../internals/to-string"),e=p([].push);C.exports=function(l){if(o(l))return l;if(a(l)){for(var i=l.length,n=[],c=0;cL;L++)if((P=y(f[L]))&&l(d,P))return P;return new u(!1)}A=i(f,N)}for(D=E?f.next:A.next;!(U=a(D,A)).done;){try{P=y(U.value)}catch(S){c(A,"throw",S)}if(typeof P=="object"&&P&&l(d,P))return P}return new u(!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(s,C,_){var p=s("../internals/function-call"),a=s("../internals/an-object"),o=s("../internals/get-method");C.exports=function(r,t,e){var l,i;a(r);try{if(!(l=o(r,"return"))){if(t==="throw")throw e;return e}l=p(l,r)}catch(n){i=!0,l=n}if(t==="throw")throw e;if(i)throw l;return a(l),e}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(s,C,_){var p=s("../internals/iterators-core").IteratorPrototype,a=s("../internals/object-create"),o=s("../internals/create-property-descriptor"),r=s("../internals/set-to-string-tag"),t=s("../internals/iterators"),e=function(){return this};C.exports=function(l,i,n,c){var h=i+" Iterator";return l.prototype=a(p,{next:o(+!c,n)}),r(l,h,!1,!0),t[h]=e,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(s,C,_){var p=s("../internals/export"),a=s("../internals/function-call"),o=s("../internals/is-pure"),r=s("../internals/function-name"),t=s("../internals/is-callable"),e=s("../internals/iterator-create-constructor"),l=s("../internals/object-get-prototype-of"),i=s("../internals/object-set-prototype-of"),n=s("../internals/set-to-string-tag"),c=s("../internals/create-non-enumerable-property"),h=s("../internals/define-built-in"),u=s("../internals/well-known-symbol"),d=s("../internals/iterators"),f=s("../internals/iterators-core"),w=r.PROPER,x=r.CONFIGURABLE,A=f.IteratorPrototype,N=f.BUGGY_SAFARI_ITERATORS,L=u("iterator"),O=function(){return this};C.exports=function(P,D,U,B,k,E,v){e(U,D,B);var m,b,g,y=function(j){if(j===k&&$)return $;if(!N&&j&&j in I)return I[j];switch(j){case"keys":case"values":case"entries":return function(){return new U(this,j)}}return function(){return new U(this)}},S=D+" Iterator",R=!1,I=P.prototype,z=I[L]||I["@@iterator"]||k&&I[k],$=!N&&z||y(k),W=D==="Array"&&I.entries||z;if(W&&(m=l(W.call(new P)))!==Object.prototype&&m.next&&(o||l(m)===A||(i?i(m,A):t(m[L])||h(m,L,O)),n(m,S,!0,!0),o&&(d[S]=O)),w&&k==="values"&&z&&z.name!=="values"&&(!o&&x?c(I,"name","values"):(R=!0,$=function(){return a(z,this)})),k)if(b={values:y("values"),keys:E?$:y("keys"),entries:y("entries")},v)for(g in b)(N||R||!(g in I))&&h(I,g,b[g]);else p({target:D,proto:!0,forced:N||R},b);return o&&!v||I[L]===$||h(I,L,$,{name:k}),d[D]=$,b}},{"../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(s,C,_){var p,a,o,r=s("../internals/fails"),t=s("../internals/is-callable"),e=s("../internals/is-object"),l=s("../internals/object-create"),i=s("../internals/object-get-prototype-of"),n=s("../internals/define-built-in"),c=s("../internals/well-known-symbol"),h=s("../internals/is-pure"),u=c("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(a=i(i(o)))!==Object.prototype&&(p=a):d=!0),!e(p)||r(function(){var f={};return p[u].call(f)!==f})?p={}:h&&(p=l(p)),t(p[u])||n(p,u,function(){return this}),C.exports={IteratorPrototype:p,BUGGY_SAFARI_ITERATORS:d}},{"../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(s,C,_){arguments[4][276][0].apply(_,arguments)},{dup:276}],299:[function(s,C,_){var p=s("../internals/to-length");C.exports=function(a){return p(a.length)}},{"../internals/to-length":343}],300:[function(s,C,_){var p=s("../internals/function-uncurry-this"),a=s("../internals/fails"),o=s("../internals/is-callable"),r=s("../internals/has-own-property"),t=s("../internals/descriptors"),e=s("../internals/function-name").CONFIGURABLE,l=s("../internals/inspect-source"),i=s("../internals/internal-state"),n=i.enforce,c=i.get,h=String,u=Object.defineProperty,d=p("".slice),f=p("".replace),w=p([].join),x=t&&!a(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=C.exports=function(L,O,P){d(h(O),0,7)==="Symbol("&&(O="["+f(h(O),/^Symbol\(([^)]*)\)/,"$1")+"]"),P&&P.getter&&(O="get "+O),P&&P.setter&&(O="set "+O),(!r(L,"name")||e&&L.name!==O)&&(t?u(L,"name",{value:O,configurable:!0}):L.name=O),x&&P&&r(P,"arity")&&L.length!==P.arity&&u(L,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch(U){}var D=n(L);return r(D,"source")||(D.source=w(A,typeof O=="string"?O:"")),L};Function.prototype.toString=N(function(){return o(this)&&c(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(s,C,_){var p=Math.ceil,a=Math.floor;C.exports=Math.trunc||function(o){var r=+o;return(r>0?a:p)(r)}},{}],302:[function(s,C,_){var p,a,o,r,t,e=s("../internals/global"),l=s("../internals/function-bind-context"),i=s("../internals/object-get-own-property-descriptor").f,n=s("../internals/task").set,c=s("../internals/queue"),h=s("../internals/engine-is-ios"),u=s("../internals/engine-is-ios-pebble"),d=s("../internals/engine-is-webos-webkit"),f=s("../internals/engine-is-node"),w=e.MutationObserver||e.WebKitMutationObserver,x=e.document,A=e.process,N=e.Promise,L=i(e,"queueMicrotask"),O=L&&L.value;if(!O){var P=new c,D=function(){var U,B;for(f&&(U=A.domain)&&U.exit();B=P.get();)try{B()}catch(k){throw P.head&&p(),k}U&&U.enter()};h||f||d||!w||!x?!u&&N&&N.resolve?((r=N.resolve(void 0)).constructor=N,t=l(r.then,r),p=function(){t(D)}):f?p=function(){A.nextTick(D)}:(n=l(n,e),p=function(){n(D)}):(a=!0,o=x.createTextNode(""),new w(D).observe(o,{characterData:!0}),p=function(){o.data=a=!a}),O=function(U){P.head||p(),P.add(U)}}C.exports=O},{"../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(s,C,_){var p=s("../internals/a-callable"),a=TypeError,o=function(r){var t,e;this.promise=new r(function(l,i){if(t!==void 0||e!==void 0)throw new a("Bad Promise constructor");t=l,e=i}),this.resolve=p(t),this.reject=p(e)};C.exports.f=function(r){return new o(r)}},{"../internals/a-callable":222}],304:[function(s,C,_){var p=s("../internals/is-regexp"),a=TypeError;C.exports=function(o){if(p(o))throw new a("The method doesn't accept regular expressions");return o}},{"../internals/is-regexp":291}],305:[function(s,C,_){var p=s("../internals/descriptors"),a=s("../internals/function-uncurry-this"),o=s("../internals/function-call"),r=s("../internals/fails"),t=s("../internals/object-keys"),e=s("../internals/object-get-own-property-symbols"),l=s("../internals/object-property-is-enumerable"),i=s("../internals/to-object"),n=s("../internals/indexed-object"),c=Object.assign,h=Object.defineProperty,u=a([].concat);C.exports=!c||r(function(){if(p&&c({b:1},c(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},f={},w=Symbol("assign detection");return d[w]=7,"abcdefghijklmnopqrst".split("").forEach(function(x){f[x]=x}),c({},d)[w]!==7||t(c({},f)).join("")!=="abcdefghijklmnopqrst"})?function(d,f){for(var w=i(d),x=arguments.length,A=1,N=e.f,L=l.f;x>A;)for(var O,P=n(arguments[A++]),D=N?u(t(P),N(P)):t(P),U=D.length,B=0;U>B;)O=D[B++],p&&!o(L,P,O)||(w[O]=P[O]);return w}:c},{"../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(s,C,_){var p,a=s("../internals/an-object"),o=s("../internals/object-define-properties"),r=s("../internals/enum-bug-keys"),t=s("../internals/hidden-keys"),e=s("../internals/html"),l=s("../internals/document-create-element"),i=s("../internals/shared-key"),n=i("IE_PROTO"),c=function(){},h=function(f){return"