gm-datagrid 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/gm-datagrid.js +1938 -1918
- package/dist/gm-datagrid.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/gm-datagrid.umd.cjs
CHANGED
|
@@ -24,7 +24,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
24
24
|
* @license MIT license.
|
|
25
25
|
* @copyright (c) 2020 Kent C. Dodds
|
|
26
26
|
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
27
|
-
*/const _g={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},XE=(N,d)=>String(N.rankedValue).localeCompare(String(d.rankedValue));function oB(N,d,A={}){return _E(N,d,A).map(({item:n})=>n)}function _E(N,d,A){const{keys:n,threshold:c=_g.MATCHES,baseSort:e=XE,sorter:E=g=>g.sort((I,t)=>Qi(I,t,e))}=A,i=N.reduce(Q,[]);return E(i);function Q(g,I,t){const B=$E(I,n,d,A),{rank:C,keyThreshold:s=c}=B;return C>=s&&g.push({...B,item:I,index:t}),g}}oB.rankings=_g;function $E(N,d,A,n){if(!d){const e=N;return{rankedValue:e,rank:CC(e,A,n),keyIndex:-1,keyThreshold:n.threshold}}return Ei(N,d).reduce(({rank:e,rankedValue:E,keyIndex:i,keyThreshold:Q},{itemValue:g,attributes:I},t)=>{let B=CC(g,A,n),C=E;const{minRanking:s,maxRanking:D,threshold:o}=I;return B<s&&B>=_g.MATCHES?B=s:B>D&&(B=D),B>e&&(e=B,i=t,Q=o,C=g),{rankedValue:C,rank:e,keyIndex:i,keyThreshold:Q}},{rankedValue:N,rank:_g.NO_MATCH,keyIndex:-1,keyThreshold:n.threshold})}function*Ai(N,d){let A=-1;for(;(A=N.indexOf(d,A+1))>-1;)yield A;return-1}function CC(N,d,A){if(N=EC(N,A),d=EC(d,A),d.length>N.length)return _g.NO_MATCH;if(N===d)return _g.CASE_SENSITIVE_EQUAL;N=N.toLowerCase(),d=d.toLowerCase();const n=Ai(N,d),c=n.next(),e=c.value;if(N.length===d.length&&e===0)return _g.EQUAL;if(e===0)return _g.STARTS_WITH;let E=c;for(;!E.done;){if(E.value>0&&N[E.value-1]===" ")return _g.WORD_STARTS_WITH;E=n.next()}return e>0?_g.CONTAINS:d.length===1?_g.NO_MATCH:gi(N).includes(d)?_g.ACRONYM:Ii(N,d)}function gi(N){let d="",A=" ";for(let n=0;n<N.length;n++){const c=N.charAt(n);(A===" "||A==="-")&&!(c===" "||c==="-")&&(d+=c),A=c}return d}function Ii(N,d){let A=0,n=0;function c(Q,g,I){for(let t=I,B=g.length;t<B;t++)if(g[t]===Q)return A+=1,t+1;return-1}function e(Q){const g=1/Q,I=A/d.length;return _g.MATCHES+I*g}const E=c(d[0],N,0);if(E<0)return _g.NO_MATCH;n=E;for(let Q=1,g=d.length;Q<g;Q++){const I=d[Q];if(n=c(I,N,n),!(n>-1))return _g.NO_MATCH}const i=n-E;return e(i)}function Qi(N,d,A){const{rank:e,keyIndex:E}=N,{rank:i,keyIndex:Q}=d;return e===i?E===Q?A(N,d):E<Q?-1:1:e>i?-1:1}function EC(N,{keepDiacritics:d}){return N=`${N}`,d||(N=zE(N)),N}function Bi(N,d){typeof d=="object"&&(d=d.key);let A;if(typeof d=="function")A=d(N);else if(N==null)A=null;else if(Object.hasOwnProperty.call(N,d))A=N[d];else{if(d.includes("."))return Ci(d,N);A=null}return A==null?[]:Array.isArray(A)?A:[String(A)]}function Ci(N,d){const A=N.split(".");let n=[d];for(let c=0,e=A.length;c<e;c++){const E=A[c];let i=[];for(let Q=0,g=n.length;Q<g;Q++){const I=n[Q];if(I!=null)if(Object.hasOwnProperty.call(I,E)){const t=I[E];t!=null&&i.push(t)}else E==="*"&&(i=i.concat(I))}n=i}return Array.isArray(n[0])?[].concat(...n):n}function Ei(N,d){const A=[];for(let n=0,c=d.length;n<c;n++){const e=d[n],E=ii(e),i=Bi(N,e);for(let Q=0,g=i.length;Q<g;Q++)A.push({itemValue:i[Q],attributes:E})}return A}const iC={maxRanking:1/0,minRanking:-1/0};function ii(N){return typeof N=="string"?iC:{...iC,...N}}const ti=5e3;let eQ=null;function oi(){return eQ||(eQ=Promise.race([Promise.resolve().then(()=>aD).then(async N=>(await N.default?.(),N)),new Promise((N,d)=>setTimeout(()=>d(new Error("Wasm load timeout (5 s)")),ti))]).catch(N=>{throw eQ=null,N})),eQ}function ei(){const[N,d]=sA.useState(!1),[A,n]=sA.useState(null),c=sA.useRef(null),[e,E]=sA.useState(0);sA.useEffect(()=>{let Q=!1;return(async()=>{n(null),d(!1);try{const I=await oi();Q||(c.current=new I.GridEngine,d(!0))}catch(I){Q||n(I instanceof Error?I:new Error(String(I)))}})(),()=>{Q=!0}},[e]);const i=sA.useCallback(()=>{eQ=null,E(Q=>Q+1)},[]);return{engine:c.current,ready:N,error:A,retry:i}}function tC(N){return N==null?null:typeof N=="string"||typeof N=="number"||typeof N=="boolean"?N:JSON.stringify(N)}function si(N,d){const A=new Map;for(const n of d)n.valueGetter&&A.set(n.field,n.valueGetter);return N.map(n=>{const c=n,e={};for(const E of Object.keys(c)){const i=A.get(E);e[E]=tC(i?i(c):c[E])}for(const[E,i]of A.entries())i&&!(E in e)&&(e[E]=tC(i(c)));return e})}function Di({engine:N,ready:d,rows:A,columns:n,onSynced:c,page:e,pageSize:E,onPageData:i,sortStack:Q=[],filterGroup:g=null,quickFilterText:I="",groupBy:t=null,onGroups:B}){sA.useEffect(()=>{if(!(!d||!N))try{N.set_columns(JSON.stringify(n)),N.load_data(JSON.stringify(si(A,n))),N.set_sort_stack(JSON.stringify(Q)),g?N.set_filter_group(JSON.stringify(g)):N.clear_filters(),I?N.set_quick_filter(I):N.clear_quick_filter(),t?N.set_group_by(t):N.clear_group_by();const C=e*E,s=JSON.parse(N.get_page(C,E)),D=N.get_total_count(),o=JSON.parse(N.get_subtotals());if(i(s),c(D,o),t&&B){const a=JSON.parse(N.get_groups());B(a)}else B?.([])}catch(C){console.error("[GMDatagrid] engine sync error:",C)}},[d,N,A,n,Q,g,I,t,B,e,E,i,c])}const oC=sA.createContext(null);function eC({dataset:N,children:d,defaultPageSize:A=50,onRowSelectionChange:n}){const{engine:c,ready:e,error:E,retry:i}=ei(),[Q,g]=sA.useState([]),[I,t]=sA.useState(0),[B,C]=sA.useState({}),[s,D]=sA.useState(0),[o,a]=sA.useState(A),[r,l]=sA.useState(null),[R,Y]=sA.useState([]),[p,x]=sA.useState(new Set),[J,H]=sA.useState({}),[b,O]=sA.useState(new Set),m=sA.useCallback(f=>{if(!n)return;const q=N.rows.filter(W=>f.has(String(W.id??"")));n(q)},[n,N.rows]),F=sA.useCallback(f=>{O(q=>{const W=new Set(q);return W.has(f)?W.delete(f):W.add(f),m(W),W})},[m]),u=sA.useMemo(()=>Q.map(f=>String(f.id??"")),[Q]),G=u.length>0&&u.every(f=>b.has(f)),w=!G&&u.some(f=>b.has(f)),h=sA.useCallback(()=>{O(f=>{const q=new Set(f);return G?u.forEach(W=>q.delete(W)):u.forEach(W=>q.add(W)),m(q),q})},[G,u,m]),M=sA.useCallback(()=>{const f=new Set;O(f),m(f)},[m]),y=sA.useCallback(f=>{const q=new Set(f);O(q),m(q)},[m]),[k,L]=sA.useState(""),K=sA.useMemo(()=>N.columns.filter(f=>f.type==="string"||f.type==="text"||f.type==="code").map(f=>f.field),[N.columns]),v=sA.useMemo(()=>!k.trim()||K.length===0?N.rows:oB(N.rows,k.trim(),{keys:K,threshold:oB.rankings.MATCHES}),[N.rows,k,K]),T=sA.useCallback((f,q)=>{t(f),C(q)},[]),P=sA.useCallback(f=>{g(f)},[]),S=sA.useCallback(f=>{Y(f),x(new Set),H({})},[]),Z=sA.useCallback(f=>{const q=!p.has(f);if(x(W=>{const z=new Set(W);return z.has(f)?z.delete(f):z.add(f),z}),q&&c&&e)try{const W=JSON.parse(c.get_group_page(f,0,500));H(z=>({...z,[f]:W}))}catch(W){console.error("[GMDatagrid] get_group_page error:",W)}},[c,e,p]);Di({engine:c,ready:e,rows:v,columns:N.columns,page:s,pageSize:o,onSynced:T,onPageData:P,sortStack:N.sortStack,filterGroup:N.filterGroup,quickFilterText:N.quickFilterText,groupBy:r,onGroups:S});const U={...N,pageRows:Q,totalCount:I,subtotals:B,page:s,pageSize:o,setPage:D,setPageSize:a,engine:c,engineReady:e,engineError:E,retryEngine:i,groupBy:r,setGroupBy:l,groups:R,expandedGroups:p,groupRows:J,toggleGroup:Z,selectedIds:b,toggleRowSelection:F,toggleSelectAll:h,clearSelection:M,setSelectedIds:y,isAllSelected:G,isSomeSelected:w,textSearch:k,setTextSearch:L};return gA.jsxDEV(oC.Provider,{value:U,children:d},void 0,!1,{fileName:"/workspace/react-wrapper/src/context/GridContext.tsx",lineNumber:237,columnNumber:10},this)}function eB(){const N=sA.useContext(oC);if(!N)throw new Error("useGMGrid must be used inside <GridProvider>");return N}function sC(N){const{columns:d,sourceApi:A,apiParameters:n={},localData:c,apiContext:e}=N,[E,i]=sA.useState([]),[Q,g]=sA.useState(!c),[I,t]=sA.useState(null),[B,C]=sA.useState(!1),[s,D]=sA.useState(n),[o,a]=sA.useState([]),[r,l]=sA.useState(null),[R,Y]=sA.useState(""),p=sA.useRef(!0);sA.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const x=sA.useCallback(async H=>{if(A){g(!0),t(null);try{const b={...H,...e},O=await A(b);p.current&&(i(O.data??[]),C(!0))}catch(b){p.current&&t(b instanceof Error?b.message:"Error al cargar datos")}finally{p.current&&g(!1)}}},[A,e]);sA.useEffect(()=>{c&&(i(c),g(!1),C(!0))},[c]),sA.useEffect(()=>{c||x(s)},[s,x,c]);const J=sA.useCallback(()=>{c||x(s)},[x,s,c]);return{rows:E,loading:Q,error:I,ready:B,columns:d,handleRefresh:J,setApiParameters:D,sortStack:o,setSortStack:a,filterGroup:r,setFilterGroup:l,quickFilterText:R,setQuickFilterText:Y}}var zA=(N=>(N.STRING="string",N.NUMBER="number",N.PRICE="price",N.TOTAL="total",N.DISCOUNT="discount",N.PERCENT="percent",N.TAX="tax",N.MARGIN="margin",N.DATE="date",N.DATE_TIME="dateTime",N.STATUS="status",N.LABELS="labels",N.IMAGE="image",N.ACTION="action",N.MENU_ACTION="menu-action",N.ID="id",N.INT="int",N.CODE="code",N.ARRAY="array",N.TEXT="text",N))(zA||{});const ri={compact:36,standard:52,comfortable:72};function ai({rows:N,containerRef:d,density:A,overscan:n=10}){const c=ri[A],[e,E]=sA.useState({visibleStart:0,visibleEnd:Math.min(50,N.length),offsetTop:0,totalHeight:N.length*c}),i=sA.useRef(0);return sA.useEffect(()=>{const Q=d.current;if(!Q)return;const g=()=>{const I=Q.scrollTop,t=Q.clientHeight,B=Math.floor(I/c),C=Math.ceil((I+t)/c),s=Math.max(0,B-n),D=Math.min(N.length,C+n);E({visibleStart:s,visibleEnd:D,offsetTop:s*c,totalHeight:N.length*c}),i.current=requestAnimationFrame(g)};return i.current=requestAnimationFrame(g),()=>cancelAnimationFrame(i.current)},[d,N.length,c,n]),e}function wi({visibleRows:N,columns:d}){const[A,n]=sA.useState(null),[c,e]=sA.useState(null),[E,i]=sA.useState(!1),Q=sA.useRef(null),g=sA.useCallback((s,D)=>{const o={rowIndex:s,colIndex:D};Q.current=o,n({start:o,end:o}),e(o),i(!0)},[]),I=sA.useCallback((s,D)=>{if(!E||!Q.current)return;const o=Q.current;n({start:{rowIndex:Math.min(o.rowIndex,s),colIndex:Math.min(o.colIndex,D)},end:{rowIndex:Math.max(o.rowIndex,s),colIndex:Math.max(o.colIndex,D)}})},[E]),t=sA.useCallback(()=>i(!1),[]);sA.useEffect(()=>(document.addEventListener("mouseup",t),()=>document.removeEventListener("mouseup",t)),[t]);const B=sA.useCallback(()=>{n(null),e(null),Q.current=null},[]),C=sA.useCallback((s,D)=>A?s>=A.start.rowIndex&&s<=A.end.rowIndex&&D>=A.start.colIndex&&D<=A.end.colIndex:!1,[A]);return{range:A,focusedCell:c,isSelecting:E,handleMouseDown:g,handleMouseEnter:I,handleMouseUp:t,setFocusedCell:e,clearSelection:B,isCellSelected:C}}function ni({range:N,visibleRows:d,columns:A,engine:n,engineReady:c,onPasted:e,gridRootRef:E}){const i=sA.useCallback(async()=>{if(!N)return;const g=[];for(let I=N.start.rowIndex;I<=N.end.rowIndex;I++){const t=[];for(let B=N.start.colIndex;B<=N.end.colIndex;B++){const C=A[B]?.field??"",s=d[I]?.[C];t.push(s==null?"":String(s))}g.push(t.join(" "))}await ci(g.join(`
|
|
27
|
+
*/const _g={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},XE=(N,d)=>String(N.rankedValue).localeCompare(String(d.rankedValue));function oB(N,d,A={}){return _E(N,d,A).map(({item:n})=>n)}function _E(N,d,A){const{keys:n,threshold:c=_g.MATCHES,baseSort:e=XE,sorter:E=g=>g.sort((I,t)=>Qi(I,t,e))}=A,i=N.reduce(Q,[]);return E(i);function Q(g,I,t){const B=$E(I,n,d,A),{rank:C,keyThreshold:s=c}=B;return C>=s&&g.push({...B,item:I,index:t}),g}}oB.rankings=_g;function $E(N,d,A,n){if(!d){const e=N;return{rankedValue:e,rank:CC(e,A,n),keyIndex:-1,keyThreshold:n.threshold}}return Ei(N,d).reduce(({rank:e,rankedValue:E,keyIndex:i,keyThreshold:Q},{itemValue:g,attributes:I},t)=>{let B=CC(g,A,n),C=E;const{minRanking:s,maxRanking:D,threshold:o}=I;return B<s&&B>=_g.MATCHES?B=s:B>D&&(B=D),B>e&&(e=B,i=t,Q=o,C=g),{rankedValue:C,rank:e,keyIndex:i,keyThreshold:Q}},{rankedValue:N,rank:_g.NO_MATCH,keyIndex:-1,keyThreshold:n.threshold})}function*Ai(N,d){let A=-1;for(;(A=N.indexOf(d,A+1))>-1;)yield A;return-1}function CC(N,d,A){if(N=EC(N,A),d=EC(d,A),d.length>N.length)return _g.NO_MATCH;if(N===d)return _g.CASE_SENSITIVE_EQUAL;N=N.toLowerCase(),d=d.toLowerCase();const n=Ai(N,d),c=n.next(),e=c.value;if(N.length===d.length&&e===0)return _g.EQUAL;if(e===0)return _g.STARTS_WITH;let E=c;for(;!E.done;){if(E.value>0&&N[E.value-1]===" ")return _g.WORD_STARTS_WITH;E=n.next()}return e>0?_g.CONTAINS:d.length===1?_g.NO_MATCH:gi(N).includes(d)?_g.ACRONYM:Ii(N,d)}function gi(N){let d="",A=" ";for(let n=0;n<N.length;n++){const c=N.charAt(n);(A===" "||A==="-")&&!(c===" "||c==="-")&&(d+=c),A=c}return d}function Ii(N,d){let A=0,n=0;function c(Q,g,I){for(let t=I,B=g.length;t<B;t++)if(g[t]===Q)return A+=1,t+1;return-1}function e(Q){const g=1/Q,I=A/d.length;return _g.MATCHES+I*g}const E=c(d[0],N,0);if(E<0)return _g.NO_MATCH;n=E;for(let Q=1,g=d.length;Q<g;Q++){const I=d[Q];if(n=c(I,N,n),!(n>-1))return _g.NO_MATCH}const i=n-E;return e(i)}function Qi(N,d,A){const{rank:e,keyIndex:E}=N,{rank:i,keyIndex:Q}=d;return e===i?E===Q?A(N,d):E<Q?-1:1:e>i?-1:1}function EC(N,{keepDiacritics:d}){return N=`${N}`,d||(N=zE(N)),N}function Bi(N,d){typeof d=="object"&&(d=d.key);let A;if(typeof d=="function")A=d(N);else if(N==null)A=null;else if(Object.hasOwnProperty.call(N,d))A=N[d];else{if(d.includes("."))return Ci(d,N);A=null}return A==null?[]:Array.isArray(A)?A:[String(A)]}function Ci(N,d){const A=N.split(".");let n=[d];for(let c=0,e=A.length;c<e;c++){const E=A[c];let i=[];for(let Q=0,g=n.length;Q<g;Q++){const I=n[Q];if(I!=null)if(Object.hasOwnProperty.call(I,E)){const t=I[E];t!=null&&i.push(t)}else E==="*"&&(i=i.concat(I))}n=i}return Array.isArray(n[0])?[].concat(...n):n}function Ei(N,d){const A=[];for(let n=0,c=d.length;n<c;n++){const e=d[n],E=ii(e),i=Bi(N,e);for(let Q=0,g=i.length;Q<g;Q++)A.push({itemValue:i[Q],attributes:E})}return A}const iC={maxRanking:1/0,minRanking:-1/0};function ii(N){return typeof N=="string"?iC:{...iC,...N}}const ti=5e3;let eQ=null;function oi(){return eQ||(eQ=Promise.race([Promise.resolve().then(()=>aD).then(async N=>(await N.default?.(),N)),new Promise((N,d)=>setTimeout(()=>d(new Error("Wasm load timeout (5 s)")),ti))]).catch(N=>{throw eQ=null,N})),eQ}function ei(){const[N,d]=sA.useState(!1),[A,n]=sA.useState(null),c=sA.useRef(null),[e,E]=sA.useState(0);sA.useEffect(()=>{let Q=!1;return(async()=>{n(null),d(!1);try{const I=await oi();Q||(c.current=new I.GridEngine,d(!0))}catch(I){Q||n(I instanceof Error?I:new Error(String(I)))}})(),()=>{Q=!0}},[e]);const i=sA.useCallback(()=>{eQ=null,E(Q=>Q+1)},[]);return{engine:c.current,ready:N,error:A,retry:i}}function tC(N){return N==null?null:typeof N=="string"||typeof N=="number"||typeof N=="boolean"?N:JSON.stringify(N)}function si(N,d){const A=new Map;for(const n of d)n.valueGetter&&A.set(n.field,n.valueGetter);return N.map(n=>{const c=n,e={};for(const E of Object.keys(c)){const i=A.get(E);e[E]=tC(i?i(c):c[E])}for(const[E,i]of A.entries())i&&!(E in e)&&(e[E]=tC(i(c)));return e})}function Di({engine:N,ready:d,rows:A,columns:n,onSynced:c,page:e,pageSize:E,onPageData:i,sortStack:Q=[],filterGroup:g=null,quickFilterText:I="",groupBy:t=null,onGroups:B}){sA.useEffect(()=>{if(!(!d||!N))try{N.set_columns(JSON.stringify(n)),N.load_data(JSON.stringify(si(A,n))),N.set_sort_stack(JSON.stringify(Q)),g?N.set_filter_group(JSON.stringify(g)):N.clear_filters(),I?N.set_quick_filter(I):N.clear_quick_filter(),t?N.set_group_by(t):N.clear_group_by();const C=e*E,s=JSON.parse(N.get_page(C,E)),D=N.get_total_count(),o=JSON.parse(N.get_subtotals());if(i(s),c(D,o),t&&B){const a=JSON.parse(N.get_groups());B(a)}else B?.([])}catch(C){console.error("[GMDatagrid] engine sync error:",C)}},[d,N,A,n,Q,g,I,t,B,e,E,i,c])}const oC=sA.createContext(null);function eC({dataset:N,children:d,defaultPageSize:A=50,onRowSelectionChange:n}){const{engine:c,ready:e,error:E,retry:i}=ei(),[Q,g]=sA.useState([]),[I,t]=sA.useState(0),[B,C]=sA.useState({}),[s,D]=sA.useState(0),[o,a]=sA.useState(A),[r,l]=sA.useState(null),[R,Y]=sA.useState([]),[p,x]=sA.useState(new Set),[J,H]=sA.useState({}),[b,O]=sA.useState(new Set),m=sA.useCallback(f=>{if(!n)return;const q=N.rows.filter(W=>f.has(String(W.id??"")));n(q)},[n,N.rows]),F=sA.useCallback(f=>{O(q=>{const W=new Set(q);return W.has(f)?W.delete(f):W.add(f),m(W),W})},[m]),u=sA.useMemo(()=>Q.map(f=>String(f.id??"")),[Q]),G=u.length>0&&u.every(f=>b.has(f)),w=!G&&u.some(f=>b.has(f)),h=sA.useCallback(()=>{O(f=>{const q=new Set(f);return G?u.forEach(W=>q.delete(W)):u.forEach(W=>q.add(W)),m(q),q})},[G,u,m]),M=sA.useCallback(()=>{const f=new Set;O(f),m(f)},[m]),y=sA.useCallback(f=>{const q=new Set(f);O(q),m(q)},[m]),[k,L]=sA.useState(""),K=sA.useMemo(()=>N.columns.filter(f=>f.type==="string"||f.type==="text"||f.type==="code").map(f=>f.field),[N.columns]),v=sA.useMemo(()=>!k.trim()||K.length===0?N.rows:oB(N.rows,k.trim(),{keys:K,threshold:oB.rankings.MATCHES}),[N.rows,k,K]),T=sA.useCallback((f,q)=>{t(f),C(q)},[]),P=sA.useCallback(f=>{g(f)},[]),S=sA.useCallback(f=>{Y(f),x(new Set),H({})},[]),Z=sA.useCallback(f=>{const q=!p.has(f);if(x(W=>{const z=new Set(W);return z.has(f)?z.delete(f):z.add(f),z}),q&&c&&e&&!J[f])try{const W=JSON.parse(c.get_group_page(f,0,500));H(z=>({...z,[f]:W}))}catch(W){console.error("[GMDatagrid] get_group_page error:",W)}},[c,e,p,J]);sA.useEffect(()=>{if(!c||!e||!r||R.length===0)return;const f=R.map(W=>W.key).filter(W=>!J[W]);if(f.length===0)return;const q={};for(const W of f)try{q[W]=JSON.parse(c.get_group_page(W,0,500))}catch(z){console.error("[GMDatagrid] preload group error:",W,z)}Object.keys(q).length>0&&H(W=>({...W,...q}))},[c,e,r,R]),Di({engine:c,ready:e,rows:v,columns:N.columns,page:s,pageSize:o,onSynced:T,onPageData:P,sortStack:N.sortStack,filterGroup:N.filterGroup,quickFilterText:N.quickFilterText,groupBy:r,onGroups:S});const U={...N,pageRows:Q,totalCount:I,subtotals:B,page:s,pageSize:o,setPage:D,setPageSize:a,engine:c,engineReady:e,engineError:E,retryEngine:i,groupBy:r,setGroupBy:l,groups:R,expandedGroups:p,groupRows:J,toggleGroup:Z,selectedIds:b,toggleRowSelection:F,toggleSelectAll:h,clearSelection:M,setSelectedIds:y,isAllSelected:G,isSomeSelected:w,textSearch:k,setTextSearch:L};return gA.jsxDEV(oC.Provider,{value:U,children:d},void 0,!1,{fileName:"/workspace/react-wrapper/src/context/GridContext.tsx",lineNumber:259,columnNumber:10},this)}function eB(){const N=sA.useContext(oC);if(!N)throw new Error("useGMGrid must be used inside <GridProvider>");return N}function sC(N){const{columns:d,sourceApi:A,apiParameters:n={},localData:c,apiContext:e}=N,[E,i]=sA.useState([]),[Q,g]=sA.useState(!c),[I,t]=sA.useState(null),[B,C]=sA.useState(!1),[s,D]=sA.useState(n),[o,a]=sA.useState([]),[r,l]=sA.useState(null),[R,Y]=sA.useState(""),p=sA.useRef(!0);sA.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const x=sA.useCallback(async H=>{if(A){g(!0),t(null);try{const b={...H,...e},O=await A(b);p.current&&(i(O.data??[]),C(!0))}catch(b){p.current&&t(b instanceof Error?b.message:"Error al cargar datos")}finally{p.current&&g(!1)}}},[A,e]);sA.useEffect(()=>{c&&(i(c),g(!1),C(!0))},[c]),sA.useEffect(()=>{c||x(s)},[s,x,c]);const J=sA.useCallback(()=>{c||x(s)},[x,s,c]);return{rows:E,loading:Q,error:I,ready:B,columns:d,handleRefresh:J,setApiParameters:D,sortStack:o,setSortStack:a,filterGroup:r,setFilterGroup:l,quickFilterText:R,setQuickFilterText:Y}}var zA=(N=>(N.STRING="string",N.NUMBER="number",N.PRICE="price",N.TOTAL="total",N.DISCOUNT="discount",N.PERCENT="percent",N.TAX="tax",N.MARGIN="margin",N.DATE="date",N.DATE_TIME="dateTime",N.STATUS="status",N.LABELS="labels",N.IMAGE="image",N.ACTION="action",N.MENU_ACTION="menu-action",N.ID="id",N.INT="int",N.CODE="code",N.ARRAY="array",N.TEXT="text",N))(zA||{});const ri={compact:36,standard:52,comfortable:72};function ai({rows:N,containerRef:d,density:A,overscan:n=10}){const c=ri[A],[e,E]=sA.useState({visibleStart:0,visibleEnd:Math.min(50,N.length),offsetTop:0,totalHeight:N.length*c}),i=sA.useRef(0);return sA.useEffect(()=>{const Q=d.current;if(!Q)return;const g=()=>{const I=Q.scrollTop,t=Q.clientHeight,B=Math.floor(I/c),C=Math.ceil((I+t)/c),s=Math.max(0,B-n),D=Math.min(N.length,C+n);E({visibleStart:s,visibleEnd:D,offsetTop:s*c,totalHeight:N.length*c}),i.current=requestAnimationFrame(g)};return i.current=requestAnimationFrame(g),()=>cancelAnimationFrame(i.current)},[d,N.length,c,n]),e}function wi({visibleRows:N,columns:d}){const[A,n]=sA.useState(null),[c,e]=sA.useState(null),[E,i]=sA.useState(!1),Q=sA.useRef(null),g=sA.useCallback((s,D)=>{const o={rowIndex:s,colIndex:D};Q.current=o,n({start:o,end:o}),e(o),i(!0)},[]),I=sA.useCallback((s,D)=>{if(!E||!Q.current)return;const o=Q.current;n({start:{rowIndex:Math.min(o.rowIndex,s),colIndex:Math.min(o.colIndex,D)},end:{rowIndex:Math.max(o.rowIndex,s),colIndex:Math.max(o.colIndex,D)}})},[E]),t=sA.useCallback(()=>i(!1),[]);sA.useEffect(()=>(document.addEventListener("mouseup",t),()=>document.removeEventListener("mouseup",t)),[t]);const B=sA.useCallback(()=>{n(null),e(null),Q.current=null},[]),C=sA.useCallback((s,D)=>A?s>=A.start.rowIndex&&s<=A.end.rowIndex&&D>=A.start.colIndex&&D<=A.end.colIndex:!1,[A]);return{range:A,focusedCell:c,isSelecting:E,handleMouseDown:g,handleMouseEnter:I,handleMouseUp:t,setFocusedCell:e,clearSelection:B,isCellSelected:C}}function ni({range:N,visibleRows:d,columns:A,engine:n,engineReady:c,onPasted:e,gridRootRef:E}){const i=sA.useCallback(async()=>{if(!N)return;const g=[];for(let I=N.start.rowIndex;I<=N.end.rowIndex;I++){const t=[];for(let B=N.start.colIndex;B<=N.end.colIndex;B++){const C=A[B]?.field??"",s=d[I]?.[C];t.push(s==null?"":String(s))}g.push(t.join(" "))}await ci(g.join(`
|
|
28
28
|
`))},[N,d,A]),Q=sA.useCallback(async()=>{},[c,n,A,d,e]);sA.useEffect(()=>{const g=I=>{const t=E.current;if(!t||!t.contains(document.activeElement))return;const B=I.ctrlKey||I.metaKey;B&&I.key==="c"&&(I.preventDefault(),i()),B&&I.key==="v"&&(I.preventDefault(),Q())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[E,i,Q])}async function ci(N){try{await navigator.clipboard.writeText(N)}catch{const d=document.createElement("textarea");d.value=N,d.style.position="fixed",d.style.opacity="0",document.body.appendChild(d),d.select(),document.execCommand("copy"),document.body.removeChild(d)}}function hi({visibleRows:N,columns:d,engine:A,engineReady:n,processRowUpdate:c,onCellError:e,onCellEditStart:E,onCellEditStop:i,isCellEditable:Q,editableFlag:g=!1,editableSet:I=null}){const[t,B]=sA.useState(null),[C,s]=sA.useState(""),[D,o]=sA.useState({}),a=sA.useCallback((l,R)=>{if(!g)return;const Y=N[l.rowIndex],p=d[l.colIndex];if(!Y||!p||!(I?I.has(p.field):p.editable!==!1))return;if(Q){const b={id:Y.id??"",field:p.field,value:Y[p.field],row:Y};if(!Q(b))return}const J=Y[p.field],H=R??(J==null?"":String(J));s(H),B(l),E?.({id:Y.id??"",field:p.field,value:J,row:Y})},[N,d,g,I,Q,E]),r=sA.useCallback(async l=>{if(!t)return;const{rowIndex:R,colIndex:Y}=t,p=d[Y],x=N[R];B(null),p&&x&&i?.({id:x.id??"",field:p.field,value:l?C:x[p.field],row:x})},[t,d,N,C,A,n,c,e,i]);return{editingCell:t,editValue:C,startEditing:a,stopEditing:r,setEditValue:s,cellErrors:D}}function Mi({focusedCell:N,setFocusedCell:d,editingCell:A,startEditing:n,stopEditing:c,totalRows:e,columns:E,gridRootRef:i}){const Q=sA.useCallback((I,t)=>{if(!N)return;const B=Math.max(0,Math.min(e-1,N.rowIndex+I)),C=Math.max(0,Math.min(E.length-1,N.colIndex+t));d({rowIndex:B,colIndex:C})},[N,d,e,E.length]),g=sA.useCallback(I=>{const t=i.current;if(!t)return;const B=document.activeElement;if(!(B&&!t.contains(B))&&N){if(A){I.key==="Escape"?(I.preventDefault(),c(!1)):I.key==="Enter"&&!I.shiftKey?(I.preventDefault(),c(!0).then(()=>Q(1,0))):I.key==="Tab"&&(I.preventDefault(),c(!0).then(()=>Q(0,I.shiftKey?-1:1)));return}switch(I.key){case"ArrowUp":!I.ctrlKey&&!I.metaKey&&(I.preventDefault(),Q(-1,0));break;case"ArrowDown":!I.ctrlKey&&!I.metaKey&&(I.preventDefault(),Q(1,0));break;case"ArrowLeft":!I.ctrlKey&&!I.metaKey&&(I.preventDefault(),Q(0,-1));break;case"ArrowRight":!I.ctrlKey&&!I.metaKey&&(I.preventDefault(),Q(0,1));break;case"Tab":I.preventDefault(),Q(0,I.shiftKey?-1:1);break;case"Enter":I.preventDefault(),n(N);break;case"F2":I.preventDefault(),n(N);break;default:I.key.length===1&&!I.ctrlKey&&!I.metaKey&&!I.altKey&&n(N,I.key)}}},[i,N,A,Q,n,c]);sA.useEffect(()=>{const I=i.current;if(I)return I.addEventListener("keydown",g),()=>I.removeEventListener("keydown",g)},[i,g])}const Ni="gm-datagrid-col-widths-";function yi({columns:N,gridTitle:d}){const A=Ni+d,[n,c]=sA.useState(()=>{try{const i=localStorage.getItem(A);if(i)return JSON.parse(i)}catch{}const E={};return N.forEach(i=>{E[i.field]=i.width??i.minWidth??120}),E});sA.useEffect(()=>{try{localStorage.setItem(A,JSON.stringify(n))}catch{}},[n,A]);const e=sA.useCallback((E,i,Q)=>{const g=t=>{const B=t.clientX-i,C=N.find(D=>D.field===E)?.minWidth??60,s=Math.max(C,Q+B);c(D=>({...D,[E]:s}))},I=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",I)},[N]);return{widths:n,onResizeStart:e}}function KQ(N){throw new Error('Could not dynamically require "'+N+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var sB={exports:{}};/*! ExcelJS 19-10-2023 */var DC;function Gi(){return DC||(DC=1,(function(N,d){(function(A){N.exports=A()})((function(){return(function A(n,c,e){function E(g,I){if(!c[g]){if(!n[g]){var t=typeof KQ=="function"&&KQ;if(!I&&t)return t(g,!0);if(i)return i(g,!0);var B=new Error("Cannot find module '"+g+"'");throw B.code="MODULE_NOT_FOUND",B}var C=c[g]={exports:{}};n[g][0].call(C.exports,(function(s){return E(n[g][1][s]||s)}),C,C.exports,A,n,c,e)}return c[g].exports}for(var i=typeof KQ=="function"&&KQ,Q=0;Q<e.length;Q++)E(e[Q]);return E})({1:[function(A,n,c){const e=A("fs"),E=A("fast-csv"),i=A("dayjs/plugin/customParseFormat"),Q=A("dayjs/plugin/utc"),g=A("dayjs").extend(i).extend(Q),I=A("../utils/stream-buf"),{fs:{exists:t}}=A("../utils/utils"),B={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};n.exports=class{constructor(C){this.workbook=C,this.worksheet=null}async readFile(C,s){if(s=s||{},!await t(C))throw new Error("File not found: "+C);const D=e.createReadStream(C),o=await this.read(D,s);return D.close(),o}read(C,s){return s=s||{},new Promise((D,o)=>{const a=this.workbook.addWorksheet(s.sheetName),r=s.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],l=s.map||function(Y){if(Y==="")return null;const p=Number(Y);if(!Number.isNaN(p)&&p!==1/0)return p;const x=r.reduce((H,b)=>{if(H)return H;const O=g(Y,b,!0);return O.isValid()?O:null},null);if(x)return new Date(x.valueOf());const J=B[Y];return J!==void 0?J:Y},R=E.parse(s.parserOptions).on("data",Y=>{a.addRow(Y.map(l))}).on("end",()=>{R.emit("worksheet",a)});R.on("worksheet",D).on("error",o),C.pipe(R)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(C,s){return new Promise((D,o)=>{s=s||{};const a=this.workbook.getWorksheet(s.sheetName||s.sheetId),r=E.format(s.formatterOptions);C.on("finish",()=>{D()}),r.on("error",o),r.pipe(C);const{dateFormat:l,dateUTC:R}=s,Y=s.map||(J=>{if(J){if(J.text||J.hyperlink)return J.hyperlink||J.text||"";if(J.formula||J.result)return J.result||"";if(J instanceof Date)return l?R?g.utc(J).format(l):g(J).format(l):R?g.utc(J).format():g(J).format();if(J.error)return J.error;if(typeof J=="object")return JSON.stringify(J)}return J}),p=s.includeEmptyRows===void 0||s.includeEmptyRows;let x=1;a&&a.eachRow((J,H)=>{if(p)for(;x++<H-1;)r.write([]);const{values:b}=J;b.shift(),r.write(b.map(Y)),x=H}),r.end()})}writeFile(C,s){const D={encoding:(s=s||{}).encoding||"utf8"},o=e.createWriteStream(C,D);return this.write(o,s)}async writeBuffer(C){const s=new I;return await this.write(s,C),s.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(A,n,c){const e=A("../utils/col-cache");class E{constructor(Q,g){let I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=Q,g)if(typeof g=="string"){const t=e.decodeAddress(g);this.nativeCol=t.col+I,this.nativeColOff=0,this.nativeRow=t.row+I,this.nativeRowOff=0}else g.nativeCol!==void 0?(this.nativeCol=g.nativeCol||0,this.nativeColOff=g.nativeColOff||0,this.nativeRow=g.nativeRow||0,this.nativeRowOff=g.nativeRowOff||0):g.col!==void 0?(this.col=g.col+I,this.row=g.row+I):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(Q){return Q instanceof E||Q==null?Q:new E(Q)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(Q){this.nativeCol=Math.floor(Q),this.nativeColOff=Math.floor((Q-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(Q){this.nativeRow=Math.floor(Q),this.nativeRowOff=Math.floor((Q-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(Q){this.nativeCol=Q.nativeCol,this.nativeColOff=Q.nativeColOff,this.nativeRow=Q.nativeRow,this.nativeRowOff=Q.nativeRowOff}}n.exports=E},{"../utils/col-cache":19}],3:[function(A,n,c){const e=A("../utils/col-cache"),E=A("../utils/under-dash"),i=A("./enums"),{slideFormula:Q}=A("../utils/shared-formula"),g=A("./note");class I{constructor(C,s,D){if(!C||!s)throw new Error("A Cell needs a Row");this._row=C,this._column=s,e.validateAddress(D),this._address=D,this._value=t.create(I.Types.Null,this),this.style=this._mergeStyle(C.style,s.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(C){this.style.numFmt=C}get font(){return this.style.font}set font(C){this.style.font=C}get alignment(){return this.style.alignment}set alignment(C){this.style.alignment=C}get border(){return this.style.border}set border(C){this.style.border=C}get fill(){return this.style.fill}set fill(C){this.style.fill=C}get protection(){return this.style.protection}set protection(C){this.style.protection=C}_mergeStyle(C,s,D){const o=C&&C.numFmt||s&&s.numFmt;o&&(D.numFmt=o);const a=C&&C.font||s&&s.font;a&&(D.font=a);const r=C&&C.alignment||s&&s.alignment;r&&(D.alignment=r);const l=C&&C.border||s&&s.border;l&&(D.border=l);const R=C&&C.fill||s&&s.fill;R&&(D.fill=R);const Y=C&&C.protection||s&&s.protection;return Y&&(D.protection=Y),D}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===I.Types.Merge}merge(C,s){this._value.release(),this._value=t.create(I.Types.Merge,this,C),s||(this.style=C.style)}unmerge(){this.type===I.Types.Merge&&(this._value.release(),this._value=t.create(I.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(C){return this._value.type===I.Types.Merge&&this._value.isMergedTo(C)}get master(){return this.type===I.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===I.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(C){this.type!==I.Types.Merge?(this._value.release(),this._value=t.create(t.getType(C),this,C)):this._value.master.value=C}get note(){return this._comment&&this._comment.note}set note(C){this._comment=new g(C)}get text(){return this._value.toString()}get html(){return E.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(C){this.type===I.Types.String&&(this._value=t.create(I.Types.Hyperlink,this,{text:this._value.value,hyperlink:C}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:C}=this._row;return{sheetName:C.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(C){this.names=[C]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(C){const{definedNames:s}=this.workbook;s.removeAllNames(this.fullAddress),C.forEach(D=>{s.addEx(this.fullAddress,D)})}addName(C){this.workbook.definedNames.addEx(this.fullAddress,C)}removeName(C){this.workbook.definedNames.removeEx(this.fullAddress,C)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(C){this._dataValidations.add(this.address,C)}get model(){const{model:C}=this._value;return C.style=this.style,this._comment&&(C.comment=this._comment.model),C}set model(C){if(this._value.release(),this._value=t.create(C.type,this),this._value.model=C,C.comment)switch(C.comment.type){case"note":this._comment=g.fromModel(C.comment)}C.style?this.style=C.style:this.style={}}}I.Types=i.ValueType;const t={getType:B=>B==null?I.Types.Null:B instanceof String||typeof B=="string"?I.Types.String:typeof B=="number"?I.Types.Number:typeof B=="boolean"?I.Types.Boolean:B instanceof Date?I.Types.Date:B.text&&B.hyperlink?I.Types.Hyperlink:B.formula||B.sharedFormula?I.Types.Formula:B.richText?I.Types.RichText:B.sharedString?I.Types.SharedString:B.error?I.Types.Error:I.Types.JSON,types:[{t:I.Types.Null,f:class{constructor(B){this.model={address:B.address,type:I.Types.Null}}get value(){return null}set value(B){}get type(){return I.Types.Null}get effectiveType(){return I.Types.Null}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return""}release(){}toString(){return""}}},{t:I.Types.Number,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Number,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.Number}get effectiveType(){return I.Types.Number}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:I.Types.String,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.String,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.String}get effectiveType(){return I.Types.String}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:I.Types.Date,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Date,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.Date}get effectiveType(){return I.Types.Date}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:I.Types.Hyperlink,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Hyperlink,text:C?C.text:void 0,hyperlink:C?C.hyperlink:void 0},C&&C.tooltip&&(this.model.tooltip=C.tooltip)}get value(){const B={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(B.tooltip=this.model.tooltip),B}set value(B){this.model={text:B.text,hyperlink:B.hyperlink},B.tooltip&&(this.model.tooltip=B.tooltip)}get text(){return this.model.text}set text(B){this.model.text=B}get hyperlink(){return this.model.hyperlink}set hyperlink(B){this.model.hyperlink=B}get type(){return I.Types.Hyperlink}get effectiveType(){return I.Types.Hyperlink}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:I.Types.Formula,f:class{constructor(B,C){this.cell=B,this.model={address:B.address,type:I.Types.Formula,shareType:C?C.shareType:void 0,ref:C?C.ref:void 0,formula:C?C.formula:void 0,sharedFormula:C?C.sharedFormula:void 0,result:C?C.result:void 0}}_copyModel(B){const C={},s=D=>{const o=B[D];o&&(C[D]=o)};return s("formula"),s("result"),s("ref"),s("shareType"),s("sharedFormula"),C}get value(){return this._copyModel(this.model)}set value(B){this.model=this._copyModel(B)}validate(B){switch(t.getType(B)){case I.Types.Null:case I.Types.String:case I.Types.Number:case I.Types.Date:break;case I.Types.Hyperlink:case I.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(B){this.model.formula=B}get formulaType(){return this.model.formula?i.FormulaType.Master:this.model.sharedFormula?i.FormulaType.Shared:i.FormulaType.None}get result(){return this.model.result}set result(B){this.model.result=B}get type(){return I.Types.Formula}get effectiveType(){const B=this.model.result;return B==null?i.ValueType.Null:B instanceof String||typeof B=="string"?i.ValueType.String:typeof B=="number"?i.ValueType.Number:B instanceof Date?i.ValueType.Date:B.text&&B.hyperlink?i.ValueType.Hyperlink:B.formula?i.ValueType.Formula:i.ValueType.Null}get address(){return this.model.address}set address(B){this.model.address=B}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:B}=this.cell,C=B.findCell(this.model.sharedFormula);this._translatedFormula=C&&Q(C.formula,C.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:I.Types.Merge,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Merge,master:C?C.address:void 0},this._master=C,C&&C.addMergeRef()}get value(){return this._master.value}set value(B){B instanceof I?(this._master&&this._master.releaseMergeRef(),B.addMergeRef(),this._master=B):this._master.value=B}isMergedTo(B){return B===this._master}get master(){return this._master}get type(){return I.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:I.Types.JSON,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.String,value:JSON.stringify(C),rawValue:C}}get value(){return this.model.rawValue}set value(B){this.model.rawValue=B,this.model.value=JSON.stringify(B)}get type(){return I.Types.String}get effectiveType(){return I.Types.String}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:I.Types.SharedString,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.SharedString,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.SharedString}get effectiveType(){return I.Types.SharedString}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:I.Types.RichText,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.String,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}toString(){return this.model.value.richText.map(B=>B.text).join("")}get type(){return I.Types.RichText}get effectiveType(){return I.Types.RichText}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:I.Types.Boolean,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Boolean,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.Boolean}get effectiveType(){return I.Types.Boolean}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:I.Types.Error,f:class{constructor(B,C){this.model={address:B.address,type:I.Types.Error,value:C}}get value(){return this.model.value}set value(B){this.model.value=B}get type(){return I.Types.Error}get effectiveType(){return I.Types.Error}get address(){return this.model.address}set address(B){this.model.address=B}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((B,C)=>(B[C.t]=C.f,B),[]),create(B,C,s){const D=this.types[B];if(!D)throw new Error("Could not create Value of type "+B);return new D(C,s)}};n.exports=I},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(A,n,c){const e=A("../utils/under-dash"),E=A("./enums"),i=A("../utils/col-cache");class Q{constructor(I,t,B){this._worksheet=I,this._number=t,B!==!1&&(this.defn=B)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return i.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(I){I?(this.key=I.key,this.width=I.width!==void 0?I.width:9,this.outlineLevel=I.outlineLevel,I.style?this.style=I.style:this.style={},this.header=I.header,this._hidden=!!I.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(I){I!==void 0?(this._header=I,this.headers.forEach((t,B)=>{this._worksheet.getCell(B+1,this.number).value=t})):this._header=void 0}get key(){return this._key}set key(I){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=I,I&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(I){this._hidden=I}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(I){this._outlineLevel=I}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(I){return this.width===I.width&&this.hidden===I.hidden&&this.outlineLevel===I.outlineLevel&&e.isEqual(this.style,I.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const I=this.style;return!I||!(I.font||I.numFmt||I.alignment||I.border||I.fill||I.protection)}get headerCount(){return this.headers.length}eachCell(I,t){const B=this.number;t||(t=I,I=null),this._worksheet.eachRow(I,(C,s)=>{t(C.getCell(B),s)})}get values(){const I=[];return this.eachCell((t,B)=>{t&&t.type!==E.ValueType.Null&&(I[B]=t.value)}),I}set values(I){if(!I)return;const t=this.number;let B=0;I.hasOwnProperty("0")&&(B=1),I.forEach((C,s)=>{this._worksheet.getCell(s+B,t).value=C})}_applyStyle(I,t){return this.style[I]=t,this.eachCell(B=>{B[I]=t}),t}get numFmt(){return this.style.numFmt}set numFmt(I){this._applyStyle("numFmt",I)}get font(){return this.style.font}set font(I){this._applyStyle("font",I)}get alignment(){return this.style.alignment}set alignment(I){this._applyStyle("alignment",I)}get protection(){return this.style.protection}set protection(I){this._applyStyle("protection",I)}get border(){return this.style.border}set border(I){this._applyStyle("border",I)}get fill(){return this.style.fill}set fill(I){this._applyStyle("fill",I)}static toModel(I){const t=[];let B=null;return I&&I.forEach((C,s)=>{C.isDefault?B&&(B=null):B&&C.equivalentTo(B)?B.max=s+1:(B={min:s+1,max:s+1,width:C.width!==void 0?C.width:9,style:C.style,isCustomWidth:C.isCustomWidth,hidden:C.hidden,outlineLevel:C.outlineLevel,collapsed:C.collapsed},t.push(B))}),t.length?t:void 0}static fromModel(I,t){const B=[];let C=1,s=0;for(t=(t=t||[]).sort((function(D,o){return D.min-o.min}));s<t.length;){const D=t[s++];for(;C<D.min;)B.push(new Q(I,C++));for(;C<=D.max;)B.push(new Q(I,C++,D))}return B.length?B:null}}n.exports=Q},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(A,n,c){n.exports=class{constructor(e){this.model=e||{}}add(e,E){return this.model[e]=E}find(e){return this.model[e]}remove(e){this.model[e]=void 0}}},{}],6:[function(A,n,c){const e=A("../utils/under-dash"),E=A("../utils/col-cache"),i=A("../utils/cell-matrix"),Q=A("./range"),g=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;n.exports=class{constructor(){this.matrixMap={}}getMatrix(I){return this.matrixMap[I]||(this.matrixMap[I]=new i)}add(I,t){const B=E.decodeEx(I);this.addEx(B,t)}addEx(I,t){const B=this.getMatrix(t);if(I.top)for(let C=I.left;C<=I.right;C++)for(let s=I.top;s<=I.bottom;s++){const D={sheetName:I.sheetName,address:E.n2l(C)+s,row:s,col:C};B.addCellEx(D)}else B.addCellEx(I)}remove(I,t){const B=E.decodeEx(I);this.removeEx(B,t)}removeEx(I,t){this.getMatrix(t).removeCellEx(I)}removeAllNames(I){e.each(this.matrixMap,t=>{t.removeCellEx(I)})}forEach(I){e.each(this.matrixMap,(t,B)=>{t.forEach(C=>{I(B,C)})})}getNames(I){return this.getNamesEx(E.decodeEx(I))}getNamesEx(I){return e.map(this.matrixMap,(t,B)=>t.findCellEx(I)&&B).filter(Boolean)}_explore(I,t){t.mark=!1;const{sheetName:B}=t,C=new Q(t.row,t.col,t.row,t.col,B);let s,D;function o(r,l){const R=I.findCellAt(B,r,t.col);return!(!R||!R.mark)&&(C[l]=r,R.mark=!1,!0)}for(D=t.row-1;o(D,"top");D--);for(D=t.row+1;o(D,"bottom");D++);function a(r,l){const R=[];for(D=C.top;D<=C.bottom;D++){const Y=I.findCellAt(B,D,r);if(!Y||!Y.mark)return!1;R.push(Y)}C[l]=r;for(let Y=0;Y<R.length;Y++)R[Y].mark=!1;return!0}for(s=t.col-1;a(s,"left");s--);for(s=t.col+1;a(s,"right");s++);return C}getRanges(I,t){return(t=t||this.matrixMap[I])?(t.forEach(B=>{B.mark=!0}),{name:I,ranges:t.map(B=>B.mark&&this._explore(t,B)).filter(Boolean).map(B=>B.$shortRange)}):{name:I,ranges:[]}}normaliseMatrix(I,t){I.forEachInSheet(t,(B,C,s)=>{B&&(B.row===C&&B.col===s||(B.row=C,B.col=s,B.address=E.n2l(s)+C))})}spliceRows(I,t,B,C){e.each(this.matrixMap,s=>{s.spliceRows(I,t,B,C),this.normaliseMatrix(s,I)})}spliceColumns(I,t,B,C){e.each(this.matrixMap,s=>{s.spliceColumns(I,t,B,C),this.normaliseMatrix(s,I)})}get model(){return e.map(this.matrixMap,(I,t)=>this.getRanges(t,I)).filter(I=>I.ranges.length)}set model(I){const t=this.matrixMap={};I.forEach(B=>{const C=t[B.name]=new i;B.ranges.forEach(s=>{g.test(s.split("!").pop()||"")&&C.addCell(s)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(A,n,c){n.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(A,n,c){const e=A("../utils/col-cache"),E=A("./anchor");n.exports=class{constructor(i,Q){this.worksheet=i,this.model=Q}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(i){let{type:Q,imageId:g,range:I,hyperlinks:t}=i;if(this.type=Q,this.imageId=g,Q==="image")if(typeof I=="string"){const B=e.decode(I);this.range={tl:new E(this.worksheet,{col:B.left,row:B.top},-1),br:new E(this.worksheet,{col:B.right,row:B.bottom},0),editAs:"oneCell"}}else this.range={tl:new E(this.worksheet,I.tl,0),br:I.br&&new E(this.worksheet,I.br,0),ext:I.ext,editAs:I.editAs,hyperlinks:t||I.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(A,n,c){const e=A("../utils/under-dash");class E{constructor(Q){this.note=Q}get model(){let Q=null;switch(typeof this.note){case"string":Q={type:"note",note:{texts:[{text:this.note}]}};break;default:Q={type:"note",note:this.note}}return e.deepMerge({},E.DEFAULT_CONFIGS,Q)}set model(Q){const{note:g}=Q,{texts:I}=g;I.length===1&&Object.keys(I[0]).length===1?this.note=I[0].text:this.note=g}static fromModel(Q){const g=new E;return g.model=Q,g}}E.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},n.exports=E},{"../utils/under-dash":26}],10:[function(A,n,c){const e=A("../utils/col-cache");class E{constructor(){this.decode(arguments)}setTLBR(Q,g,I,t,B){if(arguments.length<4){const C=e.decodeAddress(Q),s=e.decodeAddress(g);this.model={top:Math.min(C.row,s.row),left:Math.min(C.col,s.col),bottom:Math.max(C.row,s.row),right:Math.max(C.col,s.col),sheetName:I},this.setTLBR(C.row,C.col,s.row,s.col,B)}else this.model={top:Math.min(Q,I),left:Math.min(g,t),bottom:Math.max(Q,I),right:Math.max(g,t),sheetName:B}}decode(Q){switch(Q.length){case 5:this.setTLBR(Q[0],Q[1],Q[2],Q[3],Q[4]);break;case 4:this.setTLBR(Q[0],Q[1],Q[2],Q[3]);break;case 3:this.setTLBR(Q[0],Q[1],Q[2]);break;case 2:this.setTLBR(Q[0],Q[1]);break;case 1:{const g=Q[0];if(g instanceof E)this.model={top:g.model.top,left:g.model.left,bottom:g.model.bottom,right:g.model.right,sheetName:g.sheetName};else if(g instanceof Array)this.decode(g);else if(g.top&&g.left&&g.bottom&&g.right)this.model={top:g.top,left:g.left,bottom:g.bottom,right:g.right,sheetName:g.sheetName};else{const I=e.decodeEx(g);I.top?this.model={top:I.top,left:I.left,bottom:I.bottom,right:I.right,sheetName:I.sheetName}:this.model={top:I.row,left:I.col,bottom:I.row,right:I.col,sheetName:I.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+Q.length)}}get top(){return this.model.top||1}set top(Q){this.model.top=Q}get left(){return this.model.left||1}set left(Q){this.model.left=Q}get bottom(){return this.model.bottom||1}set bottom(Q){this.model.bottom=Q}get right(){return this.model.right||1}set right(Q){this.model.right=Q}get sheetName(){return this.model.sheetName}set sheetName(Q){this.model.sheetName=Q}get _serialisedSheetName(){const{sheetName:Q}=this.model;return Q?/^[a-zA-Z0-9]*$/.test(Q)?Q+"!":`'${Q}'!`:""}expand(Q,g,I,t){(!this.model.top||Q<this.top)&&(this.top=Q),(!this.model.left||g<this.left)&&(this.left=g),(!this.model.bottom||I>this.bottom)&&(this.bottom=I),(!this.model.right||t>this.right)&&(this.right=t)}expandRow(Q){if(Q){const{dimensions:g,number:I}=Q;g&&this.expand(I,g.min,I,g.max)}}expandToAddress(Q){const g=e.decodeEx(Q);this.expand(g.row,g.col,g.row,g.col)}get tl(){return e.n2l(this.left)+this.top}get $t$l(){return`$${e.n2l(this.left)}$${this.top}`}get br(){return e.n2l(this.right)+this.bottom}get $b$r(){return`$${e.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(Q){return(!Q.sheetName||!this.sheetName||Q.sheetName===this.sheetName)&&!(Q.bottom<this.top)&&!(Q.top>this.bottom)&&!(Q.right<this.left)&&!(Q.left>this.right)}contains(Q){const g=e.decodeEx(Q);return this.containsEx(g)}containsEx(Q){return(!Q.sheetName||!this.sheetName||Q.sheetName===this.sheetName)&&Q.row>=this.top&&Q.row<=this.bottom&&Q.col>=this.left&&Q.col<=this.right}forEachAddress(Q){for(let g=this.left;g<=this.right;g++)for(let I=this.top;I<=this.bottom;I++)Q(e.encodeAddress(I,g),I,g)}}n.exports=E},{"../utils/col-cache":19}],11:[function(A,n,c){const e=A("../utils/under-dash"),E=A("./enums"),i=A("../utils/col-cache"),Q=A("./cell");n.exports=class{constructor(g,I){this._worksheet=g,this._number=I,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(g){return this._cells[g-1]}getCellEx(g){let I=this._cells[g.col-1];if(!I){const t=this._worksheet.getColumn(g.col);I=new Q(this,t,g.address),this._cells[g.col-1]=I}return I}getCell(g){if(typeof g=="string"){const I=this._worksheet.getColumnKey(g);g=I?I.number:i.l2n(g)}return this._cells[g-1]||this.getCellEx({address:i.encodeAddress(this._number,g),row:this._number,col:g})}splice(g,I){const t=g+I;for(var B=arguments.length,C=new Array(B>2?B-2:0),s=2;s<B;s++)C[s-2]=arguments[s];const D=C.length-I,o=this._cells.length;let a,r,l;if(D<0)for(a=g+C.length;a<=o;a++)l=this._cells[a-1],r=this._cells[a-D-1],r?(l=this.getCell(a),l.value=r.value,l.style=r.style,l._comment=r._comment):l&&(l.value=null,l.style={},l._comment=void 0);else if(D>0)for(a=o;a>=t;a--)r=this._cells[a-1],r?(l=this.getCell(a+D),l.value=r.value,l.style=r.style,l._comment=r._comment):this._cells[a+D-1]=void 0;for(a=0;a<C.length;a++)l=this.getCell(g+a),l.value=C[a],l.style={},l._comment=void 0}eachCell(g,I){if(I||(I=g,g=null),g&&g.includeEmpty){const t=this._cells.length;for(let B=1;B<=t;B++)I(this.getCell(B),B)}else this._cells.forEach((t,B)=>{t&&t.type!==E.ValueType.Null&&I(t,B+1)})}addPageBreak(g,I){const t=this._worksheet,B=Math.max(0,g-1)||0,C=Math.max(0,I-1)||16838,s={id:this._number,max:C,man:1};B&&(s.min=B),t.rowBreaks.push(s)}get values(){const g=[];return this._cells.forEach(I=>{I&&I.type!==E.ValueType.Null&&(g[I.col]=I.value)}),g}set values(g){if(this._cells=[],g)if(g instanceof Array){let I=0;g.hasOwnProperty("0")&&(I=1),g.forEach((t,B)=>{t!==void 0&&(this.getCellEx({address:i.encodeAddress(this._number,B+I),row:this._number,col:B+I}).value=t)})}else this._worksheet.eachColumnKey((I,t)=>{g[t]!==void 0&&(this.getCellEx({address:i.encodeAddress(this._number,I.number),row:this._number,col:I.number}).value=g[t])})}get hasValues(){return e.some(this._cells,g=>g&&g.type!==E.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let g=0;return this.eachCell(()=>{g++}),g}get dimensions(){let g=0,I=0;return this._cells.forEach(t=>{t&&t.type!==E.ValueType.Null&&((!g||g>t.col)&&(g=t.col),I<t.col&&(I=t.col))}),g>0?{min:g,max:I}:null}_applyStyle(g,I){return this.style[g]=I,this._cells.forEach(t=>{t&&(t[g]=I)}),I}get numFmt(){return this.style.numFmt}set numFmt(g){this._applyStyle("numFmt",g)}get font(){return this.style.font}set font(g){this._applyStyle("font",g)}get alignment(){return this.style.alignment}set alignment(g){this._applyStyle("alignment",g)}get protection(){return this.style.protection}set protection(g){this._applyStyle("protection",g)}get border(){return this.style.border}set border(g){this._applyStyle("border",g)}get fill(){return this.style.fill}set fill(g){this._applyStyle("fill",g)}get hidden(){return!!this._hidden}set hidden(g){this._hidden=g}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(g){this._outlineLevel=g}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const g=[];let I=0,t=0;return this._cells.forEach(B=>{if(B){const C=B.model;C&&((!I||I>B.col)&&(I=B.col),t<B.col&&(t=B.col),g.push(C))}}),this.height||g.length?{cells:g,number:this.number,min:I,max:t,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(g){if(g.number!==this._number)throw new Error("Invalid row number in model");let I;this._cells=[],g.cells.forEach(t=>{switch(t.type){case Q.Types.Merge:break;default:{let B;if(t.address)B=i.decodeAddress(t.address);else if(I){const{row:C}=I,s=I.col+1;B={row:C,col:s,address:i.encodeAddress(C,s),$col$row:`$${i.n2l(s)}$${C}`}}I=B,this.getCellEx(B).model=t;break}}}),g.height?this.height=g.height:delete this.height,this.hidden=g.hidden,this.outlineLevel=g.outlineLevel||0,this.style=g.style&&JSON.parse(JSON.stringify(g.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(A,n,c){const e=A("../utils/col-cache");class E{constructor(Q,g,I){this.table=Q,this.column=g,this.index=I}_set(Q,g){this.table.cacheState(),this.column[Q]=g}get name(){return this.column.name}set name(Q){this._set("name",Q)}get filterButton(){return this.column.filterButton}set filterButton(Q){this.column.filterButton=Q}get style(){return this.column.style}set style(Q){this.column.style=Q}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(Q){this._set("totalsRowLabel",Q)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(Q){this._set("totalsRowFunction",Q)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(Q){this._set("totalsRowResult",Q)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(Q){this._set("totalsRowFormula",Q)}}n.exports=class{constructor(i,Q){this.worksheet=i,Q&&(this.table=Q,this.validate(),this.store())}getFormula(i){switch(i.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${i.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${i.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${i.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${i.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${i.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${i.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${i.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${i.name}])`;case"custom":return i.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+i.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:i}=this,Q=(D,o,a)=>{D[o]===void 0&&(D[o]=a)};Q(i,"headerRow",!0),Q(i,"totalsRow",!1),Q(i,"style",{}),Q(i.style,"theme","TableStyleMedium2"),Q(i.style,"showFirstColumn",!1),Q(i.style,"showLastColumn",!1),Q(i.style,"showRowStripes",!1),Q(i.style,"showColumnStripes",!1);const g=(D,o)=>{if(!D)throw new Error(o)};g(i.ref,"Table must have ref"),g(i.columns,"Table must have column definitions"),g(i.rows,"Table must have row definitions"),i.tl=e.decodeAddress(i.ref);const{row:I,col:t}=i.tl;g(I>0,"Table must be on valid row"),g(t>0,"Table must be on valid col");const{width:B,filterHeight:C,tableHeight:s}=this;i.autoFilterRef=e.encode(I,t,I+C-1,t+B-1),i.tableRef=e.encode(I,t,I+s-1,t+B-1),i.columns.forEach((D,o)=>{g(D.name,`Column ${o} must have a name`),o===0?Q(D,"totalsRowLabel","Total"):(Q(D,"totalsRowFunction","none"),D.totalsRowFormula=this.getFormula(D))})}store(){const i=(C,s)=>{s&&Object.keys(s).forEach(D=>{C[D]=s[D]})},{worksheet:Q,table:g}=this,{row:I,col:t}=g.tl;let B=0;if(g.headerRow){const C=Q.getRow(I+B++);g.columns.forEach((s,D)=>{const{style:o,name:a}=s,r=C.getCell(t+D);r.value=a,i(r,o)})}if(g.rows.forEach(C=>{const s=Q.getRow(I+B++);C.forEach((D,o)=>{const a=s.getCell(t+o);a.value=D,i(a,g.columns[o].style)})}),g.totalsRow){const C=Q.getRow(I+B++);g.columns.forEach((s,D)=>{const o=C.getCell(t+D);if(D===0)o.value=s.totalsRowLabel;else{const a=this.getFormula(s);o.value=a?{formula:s.totalsRowFormula,result:s.totalsRowResult}:null}i(o,s.style)})}}load(i){const{table:Q}=this,{row:g,col:I}=Q.tl;let t=0;if(Q.headerRow){const B=i.getRow(g+t++);Q.columns.forEach((C,s)=>{B.getCell(I+s).value=C.name})}if(Q.rows.forEach(B=>{const C=i.getRow(g+t++);B.forEach((s,D)=>{C.getCell(I+D).value=s})}),Q.totalsRow){const B=i.getRow(g+t++);Q.columns.forEach((C,s)=>{const D=B.getCell(I+s);s===0?D.value=C.totalsRowLabel:this.getFormula(C)&&(D.value={formula:C.totalsRowFormula,result:C.totalsRowResult})})}}get model(){return this.table}set model(i){this.table=i}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const i=e.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Q=0;Q<this._cache.tableHeight;Q++){const g=this.worksheet.getRow(i.row+Q);for(let I=0;I<this._cache.width;I++)g.getCell(i.col+I).value=null}else{for(let Q=this.tableHeight;Q<this._cache.tableHeight;Q++){const g=this.worksheet.getRow(i.row+Q);for(let I=0;I<this._cache.width;I++)g.getCell(i.col+I).value=null}for(let Q=0;Q<this.tableHeight;Q++){const g=this.worksheet.getRow(i.row+Q);for(let I=this.width;I<this._cache.width;I++)g.getCell(i.col+I).value=null}}this.store()}addRow(i,Q){this.cacheState(),Q===void 0?this.table.rows.push(i):this.table.rows.splice(Q,0,i)}removeRows(i){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(i,Q)}getColumn(i){const Q=this.table.columns[i];return new E(this,Q,i)}addColumn(i,Q,g){this.cacheState(),g===void 0?(this.table.columns.push(i),this.table.rows.forEach((I,t)=>{I.push(Q[t])})):(this.table.columns.splice(g,0,i),this.table.rows.forEach((I,t)=>{I.splice(g,0,Q[t])}))}removeColumns(i){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(i,Q),this.table.rows.forEach(g=>{g.splice(i,Q)})}_assign(i,Q,g){this.cacheState(),i[Q]=g}get ref(){return this.table.ref}set ref(i){this._assign(this.table,"ref",i)}get name(){return this.table.name}set name(i){this.table.name=i}get displayName(){return this.table.displyName||this.table.name}set displayNamename(i){this.table.displayName=i}get headerRow(){return this.table.headerRow}set headerRow(i){this._assign(this.table,"headerRow",i)}get totalsRow(){return this.table.totalsRow}set totalsRow(i){this._assign(this.table,"totalsRow",i)}get theme(){return this.table.style.name}set theme(i){this.table.style.name=i}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(i){this.table.style.showFirstColumn=i}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(i){this.table.style.showLastColumn=i}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(i){this.table.style.showRowStripes=i}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(i){this.table.style.showColumnStripes=i}}},{"../utils/col-cache":19}],13:[function(A,n,c){const e=A("./worksheet"),E=A("./defined-names"),i=A("../xlsx/xlsx"),Q=A("../csv/csv");n.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new E}get xlsx(){return this._xlsx||(this._xlsx=new i(this)),this._xlsx}get csv(){return this._csv||(this._csv=new Q(this)),this._csv}get nextId(){for(let g=1;g<this._worksheets.length;g++)if(!this._worksheets[g])return g;return this._worksheets.length||1}addWorksheet(g,I){const t=this.nextId;I&&(typeof I=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),I={properties:{tabColor:{argb:I}}}):(I.argb||I.theme||I.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),I={properties:{tabColor:I}}));const B=this._worksheets.reduce((D,o)=>(o&&o.orderNo)>D?o.orderNo:D,0),C=Object.assign({},I,{id:t,name:g,orderNo:B+1,workbook:this}),s=new e(C);return this._worksheets[t]=s,s}removeWorksheetEx(g){delete this._worksheets[g.id]}removeWorksheet(g){const I=this.getWorksheet(g);I&&I.destroy()}getWorksheet(g){return g===void 0?this._worksheets.find(Boolean):typeof g=="number"?this._worksheets[g]:typeof g=="string"?this._worksheets.find(I=>I&&I.name===g):void 0}get worksheets(){return this._worksheets.slice(1).sort((g,I)=>g.orderNo-I.orderNo).filter(Boolean)}eachSheet(g){this.worksheets.forEach(I=>{g(I,I.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(g){const I=this.media.length;return this.media.push(Object.assign({},g,{type:"image"})),I}getImage(g){return this.media[g]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(g=>g.model),sheets:this.worksheets.map(g=>g.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(g){this.creator=g.creator,this.lastModifiedBy=g.lastModifiedBy,this.lastPrinted=g.lastPrinted,this.created=g.created,this.modified=g.modified,this.company=g.company,this.manager=g.manager,this.title=g.title,this.subject=g.subject,this.keywords=g.keywords,this.category=g.category,this.description=g.description,this.language=g.language,this.revision=g.revision,this.contentStatus=g.contentStatus,this.properties=g.properties,this.calcProperties=g.calcProperties,this._worksheets=[],g.worksheets.forEach(I=>{const{id:t,name:B,state:C}=I,s=g.sheets&&g.sheets.findIndex(D=>D.id===t);(this._worksheets[t]=new e({id:t,name:B,orderNo:s,state:C,workbook:this})).model=I}),this._definedNames.model=g.definedNames,this.views=g.views,this._themes=g.themes,this.media=g.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(A,n,c){const e=A("../utils/under-dash"),E=A("../utils/col-cache"),i=A("./range"),Q=A("./row"),g=A("./column"),I=A("./enums"),t=A("./image"),B=A("./table"),C=A("./data-validations"),s=A("../utils/encryptor"),{copyStyle:D}=A("../utils/copy-style");n.exports=class{constructor(o){o=o||{},this._workbook=o.workbook,this.id=o.id,this.orderNo=o.orderNo,this.name=o.name,this.state=o.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},o.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!o.pageSetup||!o.pageSetup.fitToWidth&&!o.pageSetup.fitToHeight||o.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},o.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},o.headerFooter),this.dataValidations=new C,this.views=o.views||[],this.autoFilter=o.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(o){if(o===void 0&&(o="sheet"+this.id),this._name!==o){if(typeof o!="string")throw new Error("The name has to be a string.");if(o==="")throw new Error("The name can't be empty.");if(o==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(o))throw new Error(`Worksheet name ${o} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(o))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+o);if(o&&o.length>31&&(console.warn(`Worksheet name ${o} exceeds 31 chars. This will be truncated`),o=o.substring(0,31)),this._workbook._worksheets.find(a=>a&&a.name.toLowerCase()===o.toLowerCase()))throw new Error("Worksheet name already exists: "+o);this._name=o}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const o=new i;return this._rows.forEach(a=>{if(a){const r=a.dimensions;r&&o.expand(a.number,r.min,a.number,r.max)}}),o}get columns(){return this._columns}set columns(o){this._headerRowCount=o.reduce((l,R)=>{const Y=(R.header?1:R.headers&&R.headers.length)||0;return Math.max(l,Y)},0);let a=1;const r=this._columns=[];o.forEach(l=>{const R=new g(this,a++,!1);r.push(R),R.defn=l})}getColumnKey(o){return this._keys[o]}setColumnKey(o,a){this._keys[o]=a}deleteColumnKey(o){delete this._keys[o]}eachColumnKey(o){e.each(this._keys,o)}getColumn(o){if(typeof o=="string"){const a=this._keys[o];if(a)return a;o=E.l2n(o)}if(this._columns||(this._columns=[]),o>this._columns.length){let a=this._columns.length+1;for(;a<=o;)this._columns.push(new g(this,a++))}return this._columns[o-1]}spliceColumns(o,a){const r=this._rows.length;for(var l=arguments.length,R=new Array(l>2?l-2:0),Y=2;Y<l;Y++)R[Y-2]=arguments[Y];if(R.length>0)for(let H=0;H<r;H++){const b=[o,a];R.forEach(m=>{b.push(m[H]||null)});const O=this.getRow(H+1);O.splice.apply(O,b)}else this._rows.forEach(H=>{H&&H.splice(o,a)});const p=R.length-a,x=o+a,J=this._columns.length;if(p<0)for(let H=o+R.length;H<=J;H++)this.getColumn(H).defn=this.getColumn(H-p).defn;else if(p>0)for(let H=J;H>=x;H--)this.getColumn(H+p).defn=this.getColumn(H).defn;for(let H=o;H<o+R.length;H++)this.getColumn(H).defn=null;this.workbook.definedNames.spliceColumns(this.name,o,a,R.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let o=0;return this.eachRow(a=>{o=Math.max(o,a.cellCount)}),o}get actualColumnCount(){const o=[];let a=0;return this.eachRow(r=>{r.eachCell(l=>{let{col:R}=l;o[R]||(o[R]=!0,a++)})}),a}_commitRow(){}get _lastRowNumber(){const o=this._rows;let a=o.length;for(;a>0&&o[a-1]===void 0;)a--;return a}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(o){return this._rows[o-1]}findRows(o,a){return this._rows.slice(o-1,o-1+a)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let o=0;return this.eachRow(()=>{o++}),o}getRow(o){let a=this._rows[o-1];return a||(a=this._rows[o-1]=new Q(this,o)),a}getRows(o,a){if(a<1)return;const r=[];for(let l=o;l<o+a;l++)r.push(this.getRow(l));return r}addRow(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const r=this._nextRow,l=this.getRow(r);return l.values=o,this._setStyleOption(r,a[0]==="i"?a:"n"),l}addRows(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const r=[];return o.forEach(l=>{r.push(this.addRow(l,a))}),r}insertRow(o,a){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(o,0,a),this._setStyleOption(o,r),this.getRow(o)}insertRows(o,a){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(o,0,...a),r!=="n")for(let l=0;l<a.length;l++)r[0]==="o"&&this.findRow(a.length+o+l)!==void 0?this._copyStyle(a.length+o+l,o+l,r[1]==="+"):r[0]==="i"&&this.findRow(o-1)!==void 0&&this._copyStyle(o-1,o+l,r[1]==="+");return this.getRows(o,a.length)}_setStyleOption(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";a[0]==="o"&&this.findRow(o+1)!==void 0?this._copyStyle(o+1,o,a[1]==="+"):a[0]==="i"&&this.findRow(o-1)!==void 0&&this._copyStyle(o-1,o,a[1]==="+")}_copyStyle(o,a){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const l=this.getRow(o),R=this.getRow(a);R.style=D(l.style),l.eachCell({includeEmpty:r},(Y,p)=>{R.getCell(p).style=D(Y.style)}),R.height=l.height}duplicateRow(o,a){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const l=this._rows[o-1],R=new Array(a).fill(l.values);this.spliceRows(o+1,r?0:a,...R);for(let Y=0;Y<a;Y++){const p=this._rows[o+Y];p.style=l.style,p.height=l.height,l.eachCell({includeEmpty:!0},(x,J)=>{p.getCell(J).style=x.style})}}spliceRows(o,a){const r=o+a;for(var l=arguments.length,R=new Array(l>2?l-2:0),Y=2;Y<l;Y++)R[Y-2]=arguments[Y];const p=R.length,x=p-a,J=this._rows.length;let H,b;if(x<0)for(o===J&&(this._rows[J-1]=void 0),H=r;H<=J;H++)if(b=this._rows[H-1],b){const O=this.getRow(H+x);O.values=b.values,O.style=b.style,O.height=b.height,b.eachCell({includeEmpty:!0},(m,F)=>{O.getCell(F).style=m.style}),this._rows[H-1]=void 0}else this._rows[H+x-1]=void 0;else if(x>0)for(H=J;H>=r;H--)if(b=this._rows[H-1],b){const O=this.getRow(H+x);O.values=b.values,O.style=b.style,O.height=b.height,b.eachCell({includeEmpty:!0},(m,F)=>{if(O.getCell(F).style=m.style,m._value.constructor.name==="MergeValue"){const u=this.getRow(m._row._number+p).getCell(F),G=m._value._master,w=this.getRow(G._row._number+p).getCell(G._column._number);u.merge(w)}})}else this._rows[H+x-1]=void 0;for(H=0;H<p;H++){const O=this.getRow(o+H);O.style={},O.values=R[H]}this.workbook.definedNames.spliceRows(this.name,o,a,p)}eachRow(o,a){if(a||(a=o,o=void 0),o&&o.includeEmpty){const r=this._rows.length;for(let l=1;l<=r;l++)a(this.getRow(l),l)}else this._rows.forEach(r=>{r&&r.hasValues&&a(r,r.number)})}getSheetValues(){const o=[];return this._rows.forEach(a=>{a&&(o[a.number]=a.values)}),o}findCell(o,a){const r=E.getAddress(o,a),l=this._rows[r.row-1];return l?l.findCell(r.col):void 0}getCell(o,a){const r=E.getAddress(o,a);return this.getRow(r.row).getCellEx(r)}mergeCells(){for(var o=arguments.length,a=new Array(o),r=0;r<o;r++)a[r]=arguments[r];const l=new i(a);this._mergeCellsInternal(l)}mergeCellsWithoutStyle(){for(var o=arguments.length,a=new Array(o),r=0;r<o;r++)a[r]=arguments[r];const l=new i(a);this._mergeCellsInternal(l,!0)}_mergeCellsInternal(o,a){e.each(this._merges,l=>{if(l.intersects(o))throw new Error("Cannot merge already merged cells")});const r=this.getCell(o.top,o.left);for(let l=o.top;l<=o.bottom;l++)for(let R=o.left;R<=o.right;R++)(l>o.top||R>o.left)&&this.getCell(l,R).merge(r,a);this._merges[r.address]=o}_unMergeMaster(o){const a=this._merges[o.address];if(a){for(let r=a.top;r<=a.bottom;r++)for(let l=a.left;l<=a.right;l++)this.getCell(r,l).unmerge();delete this._merges[o.address]}}get hasMerges(){return e.some(this._merges,Boolean)}unMergeCells(){for(var o=arguments.length,a=new Array(o),r=0;r<o;r++)a[r]=arguments[r];const l=new i(a);for(let R=l.top;R<=l.bottom;R++)for(let Y=l.left;Y<=l.right;Y++){const p=this.findCell(R,Y);p&&(p.type===I.ValueType.Merge?this._unMergeMaster(p.master):this._merges[p.address]&&this._unMergeMaster(p))}}fillFormula(o,a,r){let l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared";const R=E.decode(o),{top:Y,left:p,bottom:x,right:J}=R,H=J-p+1,b=E.encodeAddress(Y,p),O=l==="shared";let m;m=typeof r=="function"?r:Array.isArray(r)?Array.isArray(r[0])?(u,G)=>r[u-Y][G-p]:(u,G)=>r[(u-Y)*H+(G-p)]:()=>{};let F=!0;for(let u=Y;u<=x;u++)for(let G=p;G<=J;G++)F?(this.getCell(u,G).value={shareType:l,formula:a,ref:o,result:m(u,G)},F=!1):this.getCell(u,G).value=O?{sharedFormula:b,result:m(u,G)}:m(u,G)}addImage(o,a){const r={type:"image",imageId:o,range:a};this._media.push(new t(this,r))}getImages(){return this._media.filter(o=>o.type==="image")}addBackgroundImage(o){const a={type:"background",imageId:o};this._media.push(new t(this,a))}getBackgroundImageId(){const o=this._media.find(a=>a.type==="background");return o&&o.imageId}protect(o,a){return new Promise(r=>{this.sheetProtection={sheet:!0},a&&"spinCount"in a&&(a.spinCount=Number.isFinite(a.spinCount)?Math.round(Math.max(0,a.spinCount)):1e5),o&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=s.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=a&&"spinCount"in a?a.spinCount:1e5,this.sheetProtection.hashValue=s.convertPasswordToHash(o,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),a&&(this.sheetProtection=Object.assign(this.sheetProtection,a),!o&&"spinCount"in a&&delete this.sheetProtection.spinCount),r()})}unprotect(){this.sheetProtection=null}addTable(o){const a=new B(this,o);return this.tables[o.name]=a,a}getTable(o){return this.tables[o]}removeTable(o){delete this.tables[o]}getTables(){return Object.values(this.tables)}addConditionalFormatting(o){this.conditionalFormattings.push(o)}removeConditionalFormatting(o){typeof o=="number"?this.conditionalFormattings.splice(o,1):this.conditionalFormattings=o instanceof Function?this.conditionalFormattings.filter(o):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(o){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=o}get model(){const o={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(l=>l.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(l=>l.model),conditionalFormattings:this.conditionalFormattings};o.cols=g.toModel(this.columns);const a=o.rows=[],r=o.dimensions=new i;return this._rows.forEach(l=>{const R=l&&l.model;R&&(r.expand(R.number,R.min,R.number,R.max),a.push(R))}),o.merges=[],e.each(this._merges,l=>{o.merges.push(l.range)}),o}_parseRows(o){this._rows=[],o.rows.forEach(a=>{const r=new Q(this,a.number);this._rows[r.number-1]=r,r.model=a})}_parseMergeCells(o){e.each(o.mergeCells,a=>{this.mergeCellsWithoutStyle(a)})}set model(o){this.name=o.name,this._columns=g.fromModel(this,o.cols),this._parseRows(o),this._parseMergeCells(o),this.dataValidations=new C(o.dataValidations),this.properties=o.properties,this.pageSetup=o.pageSetup,this.headerFooter=o.headerFooter,this.views=o.views,this.autoFilter=o.autoFilter,this._media=o.media.map(a=>new t(this,a)),this.sheetProtection=o.sheetProtection,this.tables=o.tables.reduce((a,r)=>{const l=new B;return l.model=r,a[r.name]=l,a},{}),this.conditionalFormattings=o.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(A,n,c){A("core-js/modules/es.promise"),A("core-js/modules/es.promise.finally"),A("core-js/modules/es.object.assign"),A("core-js/modules/es.object.keys"),A("core-js/modules/es.object.values"),A("core-js/modules/es.symbol"),A("core-js/modules/es.symbol.async-iterator"),A("core-js/modules/es.array.iterator"),A("core-js/modules/es.array.includes"),A("core-js/modules/es.array.find-index"),A("core-js/modules/es.array.find"),A("core-js/modules/es.string.from-code-point"),A("core-js/modules/es.string.includes"),A("core-js/modules/es.number.is-nan"),A("regenerator-runtime/runtime");const e={Workbook:A("./doc/workbook")},E=A("./doc/enums");Object.keys(E).forEach(i=>{e[i]=E[i]}),n.exports=e},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(A,n,c){const e=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");c.bufferToString=function(E){return typeof E=="string"?E:e?e.decode(E):E.toString()}},{}],17:[function(A,n,c){const e=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:E}=A("buffer");c.stringToBuffer=function(i){return typeof i!="string"?i:e?E.from(e.encode(i).buffer):E.from(i)}},{buffer:220}],18:[function(A,n,c){const e=A("./under-dash"),E=A("./col-cache");n.exports=class{constructor(i){this.template=i,this.sheets={}}addCell(i){this.addCellEx(E.decodeEx(i))}getCell(i){return this.findCellEx(E.decodeEx(i),!0)}findCell(i){return this.findCellEx(E.decodeEx(i),!1)}findCellAt(i,Q,g){const I=this.sheets[i],t=I&&I[Q];return t&&t[g]}addCellEx(i){if(i.top)for(let Q=i.top;Q<=i.bottom;Q++)for(let g=i.left;g<=i.right;g++)this.getCellAt(i.sheetName,Q,g);else this.findCellEx(i,!0)}getCellEx(i){return this.findCellEx(i,!0)}findCellEx(i,Q){const g=this.findSheet(i,Q),I=this.findSheetRow(g,i,Q);return this.findRowCell(I,i,Q)}getCellAt(i,Q,g){const I=this.sheets[i]||(this.sheets[i]=[]),t=I[Q]||(I[Q]=[]);return t[g]||(t[g]={sheetName:i,address:E.n2l(g)+Q,row:Q,col:g})}removeCellEx(i){const Q=this.findSheet(i);if(!Q)return;const g=this.findSheetRow(Q,i);g&&delete g[i.col]}forEachInSheet(i,Q){const g=this.sheets[i];g&&g.forEach((I,t)=>{I&&I.forEach((B,C)=>{B&&Q(B,t,C)})})}forEach(i){e.each(this.sheets,(Q,g)=>{this.forEachInSheet(g,i)})}map(i){const Q=[];return this.forEach(g=>{Q.push(i(g))}),Q}findSheet(i,Q){const g=i.sheetName;return this.sheets[g]?this.sheets[g]:Q?this.sheets[g]=[]:void 0}findSheetRow(i,Q,g){const{row:I}=Q;return i&&i[I]?i[I]:g?i[I]=[]:void 0}findRowCell(i,Q,g){const{col:I}=Q;return i&&i[I]?i[I]:g?i[I]=this.template?Object.assign(Q,JSON.parse(JSON.stringify(this.template))):Q:void 0}spliceRows(i,Q,g,I){const t=this.sheets[i];if(t){const B=[];for(let C=0;C<I;C++)B.push([]);t.splice(Q,g,...B)}}spliceColumns(i,Q,g,I){const t=this.sheets[i];if(t){const B=[];for(let C=0;C<I;C++)B.push(null);e.each(t,C=>{C.splice(Q,g,...B)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(A,n,c){const e=/^[A-Z]+\d+$/,E={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:i=>i<=26?1:i<=676?2:3,_fill(i){let Q,g,I,t,B,C=1;if(i>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&i>=1){for(;C<=26;)Q=this._dictionary[C-1],this._n2l[C]=Q,this._l2n[Q]=C,C++;this._l2nFill=1}if(this._l2nFill<2&&i>=2){for(C=27;C<=702;)g=C-27,I=g%26,t=Math.floor(g/26),Q=this._dictionary[t]+this._dictionary[I],this._n2l[C]=Q,this._l2n[Q]=C,C++;this._l2nFill=2}if(this._l2nFill<3&&i>=3){for(C=703;C<=16384;)g=C-703,I=g%26,t=Math.floor(g/26)%26,B=Math.floor(g/676),Q=this._dictionary[B]+this._dictionary[t]+this._dictionary[I],this._n2l[C]=Q,this._l2n[Q]=C,C++;this._l2nFill=3}},l2n(i){if(this._l2n[i]||this._fill(i.length),!this._l2n[i])throw new Error("Out of bounds. Invalid column letter: "+i);return this._l2n[i]},n2l(i){if(i<1||i>16384)throw new Error(i+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[i]||this._fill(this._level(i)),this._n2l[i]},_hash:{},validateAddress(i){if(!e.test(i))throw new Error("Invalid Address: "+i);return!0},decodeAddress(i){const Q=i.length<5&&this._hash[i];if(Q)return Q;let g=!1,I="",t=0,B=!1,C="",s=0;for(let o,a=0;a<i.length;a++)if(o=i.charCodeAt(a),!B&&o>=65&&o<=90)g=!0,I+=i[a],t=26*t+o-64;else if(o>=48&&o<=57)B=!0,C+=i[a],s=10*s+o-48;else if(B&&g&&o!==36)break;if(g){if(t>16384)throw new Error("Out of bounds. Invalid column letter: "+I)}else t=void 0;B||(s=void 0);const D={address:i=I+C,col:t,row:s,$col$row:`$${I}$${C}`};return t<=100&&s<=100&&(this._hash[i]=D,this._hash[D.$col$row]=D),D},getAddress(i,Q){if(Q){const g=this.n2l(Q)+i;return this.decodeAddress(g)}return this.decodeAddress(i)},decode(i){const Q=i.split(":");if(Q.length===2){const g=this.decodeAddress(Q[0]),I=this.decodeAddress(Q[1]),t={top:Math.min(g.row,I.row),left:Math.min(g.col,I.col),bottom:Math.max(g.row,I.row),right:Math.max(g.col,I.col)};return t.tl=this.n2l(t.left)+t.top,t.br=this.n2l(t.right)+t.bottom,t.dimensions=`${t.tl}:${t.br}`,t}return this.decodeAddress(i)},decodeEx(i){const Q=i.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),g=Q[1]||Q[2],I=Q[3],t=I.split(":");if(t.length>1){let C=this.decodeAddress(t[0]),s=this.decodeAddress(t[1]);const D=Math.min(C.row,s.row),o=Math.min(C.col,s.col),a=Math.max(C.row,s.row),r=Math.max(C.col,s.col);return C=this.n2l(o)+D,s=this.n2l(r)+a,{top:D,left:o,bottom:a,right:r,sheetName:g,tl:{address:C,col:o,row:D,$col$row:`$${this.n2l(o)}$${D}`,sheetName:g},br:{address:s,col:r,row:a,$col$row:`$${this.n2l(r)}$${a}`,sheetName:g},dimensions:`${C}:${s}`}}if(I.startsWith("#"))return g?{sheetName:g,error:I}:{error:I};const B=this.decodeAddress(I);return g?{sheetName:g,...B}:B},encodeAddress:(i,Q)=>E.n2l(Q)+i,encode(){switch(arguments.length){case 2:return E.encodeAddress(arguments[0],arguments[1]);case 4:return`${E.encodeAddress(arguments[0],arguments[1])}:${E.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(i,Q){const[g,I,,t,B]=i,[C,s]=Q;return C>=g&&C<=t&&s>=I&&s<=B}};n.exports=E},{}],20:[function(A,n,c){const e=(i,Q)=>({...i,...Q.reduce((g,I)=>(i[I]&&(g[I]={...i[I]}),g),{})}),E=function(i,Q,g){let I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];i[g]&&(Q[g]=e(i[g],I))};c.copyStyle=i=>{if(!i)return i;if(Q=i,Object.keys(Q).length===0)return{};var Q;const g={...i};return E(i,g,"font",["color"]),E(i,g,"alignment"),E(i,g,"protection"),i.border&&(E(i,g,"border"),E(i.border,g.border,"top",["color"]),E(i.border,g.border,"left",["color"]),E(i.border,g.border,"bottom",["color"]),E(i.border,g.border,"right",["color"]),E(i.border,g.border,"diagonal",["color"])),i.fill&&(E(i,g,"fill",["fgColor","bgColor","center"]),i.fill.stops&&(g.fill.stops=i.fill.stops.map(I=>e(I,["color"])))),g}},{}],21:[function(A,n,c){(function(e){(function(){const E=A("crypto"),i={hash(Q){const g=E.createHash(Q);for(var I=arguments.length,t=new Array(I>1?I-1:0),B=1;B<I;B++)t[B-1]=arguments[B];return g.update(e.concat(t)),g.digest()},convertPasswordToHash(Q,g,I,t){if(g=g.toLowerCase(),E.getHashes().indexOf(g)<0)throw new Error(`Hash algorithm '${g}' not supported!`);const B=e.from(Q,"utf16le");let C=this.hash(g,e.from(I,"base64"),B);for(let s=0;s<t;s++){const D=e.alloc(4);D.writeUInt32LE(s,0),C=this.hash(g,C,D)}return C.toString("base64")},randomBytes:Q=>E.randomBytes(Q)};n.exports=i}).call(this)}).call(this,A("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(A,n,c){const{SaxesParser:e}=A("saxes"),{PassThrough:E}=A("readable-stream"),{bufferToString:i}=A("./browser-buffer-decode");n.exports=async function*(Q){Q.pipe&&!Q[Symbol.asyncIterator]&&(Q=Q.pipe(new E));const g=new e;let I;g.on("error",B=>{I=B});let t=[];g.on("opentag",B=>t.push({eventType:"opentag",value:B})),g.on("text",B=>t.push({eventType:"text",value:B})),g.on("closetag",B=>t.push({eventType:"closetag",value:B}));for await(const B of Q){if(g.write(i(B)),I)throw I;yield t,t=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(A,n,c){const e=A("./col-cache"),E=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,i=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;n.exports={slideFormula:function(Q,g,I){const t=e.decode(g),B=e.decode(I);return Q.replace(E,(C,s,D,o,a)=>{if(a)return C;const r=i.exec(o);if(r){const l=r[1],R=r[2].toUpperCase(),Y=r[3],p=r[4];if(R.length>3||R.length===3&&R>"XFD")return C;let x=e.l2n(R),J=parseInt(p,10);return l||(x+=B.col-t.col),Y||(J+=B.row-t.row),(s||"")+(l||"")+e.n2l(x)+(Y||"")+J}return C})}}},{"./col-cache":19}],24:[function(A,n,c){(function(e,E){(function(){const i=A("readable-stream"),Q=A("./utils"),g=A("./string-buf");class I{constructor(o,a){this._data=o,this._encoding=a}get length(){return this.toBuffer().length}copy(o,a,r,l){return this.toBuffer().copy(o,a,r,l)}toBuffer(){return this._buffer||(this._buffer=E.from(this._data,this._encoding)),this._buffer}}class t{constructor(o){this._data=o}get length(){return this._data.length}copy(o,a,r,l){return this._data._buf.copy(o,a,r,l)}toBuffer(){return this._data.toBuffer()}}class B{constructor(o){this._data=o}get length(){return this._data.length}copy(o,a,r,l){this._data.copy(o,a,r,l)}toBuffer(){return this._data}}class C{constructor(o){this.size=o,this.buffer=E.alloc(o),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const o=E.alloc(this.iWrite-this.iRead);return this.buffer.copy(o,0,this.iRead,this.iWrite),o}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(o){let a;return o===0?null:o===void 0||o>=this.length?(a=this.toBuffer(),this.iRead=this.iWrite,a):(a=E.alloc(o),this.buffer.copy(a,0,this.iRead,o),this.iRead+=o,a)}write(o,a,r){const l=Math.min(r,this.size-this.iWrite);return o.copy(this.buffer,this.iWrite,a,a+l),this.iWrite+=l,l}}const s=function(D){D=D||{},this.bufSize=D.bufSize||1048576,this.buffers=[],this.batch=D.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Q.inherits(s,i.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return E.concat(this.buffers.map(D=>D.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const o=this.buffers[this.buffers.length-1];if(!o.full)return o}const D=new C(this.bufSize);return this.buffers.push(D),D},async _pipe(D){await Promise.all(this.pipes.map((function(o){return new Promise(a=>{o.write(D.toBuffer(),()=>{a()})})})))},_writeToBuffers(D){let o=0;const a=D.length;for(;o<a;)o+=this._getWritableBuffer().write(D,o,a-o)},async write(D,o,a){let r;if(o instanceof Function&&(a=o,o="utf8"),a=a||Q.nop,D instanceof g)r=new t(D);else if(D instanceof E)r=new B(D);else{if(!(typeof D=="string"||D instanceof String||D instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");r=new I(D,o)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(r),e.nextTick(a)):(await this._pipe(r),a());else this.paused||this.emit("data",r.toBuffer()),this._writeToBuffers(r),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(D,o,a){const r=l=>{l?a(l):(this._flush(),this.pipes.forEach(R=>{R.end()}),this.emit("finish"))};D?this.write(D,o,r):r()},read(D){let o;if(D){for(o=[];D&&this.buffers.length&&!this.buffers[0].eod;){const a=this.buffers[0],r=a.read(D);D-=r.length,o.push(r),a.eod&&a.full&&this.buffers.shift()}return E.concat(o)}return o=this.buffers.map(a=>a.toBuffer()).filter(Boolean),this.buffers=[],E.concat(o)},setEncoding(D){this.encoding=D},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(D){this.pipes.push(D),!this.paused&&this.buffers.length&&this.end()},unpipe(D){this.pipes=this.pipes.filter(o=>o!==D)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),n.exports=s}).call(this)}).call(this,A("_process"),A("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(A,n,c){(function(e){(function(){n.exports=class{constructor(E){this._buf=e.alloc(E&&E.size||16384),this._encoding=E&&E.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=e.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(E){E=E||0,this._buffer=void 0,this._inPos=E}_grow(E){let i=2*this._buf.length;for(;i<E;)i*=2;const Q=e.alloc(i);this._buf.copy(Q,0),this._buf=Q}addText(E){this._buffer=void 0;let i=this._inPos+this._buf.write(E,this._inPos,this._encoding);for(;i>=this._buf.length-4;)this._grow(this._inPos+E.length),i=this._inPos+this._buf.write(E,this._inPos,this._encoding);this._inPos=i}addStringBuf(E){E.length&&(this._buffer=void 0,this.length+E.length>this.capacity&&this._grow(this.length+E.length),E._buf.copy(this._buf,this._inPos,0,E.length),this._inPos+=E.length)}}}).call(this)}).call(this,A("buffer").Buffer)},{buffer:220}],26:[function(A,n,c){const{toString:e}=Object.prototype,E=/["&<>]/,i={each:function(Q,g){Q&&(Array.isArray(Q)?Q.forEach(g):Object.keys(Q).forEach(I=>{g(Q[I],I)}))},some:function(Q,g){return!!Q&&(Array.isArray(Q)?Q.some(g):Object.keys(Q).some(I=>g(Q[I],I)))},every:function(Q,g){return!Q||(Array.isArray(Q)?Q.every(g):Object.keys(Q).every(I=>g(Q[I],I)))},map:function(Q,g){return Q?Array.isArray(Q)?Q.map(g):Object.keys(Q).map(I=>g(Q[I],I)):[]},keyBy:(Q,g)=>Q.reduce((I,t)=>(I[t[g]]=t,I),{}),isEqual:function(Q,g){const I=typeof Q,t=typeof g,B=Array.isArray(Q),C=Array.isArray(g);let s;if(I!==t)return!1;switch(typeof Q){case"object":if(B||C)return!(!B||!C)&&Q.length===g.length&&Q.every((D,o)=>{const a=g[o];return i.isEqual(D,a)});if(Q===null||g===null)return Q===g;if(s=Object.keys(Q),Object.keys(g).length!==s.length)return!1;for(const D of s)if(!g.hasOwnProperty(D))return!1;return i.every(Q,(D,o)=>{const a=g[o];return i.isEqual(D,a)});default:return Q===g}},escapeHtml(Q){const g=E.exec(Q);if(!g)return Q;let I="",t="",B=0,C=g.index;for(;C<Q.length;C++){switch(Q.charAt(C)){case'"':t=""";break;case"&":t="&";break;case"'":t="'";break;case"<":t="<";break;case">":t=">";break;default:continue}B!==C&&(I+=Q.substring(B,C)),B=C+1,I+=t}return B!==C?I+Q.substring(B,C):I},strcmp:(Q,g)=>Q<g?-1:Q>g?1:0,isUndefined:Q=>e.call(Q)==="[object Undefined]",isObject:Q=>e.call(Q)==="[object Object]",deepMerge(){const Q=arguments[0]||{},{length:g}=arguments;let I,t,B;function C(s,D){I=Q[D],B=Array.isArray(s),i.isObject(s)||B?(B?(B=!1,t=I&&Array.isArray(I)?I:[]):t=I&&i.isObject(I)?I:{},Q[D]=i.deepMerge(t,s)):i.isUndefined(s)||(Q[D]=s)}for(let s=0;s<g;s++)i.each(arguments[s],C);return Q}};n.exports=i},{}],27:[function(A,n,c){(function(e,E){(function(){const i=A("fs"),Q=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,g={nop(){},promiseImmediate:I=>new Promise(t=>{e.setImmediate?E(()=>{t(I)}):setTimeout(()=>{t(I)},1)}),inherits:function(I,t,B,C){I.super_=t,C||(C=B,B=null),B&&Object.keys(B).forEach(D=>{Object.defineProperty(I,D,Object.getOwnPropertyDescriptor(B,D))});const s={constructor:{value:I,enumerable:!1,writable:!1,configurable:!0}};C&&Object.keys(C).forEach(D=>{s[D]=Object.getOwnPropertyDescriptor(C,D)}),I.prototype=Object.create(t.prototype,s)},dateToExcel:(I,t)=>25569+I.getTime()/864e5-(t?1462:0),excelToDate(I,t){const B=Math.round(24*(I-25569+(t?1462:0))*3600*1e3);return new Date(B)},parsePath(I){const t=I.lastIndexOf("/");return{path:I.substring(0,t),name:I.substring(t+1)}},getRelsPath(I){const t=g.parsePath(I);return`${t.path}/_rels/${t.name}.rels`},xmlEncode(I){const t=Q.exec(I);if(!t)return I;let B="",C="",s=0,D=t.index;for(;D<I.length;D++){const o=I.charCodeAt(D);switch(o){case 34:C=""";break;case 38:C="&";break;case 39:C="'";break;case 60:C="<";break;case 62:C=">";break;case 127:C="";break;default:if(o<=31&&(o<=8||o>=11&&o!==13)){C="";break}continue}s!==D&&(B+=I.substring(s,D)),s=D+1,C&&(B+=C)}return s!==D?B+I.substring(s,D):B},xmlDecode:I=>I.replace(/&([a-z]*);/g,t=>{switch(t){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return t}}),validInt(I){const t=parseInt(I,10);return Number.isNaN(t)?0:t},isDateFmt(I){return I?(I=(I=I.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:I=>new Promise(t=>{i.access(I,i.constants.F_OK,B=>{t(!B)})})},toIsoDateString:I=>I.toIsoString().subsstr(0,10),parseBoolean:I=>I===!0||I==="true"||I===1||I==="1"};n.exports=g}).call(this)}).call(this,typeof cg<"u"?cg:typeof self<"u"?self:typeof window<"u"?window:{},A("timers").setImmediate)},{fs:216,timers:523}],28:[function(A,n,c){const e=A("./under-dash"),E=A("./utils");function i(I,t,B){I.push(` ${t}="${E.xmlEncode(B.toString())}"`)}function Q(I,t){if(t){const B=[];e.each(t,(C,s)=>{C!==void 0&&i(B,s,C)}),I.push(B.join(""))}}class g{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(t){const B=this._xml;B.push("<?xml"),Q(B,t),B.push(`?>
|
|
29
29
|
`)}openNode(t,B){const C=this.tos,s=this._xml;C&&this.open&&s.push(">"),this._stack.push(t),s.push("<"),s.push(t),Q(s,B),this.leaf=!0,this.open=!0}addAttribute(t,B){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");B!==void 0&&i(this._xml,t,B)}addAttributes(t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");Q(this._xml,t)}writeText(t){const B=this._xml;this.open&&(B.push(">"),this.open=!1),this.leaf=!1,B.push(E.xmlEncode(t.toString()))}writeXml(t){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(t)}closeNode(){const t=this._stack.pop(),B=this._xml;this.leaf?B.push("/>"):(B.push("</"),B.push(t),B.push(">")),this.open=!1,this.leaf=!1}leafNode(t,B,C){this.openNode(t,B),C!==void 0&&this.writeText(C),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const t=this._rollbacks.pop();this._xml.length>t.xml&&this._xml.splice(t.xml,this._xml.length-t.xml),this._stack.length>t.stack&&this._stack.splice(t.stack,this._stack.length-t.stack),this.leaf=t.leaf,this.open=t.open}get xml(){return this.closeAll(),this._xml.join("")}}g.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},n.exports=g},{"./under-dash":26,"./utils":27}],29:[function(A,n,c){(function(e){(function(){const E=A("events"),i=A("jszip"),Q=A("./stream-buf"),{stringToBuffer:g}=A("./browser-buffer-encode");class I extends E.EventEmitter{constructor(B){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},B),this.zip=new i,this.stream=new Q}append(B,C){C.hasOwnProperty("base64")&&C.base64?this.zip.file(C.name,B,{base64:!0}):(e.browser&&typeof B=="string"&&(B=g(B)),this.zip.file(C.name,B))}async finalize(){const B=await this.zip.generateAsync(this.options);this.stream.end(B),this.emit("finish")}read(B){return this.stream.read(B)}setEncoding(B){return this.stream.setEncoding(B)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(B,C){return this.stream.pipe(B,C)}unpipe(B){return this.stream.unpipe(B)}unshift(B){return this.stream.unshift(B)}wrap(B){return this.stream.wrap(B)}}n.exports={ZipWriter:I}}).call(this)}).call(this,A("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(A,n,c){n.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(A,n,c){n.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(A,n,c){const e=A("../../utils/parse-sax"),E=A("../../utils/xml-stream");class i{prepare(){}render(){}parseOpen(g){}parseText(g){}parseClose(g){}reconcile(g,I){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(g=>{g instanceof i?g.reset():g.xform&&g.xform.reset()})}mergeModel(g){this.model=Object.assign(this.model||{},g)}async parse(g){for await(const I of g)for(const{eventType:t,value:B}of I)if(t==="opentag")this.parseOpen(B);else if(t==="text")this.parseText(B);else if(t==="closetag"&&!this.parseClose(B.name))return this.model;return this.model}async parseStream(g){return this.parse(e(g))}get xml(){return this.toXml(this.model)}toXml(g){const I=new E;return this.render(I,g),I.xml}static toAttribute(g,I){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(g===void 0){if(t)return I}else if(t||g!==I)return g.toString()}static toStringAttribute(g,I){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return i.toAttribute(g,I,t)}static toStringValue(g,I){return g===void 0?I:g}static toBoolAttribute(g,I){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(g===void 0){if(t)return I}else if(t||g!==I)return g?"1":"0"}static toBoolValue(g,I){return g===void 0?I:g==="1"}static toIntAttribute(g,I){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return i.toAttribute(g,I,t)}static toIntValue(g,I){return g===void 0?I:parseInt(g,10)}static toFloatAttribute(g,I){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return i.toAttribute(g,I,t)}static toFloatValue(g,I){return g===void 0?I:parseFloat(g)}}n.exports=i},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(A,n,c){const e=A("../base-xform"),E=A("../../../utils/col-cache");function i(g){try{return E.decodeEx(g),!0}catch{return!1}}function Q(g){const I=[];let t=!1,B="";return g.split(",").forEach(C=>{if(!C)return;const s=(C.match(/'/g)||[]).length;if(!s)return void(t?B+=C+",":i(C)&&I.push(C));const D=s%2==0;!t&&D&&i(C)?I.push(C):t&&!D?(t=!1,i(B+C)&&I.push(B+C),B=""):(t=!0,B+=C+",")}),I}n.exports=class extends e{render(g,I){g.openNode("definedName",{name:I.name,localSheetId:I.localSheetId}),g.writeText(I.ranges.join(",")),g.closeNode()}parseOpen(g){switch(g.name){case"definedName":return this._parsedName=g.attributes.name,this._parsedLocalSheetId=g.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(g){this._parsedText.push(g)}parseClose(){return this.model={name:this._parsedName,ranges:Q(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(A,n,c){const e=A("../../../utils/utils"),E=A("../base-xform");n.exports=class extends E{render(i,Q){i.leafNode("sheet",{sheetId:Q.id,name:Q.name,state:Q.state,"r:id":Q.rId})}parseOpen(i){return i.name==="sheet"&&(this.model={name:e.xmlDecode(i.attributes.name),id:parseInt(i.attributes.sheetId,10),state:i.attributes.state,rId:i.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){E.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:i.fullCalcOnLoad?1:void 0})}parseOpen(E){return E.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){E.leafNode("workbookPr",{date1904:i.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(E){return E.name==="workbookPr"&&(this.model={date1904:E.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){const Q={xWindow:i.x||0,yWindow:i.y||0,windowWidth:i.width||12e3,windowHeight:i.height||24e3,firstSheet:i.firstSheet,activeTab:i.activeTab};i.visibility&&i.visibility!=="visible"&&(Q.visibility=i.visibility),E.leafNode("workbookView",Q)}parseOpen(E){if(E.name==="workbookView"){const i=this.model={},Q=function(I,t,B){const C=t!==void 0?i[I]=t:B;C!==void 0&&(i[I]=C)},g=function(I,t,B){const C=t!==void 0?i[I]=parseInt(t,10):B;C!==void 0&&(i[I]=C)};return g("x",E.attributes.xWindow,0),g("y",E.attributes.yWindow,0),g("width",E.attributes.windowWidth,25e3),g("height",E.attributes.windowHeight,1e4),Q("visibility",E.attributes.visibility,"visible"),g("activeTab",E.attributes.activeTab,void 0),g("firstSheet",E.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../../../utils/col-cache"),i=A("../../../utils/xml-stream"),Q=A("../base-xform"),g=A("../static-xform"),I=A("../list-xform"),t=A("./defined-name-xform"),B=A("./sheet-xform"),C=A("./workbook-view-xform"),s=A("./workbook-properties-xform"),D=A("./workbook-calc-properties-xform");class o extends Q{constructor(){super(),this.map={fileVersion:o.STATIC_XFORMS.fileVersion,workbookPr:new s,bookViews:new I({tag:"bookViews",count:!1,childXform:new C}),sheets:new I({tag:"sheets",count:!1,childXform:new B}),definedNames:new I({tag:"definedNames",count:!1,childXform:new t}),calcPr:new D}}prepare(r){r.sheets=r.worksheets;const l=[];let R=0;r.sheets.forEach(Y=>{if(Y.pageSetup&&Y.pageSetup.printArea&&Y.pageSetup.printArea.split("&&").forEach(p=>{const x=p.split(":"),J={name:"_xlnm.Print_Area",ranges:[`'${Y.name}'!$${x[0]}:$${x[1]}`],localSheetId:R};l.push(J)}),Y.pageSetup&&(Y.pageSetup.printTitlesRow||Y.pageSetup.printTitlesColumn)){const p=[];if(Y.pageSetup.printTitlesColumn){const J=Y.pageSetup.printTitlesColumn.split(":");p.push(`'${Y.name}'!$${J[0]}:$${J[1]}`)}if(Y.pageSetup.printTitlesRow){const J=Y.pageSetup.printTitlesRow.split(":");p.push(`'${Y.name}'!$${J[0]}:$${J[1]}`)}const x={name:"_xlnm.Print_Titles",ranges:p,localSheetId:R};l.push(x)}R++}),l.length&&(r.definedNames=r.definedNames.concat(l)),(r.media||[]).forEach((Y,p)=>{Y.name=Y.type+(p+1)})}render(r,l){r.openXml(i.StdDocAttributes),r.openNode("workbook",o.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(r),this.map.workbookPr.render(r,l.properties),this.map.bookViews.render(r,l.views),this.map.sheets.render(r,l.sheets),this.map.definedNames.render(r,l.definedNames),this.map.calcPr.render(r,l.calcProperties),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"workbook":return!0;default:return this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r),!0}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case"workbook":return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(r){const l=(r.workbookRels||[]).reduce((J,H)=>(J[H.Id]=H,J),{}),R=[];let Y,p=0;(r.sheets||[]).forEach(J=>{const H=l[J.rId];H&&(Y=r.worksheetHash["xl/"+H.Target.replace(/^(\s|\/xl\/)+/,"")],Y&&(Y.name=J.name,Y.id=J.id,Y.state=J.state,R[p++]=Y))});const x=[];e.each(r.definedNames,J=>{if(J.name==="_xlnm.Print_Area"){if(Y=R[J.localSheetId],Y){Y.pageSetup||(Y.pageSetup={});const H=E.decodeEx(J.ranges[0]);Y.pageSetup.printArea=Y.pageSetup.printArea?`${Y.pageSetup.printArea}&&${H.dimensions}`:H.dimensions}}else if(J.name==="_xlnm.Print_Titles"){if(Y=R[J.localSheetId],Y){Y.pageSetup||(Y.pageSetup={});const H=J.ranges.join(","),b=/\$/g,O=/\$\d+:\$\d+/,m=H.match(O);if(m&&m.length){const G=m[0];Y.pageSetup.printTitlesRow=G.replace(b,"")}const F=/\$[A-Z]+:\$[A-Z]+/,u=H.match(F);if(u&&u.length){const G=u[0];Y.pageSetup.printTitlesColumn=G.replace(b,"")}}}else x.push(J)}),r.definedNames=x,r.media.forEach((J,H)=>{J.index=H})}}o.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},o.STATIC_XFORMS={fileVersion:new g({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},n.exports=o},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(A,n,c){const e=A("../strings/rich-text-xform"),E=A("../../../utils/utils"),i=A("../base-xform"),Q=n.exports=function(g){this.model=g};E.inherits(Q,i,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new e),this._richTextXform},render(g,I){I=I||this.model,g.openNode("comment",{ref:I.ref,authorId:0}),g.openNode("text"),I&&I.note&&I.note.texts&&I.note.texts.forEach(t=>{this.richTextXform.render(g,t)}),g.closeNode(),g.closeNode()},parseOpen(g){if(this.parser)return this.parser.parseOpen(g),!0;switch(g.name){case"comment":return this.model={type:"note",note:{texts:[]},...g.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(g),!0;default:return!1}},parseText(g){this.parser&&this.parser.parseText(g)},parseClose(g){switch(g){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(g),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../../../utils/utils"),i=A("../base-xform"),Q=A("./comment-xform"),g=n.exports=function(){this.map={comment:new Q}};E.inherits(g,i,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(I,t){t=t||this.model,I.openXml(e.StdDocAttributes),I.openNode("comments",g.COMMENTS_ATTRIBUTES),I.openNode("authors"),I.leafNode("author",null,"Author"),I.closeNode(),I.openNode("commentList"),t.comments.forEach(B=>{this.map.comment.render(I,B)}),I.closeNode(),I.closeNode()},parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(I),!0;default:return!1}},parseText(I){this.parser&&this.parser.parseText(I)},parseClose(I){switch(I){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(I),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{constructor(E){super(),this._model=E}get tag(){return this._model&&this._model.tag}render(E,i,Q){(i===Q[2]||this.tag==="x:SizeWithCells"&&i===Q[1])&&E.leafNode(this.tag)}parseOpen(E){switch(E.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{constructor(E){super(),this._model=E}get tag(){return this._model&&this._model.tag}render(E,i){E.leafNode(this.tag,null,i)}parseOpen(E){switch(E.name){case this.tag:return this.text="",!0;default:return!1}}parseText(E){this.text=E}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"x:Anchor"}getAnchorRect(E){const i=Math.floor(E.left),Q=Math.floor(68*(E.left-i)),g=Math.floor(E.top),I=Math.floor(18*(E.top-g)),t=Math.floor(E.right),B=Math.floor(68*(E.right-t)),C=Math.floor(E.bottom);return[i,Q,g,I,t,B,C,Math.floor(18*(E.bottom-C))]}getDefaultRect(E){const i=E.col,Q=Math.max(E.row-2,0);return[i,6,Q,14,i+2,2,Q+4,16]}render(E,i){const Q=i.anchor?this.getAnchorRect(i.anchor):this.getDefaultRect(i.refAddress);E.leafNode("x:Anchor",null,Q.join(", "))}parseOpen(E){switch(E.name){case this.tag:return this.text="",!0;default:return!1}}parseText(E){this.text=E}parseClose(){return!1}}},{"../base-xform":32}],44:[function(A,n,c){const e=A("../base-xform"),E=A("./vml-anchor-xform"),i=A("./style/vml-protection-xform"),Q=A("./style/vml-position-xform"),g=["twoCells","oneCells","absolute"];n.exports=class extends e{constructor(){super(),this.map={"x:Anchor":new E,"x:Locked":new i({tag:"x:Locked"}),"x:LockText":new i({tag:"x:LockText"}),"x:SizeWithCells":new Q({tag:"x:SizeWithCells"}),"x:MoveWithCells":new Q({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(I,t){const{protection:B,editAs:C}=t.note;I.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(I,C,g),this.map["x:SizeWithCells"].render(I,C,g),this.map["x:Anchor"].render(I,t),this.map["x:Locked"].render(I,B.locked),I.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(I,B.lockText),I.leafNode("x:Row",null,t.refAddress.row-1),I.leafNode("x:Column",null,t.refAddress.col-1),I.closeNode()}parseOpen(I){switch(I.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[I.name],this.parser&&this.parser.parseOpen(I)}return!0}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.parser=void 0),!0;switch(I){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const I=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),t=Object.keys(I).length;this.model.editAs=g[t],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("./vml-shape-xform");class Q extends E{constructor(){super(),this.map={"v:shape":new i}}get tag(){return"xml"}render(I,t){I.openXml(e.StdDocAttributes),I.openNode(this.tag,Q.DRAWING_ATTRIBUTES),I.openNode("o:shapelayout",{"v:ext":"edit"}),I.leafNode("o:idmap",{"v:ext":"edit",data:1}),I.closeNode(),I.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),I.leafNode("v:stroke",{joinstyle:"miter"}),I.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),I.closeNode(),t.comments.forEach((B,C)=>{this.map["v:shape"].render(I,B,C)}),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[I.name],this.parser&&this.parser.parseOpen(I)}return!0}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(I){case this.tag:return!1;default:return!0}}reconcile(I,t){I.anchors.forEach(B=>{B.br?this.map["xdr:twoCellAnchor"].reconcile(B,t):this.map["xdr:oneCellAnchor"].reconcile(B,t)})}}Q.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},n.exports=Q},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(A,n,c){const e=A("../base-xform"),E=A("./vml-textbox-xform"),i=A("./vml-client-data-xform");class Q extends e{constructor(){super(),this.map={"v:textbox":new E,"x:ClientData":new i}}get tag(){return"v:shape"}render(I,t,B){I.openNode("v:shape",Q.V_SHAPE_ATTRIBUTES(t,B)),I.leafNode("v:fill",{color2:"infoBackground [80]"}),I.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),I.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(I,t),this.map["x:ClientData"].render(I,t),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case this.tag:this.reset(),this.model={margins:{insetmode:I.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[I.name],this.parser&&this.parser.parseOpen(I)}return!0}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.parser=void 0),!0;switch(I){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}Q.V_SHAPE_ATTRIBUTES=(g,I)=>({id:"_x0000_s"+(1025+I),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":g.note.margins&&g.note.margins.insetmode}),n.exports=Q},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"v:textbox"}conversionUnit(E,i,Q){return`${parseFloat(E)*i.toFixed(2)}${Q}`}reverseConversionUnit(E){return(E||"").split(",").map(i=>Number(parseFloat(this.conversionUnit(parseFloat(i),.1,"")).toFixed(2)))}render(E,i){const Q={style:"mso-direction-alt:auto"};if(i&&i.note){let{inset:g}=i.note&&i.note.margins;Array.isArray(g)&&(g=g.map(I=>this.conversionUnit(I,10,"mm")).join(",")),g&&(Q.inset=g)}E.openNode("v:textbox",Q),E.leafNode("div",{style:"text-align:left"}),E.closeNode()}parseOpen(E){switch(E.name){case this.tag:return this.model={inset:this.reverseConversionUnit(E.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(E){switch(E){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(A,n,c){const e=A("./base-xform");n.exports=class extends e{createNewModel(E){return{}}parseOpen(E){return this.parser=this.parser||this.map[E.name],this.parser?(this.parser.parseOpen(E),!0):E.name===this.tag&&(this.model=this.createNewModel(E),!0)}parseText(E){this.parser&&this.parser.parseText(E)}onParserClose(E,i){this.model[E]=i.model}parseClose(E){return this.parser?(this.parser.parseClose(E)||(this.onParserClose(E,this.parser),this.parser=void 0),!0):E!==this.tag}}},{"./base-xform":32}],49:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){E.openNode("HeadingPairs"),E.openNode("vt:vector",{size:2,baseType:"variant"}),E.openNode("vt:variant"),E.leafNode("vt:lpstr",void 0,"Worksheets"),E.closeNode(),E.openNode("vt:variant"),E.leafNode("vt:i4",void 0,i.length),E.closeNode(),E.closeNode(),E.closeNode()}parseOpen(E){return E.name==="HeadingPairs"}parseText(){}parseClose(E){return E!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){E.openNode("TitlesOfParts"),E.openNode("vt:vector",{size:i.length,baseType:"lpstr"}),i.forEach(Q=>{E.leafNode("vt:lpstr",void 0,Q.name)}),E.closeNode(),E.closeNode()}parseOpen(E){return E.name==="TitlesOfParts"}parseText(){}parseClose(E){return E!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("../simple/string-xform"),Q=A("./app-heading-pairs-xform"),g=A("./app-titles-of-parts-xform");class I extends E{constructor(){super(),this.map={Company:new i({tag:"Company"}),Manager:new i({tag:"Manager"}),HeadingPairs:new Q,TitleOfParts:new g}}render(B,C){B.openXml(e.StdDocAttributes),B.openNode("Properties",I.PROPERTY_ATTRIBUTES),B.leafNode("Application",void 0,"Microsoft Excel"),B.leafNode("DocSecurity",void 0,"0"),B.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(B,C.worksheets),this.map.TitleOfParts.render(B,C.worksheets),this.map.Company.render(B,C.company||""),this.map.Manager.render(B,C.manager),B.leafNode("LinksUpToDate",void 0,"false"),B.leafNode("SharedDoc",void 0,"false"),B.leafNode("HyperlinksChanged",void 0,"false"),B.leafNode("AppVersion",void 0,"16.0300"),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"Properties":return!0;default:return this.parser=this.map[B.name],!!this.parser&&(this.parser.parseOpen(B),!0)}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){if(this.parser)return this.parser.parseClose(B)||(this.parser=void 0),!0;switch(B){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}I.DateFormat=function(t){return t.toISOString().replace(/[.]\d{3,6}/,"")},I.DateAttrs={"xsi:type":"dcterms:W3CDTF"},I.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},n.exports=I},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform");class i extends E{render(g,I){g.openXml(e.StdDocAttributes),g.openNode("Types",i.PROPERTY_ATTRIBUTES);const t={};(I.media||[]).forEach(B=>{if(B.type==="image"){const C=B.extension;t[C]||(t[C]=!0,g.leafNode("Default",{Extension:C,ContentType:"image/"+C}))}}),g.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),g.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),g.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),I.worksheets.forEach(B=>{const C=`/xl/worksheets/sheet${B.id}.xml`;g.leafNode("Override",{PartName:C,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),g.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),g.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),I.sharedStrings&&I.sharedStrings.count&&g.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),I.tables&&I.tables.forEach(B=>{g.leafNode("Override",{PartName:"/xl/tables/"+B.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),I.drawings&&I.drawings.forEach(B=>{g.leafNode("Override",{PartName:`/xl/drawings/${B.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),I.commentRefs&&(g.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),I.commentRefs.forEach(B=>{let{commentName:C}=B;g.leafNode("Override",{PartName:`/xl/${C}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),g.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),g.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),g.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}i.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n.exports=i},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("../simple/date-xform"),Q=A("../simple/string-xform"),g=A("../simple/integer-xform");class I extends E{constructor(){super(),this.map={"dc:creator":new Q({tag:"dc:creator"}),"dc:title":new Q({tag:"dc:title"}),"dc:subject":new Q({tag:"dc:subject"}),"dc:description":new Q({tag:"dc:description"}),"dc:identifier":new Q({tag:"dc:identifier"}),"dc:language":new Q({tag:"dc:language"}),"cp:keywords":new Q({tag:"cp:keywords"}),"cp:category":new Q({tag:"cp:category"}),"cp:lastModifiedBy":new Q({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new i({tag:"cp:lastPrinted",format:I.DateFormat}),"cp:revision":new g({tag:"cp:revision"}),"cp:version":new Q({tag:"cp:version"}),"cp:contentStatus":new Q({tag:"cp:contentStatus"}),"cp:contentType":new Q({tag:"cp:contentType"}),"dcterms:created":new i({tag:"dcterms:created",attrs:I.DateAttrs,format:I.DateFormat}),"dcterms:modified":new i({tag:"dcterms:modified",attrs:I.DateAttrs,format:I.DateFormat})}}render(B,C){B.openXml(e.StdDocAttributes),B.openNode("cp:coreProperties",I.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(B,C.creator),this.map["dc:title"].render(B,C.title),this.map["dc:subject"].render(B,C.subject),this.map["dc:description"].render(B,C.description),this.map["dc:identifier"].render(B,C.identifier),this.map["dc:language"].render(B,C.language),this.map["cp:keywords"].render(B,C.keywords),this.map["cp:category"].render(B,C.category),this.map["cp:lastModifiedBy"].render(B,C.lastModifiedBy),this.map["cp:lastPrinted"].render(B,C.lastPrinted),this.map["cp:revision"].render(B,C.revision),this.map["cp:version"].render(B,C.version),this.map["cp:contentStatus"].render(B,C.contentStatus),this.map["cp:contentType"].render(B,C.contentType),this.map["dcterms:created"].render(B,C.created),this.map["dcterms:modified"].render(B,C.modified),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[B.name],this.parser)return this.parser.parseOpen(B),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(B))}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){if(this.parser)return this.parser.parseClose(B)||(this.parser=void 0),!0;switch(B){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+B)}}}I.DateFormat=function(t){return t.toISOString().replace(/[.]\d{3}/,"")},I.DateAttrs={"xsi:type":"dcterms:W3CDTF"},I.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},n.exports=I},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{render(E,i){E.leafNode("Relationship",i)}parseOpen(E){switch(E.name){case"Relationship":return this.model=E.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("./relationship-xform");class Q extends E{constructor(){super(),this.map={Relationship:new i}}render(I,t){t=t||this._values,I.openXml(e.StdDocAttributes),I.openNode("Relationships",Q.RELATIONSHIPS_ATTRIBUTES),t.forEach(B=>{this.map.Relationship.render(I,B)}),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[I.name],this.parser)return this.parser.parseOpen(I),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(I))}}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(I){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+I)}}}Q.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},n.exports=Q},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{parseOpen(E){if(this.parser)return this.parser.parseOpen(E),!0;switch(E.name){case this.tag:this.reset(),this.model={range:{editAs:E.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[E.name],this.parser&&this.parser.parseOpen(E)}return!0}parseText(E){this.parser&&this.parser.parseText(E)}reconcilePicture(E,i){if(E&&E.rId){const Q=i.rels[E.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(Q){const g=Q[1],I=i.mediaIndex[g];return i.media[I]}}}}},{"../base-xform":32}],57:[function(A,n,c){const e=A("../base-xform"),E=A("./blip-xform");n.exports=class extends e{constructor(){super(),this.map={"a:blip":new E}}get tag(){return"xdr:blipFill"}render(i,Q){i.openNode(this.tag),this.map["a:blip"].render(i,Q),i.openNode("a:stretch"),i.leafNode("a:fillRect"),i.closeNode(),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset();break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(){}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"a:blip"}render(E,i){E.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":i.rId,cstate:"print"})}parseOpen(E){switch(E.name){case this.tag:return this.model={rId:E.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(E){switch(E){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"xdr:cNvPicPr"}render(E){E.openNode(this.tag),E.leafNode("a:picLocks",{noChangeAspect:"1"}),E.closeNode()}parseOpen(E){switch(E.name){case this.tag:default:return!0}}parseText(){}parseClose(E){switch(E){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(A,n,c){const e=A("../base-xform"),E=A("./hlink-click-xform"),i=A("./ext-lst-xform");n.exports=class extends e{constructor(){super(),this.map={"a:hlinkClick":new E,"a:extLst":new i}}get tag(){return"xdr:cNvPr"}render(Q,g){Q.openNode(this.tag,{id:g.index,name:"Picture "+g.index}),this.map["a:hlinkClick"].render(Q,g),this.map["a:extLst"].render(Q,g),Q.closeNode()}parseOpen(Q){if(this.parser)return this.parser.parseOpen(Q),!0;switch(Q.name){case this.tag:this.reset();break;default:this.parser=this.map[Q.name],this.parser&&this.parser.parseOpen(Q)}return!0}parseText(){}parseClose(Q){if(this.parser)return this.parser.parseClose(Q)||(this.parser=void 0),!0;switch(Q){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(A,n,c){const e=A("../base-xform"),E=A("../simple/integer-xform");n.exports=class extends e{constructor(i){super(),this.tag=i.tag,this.map={"xdr:col":new E({tag:"xdr:col",zero:!0}),"xdr:colOff":new E({tag:"xdr:colOff",zero:!0}),"xdr:row":new E({tag:"xdr:row",zero:!0}),"xdr:rowOff":new E({tag:"xdr:rowOff",zero:!0})}}render(i,Q){i.openNode(this.tag),this.map["xdr:col"].render(i,Q.nativeCol),this.map["xdr:colOff"].render(i,Q.nativeColOff),this.map["xdr:row"].render(i,Q.nativeRow),this.map["xdr:rowOff"].render(i,Q.nativeRowOff),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset();break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(A,n,c){const e=A("../../../utils/col-cache"),E=A("../../../utils/xml-stream"),i=A("../base-xform"),Q=A("./two-cell-anchor-xform"),g=A("./one-cell-anchor-xform");class I extends i{constructor(){super(),this.map={"xdr:twoCellAnchor":new Q,"xdr:oneCellAnchor":new g}}prepare(B){B.anchors.forEach((C,s)=>{C.anchorType=(function(D){return(typeof D.range=="string"?e.decode(D.range):D.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"})(C),this.map[C.anchorType].prepare(C,{index:s})})}get tag(){return"xdr:wsDr"}render(B,C){B.openXml(E.StdDocAttributes),B.openNode(this.tag,I.DRAWING_ATTRIBUTES),C.anchors.forEach(s=>{this.map[s.anchorType].render(B,s)}),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[B.name],this.parser&&this.parser.parseOpen(B)}return!0}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){if(this.parser)return this.parser.parseClose(B)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(B){case this.tag:return!1;default:return!0}}reconcile(B,C){B.anchors.forEach(s=>{s.br?this.map["xdr:twoCellAnchor"].reconcile(s,C):this.map["xdr:oneCellAnchor"].reconcile(s,C)})}}I.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},n.exports=I},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"a:extLst"}render(E){E.openNode(this.tag),E.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),E.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),E.closeNode(),E.closeNode()}parseOpen(E){switch(E.name){case this.tag:default:return!0}}parseText(){}parseClose(E){switch(E){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.map={}}render(E,i){E.openNode(this.tag);const Q=Math.floor(9525*i.width),g=Math.floor(9525*i.height);E.addAttribute("cx",Q),E.addAttribute("cy",g),E.closeNode()}parseOpen(E){return E.name===this.tag&&(this.model={width:parseInt(E.attributes.cx||"0",10)/9525,height:parseInt(E.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"a:hlinkClick"}render(E,i){i.hyperlinks&&i.hyperlinks.rId&&E.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":i.hyperlinks.rId,tooltip:i.hyperlinks.tooltip})}parseOpen(E){switch(E.name){case this.tag:return this.model={hyperlinks:{rId:E.attributes["r:id"],tooltip:E.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(A,n,c){const e=A("../base-xform"),E=A("./c-nv-pr-xform"),i=A("./c-nv-pic-pr-xform");n.exports=class extends e{constructor(){super(),this.map={"xdr:cNvPr":new E,"xdr:cNvPicPr":new i}}get tag(){return"xdr:nvPicPr"}render(Q,g){Q.openNode(this.tag),this.map["xdr:cNvPr"].render(Q,g),this.map["xdr:cNvPicPr"].render(Q,g),Q.closeNode()}parseOpen(Q){if(this.parser)return this.parser.parseOpen(Q),!0;switch(Q.name){case this.tag:this.reset();break;default:this.parser=this.map[Q.name],this.parser&&this.parser.parseOpen(Q)}return!0}parseText(){}parseClose(Q){if(this.parser)return this.parser.parseClose(Q)||(this.parser=void 0),!0;switch(Q){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(A,n,c){const e=A("./base-cell-anchor-xform"),E=A("../static-xform"),i=A("./cell-position-xform"),Q=A("./ext-xform"),g=A("./pic-xform");n.exports=class extends e{constructor(){super(),this.map={"xdr:from":new i({tag:"xdr:from"}),"xdr:ext":new Q({tag:"xdr:ext"}),"xdr:pic":new g,"xdr:clientData":new E({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(I,t){this.map["xdr:pic"].prepare(I.picture,t)}render(I,t){I.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(I,t.range.tl),this.map["xdr:ext"].render(I,t.range.ext),this.map["xdr:pic"].render(I,t.picture),this.map["xdr:clientData"].render(I,{}),I.closeNode()}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.parser=void 0),!0;switch(I){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(I,t){I.medium=this.reconcilePicture(I.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(A,n,c){const e=A("../base-xform"),E=A("../static-xform"),i=A("./blip-fill-xform"),Q=A("./nv-pic-pr-xform"),g=A("./sp-pr");n.exports=class extends e{constructor(){super(),this.map={"xdr:nvPicPr":new Q,"xdr:blipFill":new i,"xdr:spPr":new E(g)}}get tag(){return"xdr:pic"}prepare(I,t){I.index=t.index+1}render(I,t){I.openNode(this.tag),this.map["xdr:nvPicPr"].render(I,t),this.map["xdr:blipFill"].render(I,t),this.map["xdr:spPr"].render(I,t),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case this.tag:this.reset();break;default:this.parser=this.map[I.name],this.parser&&this.parser.parseOpen(I)}return!0}parseText(){}parseClose(I){if(this.parser)return this.parser.parseClose(I)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(I){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(A,n,c){n.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(A,n,c){const e=A("./base-cell-anchor-xform"),E=A("../static-xform"),i=A("./cell-position-xform"),Q=A("./pic-xform");n.exports=class extends e{constructor(){super(),this.map={"xdr:from":new i({tag:"xdr:from"}),"xdr:to":new i({tag:"xdr:to"}),"xdr:pic":new Q,"xdr:clientData":new E({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(g,I){this.map["xdr:pic"].prepare(g.picture,I)}render(g,I){g.openNode(this.tag,{editAs:I.range.editAs||"oneCell"}),this.map["xdr:from"].render(g,I.range.tl),this.map["xdr:to"].render(g,I.range.br),this.map["xdr:pic"].render(g,I.picture),this.map["xdr:clientData"].render(g,{}),g.closeNode()}parseClose(g){if(this.parser)return this.parser.parseClose(g)||(this.parser=void 0),!0;switch(g){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(g,I){g.medium=this.reconcilePicture(g.picture,I)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(A,n,c){const e=A("./base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.always=!!E.always,this.count=E.count,this.empty=E.empty,this.$count=E.$count||"count",this.$=E.$,this.childXform=E.childXform,this.maxItems=E.maxItems}prepare(E,i){const{childXform:Q}=this;E&&E.forEach((g,I)=>{i.index=I,Q.prepare(g,i)})}render(E,i){if(this.always||i&&i.length){E.openNode(this.tag,this.$),this.count&&E.addAttribute(this.$count,i&&i.length||0);const{childXform:Q}=this;(i||[]).forEach((g,I)=>{Q.render(E,g,I)}),E.closeNode()}else this.empty&&E.leafNode(this.tag)}parseOpen(E){if(this.parser)return this.parser.parseOpen(E),!0;switch(E.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(E)&&(this.parser=this.childXform,!0)}}parseText(E){this.parser&&this.parser.parseText(E)}parseClose(E){if(this.parser){if(!this.parser.parseClose(E)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(E,i){if(E){const{childXform:Q}=this;E.forEach(g=>{Q.reconcile(g,i)})}}}},{"./base-xform":32}],72:[function(A,n,c){const e=A("../../../utils/col-cache"),E=A("../base-xform");n.exports=class extends E{get tag(){return"autoFilter"}render(i,Q){if(Q)if(typeof Q=="string")i.leafNode("autoFilter",{ref:Q});else{const g=function(B){return typeof B=="string"?B:e.getAddress(B.row,B.column).address},I=g(Q.from),t=g(Q.to);I&&t&&i.leafNode("autoFilter",{ref:`${I}:${t}`})}}parseOpen(i){i.name==="autoFilter"&&(this.model=i.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(A,n,c){const e=A("../../../utils/utils"),E=A("../base-xform"),i=A("../../../doc/range"),Q=A("../../../doc/enums"),g=A("../strings/rich-text-xform");function I(t){if(t==null)return Q.ValueType.Null;if(t instanceof String||typeof t=="string")return Q.ValueType.String;if(typeof t=="number")return Q.ValueType.Number;if(typeof t=="boolean")return Q.ValueType.Boolean;if(t instanceof Date)return Q.ValueType.Date;if(t.text&&t.hyperlink)return Q.ValueType.Hyperlink;if(t.formula)return Q.ValueType.Formula;if(t.error)return Q.ValueType.Error;throw new Error("I could not understand type of value")}n.exports=class extends E{constructor(){super(),this.richTextXForm=new g}get tag(){return"c"}prepare(t,B){const C=B.styles.addStyleModel(t.style||{},(function(s){switch(s.type){case Q.ValueType.Formula:return I(s.result);default:return s.type}})(t));switch(C&&(t.styleId=C),t.comment&&B.comments.push({...t.comment,ref:t.address}),t.type){case Q.ValueType.String:case Q.ValueType.RichText:B.sharedStrings&&(t.ssId=B.sharedStrings.add(t.value));break;case Q.ValueType.Date:B.date1904&&(t.date1904=!0);break;case Q.ValueType.Hyperlink:B.sharedStrings&&t.text!==void 0&&t.text!==null&&(t.ssId=B.sharedStrings.add(t.text)),B.hyperlinks.push({address:t.address,target:t.hyperlink,tooltip:t.tooltip});break;case Q.ValueType.Merge:B.merges.add(t);break;case Q.ValueType.Formula:if(B.date1904&&(t.date1904=!0),t.shareType==="shared"&&(t.si=B.siFormulae++),t.formula)B.formulae[t.address]=t;else if(t.sharedFormula){const s=B.formulae[t.sharedFormula];if(!s)throw new Error("Shared Formula master must exist above and or left of clone for cell "+t.address);s.si===void 0?(s.shareType="shared",s.si=B.siFormulae++,s.range=new i(s.address,t.address)):s.range&&s.range.expandToAddress(t.address),t.si=s.si}}}renderFormula(t,B){let C=null;switch(B.shareType){case"shared":C={t:"shared",ref:B.ref||B.range.range,si:B.si};break;case"array":C={t:"array",ref:B.ref};break;default:B.si!==void 0&&(C={t:"shared",si:B.si})}switch(I(B.result)){case Q.ValueType.Null:t.leafNode("f",C,B.formula);break;case Q.ValueType.String:t.addAttribute("t","str"),t.leafNode("f",C,B.formula),t.leafNode("v",null,B.result);break;case Q.ValueType.Number:t.leafNode("f",C,B.formula),t.leafNode("v",null,B.result);break;case Q.ValueType.Boolean:t.addAttribute("t","b"),t.leafNode("f",C,B.formula),t.leafNode("v",null,B.result?1:0);break;case Q.ValueType.Error:t.addAttribute("t","e"),t.leafNode("f",C,B.formula),t.leafNode("v",null,B.result.error);break;case Q.ValueType.Date:t.leafNode("f",C,B.formula),t.leafNode("v",null,e.dateToExcel(B.result,B.date1904));break;default:throw new Error("I could not understand type of value")}}render(t,B){if(B.type!==Q.ValueType.Null||B.styleId){switch(t.openNode("c"),t.addAttribute("r",B.address),B.styleId&&t.addAttribute("s",B.styleId),B.type){case Q.ValueType.Null:break;case Q.ValueType.Number:t.leafNode("v",null,B.value);break;case Q.ValueType.Boolean:t.addAttribute("t","b"),t.leafNode("v",null,B.value?"1":"0");break;case Q.ValueType.Error:t.addAttribute("t","e"),t.leafNode("v",null,B.value.error);break;case Q.ValueType.String:case Q.ValueType.RichText:B.ssId!==void 0?(t.addAttribute("t","s"),t.leafNode("v",null,B.ssId)):B.value&&B.value.richText?(t.addAttribute("t","inlineStr"),t.openNode("is"),B.value.richText.forEach(C=>{this.richTextXForm.render(t,C)}),t.closeNode("is")):(t.addAttribute("t","str"),t.leafNode("v",null,B.value));break;case Q.ValueType.Date:t.leafNode("v",null,e.dateToExcel(B.value,B.date1904));break;case Q.ValueType.Hyperlink:B.ssId!==void 0?(t.addAttribute("t","s"),t.leafNode("v",null,B.ssId)):(t.addAttribute("t","str"),t.leafNode("v",null,B.text));break;case Q.ValueType.Formula:this.renderFormula(t,B);break;case Q.ValueType.Merge:}t.closeNode()}}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"c":return this.model={address:t.attributes.r},this.t=t.attributes.t,t.attributes.s&&(this.model.styleId=parseInt(t.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=t.attributes.si,this.model.shareType=t.attributes.t,this.model.ref=t.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){if(this.parser)this.parser.parseText(t);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+t:t;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+t:t:this.model.value=this.model.value?this.model.value+t:t}}parseClose(t){switch(t){case"c":{const{model:B}=this;if(B.formula||B.shareType)B.type=Q.ValueType.Formula,B.value&&(this.t==="str"?B.result=e.xmlDecode(B.value):this.t==="b"?B.result=parseInt(B.value,10)!==0:this.t==="e"?B.result={error:B.value}:B.result=parseFloat(B.value),B.value=void 0);else if(B.value!==void 0)switch(this.t){case"s":B.type=Q.ValueType.String,B.value=parseInt(B.value,10);break;case"str":B.type=Q.ValueType.String,B.value=e.xmlDecode(B.value);break;case"inlineStr":B.type=Q.ValueType.String;break;case"b":B.type=Q.ValueType.Boolean,B.value=parseInt(B.value,10)!==0;break;case"e":B.type=Q.ValueType.Error,B.value={error:B.value};break;default:B.type=Q.ValueType.Number,B.value=parseFloat(B.value)}else B.styleId?B.type=Q.ValueType.Null:B.type=Q.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(t),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(t),!0)}}reconcile(t,B){const C=t.styleId&&B.styles&&B.styles.getStyleModel(t.styleId);switch(C&&(t.style=C),t.styleId!==void 0&&(t.styleId=void 0),t.type){case Q.ValueType.String:typeof t.value=="number"&&B.sharedStrings&&(t.value=B.sharedStrings.getString(t.value)),t.value.richText&&(t.type=Q.ValueType.RichText);break;case Q.ValueType.Number:C&&e.isDateFmt(C.numFmt)&&(t.type=Q.ValueType.Date,t.value=e.excelToDate(t.value,B.date1904));break;case Q.ValueType.Formula:t.result!==void 0&&C&&e.isDateFmt(C.numFmt)&&(t.result=e.excelToDate(t.result,B.date1904)),t.shareType==="shared"&&(t.ref?B.formulae[t.si]=t.address:(t.sharedFormula=B.formulae[t.si],delete t.shareType),delete t.si)}const s=B.hyperlinkMap[t.address];s&&(t.type===Q.ValueType.Formula?(t.text=t.result,t.result=void 0):(t.text=t.value,t.value=void 0),t.type=Q.ValueType.Hyperlink,t.hyperlink=s);const D=B.commentsMap&&B.commentsMap[t.address];D&&(t.comment=D)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{get tag(){return"x14:cfIcon"}render(E,i){E.leafNode(this.tag,{iconSet:i.iconSet,iconId:i.iconId})}parseOpen(E){let{attributes:i}=E;this.model={iconSet:i.iconSet,iconId:e.toIntValue(i.iconId)}}parseClose(E){return E!==this.tag}}},{"../../base-xform":32}],75:[function(A,n,c){const{v4:e}=A("uuid"),E=A("../../base-xform"),i=A("../../composite-xform"),Q=A("./databar-ext-xform"),g=A("./icon-set-ext-xform"),I={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class t extends i{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new Q,"x14:iconSet":this.iconSetXform=new g}}get tag(){return"x14:cfRule"}static isExt(C){return C.type==="dataBar"?Q.isExt(C):!(C.type!=="iconSet"||!C.custom&&!I[C.iconSet])}prepare(C){t.isExt(C)&&(C.x14Id=`{${e()}}`.toUpperCase())}render(C,s){if(t.isExt(s))switch(s.type){case"dataBar":this.renderDataBar(C,s);break;case"iconSet":this.renderIconSet(C,s)}}renderDataBar(C,s){C.openNode(this.tag,{type:"dataBar",id:s.x14Id}),this.databarXform.render(C,s),C.closeNode()}renderIconSet(C,s){C.openNode(this.tag,{type:"iconSet",priority:s.priority,id:s.x14Id||`{${e()}}`}),this.iconSetXform.render(C,s),C.closeNode()}createNewModel(C){let{attributes:s}=C;return{type:s.type,x14Id:s.id,priority:E.toIntValue(s.priority)}}onParserClose(C,s){Object.assign(this.model,s.model)}}n.exports=t},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(A,n,c){const e=A("../../composite-xform"),E=A("./f-ext-xform");n.exports=class extends e{constructor(){super(),this.map={"xm:f":this.fExtXform=new E}}get tag(){return"x14:cfvo"}render(i,Q){i.openNode(this.tag,{type:Q.type}),Q.value!==void 0&&this.fExtXform.render(i,Q.value),i.closeNode()}createNewModel(i){return{type:i.attributes.type}}onParserClose(i,Q){switch(i){case"xm:f":this.model.value=Q.model?parseFloat(Q.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(A,n,c){const e=A("../../composite-xform"),E=A("./sqref-ext-xform"),i=A("./cf-rule-ext-xform");n.exports=class extends e{constructor(){super(),this.map={"xm:sqref":this.sqRef=new E,"x14:cfRule":this.cfRule=new i}}get tag(){return"x14:conditionalFormatting"}prepare(Q,g){Q.rules.forEach(I=>{this.cfRule.prepare(I,g)})}render(Q,g){g.rules.some(i.isExt)&&(Q.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),g.rules.filter(i.isExt).forEach(I=>this.cfRule.render(Q,I)),this.sqRef.render(Q,g.ref),Q.closeNode())}createNewModel(){return{rules:[]}}onParserClose(Q,g){switch(Q){case"xm:sqref":this.model.ref=g.model;break;case"x14:cfRule":this.model.rules.push(g.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(A,n,c){const e=A("../../composite-xform"),E=A("./cf-rule-ext-xform"),i=A("./conditional-formatting-ext-xform");n.exports=class extends e{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new i}}get tag(){return"x14:conditionalFormattings"}hasContent(Q){return Q.hasExtContent===void 0&&(Q.hasExtContent=Q.some(g=>g.rules.some(E.isExt))),Q.hasExtContent}prepare(Q,g){Q.forEach(I=>{this.cfXform.prepare(I,g)})}render(Q,g){this.hasContent(g)&&(Q.openNode(this.tag),g.forEach(I=>this.cfXform.render(Q,I)),Q.closeNode())}createNewModel(){return[]}onParserClose(Q,g){this.model.push(g.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(A,n,c){const e=A("../../base-xform"),E=A("../../composite-xform"),i=A("../../style/color-xform"),Q=A("./cfvo-ext-xform");n.exports=class extends E{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Q,"x14:borderColor":this.borderColorXform=new i("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new i("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new i("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new i("x14:axisColor")}}static isExt(g){return!g.gradient}get tag(){return"x14:dataBar"}render(g,I){g.openNode(this.tag,{minLength:e.toIntAttribute(I.minLength,0,!0),maxLength:e.toIntAttribute(I.maxLength,100,!0),border:e.toBoolAttribute(I.border,!1),gradient:e.toBoolAttribute(I.gradient,!0),negativeBarColorSameAsPositive:e.toBoolAttribute(I.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:e.toBoolAttribute(I.negativeBarBorderColorSameAsPositive,!0),axisPosition:e.toAttribute(I.axisPosition,"auto"),direction:e.toAttribute(I.direction,"leftToRight")}),I.cfvo.forEach(t=>{this.cfvoXform.render(g,t)}),this.borderColorXform.render(g,I.borderColor),this.negativeBorderColorXform.render(g,I.negativeBorderColor),this.negativeFillColorXform.render(g,I.negativeFillColor),this.axisColorXform.render(g,I.axisColor),g.closeNode()}createNewModel(g){let{attributes:I}=g;return{cfvo:[],minLength:e.toIntValue(I.minLength,0),maxLength:e.toIntValue(I.maxLength,100),border:e.toBoolValue(I.border,!1),gradient:e.toBoolValue(I.gradient,!0),negativeBarColorSameAsPositive:e.toBoolValue(I.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:e.toBoolValue(I.negativeBarBorderColorSameAsPositive,!0),axisPosition:e.toStringValue(I.axisPosition,"auto"),direction:e.toStringValue(I.direction,"leftToRight")}}onParserClose(g,I){const[,t]=g.split(":");switch(t){case"cfvo":this.model.cfvo.push(I.model);break;default:this.model[t]=I.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{get tag(){return"xm:f"}render(E,i){E.leafNode(this.tag,null,i)}parseOpen(){this.model=""}parseText(E){this.model+=E}parseClose(E){return E!==this.tag}}},{"../../base-xform":32}],81:[function(A,n,c){const e=A("../../base-xform"),E=A("../../composite-xform"),i=A("./cfvo-ext-xform"),Q=A("./cf-icon-ext-xform");n.exports=class extends E{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new i,"x14:cfIcon":this.cfIconXform=new Q}}get tag(){return"x14:iconSet"}render(g,I){g.openNode(this.tag,{iconSet:e.toStringAttribute(I.iconSet),reverse:e.toBoolAttribute(I.reverse,!1),showValue:e.toBoolAttribute(I.showValue,!0),custom:e.toBoolAttribute(I.icons,!1)}),I.cfvo.forEach(t=>{this.cfvoXform.render(g,t)}),I.icons&&I.icons.forEach((t,B)=>{t.iconId=B,this.cfIconXform.render(g,t)}),g.closeNode()}createNewModel(g){let{attributes:I}=g;return{cfvo:[],iconSet:e.toStringValue(I.iconSet,"3TrafficLights"),reverse:e.toBoolValue(I.reverse,!1),showValue:e.toBoolValue(I.showValue,!0)}}onParserClose(g,I){const[,t]=g.split(":");switch(t){case"cfvo":this.model.cfvo.push(I.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(I.model);break;default:this.model[t]=I.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{get tag(){return"xm:sqref"}render(E,i){E.leafNode(this.tag,null,i)}parseOpen(){this.model=""}parseText(E){this.model+=E}parseClose(E){return E!==this.tag}}},{"../../base-xform":32}],83:[function(A,n,c){const e=A("../../base-xform"),E=A("../../composite-xform"),i=A("../../../../doc/range"),Q=A("./databar-xform"),g=A("./ext-lst-ref-xform"),I=A("./formula-xform"),t=A("./color-scale-xform"),B=A("./icon-set-xform"),C={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},s=o=>{const{type:a,operator:r}=o;switch(a){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:a};default:return{type:a,operator:r}}};class D extends E{constructor(){super(),this.map={dataBar:this.databarXform=new Q,extLst:this.extLstRefXform=new g,formula:this.formulaXform=new I,colorScale:this.colorScaleXform=new t,iconSet:this.iconSetXform=new B}}get tag(){return"cfRule"}static isPrimitive(a){return a.type!=="iconSet"||!a.custom&&!C[a.iconSet]}render(a,r){switch(r.type){case"expression":this.renderExpression(a,r);break;case"cellIs":this.renderCellIs(a,r);break;case"top10":this.renderTop10(a,r);break;case"aboveAverage":this.renderAboveAverage(a,r);break;case"dataBar":this.renderDataBar(a,r);break;case"colorScale":this.renderColorScale(a,r);break;case"iconSet":this.renderIconSet(a,r);break;case"containsText":this.renderText(a,r);break;case"timePeriod":this.renderTimePeriod(a,r)}}renderExpression(a,r){a.openNode(this.tag,{type:"expression",dxfId:r.dxfId,priority:r.priority}),this.formulaXform.render(a,r.formulae[0]),a.closeNode()}renderCellIs(a,r){a.openNode(this.tag,{type:"cellIs",dxfId:r.dxfId,priority:r.priority,operator:r.operator}),r.formulae.forEach(l=>{this.formulaXform.render(a,l)}),a.closeNode()}renderTop10(a,r){a.leafNode(this.tag,{type:"top10",dxfId:r.dxfId,priority:r.priority,percent:e.toBoolAttribute(r.percent,!1),bottom:e.toBoolAttribute(r.bottom,!1),rank:e.toIntValue(r.rank,10,!0)})}renderAboveAverage(a,r){a.leafNode(this.tag,{type:"aboveAverage",dxfId:r.dxfId,priority:r.priority,aboveAverage:e.toBoolAttribute(r.aboveAverage,!0)})}renderDataBar(a,r){a.openNode(this.tag,{type:"dataBar",priority:r.priority}),this.databarXform.render(a,r),this.extLstRefXform.render(a,r),a.closeNode()}renderColorScale(a,r){a.openNode(this.tag,{type:"colorScale",priority:r.priority}),this.colorScaleXform.render(a,r),a.closeNode()}renderIconSet(a,r){D.isPrimitive(r)&&(a.openNode(this.tag,{type:"iconSet",priority:r.priority}),this.iconSetXform.render(a,r),a.closeNode())}renderText(a,r){a.openNode(this.tag,{type:r.operator,dxfId:r.dxfId,priority:r.priority,operator:e.toStringAttribute(r.operator,"containsText")});const l=(R=>{if(R.formulae&&R.formulae[0])return R.formulae[0];const Y=new i(R.ref),{tl:p}=Y;switch(R.operator){case"containsText":return`NOT(ISERROR(SEARCH("${R.text}",${p})))`;case"containsBlanks":return`LEN(TRIM(${p}))=0`;case"notContainsBlanks":return`LEN(TRIM(${p}))>0`;case"containsErrors":return`ISERROR(${p})`;case"notContainsErrors":return`NOT(ISERROR(${p}))`;default:return}})(r);l&&this.formulaXform.render(a,l),a.closeNode()}renderTimePeriod(a,r){a.openNode(this.tag,{type:"timePeriod",dxfId:r.dxfId,priority:r.priority,timePeriod:r.timePeriod});const l=(R=>{if(R.formulae&&R.formulae[0])return R.formulae[0];const Y=new i(R.ref),{tl:p}=Y;switch(R.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${p},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${p},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${p},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${p},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${p},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${p},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${p},1)=TODAY()-1`;case"today":return`FLOOR(${p},1)=TODAY()`;case"tomorrow":return`FLOOR(${p},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${p},1)<=6,FLOOR(${p},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${p})=MONTH(EDATE(TODAY(),0-1)),YEAR(${p})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${p})=MONTH(TODAY()),YEAR(${p})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${p})=MONTH(EDATE(TODAY(),0+1)),YEAR(${p})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(r);l&&this.formulaXform.render(a,l),a.closeNode()}createNewModel(a){let{attributes:r}=a;return{...s(r),dxfId:e.toIntValue(r.dxfId),priority:e.toIntValue(r.priority),timePeriod:r.timePeriod,percent:e.toBoolValue(r.percent),bottom:e.toBoolValue(r.bottom),rank:e.toIntValue(r.rank),aboveAverage:e.toBoolValue(r.aboveAverage)}}onParserClose(a,r){switch(a){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,r.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(r.model)}}}n.exports=D},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{get tag(){return"cfvo"}render(E,i){E.leafNode(this.tag,{type:i.type,val:i.value})}parseOpen(E){this.model={type:E.attributes.type,value:e.toFloatValue(E.attributes.val)}}parseClose(E){return E!==this.tag}}},{"../../base-xform":32}],85:[function(A,n,c){const e=A("../../composite-xform"),E=A("../../style/color-xform"),i=A("./cfvo-xform");n.exports=class extends e{constructor(){super(),this.map={cfvo:this.cfvoXform=new i,color:this.colorXform=new E}}get tag(){return"colorScale"}render(Q,g){Q.openNode(this.tag),g.cfvo.forEach(I=>{this.cfvoXform.render(Q,I)}),g.color.forEach(I=>{this.colorXform.render(Q,I)}),Q.closeNode()}createNewModel(Q){return{cfvo:[],color:[]}}onParserClose(Q,g){this.model[Q].push(g.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(A,n,c){const e=A("../../composite-xform"),E=A("./cf-rule-xform");n.exports=class extends e{constructor(){super(),this.map={cfRule:new E}}get tag(){return"conditionalFormatting"}render(i,Q){Q.rules.some(E.isPrimitive)&&(i.openNode(this.tag,{sqref:Q.ref}),Q.rules.forEach(g=>{E.isPrimitive(g)&&(g.ref=Q.ref,this.map.cfRule.render(i,g))}),i.closeNode())}createNewModel(i){let{attributes:Q}=i;return{ref:Q.sqref,rules:[]}}onParserClose(i,Q){this.model.rules.push(Q.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(A,n,c){const e=A("../../base-xform"),E=A("./conditional-formatting-xform");n.exports=class extends e{constructor(){super(),this.cfXform=new E}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(i,Q){let g=i.reduce((I,t)=>Math.max(I,...t.rules.map(B=>B.priority||0)),1);i.forEach(I=>{I.rules.forEach(t=>{t.priority||(t.priority=g++),t.style&&(t.dxfId=Q.styles.addDxfStyle(t.style))})})}render(i,Q){Q.forEach(g=>{this.cfXform.render(i,g)})}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(i),!0;default:return!1}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(!!this.parser.parseClose(i)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(i,Q){i.forEach(g=>{g.rules.forEach(I=>{I.dxfId!==void 0&&(I.style=Q.styles.getDxfStyle(I.dxfId),delete I.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(A,n,c){const e=A("../../composite-xform"),E=A("../../style/color-xform"),i=A("./cfvo-xform");n.exports=class extends e{constructor(){super(),this.map={cfvo:this.cfvoXform=new i,color:this.colorXform=new E}}get tag(){return"dataBar"}render(Q,g){Q.openNode(this.tag),g.cfvo.forEach(I=>{this.cfvoXform.render(Q,I)}),this.colorXform.render(Q,g.color),Q.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(Q,g){switch(Q){case"cfvo":this.model.cfvo.push(g.model);break;case"color":this.model.color=g.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(A,n,c){const e=A("../../base-xform"),E=A("../../composite-xform");class i extends e{get tag(){return"x14:id"}render(I,t){I.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(I){this.model+=I}parseClose(I){return I!==this.tag}}class Q extends E{constructor(){super(),this.map={"x14:id":this.idXform=new i}}get tag(){return"ext"}render(I,t){I.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(I,t.x14Id),I.closeNode()}createNewModel(){return{}}onParserClose(I,t){this.model.x14Id=t.model}}n.exports=class extends E{constructor(){super(),this.map={ext:new Q}}get tag(){return"extLst"}render(g,I){g.openNode(this.tag),this.map.ext.render(g,I),g.closeNode()}createNewModel(){return{}}onParserClose(g,I){Object.assign(this.model,I.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(A,n,c){const e=A("../../base-xform");n.exports=class extends e{get tag(){return"formula"}render(E,i){E.leafNode(this.tag,null,i)}parseOpen(){this.model=""}parseText(E){this.model+=E}parseClose(E){return E!==this.tag}}},{"../../base-xform":32}],91:[function(A,n,c){const e=A("../../base-xform"),E=A("../../composite-xform"),i=A("./cfvo-xform");n.exports=class extends E{constructor(){super(),this.map={cfvo:this.cfvoXform=new i}}get tag(){return"iconSet"}render(Q,g){Q.openNode(this.tag,{iconSet:e.toStringAttribute(g.iconSet,"3TrafficLights"),reverse:e.toBoolAttribute(g.reverse,!1),showValue:e.toBoolAttribute(g.showValue,!0)}),g.cfvo.forEach(I=>{this.cfvoXform.render(Q,I)}),Q.closeNode()}createNewModel(Q){let{attributes:g}=Q;return{iconSet:e.toStringValue(g.iconSet,"3TrafficLights"),reverse:e.toBoolValue(g.reverse),showValue:e.toBoolValue(g.showValue),cfvo:[]}}onParserClose(Q,g){this.model[Q].push(g.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(A,n,c){const e=A("../../../utils/utils"),E=A("../base-xform");n.exports=class extends E{get tag(){return"col"}prepare(i,Q){const g=Q.styles.addStyleModel(i.style||{});g&&(i.styleId=g)}render(i,Q){i.openNode("col"),i.addAttribute("min",Q.min),i.addAttribute("max",Q.max),Q.width&&i.addAttribute("width",Q.width),Q.styleId&&i.addAttribute("style",Q.styleId),Q.hidden&&i.addAttribute("hidden","1"),Q.bestFit&&i.addAttribute("bestFit","1"),Q.outlineLevel&&i.addAttribute("outlineLevel",Q.outlineLevel),Q.collapsed&&i.addAttribute("collapsed","1"),i.addAttribute("customWidth","1"),i.closeNode()}parseOpen(i){if(i.name==="col"){const Q=this.model={min:parseInt(i.attributes.min||"0",10),max:parseInt(i.attributes.max||"0",10),width:i.attributes.width===void 0?void 0:parseFloat(i.attributes.width||"0")};return i.attributes.style&&(Q.styleId=parseInt(i.attributes.style,10)),e.parseBoolean(i.attributes.hidden)&&(Q.hidden=!0),e.parseBoolean(i.attributes.bestFit)&&(Q.bestFit=!0),i.attributes.outlineLevel&&(Q.outlineLevel=parseInt(i.attributes.outlineLevel,10)),e.parseBoolean(i.attributes.collapsed)&&(Q.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(i,Q){i.styleId&&(i.style=Q.styles.getStyleModel(i.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../../../utils/utils"),i=A("../../../utils/col-cache"),Q=A("../base-xform"),g=A("../../../doc/range");function I(B,C,s,D){const o=C[s];o!==void 0?B[s]=o:D!==void 0&&(B[s]=D)}function t(B,C,s,D){const o=C[s];o!==void 0&&(B[s]=E.parseBoolean(o))}n.exports=class extends Q{get tag(){return"dataValidations"}render(B,C){const s=(function(D){const o=e.map(D,(l,R)=>({address:R,dataValidation:l,marked:!1})).sort((l,R)=>e.strcmp(l.address,R.address)),a=e.keyBy(o,"address"),r=(l,R,Y)=>{for(let p=0;p<R;p++){const x=i.encodeAddress(l.row+p,Y);if(!D[x]||!e.isEqual(D[l.address],D[x]))return!1}return!0};return o.map(l=>{if(!l.marked){const R=i.decodeEx(l.address);if(R.dimensions)return a[R.dimensions].marked=!0,{...l.dataValidation,sqref:l.address};let Y=1,p=i.encodeAddress(R.row+Y,R.col);for(;D[p]&&e.isEqual(l.dataValidation,D[p]);)Y++,p=i.encodeAddress(R.row+Y,R.col);let x=1;for(;r(R,Y,R.col+x);)x++;for(let J=0;J<Y;J++)for(let H=0;H<x;H++)p=i.encodeAddress(R.row+J,R.col+H),a[p].marked=!0;if(Y>1||x>1){const J=R.row+(Y-1),H=R.col+(x-1);return{...l.dataValidation,sqref:`${l.address}:${i.encodeAddress(J,H)}`}}return{...l.dataValidation,sqref:l.address}}return null}).filter(Boolean)})(C);s.length&&(B.openNode("dataValidations",{count:s.length}),s.forEach(D=>{B.openNode("dataValidation"),D.type!=="any"&&(B.addAttribute("type",D.type),D.operator&&D.type!=="list"&&D.operator!=="between"&&B.addAttribute("operator",D.operator),D.allowBlank&&B.addAttribute("allowBlank","1")),D.showInputMessage&&B.addAttribute("showInputMessage","1"),D.promptTitle&&B.addAttribute("promptTitle",D.promptTitle),D.prompt&&B.addAttribute("prompt",D.prompt),D.showErrorMessage&&B.addAttribute("showErrorMessage","1"),D.errorStyle&&B.addAttribute("errorStyle",D.errorStyle),D.errorTitle&&B.addAttribute("errorTitle",D.errorTitle),D.error&&B.addAttribute("error",D.error),B.addAttribute("sqref",D.sqref),(D.formulae||[]).forEach((o,a)=>{B.openNode("formula"+(a+1)),D.type==="date"?B.writeText(E.dateToExcel(new Date(o))):B.writeText(o),B.closeNode()}),B.closeNode()}),B.closeNode())}parseOpen(B){switch(B.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=B.attributes.sqref;const C={type:B.attributes.type||"any",formulae:[]};switch(B.attributes.type&&t(C,B.attributes,"allowBlank"),t(C,B.attributes,"showInputMessage"),t(C,B.attributes,"showErrorMessage"),C.type){case"any":case"list":case"custom":break;default:I(C,B.attributes,"operator","between")}return I(C,B.attributes,"promptTitle"),I(C,B.attributes,"prompt"),I(C,B.attributes,"errorStyle"),I(C,B.attributes,"errorTitle"),I(C,B.attributes,"error"),this._dataValidation=C,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(B){this._formula&&this._formula.push(B)}parseClose(B){switch(B){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(C=>{C.includes(":")?new g(C).forEachAddress(s=>{this.model[s]=this._dataValidation}):this.model[C]=this._dataValidation}),!0;case"formula1":case"formula2":{let C=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":C=parseInt(C,10);break;case"decimal":C=parseFloat(C);break;case"date":C=E.excelToDate(parseFloat(C))}return this._dataValidation.formulae.push(C),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"dimension"}render(E,i){i&&E.leafNode("dimension",{ref:i})}parseOpen(E){return E.name==="dimension"&&(this.model=E.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"drawing"}render(E,i){i&&E.leafNode(this.tag,{"r:id":i.rId})}parseOpen(E){switch(E.name){case this.tag:return this.model={rId:E.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(A,n,c){const e=A("../composite-xform"),E=A("./cf-ext/conditional-formattings-ext-xform");class i extends e{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new E}}get tag(){return"ext"}hasContent(g){return this.conditionalFormattings.hasContent(g.conditionalFormattings)}prepare(g,I){this.conditionalFormattings.prepare(g.conditionalFormattings,I)}render(g,I){g.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(g,I.conditionalFormattings),g.closeNode()}createNewModel(){return{}}onParserClose(g,I){this.model[g]=I.model}}n.exports=class extends e{constructor(){super(),this.map={ext:this.ext=new i}}get tag(){return"extLst"}prepare(Q,g){this.ext.prepare(Q,g)}hasContent(Q){return this.ext.hasContent(Q)}render(Q,g){this.hasContent(g)&&(Q.openNode("extLst"),this.ext.render(Q,g),Q.closeNode())}createNewModel(){return{}}onParserClose(Q,g){Object.assign(this.model,g.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"headerFooter"}render(E,i){if(i){E.addRollback();let Q=!1;E.openNode("headerFooter"),i.differentFirst&&(E.addAttribute("differentFirst","1"),Q=!0),i.differentOddEven&&(E.addAttribute("differentOddEven","1"),Q=!0),i.oddHeader&&typeof i.oddHeader=="string"&&(E.leafNode("oddHeader",null,i.oddHeader),Q=!0),i.oddFooter&&typeof i.oddFooter=="string"&&(E.leafNode("oddFooter",null,i.oddFooter),Q=!0),i.evenHeader&&typeof i.evenHeader=="string"&&(E.leafNode("evenHeader",null,i.evenHeader),Q=!0),i.evenFooter&&typeof i.evenFooter=="string"&&(E.leafNode("evenFooter",null,i.evenFooter),Q=!0),i.firstHeader&&typeof i.firstHeader=="string"&&(E.leafNode("firstHeader",null,i.firstHeader),Q=!0),i.firstFooter&&typeof i.firstFooter=="string"&&(E.leafNode("firstFooter",null,i.firstFooter),Q=!0),Q?(E.closeNode(),E.commit()):E.rollback()}}parseOpen(E){switch(E.name){case"headerFooter":return this.model={},E.attributes.differentFirst&&(this.model.differentFirst=parseInt(E.attributes.differentFirst,0)===1),E.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(E.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(E){switch(this.currentNode){case"oddHeader":this.model.oddHeader=E;break;case"oddFooter":this.model.oddFooter=E;break;case"evenHeader":this.model.evenHeader=E;break;case"evenFooter":this.model.evenFooter=E;break;case"firstHeader":this.model.firstHeader=E;break;case"firstFooter":this.model.firstFooter=E}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"hyperlink"}render(E,i){this.isInternalLink(i)?E.leafNode("hyperlink",{ref:i.address,"r:id":i.rId,tooltip:i.tooltip,location:i.target}):E.leafNode("hyperlink",{ref:i.address,"r:id":i.rId,tooltip:i.tooltip})}parseOpen(E){return E.name==="hyperlink"&&(this.model={address:E.attributes.ref,rId:E.attributes["r:id"],tooltip:E.attributes.tooltip},E.attributes.location&&(this.model.target=E.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(E){return E.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(E.target)}}},{"../base-xform":32}],99:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"mergeCell"}render(E,i){E.leafNode("mergeCell",{ref:i})}parseOpen(E){return E.name==="mergeCell"&&(this.model=E.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../../../doc/range"),i=A("../../../utils/col-cache"),Q=A("../../../doc/enums");n.exports=class{constructor(){this.merges={}}add(g){if(this.merges[g.master])this.merges[g.master].expandToAddress(g.address);else{const I=`${g.master}:${g.address}`;this.merges[g.master]=new E(I)}}get mergeCells(){return e.map(this.merges,g=>g.range)}reconcile(g,I){e.each(g,t=>{const B=i.decode(t);for(let C=B.top;C<=B.bottom;C++){const s=I[C-1];for(let D=B.left;D<=B.right;D++){const o=s.cells[D-1];o?o.type===Q.ValueType.Merge&&(o.master=B.tl):s.cells[D]={type:Q.ValueType.Null,address:i.encodeAddress(C,D)}}}})}getMasterAddress(g){const I=this.hash[g];return I&&I.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(A,n,c){const e=A("../base-xform"),E=i=>i!==void 0;n.exports=class extends e{get tag(){return"outlinePr"}render(i,Q){return!(!Q||!E(Q.summaryBelow)&&!E(Q.summaryRight))&&(i.leafNode(this.tag,{summaryBelow:E(Q.summaryBelow)?Number(Q.summaryBelow):void 0,summaryRight:E(Q.summaryRight)?Number(Q.summaryRight):void 0}),!0)}parseOpen(i){return i.name===this.tag&&(this.model={summaryBelow:E(i.attributes.summaryBelow)?!!Number(i.attributes.summaryBelow):void 0,summaryRight:E(i.attributes.summaryRight)?!!Number(i.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"brk"}render(E,i){E.leafNode("brk",i)}parseOpen(E){return E.name==="brk"&&(this.model=E.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../base-xform");n.exports=class extends E{get tag(){return"pageMargins"}render(i,Q){if(Q){const g={left:Q.left,right:Q.right,top:Q.top,bottom:Q.bottom,header:Q.header,footer:Q.footer};e.some(g,I=>I!==void 0)&&i.leafNode(this.tag,g)}}parseOpen(i){switch(i.name){case this.tag:return this.model={left:parseFloat(i.attributes.left||.7),right:parseFloat(i.attributes.right||.7),top:parseFloat(i.attributes.top||.75),bottom:parseFloat(i.attributes.bottom||.75),header:parseFloat(i.attributes.header||.3),footer:parseFloat(i.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"pageSetUpPr"}render(E,i){return!(!i||!i.fitToPage)&&(E.leafNode(this.tag,{fitToPage:i.fitToPage?"1":void 0}),!0)}parseOpen(E){return E.name===this.tag&&(this.model={fitToPage:E.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../base-xform");function i(t){return t?"1":void 0}function Q(t){switch(t){case"overThenDown":return t;default:return}}function g(t){switch(t){case"atEnd":case"asDisplyed":return t;default:return}}function I(t){switch(t){case"dash":case"blank":case"NA":return t;default:return}}n.exports=class extends E{get tag(){return"pageSetup"}render(t,B){if(B){const C={paperSize:B.paperSize,orientation:B.orientation,horizontalDpi:B.horizontalDpi,verticalDpi:B.verticalDpi,pageOrder:Q(B.pageOrder),blackAndWhite:i(B.blackAndWhite),draft:i(B.draft),cellComments:g(B.cellComments),errors:I(B.errors),scale:B.scale,fitToWidth:B.fitToWidth,fitToHeight:B.fitToHeight,firstPageNumber:B.firstPageNumber,useFirstPageNumber:i(B.firstPageNumber),usePrinterDefaults:i(B.usePrinterDefaults),copies:B.copies};e.some(C,s=>s!==void 0)&&t.leafNode(this.tag,C)}}parseOpen(t){switch(t.name){case this.tag:return this.model={paperSize:(B=t.attributes.paperSize,B!==void 0?parseInt(B,10):void 0),orientation:t.attributes.orientation||"portrait",horizontalDpi:parseInt(t.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(t.attributes.verticalDpi||"4294967295",10),pageOrder:t.attributes.pageOrder||"downThenOver",blackAndWhite:t.attributes.blackAndWhite==="1",draft:t.attributes.draft==="1",cellComments:t.attributes.cellComments||"None",errors:t.attributes.errors||"displayed",scale:parseInt(t.attributes.scale||"100",10),fitToWidth:parseInt(t.attributes.fitToWidth||"1",10),fitToHeight:parseInt(t.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(t.attributes.firstPageNumber||"1",10),useFirstPageNumber:t.attributes.useFirstPageNumber==="1",usePrinterDefaults:t.attributes.usePrinterDefaults==="1",copies:parseInt(t.attributes.copies||"1",10)},!0;default:return!1}var B}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"picture"}render(E,i){i&&E.leafNode(this.tag,{"r:id":i.rId})}parseOpen(E){switch(E.name){case this.tag:return this.model={rId:E.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../base-xform");function i(Q){return Q?"1":void 0}n.exports=class extends E{get tag(){return"printOptions"}render(Q,g){if(g){const I={headings:i(g.showRowColHeaders),gridLines:i(g.showGridLines),horizontalCentered:i(g.horizontalCentered),verticalCentered:i(g.verticalCentered)};e.some(I,t=>t!==void 0)&&Q.leafNode(this.tag,I)}}parseOpen(Q){switch(Q.name){case this.tag:return this.model={showRowColHeaders:Q.attributes.headings==="1",showGridLines:Q.attributes.gridLines==="1",horizontalCentered:Q.attributes.horizontalCentered==="1",verticalCentered:Q.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(A,n,c){const e=A("./page-breaks-xform"),E=A("../list-xform");n.exports=class extends E{constructor(){super({tag:"rowBreaks",count:!0,childXform:new e})}render(i,Q){if(Q&&Q.length){i.openNode(this.tag,this.$),this.count&&(i.addAttribute(this.$count,Q.length),i.addAttribute("manualBreakCount",Q.length));const{childXform:g}=this;Q.forEach(I=>{g.render(i,I)}),i.closeNode()}else this.empty&&i.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(A,n,c){const e=A("../base-xform"),E=A("../../../utils/utils"),i=A("./cell-xform");n.exports=class extends e{constructor(Q){super(),this.maxItems=Q&&Q.maxItems,this.map={c:new i}}get tag(){return"row"}prepare(Q,g){const I=g.styles.addStyleModel(Q.style);I&&(Q.styleId=I);const t=this.map.c;Q.cells.forEach(B=>{t.prepare(B,g)})}render(Q,g,I){Q.openNode("row"),Q.addAttribute("r",g.number),g.height&&(Q.addAttribute("ht",g.height),Q.addAttribute("customHeight","1")),g.hidden&&Q.addAttribute("hidden","1"),g.min>0&&g.max>0&&g.min<=g.max&&Q.addAttribute("spans",`${g.min}:${g.max}`),g.styleId&&(Q.addAttribute("s",g.styleId),Q.addAttribute("customFormat","1")),Q.addAttribute("x14ac:dyDescent","0.25"),g.outlineLevel&&Q.addAttribute("outlineLevel",g.outlineLevel),g.collapsed&&Q.addAttribute("collapsed","1");const t=this.map.c;g.cells.forEach(B=>{t.render(Q,B,I)}),Q.closeNode()}parseOpen(Q){if(this.parser)return this.parser.parseOpen(Q),!0;if(Q.name==="row"){this.numRowsSeen+=1;const g=Q.attributes.spans?Q.attributes.spans.split(":").map(t=>parseInt(t,10)):[void 0,void 0],I=this.model={number:parseInt(Q.attributes.r,10),min:g[0],max:g[1],cells:[]};return Q.attributes.s&&(I.styleId=parseInt(Q.attributes.s,10)),E.parseBoolean(Q.attributes.hidden)&&(I.hidden=!0),E.parseBoolean(Q.attributes.bestFit)&&(I.bestFit=!0),Q.attributes.ht&&(I.height=parseFloat(Q.attributes.ht)),Q.attributes.outlineLevel&&(I.outlineLevel=parseInt(Q.attributes.outlineLevel,10)),E.parseBoolean(Q.attributes.collapsed)&&(I.collapsed=!0),!0}return this.parser=this.map[Q.name],!!this.parser&&(this.parser.parseOpen(Q),!0)}parseText(Q){this.parser&&this.parser.parseText(Q)}parseClose(Q){if(this.parser){if(!this.parser.parseClose(Q)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(Q,g){Q.style=Q.styleId?g.styles.getStyleModel(Q.styleId):{},Q.styleId!==void 0&&(Q.styleId=void 0);const I=this.map.c;Q.cells.forEach(t=>{I.reconcile(t,g)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../base-xform");n.exports=class extends E{get tag(){return"sheetFormatPr"}render(i,Q){if(Q){const g={defaultRowHeight:Q.defaultRowHeight,outlineLevelRow:Q.outlineLevelRow,outlineLevelCol:Q.outlineLevelCol,"x14ac:dyDescent":Q.dyDescent};Q.defaultColWidth&&(g.defaultColWidth=Q.defaultColWidth),Q.defaultRowHeight&&Q.defaultRowHeight===15||(g.customHeight="1"),e.some(g,I=>I!==void 0)&&i.leafNode("sheetFormatPr",g)}}parseOpen(i){return i.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(i.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(i.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(i.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(i.attributes.outlineLevelCol||"0",10)},i.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(i.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(A,n,c){const e=A("../base-xform"),E=A("../style/color-xform"),i=A("./page-setup-properties-xform"),Q=A("./outline-properties-xform");n.exports=class extends e{constructor(){super(),this.map={tabColor:new E("tabColor"),pageSetUpPr:new i,outlinePr:new Q}}get tag(){return"sheetPr"}render(g,I){if(I){g.addRollback(),g.openNode("sheetPr");let t=!1;t=this.map.tabColor.render(g,I.tabColor)||t,t=this.map.pageSetUpPr.render(g,I.pageSetup)||t,t=this.map.outlinePr.render(g,I.outlineProperties)||t,t?(g.closeNode(),g.commit()):g.rollback()}}parseOpen(g){return this.parser?(this.parser.parseOpen(g),!0):g.name===this.tag?(this.reset(),!0):!!this.map[g.name]&&(this.parser=this.map[g.name],this.parser.parseOpen(g),!0)}parseText(g){return!!this.parser&&(this.parser.parseText(g),!0)}parseClose(g){return this.parser?(this.parser.parseClose(g)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../base-xform");function i(g,I){return g?I:void 0}function Q(g,I){return g===I||void 0}n.exports=class extends E{get tag(){return"sheetProtection"}render(g,I){if(I){const t={sheet:i(I.sheet,"1"),selectLockedCells:I.selectLockedCells===!1?"1":void 0,selectUnlockedCells:I.selectUnlockedCells===!1?"1":void 0,formatCells:i(I.formatCells,"0"),formatColumns:i(I.formatColumns,"0"),formatRows:i(I.formatRows,"0"),insertColumns:i(I.insertColumns,"0"),insertRows:i(I.insertRows,"0"),insertHyperlinks:i(I.insertHyperlinks,"0"),deleteColumns:i(I.deleteColumns,"0"),deleteRows:i(I.deleteRows,"0"),sort:i(I.sort,"0"),autoFilter:i(I.autoFilter,"0"),pivotTables:i(I.pivotTables,"0")};I.sheet&&(t.algorithmName=I.algorithmName,t.hashValue=I.hashValue,t.saltValue=I.saltValue,t.spinCount=I.spinCount,t.objects=i(I.objects===!1,"1"),t.scenarios=i(I.scenarios===!1,"1")),e.some(t,B=>B!==void 0)&&g.leafNode(this.tag,t)}}parseOpen(g){switch(g.name){case this.tag:return this.model={sheet:Q(g.attributes.sheet,"1"),objects:g.attributes.objects!=="1"&&void 0,scenarios:g.attributes.scenarios!=="1"&&void 0,selectLockedCells:g.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:g.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:Q(g.attributes.formatCells,"0"),formatColumns:Q(g.attributes.formatColumns,"0"),formatRows:Q(g.attributes.formatRows,"0"),insertColumns:Q(g.attributes.insertColumns,"0"),insertRows:Q(g.attributes.insertRows,"0"),insertHyperlinks:Q(g.attributes.insertHyperlinks,"0"),deleteColumns:Q(g.attributes.deleteColumns,"0"),deleteRows:Q(g.attributes.deleteRows,"0"),sort:Q(g.attributes.sort,"0"),autoFilter:Q(g.attributes.autoFilter,"0"),pivotTables:Q(g.attributes.pivotTables,"0")},g.attributes.algorithmName&&(this.model.algorithmName=g.attributes.algorithmName,this.model.hashValue=g.attributes.hashValue,this.model.saltValue=g.attributes.saltValue,this.model.spinCount=parseInt(g.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(A,n,c){const e=A("../../../utils/col-cache"),E=A("../base-xform"),i={frozen:"frozen",frozenSplit:"frozen",split:"split"};n.exports=class extends E{get tag(){return"sheetView"}prepare(Q){switch(Q.state){case"frozen":case"split":break;default:Q.state="normal"}}render(Q,g){Q.openNode("sheetView",{workbookViewId:g.workbookViewId||0});const I=function(D,o,a){a&&Q.addAttribute(D,o)};let t,B,C,s;switch(I("rightToLeft","1",g.rightToLeft===!0),I("tabSelected","1",g.tabSelected),I("showRuler","0",g.showRuler===!1),I("showRowColHeaders","0",g.showRowColHeaders===!1),I("showGridLines","0",g.showGridLines===!1),I("zoomScale",g.zoomScale,g.zoomScale),I("zoomScaleNormal",g.zoomScaleNormal,g.zoomScaleNormal),I("view",g.style,g.style),g.state){case"frozen":B=g.xSplit||0,C=g.ySplit||0,t=g.topLeftCell||e.getAddress(C+1,B+1).address,s=(g.xSplit&&g.ySplit?"bottomRight":g.xSplit&&"topRight")||"bottomLeft",Q.leafNode("pane",{xSplit:g.xSplit||void 0,ySplit:g.ySplit||void 0,topLeftCell:t,activePane:s,state:"frozen"}),Q.leafNode("selection",{pane:s,activeCell:g.activeCell,sqref:g.activeCell});break;case"split":g.activePane==="topLeft"&&(g.activePane=void 0),Q.leafNode("pane",{xSplit:g.xSplit||void 0,ySplit:g.ySplit||void 0,topLeftCell:g.topLeftCell,activePane:g.activePane}),Q.leafNode("selection",{pane:g.activePane,activeCell:g.activeCell,sqref:g.activeCell});break;case"normal":g.activeCell&&Q.leafNode("selection",{activeCell:g.activeCell,sqref:g.activeCell})}Q.closeNode()}parseOpen(Q){switch(Q.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(Q.attributes.workbookViewId,10),rightToLeft:Q.attributes.rightToLeft==="1",tabSelected:Q.attributes.tabSelected==="1",showRuler:Q.attributes.showRuler!=="0",showRowColHeaders:Q.attributes.showRowColHeaders!=="0",showGridLines:Q.attributes.showGridLines!=="0",zoomScale:parseInt(Q.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(Q.attributes.zoomScaleNormal||"100",10),style:Q.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(Q.attributes.xSplit||"0",10),ySplit:parseInt(Q.attributes.ySplit||"0",10),topLeftCell:Q.attributes.topLeftCell,activePane:Q.attributes.activePane||"topLeft",state:Q.attributes.state},!0;case"selection":{const g=Q.attributes.pane||"topLeft";return this.selections[g]={pane:g,activeCell:Q.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(Q){let g,I;switch(Q){case"sheetView":return this.sheetView&&this.pane?(g=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:i[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(g.activePane=this.pane.activePane),I=this.selections[this.pane.activePane],I&&I.activeCell&&(g.activeCell=I.activeCell),this.sheetView.style&&(g.style=this.sheetView.style)):(g=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},I=this.selections.topLeft,I&&I.activeCell&&(g.activeCell=I.activeCell),this.sheetView.style&&(g.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"tablePart"}render(E,i){i&&E.leafNode(this.tag,{"r:id":i.rId})}parseOpen(E){switch(E.name){case this.tag:return this.model={rId:E.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../../../utils/col-cache"),i=A("../../../utils/xml-stream"),Q=A("../../rel-type"),g=A("./merges"),I=A("../base-xform"),t=A("../list-xform"),B=A("./row-xform"),C=A("./col-xform"),s=A("./dimension-xform"),D=A("./hyperlink-xform"),o=A("./merge-cell-xform"),a=A("./data-validations-xform"),r=A("./sheet-properties-xform"),l=A("./sheet-format-properties-xform"),R=A("./sheet-view-xform"),Y=A("./sheet-protection-xform"),p=A("./page-margins-xform"),x=A("./page-setup-xform"),J=A("./print-options-xform"),H=A("./auto-filter-xform"),b=A("./picture-xform"),O=A("./drawing-xform"),m=A("./table-part-xform"),F=A("./row-breaks-xform"),u=A("./header-footer-xform"),G=A("./cf/conditional-formattings-xform"),w=A("./ext-lst-xform"),h=(y,k)=>{if(!k||!k.length)return y;if(!y||!y.length)return k;const L={},K={};return y.forEach(v=>{L[v.ref]=v,v.rules.forEach(T=>{const{x14Id:P}=T;P&&(K[P]=T)})}),k.forEach(v=>{v.rules.forEach(T=>{const P=K[T.x14Id];P?((S,Z)=>{Object.keys(Z).forEach(U=>{const f=S[U],q=Z[U];f===void 0&&q!==void 0&&(S[U]=q)})})(P,T):L[v.ref]?L[v.ref].rules.push(T):y.push({ref:v.ref,rules:[T]})})}),y};class M extends I{constructor(k){super();const{maxRows:L,maxCols:K,ignoreNodes:v}=k||{};this.ignoreNodes=v||[],this.map={sheetPr:new r,dimension:new s,sheetViews:new t({tag:"sheetViews",count:!1,childXform:new R}),sheetFormatPr:new l,cols:new t({tag:"cols",count:!1,childXform:new C}),sheetData:new t({tag:"sheetData",count:!1,empty:!0,childXform:new B({maxItems:K}),maxItems:L}),autoFilter:new H,mergeCells:new t({tag:"mergeCells",count:!0,childXform:new o}),rowBreaks:new F,hyperlinks:new t({tag:"hyperlinks",count:!1,childXform:new D}),pageMargins:new p,dataValidations:new a,pageSetup:new x,headerFooter:new u,printOptions:new J,picture:new b,drawing:new O,sheetProtection:new Y,tableParts:new t({tag:"tableParts",count:!0,childXform:new m}),conditionalFormatting:new G,extLst:new w}}prepare(k,L){L.merges=new g,k.hyperlinks=L.hyperlinks=[],k.comments=L.comments=[],L.formulae={},L.siFormulae=0,this.map.cols.prepare(k.cols,L),this.map.sheetData.prepare(k.rows,L),this.map.conditionalFormatting.prepare(k.conditionalFormattings,L),k.mergeCells=L.merges.mergeCells;const K=k.rels=[];function v(S){return"rId"+(S.length+1)}if(k.hyperlinks.forEach(S=>{const Z=v(K);S.rId=Z,K.push({Id:Z,Type:Q.Hyperlink,Target:S.target,TargetMode:"External"})}),k.comments.length>0){const S={Id:v(K),Type:Q.Comments,Target:`../comments${k.id}.xml`};K.push(S);const Z={Id:v(K),Type:Q.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};K.push(Z),k.comments.forEach(U=>{U.refAddress=E.decodeAddress(U.ref)}),L.commentRefs.push({commentName:"comments"+k.id,vmlDrawing:"vmlDrawing"+k.id})}const T=[];let P;k.media.forEach(S=>{if(S.type==="background"){const Z=v(K);P=L.media[S.imageId],K.push({Id:Z,Type:Q.Image,Target:`../media/${P.name}.${P.extension}`}),k.background={rId:Z},k.image=L.media[S.imageId]}else if(S.type==="image"){let{drawing:Z}=k;P=L.media[S.imageId],Z||(Z=k.drawing={rId:v(K),name:"drawing"+ ++L.drawingsCount,anchors:[],rels:[]},L.drawings.push(Z),K.push({Id:Z.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${Z.name}.xml`}));let U=this.preImageId===S.imageId?T[S.imageId]:T[Z.rels.length];U||(U=v(Z.rels),T[Z.rels.length]=U,Z.rels.push({Id:U,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${P.name}.${P.extension}`}));const f={picture:{rId:U},range:S.range};if(S.hyperlinks&&S.hyperlinks.hyperlink){const q=v(Z.rels);T[Z.rels.length]=q,f.picture.hyperlinks={tooltip:S.hyperlinks.tooltip,rId:q},Z.rels.push({Id:q,Type:Q.Hyperlink,Target:S.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=S.imageId,Z.anchors.push(f)}}),k.tables.forEach(S=>{const Z=v(K);S.rId=Z,K.push({Id:Z,Type:Q.Table,Target:"../tables/"+S.target}),S.columns.forEach(U=>{const{style:f}=U;f&&(U.dxfId=L.styles.addDxfStyle(f))})}),this.map.extLst.prepare(k,L)}render(k,L){k.openXml(i.StdDocAttributes),k.openNode("worksheet",M.WORKSHEET_ATTRIBUTES);const K=L.properties?{defaultRowHeight:L.properties.defaultRowHeight,dyDescent:L.properties.dyDescent,outlineLevelCol:L.properties.outlineLevelCol,outlineLevelRow:L.properties.outlineLevelRow}:void 0;L.properties&&L.properties.defaultColWidth&&(K.defaultColWidth=L.properties.defaultColWidth);const v={outlineProperties:L.properties&&L.properties.outlineProperties,tabColor:L.properties&&L.properties.tabColor,pageSetup:L.pageSetup&&L.pageSetup.fitToPage?{fitToPage:L.pageSetup.fitToPage}:void 0},T=L.pageSetup&&L.pageSetup.margins,P={showRowColHeaders:L.pageSetup&&L.pageSetup.showRowColHeaders,showGridLines:L.pageSetup&&L.pageSetup.showGridLines,horizontalCentered:L.pageSetup&&L.pageSetup.horizontalCentered,verticalCentered:L.pageSetup&&L.pageSetup.verticalCentered},S=L.sheetProtection;this.map.sheetPr.render(k,v),this.map.dimension.render(k,L.dimensions),this.map.sheetViews.render(k,L.views),this.map.sheetFormatPr.render(k,K),this.map.cols.render(k,L.cols),this.map.sheetData.render(k,L.rows),this.map.sheetProtection.render(k,S),this.map.autoFilter.render(k,L.autoFilter),this.map.mergeCells.render(k,L.mergeCells),this.map.conditionalFormatting.render(k,L.conditionalFormattings),this.map.dataValidations.render(k,L.dataValidations),this.map.hyperlinks.render(k,L.hyperlinks),this.map.printOptions.render(k,P),this.map.pageMargins.render(k,T),this.map.pageSetup.render(k,L.pageSetup),this.map.headerFooter.render(k,L.headerFooter),this.map.rowBreaks.render(k,L.rowBreaks),this.map.drawing.render(k,L.drawing),this.map.picture.render(k,L.background),this.map.tableParts.render(k,L.tables),this.map.extLst.render(k,L),L.rels&&L.rels.forEach(Z=>{Z.Type===Q.VmlDrawing&&k.leafNode("legacyDrawing",{"r:id":Z.Id})}),k.closeNode()}parseOpen(k){return this.parser?(this.parser.parseOpen(k),!0):k.name==="worksheet"?(e.each(this.map,L=>{L.reset()}),!0):(this.map[k.name]&&!this.ignoreNodes.includes(k.name)&&(this.parser=this.map[k.name],this.parser.parseOpen(k)),!0)}parseText(k){this.parser&&this.parser.parseText(k)}parseClose(k){if(this.parser)return this.parser.parseClose(k)||(this.parser=void 0),!0;switch(k){case"worksheet":{const L=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(L.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(L.outlineProperties=this.map.sheetPr.model.outlineProperties);const K={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},v=Object.assign(K,this.map.pageSetup.model,this.map.printOptions.model),T=h(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:L,views:this.map.sheetViews.model,pageSetup:v,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:T},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(k,L){const K=(k.relationships||[]).reduce((T,P)=>{if(T[P.Id]=P,P.Type===Q.Comments&&(k.comments=L.comments[P.Target].comments),P.Type===Q.VmlDrawing&&k.comments&&k.comments.length){const S=L.vmlDrawings[P.Target].comments;k.comments.forEach((Z,U)=>{Z.note=Object.assign({},Z.note,S[U])})}return T},{});if(L.commentsMap=(k.comments||[]).reduce((T,P)=>(P.ref&&(T[P.ref]=P),T),{}),L.hyperlinkMap=(k.hyperlinks||[]).reduce((T,P)=>(P.rId&&(T[P.address]=K[P.rId].Target),T),{}),L.formulae={},k.rows=k.rows&&k.rows.filter(Boolean)||[],k.rows.forEach(T=>{T.cells=T.cells&&T.cells.filter(Boolean)||[]}),this.map.cols.reconcile(k.cols,L),this.map.sheetData.reconcile(k.rows,L),this.map.conditionalFormatting.reconcile(k.conditionalFormattings,L),k.media=[],k.drawing){const T=K[k.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(T){const P=T[1];L.drawings[P].anchors.forEach(S=>{if(S.medium){const Z={type:"image",imageId:S.medium.index,range:S.range,hyperlinks:S.picture.hyperlinks};k.media.push(Z)}})}}const v=k.background&&K[k.background.rId];if(v){const T=v.Target.split("/media/")[1],P=L.mediaIndex&&L.mediaIndex[T];P!==void 0&&k.media.push({type:"background",imageId:P})}k.tables=(k.tables||[]).map(T=>{const P=K[T.rId];return L.tables[P.Target]}),delete k.relationships,delete k.hyperlinks,delete k.comments}}M.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},n.exports=M},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.attr=E.attr}render(E,i){i&&(E.openNode(this.tag),E.closeNode())}parseOpen(E){E.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.attr=E.attr,this.attrs=E.attrs,this._format=E.format||function(i){try{return Number.isNaN(i.getTime())?"":i.toISOString()}catch{return""}},this._parse=E.parse||function(i){return new Date(i)}}render(E,i){i&&(E.openNode(this.tag),this.attrs&&E.addAttributes(this.attrs),this.attr?E.addAttribute(this.attr,this._format(i)):E.writeText(this._format(i)),E.closeNode())}parseOpen(E){E.name===this.tag&&(this.attr?this.model=this._parse(E.attributes[this.attr]):this.text=[])}parseText(E){this.attr||this.text.push(E)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.attr=E.attr,this.attrs=E.attrs,this.zero=E.zero}render(E,i){(i||this.zero)&&(E.openNode(this.tag),this.attrs&&E.addAttributes(this.attrs),this.attr?E.addAttribute(this.attr,i):E.writeText(i),E.closeNode())}parseOpen(E){return E.name===this.tag&&(this.attr?this.model=parseInt(E.attributes[this.attr],10):this.text=[],!0)}parseText(E){this.attr||this.text.push(E)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.tag=E.tag,this.attr=E.attr,this.attrs=E.attrs}render(E,i){i!==void 0&&(E.openNode(this.tag),this.attrs&&E.addAttributes(this.attrs),this.attr?E.addAttribute(this.attr,i):E.writeText(i),E.closeNode())}parseOpen(E){E.name===this.tag&&(this.attr?this.model=E.attributes[this.attr]:this.text=[])}parseText(E){this.attr||this.text.push(E)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(A,n,c){const e=A("./base-xform"),E=A("../../utils/xml-stream");n.exports=class extends e{constructor(i){super(),this._model=i}render(i){if(!this._xml){const Q=new E;(function g(I,t){I.openNode(t.tag,t.$),t.c&&t.c.forEach(B=>{g(I,B)}),t.t&&I.writeText(t.t),I.closeNode()})(Q,this._model),this._xml=Q.xml}i.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(i){switch(i){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(A,n,c){const e=A("./text-xform"),E=A("./rich-text-xform"),i=A("../base-xform");n.exports=class extends i{constructor(){super(),this.map={r:new E,t:new e}}get tag(){return"rPh"}render(Q,g){if(Q.openNode(this.tag,{sb:g.sb||0,eb:g.eb||0}),g&&g.hasOwnProperty("richText")&&g.richText){const{r:I}=this.map;g.richText.forEach(t=>{I.render(Q,t)})}else g&&this.map.t.render(Q,g.text);Q.closeNode()}parseOpen(Q){const{name:g}=Q;return this.parser?(this.parser.parseOpen(Q),!0):g===this.tag?(this.model={sb:parseInt(Q.attributes.sb,10),eb:parseInt(Q.attributes.eb,10)},!0):(this.parser=this.map[g],!!this.parser&&(this.parser.parseOpen(Q),!0))}parseText(Q){this.parser&&this.parser.parseText(Q)}parseClose(Q){if(this.parser){if(!this.parser.parseClose(Q)){switch(Q){case"r":{let g=this.model.richText;g||(g=this.model.richText=[]),g.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(Q){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(A,n,c){const e=A("./text-xform"),E=A("../style/font-xform"),i=A("../base-xform");class Q extends i{constructor(I){super(),this.model=I}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new e)}get fontXform(){return this._fontXform||(this._fontXform=new E(Q.FONT_OPTIONS))}render(I,t){t=t||this.model,I.openNode("r"),t.font&&this.fontXform.render(I,t.font),this.textXform.render(I,t.text),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(I),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(I),!0;default:return!1}}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){switch(I){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(I),!0}}}Q.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},n.exports=Q},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(A,n,c){const e=A("./text-xform"),E=A("./rich-text-xform"),i=A("./phonetic-text-xform"),Q=A("../base-xform");n.exports=class extends Q{constructor(g){super(),this.model=g,this.map={r:new E,t:new e,rPh:new i}}get tag(){return"si"}render(g,I){g.openNode(this.tag),I&&I.hasOwnProperty("richText")&&I.richText?I.richText.length?I.richText.forEach(t=>{this.map.r.render(g,t)}):this.map.t.render(g,""):I!=null&&this.map.t.render(g,I),g.closeNode()}parseOpen(g){const{name:I}=g;return this.parser?(this.parser.parseOpen(g),!0):I===this.tag?(this.model={},!0):(this.parser=this.map[I],!!this.parser&&(this.parser.parseOpen(g),!0))}parseText(g){this.parser&&this.parser.parseText(g)}parseClose(g){if(this.parser){if(!this.parser.parseClose(g)){switch(g){case"r":{let I=this.model.richText;I||(I=this.model.richText=[]),I.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(g){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("./shared-string-xform");n.exports=class extends E{constructor(Q){super(),this.model=Q||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new i)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(Q){return this.model.values[Q]}add(Q){return Q.richText?this.addRichText(Q):this.addText(Q)}addText(Q){let g=this.hash[Q];return g===void 0&&(g=this.hash[Q]=this.model.values.length,this.model.values.push(Q)),this.model.count++,g}addRichText(Q){const g=this.sharedStringXform.toXml(Q);let I=this.rich[g];return I===void 0&&(I=this.rich[g]=this.model.values.length,this.model.values.push(Q)),this.model.count++,I}render(Q,g){g=g||this._values,Q.openXml(e.StdDocAttributes),Q.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:g.count,uniqueCount:g.values.length});const I=this.sharedStringXform;g.values.forEach(t=>{I.render(Q,t)}),Q.closeNode()}parseOpen(Q){if(this.parser)return this.parser.parseOpen(Q),!0;switch(Q.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(Q),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(Q))}}parseText(Q){this.parser&&this.parser.parseText(Q)}parseClose(Q){if(this.parser)return this.parser.parseClose(Q)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(Q){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+Q)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"t"}render(E,i){E.openNode("t"),/^\s|\n|\s$/.test(i)&&E.addAttribute("xml:space","preserve"),E.writeText(i),E.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(E,i)=>String.fromCharCode(parseInt(i,16)))}parseOpen(E){switch(E.name){case"t":return this._text=[],!0;default:return!1}}parseText(E){this._text.push(E)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(A,n,c){const e=A("../../../doc/enums"),E=A("../../../utils/utils"),i=A("../base-xform"),Q={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((I,t)=>(I[t]=!0,I),{}),horizontal(I){return this.horizontalValues[I]?I:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((I,t)=>(I[t]=!0,I),{}),vertical(I){return I==="middle"?"center":this.verticalValues[I]?I:void 0},wrapText:I=>!!I||void 0,shrinkToFit:I=>!!I||void 0,textRotation(I){switch(I){case"vertical":return I;default:return(I=E.validInt(I))>=-90&&I<=90?I:void 0}},indent:I=>(I=E.validInt(I),Math.max(0,I)),readingOrder(I){switch(I){case"ltr":return e.ReadingOrder.LeftToRight;case"rtl":return e.ReadingOrder.RightToLeft;default:return}}},g={toXml(I){if(I=Q.textRotation(I)){if(I==="vertical")return 255;const t=Math.round(I);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(I){const t=E.validInt(I);if(t!==void 0){if(t===255)return"vertical";if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};n.exports=class extends i{get tag(){return"alignment"}render(I,t){I.addRollback(),I.openNode("alignment");let B=!1;function C(s,D){D&&(I.addAttribute(s,D),B=!0)}C("horizontal",Q.horizontal(t.horizontal)),C("vertical",Q.vertical(t.vertical)),C("wrapText",!!Q.wrapText(t.wrapText)&&"1"),C("shrinkToFit",!!Q.shrinkToFit(t.shrinkToFit)&&"1"),C("indent",Q.indent(t.indent)),C("textRotation",g.toXml(t.textRotation)),C("readingOrder",Q.readingOrder(t.readingOrder)),I.closeNode(),B?I.commit():I.rollback()}parseOpen(I){const t={};let B=!1;function C(s,D,o){s&&(t[D]=o,B=!0)}C(I.attributes.horizontal,"horizontal",I.attributes.horizontal),C(I.attributes.vertical,"vertical",I.attributes.vertical==="center"?"middle":I.attributes.vertical),C(I.attributes.wrapText,"wrapText",E.parseBoolean(I.attributes.wrapText)),C(I.attributes.shrinkToFit,"shrinkToFit",E.parseBoolean(I.attributes.shrinkToFit)),C(I.attributes.indent,"indent",parseInt(I.attributes.indent,10)),C(I.attributes.textRotation,"textRotation",g.toModel(I.attributes.textRotation)),C(I.attributes.readingOrder,"readingOrder",I.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=B?t:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(A,n,c){const e=A("../base-xform"),E=A("../../../utils/utils"),i=A("./color-xform");class Q extends e{constructor(I){super(),this.name=I,this.map={color:new i}}get tag(){return this.name}render(I,t,B){const C=t&&t.color||B||this.defaultColor;I.openNode(this.name),t&&t.style&&(I.addAttribute("style",t.style),C&&this.map.color.render(I,C)),I.closeNode()}parseOpen(I){if(this.parser)return this.parser.parseOpen(I),!0;switch(I.name){case this.name:{const{style:t}=I.attributes;return this.model=t?{style:t}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(I),!0;default:return!1}}parseText(I){this.parser&&this.parser.parseText(I)}parseClose(I){return this.parser?(this.parser.parseClose(I)||(this.parser=void 0),!0):(I===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(I){return Q.validStyleValues[I]}}Q.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((g,I)=>(g[I]=!0,g),{}),n.exports=class extends e{constructor(){super(),this.map={top:new Q("top"),left:new Q("left"),bottom:new Q("bottom"),right:new Q("right"),diagonal:new Q("diagonal")}}render(g,I){const{color:t}=I;function B(C,s){C&&!C.color&&I.color&&(C={...C,color:I.color}),s.render(g,C,t)}g.openNode("border"),I.diagonal&&I.diagonal.style&&(I.diagonal.up&&g.addAttribute("diagonalUp","1"),I.diagonal.down&&g.addAttribute("diagonalDown","1")),B(I.left,this.map.left),B(I.right,this.map.right),B(I.top,this.map.top),B(I.bottom,this.map.bottom),B(I.diagonal,this.map.diagonal),g.closeNode()}parseOpen(g){if(this.parser)return this.parser.parseOpen(g),!0;switch(g.name){case"border":return this.reset(),this.diagonalUp=E.parseBoolean(g.attributes.diagonalUp),this.diagonalDown=E.parseBoolean(g.attributes.diagonalDown),!0;default:return this.parser=this.map[g.name],!!this.parser&&(this.parser.parseOpen(g),!0)}}parseText(g){this.parser&&this.parser.parseText(g)}parseClose(g){if(this.parser)return this.parser.parseClose(g)||(this.parser=void 0),!0;if(g==="border"){const I=this.model={},t=function(B,C,s){C&&(s&&Object.assign(C,s),I[B]=C)};t("left",this.map.left.model),t("right",this.map.right.model),t("top",this.map.top.model),t("bottom",this.map.bottom.model),t("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{constructor(E){super(),this.name=E||"color"}get tag(){return this.name}render(E,i){return!!i&&(E.openNode(this.name),i.argb?E.addAttribute("rgb",i.argb):i.theme!==void 0?(E.addAttribute("theme",i.theme),i.tint!==void 0&&E.addAttribute("tint",i.tint)):i.indexed!==void 0?E.addAttribute("indexed",i.indexed):E.addAttribute("auto","1"),E.closeNode(),!0)}parseOpen(E){return E.name===this.name&&(E.attributes.rgb?this.model={argb:E.attributes.rgb}:E.attributes.theme?(this.model={theme:parseInt(E.attributes.theme,10)},E.attributes.tint&&(this.model.tint=parseFloat(E.attributes.tint))):E.attributes.indexed?this.model={indexed:parseInt(E.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(A,n,c){const e=A("../base-xform"),E=A("./alignment-xform"),i=A("./border-xform"),Q=A("./fill-xform"),g=A("./font-xform"),I=A("./numfmt-xform"),t=A("./protection-xform");n.exports=class extends e{constructor(){super(),this.map={alignment:new E,border:new i,fill:new Q,font:new g,numFmt:new I,protection:new t}}get tag(){return"dxf"}render(B,C){if(B.openNode(this.tag),C.font&&this.map.font.render(B,C.font),C.numFmt&&C.numFmtId){const s={id:C.numFmtId,formatCode:C.numFmt};this.map.numFmt.render(B,s)}C.fill&&this.map.fill.render(B,C.fill),C.alignment&&this.map.alignment.render(B,C.alignment),C.border&&this.map.border.render(B,C.border),C.protection&&this.map.protection.render(B,C.protection),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[B.name],this.parser&&this.parser.parseOpen(B),!0}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){return this.parser?(this.parser.parseClose(B)||(this.parser=void 0),!0):B!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(A,n,c){const e=A("../base-xform"),E=A("./color-xform");class i extends e{constructor(){super(),this.map={color:new E}}get tag(){return"stop"}render(B,C){B.openNode("stop"),B.addAttribute("position",C.position),this.map.color.render(B,C.color),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"stop":return this.model={position:parseFloat(B.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(B),!0;default:return!1}}parseText(){}parseClose(B){return!!this.parser&&(this.parser.parseClose(B)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class Q extends e{constructor(){super(),this.map={fgColor:new E("fgColor"),bgColor:new E("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(B,C){B.openNode("patternFill"),B.addAttribute("patternType",C.pattern),C.fgColor&&this.map.fgColor.render(B,C.fgColor),C.bgColor&&this.map.bgColor.render(B,C.bgColor),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"patternFill":return this.model={type:"pattern",pattern:B.attributes.patternType},!0;default:return this.parser=this.map[B.name],!!this.parser&&(this.parser.parseOpen(B),!0)}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){return!!this.parser&&(this.parser.parseClose(B)||(this.parser.model&&(this.model[B]=this.parser.model),this.parser=void 0),!0)}}class g extends e{constructor(){super(),this.map={stop:new i}}get name(){return"gradient"}get tag(){return"gradientFill"}render(B,C){switch(B.openNode("gradientFill"),C.gradient){case"angle":B.addAttribute("degree",C.degree);break;case"path":B.addAttribute("type","path"),C.center.left&&(B.addAttribute("left",C.center.left),C.center.right===void 0&&B.addAttribute("right",C.center.left)),C.center.right&&B.addAttribute("right",C.center.right),C.center.top&&(B.addAttribute("top",C.center.top),C.center.bottom===void 0&&B.addAttribute("bottom",C.center.top)),C.center.bottom&&B.addAttribute("bottom",C.center.bottom)}const s=this.map.stop;C.stops.forEach(D=>{s.render(B,D)}),B.closeNode()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"gradientFill":{const C=this.model={stops:[]};return B.attributes.degree?(C.gradient="angle",C.degree=parseInt(B.attributes.degree,10)):B.attributes.type==="path"&&(C.gradient="path",C.center={left:B.attributes.left?parseFloat(B.attributes.left):0,top:B.attributes.top?parseFloat(B.attributes.top):0},B.attributes.right!==B.attributes.left&&(C.center.right=B.attributes.right?parseFloat(B.attributes.right):0),B.attributes.bottom!==B.attributes.top&&(C.center.bottom=B.attributes.bottom?parseFloat(B.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(B),!0;default:return!1}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){return!!this.parser&&(this.parser.parseClose(B)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class I extends e{constructor(){super(),this.map={patternFill:new Q,gradientFill:new g}}get tag(){return"fill"}render(B,C){switch(B.addRollback(),B.openNode("fill"),C.type){case"pattern":this.map.patternFill.render(B,C);break;case"gradient":this.map.gradientFill.render(B,C);break;default:return void B.rollback()}B.closeNode(),B.commit()}parseOpen(B){if(this.parser)return this.parser.parseOpen(B),!0;switch(B.name){case"fill":return this.model={},!0;default:return this.parser=this.map[B.name],!!this.parser&&(this.parser.parseOpen(B),!0)}}parseText(B){this.parser&&this.parser.parseText(B)}parseClose(B){return!!this.parser&&(this.parser.parseClose(B)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(B){return I.validPatternValues[B]}}I.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((t,B)=>(t[B]=!0,t),{}),I.StopXform=i,I.PatternFillXform=Q,I.GradientFillXform=g,n.exports=I},{"../base-xform":32,"./color-xform":128}],131:[function(A,n,c){const e=A("./color-xform"),E=A("../simple/boolean-xform"),i=A("../simple/integer-xform"),Q=A("../simple/string-xform"),g=A("./underline-xform"),I=A("../../../utils/under-dash"),t=A("../base-xform");class B extends t{constructor(s){super(),this.options=s||B.OPTIONS,this.map={b:{prop:"bold",xform:new E({tag:"b",attr:"val"})},i:{prop:"italic",xform:new E({tag:"i",attr:"val"})},u:{prop:"underline",xform:new g},charset:{prop:"charset",xform:new i({tag:"charset",attr:"val"})},color:{prop:"color",xform:new e},condense:{prop:"condense",xform:new E({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new E({tag:"extend",attr:"val"})},family:{prop:"family",xform:new i({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new E({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new Q({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new Q({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new E({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new E({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new i({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new Q({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(s,D){const{map:o}=this;s.openNode(this.options.tagName),I.each(this.map,(a,r)=>{o[r].xform.render(s,D[a.prop])}),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;if(this.map[s.name])return this.parser=this.map[s.name].xform,this.parser.parseOpen(s);switch(s.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser&&!this.parser.parseClose(s)){const D=this.map[s];return this.parser.model&&(this.model[D.prop]=this.parser.model),this.parser=void 0,!0}switch(s){case this.options.tagName:return!1;default:return!0}}}B.OPTIONS={tagName:"font",fontNameTag:"name"},n.exports=B},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(A,n,c){const e=A("../../../utils/under-dash"),E=A("../../defaultnumformats"),i=A("../base-xform"),Q=(function(){const I={};return e.each(E,(t,B)=>{t.f&&(I[t.f]=parseInt(B,10))}),I})();class g extends i{constructor(t,B){super(),this.id=t,this.formatCode=B}get tag(){return"numFmt"}render(t,B){t.leafNode("numFmt",{numFmtId:B.id,formatCode:B.formatCode})}parseOpen(t){switch(t.name){case"numFmt":return this.model={id:parseInt(t.attributes.numFmtId,10),formatCode:t.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}g.getDefaultFmtId=function(I){return Q[I]},g.getDefaultFmtCode=function(I){return E[I]&&E[I].f},n.exports=g},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(A,n,c){const e=A("../base-xform"),E={boolean:(i,Q)=>i===void 0?Q:i};n.exports=class extends e{get tag(){return"protection"}render(i,Q){i.addRollback(),i.openNode("protection");let g=!1;function I(t,B){B!==void 0&&(i.addAttribute(t,B),g=!0)}I("locked",E.boolean(Q.locked,!0)?void 0:"0"),I("hidden",E.boolean(Q.hidden,!1)?"1":void 0),i.closeNode(),g?i.commit():i.rollback()}parseOpen(i){const Q={locked:i.attributes.locked!=="0",hidden:i.attributes.hidden==="1"},g=!Q.locked||Q.hidden;this.model=g?Q:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(A,n,c){const e=A("../base-xform"),E=A("./alignment-xform"),i=A("./protection-xform");n.exports=class extends e{constructor(Q){super(),this.xfId=!(!Q||!Q.xfId),this.map={alignment:new E,protection:new i}}get tag(){return"xf"}render(Q,g){Q.openNode("xf",{numFmtId:g.numFmtId||0,fontId:g.fontId||0,fillId:g.fillId||0,borderId:g.borderId||0}),this.xfId&&Q.addAttribute("xfId",g.xfId||0),g.numFmtId&&Q.addAttribute("applyNumberFormat","1"),g.fontId&&Q.addAttribute("applyFont","1"),g.fillId&&Q.addAttribute("applyFill","1"),g.borderId&&Q.addAttribute("applyBorder","1"),g.alignment&&Q.addAttribute("applyAlignment","1"),g.protection&&Q.addAttribute("applyProtection","1"),g.alignment&&this.map.alignment.render(Q,g.alignment),g.protection&&this.map.protection.render(Q,g.protection),Q.closeNode()}parseOpen(Q){if(this.parser)return this.parser.parseOpen(Q),!0;switch(Q.name){case"xf":return this.model={numFmtId:parseInt(Q.attributes.numFmtId,10),fontId:parseInt(Q.attributes.fontId,10),fillId:parseInt(Q.attributes.fillId,10),borderId:parseInt(Q.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(Q.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(Q),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(Q),!0;default:return!1}}parseText(Q){this.parser&&this.parser.parseText(Q)}parseClose(Q){return this.parser?(this.parser.parseClose(Q)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):Q!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(A,n,c){const e=A("../../../doc/enums"),E=A("../../../utils/xml-stream"),i=A("../base-xform"),Q=A("../static-xform"),g=A("../list-xform"),I=A("./font-xform"),t=A("./fill-xform"),B=A("./border-xform"),C=A("./numfmt-xform"),s=A("./style-xform"),D=A("./dxf-xform");class o extends i{constructor(r){super(),this.map={numFmts:new g({tag:"numFmts",count:!0,childXform:new C}),fonts:new g({tag:"fonts",count:!0,childXform:new I,$:{"x14ac:knownFonts":1}}),fills:new g({tag:"fills",count:!0,childXform:new t}),borders:new g({tag:"borders",count:!0,childXform:new B}),cellStyleXfs:new g({tag:"cellStyleXfs",count:!0,childXform:new s}),cellXfs:new g({tag:"cellXfs",count:!0,childXform:new s({xfId:!0})}),dxfs:new g({tag:"dxfs",always:!0,count:!0,childXform:new D}),numFmt:new C,font:new I,fill:new t,border:new B,style:new s({xfId:!0}),cellStyles:o.STATIC_XFORMS.cellStyles,tableStyles:o.STATIC_XFORMS.tableStyles,extLst:o.STATIC_XFORMS.extLst},r&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(r,l){l=l||this.model,r.openXml(E.StdDocAttributes),r.openNode("styleSheet",o.STYLESHEET_ATTRIBUTES),this.index?(l.numFmts&&l.numFmts.length&&(r.openNode("numFmts",{count:l.numFmts.length}),l.numFmts.forEach(R=>{r.writeXml(R)}),r.closeNode()),l.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),r.openNode("fonts",{count:l.fonts.length,"x14ac:knownFonts":1}),l.fonts.forEach(R=>{r.writeXml(R)}),r.closeNode(),r.openNode("fills",{count:l.fills.length}),l.fills.forEach(R=>{r.writeXml(R)}),r.closeNode(),r.openNode("borders",{count:l.borders.length}),l.borders.forEach(R=>{r.writeXml(R)}),r.closeNode(),this.map.cellStyleXfs.render(r,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),r.openNode("cellXfs",{count:l.styles.length}),l.styles.forEach(R=>{r.writeXml(R)}),r.closeNode()):(this.map.numFmts.render(r,l.numFmts),this.map.fonts.render(r,l.fonts),this.map.fills.render(r,l.fills),this.map.borders.render(r,l.borders),this.map.cellStyleXfs.render(r,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(r,l.styles)),o.STATIC_XFORMS.cellStyles.render(r),this.map.dxfs.render(r,l.dxfs),o.STATIC_XFORMS.tableStyles.render(r),o.STATIC_XFORMS.extLst.render(r),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r),!0}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case"styleSheet":{this.model={};const l=(R,Y)=>{Y.model&&Y.model.length&&(this.model[R]=Y.model)};if(l("numFmts",this.map.numFmts),l("fonts",this.map.fonts),l("fills",this.map.fills),l("borders",this.map.borders),l("styles",this.map.cellXfs),l("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const R=this.index.numFmt;this.model.numFmts.forEach(Y=>{R[Y.id]=Y.formatCode})}return!1}default:return!0}}addStyleModel(r,l){if(!r)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(r))return this.weakMap.get(r);const R={};if(l=l||e.ValueType.Number,r.numFmt)R.numFmtId=this._addNumFmtStr(r.numFmt);else switch(l){case e.ValueType.Number:R.numFmtId=this._addNumFmtStr("General");break;case e.ValueType.Date:R.numFmtId=this._addNumFmtStr("mm-dd-yy")}r.font&&(R.fontId=this._addFont(r.font)),r.border&&(R.borderId=this._addBorder(r.border)),r.fill&&(R.fillId=this._addFill(r.fill)),r.alignment&&(R.alignment=r.alignment),r.protection&&(R.protection=r.protection);const Y=this._addStyle(R);return this.weakMap&&this.weakMap.set(r,Y),Y}getStyleModel(r){const l=this.model.styles[r];if(!l)return null;let R=this.index.model[r];if(R)return R;if(R=this.index.model[r]={},l.numFmtId){const p=this.index.numFmt[l.numFmtId]||C.getDefaultFmtCode(l.numFmtId);p&&(R.numFmt=p)}function Y(p,x,J){if(J||J===0){const H=x[J];H&&(R[p]=H)}}return Y("font",this.model.fonts,l.fontId),Y("border",this.model.borders,l.borderId),Y("fill",this.model.fills,l.fillId),l.alignment&&(R.alignment=l.alignment),l.protection&&(R.protection=l.protection),R}addDxfStyle(r){return r.numFmt&&(r.numFmtId=this._addNumFmtStr(r.numFmt)),this.model.dxfs.push(r),this.model.dxfs.length-1}getDxfStyle(r){return this.model.dxfs[r]}_addStyle(r){const l=this.map.style.toXml(r);let R=this.index.style[l];return R===void 0&&(R=this.index.style[l]=this.model.styles.length,this.model.styles.push(l)),R}_addNumFmtStr(r){let l=C.getDefaultFmtId(r);if(l!==void 0||(l=this.index.numFmt[r],l!==void 0))return l;l=this.index.numFmt[r]=164+this.model.numFmts.length;const R=this.map.numFmt.toXml({id:l,formatCode:r});return this.model.numFmts.push(R),l}_addFont(r){const l=this.map.font.toXml(r);let R=this.index.font[l];return R===void 0&&(R=this.index.font[l]=this.model.fonts.length,this.model.fonts.push(l)),R}_addBorder(r){const l=this.map.border.toXml(r);let R=this.index.border[l];return R===void 0&&(R=this.index.border[l]=this.model.borders.length,this.model.borders.push(l)),R}_addFill(r){const l=this.map.fill.toXml(r);let R=this.index.fill[l];return R===void 0&&(R=this.index.fill[l]=this.model.fills.length,this.model.fills.push(l)),R}}o.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},o.STATIC_XFORMS={cellStyles:new Q({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new Q({tag:"dxfs",$:{count:0}}),tableStyles:new Q({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new Q({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},o.Mock=class extends o{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(a){return a.autodrain(),Promise.resolve()}addStyleModel(a,r){switch(r){case e.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const a={numFmtId:C.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(a)}return this._dateStyleId}getStyleModel(){return{}}},n.exports=o},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(A,n,c){const e=A("../base-xform");class E extends e{constructor(Q){super(),this.model=Q}get tag(){return"u"}render(Q,g){if((g=g||this.model)===!0)Q.leafNode("u");else{const I=E.Attributes[g];I&&Q.leafNode("u",I)}}parseOpen(Q){Q.name==="u"&&(this.model=Q.attributes.val||!0)}parseText(){}parseClose(){return!1}}E.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},n.exports=E},{"../base-xform":32}],137:[function(A,n,c){const e=A("../base-xform"),E=A("./filter-column-xform");n.exports=class extends e{constructor(){super(),this.map={filterColumn:new E}}get tag(){return"autoFilter"}prepare(i){i.columns.forEach((Q,g)=>{this.map.filterColumn.prepare(Q,{index:g})})}render(i,Q){return i.openNode(this.tag,{ref:Q.autoFilterRef}),Q.columns.forEach(g=>{this.map.filterColumn.render(i,g)}),i.closeNode(),!0}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:return this.model={autoFilterRef:i.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[i.name],this.parser)return this.parseOpen(i),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(i))}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(i){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+i)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"customFilter"}render(E,i){E.leafNode(this.tag,{val:i.val,operator:i.operator})}parseOpen(E){return E.name===this.tag&&(this.model={val:E.attributes.val,operator:E.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(A,n,c){const e=A("../base-xform"),E=A("../list-xform"),i=A("./custom-filter-xform"),Q=A("./filter-xform");n.exports=class extends e{constructor(){super(),this.map={customFilters:new E({tag:"customFilters",count:!1,empty:!0,childXform:new i}),filters:new E({tag:"filters",count:!1,empty:!0,childXform:new Q})}}get tag(){return"filterColumn"}prepare(g,I){g.colId=I.index.toString()}render(g,I){return I.customFilters?(g.openNode(this.tag,{colId:I.colId,hiddenButton:I.filterButton?"0":"1"}),this.map.customFilters.render(g,I.customFilters),g.closeNode(),!0):(g.leafNode(this.tag,{colId:I.colId,hiddenButton:I.filterButton?"0":"1"}),!0)}parseOpen(g){if(this.parser)return this.parser.parseOpen(g),!0;const{attributes:I}=g;switch(g.name){case this.tag:return this.model={filterButton:I.hiddenButton==="0"},!0;default:if(this.parser=this.map[g.name],this.parser)return this.parseOpen(g),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(g))}}parseText(){}parseClose(g){if(this.parser)return this.parser.parseClose(g)||(this.parser=void 0),!0;switch(g){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"filter"}render(E,i){E.leafNode(this.tag,{val:i.val})}parseOpen(E){return E.name===this.tag&&(this.model={val:E.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"tableColumn"}prepare(E,i){E.id=i.index+1}render(E,i){return E.leafNode(this.tag,{id:i.id.toString(),name:i.name,totalsRowLabel:i.totalsRowLabel,totalsRowFunction:i.totalsRowFunction,dxfId:i.dxfId}),!0}parseOpen(E){if(E.name===this.tag){const{attributes:i}=E;return this.model={name:i.name,totalsRowLabel:i.totalsRowLabel,totalsRowFunction:i.totalsRowFunction,dxfId:i.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(A,n,c){const e=A("../base-xform");n.exports=class extends e{get tag(){return"tableStyleInfo"}render(E,i){return E.leafNode(this.tag,{name:i.theme?i.theme:void 0,showFirstColumn:i.showFirstColumn?"1":"0",showLastColumn:i.showLastColumn?"1":"0",showRowStripes:i.showRowStripes?"1":"0",showColumnStripes:i.showColumnStripes?"1":"0"}),!0}parseOpen(E){if(E.name===this.tag){const{attributes:i}=E;return this.model={theme:i.name?i.name:null,showFirstColumn:i.showFirstColumn==="1",showLastColumn:i.showLastColumn==="1",showRowStripes:i.showRowStripes==="1",showColumnStripes:i.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(A,n,c){const e=A("../../../utils/xml-stream"),E=A("../base-xform"),i=A("../list-xform"),Q=A("./auto-filter-xform"),g=A("./table-column-xform"),I=A("./table-style-info-xform");class t extends E{constructor(){super(),this.map={autoFilter:new Q,tableColumns:new i({tag:"tableColumns",count:!0,empty:!0,childXform:new g}),tableStyleInfo:new I}}prepare(C,s){this.map.autoFilter.prepare(C),this.map.tableColumns.prepare(C.columns,s)}get tag(){return"table"}render(C,s){C.openXml(e.StdDocAttributes),C.openNode(this.tag,{...t.TABLE_ATTRIBUTES,id:s.id,name:s.name,displayName:s.displayName||s.name,ref:s.tableRef,totalsRowCount:s.totalsRow?"1":void 0,totalsRowShown:s.totalsRow?void 0:"1",headerRowCount:s.headerRow?"1":"0"}),this.map.autoFilter.render(C,s),this.map.tableColumns.render(C,s.columns),this.map.tableStyleInfo.render(C,s.style),C.closeNode()}parseOpen(C){if(this.parser)return this.parser.parseOpen(C),!0;const{name:s,attributes:D}=C;switch(s){case this.tag:this.reset(),this.model={name:D.name,displayName:D.displayName||D.name,tableRef:D.ref,totalsRow:D.totalsRowCount==="1",headerRow:D.headerRowCount==="1"};break;default:this.parser=this.map[C.name],this.parser&&this.parser.parseOpen(C)}return!0}parseText(C){this.parser&&this.parser.parseText(C)}parseClose(C){if(this.parser)return this.parser.parseClose(C)||(this.parser=void 0),!0;switch(C){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((s,D)=>{this.model.columns[D].filterButton=s.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(C,s){C.columns.forEach(D=>{D.dxfId!==void 0&&(D.style=s.styles.getDxfStyle(D.dxfId))})}}t.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},n.exports=t},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(A,n,c){(function(e,E){(function(){const i=A("fs"),Q=A("jszip"),{PassThrough:g}=A("readable-stream"),I=A("../utils/zip-stream"),t=A("../utils/stream-buf"),B=A("../utils/utils"),C=A("../utils/xml-stream"),{bufferToString:s}=A("../utils/browser-buffer-decode"),D=A("./xform/style/styles-xform"),o=A("./xform/core/core-xform"),a=A("./xform/strings/shared-strings-xform"),r=A("./xform/core/relationships-xform"),l=A("./xform/core/content-types-xform"),R=A("./xform/core/app-xform"),Y=A("./xform/book/workbook-xform"),p=A("./xform/sheet/worksheet-xform"),x=A("./xform/drawing/drawing-xform"),J=A("./xform/table/table-xform"),H=A("./xform/comment/comments-xform"),b=A("./xform/comment/vml-notes-xform"),O=A("./xml/theme1");class m{constructor(u){this.workbook=u}async readFile(u,G){if(!await B.fs.exists(u))throw new Error("File not found: "+u);const w=i.createReadStream(u);try{const h=await this.read(w,G);return w.close(),h}catch(h){throw w.close(),h}}parseRels(u){return new r().parseStream(u)}parseWorkbook(u){return new Y().parseStream(u)}parseSharedStrings(u){return new a().parseStream(u)}reconcile(u,G){const w=new Y,h=new p(G),M=new x,y=new J;w.reconcile(u);const k={media:u.media,mediaIndex:u.mediaIndex};Object.keys(u.drawings).forEach(v=>{const T=u.drawings[v],P=u.drawingRels[v];P&&(k.rels=P.reduce((S,Z)=>(S[Z.Id]=Z,S),{}),(T.anchors||[]).forEach(S=>{const Z=S.picture&&S.picture.hyperlinks;Z&&k.rels[Z.rId]&&(Z.hyperlink=k.rels[Z.rId].Target,delete Z.rId)}),M.reconcile(T,k))});const L={styles:u.styles};Object.values(u.tables).forEach(v=>{y.reconcile(v,L)});const K={styles:u.styles,sharedStrings:u.sharedStrings,media:u.media,mediaIndex:u.mediaIndex,date1904:u.properties&&u.properties.date1904,drawings:u.drawings,comments:u.comments,tables:u.tables,vmlDrawings:u.vmlDrawings};u.worksheets.forEach(v=>{v.relationships=u.worksheetRels[v.sheetNo],h.reconcile(v,K)}),delete u.worksheetHash,delete u.worksheetRels,delete u.globalRels,delete u.sharedStrings,delete u.workbookRels,delete u.sheetDefs,delete u.styles,delete u.mediaIndex,delete u.drawings,delete u.drawingRels,delete u.vmlDrawings}async _processWorksheetEntry(u,G,w,h,M){const y=new p(h),k=await y.parseStream(u);k.sheetNo=w,G.worksheetHash[M]=k,G.worksheets.push(k)}async _processCommentEntry(u,G,w){const h=new H,M=await h.parseStream(u);G.comments[`../${w}.xml`]=M}async _processTableEntry(u,G,w){const h=new J,M=await h.parseStream(u);G.tables[`../tables/${w}.xml`]=M}async _processWorksheetRelsEntry(u,G,w){const h=new r,M=await h.parseStream(u);G.worksheetRels[w]=M}async _processMediaEntry(u,G,w){const h=w.lastIndexOf(".");if(h>=1){const M=w.substr(h+1),y=w.substr(0,h);await new Promise((k,L)=>{const K=new t;K.on("finish",()=>{G.mediaIndex[w]=G.media.length,G.mediaIndex[y]=G.media.length;const v={type:"image",name:y,extension:M,buffer:K.toBuffer()};G.media.push(v),k()}),u.on("error",v=>{L(v)}),u.pipe(K)})}}async _processDrawingEntry(u,G,w){const h=new x,M=await h.parseStream(u);G.drawings[w]=M}async _processDrawingRelsEntry(u,G,w){const h=new r,M=await h.parseStream(u);G.drawingRels[w]=M}async _processVmlDrawingEntry(u,G,w){const h=new b,M=await h.parseStream(u);G.vmlDrawings[`../drawings/${w}.vml`]=M}async _processThemeEntry(u,G,w){await new Promise((h,M)=>{const y=new t;u.on("error",M),y.on("error",M),y.on("finish",()=>{G.themes[w]=y.read().toString(),h()}),u.pipe(y)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(u,G){!u[Symbol.asyncIterator]&&u.pipe&&(u=u.pipe(new g));const w=[];for await(const h of u)w.push(h);return this.load(E.concat(w),G)}async load(u,G){let w;w=G&&G.base64?E.from(u.toString(),"base64"):u;const h={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},M=await Q.loadAsync(w);for(const y of Object.values(M.files))if(!y.dir){let k,L=y.name;if(L[0]==="/"&&(L=L.substr(1)),L.match(/xl\/media\//)||L.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))k=new g,k.write(await y.async("nodebuffer"));else{let K;k=new g({writableObjectMode:!0,readableObjectMode:!0}),K=e.browser?s(await y.async("nodebuffer")):await y.async("string");const v=16384;for(let T=0;T<K.length;T+=v)k.write(K.substring(T,T+v))}switch(k.end(),L){case"_rels/.rels":h.globalRels=await this.parseRels(k);break;case"xl/workbook.xml":{const K=await this.parseWorkbook(k);h.sheets=K.sheets,h.definedNames=K.definedNames,h.views=K.views,h.properties=K.properties,h.calcProperties=K.calcProperties;break}case"xl/_rels/workbook.xml.rels":h.workbookRels=await this.parseRels(k);break;case"xl/sharedStrings.xml":h.sharedStrings=new a,await h.sharedStrings.parseStream(k);break;case"xl/styles.xml":h.styles=new D,await h.styles.parseStream(k);break;case"docProps/app.xml":{const K=new R,v=await K.parseStream(k);h.company=v.company,h.manager=v.manager;break}case"docProps/core.xml":{const K=new o,v=await K.parseStream(k);Object.assign(h,v);break}default:{let K=L.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(K){await this._processWorksheetEntry(k,h,K[1],G,L);break}if(K=L.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),K){await this._processWorksheetRelsEntry(k,h,K[1]);break}if(K=L.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),K){await this._processThemeEntry(k,h,K[1]);break}if(K=L.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),K){await this._processMediaEntry(k,h,K[1]);break}if(K=L.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),K){await this._processDrawingEntry(k,h,K[1]);break}if(K=L.match(/xl\/(comments\d+)[.]xml/),K){await this._processCommentEntry(k,h,K[1]);break}if(K=L.match(/xl\/tables\/(table\d+)[.]xml/),K){await this._processTableEntry(k,h,K[1]);break}if(K=L.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),K){await this._processDrawingRelsEntry(k,h,K[1]);break}if(K=L.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),K){await this._processVmlDrawingEntry(k,h,K[1]);break}}}}return this.reconcile(h,G),this.workbook.model=h,this.workbook}async addMedia(u,G){await Promise.all(G.media.map(async w=>{if(w.type==="image"){const h=`xl/media/${w.name}.${w.extension}`;if(w.filename){const M=await(function(y,k){return new Promise((L,K)=>{i.readFile(y,k,(v,T)=>{v?K(v):L(T)})})})(w.filename);return u.append(M,{name:h})}if(w.buffer)return u.append(w.buffer,{name:h});if(w.base64){const M=w.base64,y=M.substring(M.indexOf(",")+1);return u.append(y,{name:h,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(u,G){const w=new x,h=new r;G.worksheets.forEach(M=>{const{drawing:y}=M;if(y){w.prepare(y,{});let k=w.toXml(y);u.append(k,{name:`xl/drawings/${y.name}.xml`}),k=h.toXml(y.rels),u.append(k,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(u,G){const w=new J;G.worksheets.forEach(h=>{const{tables:M}=h;M.forEach(y=>{w.prepare(y,{});const k=w.toXml(y);u.append(k,{name:"xl/tables/"+y.target})})})}async addContentTypes(u,G){const w=new l().toXml(G);u.append(w,{name:"[Content_Types].xml"})}async addApp(u,G){const w=new R().toXml(G);u.append(w,{name:"docProps/app.xml"})}async addCore(u,G){const w=new o;u.append(w.toXml(G),{name:"docProps/core.xml"})}async addThemes(u,G){const w=G.themes||{theme1:O};Object.keys(w).forEach(h=>{const M=w[h],y=`xl/theme/${h}.xml`;u.append(M,{name:y})})}async addOfficeRels(u){const G=new r().toXml([{Id:"rId1",Type:m.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:m.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:m.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);u.append(G,{name:"_rels/.rels"})}async addWorkbookRels(u,G){let w=1;const h=[{Id:"rId"+w++,Type:m.RelType.Styles,Target:"styles.xml"},{Id:"rId"+w++,Type:m.RelType.Theme,Target:"theme/theme1.xml"}];G.sharedStrings.count&&h.push({Id:"rId"+w++,Type:m.RelType.SharedStrings,Target:"sharedStrings.xml"}),G.worksheets.forEach(y=>{y.rId="rId"+w++,h.push({Id:y.rId,Type:m.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const M=new r().toXml(h);u.append(M,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(u,G){G.sharedStrings&&G.sharedStrings.count&&u.append(G.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(u,G){const{xml:w}=G.styles;w&&u.append(w,{name:"xl/styles.xml"})}async addWorkbook(u,G){const w=new Y;u.append(w.toXml(G),{name:"xl/workbook.xml"})}async addWorksheets(u,G){const w=new p,h=new r,M=new H,y=new b;G.worksheets.forEach(k=>{let L=new C;w.render(L,k),u.append(L.xml,{name:`xl/worksheets/sheet${k.id}.xml`}),k.rels&&k.rels.length&&(L=new C,h.render(L,k.rels),u.append(L.xml,{name:`xl/worksheets/_rels/sheet${k.id}.xml.rels`})),k.comments.length>0&&(L=new C,M.render(L,k),u.append(L.xml,{name:`xl/comments${k.id}.xml`}),L=new C,y.render(L,k),u.append(L.xml,{name:`xl/drawings/vmlDrawing${k.id}.vml`}))})}_finalize(u){return new Promise((G,w)=>{u.on("finish",()=>{G(this)}),u.on("error",w),u.finalize()})}prepareModel(u,G){u.creator=u.creator||"ExcelJS",u.lastModifiedBy=u.lastModifiedBy||"ExcelJS",u.created=u.created||new Date,u.modified=u.modified||new Date,u.useSharedStrings=G.useSharedStrings===void 0||G.useSharedStrings,u.useStyles=G.useStyles===void 0||G.useStyles,u.sharedStrings=new a,u.styles=u.useStyles?new D(!0):new D.Mock;const w=new Y,h=new p;w.prepare(u);const M={sharedStrings:u.sharedStrings,styles:u.styles,date1904:u.properties.date1904,drawingsCount:0,media:u.media};M.drawings=u.drawings=[],M.commentRefs=u.commentRefs=[];let y=0;u.tables=[],u.worksheets.forEach(k=>{k.tables.forEach(L=>{y++,L.target=`table${y}.xml`,L.id=y,u.tables.push(L)}),h.prepare(k,M)})}async write(u,G){G=G||{};const{model:w}=this.workbook,h=new I.ZipWriter(G.zip);return h.pipe(u),this.prepareModel(w,G),await this.addContentTypes(h,w),await this.addOfficeRels(h,w),await this.addWorkbookRels(h,w),await this.addWorksheets(h,w),await this.addSharedStrings(h,w),await this.addDrawings(h,w),await this.addTables(h,w),await Promise.all([this.addThemes(h,w),this.addStyles(h,w)]),await this.addMedia(h,w),await Promise.all([this.addApp(h,w),this.addCore(h,w)]),await this.addWorkbook(h,w),this._finalize(h)}writeFile(u,G){const w=i.createWriteStream(u);return new Promise((h,M)=>{w.on("finish",()=>{h()}),w.on("error",y=>{M(y)}),this.write(w,G).then(()=>{w.end()}).catch(y=>{M(y)})})}async writeBuffer(u){const G=new t;return await this.write(G,u),G.read()}}m.RelType=A("./rel-type"),n.exports=m}).call(this)}).call(this,A("_process"),A("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(A,n,c){n.exports=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
30
30
|
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`},{}],146:[function(A,n,c){(function(e){(function(){Object.defineProperty(c,"__esModule",{value:!0}),c.CsvFormatterStream=void 0;const E=A("stream"),i=A("./formatter");class Q extends E.Transform{constructor(I){super({writableObjectMode:I.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=I,this.rowFormatter=new i.RowFormatter(I),this.hasWrittenBOM=!I.writeBOM}transform(I){return this.rowFormatter.rowTransform=I,this}_transform(I,t,B){let C=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(I,(s,D)=>s?(C=!0,B(s)):(D&&D.forEach(o=>{this.push(e.from(o,"utf8"))}),C=!0,B()))}catch(s){if(C)throw s;B(s)}}_flush(I){this.rowFormatter.finish((t,B)=>t?I(t):(B&&B.forEach(C=>{this.push(e.from(C,"utf8"))}),I()))}}c.CsvFormatterStream=Q}).call(this)}).call(this,A("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(A,n,c){Object.defineProperty(c,"__esModule",{value:!0}),c.FormatterOptions=void 0,c.FormatterOptions=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var E;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=`
|