@node-projects/excelforge 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,421 @@
1
+ var Xt=class s{constructor(t){this.error=t}toString(){return this.error}static{this.NULL=new s("#NULL!")}static{this.DIV0=new s("#DIV/0!")}static{this.VALUE=new s("#VALUE!")}static{this.REF=new s("#REF!")}static{this.NAME=new s("#NAME?")}static{this.NUM=new s("#NUM!")}static{this.NA=new s("#N/A")}static{this.GETTING=new s("#GETTING_DATA")}};var $e=[];function Ct(s){if($e[s])return $e[s];let t="",e=s;for(;e>0;){let o=(e-1)%26;t=String.fromCharCode(65+o)+t,e=Math.floor((e-1)/26)}return $e[s]=t,t}function be(s){let t=0;for(let e=0;e<s.length;e++)t=t*26+(s.charCodeAt(e)-64);return t}function kt(s){let t=s.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!t)throw new Error(`Invalid cell ref: ${s}`);return{col:be(t[2]),row:parseInt(t[4],10)}}function Mt(s,t,e=!1){let o=e?"$":"";return`${o}${Ct(t)}${o}${s}`}function Pt(s){let[t,e]=s.split(":"),o=kt(t.replace(/\$/g,"")),r=e?kt(e.replace(/\$/g,"")):o;return{startRow:o.row,startCol:o.col,endRow:r.row,endCol:r.col}}var Os={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"},ye=/[&<>"']/g;function w(s){return ye.test(s)?(ye.lastIndex=0,s.replace(ye,t=>Os[t])):s}var Ns=new TextEncoder;function E(s){return Ns.encode(s)}function Fe(s,t=!1){let e=t?Date.UTC(1904,0,1):Date.UTC(1899,11,30),o=(s.getTime()-e)/864e5;return t||o>=60,o}function we(s){return Math.round(s*914400/96)}function Vt(s){let t=atob(s),e=new Uint8Array(t.length);for(let o=0;o<t.length;o++)e[o]=t.charCodeAt(o);return e}function js(s){let t=[];for(let e=0;e<s.length;e+=8192)t.push(String.fromCharCode.apply(null,s.subarray(e,e+8192)));return btoa(t.join(""))}function ze(s,t,e){let o=s.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!o)return s;let r=o[1]==="$",n=be(o[2]),a=o[3]==="$",i=parseInt(o[4],10),l=a?`R${i}`:i===t?"R":`R[${i-t}]`,d=r?`C${n}`:n===e?"C":`C[${n-e}]`;return l+d}function He(s,t,e){let o=s.match(/^R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?$/);if(!o)return s;let r,n,a,i;return o[3]!==void 0?(r=parseInt(o[3],10),n=!0):o[2]!==void 0?(r=t+parseInt(o[2],10),n=!1):(r=t,n=!1),o[6]!==void 0?(a=parseInt(o[6],10),i=!0):o[5]!==void 0?(a=e+parseInt(o[5],10),i=!1):(a=e,i=!1),`${i?"$":""}${Ct(a)}${n?"$":""}${r}`}function Es(s,t,e){return s.replace(/(\$?)([A-Z]+)(\$?)(\d+)/g,(o,r,n,a,i)=>ze(`${r}${n}${a}${i}`,t,e))}function Ms(s,t,e){return s.replace(/R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?/g,o=>He(o,t,e))}var ve=/[&<>]/g,Ls={"&":"&amp;","<":"&lt;",">":"&gt;"};function Ce(s){return ve.test(s)?(ve.lastIndex=0,s.replace(ve,t=>Ls[t])):s}function qe(s){if(s.startsWith("theme:")){let e=s.slice(6),o=e.indexOf(":tint:");if(o>=0){let r=e.slice(0,o),n=e.slice(o+6);return`<color theme="${r}" tint="${n}"/>`}return`<color theme="${e}"/>`}return`<color rgb="${s.startsWith("#")?"FF"+s.slice(1):s}"/>`}var Xs={average:101,count:102,countNums:103,max:104,min:105,stdDev:107,sum:109,var:110,vars:111},Ut=class{constructor(t,e={}){this.cells=new Map,this.merges=[],this.images=[],this.cellImages=[],this.charts=[],this.conditionalFormats=[],this.tables=[],this.pivotTables=[],this.sparklines=[],this.formControls=[],this.shapes=[],this.wordArt=[],this.queryTables=[],this.tableSlicers=[],this.mathEquations=[],this.oleObjects=[],this.colDefs=new Map,this.rowDefs=new Map,this.dataValidations=new Map,this.rowBreaks=[],this.colBreaks=[],this.preservedXml=[],this._nextSharedIdx=0,this._isChartSheet=!1,this._isDialogSheet=!1,this.sheetIndex=0,this.rId="",this.drawingRId="",this.legacyDrawingRId="",this.tableRIds=[],this.ctrlPropRIds=[],this.slicerRId="",this._slicerDrawingInfo=[],this._cellImageVm=new Map,this.ignoreErrors=[],this.oleRIds=[],this.oleIconRIds=[],this.name=t,this.options={...e,name:t}}markDirty(){this._workbook?.markDirty(this.name)}setActive(){this._workbook?.setActiveSheet(this.name)}getCell(t,e){let o=this.cells.get(t);o||(o=new Map,this.cells.set(t,o));let r=o.get(e);return r||(r={},o.set(e,r)),r}getCellByRef(t){let{row:e,col:o}=kt(t);return this.getCell(e,o)}setCell(t,e,o){let r=this.cells.get(t);return r||(r=new Map,this.cells.set(t,r)),r.set(e,o),this}setValue(t,e,o){let r=this.getCell(t,e);return delete r.formula,delete r.arrayFormula,delete r.richText,delete r._sharedIdx,delete r._sharedRef,delete r._dynamic,r.value=o,this}setFormula(t,e,o){let r=this.getCell(t,e);return delete r.arrayFormula,delete r.richText,delete r._sharedIdx,delete r._sharedRef,delete r._dynamic,r.formula=o,this}setDynamicArrayFormula(t,e,o){let r=this.getCell(t,e);return delete r.formula,delete r.richText,delete r._sharedIdx,delete r._sharedRef,r.arrayFormula=o,r._dynamic=!0,this}setSharedFormula(t,e,o,r){let n=this._nextSharedIdx++,a=this.getCell(t,e);a.formula=o,a._sharedRef=r,a._sharedIdx=n;let{startRow:i,startCol:l,endRow:d,endCol:m}=Pt(r);for(let c=i;c<=d;c++)for(let f=l;f<=m;f++){if(c===t&&f===e)continue;let h=this.getCell(c,f);h._sharedIdx=n}return this}setStyle(t,e,o){return this.getCell(t,e).style=o,this}writeArray(t,e,o){for(let r=0;r<o.length;r++)for(let n=0;n<o[r].length;n++)this.setValue(t+r,e+n,o[r][n]);return this}writeColumn(t,e,o){return o.forEach((r,n)=>this.setValue(t+n,e,r)),this}writeRow(t,e,o){return o.forEach((r,n)=>this.setValue(t,e+n,r)),this}setColumn(t,e){return this.colDefs.set(t,e),this}setColumnWidth(t,e){let o=this.colDefs.get(t)??{};return this.colDefs.set(t,{...o,width:e,customWidth:!0}),this}setRow(t,e){return this.rowDefs.set(t,e),this}setRowHeight(t,e){let o=this.rowDefs.get(t)??{};return this.rowDefs.set(t,{...o,height:e}),this}merge(t,e,o,r){return this.merges.push({startRow:t,startCol:e,endRow:o,endCol:r}),this}mergeByRef(t){let[e,o]=t.split(":"),r=kt(e),n=kt(o);return this.merge(r.row,r.col,n.row,n.col)}getMerges(){return this.merges}addImage(t){return this.images.push(t),this}getImages(){return this.images}addCellImage(t){return this.cellImages.push(t),this}getCellImages(){return this.cellImages}getComments(){let t=[];for(let[e,o]of this.cells)for(let[r,n]of o)n.comment&&t.push({row:e,col:r,comment:n.comment});return t}addChart(t){return this.charts.push(t),this}getCharts(){return this.charts}addConditionalFormat(t){return this.conditionalFormats.push(t),this}getConditionalFormats(){return this.conditionalFormats}getDataValidations(){return this.dataValidations}addTable(t){if(this.tables.push(t),t.totalsRow&&t.columns?.length){let{startRow:e,startCol:o,endRow:r}=Pt(t.ref),n=e+1,a=r-1;t.columns.forEach((i,l)=>{let d=o+l;if(i.totalsRowLabel)this.setValue(r,d,i.totalsRowLabel);else if(i.totalsRowFunction&&i.totalsRowFunction!=="none"){let m=Xs[i.totalsRowFunction];if(m!==void 0){let c=Ct(d);this.setFormula(r,d,`SUBTOTAL(${m},${c}${n}:${c}${a})`)}}})}return this}getTables(){return this.tables}addPivotTable(t){return this.pivotTables.push(t),this}getPivotTables(){return this.pivotTables}readRange(t){let{startRow:e,startCol:o,endRow:r,endCol:n}=Pt(t),a=[];for(let i=e;i<=r;i++){let l=[],d=this.cells.get(i);for(let m=o;m<=n;m++){let c=d?.get(m);l.push(c?.value??null)}a.push(l)}return a}readAllCells(){let t=[];for(let[e,o]of this.cells)for(let[r,n]of o)t.push({row:e,col:r,cell:n});return t}getUsedRange(){let t=1/0,e=0,o=1/0,r=0;for(let[n,a]of this.cells)for(let[i]of a)n<t&&(t=n),n>e&&(e=n),i<o&&(o=i),i>r&&(r=i);return e===0?null:{startRow:t,startCol:o,endRow:e,endCol:r}}getColumn(t){return this.colDefs.get(t)}getRow(t){return this.rowDefs.get(t)}insertRows(t,e){let o=[...this.cells.keys()].filter(n=>n>=t).sort((n,a)=>a-n);for(let n of o){let a=this.cells.get(n);this.cells.delete(n),this.cells.set(n+e,a)}let r=[...this.rowDefs.keys()].filter(n=>n>=t).sort((n,a)=>a-n);for(let n of r){let a=this.rowDefs.get(n);this.rowDefs.delete(n),this.rowDefs.set(n+e,a)}for(let n of this.merges)n.startRow>=t&&(n.startRow+=e),n.endRow>=t&&(n.endRow+=e);return this}deleteRows(t,e){for(let n=t;n<t+e;n++)this.cells.delete(n),this.rowDefs.delete(n);let o=[...this.cells.keys()].filter(n=>n>=t+e).sort((n,a)=>n-a);for(let n of o){let a=this.cells.get(n);this.cells.delete(n),this.cells.set(n-e,a)}let r=[...this.rowDefs.keys()].filter(n=>n>=t+e).sort((n,a)=>n-a);for(let n of r){let a=this.rowDefs.get(n);this.rowDefs.delete(n),this.rowDefs.set(n-e,a)}this.merges=this.merges.filter(n=>!(n.startRow>=t&&n.endRow<t+e));for(let n of this.merges)n.startRow>=t+e&&(n.startRow-=e),n.endRow>=t+e&&(n.endRow-=e);return this}insertColumns(t,e){for(let[,r]of this.cells){let n=[...r.keys()].filter(a=>a>=t).sort((a,i)=>i-a);for(let a of n){let i=r.get(a);r.delete(a),r.set(a+e,i)}}let o=[...this.colDefs.keys()].filter(r=>r>=t).sort((r,n)=>n-r);for(let r of o){let n=this.colDefs.get(r);this.colDefs.delete(r),this.colDefs.set(r+e,n)}for(let r of this.merges)r.startCol>=t&&(r.startCol+=e),r.endCol>=t&&(r.endCol+=e);return this}copyRange(t,e,o){let{startRow:r,startCol:n,endRow:a,endCol:i}=Pt(t);for(let l=r;l<=a;l++)for(let d=n;d<=i;d++){let m=this.getCell(l,d),c=e+(l-r),f=o+(d-n);m.value!=null&&this.setValue(c,f,m.value),m.formula&&this.setFormula(c,f,m.formula),m.style&&this.setStyle(c,f,{...m.style})}return this}moveRange(t,e,o){let{startRow:r,startCol:n,endRow:a,endCol:i}=Pt(t);this.copyRange(t,e,o);let l=e+(a-r),d=o+(i-n);for(let m=r;m<=a;m++)for(let c=n;c<=i;c++){let f=e+(m-r),h=o+(c-n);if(f===m&&h===c)continue;let p=this.cells.get(m);p&&p.delete(c)}return this}sortRange(t,e,o="asc"){let{startRow:r,startCol:n,endRow:a,endCol:i}=Pt(t),l=[];for(let d=r;d<=a;d++){let m=this.cells.get(d),c=new Map;for(let f=n;f<=i;f++){let h=m?.get(f);h&&c.set(f,{...h})}l.push({rowIdx:d,cells:c})}l.sort((d,m)=>{let c=d.cells.get(e)?.value,f=m.cells.get(e)?.value,h=typeof c=="number"||typeof c=="string"?c:"",p=typeof f=="number"||typeof f=="string"?f:"",x=0;return typeof h=="number"&&typeof p=="number"?x=h-p:x=String(h).localeCompare(String(p)),o==="desc"?-x:x});for(let d=0;d<l.length;d++){let m=r+d;for(let c=n;c<=i;c++){let f=l[d].cells.get(c),h=this.cells.get(m)??new Map;this.cells.has(m)||this.cells.set(m,h),f?h.set(c,f):h.delete(c)}}return this}fillNumber(t,e,o,r=0,n=1){for(let a=0;a<o;a++)this.setValue(t+a,e,r+a*n);return this}fillDate(t,e,o,r,n="day",a=1){for(let i=0;i<o;i++){let l=new Date(r);switch(n){case"day":l.setDate(l.getDate()+i*a);break;case"week":l.setDate(l.getDate()+i*a*7);break;case"month":l.setMonth(l.getMonth()+i*a);break;case"year":l.setFullYear(l.getFullYear()+i*a);break}this.setValue(t+i,e,l)}return this}fillList(t,e,o,r){for(let n=0;n<r;n++)this.setValue(t+n,e,o[n%o.length]);return this}autoFitColumns(t=8,e=60){let o=this.getUsedRange();if(!o)return this;for(let r=o.startCol;r<=o.endCol;r++){let n=0;for(let a=o.startRow;a<=o.endRow;a++){let i=this.cells.get(a)?.get(r);if(i?.value!=null){let l=String(i.value);l.length>n&&(n=l.length)}if(i?.richText){let l=i.richText.map(d=>d.text).join("");l.length>n&&(n=l.length)}}if(n>0){let a=Math.max(t,Math.min(e,n*1.2+2));this.setColumn(r,{...this.colDefs.get(r)??{},width:a,customWidth:!0})}}return this}duplicateRow(t,e){this.insertRows(e,1);let o=this.cells.get(t>=e?t+1:t);if(o){let n=new Map;for(let[a,i]of o)n.set(a,{...i,style:i.style?{...i.style}:void 0});this.cells.set(e,n)}let r=this.rowDefs.get(t>=e?t+1:t);return r&&this.rowDefs.set(e,{...r}),this}spliceRows(t,e,o){if(e>0&&this.deleteRows(t,e),o&&o.length>0){this.insertRows(t,o.length);for(let r=0;r<o.length;r++)this.writeRow(t+r,1,o[r])}return this}setAutoFilter(t,e){return this.autoFilter={ref:t},e?.columns&&(this._filterColumns=e.columns),this}addSparkline(t){return this.sparklines.push(t),this}getSparklines(){return this.sparklines}addDataValidation(t,e){return this.dataValidations.set(t,e),this}addRowBreak(t,e=!0){return this.rowBreaks.push({id:t,manual:e}),this}addColBreak(t,e=!0){return this.colBreaks.push({id:t,manual:e}),this}getRowBreaks(){return this.rowBreaks}getColBreaks(){return this.colBreaks}addFormControl(t){if(!t.to&&(t.width||t.height)){let r=t.width??100,n=t.height??30,a=t.from.col+r/64,i=t.from.row+n/20;t={...t,to:{col:Math.floor(a),row:Math.floor(i),colOff:Math.round(a%1*64),rowOff:Math.round(i%1*20)}}}return this.formControls.push(t),this}getFormControls(){return this.formControls}addShape(t){return this.shapes.push(t),this}getShapes(){return this.shapes}addOleObject(t){return this.oleObjects.push(t),this}getOleObjects(){return this.oleObjects}addWordArt(t){return this.wordArt.push(t),this}getWordArt(){return this.wordArt}addQueryTable(t){return this.queryTables.push(t),this}getQueryTables(){return this.queryTables}addTableSlicer(t){return this.tableSlicers.push(t),this}getTableSlicers(){return this.tableSlicers}addMathEquation(t){return this.mathEquations.push(t),this}getMathEquations(){return this.mathEquations}addIgnoredError(t,e){return this.ignoreErrors.push({sqref:t,...e}),this}getIgnoredErrors(){return this.ignoreErrors}addPreservedXml(t){return this.preservedXml.push(t),this}freeze(t,e){return this.freezePane={row:t,col:e},this}toXml(t,e){let o=this.pageSetup?.fitToPage,r=this.options?.tabColor,n=o||r?`<sheetPr>${r?`<tabColor rgb="${r}"/>`:""}${o?'<pageSetUpPr fitToPage="1"/>':""}</sheetPr>`:"",a=this._sheetViewXml(),i=this._colsXml(t),l=this._sheetDataXml(t,e),d=this._mergesXml(),m=this._conditionalFormatXml(t),c=this._dataValidationsXml(),f=this.autoFilter&&!this.tables.some(A=>A.ref===this.autoFilter.ref)?this._autoFilterXml():"",h=this.tables.length?`<tableParts count="${this.tables.length}">${this.tableRIds.map(A=>`<tablePart r:id="${A}"/>`).join("")}</tableParts>`:"",p=this.drawingRId?`<drawing r:id="${this.drawingRId}"/>`:"",x=this.legacyDrawingRId?`<legacyDrawing r:id="${this.legacyDrawingRId}"/>`:"",g=this._formControlsXml(),$=this._oleObjectsXml(),b=this._sparklineXml(),k=this._customIconExtXml(),P=this.slicerRId?`<extLst><ext uri="{A8765BA9-456A-4dab-B4F3-ACF838C121DE}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerList><x14:slicer r:id="${this.slicerRId}"/></x14:slicerList></ext></extLst>`:"",I=this._ignoredErrorsXml(),v=this._protectionXml(),y=this._pageSetupXml(),O=this._pageMarginsXml(),S=this._headerFooterXml(),_=this._printOptionsXml(),R=this._pageBreaksXml("rowBreaks",this.rowBreaks,16383),M=this._pageBreaksXml("colBreaks",this.colBreaks,1048575);return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
3
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
4
+ xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
5
+ xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
6
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
+ xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
8
+ ${n}
9
+ ${a}
10
+ ${i}
11
+ ${l}
12
+ ${v}
13
+ ${f}
14
+ ${d}
15
+ ${m}
16
+ ${c}
17
+ ${_}
18
+ ${O}
19
+ ${y}
20
+ ${S}
21
+ ${R}
22
+ ${M}
23
+ ${I}
24
+ ${p}
25
+ ${x}
26
+ ${$}
27
+ ${g}
28
+ ${b}
29
+ ${k}
30
+ ${h}
31
+ ${P}
32
+ ${this.preservedXml.join(`
33
+ `)}
34
+ </worksheet>`}toChartSheetXml(){let t=this._pageMarginsXml(),e=this._pageSetupXml();return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
35
+ <chartsheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
36
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
37
+ <sheetPr/>
38
+ <sheetViews><sheetView zoomScale="99" workbookViewId="0" zoomToFit="1"/></sheetViews>
39
+ ${t||'<pageMargins left="0.7" right="0.7" top="0.78740157499999996" bottom="0.78740157499999996" header="0.3" footer="0.3"/>'}
40
+ ${e}
41
+ <drawing r:id="${this.drawingRId}"/>
42
+ </chartsheet>`}toDialogSheetXml(t,e){let o=this._pageMarginsXml(),r=this.legacyDrawingRId?`<legacyDrawing r:id="${this.legacyDrawingRId}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
43
+ <dialogsheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
44
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
45
+ <sheetViews><sheetView showRowColHeaders="0" showZeros="0" showOutlineSymbols="0" workbookViewId="0"/></sheetViews>
46
+ <sheetFormatPr baseColWidth="10" defaultColWidth="1" defaultRowHeight="5.65" customHeight="1"/>
47
+ <sheetProtection sheet="1"/>
48
+ ${o||'<pageMargins left="0.7" right="0.7" top="0.78740157499999996" bottom="0.78740157499999996" header="0.3" footer="0.3"/>'}
49
+ ${r}
50
+ </dialogsheet>`}_sheetViewXml(){let t=this.view??{},e=['workbookViewId="0"',t.showGridLines===!1?'showGridLines="0"':"",t.showRowColHeaders===!1?'showRowColHeaders="0"':"",t.zoomScale!==void 0?`zoomScale="${t.zoomScale}"`:"",t.rightToLeft?'rightToLeft="1"':"",t.tabSelected?'tabSelected="1"':"",t.view?`view="${t.view}"`:""].filter(Boolean),o="";if(this.freezePane){let{row:r=0,col:n=0}=this.freezePane,a=r&&n?Mt(r+1,n+1):r?Mt(r+1,1):Mt(1,n+1),i=r&&n?"bottomRight":r?"bottomLeft":"topRight";o=`<pane xSplit="${n}" ySplit="${r}" topLeftCell="${a}" activePane="${i}" state="frozen"/>
51
+ <selection pane="${i}" activeCell="${a}" sqref="${a}"/>`}return`<sheetViews><sheetView ${e.join(" ")}>${o}</sheetView></sheetViews>`}_colsXml(t){return this.colDefs.size?`<cols>${[...this.colDefs.entries()].sort((r,n)=>r[0]-n[0]).map(([r,n])=>{let a=n.style?t.register(n.style):0;return`<col min="${r}" max="${r}"`+(n.width?` width="${n.width}" customWidth="1"`:"")+(n.hidden?' hidden="1"':"")+(n.bestFit?' bestFit="1"':"")+(n.outlineLevel?` outlineLevel="${n.outlineLevel}"`:"")+(n.collapsed?' collapsed="1"':"")+(a?` style="${a}"`:"")+"/>"}).join("")}</cols>`:""}_sheetDataXml(t,e){let o=[...this.cells.entries()].sort((n,a)=>n[0]-a[0]),r=["<sheetData>"];for(let n=0;n<o.length;n++){let[a,i]=o[n],l=this.rowDefs.get(a),d=l?.style?t.register(l.style):0,m=`r="${a}"`;l?.height&&(m+=` ht="${l.height}" customHeight="1"`),l?.hidden&&(m+=' hidden="1"'),l?.outlineLevel&&(m+=` outlineLevel="${l.outlineLevel}"`),l?.collapsed&&(m+=' collapsed="1"'),d&&(m+=` s="${d}" customFormat="1"`),l?.thickTop&&(m+=' thickTop="1"'),l?.thickBot&&(m+=' thickBot="1"'),r.push(`<row ${m}>`);let c=[...i.entries()].sort((f,h)=>f[0]-h[0]);for(let f=0;f<c.length;f++)r.push(this._cellXml(a,c[f][0],c[f][1],t,e));r.push("</row>")}return r.push("</sheetData>"),r.join("")}_cellXml(t,e,o,r,n){let a=`${Ct(e)}${t}`,i=o.style?r.register(o.style):0,l=i?` s="${i}"`:"",d=this._cellImageVm.get(a),m=d!==void 0?` vm="${d}"`:"";if(o.arrayFormula){let h=`<f t="array" ref="${a}">${Ce(o.arrayFormula)}</f>`;return`<c r="${a}"${l}${m}>${h}<v>0</v></c>`}if(o._sharedIdx!==void 0){let h=o._sharedIdx,p=o._sharedRef;if(o.formula&&p){let x=`<f t="shared" ref="${p}" si="${h}">${Ce(o.formula)}</f>`;return`<c r="${a}"${l}${m}>${x}</c>`}return`<c r="${a}"${l}${m}><f t="shared" si="${h}"/></c>`}if(o.formula){let h=`<f>${Ce(o.formula)}</f>`;return`<c r="${a}"${l}${m}>${h}</c>`}if(o.richText){let h=n.internRichText(o.richText);return`<c r="${a}" t="s"${l}${m}><v>${h}</v></c>`}let c=o.value;if(c==null)return m?`<c r="${a}"${l} t="e"${m}><v>#VALUE!</v></c>`:i?`<c r="${a}"${l}/>`:"";if(c instanceof Xt)return`<c r="${a}" t="e"${l}${m}><v>${w(c.error)}</v></c>`;if(typeof c=="boolean")return`<c r="${a}" t="b"${l}${m}><v>${c?1:0}</v></c>`;if(c instanceof Date){let h=Fe(c);return`<c r="${a}"${l}${m}><v>${h}</v></c>`}if(typeof c=="number")return`<c r="${a}"${l}${m}><v>${c}</v></c>`;let f=n.intern(c);return`<c r="${a}" t="s"${l}${m}><v>${f}</v></c>`}_mergesXml(){if(!this.merges.length)return"";let t=this.merges.map(e=>{let o=`${Ct(e.startCol)}${e.startRow}`,r=`${Ct(e.endCol)}${e.endRow}`;return`<mergeCell ref="${o}:${r}"/>`});return`<mergeCells count="${this.merges.length}">${t.join("")}</mergeCells>`}_conditionalFormatXml(t){return this.conditionalFormats.map(e=>{let o=e.style?t.registerDxf(e.style):void 0,r="";if(e.colorScale?.type==="colorScale"){let l=e.colorScale,d=l.cfvo.map(c=>`<cfvo type="${c.type}"${c.val?` val="${c.val}"`:""}/>`).join(""),m=l.color.map(c=>qe(c)).join("");r=`<colorScale>${d}${m}</colorScale>`}else if(e.dataBar?.type==="dataBar"){let l=e.dataBar,d=`<cfvo type="${l.minType??"min"}"${l.minVal!=null?` val="${l.minVal}"`:""}/>`,m=`<cfvo type="${l.maxType??"max"}"${l.maxVal!=null?` val="${l.maxVal}"`:""}/>`,c=l.color??l.minColor??"FF638EC6";r=`<dataBar${l.showValue===!1?' showValue="0"':""}>${d}${m}${qe(c)}</dataBar>`}else if(e.iconSet?.type==="iconSet"){let l=e.iconSet,d=l.cfvo.map(m=>`<cfvo type="${m.type}"${m.val?` val="${m.val}"`:""}/>`).join("");r=`<iconSet iconSet="${l.iconSet}"${l.showValue===!1?' showValue="0"':""}${l.reverse?' reverse="1"':""}>${d}</iconSet>`}let n=[`type="${e.type}"`,e.operator?`operator="${e.operator}"`:"",o!==void 0?`dxfId="${o}"`:"",`priority="${e.priority??1}"`,e.aboveAverage===!1?'aboveAverage="0"':"",e.percent?'percent="1"':"",e.rank?`rank="${e.rank}"`:"",e.timePeriod?`timePeriod="${e.timePeriod}"`:"",e.text?`text="${w(e.text)}"`:""].filter(Boolean).join(" "),a=e.formula?`<formula>${w(e.formula)}</formula>`:"",i=e.formula2?`<formula>${w(e.formula2)}</formula>`:"";return`<conditionalFormatting sqref="${e.sqref}"><cfRule ${n}>${a}${i}${r}</cfRule></conditionalFormatting>`}).join("")}_dataValidationsXml(){if(!this.dataValidations.size)return"";let t=[...this.dataValidations.entries()].map(([e,o])=>{let r=o.type==="list"&&o.list?`<formula1>"${o.list.join(",")}"</formula1>`:o.formula1?`<formula1>${w(o.formula1)}</formula1>`:"",n=o.formula2?`<formula2>${w(o.formula2)}</formula2>`:"";return`<dataValidation ${[`type="${o.type}"`,o.operator?`operator="${o.operator}"`:"",`sqref="${e}"`,o.showDropDown!==!1&&o.type==="list"?"":'showDropDown="1"',o.allowBlank!==!1?'allowBlank="1"':"",o.showErrorAlert?'showErrorMessage="1"':"",o.errorTitle?`errorTitle="${w(o.errorTitle)}"`:"",o.error?`error="${w(o.error)}"`:"",o.showInputMessage?'showInputMessage="1"':"",o.promptTitle?`promptTitle="${w(o.promptTitle)}"`:"",o.prompt?`prompt="${w(o.prompt)}"`:""].filter(Boolean).join(" ")}>${r}${n}</dataValidation>`});return`<dataValidations count="${this.dataValidations.size}">${t.join("")}</dataValidations>`}_protectionXml(){let t=this.protection;return t?`<sheetProtection ${[t.sheet?'sheet="1"':"",t.password?`password="${Vs(t.password)}"`:"",t.selectLockedCells===!1?'selectLockedCells="0"':"",t.selectUnlockedCells===!1?'selectUnlockedCells="0"':"",t.formatCells?'formatCells="0"':"",t.formatColumns?'formatColumns="0"':"",t.formatRows?'formatRows="0"':"",t.insertColumns?'insertColumns="0"':"",t.insertRows?'insertRows="0"':"",t.insertHyperlinks?'insertHyperlinks="0"':"",t.deleteColumns?'deleteColumns="0"':"",t.deleteRows?'deleteRows="0"':"",t.sort?'sort="0"':"",t.autoFilter?'autoFilter="0"':"",t.pivotTables?'pivotTables="0"':""].filter(Boolean).join(" ")}/>`:""}_pageSetupXml(){let t=this.pageSetup;return t?`<pageSetup ${[t.paperSize?`paperSize="${t.paperSize}"`:"",t.orientation?`orientation="${t.orientation}"`:"",t.fitToWidth!==void 0?`fitToWidth="${t.fitToWidth}"`:"",t.fitToHeight!==void 0?`fitToHeight="${t.fitToHeight}"`:"",t.scale?`scale="${t.scale}"`:"",t.horizontalDpi?`horizontalDpi="${t.horizontalDpi}"`:"",t.verticalDpi?`verticalDpi="${t.verticalDpi}"`:"",t.firstPageNumber?`firstPageNumber="${t.firstPageNumber}" useFirstPageNumber="1"`:""].filter(Boolean).join(" ")}/>`:""}_pageMarginsXml(){let t=this.pageMargins,o={...{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},...t};return`<pageMargins left="${o.left}" right="${o.right}" top="${o.top}" bottom="${o.bottom}" header="${o.header}" footer="${o.footer}"/>`}_headerFooterXml(){let t=this.headerFooter;if(!t)return"";let e=[t.differentOddEven?'differentOddEven="1"':"",t.differentFirst?'differentFirst="1"':""].filter(Boolean).join(" "),o=t.oddHeader?`<oddHeader>${w(t.oddHeader)}</oddHeader>`:"",r=t.oddFooter?`<oddFooter>${w(t.oddFooter)}</oddFooter>`:"",n=t.evenHeader?`<evenHeader>${w(t.evenHeader)}</evenHeader>`:"",a=t.evenFooter?`<evenFooter>${w(t.evenFooter)}</evenFooter>`:"",i=t.firstHeader?`<firstHeader>${w(t.firstHeader)}</firstHeader>`:"",l=t.firstFooter?`<firstFooter>${w(t.firstFooter)}</firstFooter>`:"";return`<headerFooter${e?" "+e:""}>${o}${r}${n}${a}${i}${l}</headerFooter>`}_printOptionsXml(){let t=this.printOptions;if(!t)return"";let e=[t.gridLines?'gridLines="1"':"",t.gridLinesSet?'gridLinesSet="1"':"",t.headings?'headings="1"':"",t.centerHorizontal?'horizontalCentered="1"':"",t.centerVertical?'verticalCentered="1"':""].filter(Boolean).join(" ");return e?`<printOptions ${e}/>`:""}_pageBreaksXml(t,e,o){if(!e.length)return"";let r=e.filter(a=>a.manual!==!1).length,n=e.map(a=>`<brk id="${a.id}" max="${o}"${a.manual!==!1?' man="1"':""}/>`).join("");return`<${t} count="${e.length}" manualBreakCount="${r}">${n}</${t}>`}_formControlsXml(){if(!this.formControls.length||!this.ctrlPropRIds.length)return"";let t=1025+this.sheetIndex*1e3,e=0;for(let r of this.cells.values())for(let n of r.values())n.comment&&e++;return`<mc:AlternateContent><mc:Choice Requires="x14"><controls>${this.formControls.map((r,n)=>{let a=r._shapeId??t+e+n,i=this.ctrlPropRIds[n];if(!i)return"";let l=r.text??`${r.type} ${n+1}`;return`<mc:AlternateContent><mc:Choice Requires="x14"><control shapeId="${a}" r:id="${i}" name="${w(l)}"><controlPr defaultSize="0" print="0" autoFill="0" autoPict="0"${r.macro?` macro="${w(r.macro)}"`:""}><anchor moveWithCells="1"><from><xdr:col>${r.from.col}</xdr:col><xdr:colOff>${r.from.colOff??0}</xdr:colOff><xdr:row>${r.from.row}</xdr:row><xdr:rowOff>${r.from.rowOff??0}</xdr:rowOff></from><to><xdr:col>${r.to.col}</xdr:col><xdr:colOff>${r.to.colOff??0}</xdr:colOff><xdr:row>${r.to.row}</xdr:row><xdr:rowOff>${r.to.rowOff??0}</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>`}).join("")}</controls></mc:Choice></mc:AlternateContent>`}_oleObjectsXml(){if(!this.oleObjects.length||!this.oleRIds.length)return"";let t=2025+this.sheetIndex*1e3;return`<oleObjects>${this.oleObjects.map((o,r)=>{let n=t+r,a=this.oleRIds[r],i=o.progId??"Package",l=o.linkToFile&&o.linkPath?` link="${w(o.linkPath)}"`:"";return`<oleObject progId="${w(i)}" shapeId="${n}" r:id="${a}"${l}/>`}).join("")}</oleObjects>`}_sparklineXml(){if(!this.sparklines.length)return"";let t=(r,n)=>{if(!n)return"";let a=n.startsWith("#")?"FF"+n.slice(1):n;return`<x14:${r} rgb="${a}"/>`};return`<extLst><ext uri="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${`<x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">${this.sparklines.map(r=>{let a=[`type="${r.type==="bar"?"column":r.type}"`,r.lineWidth!==void 0?`lineWeight="${r.lineWidth}"`:"",r.showMarkers?'markers="1"':"",r.showFirst?'first="1"':"",r.showLast?'last="1"':"",r.showHigh?'high="1"':"",r.showLow?'low="1"':"",r.showNegative?'negative="1"':"",r.minAxisType?`minAxisType="${r.minAxisType}"`:"",r.maxAxisType?`maxAxisType="${r.maxAxisType}"`:""].filter(Boolean).join(" "),i=[t("colorSeries",r.color),t("colorHigh",r.highColor),t("colorLow",r.lowColor),t("colorFirst",r.firstColor),t("colorLast",r.lastColor),t("colorNegative",r.negativeColor),t("colorMarkers",r.markersColor)].join(""),l=r.dataRange.includes("!")?r.dataRange:`${this.name}!${r.dataRange}`,d=`<x14:sparklines><x14:sparkline><xm:f>${w(l)}</xm:f><xm:sqref>${r.location}</xm:sqref></x14:sparkline></x14:sparklines>`;return`<x14:sparklineGroup ${a}>${i}${d}</x14:sparklineGroup>`}).join("")}</x14:sparklineGroups>`}</ext></extLst>`}_customIconExtXml(){let t=this.conditionalFormats.filter(o=>o.iconSet?.type==="iconSet"&&"custom"in o.iconSet&&o.iconSet.custom?.length);return t.length?`<extLst><ext uri="{78C0D931-6437-407d-A8EE-F0AAD7539E65}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${t.map((o,r)=>{let n=o.iconSet,a=n.cfvo.map(l=>`<x14:cfvo type="${l.type}"${l.val?` val="${l.val}"`:""}/>`).join(""),i=n.custom.map(l=>`<x14:cfIcon iconSet="${l.iconSet}" iconId="${l.iconId}"/>`).join("");return`<x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"><x14:cfRule type="iconSet" id="{${this._uuid()}}"><x14:iconSet iconSet="${n.iconSet}" custom="1"${n.showValue===!1?' showValue="0"':""}${n.reverse?' reverse="1"':""}>${a}${i}</x14:iconSet></x14:cfRule><xm:sqref>${o.sqref}</xm:sqref></x14:conditionalFormatting>`}).join("")}</ext></extLst>`:""}_uuid(){let t="0123456789ABCDEF",e="";for(let o=0;o<36;o++)o===8||o===13||o===18||o===23?e+="-":o===14?e+="4":o===19?e+=t[(Math.random()*4|0)+8]:e+=t[Math.random()*16|0];return e}_autoFilterXml(){if(!this.autoFilter)return"";let t=this._filterColumns;if(!t||t.length===0)return`<autoFilter ref="${this.autoFilter.ref}"/>`;let e=t.map(o=>{let r=o.col-1,n="";return o.type==="custom"?n=`<customFilters><customFilter operator="${o.operator??"greaterThan"}" val="${o.val??""}"/></customFilters>`:o.type==="top10"?n=`<top10 ${[o.top===!1?'top="0"':"",o.percent?'percent="1"':"",`val="${o.val??10}"`].filter(Boolean).join(" ")}/>`:o.type==="value"&&o.items?n=`<filters>${o.items.map(a=>`<filter val="${w(String(a))}"/>`).join("")}</filters>`:o.type==="dynamic"&&(n=`<dynamicFilter type="${o.dynamicType??"aboveAverage"}"/>`),`<filterColumn colId="${r}">${n}</filterColumn>`}).join("");return`<autoFilter ref="${this.autoFilter.ref}">${e}</autoFilter>`}_ignoredErrorsXml(){return this.ignoreErrors.length?`<ignoredErrors>${this.ignoreErrors.map(e=>{let o=[`sqref="${e.sqref}"`];return e.numberStoredAsText&&o.push('numberStoredAsText="1"'),e.formula&&o.push('formula="1"'),e.formulaRange&&o.push('formulaRange="1"'),e.unlockedFormula&&o.push('unlockedFormula="1"'),e.evalError&&o.push('evalError="1"'),e.twoDigitTextYear&&o.push('twoDigitTextYear="1"'),e.emptyRef&&o.push('emptyRef="1"'),e.listDataValidation&&o.push('listDataValidation="1"'),e.calculatedColumn&&o.push('calculatedColumn="1"'),`<ignoredError ${o.join(" ")}/>`}).join("")}</ignoredErrors>`:""}toDrawingXml(t,e){let o=[],r=we;this.images.forEach((i,l)=>{let d=t[l],m=r(i.width??100),c=r(i.height??100),f,h;if(i.position)f=`<xdr:absoluteAnchor><xdr:pos x="${r(i.position.x)}" y="${r(i.position.y)}"/><xdr:ext cx="${m}" cy="${c}"/>`,h="</xdr:absoluteAnchor>";else{let x=i.from,g=i.to,$=`<xdr:from><xdr:col>${x.col}</xdr:col><xdr:colOff>${x.colOff??0}</xdr:colOff><xdr:row>${x.row}</xdr:row><xdr:rowOff>${x.rowOff??0}</xdr:rowOff></xdr:from>`;if(g){let b=`<xdr:to><xdr:col>${g.col}</xdr:col><xdr:colOff>${g.colOff??0}</xdr:colOff><xdr:row>${g.row}</xdr:row><xdr:rowOff>${g.rowOff??0}</xdr:rowOff></xdr:to>`;f=`<xdr:twoCellAnchor editAs="oneCell">${$}${b}`,h="</xdr:twoCellAnchor>"}else f=`<xdr:oneCellAnchor>${$}<xdr:ext cx="${m}" cy="${c}"/>`,h="</xdr:oneCellAnchor>"}let p=`<xdr:pic>
52
+ <xdr:nvPicPr>
53
+ <xdr:cNvPr id="${l+2}" name="Image ${l+1}"${i.altText?` descr="${w(i.altText)}"`:""}/>
54
+ <xdr:cNvPicPr><a:picLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></xdr:cNvPicPr>
55
+ </xdr:nvPicPr>
56
+ <xdr:blipFill>
57
+ <a:blip xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" r:embed="${d}"/>
58
+ <a:stretch xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:fillRect/></a:stretch>
59
+ </xdr:blipFill>
60
+ <xdr:spPr>
61
+ <a:xfrm xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
62
+ <a:off x="0" y="0"/><a:ext cx="${m}" cy="${c}"/>
63
+ </a:xfrm>
64
+ <a:prstGeom xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" prst="rect"><a:avLst/></a:prstGeom>
65
+ </xdr:spPr>
66
+ </xdr:pic>`;o.push(`${f}${p}<xdr:clientData/>${h}`)}),this.charts.forEach((i,l)=>{let d=e[l],m=i.from,c=i.to,f=`<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
67
+ <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
68
+ <c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${d}"/>
69
+ </a:graphicData>
70
+ </a:graphic>`;if(this._isChartSheet)o.push(`<xdr:absoluteAnchor><xdr:pos x="0" y="0"/><xdr:ext cx="9294091" cy="6003636"/><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noGrp="1"/></xdr:cNvGraphicFramePr></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${f}</xdr:graphicFrame><xdr:clientData/></xdr:absoluteAnchor>`);else{let h=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,p=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`;o.push(`<xdr:twoCellAnchor editAs="oneCell">${h}${p}<xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${f}</xdr:graphicFrame><xdr:clientData/></xdr:twoCellAnchor>`)}});let n=this.images.length+this.charts.length+2,a=i=>{let l=i.replace(/^#/,"");return l.length===8&&(l=l.substring(2)),l};this.shapes.forEach(i=>{let l=n++,d=i.from,m=i.to,c=`<xdr:from><xdr:col>${d.col}</xdr:col><xdr:colOff>${d.colOff??0}</xdr:colOff><xdr:row>${d.row}</xdr:row><xdr:rowOff>${d.rowOff??0}</xdr:rowOff></xdr:from>`,f=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,h=i.fillColor?`<a:solidFill><a:srgbClr val="${a(i.fillColor)}"/></a:solidFill>`:"<a:noFill/>",p=i.lineColor?`<a:ln${i.lineWidth?` w="${i.lineWidth*12700}"`:""}><a:solidFill><a:srgbClr val="${a(i.lineColor)}"/></a:solidFill></a:ln>`:"",x=i.rotation?` rot="${i.rotation*6e4}"`:"",g=i.text?`<xdr:txBody><a:bodyPr vertOverflow="clip" wrap="square" rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US"${i.font?.bold?' b="1"':""}${i.font?.size?` sz="${i.font.size*100}"`:""}/><a:t>${w(i.text)}</a:t></a:r></a:p></xdr:txBody>`:"";o.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${f}<xdr:sp><xdr:nvSpPr><xdr:cNvPr id="${l}" name="Shape ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm${x}><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="${i.type}"><a:avLst/></a:prstGeom>${h}${p}</xdr:spPr>${g}</xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.wordArt.forEach(i=>{let l=n++,d=i.from,m=i.to,c=`<xdr:from><xdr:col>${d.col}</xdr:col><xdr:colOff>${d.colOff??0}</xdr:colOff><xdr:row>${d.row}</xdr:row><xdr:rowOff>${d.rowOff??0}</xdr:rowOff></xdr:from>`,f=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,h=i.preset??"textPlain",p=i.font?.size?i.font.size*100:3600,x=i.fillColor?a(i.fillColor):"",g=i.outlineColor?a(i.outlineColor):"",$=x?`<a:solidFill><a:srgbClr val="${x}"/></a:solidFill>`:'<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>',b=g?`<a:ln w="12700"><a:solidFill><a:srgbClr val="${g}"/></a:solidFill><a:prstDash val="solid"/></a:ln>`:"",k='<a:effectLst><a:outerShdw dist="38100" dir="2700000" algn="bl" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>',P=['lang="en-US"',`sz="${p}"`,(i.font?.bold,'b="1"'),i.font?.italic?'i="1"':"",'cap="none" spc="0"'].filter(Boolean).join(" "),I=i.font?.name??"Calibri",v=h!=="textPlain"?`<a:prstTxWarp prst="${h}"><a:avLst/></a:prstTxWarp>`:"";o.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${f}<xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="WordArt ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr wrap="square" lIns="91440" tIns="45720" rIns="91440" bIns="45720">${v}<a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr ${P}>${b}${$}${k}<a:latin typeface="${w(I)}"/></a:rPr><a:t>${w(i.text)}</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.mathEquations.forEach(i=>{let l=n++,d=i.from,m=`<xdr:from><xdr:col>${d.col}</xdr:col><xdr:colOff>${d.colOff??0}</xdr:colOff><xdr:row>${d.row}</xdr:row><xdr:rowOff>${d.rowOff??0}</xdr:rowOff></xdr:from>`,c=i.width??18e5,f=i.height??5e5,h=`<xdr:ext cx="${c}" cy="${f}"/>`,p=i.fontSize?i.fontSize*100:1100,x=i.fontName??"Cambria Math",g=`<a:rPr lang="en-US" sz="${p}" i="1"><a:latin typeface="${w(x)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr>`,$=`<m:ctrlPr>${g}</m:ctrlPr>`,b=y=>{switch(y.type){case"text":return`<m:r>${g}<m:t>${w(y.text??"")}</m:t></m:r>`;case"frac":return`<m:f><m:fPr>${y.hideDegree?'<m:type m:val="noBar"/>':""}${$}</m:fPr><m:num>${(y.base??[]).map(b).join("")}</m:num><m:den>${(y.argument??[]).map(b).join("")}</m:den></m:f>`;case"sup":return`<m:sSup><m:sSupPr>${$}</m:sSupPr><m:e>${(y.base??[]).map(b).join("")}</m:e><m:sup>${(y.argument??[]).map(b).join("")}</m:sup></m:sSup>`;case"sub":return`<m:sSub><m:sSubPr>${$}</m:sSubPr><m:e>${(y.base??[]).map(b).join("")}</m:e><m:sub>${(y.argument??[]).map(b).join("")}</m:sub></m:sSub>`;case"subSup":return`<m:sSubSup><m:sSubSupPr>${$}</m:sSubSupPr><m:e>${(y.base??[]).map(b).join("")}</m:e><m:sub>${(y.subscript??[]).map(b).join("")}</m:sub><m:sup>${(y.superscript??[]).map(b).join("")}</m:sup></m:sSubSup>`;case"nary":{let O=y.operator??"\u2211";return`<m:nary><m:naryPr><m:chr m:val="${w(O)}"/>${$}</m:naryPr><m:sub>${(y.lower??[]).map(b).join("")}</m:sub><m:sup>${(y.upper??[]).map(b).join("")}</m:sup><m:e>${(y.body??[]).map(b).join("")}</m:e></m:nary>`}case"rad":return`<m:rad><m:radPr>${y.hideDegree?'<m:degHide m:val="1"/>':""}${$}</m:radPr><m:deg>${(y.degree??[]).map(b).join("")}</m:deg><m:e>${(y.body??[]).map(b).join("")}</m:e></m:rad>`;case"delim":{let O=y.open??"(",S=y.close??")";return`<m:d><m:dPr>${O!=="("?`<m:begChr m:val="${w(O)}"/>`:""}${S!==")"?`<m:endChr m:val="${w(S)}"/>`:""}${$}</m:dPr><m:e>${(y.body??[]).map(b).join("")}</m:e></m:d>`}case"func":return`<m:func><m:funcPr>${$}</m:funcPr><m:fName>${(y.base??[]).map(b).join("")}</m:fName><m:e>${(y.argument??[]).map(b).join("")}</m:e></m:func>`;case"accent":return`<m:acc><m:accPr>${y.operator?`<m:chr m:val="${w(y.operator)}"/>`:""}${$}</m:accPr><m:e>${(y.body??[]).map(b).join("")}</m:e></m:acc>`;case"bar":return`<m:bar><m:barPr>${$}</m:barPr><m:e>${(y.body??[]).map(b).join("")}</m:e></m:bar>`;case"matrix":return`<m:m><m:mPr>${$}</m:mPr>${(y.rows??[]).map(O=>`<m:mr>${O.map(S=>`<m:e>${b(S)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;case"eqArr":return`<m:eqArr><m:eqArrPr>${$}</m:eqArrPr>${(y.rows??[]).map(O=>`<m:e>${O.map(b).join("")}</m:e>`).join("")}</m:eqArr>`;case"limLow":return`<m:limLow><m:limLowPr>${$}</m:limLowPr><m:e>${(y.base??[]).map(b).join("")}</m:e><m:lim>${(y.argument??[]).map(b).join("")}</m:lim></m:limLow>`;case"limUpp":return`<m:limUpp><m:limUppPr>${$}</m:limUppPr><m:e>${(y.base??[]).map(b).join("")}</m:e><m:lim>${(y.argument??[]).map(b).join("")}</m:lim></m:limUpp>`;case"groupChar":return`<m:groupChr><m:groupChrPr>${y.operator?`<m:chr m:val="${w(y.operator)}"/>`:""}${$}</m:groupChrPr><m:e>${(y.body??[]).map(b).join("")}</m:e></m:groupChr>`;default:return`<m:r>${g}<m:t>${w(y.text??"")}</m:t></m:r>`}},P=`<m:oMathPara xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><m:oMathParaPr><m:jc m:val="centerGroup"/></m:oMathParaPr><m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${i.elements.map(b).join("")}</m:oMath></m:oMathPara>`,I=y=>{if(y.text)return y.text;let O=[y.base,y.argument,y.body,y.lower,y.upper,y.superscript,y.subscript,y.degree].filter(Boolean).map(S=>S.map(I).join("")).join("");return y.type==="frac"?`(${(y.base??[]).map(I).join("")})/(${(y.argument??[]).map(I).join("")})`:y.type==="sup"?`${(y.base??[]).map(I).join("")}^${(y.argument??[]).map(I).join("")}`:y.type==="nary"?`${y.operator??"\u2211"}(${(y.body??[]).map(I).join("")})`:y.type==="delim"?`${y.open??"("}${(y.body??[]).map(I).join("")}${y.close??")"}`:y.type==="rad"?`\u221A(${(y.body??[]).map(I).join("")})`:O},v=i.elements.map(I).join("");o.push(`<xdr:oneCellAnchor>${m}${h}<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" Requires="a14"><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${f}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a14:m>${P}</a14:m><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Choice><mc:Fallback><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${f}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" sz="${p}" i="0"><a:latin typeface="${w(x)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr><a:t>${w(v)}</a:t></a:r><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Fallback></mc:AlternateContent><xdr:clientData/></xdr:oneCellAnchor>`)}),this.oleObjects.forEach((i,l)=>{let d=n++,m=i.from,c=i.to,f=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,h=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`,p=this.oleRIds[l]??"",x=this.oleIconRIds[l]??"",g=i.progId??"Package",$=i.displayAsIcon?' showAsIcon="1"':"",b=i.linkToFile&&i.linkPath?` link="${w(i.linkPath)}"`:"",k=x?`<a:blip r:embed="${x}"/><a:stretch><a:fillRect/></a:stretch>`:"<a:blip/><a:stretch><a:fillRect/></a:stretch>";o.push(`<xdr:twoCellAnchor editAs="oneCell">${f}${h}<xdr:sp macro=""><xdr:nvSpPr><xdr:cNvPr id="${d}" name="${w(i.name)}" hidden="1"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)});for(let i of this._slicerDrawingInfo){let l=n++,{row:d,col:m}=i.cell?kt(i.cell):{row:1,col:6},c=m-1,f=d-1,h=c+2,p=f+12;o.push(`<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>${c}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${f}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:to><xdr:col>${h}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${p}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:sle15="http://schemas.microsoft.com/office/drawing/2012/slicer" Requires="sle15"><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${l}" name="${w(i.name)}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/drawing/2010/slicer"><sle:slicer xmlns:sle="http://schemas.microsoft.com/office/drawing/2010/slicer" name="${w(i.name)}"/></a:graphicData></a:graphic></xdr:graphicFrame></mc:Choice><mc:Fallback/></mc:AlternateContent><xdr:clientData/></xdr:twoCellAnchor>`)}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
71
+ <xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
72
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
73
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
74
+ ${o.join(`
75
+ `)}
76
+ </xdr:wsDr>`}};function Vs(s){let t=0;for(let e=s.length-1;e>=0;e--)t=t>>14&1|t<<1&32767,t^=s.charCodeAt(e);return t=t>>14&1|t<<1&32767,t^=s.length,t^=52811,t.toString(16).toUpperCase().padStart(4,"0")}function se(s,t){if(!t)return"";if(t.startsWith("theme:")){let o=t.slice(6),r=o.indexOf(":tint:");if(r>=0){let n=o.slice(0,r),a=o.slice(r+6);return`<${s} theme="${n}" tint="${a}"/>`}return`<${s} theme="${o}"/>`}let e=t.startsWith("#")?"FF"+t.slice(1):t;return`<${s} rgb="${e}"/>`}function Ie(s){let t=[];return s.bold&&t.push("<b/>"),s.italic&&t.push("<i/>"),s.strike&&t.push("<strike/>"),s.underline&&s.underline!=="none"&&t.push(`<u val="${s.underline}"/>`),s.vertAlign&&t.push(`<vertAlign val="${s.vertAlign}"/>`),s.size&&t.push(`<sz val="${s.size}"/>`),s.color&&t.push(se("color",s.color)),s.name&&t.push(`<name val="${w(s.name)}"/>`),s.family&&t.push(`<family val="${s.family}"/>`),s.scheme&&t.push(`<scheme val="${s.scheme}"/>`),s.charset&&t.push(`<charset val="${s.charset}"/>`),t.join("")}function ie(s){if(s.type==="pattern"){let r=s,n=se("fgColor",r.fgColor),a=se("bgColor",r.bgColor);return`<patternFill${r.pattern?` patternType="${r.pattern}"`:""}>${n}${a}</patternFill>`}let t=s,e=t.stops.map(r=>`<stop position="${r.position}">${se("color",r.color)}</stop>`).join("");return`<gradientFill ${[t.gradientType?`type="${t.gradientType}"`:"",t.degree!==void 0?`degree="${t.degree}"`:"",t.left!==void 0?`left="${t.left}"`:"",t.right!==void 0?`right="${t.right}"`:"",t.top!==void 0?`top="${t.top}"`:"",t.bottom!==void 0?`bottom="${t.bottom}"`:""].filter(Boolean).join(" ")}>${e}</gradientFill>`}function ee(s,t){if(!t)return`<${s}/>`;let e=se("color",t.color);return t.style?`<${s} style="${t.style}">${e}</${s}>`:`<${s}/>`}function Se(s){let t=[s.diagonalUp?'diagonalUp="1"':"",s.diagonalDown?'diagonalDown="1"':""].filter(Boolean).join(" ");return`<border${t?" "+t:""}>`+ee("left",s.left)+ee("right",s.right)+ee("top",s.top)+ee("bottom",s.bottom)+ee("diagonal",s.diagonal)+"</border>"}function Ge(s){return`<alignment ${[s.horizontal?`horizontal="${s.horizontal}"`:"",s.vertical?`vertical="${s.vertical}"`:"",s.wrapText?'wrapText="1"':"",s.shrinkToFit?'shrinkToFit="1"':"",s.textRotation!==void 0?`textRotation="${s.textRotation}"`:"",s.indent?`indent="${s.indent}"`:"",s.readingOrder!==void 0?`readingOrder="${s.readingOrder}"`:""].filter(Boolean).join(" ")}/>`}var Gt=class{constructor(){this.fonts=[],this.fills=[],this.borders=[],this.fontIdx=new Map,this.fillIdx=new Map,this.borderIdx=new Map,this.numFmts=new Map,this.xfs=[],this.styleKey=new Map,this.dxfs=[],this.nextNumFmtId=164,this.cellStyleXfs=[],this.cellStyleNames=[],this.tableStyleDefs=[];let t=Ie({name:"Calibri",size:11,scheme:"minor"});this.fonts.push(t),this.fontIdx.set(t,0);let e=ie({type:"pattern",pattern:"none"}),o=ie({type:"pattern",pattern:"gray125"});this.fills.push(e,o),this.fillIdx.set(e,0),this.fillIdx.set(o,1);let r=Se({});this.borders.push(r),this.borderIdx.set(r,0),this.cellStyleXfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>'),this.cellStyleNames.push({name:"Normal",xfId:0,builtinId:0}),this.xfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>')}registerNamedStyle(t,e,o){let r=this.internFont(e.font),n=this.internFill(e.fill),a=this.internBorder(e.border),i=this.internNumFmt(e.numberFormat,e.numFmtId),l=e.font?' applyFont="1"':"",d=e.fill?' applyFill="1"':"",m=e.border?' applyBorder="1"':"",c=e.alignment?' applyAlignment="1"':"",f=e.numberFormat||e.numFmtId!==void 0?' applyNumberFormat="1"':"",h=e.alignment?Ge(e.alignment):"",p=`<xf numFmtId="${i}" fontId="${r}" fillId="${n}" borderId="${a}"${l}${d}${m}${c}${f}>${h}</xf>`;this.cellStyleXfs.push(p);let x=this.cellStyleXfs.length-1;return this.cellStyleNames.push({name:t,xfId:x,builtinId:o}),x}internFont(t){if(!t)return 0;let e=Ie(t),o=this.fontIdx.get(e);if(o!==void 0)return o;let r=this.fonts.length;return this.fonts.push(e),this.fontIdx.set(e,r),r}internFill(t){if(!t)return 0;let e=ie(t),o=this.fillIdx.get(e);if(o!==void 0)return o;let r=this.fills.length;return this.fills.push(e),this.fillIdx.set(e,r),r}internBorder(t){if(!t)return 0;let e=Se(t),o=this.borderIdx.get(e);if(o!==void 0)return o;let r=this.borders.length;return this.borders.push(e),this.borderIdx.set(e,r),r}internNumFmt(t,e){if(e!==void 0)return e;if(!t)return 0;if(this.numFmts.has(t.formatCode))return this.numFmts.get(t.formatCode);let o=this.nextNumFmtId++;return this.numFmts.set(t.formatCode,o),o}register(t){if(!t)return 0;let e=JSON.stringify(t);if(this.styleKey.has(e))return this.styleKey.get(e);let o=this.internFont(t.font),r=this.internFill(t.fill),n=this.internBorder(t.border),a=this.internNumFmt(t.numberFormat,t.numFmtId),i=t.font?' applyFont="1"':"",l=t.fill?' applyFill="1"':"",d=t.border?' applyBorder="1"':"",m=t.alignment?' applyAlignment="1"':"",c=t.numberFormat||t.numFmtId!==void 0?' applyNumberFormat="1"':"",f=t.locked!==void 0||t.hidden!==void 0?' applyProtection="1"':"",h=t.alignment?Ge(t.alignment):"",p=t.locked!==void 0||t.hidden!==void 0?`<protection${t.locked!==void 0?` locked="${t.locked?"1":"0"}"`:""}${t.hidden!==void 0?` hidden="${t.hidden?"1":"0"}"`:""}/>`:"",x=t.namedStyleId??0,g=`<xf numFmtId="${a}" fontId="${o}" fillId="${r}" borderId="${n}" xfId="${x}"${i}${l}${d}${m}${c}${f}>${h}${p}</xf>`;this.xfs.push(g);let $=this.xfs.length-1;return this.styleKey.set(e,$),$}registerDxf(t){let e=[];if(t.font&&e.push(`<font>${Ie(t.font)}</font>`),t.numberFormat){let r=this.internNumFmt(t.numberFormat);e.push(`<numFmt numFmtId="${r}" formatCode="${w(t.numberFormat.formatCode)}"/>`)}t.fill&&e.push(`<fill>${ie(t.fill)}</fill>`),t.alignment&&e.push(`<alignment${t.alignment.horizontal?` horizontal="${t.alignment.horizontal}"`:""}${t.alignment.vertical?` vertical="${t.alignment.vertical}"`:""}${t.alignment.wrapText?' wrapText="1"':""}${t.alignment.textRotation?` textRotation="${t.alignment.textRotation}"`:""}/>`),t.border&&e.push(Se(t.border));let o=e.join("");return this.dxfs.push(o),this.dxfs.length-1}prependRawDxfs(t){this.dxfs.unshift(...t)}registerTableStyle(t,e){let o=[];e.headerRow&&o.push({type:"headerRow",dxfId:this.registerDxf(e.headerRow)}),e.totalRow&&o.push({type:"totalRow",dxfId:this.registerDxf(e.totalRow)}),e.dataRow1&&o.push({type:"firstRowStripe",dxfId:this.registerDxf(e.dataRow1)}),e.dataRow2&&o.push({type:"secondRowStripe",dxfId:this.registerDxf(e.dataRow2)}),this.tableStyleDefs.push({name:t,elements:o})}toXml(){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
77
+ <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
78
+ ${this.numFmts.size?`<numFmts count="${this.numFmts.size}">${[...this.numFmts.entries()].map(([e,o])=>`<numFmt numFmtId="${o}" formatCode="${w(e)}"/>`).join("")}</numFmts>`:""}
79
+ <fonts count="${this.fonts.length}">${this.fonts.map(e=>`<font>${e}</font>`).join("")}</fonts>
80
+ <fills count="${this.fills.length}">${this.fills.map(e=>`<fill>${e}</fill>`).join("")}</fills>
81
+ <borders count="${this.borders.length}">${this.borders.join("")}</borders>
82
+ <cellStyleXfs count="${this.cellStyleXfs.length}">${this.cellStyleXfs.join("")}</cellStyleXfs>
83
+ <cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs>
84
+ <cellStyles count="${this.cellStyleNames.length}">${this.cellStyleNames.map(e=>`<cellStyle name="${w(e.name)}" xfId="${e.xfId}"${e.builtinId!==void 0?` builtinId="${e.builtinId}"`:""}/>`).join("")}</cellStyles>
85
+ ${this.dxfs.length?`<dxfs count="${this.dxfs.length}">${this.dxfs.map(e=>`<dxf>${e}</dxf>`).join("")}</dxfs>`:""}
86
+ ${this.tableStyleDefs.length?`<tableStyles count="${this.tableStyleDefs.length}">${this.tableStyleDefs.map(e=>`<tableStyle name="${w(e.name)}" count="${e.elements.length}">${e.elements.map(o=>`<tableStyleElement type="${o.type}" dxfId="${o.dxfId}"/>`).join("")}</tableStyle>`).join("")}</tableStyles>`:""}
87
+ </styleSheet>`}};var Zt=class{constructor(){this.table=new Map,this.strings=[],this._count=0}get count(){return this._count}get uniqueCount(){return this.strings.length}intern(t){this._count++;let e=this.table.get(t);if(e!==void 0)return e;let o=this.strings.length;return this.strings.push(t),this.table.set(t,o),o}internRichText(t){let e=JSON.stringify(t);this._count++;let o=this.table.get(e);if(o!==void 0)return o;let r=t.map(a=>`<r>${a.font?Us(a.font):""}<t xml:space="preserve">${w(a.text)}</t></r>`).join(""),n=this.strings.length;return this.strings.push("\0RICH\0"+r),this.table.set(e,n),n}toXml(){let t=this.strings.map(e=>e.startsWith("\0RICH\0")?`<si>${e.slice(6)}</si>`:`<si><t${e!==e.trim()||e.includes(`
88
+ `)?' xml:space="preserve"':""}>${w(e)}</t></si>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
89
+ <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${this._count}" uniqueCount="${this.strings.length}">
90
+ ${t}
91
+ </sst>`}};function Us(s){let t=[];return s.bold&&t.push("<b/>"),s.italic&&t.push("<i/>"),s.strike&&t.push("<strike/>"),s.underline&&s.underline!=="none"&&t.push(`<u val="${s.underline}"/>`),s.size&&t.push(`<sz val="${s.size}"/>`),s.color&&(s.color.startsWith("theme:")?t.push(`<color theme="${s.color.slice(6)}"/>`):t.push(`<color rgb="${s.color.startsWith("#")?"FF"+s.color.slice(1):s.color}"/>`)),s.name&&t.push(`<name val="${w(s.name)}"/>`),t.length?`<rPr>${t.join("")}</rPr>`:""}var Ze=["FF4472C4","FFED7D31","FFA5A5A5","FFFFC000","FF5B9BD5","FF70AD47","FF264478","FF9E480E","FF636363","FF997300"],Ws={office:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","264478","9E480E","636363","997300"],blue:["5B9BD5","8FAADC","B4C7E7","D6DCE4","4472C4","2F5597","1F4E79","002060","00B0F0","0070C0"],orange:["ED7D31","F4B183","F8CBAD","FCE4D6","C55A11","843C0C","BF8F00","806000","FFD966","FFC000"],green:["70AD47","A9D18E","C5E0B4","E2F0D9","548235","375623","92D050","00B050","00B0F0","00FF00"],red:["FF0000","FF6161","FF9F9F","FFD2D2","C00000","8B0000","FFC000","FF6600","FF3300","CC0000"],purple:["7030A0","9B59B6","BB8FCE","D7BDE2","5B2C6F","4A235A","8E44AD","6C3483","A569BD","D2B4DE"],teal:["00B0F0","00BCD4","26C6DA","80DEEA","0097A7","006064","009688","00796B","4DB6AC","80CBC4"],gray:["595959","808080","A6A6A6","D9D9D9","404040","262626","BFBFBF","F2F2F2","7F7F7F","C0C0C0"],gold:["FFC000","FFD966","FFE699","FFF2CC","BF8F00","806000","ED7D31","F4B183","DBA13A","C09100"],blueWarm:["4472C4","5B9BD5","9DC3E6","BDD7EE","DEEBF7","2E75B6","1F4E79","2F5597","8FAADC","D6DCE4"],blueGreen:["00B0F0","00B050","70AD47","5B9BD5","4472C4","2E75B6","548235","00B0F0","009688","00796B"],greenYellow:["70AD47","92D050","C9E265","FFD966","FFC000","548235","BF8F00","A9D18E","E2F0D9","C5E0B4"],redOrange:["FF0000","ED7D31","FFC000","FF6600","C00000","843C0C","BF8F00","FF3300","F4B183","FFD966"],redViolet:["FF0000","7030A0","ED7D31","C00000","5B2C6F","843C0C","FF6161","9B59B6","F4B183","BB8FCE"],yellowOrange:["FFC000","ED7D31","FFD966","F4B183","BF8F00","C55A11","FFE699","F8CBAD","806000","843C0C"],slipstream:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","255E91","9E480E","636363","997300"],marquee:["ED7D31","4472C4","70AD47","FFC000","5B9BD5","A5A5A5","264478","9E480E","636363","997300"],aspect:["5B9BD5","4472C4","ED7D31","FFC000","70AD47","A5A5A5","9E480E","264478","636363","997300"]},zs={colorful1:102,colorful2:103,colorful3:104,colorful4:105,monochromatic1:201,monochromatic2:202,monochromatic3:203,monochromatic4:204,monochromatic5:205,monochromatic6:206,monochromatic7:207,monochromatic8:208,monochromatic9:209,monochromatic10:210,monochromatic11:211,monochromatic12:212};function Hs(s,t){let e=' xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"',o=s.replace(/^FF/,""),r;t?.fillType==="gradient"&&t.gradientStops?.length?r=`<a:gradFill><a:gsLst>${t.gradientStops.map(l=>`<a:gs pos="${l.pos*1e3}"><a:srgbClr val="${l.color.replace(/^FF/,"").replace(/^#/,"")}"/></a:gs>`).join("")}</a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>`:r=`<a:solidFill><a:srgbClr val="${o}"/></a:solidFill>`;let n=t?.lineWidth?` w="${Math.round(t.lineWidth*12700)}"`:"",a=n?`<a:ln${n}><a:solidFill><a:srgbClr val="${o}"/></a:solidFill></a:ln>`:"";return`<c:spPr${e}>${r}${a}</c:spPr>`}function Ye(s){return s?`<c:dLbls>${[s.numFmt?`<c:numFmt formatCode="${w(s.numFmt)}" sourceLinked="0"/>`:"",s.position?`<c:dLblPos val="${s.position}"/>`:"",'<c:showLegendKey val="0"/>',`<c:showVal val="${s.showValue?"1":"0"}"/>`,`<c:showCatName val="${s.showCategory?"1":"0"}"/>`,`<c:showSerName val="${s.showSeriesName?"1":"0"}"/>`,`<c:showPercent val="${s.showPercent?"1":"0"}"/>`].join("")}</c:dLbls>`:""}function Wt(s,t,e,o){return t.map((r,n)=>{let a=r.color?r.color.startsWith("#")?"FF"+r.color.slice(1):r.color:o?"FF"+o[n%o.length]:Ze[n%Ze.length],i=r.categories?`<c:cat><c:strRef><c:f>${w(r.categories)}</c:f></c:strRef></c:cat>`:"",l=`<c:val><c:numRef><c:f>${w(r.values)}</c:f></c:numRef></c:val>`,d=r.name?`<c:tx><c:strRef><c:f>"${w(r.name)}"</c:f></c:strRef></c:tx>`:"",m=s.startsWith("line")||s==="scatter"?'<c:marker><c:symbol val="none"/></c:marker>':"",c=Ye(r.dataLabels);return`<c:ser><c:idx val="${n}"/><c:order val="${n}"/>${d}${Hs(a,r)}${m}${c}${i}${l}</c:ser>`}).join("")}function qs(s,t,e,o=!1){if(o)return`<c:valAx><c:axId val="${s}"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="1"/><c:axPos val="b"/><c:crossAx val="${t}"/></c:valAx>`;let r=e?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${w(e.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",n=[e?.min!==void 0?`<c:min val="${e.min}"/>`:"",e?.max!==void 0?`<c:max val="${e.max}"/>`:""].join(""),a=e?.numFmt?`<c:numFmt formatCode="${w(e.numFmt)}" sourceLinked="0"/>`:"",i=e?.gridLines!==!1?"<c:majorGridlines/>":"";return`<c:valAx>
92
+ <c:axId val="${s}"/>
93
+ <c:scaling><c:orientation val="minMax"/>${n}</c:scaling>
94
+ <c:delete val="0"/>
95
+ <c:axPos val="l"/>
96
+ ${i}${r}${a}
97
+ <c:crossAx val="${t}"/>
98
+ </c:valAx>`}function Gs(s,t,e){let o=e?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${w(e.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",r=e?.gridLines?"<c:majorGridlines/>":"";return`<c:catAx>
99
+ <c:axId val="${s}"/>
100
+ <c:scaling><c:orientation val="minMax"/></c:scaling>
101
+ <c:delete val="0"/>
102
+ <c:axPos val="b"/>
103
+ ${r}${o}
104
+ <c:crossAx val="${t}"/>
105
+ </c:catAx>`}function Zs(s){if(s===!1)return"";let t=typeof s=="string"?s:"b";return`<c:legend><c:legendPos val="${{bottom:"b",top:"t",left:"l",right:"r",corner:"tr"}[t]??t}"/></c:legend>`}function Ke(s){let t=s.type,e=s.series,o=s.colorPalette?Ws[s.colorPalette]:void 0,r=s.title?`<c:title><c:tx><c:rich>
106
+ <a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/>
107
+ <a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
108
+ <a:r><a:t>${w(s.title)}</a:t></a:r>
109
+ </a:p>
110
+ </c:rich></c:tx><c:overlay val="0"/></c:title>`:"",n=s.varyColors?'<c:varyColors val="1"/>':"",a=Ye(s.dataLabels),i="",l=t==="pie"||t==="doughnut",d=t.startsWith("bar")||t.startsWith("column"),m=t.startsWith("line"),c=t.startsWith("scatter")||t==="bubble",f=t.startsWith("area"),h=t.startsWith("radar"),p=t==="stock",x=s.grouping??(t.endsWith("Stacked100")?"percentStacked":t.endsWith("Stacked")?"stacked":d?"clustered":m||f?"standard":void 0);if(l){let y=t==="doughnut"?"doughnutChart":"pieChart",O=t==="doughnut"?'<c:holeSize val="50"/>':"";i=`<c:${y}>${n}${Wt(t,e,0,o)}${a}${O}</c:${y}>`}else d?i=`<c:barChart>
111
+ <c:barDir val="${t.startsWith("bar")?"bar":"col"}"/>
112
+ ${x?`<c:grouping val="${x}"/>`:""}
113
+ ${n}
114
+ ${Wt(t,e,0,o)}
115
+ ${a}
116
+ <c:axId val="1"/><c:axId val="2"/>
117
+ </c:barChart>`:m?i=`<c:lineChart>
118
+ ${x?`<c:grouping val="${x}"/>`:""}
119
+ ${n}
120
+ ${Wt(t,e,0,o)}
121
+ ${a}
122
+ <c:axId val="1"/><c:axId val="2"/>
123
+ </c:lineChart>`:c?i=`<c:scatterChart>
124
+ <c:scatterStyle val="${t==="scatterSmooth"?"smoothMarker":"marker"}"/>
125
+ ${n}
126
+ ${Wt(t,e,0,o)}
127
+ ${a}
128
+ <c:axId val="1"/><c:axId val="2"/>
129
+ </c:scatterChart>`:f?i=`<c:areaChart>
130
+ ${x?`<c:grouping val="${x}"/>`:""}
131
+ ${n}
132
+ ${Wt(t,e,0,o)}
133
+ ${a}
134
+ <c:axId val="1"/><c:axId val="2"/>
135
+ </c:areaChart>`:h?i=`<c:radarChart>
136
+ <c:radarStyle val="${t==="radarFilled"?"filled":"marker"}"/>
137
+ ${n}
138
+ ${Wt(t,e,0,o)}
139
+ ${a}
140
+ <c:axId val="1"/><c:axId val="2"/>
141
+ </c:radarChart>`:i=`<c:barChart>
142
+ <c:barDir val="col"/>
143
+ <c:grouping val="clustered"/>
144
+ ${n}
145
+ ${Wt(t,e,0,o)}
146
+ ${a}
147
+ <c:axId val="1"/><c:axId val="2"/>
148
+ </c:barChart>`;let $=!l?Gs(1,2,s.xAxis)+qs(2,1,s.yAxis):"",b=Zs(s.legend??"b"),k=s.modernStyle?Math.min(zs[s.modernStyle],48):s.style,P=k?`<c:style val="${k}"/>`:"",I="";if(s.chartFill||s.shadow){let y=s.chartFill==="gradient"?'<a:gradFill><a:gsLst><a:gs pos="0"><a:schemeClr val="lt1"/></a:gs><a:gs pos="100000"><a:schemeClr val="bg1"><a:lumMod val="85000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>':s.chartFill==="white"?'<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>':s.chartFill==="none"?"<a:noFill/>":"",O=s.shadow?'<a:effectLst><a:outerShdw blurRad="50800" dist="38100" dir="5400000" algn="t" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>':"";I=`<c:spPr>${y}${O}</c:spPr>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
149
+ <c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
150
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
151
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
152
+ ${s.roundedCorners?'<c:roundedCorners val="1"/>':""}
153
+ ${P}
154
+ <c:chart>
155
+ ${r}
156
+ <c:autoTitleDeleted val="${s.title?"0":"1"}"/>
157
+ <c:plotArea>
158
+ ${i}
159
+ ${$}
160
+ </c:plotArea>
161
+ ${b}
162
+ <c:plotVisOnly val="1"/>
163
+ </c:chart>
164
+ ${I}
165
+ </c:chartSpace>`}function Te(s,t){let{startRow:e,startCol:o,endRow:r,endCol:n}=Pt(s.ref),a=s.displayName??s.name,i=s.columns.map((h,p)=>{let x=o+p,g=p+1,$=h.totalsRowFunction??"none",b=s.totalsRow?` totalsRowFunction="${$}"${$!=="none"&&h.totalsRowFormula?` totalsRowFormula="${w(h.totalsRowFormula)}"`:""}`:"",k=s.totalsRow&&h.totalsRowLabel?` totalsRowLabel="${w(h.totalsRowLabel)}"`:"";return`<tableColumn id="${g}" name="${w(h.name)}"${b}${k}/>`}).join(""),l=[`name="${w(s.style??"TableStyleMedium2")}"`,s.showFirstColumn?'showFirstColumn="1"':"",s.showLastColumn?'showLastColumn="1"':"",s.showRowStripes!==!1?'showRowStripes="1"':"",s.showColumnStripes?'showColumnStripes="1"':""].filter(Boolean).join(" "),d=s.totalsRow?1:0,m=Ct(o),c=Ct(n),f=`${m}${e}:${c}${r-d}`;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
166
+ <table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
167
+ id="${t}" name="${w(s.name)}" displayName="${w(a)}"
168
+ ref="${s.ref}" totalsRowCount="${d}">
169
+ <autoFilter ref="${f}"/>
170
+ <tableColumns count="${s.columns.length}">${i}</tableColumns>
171
+ <tableStyleInfo ${l}/>
172
+ </table>`}var Ys={sum:"sum",count:"count",average:"average",max:"max",min:"min",product:"product",countNums:"countNums",stdDev:"stdDev",stdDevp:"stdDevp",var:"var",varp:"varp"};function Je(s,t,e,o){let r=(t[0]??[]).map(V=>String(V??"")),n=t.slice(1),a=r.length,i=s.rowGrandTotals!==!1,l=s.colGrandTotals!==!1,d=new Map(r.map((V,L)=>[V,L])),m=s.rowFields.map(V=>d.get(V)??0),c=s.colFields.map(V=>d.get(V)??0),f=s.dataFields.map(V=>d.get(V.field)??0),h=Array.from({length:a},()=>[]),p=Array.from({length:a},()=>new Map),x=new Array(a).fill(!0);for(let V of n)for(let L=0;L<a;L++){let u=V[L],F=u==null?"":String(u);typeof u!="number"&&(x[L]=!1),p[L].has(F)||(p[L].set(F,h[L].length),h[L].push(F))}let{row:g,col:$}=kt(s.targetCell),b=c.length>0,k=b?c.reduce((V,L)=>V*Math.max(h[L].length,1),1):1,I=1+(m.length?m.reduce((V,L)=>V*Math.max(h[L].length,1),1):1)+(i?1:0),v=s.dataFields.length+(s.calculatedFields??[]).length,y=m.length+k*v+(l?v:0),O=`${Mt(g,$)}:${Mt(g+I-1,$+y-1)}`,S=m.length+1,_=new Set([...m,...c]),R=s.calculatedFields??[],M=R.map(V=>`<cacheField name="${w(V.name)}" numFmtId="0" formula="${w(V.formula)}" databaseField="0"><sharedItems/></cacheField>`).join(""),A=a+R.length,j=new Map;for(let V of s.fieldGrouping??[]){let L=d.get(V.field);L!==void 0&&j.set(L,V)}let H=r.map((V,L)=>{let u=j.get(L);if(_.has(L)){let F=h[L].map(N=>`<s v="${w(N)}"/>`).join(""),B="";return u&&(u.groupBy==="numeric"?B=`<fieldGroup base="${L}"><rangePr startNum="${u.start??0}" endNum="${u.end??100}" groupInterval="${u.interval??10}"/></fieldGroup>`:B=`<fieldGroup base="${L}"><rangePr groupBy="${{days:"days",months:"months",quarters:"quarters",years:"years"}[u.groupBy]??"months"}"/></fieldGroup>`),`<cacheField name="${w(V)}" numFmtId="0"><sharedItems count="${h[L].length}">${F}</sharedItems>${B}</cacheField>`}if(x[L]){let F=n.map(U=>Number(U[L])).filter(U=>!isNaN(U)),B=F.length?Math.min(...F):0,N=F.length?Math.max(...F):0;return`<cacheField name="${w(V)}" numFmtId="0"><sharedItems containsSemiMixedTypes="0" containsString="0" containsNumber="1" minValue="${B}" maxValue="${N}"/></cacheField>`}return`<cacheField name="${w(V)}" numFmtId="0"><sharedItems/></cacheField>`}).join("")+M,X=n.map(V=>`<r>${r.map((u,F)=>{let B=V[F];if(_.has(F)){let N=B==null?"":String(B);return`<x v="${p[F].get(N)??0}"/>`}return typeof B=="number"?`<n v="${B}"/>`:typeof B=="boolean"?`<b v="${B?1:0}"/>`:`<s v="${w(String(B??""))}"/>`}).join("")}</r>`).join(""),T=r.map((V,L)=>{let u=m.includes(L),F=c.includes(L),B=f.includes(L);if(u){let N=h[L].map((U,rt)=>`<item x="${rt}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisRow" showAll="0"><items count="${h[L].length+1}">${N}</items></pivotField>`}if(F){let N=h[L].map((U,rt)=>`<item x="${rt}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisCol" showAll="0"><items count="${h[L].length+1}">${N}</items></pivotField>`}return B?'<pivotField dataField="1" showAll="0"/>':'<pivotField showAll="0"/>'}).join("")+R.map(()=>'<pivotField dataField="1" showAll="0"/>').join(""),D="",z="";if(m.length){D=`<rowFields count="${m.length}">${m.map(F=>`<field x="${F}"/>`).join("")}</rowFields>`;let V=m[0],L=h[V].map((F,B)=>`<i><x v="${B}"/></i>`).join(""),u=i?'<i t="grand"><x/></i>':"";z=`<rowItems count="${h[V].length+(i?1:0)}">${L}${u}</rowItems>`}let et="",pt="";if(b){et=`<colFields count="${c.length}">${c.map(F=>`<field x="${F}"/>`).join("")}</colFields>`;let V=c[0],L=h[V].map((F,B)=>`<i><x v="${B}"/></i>`).join(""),u=l?'<i t="grand"><x/></i>':"";pt=`<colItems count="${h[V].length+(l?1:0)}">${L}${u}</colItems>`}else if(v>1){et='<colFields count="1"><field x="-2"/></colFields>';let V=Array.from({length:v},(L,u)=>`<i><x v="${u}"/></i>`).join("");pt=`<colItems count="${v}">${V}</colItems>`}let at=[];for(let V=0;V<s.dataFields.length;V++){let L=s.dataFields[V],u=f[V],F=Ys[L.func??"sum"]??"sum",B=L.name??`Sum of ${L.field}`;at.push(`<dataField name="${w(B)}" fld="${u}" subtotal="${F}" showDataAs="normal" baseField="0" baseItem="0"/>`)}for(let V=0;V<R.length;V++){let L=R[V],u=a+V;at.push(`<dataField name="${w(L.name)}" fld="${u}" subtotal="sum" showDataAs="normal" baseField="0" baseItem="0"/>`)}let st=`<dataFields count="${at.length}">${at.join("")}</dataFields>`,J=[i?"":'rowGrandTotals="0"',l?"":'colGrandTotals="0"'].filter(Boolean),Dt=J.length?" "+J.join(" "):"",Tt=w(s.style??"PivotStyleMedium9"),Bt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
173
+ <pivotTableDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="${w(s.name)}" cacheId="${o}" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Values" updatedVersion="6" minRefreshableVersion="3" useAutoFormatting="1" itemPrintTitles="1" createdVersion="6" indent="0" outline="1" outlineData="1" multipleFieldFilters="0"${Dt}>
174
+ <location ref="${O}" firstHeaderRow="1" firstDataRow="2" firstDataCol="${S}"/>
175
+ <pivotFields count="${A}">${T}</pivotFields>
176
+ ${D}${z}${et}${pt}${st}
177
+ <pivotTableStyleInfo name="${Tt}" showRowHeaders="1" showColHeaders="1" showRowStripes="0" showColStripes="0" showLastColumn="1"/>
178
+ </pivotTableDefinition>`,_t=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
+ <pivotCacheDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" refreshedBy="ExcelForge" refreshedDate="45000" createdVersion="6" refreshedVersion="6" minRefreshableVersion="3" recordCount="${n.length}" saveData="1">
180
+ <cacheSource type="worksheet"><worksheetSource ref="${s.sourceRef}" sheet="${w(s.sourceSheet)}"/></cacheSource>
181
+ <cacheFields count="${A}">${H}</cacheFields>
182
+ </pivotCacheDefinition>`,Et=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
183
+ <pivotCacheRecords xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" count="${n.length}">${X}</pivotCacheRecords>`;return{pivotTableXml:Bt,cacheDefXml:_t,cacheRecordsXml:Et}}var ke={button:"Button",checkBox:"Checkbox",comboBox:"Drop",listBox:"List",optionButton:"Radio",groupBox:"GBox",label:"Label",scrollBar:"Scroll",spinner:"Spin",dialog:"Dialog"},Ks={...ke,checkBox:"CheckBox",dialog:"Dialog"},Qe={...Object.fromEntries(Object.entries(ke).map(([s,t])=>[t,s])),CheckBox:"checkBox"},ts={unchecked:"0",checked:"1",mixed:"2"},es={0:"unchecked",1:"checked",2:"mixed"};function ss(s){if(s._ctrlPropXml)return s._ctrlPropXml;let e=[`objectType="${Ks[s.type]??"Button"}"`,'lockText="1"'];if(s.linkedCell&&e.push(`fmlaLink="${w(s.linkedCell)}"`),s.inputRange&&e.push(`fmlaRange="${w(s.inputRange)}"`),s.checked!==void 0&&e.push(`checked="${ts[s.checked]??"0"}"`),s.dropLines!==void 0&&e.push(`dropLines="${s.dropLines}"`),s.min!==void 0&&e.push(`min="${s.min}"`),s.max!==void 0&&e.push(`max="${s.max}"`),s.inc!==void 0&&e.push(`inc="${s.inc}"`),s.page!==void 0&&e.push(`page="${s.page}"`),s.val!==void 0&&e.push(`val="${s.val}"`),s.selType){let o={single:"Single",multi:"Multi",extend:"Extend"};e.push(`selType="${o[s.selType]??"Single"}"`)}return s.noThreeD&&e.push('noThreeD="1"'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
184
+ <formControlPr xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" ${e.join(" ")}/>`}function Js(s,t){return`${s.col}, ${s.colOff??0}, ${s.row}, ${s.rowOff??0}, ${t.col}, ${t.colOff??0}, ${t.row}, ${t.rowOff??0}`}function os(s,t){if(s._vmlShapeXml)return s._vmlShapeXml;let e=ke[s.type]??"Button",o=Js(s.from,s.to),r=[];if(r.push(`<x:Anchor>${o}</x:Anchor>`),r.push("<x:PrintObject>False</x:PrintObject>"),r.push("<x:AutoFill>False</x:AutoFill>"),s.macro&&r.push(`<x:FmlaMacro>${w(s.macro)}</x:FmlaMacro>`),s.linkedCell&&r.push(`<x:FmlaLink>${w(s.linkedCell)}</x:FmlaLink>`),s.inputRange&&r.push(`<x:FmlaRange>${w(s.inputRange)}</x:FmlaRange>`),s.checked!==void 0&&r.push(`<x:Checked>${ts[s.checked]??"0"}</x:Checked>`),s.dropLines!==void 0&&r.push(`<x:DropLines>${s.dropLines}</x:DropLines>`),s.dropStyle&&r.push(`<x:DropStyle>${w(s.dropStyle)}</x:DropStyle>`),s.min!==void 0&&r.push(`<x:Min>${s.min}</x:Min>`),s.max!==void 0&&r.push(`<x:Max>${s.max}</x:Max>`),s.inc!==void 0&&r.push(`<x:Inc>${s.inc}</x:Inc>`),s.page!==void 0&&r.push(`<x:Page>${s.page}</x:Page>`),s.val!==void 0&&r.push(`<x:Val>${s.val}</x:Val>`),s.selType){let f={single:"Single",multi:"Multi",extend:"Extend"};r.push(`<x:Sel>${f[s.selType]??"Single"}</x:Sel>`)}s.noThreeD&&r.push("<x:NoThreeD/>"),s.isDefault&&r.push("<x:Default/>"),s.isDismiss&&r.push("<x:Dismiss/>"),s.isCancel&&r.push("<x:Cancel/>");let n="";s.text&&(s.type==="button"||s.type==="checkBox"||s.type==="optionButton"||s.type==="groupBox"||s.type==="label"||s.type==="dialog")&&(n=`<v:textbox style="mso-direction-alt:auto"><div style="text-align:${s.type==="button"?"center":"left"}"><font face="Calibri" size="220" color="#000000">${w(s.text)}</font></div></v:textbox>`,r.push("<x:TextHAlign>Center</x:TextHAlign>"),r.push("<x:TextVAlign>Center</x:TextVAlign>"));let a=(s.from.col*64+(s.from.colOff??0))*.75,i=(s.from.row*20+(s.from.rowOff??0))*.75,l=(s.to.col-s.from.col)*64*.75,d=(s.to.row-s.from.row)*20*.75,m=s.text??`${s.type}_${t}`,c=s.type==="dialog"?"":' filled="f" stroked="f"';return`<v:shape o:spid="_x0000_s${t}" id="${w(m)}" type="#_x0000_t201" style="position:absolute;margin-left:${a.toFixed(1)}pt;margin-top:${i.toFixed(1)}pt;width:${l.toFixed(1)}pt;height:${d.toFixed(1)}pt;z-index:${t}"${c} o:insetmode="auto"><o:lock v:ext="edit" rotation="t"/>${n}<x:ClientData ObjectType="${e}">${r.join("")}</x:ClientData></v:shape>`}function rs(s,t){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
185
+ <o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>
186
+ <v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>
187
+ <v:shapetype id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/><o:lock v:ext="edit" shapetype="t"/></v:shapetype>
188
+ ${s.join(`
189
+ `)}
190
+ ${t.join(`
191
+ `)}
192
+ </xml>`}function ns(s){return s<=16?4:s<=32?5:s<=64?6:s<=128?7:s<=256?8:s<=512?9:s<=1024?10:s<=2048?11:12}function Pe(s){let t=[1],e=0;for(;e<s.length;){let o=e,r=Math.min(e+4096,s.length),n=Qs(s,o,r);if(n.length<4096){let i=45056|n.length+2-3&4095;t.push(i&255,i>>8&255);for(let l of n)t.push(l)}else{t.push(255,63);for(let i=o;i<r;i++)t.push(s[i]);for(let i=r-o;i<4096;i++)t.push(0)}e=r}return new Uint8Array(t)}function Qs(s,t,e){let o=[],r=0;for(;t+r<e;){let n=0,a=o.length;o.push(0);for(let i=0;i<8&&t+r<e;i++){if(r===0){o.push(s[t]),r++;continue}let l=ns(r),d=1<<l,m=16-l,c=(1<<m)-1+3,f=Math.max(0,r-d),h=0,p=0;for(let x=f;x<r;x++){let g=0;for(;r+g<e-t&&g<c&&s[t+x+g]===s[t+r+g];)g++;g>p&&(p=g,h=r-x)}if(p>=3){n|=1<<i;let x=h-1<<m|p-3;o.push(x&255,x>>8&255),r+=p}else o.push(s[t+r]),r++}o[a]=n}return o}function De(s){if(s.length===0||s[0]!==1)throw new Error("Invalid OVBA compressed container (bad signature)");let t=[],e=1;for(;e<s.length&&!(e+1>=s.length);){let o=s[e]|s[e+1]<<8;e+=2;let r=(o&4095)+3,n=o>>15&1,a=r-2,i=e+a;if(n){let l=t.length;for(;e<i&&e<s.length;){let d=s[e++];for(let m=0;m<8&&e<i&&e<s.length;m++)if((d&1<<m)===0)t.push(s[e++]);else{if(e+1>=s.length)break;let c=s[e]|s[e+1]<<8;e+=2;let f=t.length-l,p=16-ns(f),x=(c>>p)+1,g=(c&(1<<p)-1)+3,$=t.length-x;for(let b=0;b<g;b++)t.push(t[$+b])}}}else{for(let l=0;l<4096&&e<s.length;l++)t.push(s[e++]);e=Math.max(e,i)}}return new Uint8Array(t)}var as=new Uint8Array([208,207,17,224,161,177,26,225]),zt=4294967294,Jt=4294967295,to=4294967293,Kt=4294967295,vt=512,le=64,is=4096,me=128;function Re(s,t){return s[t]|s[t+1]<<8}function Rt(s,t){return(s[t]|s[t+1]<<8|s[t+2]<<16|s[t+3]<<24)>>>0}function Yt(s,t,e){s[t]=e&255,s[t+1]=e>>8&255}function $t(s,t,e){s[t]=e&255,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255}function eo(s){if(s.length>31)throw new Error(`CFB entry name too long (${s.length} chars, max 31): "${s}"`);let t=new Uint8Array(64),e=0;for(let o of s){let r=o.charCodeAt(0);t[e++]=r&255,t[e++]=r>>8&255}return t[e++]=0,t[e++]=0,{bytes:t,size:e}}function so(s,t,e){let o="",r=Math.max(0,e-2);for(let n=0;n<r;n+=2){let a=s[t+n]|s[t+n+1]<<8;if(a===0)break;o+=String.fromCharCode(a)}return o}function oe(s,t){let e=[],o=t;for(;o!==zt&&o<s.length;)e.push(o),o=s[o];return e}function ce(s,t){return Math.ceil(s/t)}function ls(s){for(let S=0;S<8;S++)if(s[S]!==as[S])throw new Error("Not a CFB file");let e=1<<Re(s,30),r=1<<Re(s,32),n=Rt(s,44),a=Rt(s,48),i=Rt(s,60),l=S=>512+S*e,d=[];for(let S=0;S<109&&S<n;S++){let _=Rt(s,76+S*4);_!==Jt&&d.push(_)}let m=Math.floor((s.length-512)/e),c=new Uint32Array(m);c.fill(Jt);for(let S=0;S<d.length;S++){let _=l(d[S]),R=e/4;for(let M=0;M<R&&S*R+M<m;M++)c[S*R+M]=Rt(s,_+M*4)}let f=oe(c,a),h=new Uint8Array(f.length*e);for(let S=0;S<f.length;S++)h.set(s.subarray(l(f[S]),l(f[S])+e),S*e);let p=h.length/me,x=[];for(let S=0;S<p;S++){let _=S*me,R=Re(h,_+64);R!==0&&x.push({name:so(h,_,R),type:h[_+66],child:Rt(h,_+76),left:Rt(h,_+68),right:Rt(h,_+72),startSector:Rt(h,_+116),size:Rt(h,_+120),index:S})}let g=x.find(S=>S.type===5);if(!g)throw new Error("No root entry in CFB");let $=oe(c,g.startSector),b=new Uint8Array($.length*e);for(let S=0;S<$.length;S++)b.set(s.subarray(l($[S]),l($[S])+e),S*e);let k=oe(c,i),P=k.length*(e/4),I=new Uint32Array(P);I.fill(Jt);for(let S=0;S<k.length;S++){let _=l(k[S]),R=e/4;for(let M=0;M<R;M++)I[S*R+M]=Rt(s,_+M*4)}let v=new Map;function y(S,_){let R=x.find(A=>A.index===S);if(!R||R.child===Kt)return;let M=A=>{if(A===Kt||A>=p)return;let j=x.find(H=>H.index===A);j&&(v.set(A,_),j.type===1&&y(A,j.name),M(j.left),M(j.right))};M(R.child)}y(g.index,"");let O=[];for(let S of x){if(S.type!==2)continue;let _;if(S.size<is){let R=oe(I,S.startSector),M=new Uint8Array(R.length*r);for(let A=0;A<R.length;A++){let j=R[A]*r;M.set(b.subarray(j,j+r),A*r)}_=M.subarray(0,S.size)}else{let R=oe(c,S.startSector),M=new Uint8Array(R.length*e);for(let A=0;A<R.length;A++)M.set(s.subarray(l(R[A]),l(R[A])+e),A*e);_=M.subarray(0,S.size)}O.push({name:S.name,data:_,storage:v.get(S.index)||void 0})}return O}function cs(s){let t={name:"Root Entry",type:5,children:[]},e=new Map;e.set("",t);for(let A of s){let j=A.storage??"",H=e.get(j);H||(H={name:j,type:1,children:[]},e.set(j,H),t.children.push(H));let X={name:A.name,type:2,data:A.data};H.children.push(X)}let o=[],r=[t];for(;r.length;){let A=r.shift();if(o.push({node:A,parentIdx:-1,childIdx:Kt,leftIdx:Kt,rightIdx:Kt,miniStart:0,size:A.data?.length??0}),A.children)for(let j of A.children)r.push(j)}for(let A=0;A<o.length;A++){let j=o[A].node;if(!j.children?.length)continue;let H=o.map((D,z)=>({e:D,idx:z})).filter(({e:D})=>j.children.includes(D.node)).map(({idx:D})=>D);if(H.length===0)continue;let X=H.sort((D,z)=>{let et=o[D].node.name,pt=o[z].node.name;return et.length!==pt.length?et.length-pt.length:et.toUpperCase()<pt.toUpperCase()?-1:et.toUpperCase()>pt.toUpperCase()?1:0}),T=D=>{if(D.length===0)return Kt;let z=D.length>>1;return o[D[z]].leftIdx=T(D.slice(0,z)),o[D[z]].rightIdx=T(D.slice(z+1)),D[z]};o[A].childIdx=T(X)}let n=[],a=new Map,i=0;for(let A=0;A<o.length;A++){let j=o[A].node.data;if(!j||j.length===0)continue;let H=ce(j.length,le),X=[];for(let T=0;T<H;T++){X.push(i++);let D=j.subarray(T*le,Math.min((T+1)*le,j.length));for(let z of D)n.push(z);for(let z=D.length;z<le;z++)n.push(0)}o[A].miniStart=X[0],a.set(A,X)}let d=Math.max(i,1),m=ce(d*4,vt),c=new Uint32Array(m*(vt/4));c.fill(Jt);for(let A of a.values())for(let j=0;j<A.length;j++)c[A[j]]=j+1<A.length?A[j+1]:zt;let f=new Uint8Array(n),h=ce(f.length||1,vt),p=o.length,x=ce(p*me,vt),g=0,$=1,b=$+x,k=b+m,P=1+x+m+h,I=new Uint32Array(vt/4);I.fill(Jt),I[g]=to;for(let A=0;A<x;A++)I[$+A]=A+1<x?$+A+1:zt;for(let A=0;A<m;A++)I[b+A]=A+1<m?b+A+1:zt;for(let A=0;A<h;A++)I[k+A]=A+1<h?k+A+1:zt;o[0].miniStart=k,o[0].size=f.length;let v=new Uint8Array(x*vt);for(let A=0;A<o.length;A++){let j=A*me,H=o[A],{bytes:X,size:T}=eo(H.node.name);v.set(X,j),Yt(v,j+64,T),v[j+66]=H.node.type,v[j+67]=1,$t(v,j+68,H.leftIdx),$t(v,j+72,H.rightIdx),$t(v,j+76,H.childIdx),H.node.type===5?($t(v,j+116,k),$t(v,j+120,f.length)):H.node.type===2&&H.node.data&&H.node.data.length>0?($t(v,j+116,H.miniStart),$t(v,j+120,H.node.data.length)):H.node.type===1?($t(v,j+116,0),$t(v,j+120,0)):($t(v,j+116,zt),$t(v,j+120,0))}let y=new Uint8Array(512);y.set(as,0),Yt(y,24,62),Yt(y,26,3),Yt(y,28,65534),Yt(y,30,9),Yt(y,32,6),$t(y,44,1),$t(y,48,$),$t(y,56,is),$t(y,60,b),$t(y,64,m),$t(y,68,zt),$t(y,72,0),$t(y,76,g);for(let A=1;A<109;A++)$t(y,76+A*4,Jt);let O=512+P*vt,S=new Uint8Array(O);S.set(y,0);let _=new Uint8Array(vt);for(let A=0;A<I.length;A++)$t(_,A*4,I[A]);S.set(_,512+g*vt),S.set(v,512+$*vt);let R=new Uint8Array(m*vt);for(let A=0;A<c.length;A++)$t(R,A*4,c[A]);S.set(R,512+b*vt);let M=new Uint8Array(h*vt);return M.set(f),S.set(M,512+k*vt),S}var It=new TextEncoder,he=new TextDecoder("utf-8");function Lt(s){return[s&255,s>>8&255]}function tt(s){return[s&255,s>>8&255,s>>16&255,s>>24&255]}function oo(s,t){return s[t]|s[t+1]<<8}function ms(s,t){return(s[t]|s[t+1]<<8|s[t+2]<<16|s[t+3]<<24)>>>0}function ct(s,t){let e=t instanceof Uint8Array?Array.from(t):t;return[...Lt(s),...tt(e.length),...e]}function ro(s){let t=[];for(let e of s){let o=e.charCodeAt(0);t.push(o&255,o>>8&255)}return t}function no(s){let t=[`Attribute VB_Name = "${s.name}"`];if(s.type==="document"){let e=s.name==="ThisWorkbook"?"0{00020819-0000-0000-C000-000000000046}":"0{00020820-0000-0000-C000-000000000046}";t.push(`Attribute VB_Base = "${e}"`,"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = True","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = True")}else s.type==="userform"?t.push('Attribute VB_Base = "0{F8A47041-B2A6-11CE-8027-00AA00611080}"',"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = False","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = False"):s.type==="class"&&t.push("Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = False","Attribute VB_Exposed = False");return t.join(`\r
193
+ `)+`\r
194
+ `}var de=class s{constructor(){this.modules=[],this._dirty=!1}addModule(t){return this.modules.push(t),this._dirty=!0,this}removeModule(t){return this.modules=this.modules.filter(e=>e.name!==t),this._dirty=!0,this}getModule(t){return this.modules.find(e=>e.name===t)}build(){if(this._raw&&!this._dirty)return this._raw;let e=this.modules.some(p=>p.name==="ThisWorkbook"&&p.type==="document")?this.modules:[{name:"ThisWorkbook",type:"document",code:""},...this.modules],o=[...e.filter(p=>p.type==="document"),...e.filter(p=>p.type!=="document")],r=[];for(let p of o){let x=no(p)+p.code,g=Pe(It.encode(x));r.push({name:p.name,data:g,storage:"VBA"})}let n={name:"_VBA_PROJECT",data:new Uint8Array([204,97,255,255,0,0,0]),storage:"VBA"},a=this._buildDirStream(o),l={name:"dir",data:Pe(a),storage:"VBA"},d=this._buildProjectText(o),m={name:"PROJECT",data:It.encode(d)},c=this._buildProjectWm(o),f={name:"PROJECTwm",data:new Uint8Array(c)},h=[n,l,...r,m,f];for(let p of o)if(p.type==="userform")if(p._formStreams&&p._formStreams.size>0)for(let[x,g]of p._formStreams)h.push({name:x,data:g,storage:p.name});else h.push({name:"CompObj",data:co(),storage:p.name}),h.push({name:"VBFrame",data:It.encode(mo(p)),storage:p.name}),h.push({name:"f",data:ho(p),storage:p.name}),h.push({name:"o",data:xo(p),storage:p.name});return cs(h)}_buildDirStream(t){let e=[],r=It.encode("VBAProject");e.push(...ct(1,tt(1))),e.push(...ct(2,tt(1033))),e.push(...ct(20,tt(1033))),e.push(...ct(3,Lt(1252))),e.push(...ct(4,Array.from(r))),e.push(...ct(5,[])),e.push(...ct(64,[])),e.push(...ct(6,[])),e.push(...ct(61,[])),e.push(...ct(7,tt(0))),e.push(...ct(8,tt(0))),e.push(...Lt(9),...tt(4),...tt(1443),...Lt(2)),e.push(...ct(12,[])),e.push(...ct(60,[])),e.push(...ct(15,Lt(t.length))),e.push(...ct(19,Lt(65535)));for(let n of t){let a=It.encode(n.name),i=ro(n.name);e.push(...ct(25,Array.from(a))),e.push(...ct(71,i)),e.push(...ct(26,Array.from(a))),e.push(...ct(50,i)),e.push(...ct(28,[])),e.push(...ct(72,[])),e.push(...ct(49,tt(0))),e.push(...ct(30,tt(0))),e.push(...ct(44,Lt(65535))),n.type==="document"||n.type==="userform"?e.push(...ct(34,[])):e.push(...ct(33,[])),e.push(...ct(43,[]))}return e.push(...ct(16,[])),new Uint8Array(e)}_buildProjectText(t){let e=['ID="{00000000-0000-0000-0000-000000000000}"'],o=t.filter(n=>n.type==="document"),r=t.filter(n=>n.type!=="document");for(let n of o)e.push(`Document=${n.name}/&H00000000`);for(let n of r)n.type==="class"?e.push(`Class=${n.name}`):n.type==="userform"?(e.push("Package={AC9F2F90-E877-11CE-9F68-00AA00574A4F}"),e.push(`BaseClass=${n.name}`)):e.push(`Module=${n.name}`);e.push('Name="VBAProject"',"HelpContextID=0",'VersionCompatible32="393222000"',"","[Host Extender Info]","&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000","","[Workspace]");for(let n of[...o,...r])e.push(`${n.name}=0, 0, 0, 0, C `);return e.join(`\r
195
+ `)+`\r
196
+ `}_buildProjectWm(t){let e=[];for(let o of t){for(let r of o.name)e.push(r.charCodeAt(0));e.push(0);for(let r of o.name){let n=r.charCodeAt(0);e.push(n&255,n>>8&255)}e.push(0,0)}return e.push(0),e}static fromBytes(t){let e=new s;e._raw=t;let o=ls(t),r=new Map;for(let c of o){let f=c.storage?`${c.storage}/${c.name}`:c.name;r.set(f,c.data)}let n=r.get("VBA/dir");if(!n)return e;let a;try{a=De(n)}catch{return e}let i=new Set,l=new Set,d=r.get("PROJECT");if(d){let c=he.decode(d);for(let f of c.split(/\r?\n/)){let h=f.match(/^Class=(.+)$/);h&&i.add(h[1]);let p=f.match(/^BaseClass=(.+)$/);p&&l.add(p[1])}}let m=ao(a);for(let c of m){let f=`VBA/${c.name}`,h=r.get(f);if(!h)continue;let p="";try{let b=h.subarray(c.offset),k=De(b);p=he.decode(k)}catch{p=he.decode(h.subarray(c.offset))}let x=io(p),g=l.has(c.name)?"userform":i.has(c.name)?"class":c.type,$={name:c.name,type:g,code:x};if(g==="userform"){let b=new Map;for(let[I,v]of r)if(I.startsWith(c.name+"/")){let y=I.substring(c.name.length+1);b.set(y,v)}b.size>0&&($._formStreams=b);let k=`${c.name}/f`,P=r.get(k);P&&($.designerData=P)}e.modules.push($)}return e._dirty=!1,e}};function ao(s){let t=[],e=0,o=null;for(;e+6<=s.length;){let r=oo(s,e),n=ms(s,e+2);if(e+=6,r===9){e+=6;continue}if(e+n>s.length)break;let a=s.subarray(e,e+n);switch(e+=n,r){case 25:o={name:he.decode(a),type:"standard",offset:0};break;case 49:o&&a.length>=4&&(o.offset=ms(a,0));break;case 33:o&&(o.type="standard");break;case 34:o&&(o.type="document");break;case 43:o?.name&&t.push(o),o=null;break}}return t}function io(s){let t=s.split(/\r?\n/),e=t.findIndex(r=>!r.startsWith("Attribute "));return e<0?s:t.slice(e).join(`
197
+ `)}var lo="{C62A69F0-16DC-11CE-9E98-00AA00574A4F}",fe={Image:12,Frame:14,SpinButton:16,CommandButton:17,Label:21,TextBox:23,ListBox:24,ComboBox:25,CheckBox:26,OptionButton:27,ToggleButton:28,ScrollBar:47};function co(){return new Uint8Array([1,0,254,255,3,10,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,77,105,99,114,111,115,111,102,116,32,70,111,114,109,115,32,50,46,48,32,70,111,114,109,0,16,0,0,0,69,109,98,101,100,100,101,100,32,79,98,106,101,99,116,0,0,0,0,0,244,57,178,113,0,0,0,0,0,0,0,0,0,0,0,0])}function mo(s){return["VERSION 5.00",`Begin ${lo} ${s.name} `,` Caption = "${s.name}"`," ClientHeight = 3015"," ClientLeft = 120"," ClientTop = 465"," ClientWidth = 4560"," StartUpPosition = 1 'CenterOwner"," TypeInfoVer = 2","End"].join(`\r
198
+ `)+`\r
199
+ `}function ho(s){let t=s.controls??[],e=t.length,o=t.map(P=>hs(P)),r=[];r.push(0),r.push(4);let n=r.length;r.push(0,0);let a=8,i=1024,l=2048,d=1<<26,m=1<<27,c=a|i|l|d|m;r.push(c&255,c>>8&255,c>>16&255,c>>24&255),r.push(...tt(e+1)),r.push(...tt(0)),r.push(...tt(32e3));let f=200,h=120;for(let P of t){let I=(P.left??0)+(P.width??72),v=(P.top??0)+(P.height??24);I>f&&(f=I),v>h&&(h=v)}let p=(f+20)*26,x=(h+20)*26;r.push(...tt(p)),r.push(...tt(x)),r.push(...tt(0)),r.push(...tt(0));let g=r.length-4;r[n]=g&255,r[n+1]=g>>8&255,r.push(...Lt(0)),r.push(...tt(e));let $=r.length;r.push(0,0,0,0);let b=r.length;for(let P=0;P<e;P++)r.push(0),r.push(1);for(;(r.length-b)%4!==0;)r.push(0);for(let P=0;P<e;P++){let I=t[P],v=It.encode(I.name),y=fe[I.type]??fe.CommandButton;r.push(0,0);let O=r.length;r.push(0,0);let S=485;for(r.push(S&255,S>>8&255,S>>16&255,S>>24&255),r.push(...tt(v.length|2147483648)),r.push(...tt(P+1)),r.push(...tt(o[P].length)),r.push(P&255,P>>8&255),r.push(y&255,y>>8&255),r.push(...v);(r.length-b)%4!==0;)r.push(0);let _=(I.left??10+P*80)*26,R=(I.top??10+P*30)*26;r.push(...tt(_)),r.push(...tt(R));let M=r.length-O-2;r[O]=M&255,r[O+1]=M>>8&255}let k=r.length-b;return r[$]=k&255,r[$+1]=k>>8&255,r[$+2]=k>>16&255,r[$+3]=k>>24&255,new Uint8Array(r)}function hs(s){let t=fe[s.type]??fe.CommandButton;return t===17?fo(s):t===21?po(s):uo(s)}function Ae(s){s.push(0,2);let t=s.length;s.push(0,0),s.push(5,0,0,0);let e=It.encode("Tahoma");for(s.push(...tt(e.length|2147483648)),s.push(160,0,0,0),s.push(...e);s.length%4!==0;)s.push(0);let o=s.length-t-2;s[t]=o&255,s[t+1]=o>>8&255}function fo(s){let t=[],e=!!s.caption;t.push(0,2);let o=t.length;t.push(0,0);let r=32;if(e&&(r|=8),t.push(r&255,r>>8&255,r>>16&255,r>>24&255),e){let l=It.encode(s.caption);t.push(...tt(l.length|2147483648))}if(e){let l=It.encode(s.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let n=(s.width??72)*26,a=(s.height??24)*26;t.push(...tt(n)),t.push(...tt(a));let i=t.length-o-2;return t[o]=i&255,t[o+1]=i>>8&255,Ae(t),new Uint8Array(t)}function po(s){let t=[],e=!!s.caption;t.push(0,2);let o=t.length;t.push(0,0);let r=32;if(e&&(r|=8),t.push(r&255,r>>8&255,r>>16&255,r>>24&255),e){let l=It.encode(s.caption);t.push(...tt(l.length|2147483648))}if(e){let l=It.encode(s.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let n=(s.width??80)*26,a=(s.height??18)*26;t.push(...tt(n)),t.push(...tt(a));let i=t.length-o-2;return t[o]=i&255,t[o+1]=i>>8&255,Ae(t),new Uint8Array(t)}function uo(s){let t=[],e=!!s.caption;t.push(0,2);let o=t.length;t.push(0,0);let r=257;if(e&&(r|=1<<23),r|=1<<31,t.push(r&255,r>>8&255,r>>16&255,r>>>24&255),t.push(0,0,0,0),t.push(27,72,128,44),e){let l=It.encode(s.caption);t.push(...tt(l.length|2147483648))}let n=(s.width??72)*26,a=(s.height??24)*26;if(t.push(...tt(n)),t.push(...tt(a)),e){let l=It.encode(s.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let i=t.length-o-2;return t[o]=i&255,t[o+1]=i>>8&255,Ae(t),new Uint8Array(t)}function xo(s){let t=s.controls??[];if(t.length===0)return new Uint8Array(0);let e=[];for(let a of t)e.push(hs(a));let o=e.reduce((a,i)=>a+i.length,0),r=new Uint8Array(o),n=0;for(let a of e)r.set(a,n),n+=a.length;return r}var re=null;function go(){if(re)return re;re=new Uint32Array(256);for(let s=0;s<256;s++){let t=s;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;re[s]=t}return re}function $o(s){let t=go(),e=4294967295;for(let o=0;o<s.length;o++)e=e>>>8^t[(e^s[o])&255];return(e^4294967295)>>>0}var pe=class{constructor(t=65536){this.pos=0,this.bits=0,this.bitLen=0,this.buf=new Uint8Array(t)}grow(){let t=new Uint8Array(this.buf.length*2);t.set(this.buf),this.buf=t}writeBits(t,e){for(this.bits|=(t&(1<<e)-1)<<this.bitLen,this.bitLen+=e;this.bitLen>=8;)this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=this.bits&255,this.bits>>>=8,this.bitLen-=8}writeByte(t){this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=t}flush(){this.bitLen>0&&(this.writeByte(this.bits&255),this.bits=0,this.bitLen=0)}toBytes(){return this.buf.subarray(0,this.pos)}};function Be(s,t){let e=s.length,o=new Uint8Array(e),r=[];for(let m=0;m<e;m++)s[m]>0&&r.push(m);if(r.length===0)return o;if(r.length===1)return o[r[0]]=1,o;let n=r.map(m=>({freq:s[m],sym:m})),a=(m,c,f)=>{for(;;){let h=c,p=2*c+1,x=2*c+2;if(p<f&&m[p].freq<m[h].freq&&(h=p),x<f&&m[x].freq<m[h].freq&&(h=x),h===c)break;let g=m[c];m[c]=m[h],m[h]=g,c=h}},i=(m,c)=>{for(;c>0;){let f=c-1>>1;if(m[f].freq<=m[c].freq)break;let h=m[c];m[c]=m[f],m[f]=h,c=f}};for(let m=(n.length>>1)-1;m>=0;m--)a(n,m,n.length);let l=n.length;for(;l>1;){let m=n[0];n[0]=n[--l],a(n,0,l);let c=n[0];n[0]={freq:m.freq+c.freq,sym:-1,left:m,right:c},a(n,0,l)}let d=(m,c)=>{if(m){if(m.sym>=0){o[m.sym]=Math.min(c,t);return}d(m.left,c+1),d(m.right,c+1)}};d(n[0],0);{let m=()=>{let h=0;for(let p=0;p<e;p++)o[p]>0&&(h+=1<<t-o[p]);return h},c=1<<t,f=m();if(f>c){let h=f-c;for(let p=t-1;p>=1&&h>0;p--){let x=1<<t-p-1;for(let g=0;g<e&&h>0;g++)o[g]===p&&(o[g]=p+1,h-=x)}}for(f=m();f<c;){let h=!1;for(let p=0;p<e;p++)if(o[p]===t){o[p]--,f++,h=!0;break}if(!h)break}}return o}function ne(s){let t=Math.max(...s),e=new Uint32Array(t+1);for(let a of s)a>0&&e[a]++;let o=new Uint32Array(t+1),r=0;for(let a=1;a<=t;a++)r=r+e[a-1]<<1,o[a]=r;let n=new Uint32Array(s.length);for(let a=0;a<s.length;a++)s[a]>0&&(n[a]=o[s[a]]++);return n}function jt(s,t){let e=0;for(let o=0;o<t;o++)e=e<<1|s&1,s>>=1;return e}function yo(){let s=new Uint8Array(288);for(let t=0;t<=143;t++)s[t]=8;for(let t=144;t<=255;t++)s[t]=9;for(let t=256;t<=279;t++)s[t]=7;for(let t=280;t<=287;t++)s[t]=8;return s}function bo(){let s=new Uint8Array(32);return s.fill(5),s}var Fo=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],wo=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],vo=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Co=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Ne=new Array(259);for(let s=0;s<29;s++){let t=wo[s],e=Fo[s];for(let o=t;o<t+(1<<e);o++)o<=258&&(Ne[o]=[257+s,e,o-t])}Ne[258]=[285,0,0];function ds(s){return Ne[s]}var gs=new Array(32769);for(let s=0;s<30;s++){let t=Co[s],e=vo[s];for(let o=t;o<t+(1<<e);o++)o<=32768&&(gs[o]=[s,e,o-t])}function fs(s){return gs[s]}var Nt=32768,_e=258,ps=3,Io=8,So=32,To=128;function ko(s,t){let e=t<=1?Io:t<=6?So:To,o=s.length,r=Math.min(o+1,65536),n=new Uint16Array(r),a=new Uint16Array(r),i=0,l=()=>{if(i>=r){r=r*2;let g=new Uint16Array(r);g.set(n),n=g;let $=new Uint16Array(r);$.set(a),a=$}},d=65536,m=new Int32Array(d).fill(-1),c=new Int32Array(Math.min(o,Nt)).fill(-1),f=g=>((s[g]*4129^s[g+1]*155^s[g+2])&d-1)>>>0,h=0,p=g=>{l(),n[i]=g+1,a[i]=0,i++},x=(g,$)=>{l(),n[i]=g,a[i]=$,i++};for(;h<o;){if(h+2>=o){p(s[h++]);continue}let g=f(h),$=ps-1,b=0,k=m[g],P=0;for(;k>=0&&P<e;){let I=h-k;if(I>Nt)break;let v=0,y=Math.min(_e,o-h);for(;v<y&&s[k+v]===s[h+v];)v++;if(v>$&&($=v,b=I),$===_e)break;k=c[k&Nt-1],P++}if(c[h&Nt-1]=m[g],m[g]=h,$>=ps){if(t>=6&&h+3<o){let I=f(h+1),v=m[I],y=0,O=0,S=0;for(;v>=0&&S<e;){let _=h+1-v;if(_>Nt)break;let R=0,M=Math.min(_e,o-h-1);for(;R<M&&s[v+R]===s[h+1+R];)R++;R>y&&(y=R,O=_),v=c[v&Nt-1],S++}if(y>$+1){p(s[h]),h++,c[h&Nt-1]=m[I],m[I]=h,x(y,O);for(let _=1;_<y;_++)if(h++,h+2<o){let R=f(h);c[h&Nt-1]=m[R],m[R]=h}h++;continue}}x($,b);for(let I=0;I<$;I++)if(h+I+2<o){let v=f(h+I);c[h+I&Nt-1]=m[v],m[v]=h+I}h+=$}else p(s[h++])}return{litLen:n,dist:a,count:i}}function Po(s,t,e,o){let r=0;for(;r<s.length;){let n=s[r];if(n===0){let a=0;for(;r+a<s.length&&s[r+a]===0&&a<138;)a++;a<3?(t.writeBits(jt(e[0],o[0]),o[0]),r++):a<=10?(t.writeBits(jt(e[17],o[17]),o[17]),t.writeBits(a-3,3),r+=a):(t.writeBits(jt(e[18],o[18]),o[18]),t.writeBits(a-11,7),r+=a)}else{t.writeBits(jt(e[n],o[n]),o[n]),r++;let a=0;for(;r+a<s.length&&s[r+a]===n&&a<6;)a++;a>=3&&(t.writeBits(jt(e[16],o[16]),o[16]),t.writeBits(a-3,2),r+=a)}}}function us(s,t,e,o){let r=new Uint32Array(286),n=new Uint32Array(30);r[256]=1;let{litLen:a,dist:i,count:l}=s;for(let p=0;p<l;p++)if(i[p]===0)r[a[p]-1]++;else{let[x]=ds(a[p]);r[x]++;let[g]=fs(i[p]);n[g]++}let d,m,c,f;if(o){d=Be(r,15),m=Be(n,15),m.every(v=>v===0)&&(m[0]=1),c=ne(d),f=ne(m);let p=xs(d,257,286)+1,x=xs(m,1,30)+1,g=[...d.subarray(0,p),...m.subarray(0,x)],$=new Uint32Array(19);Ro(g,$);let b=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=Be($,7),P=ne(k),I=Do(b.map(v=>k[v]),4,19)+1;t.writeBits(e?1:0,1),t.writeBits(2,2),t.writeBits(p-257,5),t.writeBits(x-1,5),t.writeBits(I-4,4);for(let v=0;v<I;v++)t.writeBits(k[b[v]],3);Po(g,t,P,k)}else d=yo(),m=bo(),c=ne(d),f=ne(m),t.writeBits(e?1:0,1),t.writeBits(1,2);for(let p=0;p<l;p++)if(i[p]===0){let x=a[p]-1,g=d[x];t.writeBits(jt(c[x],g),g)}else{let[x,g,$]=ds(a[p]),b=d[x];t.writeBits(jt(c[x],b),b),g>0&&t.writeBits($,g);let[k,P,I]=fs(i[p]),v=m[k];t.writeBits(jt(f[k],v),v),P>0&&t.writeBits(I,P)}let h=d[256];t.writeBits(jt(c[256],h),h)}function xs(s,t,e){let o=t-1;for(let r=t;r<Math.min(s.length,e);r++)s[r]>0&&(o=r);return Math.max(o,t-1)}function Do(s,t,e){let o=t-1;for(let r=t;r<Math.min(s.length,e);r++)s[r]>0&&(o=r);return Math.max(o,t-1)}function Ro(s,t){let e=0;for(;e<s.length;){let o=s[e];if(o===0){let r=0;for(;e+r<s.length&&s[e+r]===0&&r<138;)r++;r<3?(t[0]++,e++):r<=10?(t[17]++,e+=r):(t[18]++,e+=r)}else{t[o]++,e++;let r=0;for(;e+r<s.length&&s[e+r]===o&&r<6;)r++;r>=3&&(t[16]++,e+=r)}}}var Oe=65536;function Ao(s,t=6){if(t===0){let a=new pe,i=0;for(;i<s.length||s.length===0;){let l=Math.min(Oe,s.length-i),d=i+l>=s.length;a.flush(),a.writeBits(d?1:0,1),a.writeBits(0,2),a.flush();let m=l;for(a.writeByte(m&255),a.writeByte(m>>8&255),a.writeByte(~m&255),a.writeByte(~m>>8&255);a.pos+l>a.buf.length;)a.buf=(()=>{let c=new Uint8Array(a.buf.length*2);return c.set(a.buf),c})();if(a.buf.set(s.subarray(i,i+l),a.pos),a.pos+=l,i+=l,s.length===0)break}return a.toBytes()}let e=Math.max(1,Math.min(9,t)),o=e>=2,r=new pe,n=0;for(;n<s.length||s.length===0;){let a=s.subarray(n,n+Oe),i=n+Oe>=s.length,l=ko(a,e);if(us(l,r,i,o),n+=a.length,s.length===0){us({litLen:new Uint16Array(0),dist:new Uint16Array(0),count:0},r,!0,o);break}}return r.flush(),r.toBytes()}function xt(s,t,e){s[t]=e&255,s[t+1]=e>>8&255}function St(s,t,e){s[t]=e&255,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255}var Bo=new TextEncoder,_o=new Set(["png","jpg","jpeg","gif","tiff","emf","wmf","bmp","webp"]);function je(s,t={}){let e=t.level??6,o=t.noCompress?new Set(t.noCompress.map(p=>p.toLowerCase())):_o,r=[],n=[],a=0;for(let p of s){let x=Bo.encode(p.name),g=p.name.split(".").pop()?.toLowerCase()??"",$=p.level??(o.has(g)?0:e),b=$>0&&p.data.length>0,k=$o(p.data),P,I;b?(P=Ao(p.data,$),P.length>=p.data.length?(P=p.data,I=0):I=8):(P=p.data,I=0);let v=new Uint8Array(30+x.length);St(v,0,67324752),xt(v,4,20),xt(v,6,0),xt(v,8,I),xt(v,10,0),xt(v,12,0),St(v,14,k),St(v,18,P.length),St(v,22,p.data.length),xt(v,26,x.length),xt(v,28,0),v.set(x,30);let y=new Uint8Array(46+x.length);St(y,0,33639248),xt(y,4,20),xt(y,6,20),xt(y,8,0),xt(y,10,I),xt(y,12,0),xt(y,14,0),St(y,16,k),St(y,20,P.length),St(y,24,p.data.length),xt(y,28,x.length),xt(y,30,0),xt(y,32,0),xt(y,34,0),xt(y,36,0),St(y,38,0),St(y,42,a),y.set(x,46),r.push(v,P),n.push(y),a+=v.length+P.length}let i=a,l=n.reduce((p,x)=>p+x.length,0),d=new Uint8Array(22);St(d,0,101010256),xt(d,4,0),xt(d,6,0),xt(d,8,n.length),xt(d,10,n.length),St(d,12,l),St(d,16,i),xt(d,20,0);let m=[...r,...n,d],c=m.reduce((p,x)=>p+x.length,0),f=new Uint8Array(c),h=0;for(let p of m)f.set(p,h),h+=p.length;return f}function Ht(s,t){return s[t]|s[t+1]<<8}function Qt(s,t){return(s[t]|s[t+1]<<8|s[t+2]<<16|s[t+3]<<24)>>>0}async function Oo(s){let t=new DecompressionStream("deflate-raw"),e=t.writable.getWriter(),o=t.readable.getReader();e.write(s),e.close();let r=[],n=!1;for(;!n;){let{value:d,done:m}=await o.read();d&&r.push(d),n=m}let a=r.reduce((d,m)=>d+m.length,0),i=new Uint8Array(a),l=0;for(let d of r)i.set(d,l),l+=d.length;return i}async function Ee(s){let t=new TextDecoder("utf-8"),e=new Map,o=-1;for(let i=s.length-22;i>=0;i--)if(s[i]===80&&s[i+1]===75&&s[i+2]===5&&s[i+3]===6){o=i;break}if(o<0)throw new Error("Not a valid ZIP file (EOCD not found)");let r=Qt(s,o+16),n=Ht(s,o+8),a=r;for(let i=0;i<n;i++){if(Qt(s,a)!==33639248)throw new Error("Invalid central directory entry");let l=Ht(s,a+10),d=Qt(s,a+20),m=Qt(s,a+24),c=Ht(s,a+28),f=Ht(s,a+30),h=Ht(s,a+32),p=Qt(s,a+42),x=s.subarray(a+46,a+46+c),g=t.decode(x);a+=46+c+f+h;let $=p;if(Qt(s,$)!==67324752)throw new Error("Invalid local file header");let b=Ht(s,$+26),k=Ht(s,$+28),P=$+30+b+k,I=s.subarray(P,P+d),v;l===0?v=I.slice():l===8?v=await Oo(I):v=I.slice(),g.endsWith("/")||e.set(g,{name:g,data:v})}return e}function ue(s){return new TextDecoder("utf-8").decode(s.data)}function ae(s){let t=Object.entries(s.attrs).map(([r,n])=>`${r}="${No(n)}"`).join(" "),e=t?`<${s.tag} ${t}`:`<${s.tag}`,o=(s.text??"")+s.children.map(ae).join("");return o?`${e}>${o}</${s.tag}>`:`${e}/>`}function No(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ft(s){let t=[],e=[],o=0;for(s.startsWith("<?")&&(o=s.indexOf("?>")+2);o<s.length;){if(s[o]!=="<"){let c=s.indexOf("<",o),f=c<0?s.slice(o):s.slice(o,c);if(e.length&&f.trim()){let h=e[e.length-1];h.text=(h.text??"")+$s(f)}o=c<0?s.length:c;continue}if(s.startsWith("<!--",o)){let c=s.indexOf("-->",o);if(e.length){let f=e[e.length-1];f.text=(f.text??"")+s.slice(o,c+3)}o=c+3;continue}if(s.startsWith("<![CDATA[",o)){let c=s.indexOf("]]>",o),f=s.slice(o+9,c);if(e.length){let h=e[e.length-1];h.text=(h.text??"")+f}o=c+3;continue}if(s[o+1]==="/"){let c=s.indexOf(">",o),f=e.pop();e.length?e[e.length-1].children.push(f):t.push(f),o=c+1;continue}if(s[o+1]==="?"){o=s.indexOf("?>",o)+2;continue}let r=jo(s,o),n=s.slice(o+1,r),a=n.endsWith("/"),i=a?n.slice(0,-1).trim():n.trim(),{tag:l,attrs:d}=Eo(i),m={tag:l,attrs:d,children:[]};a?e.length?e[e.length-1].children.push(m):t.push(m):e.push(m),o=r+1}for(;e.length>1;){let r=e.pop();e[e.length-1].children.push(r)}if(e.length===1&&t.push(e[0]),t.length===0)throw new Error("Empty XML document");return t[0]}function jo(s,t){let e=null;for(let o=t+1;o<s.length;o++){let r=s[o];if(e)r===e&&(e=null);else if(r==='"'||r==="'")e=r;else if(r===">")return o}return s.length-1}function Eo(s){let t={},e=s.search(/\s/),o=e<0?s:s.slice(0,e);if(e<0)return{tag:o,attrs:t};let r=s.slice(e),n=/(\S+?)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,a;for(;(a=n.exec(r))!==null;)t[a[1]]=$s(a[2]??a[3]??"");return{tag:o,attrs:t}}function $s(s){return s.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(parseInt(e,10))).replace(/&#x([0-9a-fA-F]+);/g,(t,e)=>String.fromCharCode(parseInt(e,16)))}function C(s,t){return s.children.find(e=>W(e.tag)===t)}function q(s,t){return s.children.filter(e=>W(e.tag)===t)}function ys(s,t){if(s.attrs[t]!==void 0)return s.attrs[t];let e=W(t);for(let[o,r]of Object.entries(s.attrs))if(W(o)===e)return r}function W(s){let t=s.indexOf(":");return t<0?s:s.slice(t+1)}function Mo(s){return s.toISOString()}function Me(s){let t=(o,r)=>r!==void 0?`<${o}>${w(r)}</${o}>`:"",e=(o,r)=>r?`<${o} xsi:type="dcterms:W3CDTF">${Mo(r)}</${o}>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
200
+ <cp:coreProperties
201
+ xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
202
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
203
+ xmlns:dcterms="http://purl.org/dc/terms/"
204
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
205
+ ${t("dc:title",s.title)}
206
+ ${t("dc:subject",s.subject)}
207
+ ${t("dc:creator",s.creator)}
208
+ ${t("cp:keywords",s.keywords)}
209
+ ${t("dc:description",s.description)}
210
+ ${t("cp:lastModifiedBy",s.lastModifiedBy)}
211
+ ${t("cp:revision",s.revision??"1")}
212
+ ${t("dc:language",s.language)}
213
+ ${t("dc:identifier",s.identifier)}
214
+ ${t("cp:version",s.version)}
215
+ ${t("cp:category",s.category)}
216
+ ${t("cp:contentStatus",s.contentStatus)}
217
+ ${e("dcterms:created",s.created??new Date)}
218
+ ${e("dcterms:modified",s.modified??new Date)}
219
+ </cp:coreProperties>`}function Le(s,t){let e=(n,a)=>a!==void 0?`<${n}>${w(String(a))}</${n}>`:"",o="",r="";if(s.headingPairs?.length){let n=s.headingPairs.map(a=>`<vt:variant><vt:lpstr>${w(a.name)}</vt:lpstr></vt:variant><vt:variant><vt:i4>${a.count}</vt:i4></vt:variant>`).join("");o=`<HeadingPairs><vt:vector size="${s.headingPairs.length*2}" baseType="variant">${n}</vt:vector></HeadingPairs>`}if(s.titlesOfParts?.length){let n=s.titlesOfParts.map(a=>`<vt:lpstr>${w(a)}</vt:lpstr>`).join("");r=`<TitlesOfParts><vt:vector size="${s.titlesOfParts.length}" baseType="lpstr">${n}</vt:vector></TitlesOfParts>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
220
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
221
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
222
+ ${e("Application",s.application??"ExcelForge")}
223
+ ${e("AppVersion",s.appVersion)}
224
+ ${e("Company",s.company)}
225
+ ${e("Manager",s.manager)}
226
+ ${e("DocSecurity",s.docSecurity??0)}
227
+ ${e("ScaleCrop",s.scaleCrop??!1)}
228
+ ${e("LinksUpToDate",s.linksUpToDate??!1)}
229
+ ${e("SharedDoc",s.sharedDoc??!1)}
230
+ ${e("HyperlinksChanged",s.hyperlinksChanged??!1)}
231
+ ${e("Characters",s.characters)}
232
+ ${e("CharactersWithSpaces",s.charactersByWord)}
233
+ ${e("Words",s.words)}
234
+ ${e("Lines",s.lines)}
235
+ ${e("Paragraphs",s.paragraphs)}
236
+ ${e("Pages",s.pages)}
237
+ ${e("Slides",s.slides)}
238
+ ${e("Notes",s.notes)}
239
+ ${e("HiddenSlides",s.hiddenSlides)}
240
+ ${e("MMClips",s.mmClips)}
241
+ ${e("Template",s.template)}
242
+ ${e("PresentationFormat",s.presentationFormat)}
243
+ ${e("TotalTime",s.totalTime)}
244
+ ${e("HyperlinkBase",s.hyperlinkBase)}
245
+ ${o}
246
+ ${r}
247
+ ${t??""}
248
+ </Properties>`}function Xe(s){let t=2;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
249
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
250
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
251
+ ${s.map(o=>{let r,n=o.value;switch(n.type){case"string":r=`<vt:lpwstr>${w(n.value)}</vt:lpwstr>`;break;case"int":r=`<vt:i4>${n.value}</vt:i4>`;break;case"decimal":r=`<vt:decimal>${n.value}</vt:decimal>`;break;case"bool":r=`<vt:bool>${n.value}</vt:bool>`;break;case"date":r=`<vt:filetime>${n.value.toISOString()}</vt:filetime>`;break;case"r8":r=`<vt:r8>${n.value}</vt:r8>`;break;case"i8":r=`<vt:i8>${n.value}</vt:i8>`;break;case"error":r=`<vt:error>${w(n.value)}</vt:error>`;break;default:r="<vt:lpwstr></vt:lpwstr>";break}return`<property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${t++}" name="${w(o.name)}">${r}</property>`}).join(`
252
+ `)}
253
+ </Properties>`}function bs(s){let t=Ft(s),e=r=>{let n=t.children.find(a=>W(a.tag)===r);return n?.text??n?.children[0]?.text},o=r=>{let n=e(r);return n?new Date(n):void 0};return{title:e("title"),subject:e("subject"),creator:e("creator"),keywords:e("keywords"),description:e("description"),lastModifiedBy:e("lastModifiedBy"),revision:e("revision"),created:o("created"),modified:o("modified"),category:e("category"),contentStatus:e("contentStatus"),language:e("language"),identifier:e("identifier"),version:e("version")}}function Fs(s){let t=Ft(s),e=f=>t.children.find(h=>W(h.tag)===f)?.text,o=f=>{let h=e(f);return h!==void 0?Number(h):void 0},r=f=>{let h=e(f);return h!==void 0?h==="true"||h==="1":void 0},n,a=t.children.find(f=>W(f.tag)==="HeadingPairs");if(a){let f=a.children[0];if(f){let h=f.children.filter(p=>W(p.tag)==="variant");n=[];for(let p=0;p<h.length-1;p+=2){let x=h[p].children[0],g=h[p+1].children[0];n.push({name:x?.text??"",count:parseInt(g?.text??"0",10)})}}}let i,l=t.children.find(f=>W(f.tag)==="TitlesOfParts");if(l){let f=l.children[0];f&&(i=f.children.map(h=>h.text??""))}let d=new Set(["Application","AppVersion","Company","Manager","DocSecurity","ScaleCrop","LinksUpToDate","SharedDoc","HyperlinksChanged","Characters","CharactersWithSpaces","Words","Lines","Paragraphs","Pages","Slides","Notes","HiddenSlides","MMClips","Template","PresentationFormat","TotalTime","HyperlinkBase","HeadingPairs","TitlesOfParts"]),c=t.children.filter(f=>!d.has(W(f.tag))).map(f=>{let h=Object.entries(f.attrs).map(([x,g])=>` ${x}="${g}"`).join(""),p=f.text??"";return!p&&!f.children.length?`<${f.tag}${h}/>`:`<${f.tag}${h}>${p}</${f.tag}>`}).join(`
254
+ `);return{props:{application:e("Application"),appVersion:e("AppVersion"),company:e("Company"),manager:e("Manager"),docSecurity:o("DocSecurity"),scaleCrop:r("ScaleCrop"),linksUpToDate:r("LinksUpToDate"),sharedDoc:r("SharedDoc"),hyperlinksChanged:r("HyperlinksChanged"),characters:o("Characters"),charactersByWord:o("CharactersWithSpaces"),words:o("Words"),lines:o("Lines"),paragraphs:o("Paragraphs"),pages:o("Pages"),slides:o("Slides"),notes:o("Notes"),hiddenSlides:o("HiddenSlides"),mmClips:o("MMClips"),template:e("Template"),presentationFormat:e("PresentationFormat"),totalTime:o("TotalTime"),hyperlinkBase:e("HyperlinkBase"),headingPairs:n,titlesOfParts:i},unknownRaw:c}}function ws(s){return Ft(s).children.filter(e=>W(e.tag)==="property").map(e=>{let o=e.attrs.name??"",r=e.children[0];if(!r)return null;let n=W(r.tag),a=r.text??"",i;switch(n){case"lpwstr":case"lpstr":case"bstr":i={type:"string",value:a};break;case"i4":case"int":i={type:"int",value:parseInt(a,10)};break;case"decimal":i={type:"decimal",value:parseFloat(a)};break;case"bool":i={type:"bool",value:a==="true"||a==="1"};break;case"filetime":i={type:"date",value:new Date(a)};break;case"r8":i={type:"r8",value:parseFloat(a)};break;case"i8":i={type:"i8",value:BigInt(a)};break;case"error":i={type:"error",value:a};break;default:i={type:"string",value:a};break}return{name:o,value:i}}).filter(Boolean)}function Ve(s){let t=new Map;try{let e=Ft(s);for(let o of e.children)if(W(o.tag)==="Relationship"){let r={type:o.attrs.Type??"",target:o.attrs.Target??""};o.attrs.TargetMode&&(r.targetMode=o.attrs.TargetMode),t.set(o.attrs.Id??"",r)}}catch{}return t}function Lo(s){let t=new Map;try{let e=Ft(s);for(let o of e.children)if(W(o.tag)==="Override"){let n=o.attrs.PartName??"",a=o.attrs.ContentType??"";t.set(n.startsWith("/")?n.slice(1):n,a)}}catch{}return t}function Xo(s){let t=Ft(s),e=new Map,o=[],r={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},n=At(t,"numFmts");if(n)for(let x of q(n,"numFmt")){let g=parseInt(x.attrs.numFmtId??"0",10),$=x.attrs.formatCode??"";e.set(g,$)}let a=At(t,"fonts"),i=[];if(a)for(let x of q(a,"font"))i.push(Ue(x));let l=At(t,"fills"),d=[];if(l)for(let x of q(l,"fill"))d.push(vs(x));let m=At(t,"borders"),c=[];if(m)for(let x of q(m,"border"))c.push(Cs(x));let f=At(t,"cellXfs");if(f)for(let x of q(f,"xf")){let g=parseInt(x.attrs.fontId??"0",10),$=parseInt(x.attrs.fillId??"0",10),b=parseInt(x.attrs.borderId??"0",10),k=parseInt(x.attrs.numFmtId??"0",10),P=x.attrs.applyFont==="1",I=x.attrs.applyFill==="1",v=x.attrs.applyBorder==="1",y=x.attrs.applyAlignment==="1",O=x.attrs.applyNumberFormat==="1",S=x.attrs.applyProtection==="1",_={};P&&i[g]&&(_.font=i[g]),I&&d[$]&&(_.fill=d[$]),v&&c[b]&&(_.border=c[b]),O&&k!==0&&(e.has(k)?_.numberFormat={formatCode:e.get(k)}:r[k]&&(_.numFmtId=k));let R=C(x,"alignment");y&&R&&(_.alignment=Is(R));let M=C(x,"protection");S&&M&&(M.attrs.locked!==void 0&&(_.locked=M.attrs.locked!=="0"),M.attrs.hidden!==void 0&&(_.hidden=M.attrs.hidden!=="0")),o.push(_)}let h=[],p=At(t,"dxfs");if(p)for(let x of q(p,"dxf")){let g={},$=C(x,"font");$&&(g.font=Ue($));let b=C(x,"fill");b&&(g.fill=vs(b));let k=C(x,"border");k&&(g.border=Cs(k));let P=C(x,"numFmt");if(P){let v=P.attrs.formatCode??"";v&&(g.numberFormat={formatCode:v})}let I=C(x,"alignment");I&&(g.alignment=Is(I)),h.push(g)}return{xfs:o,numFmts:e,dxfs:h}}function At(s,t){if(W(s.tag)===t)return s;for(let e of s.children){let o=At(e,t);if(o)return o}}function Ue(s){let t={};for(let e of s.children)switch(W(e.tag)){case"b":t.bold=e.attrs.val!=="0";break;case"i":t.italic=e.attrs.val!=="0";break;case"strike":t.strike=e.attrs.val!=="0";break;case"u":t.underline=e.attrs.val??"single";break;case"sz":t.size=parseFloat(e.attrs.val??"11");break;case"name":t.name=e.attrs.val;break;case"family":t.family=parseInt(e.attrs.val??"0",10);break;case"scheme":t.scheme=e.attrs.val;break;case"charset":t.charset=parseInt(e.attrs.val??"0",10);break;case"vertAlign":t.vertAlign=e.attrs.val;break;case"color":{let o=e.attrs.rgb,r=e.attrs.theme;o?t.color=o:r&&(t.color=`theme:${r}${e.attrs.tint?":tint:"+e.attrs.tint:""}`);break}}return t}function vs(s){let t=C(s,"patternFill");if(t){let o=C(t,"fgColor"),r=C(t,"bgColor");return{type:"pattern",pattern:t.attrs.patternType,fgColor:o?.attrs.rgb??(o?.attrs.theme?`theme:${o.attrs.theme}${o.attrs.tint?":tint:"+o.attrs.tint:""}`:void 0),bgColor:r?.attrs.rgb??(r?.attrs.theme?`theme:${r.attrs.theme}${r.attrs.tint?":tint:"+r.attrs.tint:""}`:void 0)}}let e=C(s,"gradientFill");if(e){let o=q(e,"stop").concat(q(e,"gradientStop")).map(r=>{let n=C(r,"color");return{position:parseFloat(r.attrs.position??"0"),color:n?.attrs.rgb??(n?.attrs.theme?`theme:${n.attrs.theme}${n.attrs.tint?":tint:"+n.attrs.tint:""}`:"FF000000")}});return{type:"gradient",gradientType:e.attrs.type,degree:e.attrs.degree?parseFloat(e.attrs.degree):void 0,stops:o}}return{type:"pattern",pattern:"none"}}function Cs(s){let t=e=>{let o=C(s,e);if(!o)return;let r=o.attrs.style,n=C(o,"color");if(!r&&!n)return;let a=n?.attrs.rgb??(n?.attrs.theme?`theme:${n.attrs.theme}${n.attrs.tint?":tint:"+n.attrs.tint:""}`:void 0);return{style:r,color:a}};return{left:t("left"),right:t("right"),top:t("top"),bottom:t("bottom"),diagonal:t("diagonal"),diagonalUp:s.attrs.diagonalUp==="1",diagonalDown:s.attrs.diagonalDown==="1"}}function Is(s){let t={};return s.attrs.horizontal&&(t.horizontal=s.attrs.horizontal),s.attrs.vertical&&(t.vertical=s.attrs.vertical),s.attrs.wrapText&&(t.wrapText=s.attrs.wrapText!=="0"),s.attrs.shrinkToFit&&(t.shrinkToFit=s.attrs.shrinkToFit!=="0"),s.attrs.textRotation&&(t.textRotation=parseInt(s.attrs.textRotation,10)),s.attrs.indent&&(t.indent=parseInt(s.attrs.indent,10)),s.attrs.readingOrder&&(t.readingOrder=parseInt(s.attrs.readingOrder,10)),t}function Vo(s){let t=Ft(s);return q(t,"si").map(e=>{let o=C(e,"t"),r=q(e,"r");if(o&&!r.length)return{text:o.text??""};let n=r.map(l=>{let d=C(l,"t")?.text??"",m=C(l,"rPr"),c={text:d};return m&&(c.font=Ue(m)),c}),a=n.map(l=>l.text).join("");return n.some(l=>l.font&&Object.keys(l.font).length>0)?{text:a,richText:n}:{text:a}})}function Uo(s,t,e,o){let r=new Ut(t),n=Ft(s),a=[],i=[],l="",d="",m=[],c=new Map,f=new Set(["sheetPr","dimension","sheetViews","sheetFormatPr","cols","sheetData","mergeCells","conditionalFormatting","dataValidations","sheetProtection","printOptions","pageMargins","pageSetup","headerFooter","drawing","tableParts","autoFilter","rowBreaks","colBreaks","picture","oleObjects","ctrlProps","legacyDrawing","AlternateContent","extLst"]);for(let h of n.children){let p=W(h.tag);switch(p){case"sheetViews":Wo(h,r);break;case"cols":zo(h,r,e);break;case"sheetData":Ho(h,r,e,o,c);break;case"mergeCells":qo(h,r);break;case"autoFilter":r.autoFilter={ref:h.attrs.ref??""};break;case"tableParts":for(let x of q(h,"tablePart")){let g=x.attrs["r:id"]??"";g&&i.push(g)}break;case"sheetProtection":Go(h,r);break;case"pageMargins":Zo(h,r);break;case"pageSetup":Yo(h,r);break;case"headerFooter":Ko(h,r);break;case"printOptions":Jo(h,r);break;case"conditionalFormatting":Qo(h,r,e);break;case"dataValidations":tr(h,r);break;case"rowBreaks":for(let x of q(h,"brk")){let g=parseInt(x.attrs.id??"0",10);g>0&&r.addRowBreak(g,x.attrs.man==="1")}break;case"colBreaks":for(let x of q(h,"brk")){let g=parseInt(x.attrs.id??"0",10);g>0&&r.addColBreak(g,x.attrs.man==="1")}break;case"drawing":d=h.attrs["r:id"]??"";break;case"legacyDrawing":l=h.attrs["r:id"]??"";break;case"AlternateContent":{let x=h.children.find($=>typeof $!="string"&&W($.tag)==="Choice"),g=x?x.children.find($=>typeof $!="string"&&W($.tag)==="controls"):void 0;if(g)for(let $ of g.children){if(typeof $=="string")continue;let b;if(W($.tag)==="control"?b=$:W($.tag)==="AlternateContent"&&(b=$.children.find(v=>typeof v!="string"&&W(v.tag)==="Choice")?.children.find(v=>typeof v!="string"&&W(v.tag)==="control")),!b)continue;let k=b.children.find(I=>typeof I!="string"&&W(I.tag)==="controlPr"),P=b.attrs["r:id"]??k?.attrs["r:id"]??"";P&&m.push(P)}break}case"extLst":nr(h,r);break;default:f.has(p)||a.push(ae(h));break}}return{ws:r,originalXml:s,unknownParts:a,tableRIds:i,legacyDrawingRId:l,ctrlPropRIds:m,drawingRId:d,vmCells:c}}function Wo(s,t){let e=q(s,"sheetView")[0];if(!e)return;t.view={showGridLines:e.attrs.showGridLines!=="0",showRowColHeaders:e.attrs.showRowColHeaders!=="0",zoomScale:e.attrs.zoomScale?parseInt(e.attrs.zoomScale,10):void 0,rightToLeft:e.attrs.rightToLeft==="1",tabSelected:e.attrs.tabSelected==="1",view:e.attrs.view};let o=C(e,"pane");o&&o.attrs.state==="frozen"&&(t.freezePane={col:o.attrs.xSplit?parseInt(o.attrs.xSplit,10):void 0,row:o.attrs.ySplit?parseInt(o.attrs.ySplit,10):void 0})}function zo(s,t,e){for(let o of q(s,"col")){let r=parseInt(o.attrs.min??"1",10),n=parseInt(o.attrs.max??"1",10),a={width:o.attrs.width?parseFloat(o.attrs.width):void 0,hidden:o.attrs.hidden==="1",customWidth:o.attrs.customWidth==="1",outlineLevel:o.attrs.outlineLevel?parseInt(o.attrs.outlineLevel,10):void 0,style:o.attrs.style?e.xfs[parseInt(o.attrs.style,10)]:void 0};for(let i=r;i<=n;i++)t.setColumn(i,a)}}function Ho(s,t,e,o,r){for(let n of q(s,"row")){let a=parseInt(n.attrs.r??"0",10);if(!a)continue;let i={};n.attrs.ht&&(i.height=parseFloat(n.attrs.ht)),n.attrs.hidden&&(i.hidden=n.attrs.hidden==="1"),n.attrs.outlineLevel&&(i.outlineLevel=parseInt(n.attrs.outlineLevel,10)),n.attrs.collapsed&&(i.collapsed=n.attrs.collapsed==="1"),n.attrs.s&&(i.style=e.xfs[parseInt(n.attrs.s,10)]),Object.keys(i).length&&t.setRow(a,i);for(let l of q(n,"c")){let d=l.attrs.r??"";if(!d)continue;let{row:m,col:c}=kt(d),f=l.attrs.s?parseInt(l.attrs.s,10):0,h=f>0?e.xfs[f]:void 0,p=l.attrs.t??"",x=C(l,"f"),g=C(l,"v"),$={};h&&($.style=h);let b=l.attrs.vm;if(b&&r&&r.set(d,parseInt(b,10)),x)x.attrs.t==="array"?$.arrayFormula=x.text??"":$.formula=x.text??"";else if(g){let k=g.text??"";switch(p){case"s":{let P=parseInt(k,10),I=o[P];I?($.value=I.text,I.richText&&($.richText=I.richText)):$.value="";break}case"b":$.value=k==="1"||k==="true";break;case"str":case"inlineStr":{let P=C(l,"is");$.value=P?C(P,"t")?.text??k:k;break}case"e":$.value=new Xt(k);break;default:{let P=parseFloat(k);$.value=isNaN(P)?k:P;break}}}(Object.keys($).length||$.value!==void 0)&&t.setCell(m,c,$)}}}function qo(s,t){for(let e of q(s,"mergeCell")){let o=e.attrs.ref??"";o.includes(":")&&t.mergeByRef(o)}}function Go(s,t){t.protection={sheet:s.attrs.sheet!=="0",password:void 0,selectLockedCells:s.attrs.selectLockedCells!=="0",selectUnlockedCells:s.attrs.selectUnlockedCells!=="0",formatCells:s.attrs.formatCells==="0",formatColumns:s.attrs.formatColumns==="0",formatRows:s.attrs.formatRows==="0",insertColumns:s.attrs.insertColumns==="0",insertRows:s.attrs.insertRows==="0",insertHyperlinks:s.attrs.insertHyperlinks==="0",deleteColumns:s.attrs.deleteColumns==="0",deleteRows:s.attrs.deleteRows==="0",sort:s.attrs.sort==="0",autoFilter:s.attrs.autoFilter==="0",pivotTables:s.attrs.pivotTables==="0"}}function Zo(s,t){t.pageMargins={left:parseFloat(s.attrs.left??"0.7"),right:parseFloat(s.attrs.right??"0.7"),top:parseFloat(s.attrs.top??"0.75"),bottom:parseFloat(s.attrs.bottom??"0.75"),header:parseFloat(s.attrs.header??"0.3"),footer:parseFloat(s.attrs.footer??"0.3")}}function Yo(s,t){t.pageSetup={paperSize:s.attrs.paperSize?parseInt(s.attrs.paperSize,10):void 0,orientation:s.attrs.orientation,fitToPage:s.attrs.fitToPage==="1",fitToWidth:s.attrs.fitToWidth?parseInt(s.attrs.fitToWidth,10):void 0,fitToHeight:s.attrs.fitToHeight?parseInt(s.attrs.fitToHeight,10):void 0,scale:s.attrs.scale?parseInt(s.attrs.scale,10):void 0,horizontalDpi:s.attrs.horizontalDpi?parseInt(s.attrs.horizontalDpi,10):void 0,verticalDpi:s.attrs.verticalDpi?parseInt(s.attrs.verticalDpi,10):void 0}}function Ko(s,t){t.headerFooter={oddHeader:C(s,"oddHeader")?.text,oddFooter:C(s,"oddFooter")?.text,evenHeader:C(s,"evenHeader")?.text,evenFooter:C(s,"evenFooter")?.text,firstHeader:C(s,"firstHeader")?.text,firstFooter:C(s,"firstFooter")?.text,differentOddEven:s.attrs.differentOddEven==="1",differentFirst:s.attrs.differentFirst==="1"}}function Jo(s,t){t.printOptions={gridLines:s.attrs.gridLines==="1",gridLinesSet:s.attrs.gridLinesSet==="1",headings:s.attrs.headings==="1",centerHorizontal:s.attrs.horizontalCentered==="1",centerVertical:s.attrs.verticalCentered==="1"}}function Qo(s,t,e){let o=s.attrs.sqref??"";for(let r of q(s,"cfRule")){let n=r.attrs.type??"cellIs",a={sqref:o,type:n};if(r.attrs.operator&&(a.operator=r.attrs.operator),r.attrs.priority&&(a.priority=parseInt(r.attrs.priority,10)),r.attrs.text&&(a.text=r.attrs.text),r.attrs.aboveAverage==="0"&&(a.aboveAverage=!1),r.attrs.percent==="1"&&(a.percent=!0),r.attrs.rank&&(a.rank=parseInt(r.attrs.rank,10)),r.attrs.timePeriod&&(a.timePeriod=r.attrs.timePeriod),r.attrs.dxfId!==void 0){let c=parseInt(r.attrs.dxfId,10);e.dxfs[c]&&(a.style=e.dxfs[c])}let i=q(r,"formula");i[0]?.text&&(a.formula=i[0].text),i[1]?.text&&(a.formula2=i[1].text);let l=C(r,"colorScale");if(l){let c=q(l,"cfvo").map(h=>({type:h.attrs.type??"min",val:h.attrs.val})),f=q(l,"color").map(h=>h.attrs.rgb??h.attrs.theme??"");a.colorScale={type:"colorScale",cfvo:c,color:f}}let d=C(r,"dataBar");if(d){let c=q(d,"cfvo"),f=C(d,"color");a.dataBar={type:"dataBar",showValue:d.attrs.showValue!=="0"?void 0:!1,minType:c[0]?.attrs.type,minVal:c[0]?.attrs.val,maxType:c[1]?.attrs.type,maxVal:c[1]?.attrs.val,color:f?.attrs.rgb}}let m=C(r,"iconSet");if(m){let c=q(m,"cfvo").map(f=>({type:f.attrs.type??"percent",val:f.attrs.val}));a.iconSet={type:"iconSet",iconSet:m.attrs.iconSet??"3TrafficLights1",cfvo:c,showValue:m.attrs.showValue==="0"?!1:void 0,reverse:m.attrs.reverse==="1"?!0:void 0}}t.addConditionalFormat(a)}}function tr(s,t){for(let e of q(s,"dataValidation")){let o=e.attrs.sqref??"";if(!o)continue;let r=e.attrs.type??"whole",n={type:r};e.attrs.operator&&(n.operator=e.attrs.operator),e.attrs.allowBlank==="1"&&(n.allowBlank=!0),e.attrs.showErrorMessage==="1"&&(n.showErrorAlert=!0),e.attrs.errorTitle&&(n.errorTitle=e.attrs.errorTitle),e.attrs.error&&(n.error=e.attrs.error),e.attrs.showInputMessage==="1"&&(n.showInputMessage=!0),e.attrs.promptTitle&&(n.promptTitle=e.attrs.promptTitle),e.attrs.prompt&&(n.prompt=e.attrs.prompt),e.attrs.showDropDown==="1"&&(n.showDropDown=!1);let a=C(e,"formula1"),i=C(e,"formula2");a?.text&&(r==="list"&&a.text.startsWith('"')&&a.text.endsWith('"')?n.list=a.text.slice(1,-1).split(","):n.formula1=a.text),i?.text&&(n.formula2=i.text),t.addDataValidation(o,n)}}function er(s){try{let t=Ft(s);if(W(t.tag)!=="table")return null;let o=t.attrs.name??"",r=t.attrs.displayName??o,n=t.attrs.ref??"",a=parseInt(t.attrs.totalsRowCount??"0",10),i=[],l=At(t,"tableColumns");if(l)for(let c of q(l,"tableColumn")){let f={name:c.attrs.name??""};c.attrs.totalsRowFunction&&(f.totalsRowFunction=c.attrs.totalsRowFunction),c.attrs.totalsRowFormula&&(f.totalsRowFormula=c.attrs.totalsRowFormula),c.attrs.totalsRowLabel&&(f.totalsRowLabel=c.attrs.totalsRowLabel),i.push(f)}let d={name:o,ref:n,columns:i};r&&r!==o&&(d.displayName=r),a>0&&(d.totalsRow=!0);let m=At(t,"tableStyleInfo");return m&&(m.attrs.name&&(d.style=m.attrs.name),m.attrs.showFirstColumn==="1"&&(d.showFirstColumn=!0),m.attrs.showLastColumn==="1"&&(d.showLastColumn=!0),m.attrs.showRowStripes==="1"&&(d.showRowStripes=!0),m.attrs.showColumnStripes==="1"&&(d.showColumnStripes=!0)),d}catch{return null}}var qt=9525;function Ss(s){return{col:parseInt(C(s,"col")?.text??"0",10),row:parseInt(C(s,"row")?.text??"0",10),colOff:parseInt(C(s,"colOff")?.text??"0",10),rowOff:parseInt(C(s,"rowOff")?.text??"0",10)}}function Ts(s){return{png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",emf:"emf",wmf:"wmf",tiff:"tiff",tif:"tiff",svg:"svg",ico:"ico",webp:"webp",bmp:"bmp"}[s.toLowerCase()]??"png"}function sr(s,t,e,o,r){let n=Ft(s);for(let a of n.children){if(typeof a=="string")continue;let i=W(a.tag);if(i!=="twoCellAnchor"&&i!=="oneCellAnchor"&&i!=="absoluteAnchor")continue;let l=ar(a,i),d=Z(a,"pic");if(d){ir(d,a,i,l,t,e,o,r);continue}let m=Z(a,"graphicFrame");if(m){or(m,a,i,t,e,o,r);continue}let c=Z(a,"oMath");if(c){lr(c,a,i,l,r);continue}let f=Z(a,"sp");if(f){rr(f,a,i,r);continue}}}function or(s,t,e,o,r,n,a){let i=Z(s,"chart");if(!i||!o)return;let l=i.attrs["r:id"]??ys(i,"r:id")??"";if(!l)return;let d=o.get(l);if(!d)return;let m=d.target.startsWith("/")?d.target.slice(1):te(r,d.target),c=n(m);if(!c)return;let h=new TextDecoder().decode(c.data),p=Ft(h),x={col:0,row:0},g={col:8,row:15};if(e==="twoCellAnchor"){let T=C(t,"from"),D=C(t,"to");T&&(x={col:parseInt(C(T,"col")?.text??"0",10),row:parseInt(C(T,"row")?.text??"0",10)}),D&&(g={col:parseInt(C(D,"col")?.text??"0",10),row:parseInt(C(D,"row")?.text??"0",10)})}let $=Z(p,"plotArea");if(!$)return;let b={barChart:"column",bar3DChart:"column",lineChart:"line",line3DChart:"line",areaChart:"area",area3DChart:"area",pieChart:"pie",pie3DChart:"pie",doughnutChart:"doughnut",scatterChart:"scatter",bubbleChart:"bubble",radarChart:"radar",stockChart:"stock"},k="column",P;for(let T of $.children){if(typeof T=="string")continue;let D=W(T.tag);if(b[D]){if(k=b[D],P=T,D==="barChart"||D==="bar3DChart"){(C(T,"barDir")?.attrs.val??"")==="bar"&&(k="bar");let at=C(T,"grouping")?.attrs.val??"";at==="stacked"&&(k=k==="bar"?"barStacked":"columnStacked"),at==="percentStacked"&&(k=k==="bar"?"barStacked100":"columnStacked100")}if(D==="lineChart"){let z=Z(T,"marker");if(z){let et=C(z,"symbol")?.attrs.val??"";et&&et!=="none"&&(k="lineMarker")}}D==="scatterChart"&&C(T,"scatterStyle")?.attrs.val?.includes("Smooth")&&(k="scatterSmooth"),D==="radarChart"&&C(T,"radarStyle")?.attrs.val==="filled"&&(k="radarFilled");break}}if(!P)return;let I=[];for(let T of q(P,"ser")){let D={values:""},z=C(T,"tx");if(z){let st=Z(z,"strRef");if(st){let Dt=C(st,"f");Dt?.text&&(D.name=Dt.text);let Tt=C(st,"strCache");if(Tt){let Bt=Z(Tt,"pt"),_t=Bt?Z(Bt,"v"):void 0;_t?.text&&(D.name=_t.text)}}let J=Z(z,"v");J?.text&&!D.name&&(D.name=J.text)}let et=C(T,"val")||C(T,"yVal");if(et){let st=Z(et,"numRef");if(st){let J=C(st,"f");J?.text&&(D.values=J.text)}}let pt=C(T,"cat")||C(T,"xVal");if(pt){let st=Z(pt,"strRef"),J=Z(pt,"numRef"),Dt=st||J;if(Dt){let Tt=C(Dt,"f");Tt?.text&&(D.categories=Tt.text)}}let at=C(T,"spPr");if(at){let st=C(at,"solidFill");if(st){let J=C(st,"srgbClr");J?.attrs.val&&(D.color="#"+J.attrs.val)}}D.values&&I.push(D)}if(!I.length)return;let v,y=C(p,"title")||Z(p,"title");if(y){let T=Z(y,"t");T?.text&&(v=T.text)}let O,S,_=Z($,"catAx")||Z($,"dateAx"),R=Z($,"valAx");if(_){O={};let T=Z(_,"title");if(T){let D=Z(T,"t");D?.text&&(O.title=D.text)}}if(R){S={};let T=Z(R,"title");if(T){let z=Z(T,"t");z?.text&&(S.title=z.text)}C(R,"majorGridlines")&&(S.gridLines=!0)}let M=!1,A=Z(p,"legend");A&&(M=C(A,"legendPos")?.attrs.val||!0);let H=C(P,"varyColors")?.attrs.val!=="0",X={type:k,series:I,from:x,to:g};v&&(X.title=v),O&&(X.xAxis=O),S&&(X.yAxis=S),M!==!1&&(X.legend=M),H&&(X.varyColors=!0),a.addChart(X)}function rr(s,t,e,o){let r={col:0,row:0},n={col:2,row:2};if(e==="twoCellAnchor"){let g=C(t,"from"),$=C(t,"to");g&&(r={col:parseInt(C(g,"col")?.text??"0",10),row:parseInt(C(g,"row")?.text??"0",10)}),$&&(n={col:parseInt(C($,"col")?.text??"0",10),row:parseInt(C($,"row")?.text??"0",10)})}let a=Z(s,"spPr"),i="rect",l,d,m,c;if(a){let g=Z(a,"prstGeom");if(g){let P=g.attrs.prst??"";new Set(["rect","roundRect","ellipse","triangle","diamond","pentagon","hexagon","octagon","star5","star6","rightArrow","leftArrow","upArrow","downArrow","line","curvedConnector3","callout1","callout2","cloud","heart","lightningBolt","sun","moon","smileyFace","flowChartProcess","flowChartDecision","flowChartTerminator","flowChartDocument"]).has(P)&&(i=P)}let $=C(a,"solidFill");if($){let P=C($,"srgbClr");P?.attrs.val&&(l="#"+P.attrs.val);let I=C($,"schemeClr");I?.attrs.val&&(l="theme:"+I.attrs.val)}let b=C(a,"ln");if(b){let P=b.attrs.w;P&&(m=Math.round(parseInt(P,10)/qt));let I=C(b,"solidFill");if(I){let v=C(I,"srgbClr");v?.attrs.val&&(d="#"+v.attrs.val)}}let k=Z(a,"xfrm");k?.attrs.rot&&(c=parseInt(k.attrs.rot,10)/6e4)}let f,h,p=Z(s,"txBody");if(p){let g=C(p,"bodyPr"),b=(g?C(g,"prstTxWarp"):void 0)?.attrs.prst??g?.attrs.prstTxWarp??"",k=[];for(let I of q(p,"p"))for(let v of q(I,"r")){let y=C(v,"t");if(y?.text&&k.push(y.text),!h){let O=C(v,"rPr");if(O){h={},O.attrs.sz&&(h.size=parseInt(O.attrs.sz,10)/100),O.attrs.b==="1"&&(h.bold=!0),O.attrs.i==="1"&&(h.italic=!0);let S=Z(O,"latin");S?.attrs.typeface&&(h.name=S.attrs.typeface);let _=C(O,"solidFill");if(_){let R=C(_,"srgbClr");R?.attrs.val&&(h.color="#"+R.attrs.val)}}}}if(f=k.join(""),b&&new Set(["textPlain","textArchUp","textArchDown","textCircle","textWave1","textWave2","textInflate","textDeflate","textFadeUp","textFadeDown","textFadeLeft","textFadeRight","textSlantUp","textSlantDown","textCascadeUp","textCascadeDown","textChevron","textRingInside","textRingOutside","textStop"]).has(b)&&f){let I={text:f,from:r,to:n};b!=="textPlain"&&(I.preset=b),h&&(I.font=h),l&&(I.fillColor=l),d&&(I.outlineColor=d),o.addWordArt(I);return}}let x={type:i,from:r,to:n};f&&(x.text=f),l&&(x.fillColor=l),d&&(x.lineColor=d),m&&(x.lineWidth=m),h&&(x.font=h),c&&(x.rotation=c),o.addShape(x)}function nr(s,t){for(let e of q(s,"ext")){let o=e.children?.filter(r=>typeof r!="string"&&W(r.tag)==="sparklineGroups");if(o?.length)for(let r of o)for(let n of q(r,"sparklineGroup")){let a=n.attrs.type??"line",i=a==="column"?"bar":a==="stacked"?"stacked":"line",l=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorSeries"),d=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorHigh"),m=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorLow"),c=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorFirst"),f=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorLast"),h=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorNegative"),p=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="colorMarkers"),x=n.attrs.high==="1",g=n.attrs.low==="1",$=n.attrs.first==="1",b=n.attrs.last==="1",k=n.attrs.negative==="1",P=n.attrs.markers==="1",I=n.attrs.lineWeight,v=I?parseFloat(I):void 0,y=n.attrs.minAxisType==="individual"?"individual":n.attrs.minAxisType==="custom"?"custom":void 0,O=n.attrs.maxAxisType==="individual"?"individual":n.attrs.maxAxisType==="custom"?"custom":void 0,S=n.children?.find(R=>typeof R!="string"&&W(R.tag)==="sparklines");if(!S)continue;let _=S.children?.filter(R=>typeof R!="string"&&W(R.tag)==="sparkline");if(_)for(let R of _){let M=R.children?.find(T=>typeof T!="string"&&W(T.tag)==="f"),A=R.children?.find(T=>typeof T!="string"&&W(T.tag)==="sqref"),j=M?.text??"",H=A?.text??"";if(!j||!H)continue;let X={type:i,dataRange:j,location:H};if(l){let T=l.attrs.rgb;T&&(X.color="#"+T.slice(2));let D=l.attrs.theme;D&&(X.color="theme:"+D)}if(d){let T=d.attrs.rgb;T&&(X.highColor="#"+T.slice(2));let D=d.attrs.theme;D&&(X.highColor="theme:"+D)}if(m){let T=m.attrs.rgb;T&&(X.lowColor="#"+T.slice(2));let D=m.attrs.theme;D&&(X.lowColor="theme:"+D)}if(c){let T=c.attrs.rgb;T&&(X.firstColor="#"+T.slice(2));let D=c.attrs.theme;D&&(X.firstColor="theme:"+D)}if(f){let T=f.attrs.rgb;T&&(X.lastColor="#"+T.slice(2));let D=f.attrs.theme;D&&(X.lastColor="theme:"+D)}if(h){let T=h.attrs.rgb;T&&(X.negativeColor="#"+T.slice(2));let D=h.attrs.theme;D&&(X.negativeColor="theme:"+D)}if(p){let T=p.attrs.rgb;T&&(X.markersColor="#"+T.slice(2));let D=p.attrs.theme;D&&(X.markersColor="theme:"+D)}x&&(X.showHigh=!0),g&&(X.showLow=!0),$&&(X.showFirst=!0),b&&(X.showLast=!0),k&&(X.showNegative=!0),P&&(X.showMarkers=!0),v!==void 0&&(X.lineWidth=v),y&&(X.minAxisType=y),O&&(X.maxAxisType=O),t.addSparkline(X)}}}}function ar(s,t){let e={};if(t==="twoCellAnchor"||t==="oneCellAnchor"){let o=C(s,"from");o&&(e.from={col:parseInt(C(o,"col")?.text??"0",10),row:parseInt(C(o,"row")?.text??"0",10),colOff:parseInt(C(o,"colOff")?.text??"0",10),rowOff:parseInt(C(o,"rowOff")?.text??"0",10)})}if(t==="oneCellAnchor"){let o=Z(s,"ext");o&&(e.width=parseInt(o.attrs.cx??"0",10),e.height=parseInt(o.attrs.cy??"0",10))}return e}function ir(s,t,e,o,r,n,a,i){let l=Z(s,"blipFill"),d=l?Z(l,"blip"):void 0,m=d?.attrs["r:embed"]??d?.attrs.embed??"";if(!m||!r)return;let c=r.get(m);if(!c)return;let f=c.target.startsWith("/")?c.target.slice(1):te(n,c.target),h=a(f);if(!h)return;let p=f.split(".").pop()??"png",x=Ts(p),$=Z(s,"cNvPr")?.attrs.descr||void 0,b={data:h.data,format:x};if($&&(b.altText=$),e==="twoCellAnchor"){let k=C(t,"from"),P=C(t,"to");k&&(b.from=Ss(k)),P&&(b.to=Ss(P))}else if(e==="oneCellAnchor")o.from&&(b.from=o.from),o.width&&(b.width=Math.round(o.width/qt)),o.height&&(b.height=Math.round(o.height/qt));else{let k=C(t,"pos"),P=C(t,"ext");k&&(b.position={x:Math.round(parseInt(k.attrs.x??"0",10)/qt),y:Math.round(parseInt(k.attrs.y??"0",10)/qt)}),P&&(b.width=Math.round(parseInt(P.attrs.cx??"0",10)/qt),b.height=Math.round(parseInt(P.attrs.cy??"0",10)/qt))}i.addImage(b)}function lr(s,t,e,o,r){let n=ht(s);if(!n.length)return;let a=o.from??{col:0,row:0},i={elements:n,from:a};o.width&&(i.width=o.width),o.height&&(i.height=o.height);let l=Z(s,"rPr");if(l){let d=l.attrs.sz;d&&(i.fontSize=parseInt(d,10)/100);let m=Z(l,"latin");m?.attrs.typeface&&(i.fontName=m.attrs.typeface)}r.addMathEquation(i)}function ht(s){let t=[];for(let e of s.children){if(typeof e=="string")continue;let o=cr(e);o&&t.push(o)}return t}function cr(s){switch(W(s.tag)){case"r":return{type:"text",text:Z(s,"t")?.text??""};case"f":{let e=C(s,"num"),o=C(s,"den");return{type:"frac",base:e?ht(e):[],argument:o?ht(o):[]}}case"sSup":{let e=C(s,"e"),o=C(s,"sup");return{type:"sup",base:e?ht(e):[],argument:o?ht(o):[]}}case"sSub":{let e=C(s,"e"),o=C(s,"sub");return{type:"sub",base:e?ht(e):[],argument:o?ht(o):[]}}case"sSubSup":{let e=C(s,"e"),o=C(s,"sub"),r=C(s,"sup");return{type:"subSup",base:e?ht(e):[],subscript:o?ht(o):[],superscript:r?ht(r):[]}}case"nary":{let e=C(s,"naryPr"),o=e?C(e,"chr"):void 0,r=o?.attrs["m:val"]??o?.attrs.val??"\u2211",n=C(s,"sub"),a=C(s,"sup"),i=C(s,"e");return{type:"nary",operator:r,lower:n?ht(n):[],upper:a?ht(a):[],body:i?ht(i):[]}}case"rad":{let e=C(s,"radPr"),o=e?C(e,"degHide"):void 0,r=o?.attrs["m:val"]==="1"||o?.attrs.val==="1",n=C(s,"deg"),a=C(s,"e");return{type:"rad",hideDegree:r,degree:n?ht(n):[],body:a?ht(a):[]}}case"d":{let e=C(s,"dPr"),o=e?C(e,"begChr"):void 0,r=e?C(e,"endChr"):void 0,n=C(s,"e");return{type:"delim",open:o?.attrs["m:val"]??o?.attrs.val??"(",close:r?.attrs["m:val"]??r?.attrs.val??")",body:n?ht(n):[]}}case"func":{let e=C(s,"fName"),o=C(s,"e");return{type:"func",base:e?ht(e):[],argument:o?ht(o):[]}}case"groupChr":{let e=C(s,"groupChrPr"),o=e?C(e,"chr"):void 0,r=C(s,"e");return{type:"groupChar",operator:o?.attrs["m:val"]??o?.attrs.val??"\u23DF",base:r?ht(r):[]}}case"acc":{let e=C(s,"accPr"),o=e?C(e,"chr"):void 0,r=C(s,"e");return{type:"accent",operator:o?.attrs["m:val"]??o?.attrs.val??"\u0302",base:r?ht(r):[]}}case"bar":{let e=C(s,"e");return{type:"bar",base:e?ht(e):[]}}case"limLow":{let e=C(s,"e"),o=C(s,"lim");return{type:"limLow",base:e?ht(e):[],argument:o?ht(o):[]}}case"limUpp":{let e=C(s,"e"),o=C(s,"lim");return{type:"limUpp",base:e?ht(e):[],argument:o?ht(o):[]}}case"m":{let e=[];for(let o of q(s,"mr")){let r=[];for(let n of q(o,"e")){let a=ht(n);a.length===1?r.push(a[0]):r.push({type:"text",text:a.map(i=>i.text??"").join("")})}e.push(r)}return{type:"matrix",rows:e}}case"eqArr":{let e=[];for(let o of q(s,"e"))e.push(ht(o));return{type:"eqArr",rows:e}}default:return null}}function mr(s,t,e,o){let r=t("xl/metadata.xml");if(!r)return;let n=Ft(r),a=C(n,"valueMetadata");if(!a)return;let i=q(a,"bk"),l=n.children.find(b=>typeof b!="string"&&W(b.tag)==="futureMetadata"),d=l?q(l,"bk"):[],m=t("xl/richData/rdrichvalue.xml");if(!m)return;let c=Ft(m),f=q(c,"rv"),h=t("xl/richData/_rels/richValueRel.xml.rels");if(!h)return;let p=Ve(h),x=t("xl/richData/richValueRel.xml");if(!x)return;let g=Ft(x),$=q(g,"rel");for(let[b,k]of s){let P=i[k-1];if(!P)continue;let I=P.children.find(et=>typeof et!="string"&&W(et.tag)==="rc");if(!I)continue;let v=parseInt(I.attrs.v??"-1",10);if(v<0)continue;let y=d[v];if(!y)continue;let O=Z(y,"rvb"),S=parseInt(O?.attrs.i??"-1",10);if(S<0)continue;let _=f[S];if(!_)continue;let R=q(_,"v"),M=parseInt(R[0]?.text??"-1",10);if(M<0)continue;let A=$[M];if(!A)continue;let j=A.attrs["r:id"]??"",H=p.get(j);if(!H)continue;let X=H.target.startsWith("/")?H.target.slice(1):`xl/richData/${H.target}`,T=e(X);if(!T)continue;let D=X.split(".").pop()??"png",z=Ts(D);o.addCellImage({data:T.data,format:z,cell:b})}}function Z(s,t){for(let e of s.children){if(typeof e=="string")continue;if(W(e.tag)===t)return e;let o=Z(e,t);if(o)return o}}function te(s,t){let e=s.replace(/\/$/,"").split("/");for(let o of t.split("/"))o===".."?e.pop():o!=="."&&e.push(o);return e.join("/")}async function ks(s){let t=await Ee(s),e=T=>t.get(T)??t.get(T.replace(/^\//,"")),o=T=>{let D=e(T);return D?ue(D):void 0},r=o("[Content_Types].xml")??"<Types/>",n=Lo(r),a=o("xl/_rels/workbook.xml.rels")??"<Relationships/>",i=Ve(a),l=o("xl/workbook.xml")??"<workbook/>",d=o("xl/styles.xml")??"<styleSheet/>",m=Xo(d),c=o("xl/sharedStrings.xml")??"<sst/>",f=c!=="<sst/>"?Vo(c):[],h=o("docProps/core.xml")??"",p=h?bs(h):{},x=o("docProps/app.xml")??"",g={},$="";if(x){let T=Fs(x);g=T.props,$=T.unknownRaw}let b=o("docProps/custom.xml")??"",k=b?ws(b):[],P=Ft(l),I=At(P,"sheets"),v=I?q(I,"sheet"):[],y=[],O=At(P,"definedNames");if(O)for(let T of q(O,"definedName")){let D=T.attrs.name??"",z=T.text??"";if(!D||!z)continue;let et={name:D,ref:z};if(T.attrs.localSheetId!==void 0){let pt=parseInt(T.attrs.localSheetId,10),at=v[pt];at&&(et.scope=at.attrs.name??void 0)}T.attrs.comment&&(et.comment=T.attrs.comment),y.push(et)}let S=new Map;for(let[T,D]of t)T.includes("_rels/")&&S.set(T,Ve(ue(D)));let _=[];for(let T of v){let D=T.attrs["r:id"]??Object.values(T.attrs).find(B=>B.startsWith("rId"))??"",z=T.attrs.sheetId??"",et=T.attrs.name??`Sheet${z}`,pt=i.get(D);if(!pt)continue;let at=pt.target.startsWith("/")?pt.target.slice(1):`xl/${pt.target}`,st=o(at)??"";if(!st)continue;let{ws:J,originalXml:Dt,unknownParts:Tt,tableRIds:Bt,legacyDrawingRId:_t,ctrlPropRIds:Et,drawingRId:V,vmCells:L}=Uo(st,et,m,f);J.sheetIndex=_.length+1,J.rId=D;let u=[],F=[];if(Bt.length){let B=at.split("/").pop()??"",N=at.substring(0,at.lastIndexOf("/")+1),U=`${N}_rels/${B}.rels`,rt=S.get(U);if(rt){for(let ot of Bt){let mt=rt.get(ot);if(!mt)continue;let Y=mt.target.startsWith("/")?mt.target.slice(1):te(N,mt.target),it=o(Y);if(it){let gt=er(it);gt&&J.addTable(gt),u.push(Y),F.push(it)}}J.tableRIds=Bt}}if(_t&&Et.length){let B=at.split("/").pop()??"",N=at.substring(0,at.lastIndexOf("/")+1),U=`${N}_rels/${B}.rels`,rt=S.get(U);if(rt){let ot=rt.get(_t),mt=ot?ot.target.startsWith("/")?ot.target.slice(1):te(N,ot.target):"",Y=mt?o(mt):"",it=[];if(Y){let gt=Ft(Y);for(let ut of gt.children){if(typeof ut=="string"||W(ut.tag)!=="shape")continue;let K=ut.children.find(lt=>typeof lt!="string"&&W(lt.tag)==="ClientData");if(!K)continue;let ft=K.attrs.ObjectType??"";if(ft==="Note"||!ft)continue;let nt=(ut.attrs.id??"").replace(/\D/g,""),G=parseInt(nt,10)||0;it.push({objectType:ft,shapeXml:ae(ut),clientData:K,shapeId:G})}}for(let gt=0;gt<Et.length;gt++){let ut=rt.get(Et[gt]);if(!ut)continue;let K=ut.target.startsWith("/")?ut.target.slice(1):te(N,ut.target),ft=o(K)??"",nt=ft?Ft(ft):null,G=nt?.attrs.objectType??"",lt=Qe[G]??"button",dt=it[gt],wt=hr(dt?.clientData),Q={type:lt,from:wt.from,to:wt.to,_ctrlPropXml:ft||void 0,_vmlShapeXml:dt?.shapeXml,_shapeId:dt?.shapeId};if(nt){if(nt.attrs.fmlaLink&&(Q.linkedCell=nt.attrs.fmlaLink),nt.attrs.fmlaRange&&(Q.inputRange=nt.attrs.fmlaRange),nt.attrs.checked&&(Q.checked=es[nt.attrs.checked]??"unchecked"),nt.attrs.dropLines&&(Q.dropLines=parseInt(nt.attrs.dropLines,10)),nt.attrs.min&&(Q.min=parseInt(nt.attrs.min,10)),nt.attrs.max&&(Q.max=parseInt(nt.attrs.max,10)),nt.attrs.inc&&(Q.inc=parseInt(nt.attrs.inc,10)),nt.attrs.page&&(Q.page=parseInt(nt.attrs.page,10)),nt.attrs.val&&(Q.val=parseInt(nt.attrs.val,10)),nt.attrs.selType){let yt={Single:"single",Multi:"multi",Extend:"extend"};Q.selType=yt[nt.attrs.selType]??"single"}nt.attrs.noThreeD==="1"&&(Q.noThreeD=!0)}if(dt?.clientData){let yt=dt.clientData.children.find(Ot=>typeof Ot!="string"&&W(Ot.tag)==="FmlaMacro");yt&&(Q.macro=yt.text??"")}J.addFormControl(Q)}J.legacyDrawingRId=_t,J.ctrlPropRIds=Et}}if(V){let B=at.split("/").pop()??"",N=at.substring(0,at.lastIndexOf("/")+1),U=`${N}_rels/${B}.rels`,rt=S.get(U);if(rt){let ot=rt.get(V);if(ot){let mt=ot.target.startsWith("/")?ot.target.slice(1):te(N,ot.target),Y=o(mt);if(Y){let it=mt.substring(0,mt.lastIndexOf("/")+1),gt=mt.split("/").pop()??"",ut=`${it}_rels/${gt}.rels`,K=S.get(ut);sr(Y,K,it,e,J)}}}}L.size>0&&mr(L,o,e,J),_.push({ws:J,sheetId:z,rId:D,originalXml:Dt,unknownParts:Tt,tablePaths:u,tableXmls:F})}let R=o("xl/connections.xml")??"",M=[];if(R){let T=Ft(R);for(let D of q(T,"connection")){let z=parseInt(D.attrs.id??"0",10),et=D.attrs.name??"",pt=parseInt(D.attrs.type??"0",10),at=fr(pt);if(!et||!at)continue;let st={id:z,name:et,type:at};D.attrs.description&&(st.description=D.attrs.description),D.attrs.refreshOnLoad==="1"&&(st.refreshOnLoad=!0),D.attrs.background==="1"&&(st.background=!0),D.attrs.saveData==="1"&&(st.saveData=!0),D.attrs.keepAlive==="1"&&(st.keepAlive=!0),D.attrs.interval&&(st.interval=parseInt(D.attrs.interval,10));let J=C(D,"dbPr");J&&(J.attrs.connection&&(st.connectionString=J.attrs.connection),J.attrs.command&&(st.command=J.attrs.command),J.attrs.commandType&&(st.commandType=ur(parseInt(J.attrs.commandType,10)))),st._rawXml=ae(D),M.push(st)}}let A=[];for(let[T,D]of t)if(!(!T.startsWith("customXml/item")||T.includes("Props")||T.includes("_rels")))try{let z=await xr(D.data);if(z.length){A.push(...z);break}}catch{}let j=new Set(["xl/workbook.xml","xl/styles.xml","xl/sharedStrings.xml","xl/worksheets/","docProps/","[Content_Types].xml","_rels/","xl/_rels/","xl/connections.xml"]),H=new Map;for(let[T,D]of t){if(T.endsWith("_rels/")||T==="[Content_Types].xml")continue;[...j].some(et=>T.startsWith(et))||H.set(T,D.data)}let X=[];for(let T of y)if(T.name==="_xlnm.Print_Area"&&T.scope){let D=_.find(z=>z.ws.name===T.scope);D&&(D.ws.printArea=T.ref)}else X.push(T);return{sheets:_,styles:m,stylesXml:d,sharedStrings:f,sharedXml:c,workbookXml:l,workbookRels:i,contentTypes:n,contentTypesXml:r,core:p,extended:g,extendedUnknownRaw:$,custom:k,hasCustomProps:k.length>0,namedRanges:X,connections:M,connectionsXml:R,powerQueries:A,unknownParts:H,allRels:S}}function hr(s){let t={from:{col:0,row:0},to:{col:2,row:2}};if(!s)return t;let e=s.children.find(n=>typeof n!="string"&&W(n.tag)==="Anchor");if(!e)return t;let r=(e.text??"").split(",").map(n=>parseInt(n.trim(),10));return r.length<8||r.some(isNaN)?t:{from:{col:r[0],colOff:r[1],row:r[2],rowOff:r[3]},to:{col:r[4],colOff:r[5],row:r[6],rowOff:r[7]}}}var Ps={1:"odbc",2:"dao",3:"file",4:"web",5:"oledb",6:"text",7:"dsp"},dr=Object.fromEntries(Object.entries(Ps).map(([s,t])=>[t,Number(s)]));function fr(s){return Ps[s]}function Ds(s){return dr[s]}var Rs={1:"sql",2:"table",3:"default",4:"web",5:"oledb"},pr=Object.fromEntries(Object.entries(Rs).map(([s,t])=>[t,Number(s)]));function ur(s){return Rs[s]}function As(s){return pr[s]}async function xr(s){if(s.length<12)return[];let t=new DataView(s.buffer,s.byteOffset,s.byteLength);if(t.getUint32(0,!0)!==0)return[];let o=t.getUint32(4,!0);if(o<4||8+o>s.length)return[];let r=s.subarray(8,8+o);if(r[0]!==80||r[1]!==75)return[];let n=await Ee(r),a=[];for(let[i,l]of n){if(!i.includes("/Formula/")||!i.endsWith(".m"))continue;let d=ue(l);if(!d)continue;let m=i.match(/Formulas\/([^/]+)\//),c=m?m[1]:void 0,f=/shared\s+(?:#"([^"]+)"|(\w+))\s*=/g,h,p=new Set;for(;(h=f.exec(d))!==null;){let x=h[1]??h[2];p.add(x)}if(p.size>0){let x=/shared\s+(?:#"([^"]+)"|(\w+))\s*=\s*([\s\S]*?)(?=,\s*shared\s|\]\s*$)/g,g;for(;(g=x.exec(d))!==null;){let $=g[1]??g[2],b=g[3].replace(/,\s*$/,"").trim();a.push({name:$,formula:b})}a.length===0&&a.push({name:c??"Section1",formula:d})}else c&&a.push({name:c,formula:d})}return a}var We=class s{constructor(){this.sheets=[],this.namedRanges=[],this.connections=[],this.powerQueries=[],this.externalLinks=[],this.customPivotStyles=[],this.pivotSlicers=[],this.properties={},this.compressionLevel=6,this.coreProperties={},this.extendedProperties={},this.customProperties=[],this.isTemplate=!1,this._dirtySheets=new Set,this._activeTabIndex=0,this._customTableStyles=new Map}markDirty(t){if(typeof t=="string"){let e=this.sheets.findIndex(o=>o.name===t);e>=0&&this._dirtySheets.add(e)}else this._dirtySheets.add(t)}static async fromBytes(t){let e=new s,o=await ks(t);e._readResult=o,e.coreProperties=o.core,e.extendedProperties=o.extended,e.customProperties=o.custom,e.properties={title:o.core.title,author:o.core.creator,subject:o.core.subject,description:o.core.description,keywords:o.core.keywords,company:o.extended.company,lastModifiedBy:o.core.lastModifiedBy,created:o.core.created,modified:o.core.modified,category:o.core.category,status:o.core.contentStatus},e.sheets=o.sheets.map(a=>a.ws);for(let a=0;a<e.sheets.length;a++){let i=e.sheets[a];i._workbook=e,i.view?.tabSelected&&(e._activeTabIndex=a)}e.namedRanges=o.namedRanges,e.connections=o.connections,e.powerQueries=o.powerQueries;let r=o.unknownParts.get("xl/vbaProject.bin");if(r)try{e.vbaProject=de.fromBytes(r)}catch{}let n=o.workbookXml.match(/<calcPr([^>]*)\/?>/);if(n){let a=n[1],i={},l=a.match(/calcMode="([^"]+)"/);l&&(i.calcMode=l[1]),/fullCalcOnLoad="1"/.test(a)?i.fullCalcOnLoad=!0:/fullCalcOnLoad="0"/.test(a)&&(i.fullCalcOnLoad=!1),/iterate="1"/.test(a)&&(i.iterate=!0);let d=a.match(/iterateCount="(\d+)"/);d&&(i.iterateCount=parseInt(d[1],10));let m=a.match(/iterateDelta="([^"]+)"/);m&&(i.iterateDelta=parseFloat(m[1])),/fullPrecision="1"/.test(a)?i.fullPrecision=!0:/fullPrecision="0"/.test(a)&&(i.fullPrecision=!1),/calcOnSave="1"/.test(a)?i.calcOnSave=!0:/calcOnSave="0"/.test(a)&&(i.calcOnSave=!1),/concurrentCalc="1"/.test(a)?i.concurrentCalc=!0:/concurrentCalc="0"/.test(a)&&(i.concurrentCalc=!1),Object.keys(i).length>0&&(e.calcSettings=i)}return e}static async fromBase64(t){return s.fromBytes(Vt(t))}static async fromFile(t){let o=await(await import("fs/promises")).readFile(t);return s.fromBytes(new Uint8Array(o))}static async fromBlob(t){return s.fromBytes(new Uint8Array(await t.arrayBuffer()))}addSheet(t,e={}){let o=new Ut(t,e);return o.sheetIndex=this.sheets.length+1,o._workbook=this,this.sheets.push(o),this._dirtySheets.add(o.sheetIndex-1),o}getSheet(t){return this.sheets.find(e=>e.name===t)}getSheetByIndex(t){return this.sheets[t]}getSheetNames(){return this.sheets.map(t=>t.name)}getSheets(){return this.sheets}removeSheet(t){return this.sheets=this.sheets.filter(e=>e.name!==t),this}setActiveSheet(t){let e=typeof t=="string"?this.sheets.findIndex(o=>o.name===t):t;if(!(e<0||e>=this.sheets.length)){for(let o=0;o<this.sheets.length;o++){let r=this.sheets[o];o===e?r.view={...r.view??{},tabSelected:!0}:r.view?.tabSelected&&(r.view={...r.view,tabSelected:!1})}this._activeTabIndex=e}}addChartSheet(t,e){let o=this.addSheet(t);return o._isChartSheet=!0,o.addChart(e),o}addDialogSheet(t){let e=this.addSheet(t);return e._isDialogSheet=!0,e}copySheet(t,e){let o=this.getSheet(t);if(!o)throw new Error(`Sheet "${t}" not found`);let r=this.addSheet(e),n=o.readAllCells();for(let{row:i,col:l,cell:d}of n){let m=r.getCell(i,l);d.value!=null&&(m.value=d.value),d.formula&&(m.formula=d.formula),d.arrayFormula&&(m.arrayFormula=d.arrayFormula),d.richText&&(m.richText=d.richText.map(c=>({...c,font:c.font?{...c.font}:void 0}))),d.style&&(m.style={...d.style}),d.comment&&(m.comment={...d.comment}),d.hyperlink&&(m.hyperlink={...d.hyperlink})}for(let i of o.getMerges())r.merge(i.startRow,i.startCol,i.endRow,i.endCol);let a=o.getUsedRange();if(a)for(let i=a.startCol;i<=a.endCol;i++){let l=o.getColumn(i);l&&r.setColumn(i,{...l})}return o.pageSetup&&(r.pageSetup={...o.pageSetup}),o.printArea&&(r.printArea=o.printArea),r}registerTableStyle(t,e){return this._customTableStyles.set(t,e),this}addNamedRange(t){return this.namedRanges.push(t),this}getNamedRanges(){return this.namedRanges}getNamedRange(t){return this.namedRanges.find(e=>e.name===t)}removeNamedRange(t){return this.namedRanges=this.namedRanges.filter(e=>e.name!==t),this}addConnection(t){return this.connections.push(t),this}getConnections(){return this.connections}getConnection(t){return this.connections.find(e=>e.name===t)}removeConnection(t){return this.connections=this.connections.filter(e=>e.name!==t),this}getPowerQueries(){return this.powerQueries}getPowerQuery(t){return this.powerQueries.find(e=>e.name===t)}getCustomProperty(t){return this.customProperties.find(e=>e.name===t)}setCustomProperty(t,e){let o=this.customProperties.findIndex(r=>r.name===t);return o>=0?this.customProperties[o]={name:t,value:e}:this.customProperties.push({name:t,value:e}),this}removeCustomProperty(t){return this.customProperties=this.customProperties.filter(e=>e.name!==t),this}addExternalLink(t){return this.externalLinks.push(t),this}getExternalLinks(){return this.externalLinks}registerPivotStyle(t){return this.customPivotStyles.push(t),this}addPivotSlicer(t){return this.pivotSlicers.push(t),this}getPivotSlicers(){return this.pivotSlicers}async build(){return this._syncLegacyProperties(),this._readResult?this._buildPatched():this._buildFresh()}async _buildPatched(){let t=this._readResult,e=[],o=this._dirtySheets.size>0,r=new Gt,n=new Zt,a=new Map,i=new Map;if(o){for(let p=0;p<this.sheets.length;p++){let x=this.sheets[p],g=x.getTables();for(let $=0;$<g.length;$++){let b=g[$];i.set(`${p}:${$}`,b.columns.map(v=>v.name));let{startRow:k,startCol:P}=Pt(b.ref),I=new Set;for(let v=0;v<b.columns.length;v++){let y=x.getCell(k,P+v),O=y.value,S=null;O==null?S=null:O instanceof Date?S=O.toISOString():typeof O=="object"&&"error"in O?S=String(O.error):S=String(O);let _=S??b.columns[v].name,R=_,M=2;for(;I.has(R);)R=`${_}${M++}`;I.add(R),b.columns[v].name=R,(O==null||typeof O!="string"||O!==R)&&(y.value=R)}}}let c=/<dxf>([\s\S]*?)<\/dxf>|<dxf\/>/g,f=[],h;for(;(h=c.exec(t.stylesXml))!==null;)f.push(h[1]??"");f.length&&r.prependRawDxfs(f);for(let p=0;p<this.sheets.length;p++)a.set(p,this.sheets[p].toXml(r,n))}e.push({name:"docProps/core.xml",data:E(Me({...t.core,...this.coreProperties,modified:new Date}))}),e.push({name:"docProps/app.xml",data:E(Le({...t.extended,...this.extendedProperties,titlesOfParts:this.sheets.map(c=>c.name),headingPairs:this._headingPairs()},t.extendedUnknownRaw))});let l=this.customProperties.length>0?this.customProperties:t.hasCustomProps?t.custom:null;l&&l.length>0&&e.push({name:"docProps/custom.xml",data:E(Xe(l))}),e.push({name:"xl/workbook.xml",data:E(this._patchWorkbookXml(t.workbookXml,t))});let d=this._connectionsXml(t.connectionsXml);d&&e.push({name:"xl/connections.xml",data:E(d)}),o?(e.push({name:"xl/styles.xml",data:E(r.toXml())}),e.push({name:"xl/sharedStrings.xml",data:E(n.toXml())})):(e.push({name:"xl/styles.xml",data:E(t.stylesXml)}),e.push({name:"xl/sharedStrings.xml",data:E(t.sharedXml)}));for(let c=0;c<this.sheets.length;c++){let f=this.sheets[c],p=`xl/${f._isChartSheet?"chartsheets":f._isDialogSheet?"dialogsheets":"worksheets"}/sheet${c+1}.xml`;o?f._isChartSheet?e.push({name:p,data:E(f.toChartSheetXml())}):f._isDialogSheet?e.push({name:p,data:E(f.toDialogSheetXml(r,n))}):e.push({name:p,data:E(a.get(c)??"")}):e.push({name:p,data:E(t.sheets[c]?.originalXml??"")})}let m=new Set;for(let c=0;c<this.sheets.length;c++){let h=this.sheets[c].getTables(),p=t.sheets[c]?.tablePaths??[],x=t.sheets[c]?.tableXmls??[];for(let g=0;g<h.length;g++){let $=p[g];if($)if(m.add($),g<x.length){let b=x[g],k=b.match(/\bref="([^"]+)"/);if(k&&k[1]!==h[g].ref&&(b=b.replace(`ref="${k[1]}"`,`ref="${h[g].ref}"`)),o){let P=i.get(`${c}:${g}`);if(P)for(let I=0;I<h[g].columns.length;I++){let v=P[I],y=h[g].columns[I].name;v&&v!==y&&(b=b.replace(`name="${w(v)}"`,`name="${w(y)}"`))}}e.push({name:$,data:E(b)})}else{let b=$.match(/table(\d+)\.xml$/),k=b?parseInt(b[1],10):g+1;e.push({name:$,data:E(Te(h[g],k))})}}}for(let[c,f]of t.unknownParts)m.has(c)||c==="xl/vbaProject.bin"&&this.vbaProject||t.allRels.has(c)||o&&c==="xl/calcChain.xml"||e.push({name:c,data:f});this.vbaProject&&(this._ensureVbaSheetModules(),e.push({name:"xl/vbaProject.bin",data:this.vbaProject.build()})),e.push({name:"_rels/.rels",data:E(this._buildRootRels(l!=null&&l.length>0))}),e.push({name:"xl/_rels/workbook.xml.rels",data:E(this._buildWorkbookRels(t,o))});for(let[c,f]of t.allRels)c==="xl/_rels/workbook.xml.rels"||c==="_rels/.rels"||e.push({name:c,data:E(this._relsToXml(f))});return e.push({name:"[Content_Types].xml",data:E(this._patchContentTypes(t.contentTypesXml,l!=null&&l.length>0,o))}),je(e,{level:this.compressionLevel})}async _buildFresh(){let t=new Gt,e=new Zt,o=[];for(let[u,F]of this._customTableStyles)t.registerTableStyle(u,F);let r=1;for(let u of this.sheets)u.rId=`rId${r++}`;let n=[],a=[],i=[],l=[],d=new Map,m=new Map,c=new Map,f=new Map,h=1,p=1,x=1,g=1,$=1,b=0,k=0,P=0;for(let u of this.sheets){let F=u.getImages(),B=u.getCharts(),N=u.getTables(),U=[],rt=[],ot=[];(F.length||B.length||u.getShapes().length||u.getWordArt().length||u.getMathEquations().length||u.getTableSlicers().length||u.getOleObjects().length)&&(u.drawingRId=`rId${r++}`);let mt=u.getFormControls();(u.getComments().length||mt.length)&&(u.legacyDrawingRId=`rId${r++}`);for(let K of F){let ft=`rId${r++}`;U.push(ft),n.push({ws:u,img:K,ext:Bs(K.format),idx:h++})}for(let K=0;K<B.length;K++){let ft=`rId${r++}`;rt.push(ft),a.push({ws:u,chartIdx:K,globalIdx:p++})}for(let K=0;K<N.length;K++){let ft=`rId${r++}`;ot.push(ft),i.push({ws:u,tableIdx:K,globalTableId:x++})}let Y=[],it=[];for(let K of u.getOleObjects())Y.push(`rId${r++}`),K.iconData?it.push(`rId${r++}`):it.push("");u.oleRIds=Y,u.oleIconRIds=it;let gt=[];for(let K=0;K<mt.length;K++)gt.push(`rId${r++}`);u.ctrlPropRIds=gt,d.set(u,U),m.set(u,rt),c.set(u,ot),u.tableRIds=ot;let ut=[];for(let K of u.getPivotTables()){let ft=`rId${r++}`,nt=`rId${r++}`;ut.push(ft),l.push({ws:u,pt:K,pivotIdx:$++,cacheId:b++,pivotRId:ft,cacheRId:nt})}f.set(u,ut)}let I=[],v=h,y=1;for(let u of this.sheets){u._cellImageVm=new Map;for(let F of u.getCellImages()){let B=Bs(F.format);I.push({img:F,ext:B,idx:v++}),u._cellImageVm.set(F.cell,y++),u.getCellByRef(F.cell)}}let O=I.length>0,S=new Map,_=[],R=0,M=0;for(let u of this.sheets)u.getTableSlicers().length&&S.set(u,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});for(let u of this.pivotSlicers)for(let F of this.sheets)if(F.getPivotTables().some(B=>B.name===u.pivotTableName)){S.has(F)||S.set(F,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});break}for(let[u,F]of S){u.drawingRId||(u.drawingRId=`rId${r++}`),F.slicerDefRId=`rId${r++}`,F.slicerDefIdx=++R,u.slicerRId=F.slicerDefRId;let B=[];for(let N of u.getTableSlicers()){let U=u.getTables().find(Y=>Y.name===N.tableName),ot=i.find(Y=>Y.ws===u&&u.getTables()[Y.tableIdx]===U)?.globalTableId??1,mt=U?(U.columns?.findIndex(Y=>Y.name===N.columnName)??0)+1:1;F.tableSlicers.push({slicer:N,tableId:ot,columnIndex:mt}),B.push({name:N.name,cell:N.cell}),_.push({name:N.name+"_cache",sourceName:N.columnName,type:"table",rId:`rId${r++}`,idx:++M,tableId:ot,columnIndex:mt,sortOrder:N.sortOrder??"ascending"})}for(let N of this.pivotSlicers){let U=u.getPivotTables().find(it=>it.name===N.pivotTableName);if(!U)continue;let rt=l.find(it=>it.ws===u&&it.pt===U),ot=this.sheets.indexOf(u)+1,mt=[],Y=this.sheets.find(it=>it.name===U.sourceSheet);if(Y){let it=Y.readRange(U.sourceRef),ut=(it[0]??[]).map(K=>String(K??"")).indexOf(N.fieldName);if(ut>=0){let K=new Set;for(let ft=1;ft<it.length;ft++)K.add(String(it[ft][ut]??""));mt=[...K]}}F.pivotSlicers.push({slicer:N,pivotCacheId:rt?.cacheId??0}),B.push({name:N.name,cell:N.cell}),_.push({name:N.name+"_cache",sourceName:N.fieldName,type:"pivot",rId:`rId${r++}`,idx:++M,pivotTableName:N.pivotTableName,pivotCacheId:rt?.cacheId??0,tabId:ot,items:mt})}u._slicerDrawingInfo=B}let A=S.size>0,j=this.customProperties.length>0,H=!!this.vbaProject,X=new Set;for(let{ext:u}of[...n,...I]){let F=gr(u);X.add(`<Default Extension="${u}" ContentType="${F}"/>`)}let T=this.sheets.filter(u=>u.getComments().length),z=this.sheets.filter(u=>u.getComments().length||u.getFormControls().length).length?'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>':"",et=0,pt=T.map(()=>`<Override PartName="/xl/comments${++et}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>`).join(""),at=0,st=[];for(let u of this.sheets)if(!u._isDialogSheet)for(let F=0;F<u.getFormControls().length;F++)st.push(`<Override PartName="/xl/ctrlProps/ctrlProp${++at}.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>`);let Dt=this.sheets.some(u=>u.getOleObjects().length>0)?'<Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.oleObject"/>':"";o.push({name:"[Content_Types].xml",data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
255
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
256
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
257
+ <Default Extension="xml" ContentType="application/xml"/>
258
+ ${z}
259
+ ${Dt}
260
+ ${[...X].join("")}
261
+ <Override PartName="/xl/workbook.xml" ContentType="${H?"application/vnd.ms-excel.sheet.macroEnabled.main+xml":this.isTemplate?"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}"/>
262
+ ${H?'<Override PartName="/xl/vbaProject.bin" ContentType="application/vnd.ms-office.vbaProject"/>':""}
263
+ <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
264
+ <Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
265
+ <Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
266
+ ${this.sheets.filter(u=>!u._isChartSheet&&!u._isDialogSheet).map(u=>`<Override PartName="/xl/worksheets/sheet${this.sheets.indexOf(u)+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}
267
+ ${this.sheets.filter(u=>u._isChartSheet).map(u=>`<Override PartName="/xl/chartsheets/sheet${this.sheets.indexOf(u)+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"/>`).join("")}
268
+ ${this.sheets.filter(u=>u._isDialogSheet).map(u=>`<Override PartName="/xl/dialogsheets/sheet${this.sheets.indexOf(u)+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml"/>`).join("")}
269
+ ${this.sheets.filter(u=>u.drawingRId).map((u,F)=>`<Override PartName="/xl/drawings/drawing${F+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml"/>`).join("")}
270
+ ${a.map(({globalIdx:u})=>`<Override PartName="/xl/charts/chart${u}.xml" ContentType="application/vnd.openxmlformats-officedocument.drawingml.chart+xml"/>`).join("")}
271
+ ${i.map(({globalTableId:u})=>`<Override PartName="/xl/tables/table${u}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/>`).join("")}
272
+ ${l.map(u=>`<Override PartName="/xl/pivotTables/pivotTable${u.pivotIdx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"/>`).join(`
273
+ `)}
274
+ ${l.map(u=>`<Override PartName="/xl/pivotCache/pivotCacheDefinition${u.pivotIdx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"/>`).join(`
275
+ `)}
276
+ ${l.map(u=>`<Override PartName="/xl/pivotCache/pivotCacheRecords${u.pivotIdx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"/>`).join(`
277
+ `)}
278
+ ${pt}
279
+ ${st.join("")}
280
+ <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
281
+ <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
282
+ ${j?'<Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/>':""}
283
+ ${this.connections.length?'<Override PartName="/xl/connections.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml"/>':""}
284
+ ${this.externalLinks.map((u,F)=>`<Override PartName="/xl/externalLinks/externalLink${F+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"/>`).join(`
285
+ `)}
286
+ ${[...S.values()].map(u=>`<Override PartName="/xl/slicers/slicer${u.slicerDefIdx}.xml" ContentType="application/vnd.ms-excel.slicer+xml"/>`).join(`
287
+ `)}
288
+ ${_.map(u=>`<Override PartName="/xl/slicerCaches/slicerCache${u.idx}.xml" ContentType="application/vnd.ms-excel.slicerCache+xml"/>`).join(`
289
+ `)}
290
+ ${this.sheets.flatMap(u=>u.getQueryTables()).map((u,F)=>`<Override PartName="/xl/queryTables/queryTable${F+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml"/>`).join(`
291
+ `)}
292
+ ${O?`<Override PartName="/xl/metadata.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml"/>
293
+ <Override PartName="/xl/richData/rdrichvalue.xml" ContentType="application/vnd.ms-excel.rdrichvalue+xml"/>
294
+ <Override PartName="/xl/richData/rdRichValueStructure.xml" ContentType="application/vnd.ms-excel.rdrichvaluestructure+xml"/>
295
+ <Override PartName="/xl/richData/richValueRel.xml" ContentType="application/vnd.ms-excel.richvaluerel+xml"/>
296
+ <Override PartName="/xl/richData/rdRichValueTypes.xml" ContentType="application/vnd.ms-excel.rdrichvaluetypes+xml"/>
297
+ <Override PartName="/xl/richData/rdarray.xml" ContentType="application/vnd.ms-excel.rdarray+xml"/>`:""}
298
+ </Types>`)}),o.push({name:"_rels/.rels",data:E(this._buildRootRels(j))}),o.push({name:"xl/_rels/workbook.xml.rels",data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
299
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
300
+ ${this.sheets.map((u,F)=>{let B=u._isChartSheet?"chartsheet":u._isDialogSheet?"dialogsheet":"worksheet",N=u._isChartSheet?"chartsheets":u._isDialogSheet?"dialogsheets":"worksheets";return`<Relationship Id="${u.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${B}" Target="${N}/sheet${F+1}.xml"/>`}).join("")}
301
+ <Relationship Id="rIdStyles" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
302
+ <Relationship Id="rIdShared" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>
303
+ <Relationship Id="rIdTheme" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
304
+ ${l.map(u=>`<Relationship Id="${u.cacheRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" Target="pivotCache/pivotCacheDefinition${u.pivotIdx}.xml"/>`).join(`
305
+ `)}
306
+ ${_.map(u=>`<Relationship Id="${u.rId}" Type="http://schemas.microsoft.com/office/2007/relationships/slicerCache" Target="slicerCaches/slicerCache${u.idx}.xml"/>`).join(`
307
+ `)}
308
+ ${H?'<Relationship Id="rIdVBA" Type="http://schemas.microsoft.com/office/2006/relationships/vbaProject" Target="vbaProject.bin"/>':""}
309
+ ${this.connections.length?'<Relationship Id="rIdConns" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections" Target="connections.xml"/>':""}
310
+ ${this.externalLinks.map((u,F)=>`<Relationship Id="rIdExtLink${F+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink" Target="externalLinks/externalLink${F+1}.xml"/>`).join(`
311
+ `)}
312
+ ${O?'<Relationship Id="rIdMeta" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata" Target="metadata.xml"/>':""}
313
+ ${O?'<Relationship Id="rIdRichValueRel" Type="http://schemas.microsoft.com/office/2022/10/relationships/richValueRel" Target="richData/richValueRel.xml"/>':""}
314
+ ${O?'<Relationship Id="rIdRichValue" Type="http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue" Target="richData/rdrichvalue.xml"/>':""}
315
+ ${O?'<Relationship Id="rIdRichValueStruct" Type="http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure" Target="richData/rdRichValueStructure.xml"/>':""}
316
+ ${O?'<Relationship Id="rIdRichValueTypes" Type="http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes" Target="richData/rdRichValueTypes.xml"/>':""}
317
+ ${O?'<Relationship Id="rIdRdArray" Type="http://schemas.microsoft.com/office/2017/06/relationships/rdArray" Target="richData/rdarray.xml"/>':""}
318
+ </Relationships>`)}),H&&(this._ensureVbaSheetModules(),o.push({name:"xl/vbaProject.bin",data:this.vbaProject.build()}));let Tt=[this.properties.date1904?'date1904="1"':"",H?'codeName="ThisWorkbook"':""].filter(Boolean).join(" "),Bt=`<workbookPr${Tt?" "+Tt:""}/>`,_t=this._definedNamesXml(_),Et=l.length?`<pivotCaches>${l.map(u=>`<pivotCache cacheId="${u.cacheId}" r:id="${u.cacheRId}"/>`).join("")}</pivotCaches>`:"";o.push({name:"xl/workbook.xml",data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
319
+ <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
320
+ ${Bt}
321
+ <bookViews><workbookView xWindow="0" yWindow="0" windowWidth="14400" windowHeight="8260"${this._activeTabIndex?` activeTab="${this._activeTabIndex}"`:""}/></bookViews>
322
+ <sheets>${this.sheets.map((u,F)=>`<sheet name="${w(u.name)}" sheetId="${F+1}" r:id="${u.rId}"${u.options?.state&&u.options.state!=="visible"?` state="${u.options.state}"`:""}/>`).join("")}</sheets>
323
+ ${_t}
324
+ ${this._calcPrXml()}
325
+ ${Et}
326
+ ${A?(()=>{let u=_.filter(N=>N.type==="table"),F=_.filter(N=>N.type==="pivot"),B="<extLst>";return F.length&&(B+=`<ext uri="{BBE1A952-AA13-448e-AADC-164F8A28A991}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerCaches>${F.map(N=>`<x14:slicerCache r:id="${N.rId}"/>`).join("")}</x14:slicerCaches></ext>`),u.length&&(B+=`<ext uri="{46BE6895-7355-4a93-B00E-2C351335B9C9}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x15:slicerCaches>${u.map(N=>`<x14:slicerCache r:id="${N.rId}"/>`).join("")}</x15:slicerCaches></ext>`),B+="</extLst>",B})():""}
327
+ </workbook>`)}),this.connections.length&&o.push({name:"xl/connections.xml",data:E(this._connectionsXml())});for(let u=0;u<this.sheets.length;u++){let F=this.sheets[u],B=d.get(F)??[],N=m.get(F)??[],U=i.filter(G=>G.ws===F),rt=c.get(F)??[],ot=F._isChartSheet?"chartsheets":F._isDialogSheet?"dialogsheets":"worksheets",mt=`xl/${ot}/sheet${u+1}.xml`;F._isChartSheet?o.push({name:mt,data:E(F.toChartSheetXml())}):F._isDialogSheet?o.push({name:mt,data:E(F.toDialogSheetXml(t,e))}):o.push({name:mt,data:E(F.toXml(t,e))});let Y=[];if(F.drawingRId){let G=this.sheets.filter((lt,dt)=>dt<=u&&lt.drawingRId).length;Y.push(`<Relationship Id="${F.drawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing${G}.xml"/>`)}for(let G=0;G<F.getImages().length;G++){let lt=n.filter(dt=>dt.ws===F)[G];lt&&Y.push(`<Relationship Id="${B[G]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${lt.idx}.${lt.ext}"/>`)}for(let G=0;G<U.length;G++)Y.push(`<Relationship Id="${rt[G]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table${U[G].globalTableId}.xml"/>`);let it=f.get(F)??[],gt=l.filter(G=>G.ws===F);for(let G=0;G<gt.length;G++)Y.push(`<Relationship Id="${it[G]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" Target="../pivotTables/pivotTable${gt[G].pivotIdx}.xml"/>`);let ut=S.get(F);ut&&Y.push(`<Relationship Id="${ut.slicerDefRId}" Type="http://schemas.microsoft.com/office/2007/relationships/slicer" Target="../slicers/slicer${ut.slicerDefIdx}.xml"/>`);let K=F.getComments(),ft=F.getFormControls();if((K.length||ft.length)&&F.legacyDrawingRId){let G=g++;if(Y.push(`<Relationship Id="${F.legacyDrawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing${G}.vml"/>`),K.length){let Q=`rId${r++}`;Y.push(`<Relationship Id="${Q}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments${G}.xml"/>`),o.push({name:`xl/comments${G}.xml`,data:E(this._buildCommentsXml(K))})}let lt=K.map(({row:Q,col:yt},Ot)=>{let ge=(yt+1)*64,_s=(Q-1)*20;return`<v:shape id="_x0000_s${1025+u*1e3+Ot}" type="#_x0000_t202" style="position:absolute;margin-left:${ge}pt;margin-top:${_s}pt;width:108pt;height:59.25pt;z-index:${Ot+1};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto">
328
+ <v:fill color2="#ffffe1"/>
329
+ <v:shadow color="black" obscured="t"/>
330
+ <v:path o:connecttype="none"/>
331
+ <v:textbox style="mso-direction-alt:auto"><div style="text-align:left"/></v:textbox>
332
+ <x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${yt+1},15,${Q-1},10,${yt+3},15,${Q+4},4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${Q-1}</x:Row><x:Column>${yt-1}</x:Column></x:ClientData>
333
+ </v:shape>`}),dt=1025+F.sheetIndex*1e3+K.length,wt=ft.map((Q,yt)=>os(Q,dt+yt));if(o.push({name:`xl/drawings/vmlDrawing${G}.vml`,data:E(rs(lt,wt))}),!F._isDialogSheet){let Q=F.ctrlPropRIds;for(let yt=0;yt<ft.length;yt++){let Ot=++k;Y.push(`<Relationship Id="${Q[yt]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp${Ot}.xml"/>`),o.push({name:`xl/ctrlProps/ctrlProp${Ot}.xml`,data:E(ss(ft[yt]))})}}}let nt=F.getOleObjects();for(let G=0;G<nt.length;G++){let lt=nt[G],dt=++P,wt=F.oleRIds[G];if(lt.linkToFile)Y.push(`<Relationship Id="${wt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="${w(lt.linkPath??"")}" TargetMode="External"/>`);else{let Q=`xl/embeddings/oleObject${dt}.bin`;Y.push(`<Relationship Id="${wt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="../embeddings/oleObject${dt}.bin"/>`);let yt=lt.data?typeof lt.data=="string"?Vt(lt.data):lt.data:new Uint8Array(0);o.push({name:Q,data:yt})}if(lt.iconData){let Q=lt.iconFormat??"emf",yt=h++,Ot=F.oleIconRIds[G];Y.push(`<Relationship Id="${Ot}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${yt}.${Q}"/>`);let ge=typeof lt.iconData=="string"?Vt(lt.iconData):lt.iconData;o.push({name:`xl/media/image${yt}.${Q}`,data:ge})}}if(Y.length&&o.push({name:`xl/${ot}/_rels/sheet${u+1}.xml.rels`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
334
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
335
+ ${Y.join(`
336
+ `)}
337
+ </Relationships>`)}),F.drawingRId){let G=this.sheets.filter((dt,wt)=>wt<=u&&dt.drawingRId).length;o.push({name:`xl/drawings/drawing${G}.xml`,data:E(F.toDrawingXml(B,N))});let lt=[];for(let dt=0;dt<F.getImages().length;dt++){let wt=n.filter(Q=>Q.ws===F)[dt];wt&&lt.push(`<Relationship Id="${B[dt]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${wt.idx}.${wt.ext}"/>`)}for(let dt=0;dt<F.getCharts().length;dt++){let wt=a.filter(Q=>Q.ws===F)[dt];wt&&lt.push(`<Relationship Id="${N[dt]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" Target="../charts/chart${wt.globalIdx}.xml"/>`)}lt.length&&o.push({name:`xl/drawings/_rels/drawing${G}.xml.rels`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
338
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
339
+ ${lt.join(`
340
+ `)}
341
+ </Relationships>`)})}}for(let{img:u,ext:F,idx:B}of n)o.push({name:`xl/media/image${B}.${F}`,data:typeof u.data=="string"?Vt(u.data):u.data});if(O){let u=[],F=[];for(let B=0;B<I.length;B++){let{img:N,ext:U,idx:rt}=I[B],ot=`rId${B+1}`;u.push(ot),F.push(`<Relationship Id="${ot}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="/xl/media/image${rt}.${U}"/>`),o.push({name:`xl/media/image${rt}.${U}`,data:typeof N.data=="string"?Vt(N.data):N.data})}o.push({name:"xl/metadata.xml",data:E($r(I.length))}),o.push({name:"xl/richData/rdrichvalue.xml",data:E(yr(I.length))}),o.push({name:"xl/richData/richValueRel.xml",data:E(br(u))}),o.push({name:"xl/richData/rdRichValueStructure.xml",data:E(Fr())}),o.push({name:"xl/richData/rdRichValueTypes.xml",data:E(wr())}),o.push({name:"xl/richData/rdarray.xml",data:E('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><arrayData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" count="0"></arrayData>')}),o.push({name:"xl/richData/_rels/richValueRel.xml.rels",data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
342
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
343
+ ${F.join(`
344
+ `)}
345
+ </Relationships>`)})}for(let{ws:u,chartIdx:F,globalIdx:B}of a)o.push({name:`xl/charts/chart${B}.xml`,data:E(Ke(u.getCharts()[F]))});for(let{ws:u,tableIdx:F,globalTableId:B}of i)o.push({name:`xl/tables/table${B}.xml`,data:E(Te(u.getTables()[F],B))});for(let{ws:u,pt:F,pivotIdx:B,cacheId:N}of l){let U=this.sheets.find(gt=>gt.name===F.sourceSheet),rt=U?U.readRange(F.sourceRef):[[]],{pivotTableXml:ot,cacheDefXml:mt,cacheRecordsXml:Y}=Je(F,rt,B,N),it=(gt,ut)=>`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
346
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
347
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${gt}" Target="${ut}"/>
348
+ </Relationships>`;o.push({name:`xl/pivotTables/pivotTable${B}.xml`,data:E(ot)}),o.push({name:`xl/pivotTables/_rels/pivotTable${B}.xml.rels`,data:E(it("pivotCacheDefinition",`../pivotCache/pivotCacheDefinition${B}.xml`))}),o.push({name:`xl/pivotCache/pivotCacheDefinition${B}.xml`,data:E(mt)}),o.push({name:`xl/pivotCache/_rels/pivotCacheDefinition${B}.xml.rels`,data:E(it("pivotCacheRecords",`pivotCacheRecords${B}.xml`))}),o.push({name:`xl/pivotCache/pivotCacheRecords${B}.xml`,data:E(Y)})}o.push({name:"xl/styles.xml",data:E(t.toXml())}),o.push({name:"xl/sharedStrings.xml",data:E(e.toXml())}),o.push({name:"xl/theme/theme1.xml",data:E(this._buildThemeXml())});for(let u=0;u<this.externalLinks.length;u++){let F=this.externalLinks[u],B=u+1,N=F.sheets.map(U=>{let rt=U.definedNames?.map(ot=>`<definedName name="${w(ot.name)}" refersTo="${w(ot.ref)}"/>`).join("")??"";return`<sheetName val="${w(U.name)}"/>${rt?`<sheetDataSet>${rt}</sheetDataSet>`:""}`}).join("");o.push({name:`xl/externalLinks/externalLink${B}.xml`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
349
+ <externalLink xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
350
+ <externalBook r:id="rId1"><sheetNames>${N}</sheetNames></externalBook>
351
+ </externalLink>`)}),o.push({name:`xl/externalLinks/_rels/externalLink${B}.xml.rels`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
352
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
353
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath" Target="${w(F.target)}" TargetMode="External"/>
354
+ </Relationships>`)})}for(let[u,F]of S){let B=[];for(let N of F.tableSlicers){let U=N.slicer;B.push(`<slicer name="${w(U.name)}" cache="${w(U.name+"_cache")}" caption="${w(U.caption??U.columnName)}" rowHeight="241300" columnCount="${U.columnCount??1}" style="${U.style??"SlicerStyleLight1"}"/>`)}for(let N of F.pivotSlicers){let U=N.slicer;B.push(`<slicer name="${w(U.name)}" cache="${w(U.name+"_cache")}" caption="${w(U.caption??U.fieldName)}" rowHeight="241300" columnCount="${U.columnCount??1}" style="${U.style??"SlicerStyleLight1"}"/>`)}o.push({name:`xl/slicers/slicer${F.slicerDefIdx}.xml`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
355
+ <slicers xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" mc:Ignorable="x">
356
+ ${B.join(`
357
+ `)}
358
+ </slicers>`)})}for(let u of _){let F;if(u.type==="table")F=`<extLst><x:ext uri="{2F2917AC-EB37-4324-AD4E-5DD8C200BD13}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:tableSlicerCache tableId="${u.tableId}" column="${u.columnIndex}" sortOrder="${u.sortOrder??"ascending"}"/></x:ext></extLst>`;else{let B=(u.items??[]).map((N,U)=>`<i x="${U}" s="1"/>`).join("");F=`<pivotTables><pivotTable tabId="${u.tabId}" name="${w(u.pivotTableName??"")}"/></pivotTables>`+(u.items?.length?`<data><tabular pivotCacheId="${u.pivotCacheId}" showMissing="0"><items count="${u.items.length}">${B}</items></tabular></data>`:"")}o.push({name:`xl/slicerCaches/slicerCache${u.idx}.xml`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
359
+ <slicerCacheDefinition xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x" name="${w(u.name)}" sourceName="${w(u.sourceName)}">
360
+ ${F}
361
+ </slicerCacheDefinition>`)})}let V=this.sheets.flatMap(u=>u.getQueryTables());for(let u=0;u<V.length;u++){let F=V[u];o.push({name:`xl/queryTables/queryTable${u+1}.xml`,data:E(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
362
+ <queryTable xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" name="${w(F.name)}" connectionId="${F.connectionId}" autoFormatId="16" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="0">
363
+ <queryTableRefresh nextId="${(F.columns?.length??0)+1}">
364
+ <queryTableFields count="${F.columns?.length??0}">
365
+ ${(F.columns??[]).map((B,N)=>`<queryTableField id="${N+1}" name="${w(B)}" tableColumnId="${N+1}"/>`).join(`
366
+ `)}
367
+ </queryTableFields>
368
+ </queryTableRefresh>
369
+ </queryTable>`)})}let L={...this.coreProperties,created:this.coreProperties.created??new Date,modified:new Date};return!L.creator&&this.properties.author&&(L.creator=this.properties.author),o.push({name:"docProps/core.xml",data:E(Me(L))}),o.push({name:"docProps/app.xml",data:E(Le({...this.extendedProperties,application:this.extendedProperties.application??"ExcelForge",company:this.extendedProperties.company??this.properties.company,titlesOfParts:this.sheets.map(u=>u.name),headingPairs:this._headingPairs()}))}),j&&o.push({name:"docProps/custom.xml",data:E(Xe(this.customProperties))}),je(o,{level:this.compressionLevel})}_headingPairs(){let t=this.sheets.filter(n=>!n._isChartSheet&&!n._isDialogSheet).length,e=this.sheets.filter(n=>n._isChartSheet).length,o=this.sheets.filter(n=>n._isDialogSheet).length,r=[];return t&&r.push({name:"Worksheets",count:t}),e&&r.push({name:"Charts",count:e}),o&&r.push({name:"Dialogs",count:o}),r.length||r.push({name:"Worksheets",count:0}),r}_syncLegacyProperties(){let t=this.properties;t.title&&(this.coreProperties.title??=t.title),t.author&&(this.coreProperties.creator??=t.author),t.subject&&(this.coreProperties.subject??=t.subject),t.description&&(this.coreProperties.description??=t.description),t.keywords&&(this.coreProperties.keywords??=t.keywords),t.company&&(this.extendedProperties.company??=t.company),t.lastModifiedBy&&(this.coreProperties.lastModifiedBy??=t.lastModifiedBy),t.created&&(this.coreProperties.created??=t.created),t.category&&(this.coreProperties.category??=t.category),t.status&&(this.coreProperties.contentStatus??=t.status)}_ensureVbaSheetModules(){if(!(!this.vbaProject||this.vbaProject.modules.filter(e=>e.type==="document"&&e.name!=="ThisWorkbook").length>=this.sheets.length))for(let e of this.sheets){let o=e.name.replace(/[^A-Za-z0-9_]/g,"_");this.vbaProject.getModule(o)||this.vbaProject.addModule({name:o,type:"document",code:""})}}_patchWorkbookXml(t,e){let o=t,r=e?.sheets.length??this.sheets.length;for(let a=0;a<Math.min(this.sheets.length,r);a++)o=o.replace(new RegExp(`(<sheet[^>]+sheetId="${a+1}"[^>]+)name="[^"]*"`),`$1name="${w(this.sheets[a].name)}"`);if(e&&this.sheets.length>r){let a=0;for(let[d]of e.workbookRels){let m=parseInt(d.replace(/\D/g,""),10);m>a&&(a=m)}let i=0;for(let d of e.sheets){let m=parseInt(d.sheetId,10);m>i&&(i=m)}let l=[];for(let d=r;d<this.sheets.length;d++){let m=this.sheets[d],c=`rId${++a}`,f=++i;m.rId=c,m.sheetIndex=f;let h=m.options?.state==="hidden"?' state="hidden"':m.options?.state==="veryHidden"?' state="veryHidden"':"";l.push(`<sheet name="${w(m.name)}" sheetId="${f}" r:id="${c}"${h}/>`)}o=o.replace("</sheets>",l.join("")+"</sheets>")}this.vbaProject&&!o.includes("codeName=")&&(o=o.replace("<workbookPr",'<workbookPr codeName="ThisWorkbook"'),o.includes("<workbookPr")||(o=o.replace("<bookViews",'<workbookPr codeName="ThisWorkbook"/><bookViews')));let n=this._definedNamesXml();if(o.includes("<definedNames")?o=o.replace(/<definedNames[\s\S]*?<\/definedNames>/,n):n&&(o=o.replace("</sheets>",`</sheets>${n}`)),this.calcSettings){let a=this._calcPrXml();o.includes("<calcPr")?o=o.replace(/<calcPr[^>]*\/>|<calcPr[^>]*>[\s\S]*?<\/calcPr>/,a):o=o.replace("</workbook>",`${a}</workbook>`)}return o}_definedNamesXml(t){let e=[];for(let n of this.sheets)if(n.printArea){let a=n.printArea.includes("!")?n.printArea:`'${n.name}'!${n.printArea}`;e.push({name:"_xlnm.Print_Area",ref:a,scope:n.name})}let o=(t??[]).map(n=>({name:n.name,ref:"#N/A"})),r=[...this.namedRanges,...e,...o];return r.length?`<definedNames>${r.map(n=>{let a=`name="${w(n.name)}"`;if(n.scope){let i=this.sheets.findIndex(l=>l.name===n.scope);i>=0&&(a+=` localSheetId="${i}"`)}return n.comment&&(a+=` comment="${w(n.comment)}"`),`<definedName ${a}>${w(n.ref)}</definedName>`}).join("")}</definedNames>`:""}_calcPrXml(){let t=this.calcSettings,e='calcId="191028"';return t&&(t.calcMode==="manual"?e+=' calcMode="manual"':t.calcMode==="autoNoTable"&&(e+=' calcMode="autoNoTable"'),t.fullCalcOnLoad&&(e+=' fullCalcOnLoad="1"'),t.iterate&&(e+=' iterate="1"',t.iterateCount!=null&&(e+=` iterateCount="${t.iterateCount}"`),t.iterateDelta!=null&&(e+=` iterateDelta="${t.iterateDelta}"`)),t.fullPrecision===!1&&(e+=' fullPrecision="0"'),t.calcOnSave===!1&&(e+=' calcOnSave="0"'),t.concurrentCalc===!1&&(e+=' concurrentCalc="0"')),`<calcPr ${e}/>`}_connectionsXml(t){return this.connections.length?`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
370
+ <connections xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">${this.connections.map(e=>{if(e._rawXml)return e._rawXml;let o=` id="${e.id}" name="${w(e.name)}" type="${Ds(e.type)}" refreshedVersion="6"`;e.description&&(o+=` description="${w(e.description)}"`),e.refreshOnLoad&&(o+=' refreshOnLoad="1"'),e.background&&(o+=' background="1"'),e.saveData&&(o+=' saveData="1"'),e.keepAlive&&(o+=' keepAlive="1"'),e.interval&&(o+=` interval="${e.interval}"`);let r=e.connectionString||e.command?`<dbPr${e.connectionString?` connection="${w(e.connectionString)}"`:""}${e.command?` command="${w(e.command)}"`:""}${e.commandType?` commandType="${As(e.commandType)}"`:""}/>`:"";return`<connection${o}>${r}</connection>`}).join("")}</connections>`:""}_buildWorkbookRels(t,e=!1){let o=[...t.workbookRels.entries()].filter(([n,a])=>!(e&&a.type.includes("/calcChain"))).map(([n,a])=>`<Relationship Id="${n}" Type="${a.type}" Target="${a.target}"/>`),r=t.sheets.length;for(let n=r;n<this.sheets.length;n++){let a=this.sheets[n],i=a._isChartSheet?"chartsheets":a._isDialogSheet?"dialogsheets":"worksheets",l=a._isChartSheet?"chartsheet":a._isDialogSheet?"dialogsheet":"worksheet";o.push(`<Relationship Id="${a.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${l}" Target="${i}/sheet${n+1}.xml"/>`)}return[...t.workbookRels.values()].some(n=>n.type.includes("/styles"))||o.push('<Relationship Id="rIdStyles" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>'),[...t.workbookRels.values()].some(n=>n.type.includes("/sharedStrings"))||o.push('<Relationship Id="rIdShared" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>'),this.vbaProject&&![...t.workbookRels.values()].some(n=>n.type.includes("vbaProject"))&&o.push('<Relationship Id="rIdVBA" Type="http://schemas.microsoft.com/office/2006/relationships/vbaProject" Target="vbaProject.bin"/>'),this.connections.length&&![...t.workbookRels.values()].some(n=>n.type.includes("/connections"))&&o.push('<Relationship Id="rIdConns" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections" Target="connections.xml"/>'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
371
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
372
+ ${o.join(`
373
+ `)}
374
+ </Relationships>`}_relsToXml(t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
375
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
376
+ ${[...t.entries()].map(([e,o])=>`<Relationship Id="${w(e)}" Type="${w(o.type)}" Target="${w(o.target)}"${o.targetMode?` TargetMode="${w(o.targetMode)}"`:""}/>`).join(`
377
+ `)}
378
+ </Relationships>`}_buildThemeXml(){let t=this.theme,e=t?.majorFont??"Calibri Light",o=t?.minorFont??"Calibri",r=[{name:"dk1",color:"000000"},{name:"lt1",color:"FFFFFF"},{name:"dk2",color:"44546A"},{name:"lt2",color:"E7E6E6"},{name:"accent1",color:"4472C4"},{name:"accent2",color:"ED7D31"},{name:"accent3",color:"A5A5A5"},{name:"accent4",color:"FFC000"},{name:"accent5",color:"5B9BD5"},{name:"accent6",color:"70AD47"},{name:"hlink",color:"0563C1"},{name:"folHlink",color:"954F72"}],a=(t?.colors?.map(i=>{let l=i.color.replace(/^#/,"");return l.length===8&&(l=l.substring(2)),{name:i.name,color:l}})??r).map(i=>i.name==="dk1"||i.name==="lt1"?`<a:${i.name}><a:sysClr val="${i.name==="dk1"?"windowText":"window"}" lastClr="${i.color}"/></a:${i.name}>`:`<a:${i.name}><a:srgbClr val="${i.color}"/></a:${i.name}>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
379
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${w(t?.name??"Office Theme")}">
380
+ <a:themeElements>
381
+ <a:clrScheme name="Office">${a}</a:clrScheme>
382
+ <a:fontScheme name="Office">
383
+ <a:majorFont><a:latin typeface="${w(e)}"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont>
384
+ <a:minorFont><a:latin typeface="${w(o)}"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont>
385
+ </a:fontScheme>
386
+ <a:fmtScheme name="Office">
387
+ <a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst>
388
+ <a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst>
389
+ <a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst>
390
+ <a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst>
391
+ </a:fmtScheme>
392
+ </a:themeElements>
393
+ <a:objectDefaults/>
394
+ <a:extraClrSchemeLst/>
395
+ </a:theme>`}_buildRootRels(t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
396
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
397
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
398
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
399
+ <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
400
+ ${t?'<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/>':""}
401
+ </Relationships>`}_patchContentTypes(t,e,o=!1){let r=t;o&&(r=r.replace(/<Override[^>]*calcChain[^>]*\/>/g,"")),r.includes("sharedStrings")||(r=r.replace("</Types>",`<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
402
+ </Types>`)),e&&!r.includes("custom-properties")&&(r=r.replace("</Types>",`<Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/>
403
+ </Types>`)),this.vbaProject&&(r.includes("vbaProject.bin")||(r=r.replace("</Types>",`<Override PartName="/xl/vbaProject.bin" ContentType="application/vnd.ms-office.vbaProject"/>
404
+ </Types>`)),r=r.replace("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml","application/vnd.ms-excel.sheet.macroEnabled.main+xml")),this.isTemplate&&!this.vbaProject&&(r=r.replace("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml")),this.connections.length&&!r.includes("connections.xml")&&(r=r.replace("</Types>",`<Override PartName="/xl/connections.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml"/>
405
+ </Types>`));for(let n=0;n<this.sheets.length;n++){let a=this.sheets[n],i=a._isChartSheet?"chartsheets":a._isDialogSheet?"dialogsheets":"worksheets",l=a._isChartSheet?"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":a._isDialogSheet?"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",d=`/xl/${i}/sheet${n+1}.xml`;r.includes(d)||(r=r.replace("</Types>",`<Override PartName="${d}" ContentType="${l}"/>
406
+ </Types>`))}return r}async buildBase64(){let t=await this.build(),e="";for(let o=0;o<t.length;o++)e+=String.fromCharCode(t[o]);return btoa(e)}async writeFile(t){let e=await this.build();await(await import("fs/promises")).writeFile(t,e)}_buildCommentsXml(t){let e=[...new Set(t.map(n=>n.comment.author??""))],o=e.map(n=>`<author>${w(n)}</author>`).join(""),r=t.map(({row:n,col:a,comment:i})=>{let l=`${Ct(a)}${n}`,d=e.indexOf(i.author??""),m;return i.richText&&i.richText.length>0?m=i.richText.map(c=>{let f="";if(c.font){let p=c.font;p.bold&&(f+="<b/>"),p.italic&&(f+="<i/>"),p.underline&&p.underline!=="none"&&(f+=`<u val="${p.underline==="single"?"single":p.underline}"/>`),p.strike&&(f+="<strike/>"),p.size&&(f+=`<sz val="${p.size}"/>`),p.color&&(f+=`<color rgb="${p.color}"/>`),p.name&&(f+=`<rFont val="${w(p.name)}"/>`),p.family!=null&&(f+=`<family val="${p.family}"/>`)}return`<r>${f?`<rPr>${f}</rPr>`:""}<t xml:space="preserve">${w(c.text)}</t></r>`}).join(""):m=`<r><t>${w(i.text)}</t></r>`,`<comment ref="${l}" authorId="${d}"><text>${m}</text></comment>`}).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
407
+ <comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
408
+ <authors>${o}</authors>
409
+ <commentList>${r}</commentList>
410
+ </comments>`}_buildVmlXml(t,e){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
411
+ <o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>
412
+ <v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>
413
+ ${t.map(({row:r,col:n},a)=>{let i=(n+1)*64,l=(r-1)*20;return`<v:shape id="_x0000_s${1025+e*1e3+a}" type="#_x0000_t202" style="position:absolute;margin-left:${i}pt;margin-top:${l}pt;width:108pt;height:59.25pt;z-index:${a+1};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto">
414
+ <v:fill color2="#ffffe1"/>
415
+ <v:shadow color="black" obscured="t"/>
416
+ <v:path o:connecttype="none"/>
417
+ <v:textbox style="mso-direction-alt:auto"><div style="text-align:left"/></v:textbox>
418
+ <x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${n+1},15,${r-1},10,${n+3},15,${r+4},4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${r-1}</x:Row><x:Column>${n-1}</x:Column></x:ClientData>
419
+ </v:shape>`}).join(`
420
+ `)}
421
+ </xml>`}async download(t="workbook.xlsx"){let e=await this.build(),o=new Blob([e.buffer],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),r=URL.createObjectURL(o),n=document.createElement("a");n.href=r,n.download=t,n.click(),URL.revokeObjectURL(r)}};function gr(s){switch(s){case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tiff":return"image/tiff";case"emf":return"image/x-emf";case"wmf":return"image/x-wmf";case"svg":return"image/svg+xml";case"ico":return"image/x-icon";case"webp":return"image/webp";default:return`image/${s}`}}function Bs(s){return s==="jpeg"?"jpg":s}function $r(s){let t=Array.from({length:s},(o,r)=>`<bk><extLst><ext uri="{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}"><xlrd:rvb i="${r}"/></ext></extLst></bk>`).join(""),e=Array.from({length:s},(o,r)=>`<bk><rc t="1" v="${r}"/></bk>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"><metadataTypes count="1"><metadataType name="XLRICHVALUE" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1"/></metadataTypes><futureMetadata name="XLRICHVALUE" count="${s}">${t}</futureMetadata><valueMetadata count="${s}">${e}</valueMetadata></metadata>`}function yr(s){let t=Array.from({length:s},(e,o)=>`<rv s="0"><v>${o}</v><v>5</v><v></v></rv>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="${s}">${t}</rvData>`}function br(s){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><richValueRels xmlns="http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'+s.map(t=>`<rel r:id="${t}"/>`).join("")+"</richValueRels>"}function Fr(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvStructures xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="1"><s t="_localImage"><k n="_rvRel:LocalImageIdentifier" t="i"/><k n="CalcOrigin" t="i"/><k n="Text" t="s"/></s></rvStructures>'}function wr(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvTypesInfo xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><global><keyFlags><key name="_Self"><flag name="ExcludeFromFile" value="1"/><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_DisplayString"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Flags"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Format"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_SubLabel"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Attribution"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Icon"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Display"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_CanonicalPropertyNames"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_ClassificationId"><flag name="ExcludeFromCalcComparison" value="1"/></key></keyFlags></global><types></types></rvTypesInfo>'}var xe=class{constructor(){this.s={}}font(t){return this.s.font={...this.s.font??{},...t},this}fontSize(t){return this.font({size:t})}fontName(t){return this.font({name:t})}bold(t=!0){return this.font({bold:t})}italic(t=!0){return this.font({italic:t})}strike(t=!0){return this.font({strike:t})}underline(t="single"){return this.font({underline:t})}fontColor(t){return this.font({color:t})}fill(t,e,o){return this.s.fill={type:"pattern",pattern:t,fgColor:e,bgColor:o},this}bg(t){return this.fill("solid",t)}border(t,e){let o={style:t,color:e};return this.s.border={left:o,right:o,top:o,bottom:o},this}borderLeft(t,e){return this.s.border={...this.s.border??{},left:{style:t,color:e}},this}borderRight(t,e){return this.s.border={...this.s.border??{},right:{style:t,color:e}},this}borderTop(t,e){return this.s.border={...this.s.border??{},top:{style:t,color:e}},this}borderBottom(t,e){return this.s.border={...this.s.border??{},bottom:{style:t,color:e}},this}align(t,e){return this.s.alignment={...this.s.alignment??{},horizontal:t,vertical:e},this}center(){return this.align("center","center")}wrap(t=!0){return this.s.alignment={...this.s.alignment??{},wrapText:t},this}rotate(t){return this.s.alignment={...this.s.alignment??{},textRotation:t},this}indent(t){return this.s.alignment={...this.s.alignment??{},indent:t},this}shrink(t=!0){return this.s.alignment={...this.s.alignment??{},shrinkToFit:t},this}numFmt(t){return this.s.numberFormat={formatCode:t},this}numFmtId(t){return this.s.numFmtId=t,this}locked(t=!0){return this.s.locked=t,this}hidden(t=!0){return this.s.hidden=t,this}build(){return{...this.s}}};function bt(){return new xe}var vr={headerBlue:bt().bold().bg("FF4472C4").fontColor("FFFFFFFF").center().build(),headerGray:bt().bold().bg("FF595959").fontColor("FFFFFFFF").center().build(),headerGreen:bt().bold().bg("FF70AD47").fontColor("FFFFFFFF").center().build(),currency:bt().numFmt('"$"#,##0.00').build(),percent:bt().numFmt("0.00%").build(),integer:bt().numFmt("#,##0").build(),date:bt().numFmtId(14).build(),dateTime:bt().numFmtId(22).build(),bold:bt().bold().build(),centered:bt().center().build(),wrapped:bt().wrap().build(),bordered:bt().border("thin").build(),borderedBlack:bt().border("thin","FF000000").build(),highlight:bt().bg("FFFFFF00").build(),lightBlue:bt().bg("FFDCE6F1").build(),redText:bt().fontColor("FFFF0000").build(),blueText:bt().fontColor("FF0000FF").build(),greenText:bt().fontColor("FF00B050").build(),tableHeader:bt().bold().border("thin").center().bg("FFD9E1F2").build(),deleted:bt().strike().fontColor("FF808080").build()},Cr={General:"General",Integer:"#,##0",Decimal2:"#,##0.00",Currency:'"$"#,##0.00',CurrencyNeg:'"$"#,##0.00;[Red]("$"#,##0.00)',Percent:"0%",Percent2:"0.00%",Scientific:"0.00E+00",Fraction:"# ?/?",ShortDate:"mm/dd/yyyy",LongDate:"mmmm d, yyyy",Time:"h:mm AM/PM",DateTime:"mm/dd/yyyy h:mm",Text:"@",Accounting:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',FinancialPos:"#,##0;(#,##0)",ZeroDash:'#,##0;(#,##0);"-"',Multiple:'0.0"x"'},Ir={White:"FFFFFFFF",Black:"FF000000",Red:"FFFF0000",Green:"FF00B050",Blue:"FF0070C0",Yellow:"FFFFFF00",Orange:"FFFFA500",Gray:"FF808080",LightGray:"FFD3D3D3",DarkBlue:"FF003366",ExcelBlue:"FF4472C4",ExcelOrange:"FFED7D31",ExcelGreen:"FF70AD47",ExcelRed:"FFFF0000",ExcelPurple:"FF7030A0",Transparent:"00FFFFFF"};export{Xt as CellError,Ir as Colors,Cr as NumFmt,Zt as SharedStrings,xe as StyleBuilder,Gt as StyleRegistry,vr as Styles,We as Workbook,Ut as Worksheet,ze as a1ToR1C1,Vt as base64ToBytes,js as bytesToBase64,kt as cellRefToIndices,Ct as colIndexToLetter,be as colLetterToIndex,Fe as dateToSerial,Ms as formulaFromR1C1,Es as formulaToR1C1,Mt as indicesToCellRef,Pt as parseRange,we as pxToEmu,He as r1c1ToA1,bt as style};