efficient-office 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Documents-2ZU5D3ZI.js +1 -0
- package/dist/{Slides-LJW5C24V.js → Slides-YZQXZJX4.js} +1 -1
- package/dist/Spreadsheet-VWRRB6FE.js +1 -0
- package/dist/{chunk-6ZFEBY6H.js → chunk-ADXHTZ3Q.js} +1 -1
- package/dist/chunk-D3JKD7KW.js +1 -0
- package/dist/{chunk-3KJZFUBH.js → chunk-DG4VDXLL.js} +1 -1
- package/dist/chunk-EC6D54MM.js +1 -0
- package/dist/{chunk-HU4RI2OM.js → chunk-HNNYUGDU.js} +1 -1
- package/dist/{chunk-4M3QRYCH.js → chunk-MR7ZWQHF.js} +1 -1
- package/dist/{chunk-4MGZXE3N.js → chunk-NRGUS5QY.js} +1 -1
- package/dist/{chunk-JCSB2PHB.js → chunk-O35VT6BD.js} +1 -1
- package/dist/chunk-POH6OTTR.js +1 -0
- package/dist/chunk-UKGIT2RS.js +1 -0
- package/dist/chunk-YKQ5UKYZ.js +1 -0
- package/dist/chunk-ZS45QEF4.js +1 -0
- package/dist/documents/documents.css +39 -0
- package/dist/documents/index.d.ts +63 -2
- package/dist/documents/index.js +1 -1
- package/dist/docxPdf-QSMEFCUF.js +1 -0
- package/dist/importDocument-34WALCTG.js +1 -0
- package/dist/importSpreadsheet-IRN32JON.js +1 -0
- package/dist/{pptxImport-Y7TB6PYP.js → pptxImport-OACGHWQ6.js} +1 -1
- package/dist/slides/index.js +1 -1
- package/dist/spreadsheet/index.d.ts +3 -1
- package/dist/spreadsheet/index.js +1 -1
- package/dist/{workbookPdf-63WIOPEC.js → workbookPdf-CQTTURQ5.js} +1 -1
- package/dist/xlsxFile-SX767BIH.js +1 -0
- package/package.json +1 -1
- package/dist/Documents-ISV66NLW.js +0 -1
- package/dist/Spreadsheet-I5XA7TU7.js +0 -1
- package/dist/chunk-4NKXNXKY.js +0 -1
- package/dist/chunk-COXKOQPZ.js +0 -1
- package/dist/chunk-I3AC6PYR.js +0 -1
- package/dist/chunk-MZJSGEU3.js +0 -1
- package/dist/chunk-RHW2M2UY.js +0 -1
- package/dist/chunk-UDEPDAZI.js +0 -1
- package/dist/docxPdf-EW5I5JR3.js +0 -1
- package/dist/importDocument-274VK7OM.js +0 -1
- package/dist/importSpreadsheet-ZXS3RSKE.js +0 -1
- package/dist/xlsxFile-GYMIRUWG.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function e(e){let n=4294967295;for(let r=0;r<e.length;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0}async function n(t,e){const n=e.writable.getWriter();return n.write(t).then(()=>n.close()).catch(()=>{}),new Uint8Array(await new Response(e.readable).arrayBuffer())}function r(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let n=t.length-22;n>=Math.max(0,t.length-66e3);n--)if(101010256===e.getUint32(n,!0))return{count:e.getUint16(n+10,!0),size:e.getUint32(n+12,!0),offset:e.getUint32(n+16,!0)};throw new Error("Not a zip file")}function a(t,e,n){const r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=new TextDecoder,s=[];let o=e,i=0;for(let e=0;e<n;e++){if(33639248!==r.getUint32(o,!0))throw new Error("Damaged zip file");if(i+=r.getUint32(o+24,!0),i>1073741824)throw new Error("Zip file too large");const e=r.getUint16(o+28,!0),n=a.decode(t.subarray(o+46,o+46+e));n.endsWith("/")||s.push({name:n,method:r.getUint16(o+10,!0),packedSize:r.getUint32(o+20,!0),localAt:r.getUint32(o+42,!0)}),o+=46+e+r.getUint16(o+30,!0)+r.getUint16(o+32,!0)}return s}async function s(t,e){if(0===t.method)return e.slice();if(8===t.method)return n(e,new DecompressionStream("deflate-raw"));throw new Error("Unsupported zip compression")}var o=(t,e)=>{const n=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.localAt+30+n.getUint16(26,!0)+n.getUint16(28,!0)};async function i(t){const e=r(t),n=new Map;for(const r of a(t,e.offset,e.count)){const e=o(r,t.subarray(r.localAt,r.localAt+30));n.set(r.name,await s(r,t.subarray(e,e+r.packedSize)))}return n}async function l(t){const e=async(e,n)=>new Uint8Array(await t.slice(e,n).arrayBuffer()),n=r(await e(Math.max(0,t.size-66e3),t.size)),i=new Map(a(await e(n.offset,n.offset+n.size),0,n.count).map(t=>[t.name,t]));return{names:[...i.keys()],read:async t=>{const n=i.get(t);if(!n)throw new Error(`No part named ${t}`);const r=o(n,await e(n.localAt,n.localAt+30));return s(n,await e(r,r+n.packedSize))}}}async function w(t){const r=new TextEncoder,a=[],s=[];let o=0;for(const[i,l]of t){const t=r.encode(i),w="undefined"==typeof CompressionStream?null:await n(l,new CompressionStream("deflate-raw")),c=null===w||w.length>=l.length,f=c?l:w,p=e(l),m=new Uint8Array(30+t.length),h=new DataView(m.buffer);h.setUint32(0,67324752,!0),h.setUint16(4,20,!0),h.setUint16(6,2048,!0),h.setUint16(8,c?0:8,!0),h.setUint16(12,33,!0),h.setUint32(14,p,!0),h.setUint32(18,f.length,!0),h.setUint32(22,l.length,!0),h.setUint16(26,t.length,!0),m.set(t,30);const u=new Uint8Array(46+t.length),d=new DataView(u.buffer);d.setUint32(0,33639248,!0),d.setUint16(4,20,!0),d.setUint16(6,20,!0),d.setUint16(8,2048,!0),d.setUint16(10,c?0:8,!0),d.setUint16(14,33,!0),d.setUint32(16,p,!0),d.setUint32(20,f.length,!0),d.setUint32(24,l.length,!0),d.setUint16(28,t.length,!0),d.setUint32(42,o,!0),u.set(t,46),a.push(m,f),s.push(u),o+=m.length+f.length}const i=s.reduce((t,e)=>t+e.length,0),l=new Uint8Array(22),w=new DataView(l.buffer);w.setUint32(0,101010256,!0),w.setUint16(8,t.size,!0),w.setUint16(10,t.size,!0),w.setUint32(12,i,!0),w.setUint32(16,o,!0);const c=new Uint8Array(o+i+22);let f=0;for(const t of[...a,...s,l])c.set(t,f),f+=t.length;return c}var c={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function f(t){return t.includes("&")?t.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,e)=>{if("#"!==e[0])return c[e]??t;const n="x"===e[1]?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return n<=1114111?String.fromCodePoint(n):t}):t}function p(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g,"")}var m=/([^\s=]+)\s*=\s*("([^"]*)"|'([^']*)')/g;function h(t){const e=[];let n=null,r=0;for(;r<t.length;){const a=t.indexOf("<",r);if(a<0)break;if(a>r&&e.length&&(e[e.length-1].text+=f(t.slice(r,a))),t.startsWith("\x3c!--",a)){r=u(t,"--\x3e",a);continue}if(t.startsWith("<?",a)){r=u(t,"?>",a);continue}if(t.startsWith("<![CDATA[",a)){const n=u(t,"]]>",a);e.length&&(e[e.length-1].text+=t.slice(a+9,n-3)),r=n;continue}if(t.startsWith("<!",a)){r=u(t,">",a);continue}const s=d(t,a);if("/"===t[a+1]){const n=e.pop();if(!n||n.name!==t.slice(a+2,s).trim())throw new Error("Malformed XML");n.innerEnd=a,n.end=s+1,r=s+1;continue}const o="/"===t[s-1],i=t.slice(a+1,o?s-1:s),l=i.search(/\s/),w={name:l<0?i:i.slice(0,l),attrs:{},children:[],text:"",start:a,end:s+1,innerStart:s+1,innerEnd:s+1};if(l>=0)for(const t of i.slice(l).matchAll(m))w.attrs[t[1]]=f(t[3]??t[4]??"");e.length?e[e.length-1].children.push(w):n||(n=w),o||e.push(w),r=s+1}if(!n||e.length)throw new Error("Malformed XML");return n}function u(t,e,n){const r=t.indexOf(e,n);if(r<0)throw new Error("Malformed XML");return r+e.length}function d(t,e){let n="";for(let r=e+1;r<t.length;r++){const e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(">"===e)return r}throw new Error("Malformed XML")}var g=(t,e)=>t?.children.find(t=>t.name===e),y=(t,e)=>t?.children.filter(t=>t.name===e)??[];function v(t,e,n=[]){for(const r of t.children)e.has(r.name)&&n.push(r),v(r,e,n);return n}function b(t){if(!t)return;const e=t.attrs["w:val"];return!("0"===e||"false"===e||"off"===e||"none"===e)}var x='xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"',$="http://schemas.openxmlformats.org/officeDocument/2006/relationships",P={officeDocument:`${$}/officeDocument`,styles:`${$}/styles`,numbering:`${$}/numbering`,theme:`${$}/theme`,comments:`${$}/comments`,footnotes:`${$}/footnotes`,header:`${$}/header`,footer:`${$}/footer`,image:`${$}/image`,hyperlink:`${$}/hyperlink`,settings:`${$}/settings`},U=new TextEncoder,N=new TextDecoder,T=(t,e)=>{const n=t.get(e);return n?N.decode(n):void 0},z=(t,e,n)=>{t.set(e,U.encode(n))},C=t=>{const e=t.lastIndexOf("/");return`${t.slice(0,e+1)}_rels/${t.slice(e+1)}.rels`};function k(t,e){const n=T(t,C(e));return n?h(n).children.filter(t=>"Relationship"===t.name).map(t=>({id:t.attrs.Id,type:t.attrs.Type,target:t.attrs.Target,external:"External"===t.attrs.TargetMode})):[]}function M(t,e){if(e.startsWith("/"))return e.slice(1);const n=t.split("/").slice(0,-1);for(const t of e.split("/"))".."===t?n.pop():"."!==t&&n.push(t);return n.join("/")}function A(t,e,n,r,a=!1){const s=C(e),o=T(t,s),i=new Set(k(t,e).map(t=>t.id));let l=i.size+1;for(;i.has(`rId${l}`);)l++;const w=`rId${l}`,c=`<Relationship Id="${w}" Type="${n}" Target="${p(r)}"${a?' TargetMode="External"':""}/>`;return z(t,s,o?o.replace(/(<\/Relationships>\s*)$/,`${c}$1`).replace(/<Relationships([^>]*)\/>\s*$/,`<Relationships$1>${c}</Relationships>`):`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${c}</Relationships>`),w}function D(t,e,n){const r=T(t,"[Content_Types].xml")??"";r.includes(`PartName="/${e}"`)||z(t,"[Content_Types].xml",r.replace("</Types>",`<Override PartName="/${e}" ContentType="${n}"/></Types>`))}function L(t,e,n){const r=T(t,"[Content_Types].xml")??"";new RegExp(`Extension="${e}"`,"i").test(r)||z(t,"[Content_Types].xml",r.replace(/(<Types[^>]*>)/,`$1<Default Extension="${e}" ContentType="${n}"/>`))}var R={a4:{width:11906,height:16838},letter:{width:12240,height:15840},legal:{width:12240,height:20160},a3:{width:16838,height:23811},a5:{width:8391,height:11906}},I={normal:{top:1440,right:1440,bottom:1440,left:1440},narrow:{top:720,right:720,bottom:720,left:720},moderate:{top:1440,right:1080,bottom:1440,left:1080},wide:{top:1440,right:2880,bottom:1440,left:2880}},F={...R.a4,...I.normal,header:708,footer:708};function E(t,e){const n=R[e];return t.width>t.height?{...t,width:n.height,height:n.width}:{...t,...n}}function O(t,e){return{...t,...I[e]}}function j(t){const e=Math.min(t.width,t.height),n=Math.max(t.width,t.height);for(const[t,r]of Object.entries(R))if(Math.abs(r.width-e)<30&&Math.abs(r.height-n)<30)return t;return null}function H(t){for(const[e,n]of Object.entries(I))if(n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left)return e;return null}var S={yellow:"#ffff00",green:"#00ff00",cyan:"#00ffff",magenta:"#ff00ff",blue:"#0000ff",red:"#ff0000",darkBlue:"#000080",darkCyan:"#008080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",darkGray:"#808080",lightGray:"#c0c0c0",black:"#000000",white:"#ffffff"};function q(t){if(!t)return{};try{const e=h(t),n=g(g(e,"a:themeElements"),"a:fontScheme");return{major:g(g(n,"a:majorFont"),"a:latin")?.attrs.typeface,minor:g(g(n,"a:minorFont"),"a:latin")?.attrs.typeface}}catch{return{}}}var W=t=>t&&/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:void 0;function _(t,e){const n={};if(!t)return n;const r=b(g(t,"w:b"));void 0!==r&&(n.b=r);const a=b(g(t,"w:i"));void 0!==a&&(n.i=a);const s=g(t,"w:u");s&&(n.u="none"!==s.attrs["w:val"]);const o=b(g(t,"w:strike"));void 0!==o&&(n.strike=o);const i=g(t,"w:vertAlign")?.attrs["w:val"];"subscript"===i&&(n.vert="sub"),"superscript"===i&&(n.vert="super");const l=function(t,e){if(!t)return;const n=t.attrs["w:ascii"]??t.attrs["w:hAnsi"];if(n)return n;const r=t.attrs["w:asciiTheme"]??t.attrs["w:hAnsiTheme"];return r?r.startsWith("major")?e.major:e.minor:t.attrs["w:eastAsia"]??t.attrs["w:cs"]}(g(t,"w:rFonts"),e);l&&(n.font=l);const w=Number(g(t,"w:sz")?.attrs["w:val"]);w&&(n.size=w/2);const c=W(g(t,"w:color")?.attrs["w:val"]);c&&(n.color=c);const f=g(t,"w:highlight")?.attrs["w:val"];if(f&&S[f])n.hl=S[f];else{const e=W(g(t,"w:shd")?.attrs["w:fill"]);e&&(n.hl=e)}return n}function V(t){const e={};if(!t)return e;const n=g(t,"w:jc")?.attrs["w:val"];"left"===n||"start"===n?e.align="left":"center"===n?e.align="center":"right"===n||"end"===n?e.align="right":"both"!==n&&"distribute"!==n||(e.align="justify");const r=g(t,"w:ind");if(r){const t=r.attrs["w:left"]??r.attrs["w:start"];void 0!==t&&(e.indentLeft=Number(t)/20);const n=r.attrs["w:right"]??r.attrs["w:end"];void 0!==n&&(e.indentRight=Number(n)/20),void 0!==r.attrs["w:firstLine"]&&(e.firstLine=Number(r.attrs["w:firstLine"])/20),void 0!==r.attrs["w:hanging"]&&(e.firstLine=-Number(r.attrs["w:hanging"])/20)}const a=g(t,"w:spacing");if(a){void 0!==a.attrs["w:before"]&&(e.before=Number(a.attrs["w:before"])/20),void 0!==a.attrs["w:after"]&&(e.after=Number(a.attrs["w:after"])/20);const t=Number(a.attrs["w:line"]);t&&("exact"===a.attrs["w:lineRule"]||"atLeast"===a.attrs["w:lineRule"]?e.linePoints=t/20:e.lineMultiple=t/240)}const s=y(g(t,"w:tabs"),"w:tab").filter(t=>"clear"!==t.attrs["w:val"]&&void 0!==t.attrs["w:pos"]).map(t=>{const e=t.attrs["w:val"];return{pos:Number(t.attrs["w:pos"])/20,align:"center"===e?"center":"right"===e||"end"===e?"right":"left"}}).filter(t=>Number.isFinite(t.pos));return s.length&&(e.tabs=s.sort((t,e)=>t.pos-e.pos)),e}function B(t){if(!t.tabs?.length)return"";const e=t.indentLeft??0,n=t.tabs.find(t=>t.pos>e);return n?`tab-size:${Z(n.pos-e)}pt`:""}var Q=t=>t.map(t=>`${Z(t.pos)}${t.align[0]}`).join(" ");function X(t){return t?t.split(/\s+/).map(t=>{const e=/^(-?[\d.]+)([lcr])$/.exec(t);return e?{pos:Number(e[1]),align:"c"===e[2]?"center":"r"===e[2]?"right":"left"}:null}).filter(t=>!!t&&Number.isFinite(t.pos)).sort((t,e)=>t.pos-e.pos):[]}var Z=t=>Math.round(100*t)/100,G={open:"☐",done:"☑"},J=["Inter","Roboto","Montserrat","Lora","Playfair Display","JetBrains Mono"];function Y(t){return`https://fonts.googleapis.com/css2?${[...t].sort().map(t=>`family=${t.replace(/ /g,"+")}:ital,wght@0,400;0,700;1,400;1,700`).join("&")}&display=swap`}function K(t){const e=[];return t.align&&e.push(`text-align:${t.align}`),void 0!==t.indentLeft&&e.push(`margin-left:${Z(t.indentLeft)}pt`),void 0!==t.indentRight&&e.push(`margin-right:${Z(t.indentRight)}pt`),void 0!==t.firstLine&&e.push(`text-indent:${Z(t.firstLine)}pt`),void 0!==t.before&&e.push(`margin-top:${Z(t.before)}pt`),void 0!==t.after&&e.push(`margin-bottom:${Z(t.after)}pt`),void 0!==t.lineMultiple&&e.push(`line-height:${Z(t.lineMultiple)}`),void 0!==t.linePoints&&e.push(`line-height:${Z(t.linePoints)}pt`),e.join(";")}function tt(t){const e=[];void 0!==t.b&&e.push("font-weight:"+(t.b?700:400)),void 0!==t.i&&e.push("font-style:"+(t.i?"italic":"normal"));const n=[t.u&&"underline",t.strike&&"line-through"].filter(Boolean);return n.length&&e.push(`text-decoration-line:${n.join(" ")}`),t.font&&e.push(`font-family:${function(t){const e=t.replace(/["\\<>;]/g,"");return/mono|courier|consolas|menlo/i.test(e)?`"${e}",monospace`:/times|georgia|cambria|garamond|palatino|serif|song|ming/i.test(e)&&!/sans/i.test(e)?`"${e}",Caladea,serif`:`"${e}",Carlito,Arial,sans-serif`}(t.font)}`),t.size&&e.push(`font-size:${Z(t.size)}pt`),t.color&&e.push(`color:${t.color}`),t.hl&&e.push(`background-color:${t.hl}`),e.join(";")}var et={Title:{name:"Title",xml:'<w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="80" w:line="240" w:lineRule="auto"/></w:pPr><w:rPr><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style>'},Heading1:{name:"heading 1",xml:'<w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="360" w:after="80"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="40"/><w:szCs w:val="40"/></w:rPr></w:style>'},Heading2:{name:"heading 2",xml:'<w:style w:type="paragraph" w:styleId="Heading2"><w:name w:val="heading 2"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="160" w:after="80"/><w:outlineLvl w:val="1"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="32"/><w:szCs w:val="32"/></w:rPr></w:style>'},Heading3:{name:"heading 3",xml:'<w:style w:type="paragraph" w:styleId="Heading3"><w:name w:val="heading 3"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="160" w:after="80"/><w:outlineLvl w:val="2"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="28"/><w:szCs w:val="28"/></w:rPr></w:style>'},Heading4:{name:"heading 4",xml:'<w:style w:type="paragraph" w:styleId="Heading4"><w:name w:val="heading 4"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="80" w:after="40"/><w:outlineLvl w:val="3"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="0F4761"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr></w:style>'},Heading5:{name:"heading 5",xml:'<w:style w:type="paragraph" w:styleId="Heading5"><w:name w:val="heading 5"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="80" w:after="40"/><w:outlineLvl w:val="4"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:style>'},Heading6:{name:"heading 6",xml:'<w:style w:type="paragraph" w:styleId="Heading6"><w:name w:val="heading 6"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="40"/><w:outlineLvl w:val="5"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="595959"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:style>'},Quote:{name:"Quote",xml:'<w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style>'}},nt='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';function rt(t){const e=new Map;z(e,"[Content_Types].xml",`${nt}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/></Types>`),z(e,"_rels/.rels",`${nt}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${P.officeDocument}" Target="word/document.xml"/></Relationships>`);const n=F;z(e,"word/document.xml",`${nt}<w:document ${x}><w:body><w:p/><w:sectPr><w:pgSz w:w="${n.width}" w:h="${n.height}"/><w:pgMar w:top="${n.top}" w:right="${n.right}" w:bottom="${n.bottom}" w:left="${n.left}" w:header="${n.header}" w:footer="${n.footer}" w:gutter="0"/></w:sectPr></w:body></w:document>`),z(e,"word/_rels/document.xml.rels",`${nt}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${P.styles}" Target="styles.xml"/><Relationship Id="rId2" Type="${$}/settings" Target="settings.xml"/></Relationships>`),z(e,"word/settings.xml",`${nt}<w:settings ${x}><w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/></w:compat></w:settings>`);const r=/^[A-Za-z]{2,3}(-[A-Za-z0-9]+)*$/.test(t)?t:"en-AU";return z(e,"word/styles.xml",`${nt}<w:styles ${x}><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/><w:lang w:val="${r}"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>${Object.values(et).map(t=>t.xml).join("")}<w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style></w:styles>`),e}export{i as readZip,l as openZip,w as writeZip,p as escapeXml,h as parseXml,g as child,y as childrenOf,v as descendants,x as WORD_NS,P as REL,T as partText,z as setPartText,k as readRels,M as resolveTarget,A as addRel,D as addContentOverride,L as addContentDefault,R as PAPER_SIZES,I as MARGIN_PRESETS,F as DEFAULT_PAGE,E as withPaper,O as withMargins,j as paperOf,H as marginsOf,S as HIGHLIGHTS,q as readThemeFonts,_ as parseRunProps,V as parseParaProps,B as tabCss,Q as tabsAttr,X as parseTabsAttr,G as CHECK_BULLETS,J as WEB_FONTS,Y as webFontSheetUrl,K as paraCss,tt as runCss,et as BUILTIN_STYLES,rt as blankDocxParts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readXlsx as t}from"./chunk-
|
|
1
|
+
import{readXlsx as t}from"./chunk-MR7ZWQHF.js";import{formatKey as e,newSheet as r,parseCsv as s,sheetFromRows as n,writeCells as c}from"./chunk-ZS45QEF4.js";import{titleOf as a}from"./chunk-XYVQTQ6N.js";async function o(t){const s=await(import("xlsx")),n=s.read(t,{type:"array",cellFormula:!0,cellNF:!0});return n.SheetNames.map(t=>{const a=n.Sheets[t],o=r(t),i=[],f={};if(a["!ref"]){const t=s.utils.decode_range(a["!ref"]);for(let r=t.s.r;r<=t.e.r;r++)for(let n=t.s.c;n<=t.e.c;n++){const t=a[s.utils.encode_cell({r:r,c:n})];if(!t||void 0===t.v&&!t.f)continue;const c=t.f?`=${t.f}`:"b"===t.t?t.v?"TRUE":"FALSE":String(t.v);i.push({row:r,col:n,raw:"s"===t.t&&/^(?:=|-?\d|'|true$|false$)/i.test(c)?`'${c}`:c}),t.z&&"General"!==t.z&&(f[e(r,n)]={numFmt:t.z})}}const l={};(a["!cols"]??[]).forEach((t,e)=>{t?.wpx&&(l[e]=t.wpx)});const m=(a["!merges"]??[]).map(t=>({r1:t.s.r,c1:t.s.c,r2:t.e.r,c2:t.e.c}));return{...c(o,i),formats:f,colWidths:l,merges:m}})}async function i(e,r,c="Sheet1"){const i=await async function(e,r){if(/\.(xlsx|xls|ods)$/i.test(e.name)){const r=new Uint8Array(await e.arrayBuffer());return/\.xlsx$/i.test(e.name)&&"undefined"!=typeof DecompressionStream?t(r):o(r)}const c=s(await e.text());return[n(r,c.length?c:[[""]])]}(r,c),f=a(r.name),l=await e.create(f);try{await e.save(l.id,{sheets:i},l.version)}catch(t){throw await e.remove(l.id).catch(()=>{}),t}return{id:l.id,title:f}}export{o as readWithSheetJs,i as importSpreadsheetFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE","LI","TR","TABLE","UL","OL","TBODY"]);function t(t){let o="";const a=t=>{for(const n of Array.from(t.childNodes)){if(3===n.nodeType){o+=(n.nodeValue??"").replace(//g,"");continue}if(1!==n.nodeType)continue;const t=n;if("BR"===t.tagName){o+="\n";continue}if("DEL"===t.tagName||t.hasAttribute("data-hidden"))continue;if("object"===t.getAttribute("data-kind")||"mark"===t.getAttribute("data-kind"))continue;if("TD"===t.tagName||"TH"===t.tagName){a(t),o=`${o.replace(/\n+$/,"")}\t`;continue}const r=e.has(t.tagName);a(t),r&&!o.endsWith("\n")&&(o+="\n")}};return a(t),o.replace(/\t\n/g,"\n").replace(/\n+$/,"\n")}function o(e){return(e.match(/[-ヿ㐀-鿿豈-]/g)?.length??0)+(e.replace(/[-ヿ㐀-鿿豈-]/g," ").match(/\S+/g)?.length??0)}function a(t,o,a){if(!o)return[];const n=function(e){const t=[],o=e=>{for(const a of Array.from(e.childNodes))if(3===a.nodeType)t.push(a);else if(1===a.nodeType){const e=a;if("false"===e.getAttribute("contenteditable")||e.hasAttribute("data-raw"))continue;o(e)}};return o(e),t}(t),r=o=>{let a=o.parentNode;for(;a&&a!==t&&!e.has(a.tagName)&&"TD"!==a.tagName;)a=a.parentNode;return a},d=[];let c=0;for(;c<n.length;){const e=r(n[c]);let t=c;const i=[];for(;t<n.length&&r(n[t])===e;)i.push(n[t++]);const s=i.map(e=>e.nodeValue??"").join(""),l=a?s:s.toLowerCase(),p=a?o:o.toLowerCase(),g=l.length===s.length?l:s;for(let e=g.indexOf(p);e>=0;e=g.indexOf(p,e+p.length)){const t=[];let o=0;for(const a of i){const n=(a.nodeValue??"").length,r=Math.max(e,o),d=Math.min(e+p.length,o+n);r<d&&t.push({node:a,start:r-o,end:d-o}),o+=n}d.push(t)}c=t}return d}function n(e,t){e.forEach((e,o)=>{const a=e.node.nodeValue??"";e.node.nodeValue=a.slice(0,e.start)+(0===o?t:"")+a.slice(e.end)})}function r(e,t){const o=[0];if(t<=0)return o;let a=0;for(const n of e)if(n.breakBefore&&n.top>a&&(a=n.top,o.push(a)),!(n.top+n.height-a<=t))if(n.height<=t)n.top>a&&(a=n.top,o.push(a));else for(;n.top+n.height-a>t;)a+=t,o.push(a);return o}function d(e,t,o=1){const a=[],n=e=>{const n=e.getBoundingClientRect();a.push({top:(n.top-t)/o,height:n.height/o,breakBefore:e.hasAttribute("data-break-before")})};for(const r of Array.from(e.children))"TABLE"===r.tagName?r.querySelectorAll("tr").forEach(n):"UL"===r.tagName||"OL"===r.tagName?r.querySelectorAll("li").forEach(n):n(r),r.querySelectorAll("[data-page-break]").forEach(e=>{const n=e.getBoundingClientRect();a.push({top:(n.bottom-t)/o,height:0,breakBefore:!0})});return a}var c=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","COLGROUP","COL","B","STRONG","I","EM","U","S","STRIKE","SUB","SUP","SPAN","FONT","A","BR","IMG","PRE","HR"]),i=new Set(["SCRIPT","STYLE","TITLE","META","LINK","OBJECT","EMBED","IFRAME","NOSCRIPT","TEMPLATE","SVG","MATH","FORM","INPUT","BUTTON","SELECT","TEXTAREA","VIDEO","AUDIO","CANVAS"]),s=new Set(["color","background-color","font-weight","font-style","text-decoration-line","text-decoration","font-family","font-size","text-align","margin-left","line-height","width","height","list-style-type"]),l=/^(https?:|mailto:|tel:|#)/i,p=/^(data:image\/(png|jpe?g|gif|webp|bmp);base64,|blob:)/i;function g(e){const t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;const o=(e,t,a)=>{for(const n of Array.from(e.childNodes)){if(3===n.nodeType){t.appendChild(a.createTextNode(n.nodeValue??""));continue}if(1!==n.nodeType)continue;const e=n,r=e.tagName.toUpperCase();if(i.has(r))continue;if(!c.has(r)){o(e,t,a);continue}if("IMG"===r&&!p.test(e.getAttribute("src")??""))continue;const d=a.createElement(r),g=(e.getAttribute("style")??"").split(";").map(e=>{const t=e.indexOf(":");if(t<0)return"";const o=e.slice(0,t).trim().toLowerCase(),a=e.slice(t+1).trim();return s.has(o)&&!/url\(|expression|mso-/i.test(a)?`${o}:${a}`:""}).filter(Boolean).join(";");g&&d.setAttribute("style",g),"A"===r&&l.test(e.getAttribute("href")??"")&&d.setAttribute("href",e.getAttribute("href")),"IMG"===r&&d.setAttribute("src",e.getAttribute("src"));for(const t of["colspan","rowspan","start","color","face","size"]){const o=e.getAttribute(t);null!==o&&d.setAttribute(t,o)}o(e,d,a),t.appendChild(d)}},a=document.createElement("div");return o(t.body,a,document),a.innerHTML}import{escapeHtml as f}from"efficient-shell/ui";var u='\nhtml,body{margin:0;background:#fff}\n.docs-page [data-comment]{background:none;border:0}\n.docs-page [data-locked]{background:none;box-shadow:none}\n.docs-page [data-page-break]{break-after:page;border:0;margin:0}\n.docs-page [data-section]::after{display:none}\n.docs-page [data-section="nextPage"]{break-after:page}\n.docs-page [data-bookmark]{display:none}\n.docs-page [data-break-before]{break-before:page}\n.docs-page tr,.docs-page img{break-inside:avoid}\n';function h(e,t){return`\n.docs-sheet{background:#fff;color:#777}\n.docs-sheet-line{border-color:#aaa}\n\n${`\n.docs-page{color:#000;background:#fff;white-space:pre-wrap;overflow-wrap:break-word;outline:none;line-height:1.08;tab-size:36pt;font-family:Calibri,Carlito,Arial,sans-serif;font-size:11pt}\n.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6{margin:0;font:inherit;font-weight:400}\n.docs-page ul,.docs-page ol{margin:0;padding-left:24pt}\n.docs-page ul{list-style-type:disc}.docs-page ol{list-style-type:decimal}\n.docs-page ul ul{list-style-type:circle}.docs-page ul ul ul{list-style-type:square}\n.docs-page a{color:#0563c1;text-decoration:underline}\n.docs-page sub,.docs-page sup{font-size:.66em}\n.docs-page img{max-width:100%}\n.docs-page table{border-collapse:collapse;table-layout:fixed;width:100%}\n.docs-page td,.docs-page th{border:.5pt solid #000;padding:0 5.4pt;vertical-align:top}\n.docs-page table[data-no-borders] td,.docs-page table[data-no-borders] th{border:.5pt dotted #bbb}\n.docs-page td p{margin-bottom:0}\n.docs-page blockquote{margin:0 0 8pt 24pt;font-style:italic}\n.docs-page hr{border:0;border-top:.75pt solid #000;margin:6pt 0}\n.docs-page [data-hidden]{display:none}\n.docs-page [data-page-break]{display:block;height:0;border-top:1pt dashed #999;margin:6pt 0;user-select:none}\n.docs-page [data-comment]{background:#fff2cc;border-bottom:1.5pt solid #e0b000}\n.docs-page [data-locked]{background:#f4f4f4;box-shadow:-5pt 0 0 #bbb;cursor:not-allowed}\n.docs-page ins{color:#c00000;text-decoration:underline}\n.docs-page del{color:#c00000;text-decoration:line-through}\n.docs-page [data-kind="object"]{display:inline-block;background:#f4f4f4;border:.75pt dashed #999;color:#555;padding:1pt 5pt;cursor:not-allowed;white-space:normal}\n.docs-page [data-kind="field"]{background:#ededed}\n.docs-page{counter-reset:docs-note}\n.docs-page [data-kind="note"]{vertical-align:super;font-size:.66em}\n.docs-page [data-note]{counter-increment:docs-note;color:#0563c1;padding:0 1pt}\n.docs-page [data-note]::after{content:counter(docs-note)}\n.docs-page [data-kind="endnote"]{vertical-align:super;font-size:.66em}\n.docs-page ul[data-checklist]{list-style:none;padding-left:20pt}\n.docs-page ul[data-checklist]>li{position:relative}\n.docs-page ul[data-checklist]>li::before{content:"\\2610";position:absolute;left:-17pt;width:14pt;text-align:center;cursor:pointer}\n.docs-page ul[data-checklist]>li[data-checked]::before{content:"\\2611"}\n.docs-page ul[data-checklist]>li[data-checked]{text-decoration:line-through;color:#777}\n.docs-page [data-bookmark]{display:inline-block;width:7pt;height:9pt;margin:0 1pt;vertical-align:-1pt;background:#1a73e8;clip-path:polygon(0 0,100% 0,100% 100%,50% 70%,0 100%);cursor:default}\n.docs-page [data-toc]{margin:6pt 0;padding:4pt 0;border-top:.5pt solid #ddd;border-bottom:.5pt solid #ddd;cursor:pointer}\n.docs-page [data-toc] p{display:flex;gap:6pt;margin:0 0 3pt}\n.docs-page [data-toc] p::after{content:"";order:1;flex:1;border-bottom:1pt dotted #999;margin-bottom:3pt}\n.docs-page [data-toc] [data-toc-page]{order:2}\n.docs-page [data-toc] [data-toc-level="2"]{padding-left:11pt}\n.docs-page [data-toc] [data-toc-level="3"]{padding-left:22pt}\n.docs-page [data-toc]:empty::before{color:#777;font-style:italic}\n.docs-page [data-section]::after{display:block;margin:6pt 0;border-top:2pt double #aaa;color:#888;font-size:8pt;text-align:center;line-height:1.6;user-select:none}\n.docs-page ::highlight(docs-find){background:#ffe680}\n.docs-page ::highlight(docs-find-current){background:#ff9f1a}\n\n${e.css}`.replaceAll(".docs-page",`.docs-page[data-doc="${t}"]`)}`}var b=e=>u.replaceAll(".docs-page",`.docs-page[data-doc="${e}"]`);function m(e,t,o){const a=e=>(e??"").replaceAll("{page}",String(t)).replaceAll("{pages}",String(o)),[n,r]=e.split(/\s*\|\s*/);return[a(n),a(r)]}function k(e,t){const[o,a]=function(e){return e.split(/\s*\|\s*/).map(e=>e.split(/(\{page\}|\{pages\})/).map(e=>"{page}"===e?"counter(page)":"{pages}"===e?"counter(pages)":e?`"${e.replace(/["\\\n\r]/g,"")}"`:"").filter(Boolean).join(" "))}(t),n="font:9pt Calibri,Carlito,Arial,sans-serif;color:#555";return`${o?`@${e}-left{content:${o};${n}}`:""}${a?`@${e}-right{content:${a};${n}}`:""}`}function y({title:e,html:t,doc:o,scope:a,page:n,header:r,footer:d}){const c=e=>Math.round(e)/20+"pt",i=`@page{size:${c(n.width)} ${c(n.height)};margin:${c(n.top)} ${c(n.right)} ${c(n.bottom)} ${c(n.left)};${k("top",r)}${k("bottom",d)}}`;return`<!doctype html><html><head><meta charset="utf-8"><meta name="generator" content="efficient-shell Documents"><title>${f(e)}</title><style>${h(o,a)}\n${b(a)}\n${i}</style></head><body><div class="docs-page" data-doc="${a}">${t}</div></body></html>`}export{t as documentText,o as countWords,a as findInNodes,n as replaceSpots,r as pageStarts,d as pageBlocks,g as sanitizeHtml,h as pageStyles,b as printStyles,m as marginText,y as pageDocument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ENGLISH_WORDS as r}from"./chunk-
|
|
1
|
+
import{ENGLISH_WORDS as r}from"./chunk-POH6OTTR.js";import{createContext as e,useContext as o}from"react";import{jsx as t}from"react/jsx-runtime";var n=e(r);function a({words:r,children:e}){return t(n.Provider,{value:r,children:e})}var i=()=>o(n);import{createContext as s,useContext as c}from"react";import{jsx as d}from"react/jsx-runtime";var m=class extends Error{},u=s({});function l({value:r,children:e}){return d(u.Provider,{value:r,children:r.words?d(a,{words:r.words,children:e}):e})}var v=()=>c(u);export{a as DocumentsWordsProvider,i as useDocumentsWords,m as DocumentsConflict,l as DocumentsProvider,v as useDocumentsHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_COL_WIDTH as t,DEFAULT_FONT_SIZE as e,DEFAULT_ROW_HEIGHT as n,FormulaError as r,colIndex as o,colLabel as s,formatKey as l,isFormula as i,newSheet as a,rangeLabel as m,shiftFormula as c,tokenize as f,usedBounds as u}from"./chunk-UDEPDAZI.js";var h=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function d(t){let e=4294967295;for(let n=0;n<t.length;n++)e=h[255&(e^t[n])]^e>>>8;return(4294967295^e)>>>0}async function g(t,e){const n=e.writable.getWriter();return n.write(t).then(()=>n.close()).catch(()=>{}),new Uint8Array(await new Response(e.readable).arrayBuffer())}async function p(t){return"undefined"==typeof CompressionStream?null:g(t,new CompressionStream("deflate-raw"))}async function $(t){return g(t,new DecompressionStream("deflate-raw"))}async function b(t){const e=new TextEncoder,n=[],r=[];let o=0;for(const s of t){const t=e.encode(s.name),l=e.encode(s.text),i=await p(l),a=null===i||i.length>=l.length,m=a?l:i,c=d(l),f=new Uint8Array(30+t.length),u=new DataView(f.buffer);u.setUint32(0,67324752,!0),u.setUint16(4,20,!0),u.setUint16(6,2048,!0),u.setUint16(8,a?0:8,!0),u.setUint32(14,c,!0),u.setUint32(18,m.length,!0),u.setUint32(22,l.length,!0),u.setUint16(26,t.length,!0),f.set(t,30);const h=new Uint8Array(46+t.length),g=new DataView(h.buffer);g.setUint32(0,33639248,!0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,2048,!0),g.setUint16(10,a?0:8,!0),g.setUint32(16,c,!0),g.setUint32(20,m.length,!0),g.setUint32(24,l.length,!0),g.setUint16(28,t.length,!0),g.setUint32(42,o,!0),h.set(t,46),n.push(f,m),r.push(h),o+=f.length+m.length}const s=r.reduce((t,e)=>t+e.length,0),l=new Uint8Array(22),i=new DataView(l.buffer);i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,s,!0),i.setUint32(16,o,!0);const a=new Uint8Array(o+s+22);let m=0;for(const t of[...n,...r,l])a.set(t,m),m+=t.length;return a}async function x(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);let n=-1;for(let r=t.length-22;r>=Math.max(0,t.length-66e3);r--)if(101010256===e.getUint32(r,!0)){n=r;break}if(n<0)throw new Error("Not a zip file");const r=e.getUint16(n+10,!0);let o=e.getUint32(n+16,!0);const s=new TextDecoder,l=new Map;for(let n=0;n<r;n++){const n=e.getUint16(o+10,!0),r=e.getUint32(o+20,!0),i=e.getUint16(o+28,!0),a=e.getUint16(o+30,!0),m=e.getUint16(o+32,!0),c=e.getUint32(o+42,!0),f=s.decode(t.subarray(o+46,o+46+i));if(o+=46+i+a+m,!/\.(xml|rels)$/i.test(f))continue;const u=c+30+e.getUint16(c+26,!0)+e.getUint16(c+28,!0),h=t.subarray(u,u+r);l.set(f,s.decode(8===n?await $(h):h))}return l}var w=new Set(["CONCAT","IFS","SWITCH","TEXTJOIN","XLOOKUP","XOR","IFNA","DAYS","STDEV.S","STDEV.P","VAR.S","VAR.P","MODE.SNGL","RANK.EQ","CEILING.MATH","FLOOR.MATH"]);function F(t){const{tokens:e}=f(t);let n="",r=0;for(const o of e){if("ident"!==o.type)continue;const e=o.value.replace(/^_xlfn\.(?:_xlws\.)?/i,"").replace(/^_xlws\./i,"");e!==o.value&&(n+=t.slice(r,o.start)+e,r=o.end)}return`=${n}${t.slice(r)}`}function y(t){return t.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var A='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n',C="http://schemas.openxmlformats.org/spreadsheetml/2006/main",v="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function N(t){return`FF${t.replace("#","").toUpperCase().padStart(6,"0").slice(0,6)}`}var U=class{fonts=[`<font><sz val="${e}"/><name val="Arial"/></font>`];fills=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>'];borders=["<border><left/><right/><top/><bottom/><diagonal/></border>"];numFmts=[];xfs=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'];seen=new Map;index(t,e){const n=t.indexOf(e);return n>=0?n:(t.push(e),t.length-1)}add(t){if(!t||!Object.keys(t).length)return 0;const n=JSON.stringify(t),r=this.seen.get(n);if(void 0!==r)return r;const o=this.index(this.fonts,`<font>${t.bold?"<b/>":""}${t.italic?"<i/>":""}${t.strike?"<strike/>":""}${t.underline?"<u/>":""}<sz val="${t.fontSize??e}"/>${t.color?`<color rgb="${N(t.color)}"/>`:""}<name val="Arial"/></font>`),s=t.fill?this.index(this.fills,`<fill><patternFill patternType="solid"><fgColor rgb="${N(t.fill)}"/><bgColor indexed="64"/></patternFill></fill>`):0,l=(t,e)=>e?`<${t} style="thin"><color auto="1"/></${t}>`:`<${t}/>`,i=t.border??{},a=this.index(this.borders,`<border>${l("left",i.left)}${l("right",i.right)}${l("top",i.top)}${l("bottom",i.bottom)}<diagonal/></border>`);let m=0;t.numFmt&&"General"!==t.numFmt&&(m="@"===t.numFmt?49:164+this.index(this.numFmts,t.numFmt));const c=t.align||t.vAlign||t.wrap?`<alignment${t.align?` horizontal="${t.align}"`:""}${t.vAlign?` vertical="${"middle"===t.vAlign?"center":t.vAlign}"`:""}${t.wrap?' wrapText="1"':""}/>`:"",f=`<xf numFmtId="${m}" fontId="${o}" fillId="${s}" borderId="${a}" xfId="0" applyFont="1"${s?' applyFill="1"':""}${a?' applyBorder="1"':""}${m?' applyNumberFormat="1"':""}${c?' applyAlignment="1"':""}${c?`>${c}</xf>`:"/>"}`;return this.xfs.push(f),this.seen.set(n,this.xfs.length-1),this.xfs.length-1}toXml(){const t=this.numFmts.length?`<numFmts count="${this.numFmts.length}">${this.numFmts.map((t,e)=>`<numFmt numFmtId="${164+e}" formatCode="${y(t)}"/>`).join("")}</numFmts>`:"";return`${A}<styleSheet xmlns="${C}">${t}<fonts count="${this.fonts.length}">${this.fonts.join("")}</fonts><fills count="${this.fills.length}">${this.fills.join("")}</fills><borders count="${this.borders.length}">${this.borders.join("")}</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}};function S(t,e,n,o,a,m){const c=`${s(a)}${o+1}`,u=t.cells[o]?.[a]??"",h=t.formats[l(o,a)],d=m.add(h),g=d?` s="${d}"`:"";if(""===u)return d?`<c r="${c}"${g}/>`:"";const p=n.value(e,o,a);if(i(u)){const t=`<f>${y(function(t){const e=t.slice(1),{tokens:n}=f(e);let r="",o=0;for(let t=0;t<n.length;t++){const s=n[t],l=n[t+1];"ident"===s.type&&"op"===l?.type&&"("===l.value&&w.has(s.value.toUpperCase())&&(r+=`${e.slice(o,s.start)}_xlfn.${s.value.toUpperCase()}`,o=s.end)}return r+e.slice(o)}(u))}</f>`;if("number"==typeof p)return`<c r="${c}"${g}>${t}<v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b">${t}<v>${p?1:0}</v></c>`;if(p instanceof r){return`<c r="${c}"${g} t="e">${t}<v>${/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)$/.test(p.code)?p.code:"#VALUE!"}</v></c>`}return`<c r="${c}"${g} t="str">${t}<v>${y(null===p?"":p)}</v></c>`}if("number"==typeof p)return`<c r="${c}"${g}><v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b"><v>${p?1:0}</v></c>`;const $=String(p??"");return`<c r="${c}"${g} t="inlineStr"><is><t${$!==$.trim()||/\n/.test($)?' xml:space="preserve"':""}>${y($)}</t></is></c>`}function k(e,r,o,l){const i=u(e);let a=i?.row??0,c=i?.col??0;const f=new Map;for(const t of Object.keys(e.formats)){const[e,n]=t.split(":").map(Number);a=Math.max(a,e),c=Math.max(c,n),f.has(e)||f.set(e,[]),f.get(e).push(n)}const h=new Set(e.hiddenRows);for(const t of[...e.hiddenRows,...Object.keys(e.rowHeights).map(Number)])a=Math.max(a,t);const d=[];for(let t=0;t<=a;t++){const n=e.cells[t]??[],s=new Set(f.get(t)??[]);n.forEach((t,e)=>{""!==t&&s.add(e)});const i=e.rowHeights[t];if(!s.size&&void 0===i&&!h.has(t))continue;const a=[...s].sort((t,e)=>t-e).map(n=>S(e,r,o,t,n,l)).join(""),m=`${void 0!==i?` ht="${(.75*i).toFixed(2)}" customHeight="1"`:""}${h.has(t)?' hidden="1"':""}`;d.push(`<row r="${t+1}"${m}>${a}</row>`)}const g=new Set(e.hiddenCols),p=[...new Set([...Object.keys(e.colWidths).map(Number),...g])].sort((t,e)=>t-e),$=p.length?`<cols>${p.map(n=>`<col min="${n+1}" max="${n+1}" width="${(((e.colWidths[n]??t)-5)/7).toFixed(4)}" customWidth="1"${g.has(n)?' hidden="1"':""}/>`).join("")}</cols>`:"",{frozenRows:b,frozenCols:x}=e,w=b||x?`<pane${x?` xSplit="${x}"`:""}${b?` ySplit="${b}"`:""} topLeftCell="${s(x)}${b+1}" activePane="${b&&x?"bottomRight":b?"bottomLeft":"topRight"}" state="frozen"/>`:"",F=e.merges.length?`<mergeCells count="${e.merges.length}">${e.merges.map(t=>`<mergeCell ref="${m(t)}"/>`).join("")}</mergeCells>`:"",y=e.filter?`<autoFilter ref="${m(e.filter.range)}"/>`:"",v=e.tabColor?`<sheetPr><tabColor rgb="${N(e.tabColor)}"/></sheetPr>`:"";return`${A}<worksheet xmlns="${C}">${v}<dimension ref="A1:${s(c)}${a+1}"/><sheetViews><sheetView${0===r?' tabSelected="1"':""} workbookViewId="0">${w}</sheetView></sheetViews><sheetFormatPr defaultColWidth="${((t-5)/7).toFixed(4)}" defaultRowHeight="${(.75*n).toFixed(2)}" customHeight="1"/>${$}<sheetData>${d.join("")}</sheetData>${y}${F}</worksheet>`}async function I(t,e){const n=new U,r=function(t){const e=new Set;return t.map((t,n)=>{const r=t.name.replace(/[[\]:*?/\\]/g," ").trim().slice(0,31)||`Sheet ${n+1}`;let o=r;for(let t=2;e.has(o.toLowerCase());t++)o=`${r.slice(0,28)} ${t}`;return e.add(o.toLowerCase()),o})}(t),o=t.map((t,r)=>({name:`xl/worksheets/sheet${r+1}.xml`,text:k(t,r,e,n)})),l=t.map((t,e)=>{return t.filter?`<definedName name="_xlnm._FilterDatabase" localSheetId="${e}" hidden="1">${y(`'${r[e].replace(/'/g,"''")}'!${n=t.filter.range,`$${s(n.c1)}$${n.r1+1}:$${s(n.c2)}$${n.r2+1}`}`)}</definedName>`:"";var n}).join("");return b([{name:"[Content_Types].xml",text:`${A}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${t.map((t,e)=>`<Override PartName="/xl/worksheets/sheet${e+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`},{name:"_rels/.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${v}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",text:`${A}<workbook xmlns="${C}" xmlns:r="${v}"><sheets>${r.map((t,e)=>`<sheet name="${y(t)}" sheetId="${e+1}" r:id="rId${e+1}"/>`).join("")}</sheets>${l?`<definedNames>${l}</definedNames>`:""}<calcPr calcId="0" fullCalcOnLoad="1"/></workbook>`},{name:"xl/_rels/workbook.xml.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((t,e)=>`<Relationship Id="rId${e+1}" Type="${v}/worksheet" Target="worksheets/sheet${e+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="${v}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",text:n.toXml()},...o])}var T={1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",14:"dd/mm/yyyy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"dd/mm/yyyy h:mm",37:"#,##0;(#,##0)",38:"#,##0;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mm:ss.0",48:"##0.0E+0",49:"@"},E=["FFFFFF","000000","E7E6E6","44546A","4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","0563C1","954F72"],M={0:"000000",1:"FFFFFF",2:"FF0000",3:"00FF00",4:"0000FF",5:"FFFF00",6:"FF00FF",7:"00FFFF",8:"000000",9:"FFFFFF",10:"FF0000",11:"00FF00",12:"0000FF",13:"FFFF00",14:"FF00FF",15:"00FFFF"};function R(t){if(!t)return;const e=t.getAttribute("rgb");if(e)return`#${e.slice(-6).toLowerCase()}`;const n=Number(t.getAttribute("tint")??0),r=t.getAttribute("theme");if(null!==r){const t=E[Number(r)];return t?`#${function(t,e){const n=n=>{const r=parseInt(t.slice(n,n+2),16),o=e<0?r*(1+e):r+(255-r)*e;return Math.round(o).toString(16).padStart(2,"0")};return`${n(0)}${n(2)}${n(4)}`}(t,n)}`.toLowerCase():void 0}const o=t.getAttribute("indexed");if(null!==o){const t=M[Number(o)];return t?`#${t}`.toLowerCase():void 0}}var D=t=>(new DOMParser).parseFromString(t,"application/xml"),j=(t,e)=>Array.from(t.getElementsByTagNameNS("*",e)),O=(t,e)=>j(t,e)[0],L=(t,e)=>Array.from(t.children).filter(t=>t.localName===e);function z(t){const e=/^([A-Z]+)(\d+)$/.exec(t);return{row:Number(e[2])-1,col:o(e[1])}}function P(t){const[e,n=e]=t.replace(/\$/g,"").split(":"),r=z(e),o=z(n);return{r1:r.row,c1:r.col,r2:o.row,c2:o.col}}function V(t,e,n,r){const o=D(e),s=a(t),i=[],m={},f=new Map;for(const t of j(o,"c")){const e=t.getAttribute("r");if(!e)continue;const{row:o,col:s}=z(e),a=r[Number(t.getAttribute("s")??0)];a&&Object.keys(a).length&&(m[l(o,s)]=a);const u=L(t,"f")[0],h=L(t,"v")[0]?.textContent??"",d=t.getAttribute("t");let g="";if(u){const t=u.getAttribute("si");if("shared"===u.getAttribute("t")&&null!==t)if(u.textContent)f.set(t,{text:u.textContent,row:o,col:s}),g=F(u.textContent);else{const e=f.get(t);e&&(g=c(F(e.text),o-e.row,s-e.col))}else u.textContent&&(g=F(u.textContent))}if(g||(g="s"===d?n[Number(h)]??"":"inlineStr"===d?j(t,"t").map(t=>t.textContent??"").join(""):"b"===d?"1"===h?"TRUE":"FALSE":h,"s"!==d&&"inlineStr"!==d&&"str"!==d||!/^(?:=|-?\d|'|true$|false$)/i.test(g)||(g=`'${g}`)),""!==g){for(;i.length<=o;)i.push([]);for(;i[o].length<=s;)i[o].push("");i[o][s]=g}}const u={},h=[];for(const t of j(o,"col")){const e=Number(t.getAttribute("min"))-1,n=Math.min(Number(t.getAttribute("max"))-1,e+500),r=Number(t.getAttribute("width")??0);for(let o=e;o<=n;o++)r&&"1"===t.getAttribute("customWidth")&&(u[o]=Math.round(7*r+5)),"1"===t.getAttribute("hidden")&&h.push(o)}const d={},g=[];for(const t of j(o,"row")){const e=Number(t.getAttribute("r"))-1,n=t.getAttribute("ht");n&&"1"===t.getAttribute("customHeight")&&(d[e]=Math.round(Number(n)/.75)),"1"===t.getAttribute("hidden")&&g.push(e)}const p=O(o,"pane"),$="frozen"===p?.getAttribute("state"),b=O(o,"autoFilter")?.getAttribute("ref"),x=R(O(o,"tabColor"));return{...s,tabColor:x,cells:i,formats:m,colWidths:u,rowHeights:d,hiddenCols:h,hiddenRows:g,merges:j(o,"mergeCell").map(t=>P(t.getAttribute("ref")??"A1")),frozenRows:$?Number(p?.getAttribute("ySplit")??0):0,frozenCols:$?Number(p?.getAttribute("xSplit")??0):0,filter:b?{range:P(b),excluded:{}}:null,rowCount:Math.max(s.rowCount,i.length+100),colCount:Math.max(s.colCount,i.reduce((t,e)=>Math.max(t,e.length),0))}}async function H(t){const e=await x(t),n=e.get("xl/workbook.xml");if(!n)throw new Error("Not a workbook");const r=D(e.get("xl/_rels/workbook.xml.rels")??"<Relationships/>"),o=new Map(j(r,"Relationship").map(t=>[t.getAttribute("Id"),t.getAttribute("Target")??""])),s=e.get("xl/sharedStrings.xml")?j(D(e.get("xl/sharedStrings.xml")),"si").map(t=>j(t,"t").filter(t=>"rPh"!==t.parentElement?.localName).map(t=>t.textContent??"").join("")):[],l=function(t){if(!t)return[];const e=D(t),n=new Map(j(e,"numFmt").map(t=>[Number(t.getAttribute("numFmtId")),t.getAttribute("formatCode")??""])),r=O(e,"fonts"),o=O(e,"fills"),s=O(e,"borders"),l=O(e,"cellXfs");if(!l)return[];const i=r?L(r,"font"):[],a=o?L(o,"fill"):[],m=s?L(s,"border"):[],c=Number(i[0]?L(i[0],"sz")[0]?.getAttribute("val")??0:0);return L(l,"xf").map(t=>{const e={},r=Number(t.getAttribute("numFmtId")??0),o=n.get(r)??T[r];o&&"General"!==o&&(e.numFmt=o);const s=i[Number(t.getAttribute("fontId")??0)];if(s){L(s,"b").length&&(e.bold=!0),L(s,"i").length&&(e.italic=!0),L(s,"u").length&&(e.underline=!0),L(s,"strike").length&&(e.strike=!0);const t=Number(L(s,"sz")[0]?.getAttribute("val")??0);t&&t!==c&&(e.fontSize=t);const n=R(L(s,"color")[0]);n&&"#000000"!==n&&(e.color=n)}const l=a[Number(t.getAttribute("fillId")??0)]?.getElementsByTagNameNS("*","patternFill")[0];if(l&&"solid"===l.getAttribute("patternType")){const t=R(L(l,"fgColor")[0]);t&&(e.fill=t)}const f=m[Number(t.getAttribute("borderId")??0)];if(f){const t=t=>!!L(f,t)[0]?.getAttribute("style"),n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")};(n.top||n.right||n.bottom||n.left)&&(e.border={...n.top?{top:!0}:{},...n.right?{right:!0}:{},...n.bottom?{bottom:!0}:{},...n.left?{left:!0}:{}})}const u=L(t,"alignment")[0];if(u){const t=u.getAttribute("horizontal");"left"!==t&&"center"!==t&&"right"!==t||(e.align=t);const n=u.getAttribute("vertical");"top"!==n&&"bottom"!==n||(e.vAlign=n),"center"===n&&(e.vAlign="middle");const r=u.getAttribute("wrapText");"1"!==r&&"true"!==r||(e.wrap=!0)}return e})}(e.get("xl/styles.xml")),i=[];for(const t of j(D(n),"sheet")){const n=t.getAttribute("name")??`Sheet ${i.length+1}`,r=t.getAttributeNS(v,"id")??t.getAttribute("r:id"),a=o.get(r)??"",m=a.startsWith("/")?a.slice(1):`xl/${a}`,c=e.get(m);c&&i.push(V(n,c,s,l))}if(!i.length)throw new Error("No sheets");return i}export{b as zip,x as unzip,I as writeXlsx,H as readXlsx};
|
|
1
|
+
import{DEFAULT_COL_WIDTH as t,DEFAULT_FONT_SIZE as e,DEFAULT_ROW_HEIGHT as n,FormulaError as r,colIndex as o,colLabel as s,formatKey as l,isFormula as i,newSheet as a,rangeLabel as m,shiftFormula as c,tokenize as f,usedBounds as u}from"./chunk-ZS45QEF4.js";var h=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function d(t){let e=4294967295;for(let n=0;n<t.length;n++)e=h[255&(e^t[n])]^e>>>8;return(4294967295^e)>>>0}async function g(t,e){const n=e.writable.getWriter();return n.write(t).then(()=>n.close()).catch(()=>{}),new Uint8Array(await new Response(e.readable).arrayBuffer())}async function p(t){return"undefined"==typeof CompressionStream?null:g(t,new CompressionStream("deflate-raw"))}async function $(t){return g(t,new DecompressionStream("deflate-raw"))}async function b(t){const e=new TextEncoder,n=[],r=[];let o=0;for(const s of t){const t=e.encode(s.name),l=e.encode(s.text),i=await p(l),a=null===i||i.length>=l.length,m=a?l:i,c=d(l),f=new Uint8Array(30+t.length),u=new DataView(f.buffer);u.setUint32(0,67324752,!0),u.setUint16(4,20,!0),u.setUint16(6,2048,!0),u.setUint16(8,a?0:8,!0),u.setUint32(14,c,!0),u.setUint32(18,m.length,!0),u.setUint32(22,l.length,!0),u.setUint16(26,t.length,!0),f.set(t,30);const h=new Uint8Array(46+t.length),g=new DataView(h.buffer);g.setUint32(0,33639248,!0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,2048,!0),g.setUint16(10,a?0:8,!0),g.setUint32(16,c,!0),g.setUint32(20,m.length,!0),g.setUint32(24,l.length,!0),g.setUint16(28,t.length,!0),g.setUint32(42,o,!0),h.set(t,46),n.push(f,m),r.push(h),o+=f.length+m.length}const s=r.reduce((t,e)=>t+e.length,0),l=new Uint8Array(22),i=new DataView(l.buffer);i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,s,!0),i.setUint32(16,o,!0);const a=new Uint8Array(o+s+22);let m=0;for(const t of[...n,...r,l])a.set(t,m),m+=t.length;return a}async function x(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);let n=-1;for(let r=t.length-22;r>=Math.max(0,t.length-66e3);r--)if(101010256===e.getUint32(r,!0)){n=r;break}if(n<0)throw new Error("Not a zip file");const r=e.getUint16(n+10,!0);let o=e.getUint32(n+16,!0);const s=new TextDecoder,l=new Map;for(let n=0;n<r;n++){const n=e.getUint16(o+10,!0),r=e.getUint32(o+20,!0),i=e.getUint16(o+28,!0),a=e.getUint16(o+30,!0),m=e.getUint16(o+32,!0),c=e.getUint32(o+42,!0),f=s.decode(t.subarray(o+46,o+46+i));if(o+=46+i+a+m,!/\.(xml|rels)$/i.test(f))continue;const u=c+30+e.getUint16(c+26,!0)+e.getUint16(c+28,!0),h=t.subarray(u,u+r);l.set(f,s.decode(8===n?await $(h):h))}return l}var w=new Set(["CONCAT","IFS","SWITCH","TEXTJOIN","XLOOKUP","XOR","IFNA","DAYS","STDEV.S","STDEV.P","VAR.S","VAR.P","MODE.SNGL","RANK.EQ","CEILING.MATH","FLOOR.MATH"]);function F(t){const{tokens:e}=f(t);let n="",r=0;for(const o of e){if("ident"!==o.type)continue;const e=o.value.replace(/^_xlfn\.(?:_xlws\.)?/i,"").replace(/^_xlws\./i,"");e!==o.value&&(n+=t.slice(r,o.start)+e,r=o.end)}return`=${n}${t.slice(r)}`}function y(t){return t.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var A='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n',C="http://schemas.openxmlformats.org/spreadsheetml/2006/main",v="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function N(t){return`FF${t.replace("#","").toUpperCase().padStart(6,"0").slice(0,6)}`}var S=class{fonts=[`<font><sz val="${e}"/><name val="Arial"/></font>`];fills=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>'];borders=["<border><left/><right/><top/><bottom/><diagonal/></border>"];numFmts=[];xfs=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'];seen=new Map;index(t,e){const n=t.indexOf(e);return n>=0?n:(t.push(e),t.length-1)}add(t){if(!t||!Object.keys(t).length)return 0;const n=JSON.stringify(t),r=this.seen.get(n);if(void 0!==r)return r;const o=this.index(this.fonts,`<font>${t.bold?"<b/>":""}${t.italic?"<i/>":""}${t.strike?"<strike/>":""}${t.underline?"<u/>":""}<sz val="${t.fontSize??e}"/>${t.color?`<color rgb="${N(t.color)}"/>`:""}<name val="Arial"/></font>`),s=t.fill?this.index(this.fills,`<fill><patternFill patternType="solid"><fgColor rgb="${N(t.fill)}"/><bgColor indexed="64"/></patternFill></fill>`):0,l=(t,e)=>e?`<${t} style="thin"><color auto="1"/></${t}>`:`<${t}/>`,i=t.border??{},a=this.index(this.borders,`<border>${l("left",i.left)}${l("right",i.right)}${l("top",i.top)}${l("bottom",i.bottom)}<diagonal/></border>`);let m=0;t.numFmt&&"General"!==t.numFmt&&(m="@"===t.numFmt?49:164+this.index(this.numFmts,t.numFmt));const c=t.align||t.vAlign||t.wrap?`<alignment${t.align?` horizontal="${t.align}"`:""}${t.vAlign?` vertical="${"middle"===t.vAlign?"center":t.vAlign}"`:""}${t.wrap?' wrapText="1"':""}/>`:"",f=`<xf numFmtId="${m}" fontId="${o}" fillId="${s}" borderId="${a}" xfId="0" applyFont="1"${s?' applyFill="1"':""}${a?' applyBorder="1"':""}${m?' applyNumberFormat="1"':""}${c?' applyAlignment="1"':""}${c?`>${c}</xf>`:"/>"}`;return this.xfs.push(f),this.seen.set(n,this.xfs.length-1),this.xfs.length-1}toXml(){const t=this.numFmts.length?`<numFmts count="${this.numFmts.length}">${this.numFmts.map((t,e)=>`<numFmt numFmtId="${164+e}" formatCode="${y(t)}"/>`).join("")}</numFmts>`:"";return`${A}<styleSheet xmlns="${C}">${t}<fonts count="${this.fonts.length}">${this.fonts.join("")}</fonts><fills count="${this.fills.length}">${this.fills.join("")}</fills><borders count="${this.borders.length}">${this.borders.join("")}</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}};function U(t,e,n,o,a,m){const c=`${s(a)}${o+1}`,u=t.cells[o]?.[a]??"",h=t.formats[l(o,a)],d=m.add(h),g=d?` s="${d}"`:"";if(""===u)return d?`<c r="${c}"${g}/>`:"";const p=n.value(e,o,a);if(i(u)){const t=`<f>${y(function(t){const e=t.slice(1),{tokens:n}=f(e);let r="",o=0;for(let t=0;t<n.length;t++){const s=n[t],l=n[t+1];"ident"===s.type&&"op"===l?.type&&"("===l.value&&w.has(s.value.toUpperCase())&&(r+=`${e.slice(o,s.start)}_xlfn.${s.value.toUpperCase()}`,o=s.end)}return r+e.slice(o)}(u))}</f>`;if("number"==typeof p)return`<c r="${c}"${g}>${t}<v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b">${t}<v>${p?1:0}</v></c>`;if(p instanceof r){return`<c r="${c}"${g} t="e">${t}<v>${/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)$/.test(p.code)?p.code:"#VALUE!"}</v></c>`}return`<c r="${c}"${g} t="str">${t}<v>${y(null===p?"":p)}</v></c>`}if("number"==typeof p)return`<c r="${c}"${g}><v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b"><v>${p?1:0}</v></c>`;const $=String(p??"");return`<c r="${c}"${g} t="inlineStr"><is><t${$!==$.trim()||/\n/.test($)?' xml:space="preserve"':""}>${y($)}</t></is></c>`}function k(e,r,o,l){const i=u(e);let a=i?.row??0,c=i?.col??0;const f=new Map;for(const t of Object.keys(e.formats)){const[e,n]=t.split(":").map(Number);a=Math.max(a,e),c=Math.max(c,n),f.has(e)||f.set(e,[]),f.get(e).push(n)}const h=new Set(e.hiddenRows);for(const t of[...e.hiddenRows,...Object.keys(e.rowHeights).map(Number)])a=Math.max(a,t);const d=[];for(let t=0;t<=a;t++){const n=e.cells[t]??[],s=new Set(f.get(t)??[]);n.forEach((t,e)=>{""!==t&&s.add(e)});const i=e.rowHeights[t];if(!s.size&&void 0===i&&!h.has(t))continue;const a=[...s].sort((t,e)=>t-e).map(n=>U(e,r,o,t,n,l)).join(""),m=`${void 0!==i?` ht="${(.75*i).toFixed(2)}" customHeight="1"`:""}${h.has(t)?' hidden="1"':""}`;d.push(`<row r="${t+1}"${m}>${a}</row>`)}const g=new Set(e.hiddenCols),p=[...new Set([...Object.keys(e.colWidths).map(Number),...g])].sort((t,e)=>t-e),$=p.length?`<cols>${p.map(n=>`<col min="${n+1}" max="${n+1}" width="${(((e.colWidths[n]??t)-5)/7).toFixed(4)}" customWidth="1"${g.has(n)?' hidden="1"':""}/>`).join("")}</cols>`:"",{frozenRows:b,frozenCols:x}=e,w=b||x?`<pane${x?` xSplit="${x}"`:""}${b?` ySplit="${b}"`:""} topLeftCell="${s(x)}${b+1}" activePane="${b&&x?"bottomRight":b?"bottomLeft":"topRight"}" state="frozen"/>`:"",F=e.merges.length?`<mergeCells count="${e.merges.length}">${e.merges.map(t=>`<mergeCell ref="${m(t)}"/>`).join("")}</mergeCells>`:"",y=e.filter?`<autoFilter ref="${m(e.filter.range)}"/>`:"",v=e.tabColor?`<sheetPr><tabColor rgb="${N(e.tabColor)}"/></sheetPr>`:"";return`${A}<worksheet xmlns="${C}">${v}<dimension ref="A1:${s(c)}${a+1}"/><sheetViews><sheetView${0===r?' tabSelected="1"':""} workbookViewId="0">${w}</sheetView></sheetViews><sheetFormatPr defaultColWidth="${((t-5)/7).toFixed(4)}" defaultRowHeight="${(.75*n).toFixed(2)}" customHeight="1"/>${$}<sheetData>${d.join("")}</sheetData>${y}${F}</worksheet>`}async function I(t,e){const n=new S,r=function(t){const e=new Set;return t.map((t,n)=>{const r=t.name.replace(/[[\]:*?/\\]/g," ").trim().slice(0,31)||`Sheet ${n+1}`;let o=r;for(let t=2;e.has(o.toLowerCase());t++)o=`${r.slice(0,28)} ${t}`;return e.add(o.toLowerCase()),o})}(t),o=t.map((t,r)=>({name:`xl/worksheets/sheet${r+1}.xml`,text:k(t,r,e,n)})),l=t.map((t,e)=>{return t.filter?`<definedName name="_xlnm._FilterDatabase" localSheetId="${e}" hidden="1">${y(`'${r[e].replace(/'/g,"''")}'!${n=t.filter.range,`$${s(n.c1)}$${n.r1+1}:$${s(n.c2)}$${n.r2+1}`}`)}</definedName>`:"";var n}).join("");return b([{name:"[Content_Types].xml",text:`${A}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${t.map((t,e)=>`<Override PartName="/xl/worksheets/sheet${e+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`},{name:"_rels/.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${v}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",text:`${A}<workbook xmlns="${C}" xmlns:r="${v}"><sheets>${r.map((t,e)=>`<sheet name="${y(t)}" sheetId="${e+1}" r:id="rId${e+1}"/>`).join("")}</sheets>${l?`<definedNames>${l}</definedNames>`:""}<calcPr calcId="0" fullCalcOnLoad="1"/></workbook>`},{name:"xl/_rels/workbook.xml.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((t,e)=>`<Relationship Id="rId${e+1}" Type="${v}/worksheet" Target="worksheets/sheet${e+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="${v}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",text:n.toXml()},...o])}var T={1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",14:"dd/mm/yyyy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"dd/mm/yyyy h:mm",37:"#,##0;(#,##0)",38:"#,##0;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mm:ss.0",48:"##0.0E+0",49:"@"},E=["FFFFFF","000000","E7E6E6","44546A","4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","0563C1","954F72"],M={0:"000000",1:"FFFFFF",2:"FF0000",3:"00FF00",4:"0000FF",5:"FFFF00",6:"FF00FF",7:"00FFFF",8:"000000",9:"FFFFFF",10:"FF0000",11:"00FF00",12:"0000FF",13:"FFFF00",14:"FF00FF",15:"00FFFF"};function R(t){if(!t)return;const e=t.getAttribute("rgb");if(e)return`#${e.slice(-6).toLowerCase()}`;const n=Number(t.getAttribute("tint")??0),r=t.getAttribute("theme");if(null!==r){const t=E[Number(r)];return t?`#${function(t,e){const n=n=>{const r=parseInt(t.slice(n,n+2),16),o=e<0?r*(1+e):r+(255-r)*e;return Math.round(o).toString(16).padStart(2,"0")};return`${n(0)}${n(2)}${n(4)}`}(t,n)}`.toLowerCase():void 0}const o=t.getAttribute("indexed");if(null!==o){const t=M[Number(o)];return t?`#${t}`.toLowerCase():void 0}}var D=t=>(new DOMParser).parseFromString(t,"application/xml"),j=(t,e)=>Array.from(t.getElementsByTagNameNS("*",e)),O=(t,e)=>j(t,e)[0],L=(t,e)=>Array.from(t.children).filter(t=>t.localName===e);function z(t){const e=/^([A-Z]+)(\d+)$/.exec(t);return{row:Number(e[2])-1,col:o(e[1])}}function V(t){const[e,n=e]=t.replace(/\$/g,"").split(":"),r=z(e),o=z(n);return{r1:r.row,c1:r.col,r2:o.row,c2:o.col}}function P(t,e,n,r){const o=D(e),s=a(t),i=[],m={},f=new Map;for(const t of j(o,"c")){const e=t.getAttribute("r");if(!e)continue;const{row:o,col:s}=z(e),a=r[Number(t.getAttribute("s")??0)];a&&Object.keys(a).length&&(m[l(o,s)]=a);const u=L(t,"f")[0],h=L(t,"v")[0]?.textContent??"",d=t.getAttribute("t");let g="";if(u){const t=u.getAttribute("si");if("shared"===u.getAttribute("t")&&null!==t)if(u.textContent)f.set(t,{text:u.textContent,row:o,col:s}),g=F(u.textContent);else{const e=f.get(t);e&&(g=c(F(e.text),o-e.row,s-e.col))}else u.textContent&&(g=F(u.textContent))}if(g||(g="s"===d?n[Number(h)]??"":"inlineStr"===d?j(t,"t").map(t=>t.textContent??"").join(""):"b"===d?"1"===h?"TRUE":"FALSE":h,"s"!==d&&"inlineStr"!==d&&"str"!==d||!/^(?:=|-?\d|'|true$|false$)/i.test(g)||(g=`'${g}`)),""!==g){for(;i.length<=o;)i.push([]);for(;i[o].length<=s;)i[o].push("");i[o][s]=g}}const u={},h=[];for(const t of j(o,"col")){const e=Number(t.getAttribute("min"))-1,n=Math.min(Number(t.getAttribute("max"))-1,e+500),r=Number(t.getAttribute("width")??0);for(let o=e;o<=n;o++)r&&"1"===t.getAttribute("customWidth")&&(u[o]=Math.round(7*r+5)),"1"===t.getAttribute("hidden")&&h.push(o)}const d={},g=[];for(const t of j(o,"row")){const e=Number(t.getAttribute("r"))-1,n=t.getAttribute("ht");n&&"1"===t.getAttribute("customHeight")&&(d[e]=Math.round(Number(n)/.75)),"1"===t.getAttribute("hidden")&&g.push(e)}const p=O(o,"pane"),$="frozen"===p?.getAttribute("state"),b=O(o,"autoFilter")?.getAttribute("ref"),x=R(O(o,"tabColor"));return{...s,tabColor:x,cells:i,formats:m,colWidths:u,rowHeights:d,hiddenCols:h,hiddenRows:g,merges:j(o,"mergeCell").map(t=>V(t.getAttribute("ref")??"A1")),frozenRows:$?Number(p?.getAttribute("ySplit")??0):0,frozenCols:$?Number(p?.getAttribute("xSplit")??0):0,filter:b?{range:V(b),excluded:{}}:null,rowCount:Math.max(s.rowCount,i.length+100),colCount:Math.max(s.colCount,i.reduce((t,e)=>Math.max(t,e.length),0))}}async function H(t){const e=await x(t),n=e.get("xl/workbook.xml");if(!n)throw new Error("Not a workbook");const r=D(e.get("xl/_rels/workbook.xml.rels")??"<Relationships/>"),o=new Map(j(r,"Relationship").map(t=>[t.getAttribute("Id"),t.getAttribute("Target")??""])),s=e.get("xl/sharedStrings.xml")?j(D(e.get("xl/sharedStrings.xml")),"si").map(t=>j(t,"t").filter(t=>"rPh"!==t.parentElement?.localName).map(t=>t.textContent??"").join("")):[],l=function(t){if(!t)return[];const e=D(t),n=new Map(j(e,"numFmt").map(t=>[Number(t.getAttribute("numFmtId")),t.getAttribute("formatCode")??""])),r=O(e,"fonts"),o=O(e,"fills"),s=O(e,"borders"),l=O(e,"cellXfs");if(!l)return[];const i=r?L(r,"font"):[],a=o?L(o,"fill"):[],m=s?L(s,"border"):[],c=Number(i[0]?L(i[0],"sz")[0]?.getAttribute("val")??0:0);return L(l,"xf").map(t=>{const e={},r=Number(t.getAttribute("numFmtId")??0),o=n.get(r)??T[r];o&&"General"!==o&&(e.numFmt=o);const s=i[Number(t.getAttribute("fontId")??0)];if(s){L(s,"b").length&&(e.bold=!0),L(s,"i").length&&(e.italic=!0),L(s,"u").length&&(e.underline=!0),L(s,"strike").length&&(e.strike=!0);const t=Number(L(s,"sz")[0]?.getAttribute("val")??0);t&&t!==c&&(e.fontSize=t);const n=R(L(s,"color")[0]);n&&"#000000"!==n&&(e.color=n)}const l=a[Number(t.getAttribute("fillId")??0)]?.getElementsByTagNameNS("*","patternFill")[0];if(l&&"solid"===l.getAttribute("patternType")){const t=R(L(l,"fgColor")[0]);t&&(e.fill=t)}const f=m[Number(t.getAttribute("borderId")??0)];if(f){const t=t=>!!L(f,t)[0]?.getAttribute("style"),n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")};(n.top||n.right||n.bottom||n.left)&&(e.border={...n.top?{top:!0}:{},...n.right?{right:!0}:{},...n.bottom?{bottom:!0}:{},...n.left?{left:!0}:{}})}const u=L(t,"alignment")[0];if(u){const t=u.getAttribute("horizontal");"left"!==t&&"center"!==t&&"right"!==t||(e.align=t);const n=u.getAttribute("vertical");"top"!==n&&"bottom"!==n||(e.vAlign=n),"center"===n&&(e.vAlign="middle");const r=u.getAttribute("wrapText");"1"!==r&&"true"!==r||(e.wrap=!0)}return e})}(e.get("xl/styles.xml")),i=[];for(const t of j(D(n),"sheet")){const n=t.getAttribute("name")??`Sheet ${i.length+1}`,r=t.getAttributeNS(v,"id")??t.getAttribute("r:id"),a=o.get(r)??"",m=a.startsWith("/")?a.slice(1):`xl/${a}`,c=e.get(m);c&&i.push(P(n,c,s,l))}if(!i.length)throw new Error("No sheets");return i}export{b as zip,x as unzip,I as writeXlsx,H as readXlsx};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ENGLISH_WORDS as r}from"./chunk-
|
|
1
|
+
import{ENGLISH_WORDS as r}from"./chunk-UKGIT2RS.js";import{newSheet as e}from"./chunk-ZS45QEF4.js";var t=["xlsx","xls","ods","csv","tsv","txt"],s=t.map(r=>`.${r}`).join(",");import{createContext as o,useContext as a}from"react";import{jsx as n}from"react/jsx-runtime";var c=o(r);function i({words:r,children:e}){return n(c.Provider,{value:r,children:e})}var m=()=>a(c);import{createContext as l,useContext as u}from"react";import{jsx as v}from"react/jsx-runtime";var p=class extends Error{},x=l({});function d({value:r,children:e}){return v(x.Provider,{value:r,children:e})}var f=()=>u(x);function h(r,t){const s=Array.isArray(r?.sheets)?r.sheets:[];return s.length?s.map(r=>({...e(r.name),...r,cells:(r.cells??[]).map(r=>(r??[]).map(r=>r??""))})):[e(t)]}export{t as SPREADSHEET_EXTENSIONS,s as SPREADSHEET_ACCEPT,i as SpreadsheetWordsProvider,m as useSpreadsheetWords,p as SpreadsheetsConflict,d as SpreadsheetsProvider,f as useSpreadsheetsHost,h as sheetsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readDocx as t}from"./chunk-
|
|
1
|
+
import{readDocx as t}from"./chunk-YKQ5UKYZ.js";import{titleOf as a}from"./chunk-XYVQTQ6N.js";async function r(r,i){const e=new Uint8Array(await i.arrayBuffer());await t(e);const n=a(i.name),c=await r.create(n);try{await r.save(c.id,e,c.version)}catch(t){throw await r.remove(c.id).catch(()=>{}),t}return{id:c.id,title:n}}export{r as importDocumentFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={styleHeading4:"Heading 4",styleHeading5:"Heading 5",styleHeading6:"Heading 6",applyStyle:e=>`Apply "${e}"`,updateStyle:e=>`Update "${e}" to match`,styleUpdated:e=>`"${e}" now looks like the selected paragraph.`,paintFormat:"Paint format",paintFormatHint:"Select the text to give this formatting.",checklist:"Checklist",paragraphSpacing:"Line and paragraph spacing",addSpaceBefore:"Add space before paragraph",removeSpaceBefore:"Remove space before paragraph",addSpaceAfter:"Add space after paragraph",removeSpaceAfter:"Remove space after paragraph",customSpacing:"Custom spacing and indents",lineSpacingCustom:"Line spacing (lines)",spacingBefore:"Space before (pt)",spacingAfter:"Space after (pt)",indentLeft:"Left indent (pt)",indentRight:"Right indent (pt)",indentSpecial:"Special indent",indentNone:"None",indentFirstLine:"First line",indentHanging:"Hanging",indentBy:"By (pt)",spacingInvalid:"Enter numbers of 0 or more, and a line spacing between 0 and 10.",ruler:"Ruler",tabStop:"Tab stop",tabStopHint:"Click to add a tab stop. Drag one off the ruler to remove it. Double-click one to change its alignment.",columns:"Columns",columnsCount:e=>1===e?"One column":2===e?"Two columns":`${e} columns`,tableOfContents:"Table of contents",tocRefresh:"Refresh table of contents",tocDelete:"Delete table of contents",footnote:"Footnote",footnotes:"Footnotes",footnotePlaceholder:"Footnote text",footnoteLocked:"This footnote holds more than text, so it is kept as it is. Edit it in Word.",bookmark:"Bookmark",bookmarkPrompt:"Name the bookmark. Letters, numbers and underscores, starting with a letter.",bookmarkInvalid:"A bookmark name starts with a letter and has only letters, numbers and underscores.",bookmarkTaken:"There is already a bookmark with that name.",linkToHeading:"Link to a heading",linkToBookmark:"Link to a bookmark",noHeadings:"No headings yet",noBookmarks:"No bookmarks yet",breakMenu:"Break",sectionBreakNext:"Section break (next page)",sectionBreakContinuous:"Section break (continuous)",removeSectionBreak:"Remove section break",headersFooters:"Headers and footers",headersFootersHint:"Click to edit headers and footers",differentFirst:"Different first page",differentOddEven:"Different odd and even pages",headerDefault:"All pages",headerOdd:"Odd pages",headerFirst:"First page",headerEven:"Even pages",pageCount:"Page count",webFonts:"Web fonts",wordFonts:"Word fonts",pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Word",backToFiles:"Back to files",filesHeading:"Documents",newFile:"New document",openFile:"Open a file",filesEmptyTitle:"Write your first document",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The document could not be made.",deleteFailed:"The document could not be deleted.",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,documentName:"Document name",documentPanel:"Document",pagePanel:"Page",outline:"Outline",outlineEmpty:"Headings in the document show here.",morePageSetup:"More page setup",export:"Export",renameFailed:"The document could not be renamed.",openFailed:"This document could not be opened.",conflict:"Somebody else saved this document, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Export to keep your changes",noStoreClean:"No autosave here. Export to keep a copy",openFromFiles:"Go back to your files to open another document.",untitled:"Untitled",loading:"Loading",newDocument:"New",open:"Open",rename:"Rename",menuFile:"File",menuInsert:"Insert",menuLayout:"Layout",save:"Save",saveDocx:"Save (.docx)",saveKeepType:"Save",saveAs:"Save as",saveAsWord:"Word document (.docx)",saveAsPdf:"PDF (from the print dialog)",saveAsWeb:"Web page (.html)",saveAsText:"Plain text (.txt)",print:"Print",undo:"Undo",redo:"Redo",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",matchCase:"Match case",previousMatch:"Previous match",nextMatch:"Next match",closeFind:"Close find",noMatches:"No matches",paragraphStyle:"Paragraph style",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",textColor:"Text color",highlight:"Highlight color",clearFormatting:"Clear formatting",bulletedList:"Bulleted list",numberedList:"Numbered list",decreaseIndent:"Decrease indent",increaseIndent:"Increase indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",justify:"Justify",lineSpacing:"Line spacing",styleNormal:"Normal",styleTitle:"Title",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleQuote:"Quote",table:"Table",image:"Image",link:"Link",linkPrompt:"Web address, or leave empty to remove the link.",linkInvalid:"That address can't be used as a link.",pageBreak:"Page break",pageNumber:"Page number",horizontalLine:"Horizontal line",rowAbove:"Insert row above",rowBelow:"Insert row below",columnLeft:"Insert column left",columnRight:"Insert column right",mergeCells:"Merge cells",mergeFailed:"These cells can't be merged: the selection would cut a merged cell.",cellShading:"Cell shading",noColor:"No color",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",imageWidth:"Image width",imageOriginalSize:"Original size",imageRemove:"Remove image",pageSetup:"Page setup",paperSize:"Size",paperLetter:"US Letter",paperLegal:"US Legal",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",marginsNormal:"Normal, 2.54 cm",marginsNarrow:"Narrow, 1.27 cm",marginsModerate:"Moderate, 1.91 cm sides",marginsWide:"Wide, 5.08 cm sides",header:"Header",footer:"Footer",headerFooterLocked:"This one holds a picture or a table, so it is kept as it is. Edit it in Word.",ok:"OK",cancel:"Cancel",dismiss:"Dismiss",zoomIn:"Zoom in",zoomOut:"Zoom out",wrapLines:"Wrap lines",objectTextBox:"Text box",objectChart:"Chart from Word. Kept as is.",objectDiagram:"Diagram from Word. Kept as is.",objectEquation:"Equation from Word. Kept as is.",objectPicture:"Picture from Word. Kept as is.",objectOther:"Object from Word. Kept as is.",objectField:"Field",discardMessage:"They haven't been saved.",discard:"Discard",keepEditing:"Keep editing",legacyDoc:".doc is the old Word format. Save it as .docx in Word first.",openedOldSave:"Opened as a document. Save it to get a Word file.",saveFailed:"The document could not be saved.",savedAsUtf8:"Saved as UTF-8: the original encoding can't be written from a browser.",dropHint:"Drop a document to open. Images insert into the page.",matchCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"1 replacement":`${e} replacements`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`Page ${e}`,pageOf:(e,t)=>`Page ${e} of ${t}`,wordCount:e=>1===e?"1 word":`${e.toLocaleString()} words`,lineColumn:(e,t)=>`Ln ${e}, Col ${t}`,lineCount:e=>1===e?"1 line":`${e.toLocaleString()} lines`,noticeComments:e=>1===e?"1 comment":`${e} comments`,noticeTracked:e=>1===e?"1 tracked change":`${e} tracked changes`,noticeObjects:e=>1===e?"1 object such as a text box":`${e} objects such as text boxes`,noticeFootnotes:e=>1===e?"1 footnote":`${e} footnotes`,noticeLead:e=>`Has ${e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}. They stay in the file, but need Word to edit.`,discardTitle:e=>`Discard your changes to ${e}?`,cannotRead:e=>`${e} can't be opened. It may be damaged or password protected.`,unsupported:e=>`Unsupported file type: .${e||"unknown"}`},a={styleHeading4:"标题 4",styleHeading5:"标题 5",styleHeading6:"标题 6",applyStyle:e=>`应用“${e}”`,updateStyle:e=>`更新“${e}”以匹配所选内容`,styleUpdated:e=>`“${e}”现在与所选段落一致。`,paintFormat:"格式刷",paintFormatHint:"选择要应用此格式的文字。",checklist:"核对清单",paragraphSpacing:"行距和段落间距",addSpaceBefore:"在段前添加间距",removeSpaceBefore:"删除段前间距",addSpaceAfter:"在段后添加间距",removeSpaceAfter:"删除段后间距",customSpacing:"自定义间距和缩进",lineSpacingCustom:"行距(行)",spacingBefore:"段前(磅)",spacingAfter:"段后(磅)",indentLeft:"左缩进(磅)",indentRight:"右缩进(磅)",indentSpecial:"特殊缩进",indentNone:"无",indentFirstLine:"首行缩进",indentHanging:"悬挂缩进",indentBy:"缩进值(磅)",spacingInvalid:"请输入不小于 0 的数字,行距须在 0 到 10 之间。",ruler:"标尺",tabStop:"制表位",tabStopHint:"单击添加制表位。将制表位拖离标尺即可删除。双击可更改其对齐方式。",columns:"分栏",columnsCount:e=>1===e?"一栏":2===e?"两栏":`${e} 栏`,tableOfContents:"目录",tocRefresh:"更新目录",tocDelete:"删除目录",footnote:"脚注",footnotes:"脚注",footnotePlaceholder:"脚注文字",footnoteLocked:"此脚注包含文字以外的内容,因此保持原样。请在 Word 中编辑。",bookmark:"书签",bookmarkPrompt:"为书签命名。可使用字母、数字和下划线,须以字母开头。",bookmarkInvalid:"书签名称须以字母开头,且只能包含字母、数字和下划线。",bookmarkTaken:"已有同名书签。",linkToHeading:"链接到标题",linkToBookmark:"链接到书签",noHeadings:"尚无标题",noBookmarks:"尚无书签",breakMenu:"分隔符",sectionBreakNext:"分节符(下一页)",sectionBreakContinuous:"分节符(连续)",removeSectionBreak:"删除分节符",headersFooters:"页眉和页脚",headersFootersHint:"单击以编辑页眉和页脚",differentFirst:"首页不同",differentOddEven:"奇偶页不同",headerDefault:"所有页",headerOdd:"奇数页",headerFirst:"首页",headerEven:"偶数页",pageCount:"总页数",webFonts:"网络字体",wordFonts:"Word 字体",pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Word",backToFiles:"返回文件",filesHeading:"文档",newFile:"新建文档",openFile:"打开文件",filesEmptyTitle:"写下您的第一份文档",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建文档。",deleteFailed:"无法删除文档。",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,documentName:"文档名称",documentPanel:"文档",pagePanel:"页面",outline:"大纲",outlineEmpty:"文档中的标题会显示在这里。",morePageSetup:"更多页面设置",export:"导出",renameFailed:"无法重命名文档。",openFailed:"无法打开此文档。",conflict:"其他人已保存此文档,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请导出以保留更改",noStoreClean:"此处不会自动保存。请导出以保留副本",openFromFiles:"请返回文件列表以打开其他文档。",untitled:"未命名",loading:"正在加载",newDocument:"新建",open:"打开",rename:"重命名",menuFile:"文件",menuInsert:"插入",menuLayout:"布局",save:"保存",saveDocx:"保存 (.docx)",saveKeepType:"保存",saveAs:"另存为",saveAsWord:"Word 文档 (.docx)",saveAsPdf:"PDF(通过打印对话框)",saveAsWeb:"网页 (.html)",saveAsText:"纯文本 (.txt)",print:"打印",undo:"撤销",redo:"重做",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",matchCase:"区分大小写",previousMatch:"上一个匹配项",nextMatch:"下一个匹配项",closeFind:"关闭查找",noMatches:"无匹配项",paragraphStyle:"段落样式",font:"字体",fontSize:"字号",bold:"加粗",italic:"倾斜",underline:"下划线",strikethrough:"删除线",superscript:"上标",subscript:"下标",textColor:"文字颜色",highlight:"突出显示颜色",clearFormatting:"清除格式",bulletedList:"项目符号列表",numberedList:"编号列表",decreaseIndent:"减少缩进",increaseIndent:"增加缩进",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",justify:"两端对齐",lineSpacing:"行距",styleNormal:"正文",styleTitle:"标题",styleHeading1:"标题 1",styleHeading2:"标题 2",styleHeading3:"标题 3",styleQuote:"引用",table:"表格",image:"图片",link:"链接",linkPrompt:"输入网址;留空则移除链接。",linkInvalid:"该地址不能用作链接。",pageBreak:"分页符",pageNumber:"页码",horizontalLine:"水平线",rowAbove:"在上方插入行",rowBelow:"在下方插入行",columnLeft:"在左侧插入列",columnRight:"在右侧插入列",mergeCells:"合并单元格",mergeFailed:"无法合并这些单元格:所选范围会切开已合并的单元格。",cellShading:"单元格底纹",noColor:"无颜色",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",imageWidth:"图片宽度",imageOriginalSize:"原始大小",imageRemove:"移除图片",pageSetup:"页面设置",paperSize:"纸张大小",paperLetter:"美国信纸",paperLegal:"美国法律用纸",custom:"自定义",orientation:"方向",portrait:"纵向",landscape:"横向",margins:"页边距",marginsNormal:"常规,2.54 厘米",marginsNarrow:"窄,1.27 厘米",marginsModerate:"中等,左右 1.91 厘米",marginsWide:"宽,左右 5.08 厘米",header:"页眉",footer:"页脚",headerFooterLocked:"此处包含图片或表格,因此保持原样。请在 Word 中编辑。",ok:"确定",cancel:"取消",dismiss:"关闭",zoomIn:"放大",zoomOut:"缩小",wrapLines:"自动换行",objectTextBox:"文本框",objectChart:"来自 Word 的图表,保持原样。",objectDiagram:"来自 Word 的示意图,保持原样。",objectEquation:"来自 Word 的公式,保持原样。",objectPicture:"来自 Word 的图片,保持原样。",objectOther:"来自 Word 的对象,保持原样。",objectField:"域",discardMessage:"这些更改尚未保存。",discard:"放弃",keepEditing:"继续编辑",legacyDoc:".doc 是旧版 Word 格式,请先在 Word 中另存为 .docx。",openedOldSave:"已作为文档打开。保存后即可得到 Word 文件。",saveFailed:"无法保存文档。",savedAsUtf8:"已保存为 UTF-8:浏览器无法写入原始编码。",dropHint:"拖放文档以打开;图片会插入页面。",matchCount:(e,t)=>`第 ${e} 个,共 ${t} 个`,replacedCount:e=>`已替换 ${e} 处`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`第 ${e} 页`,pageOf:(e,t)=>`第 ${e} 页,共 ${t} 页`,wordCount:e=>`${e.toLocaleString()} 字`,lineColumn:(e,t)=>`第 ${e} 行,第 ${t} 列`,lineCount:e=>`${e.toLocaleString()} 行`,noticeComments:e=>`${e} 条批注`,noticeTracked:e=>`${e} 处修订`,noticeObjects:e=>`${e} 个文本框等对象`,noticeFootnotes:e=>`${e} 条脚注`,noticeLead:e=>`包含 ${e.join("、")}。它们会保留在文件中,但需要在 Word 中编辑。`,discardTitle:e=>`放弃对 ${e} 的更改?`,cannotRead:e=>`无法打开 ${e}。文件可能已损坏或受密码保护。`,unsupported:e=>`不支持的文件类型:.${e||"未知"}`};export{o as ENGLISH_WORDS,a as ZH_HANS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var a={ABS:"Absolute value",AND:"True if all are true",AVERAGE:"Average of numbers",AVERAGEIF:"Average where a test passes",AVERAGEIFS:"Average on many tests",CEILING:"Rounds up to a multiple","CEILING.MATH":"Rounds up to a multiple",CHAR:"Character for a Unicode number",CHOOSE:"Picks by position",CLEAN:"Removes control characters",CODE:"Unicode number of the first character",COLUMN:"Column number",COLUMNS:"Number of columns",CONCAT:"Joins text",CONCATENATE:"Joins text",COS:"Cosine",COUNT:"Counts numbers",COUNTA:"Counts non-blank cells",COUNTBLANK:"Counts blank cells",COUNTIF:"Counts where a test passes",COUNTIFS:"Counts on many tests",DATE:"Builds a date",DATEDIF:"Time between dates",DATEVALUE:"Date from text",DAY:"Day of the month",DAYS:"Days between dates",EDATE:"Date some months away",EOMONTH:"Last day of a month",EXACT:"Same text, case included",EXP:"e to a power",FIND:"Position of text, case exact",FLOOR:"Rounds down to a multiple","FLOOR.MATH":"Rounds down to a multiple",FV:"Future value",HLOOKUP:"Looks along the top row",HOUR:"Hour of a time",IF:"One value or another",IFERROR:"A fallback for an error",IFNA:"A fallback for #N/A",IFS:"First test that passes",INDEX:"The cell at a position",INT:"Rounds down to a whole number",ISBLANK:"True if blank",ISERR:"True if an error other than #N/A",ISERROR:"True if an error",ISEVEN:"True if even",ISLOGICAL:"True if TRUE or FALSE",ISNA:"True if #N/A",ISNUMBER:"True if a number",ISODD:"True if odd",ISOWEEKNUM:"ISO week of the year",ISTEXT:"True if text",LARGE:"The kth largest",LEFT:"Text from the start",LEN:"Length of text",LN:"Natural logarithm",LOG:"Logarithm",LOG10:"Base-10 logarithm",LOWER:"Lower case",MATCH:"Position of a value",MAX:"Largest number",MAXIFS:"Largest where all tests pass",MEDIAN:"Middle number",MID:"Text from the middle",MIN:"Smallest number",MINIFS:"Smallest where all tests pass",MINUTE:"Minute of a time",MOD:"Remainder",MODE:"Most common number","MODE.SNGL":"Most common number",MONTH:"Month of a date",MROUND:"Rounds to the nearest multiple",N:"A value as a number",NA:"The #N/A error",NETWORKDAYS:"Working days between dates","NETWORKDAYS.INTL":"Working days, your weekend",NOT:"The opposite",NOW:"Date and time now",NPV:"Net present value",OR:"True if any is true",PERCENTILE:"Value at a percentile","PERCENTILE.INC":"Value at a percentile",PI:"The number pi",PMT:"Loan payment",POWER:"A number to a power",PRODUCT:"Multiplies numbers",PROPER:"Capitals on each word",PV:"Present value",QUARTILE:"Value at a quartile","QUARTILE.INC":"Value at a quartile",QUOTIENT:"Whole part of a division",RAND:"Random from 0 to 1",RANDBETWEEN:"Random whole number",RANK:"Rank in a list","RANK.EQ":"Rank in a list",REGEXEXTRACT:"Text a pattern finds",REGEXMATCH:"True if a pattern matches",REGEXREPLACE:"Replaces what a pattern finds",REPLACE:"Replaces by position",REPT:"Repeats text",RIGHT:"Text from the end",ROUND:"Rounds a number",ROUNDDOWN:"Rounds toward zero",ROUNDUP:"Rounds away from zero",ROW:"Row number",ROWS:"Number of rows",SEARCH:"Position of text, any case",SECOND:"Second of a time",SIGN:"Sign of a number",SIN:"Sine",SMALL:"The kth smallest",SQRT:"Square root",STDEV:"Standard deviation of a sample","STDEV.P":"Standard deviation of everything","STDEV.S":"Standard deviation of a sample",STDEVP:"Standard deviation of everything",SUBSTITUTE:"Replaces text",SUBTOTAL:"Total that skips other subtotals",SUM:"Adds numbers",SUMIF:"Adds where a test passes",SUMIFS:"Adds on many tests",SUMPRODUCT:"Multiplies, then adds",SWITCH:"Picks a result by value",TAN:"Tangent",TEXT:"A number as formatted text",TEXTJOIN:"Joins with a separator",TIME:"Builds a time",TIMEVALUE:"Time from text",TODAY:"Today's date",TRIM:"Removes extra spaces",TRUNC:"Cuts off decimals",UPPER:"Upper case",VALUE:"Text as a number",VAR:"Variance of a sample","VAR.P":"Variance of everything","VAR.S":"Variance of a sample",VARP:"Variance of everything",VLOOKUP:"Looks down the first column",WEEKDAY:"Day of the week",WEEKNUM:"Week of the year",WORKDAY:"Date some working days away","WORKDAY.INTL":"Working days away, your weekend",XLOOKUP:"Looks up in any column",XOR:"True if an odd number are true",YEAR:"Year of a date",YEARFRAC:"Years between dates, as a fraction"},o={ABS:"绝对值",AND:"全部为真时返回真",AVERAGE:"数字的平均值",AVERAGEIF:"满足条件的平均值",AVERAGEIFS:"满足多个条件的平均值",CEILING:"向上舍入到倍数","CEILING.MATH":"向上舍入到倍数",CHAR:"Unicode 编号对应的字符",CHOOSE:"按位置选择",CLEAN:"删除控制字符",CODE:"首字符的 Unicode 编号",COLUMN:"列号",COLUMNS:"列数",CONCAT:"连接文本",CONCATENATE:"连接文本",COS:"余弦",COUNT:"统计数字个数",COUNTA:"统计非空单元格",COUNTBLANK:"统计空单元格",COUNTIF:"统计满足条件的个数",COUNTIFS:"统计满足多个条件的个数",DATE:"生成日期",DATEDIF:"两个日期的间隔",DATEVALUE:"将文本转换为日期",DAY:"月份中的第几天",DAYS:"两个日期相差的天数",EDATE:"相隔若干个月的日期",EOMONTH:"月份的最后一天",EXACT:"文本完全相同",EXP:"e 的幂",FIND:"文本位置(区分大小写)",FLOOR:"向下舍入到倍数","FLOOR.MATH":"向下舍入到倍数",FV:"未来值",HLOOKUP:"在首行中查找",HOUR:"时间中的小时",IF:"二选一返回值",IFERROR:"出错时的备用值",IFNA:"#N/A 时的备用值",IFS:"第一个满足的条件",INDEX:"指定位置的单元格",INT:"向下取整",ISBLANK:"为空时返回真",ISERR:"为 #N/A 以外的错误时返回真",ISERROR:"为错误时返回真",ISEVEN:"为偶数时返回真",ISLOGICAL:"为逻辑值时返回真",ISNA:"为 #N/A 时返回真",ISNUMBER:"为数字时返回真",ISODD:"为奇数时返回真",ISOWEEKNUM:"ISO 周数",ISTEXT:"为文本时返回真",LARGE:"第 k 大的值",LEFT:"从开头截取文本",LEN:"文本长度",LN:"自然对数",LOG:"对数",LOG10:"以 10 为底的对数",LOWER:"转为小写",MATCH:"值的位置",MAX:"最大值",MAXIFS:"满足全部条件的最大值",MEDIAN:"中位数",MID:"从中间截取文本",MIN:"最小值",MINIFS:"满足全部条件的最小值",MINUTE:"时间中的分钟",MOD:"余数",MODE:"出现最多的数字","MODE.SNGL":"出现最多的数字",MONTH:"日期中的月份",MROUND:"舍入到最接近的倍数",N:"转为数字",NA:"#N/A 错误",NETWORKDAYS:"两个日期之间的工作日","NETWORKDAYS.INTL":"工作日天数(自定义周末)",NOT:"取反",NOW:"当前日期和时间",NPV:"净现值",OR:"任一为真时返回真",PERCENTILE:"百分位数","PERCENTILE.INC":"百分位数",PI:"圆周率",PMT:"贷款每期还款额",POWER:"幂运算",PRODUCT:"数字相乘",PROPER:"每个单词首字母大写",PV:"现值",QUARTILE:"四分位数","QUARTILE.INC":"四分位数",QUOTIENT:"除法的整数部分",RAND:"0 到 1 之间的随机数",RANDBETWEEN:"随机整数",RANK:"在列表中的排名","RANK.EQ":"在列表中的排名",REGEXEXTRACT:"提取正则表达式匹配的文本",REGEXMATCH:"匹配正则表达式时返回真",REGEXREPLACE:"替换正则表达式匹配的文本",REPLACE:"按位置替换",REPT:"重复文本",RIGHT:"从末尾截取文本",ROUND:"四舍五入",ROUNDDOWN:"向零舍入",ROUNDUP:"远离零舍入",ROW:"行号",ROWS:"行数",SEARCH:"文本位置(不区分大小写)",SECOND:"时间中的秒",SIGN:"数字的符号",SIN:"正弦",SMALL:"第 k 小的值",SQRT:"平方根",STDEV:"样本标准差","STDEV.P":"总体标准差","STDEV.S":"样本标准差",STDEVP:"总体标准差",SUBSTITUTE:"替换文本",SUBTOTAL:"跳过其他小计的汇总",SUM:"数字求和",SUMIF:"对满足条件的值求和",SUMIFS:"对满足多个条件的值求和",SUMPRODUCT:"相乘后求和",SWITCH:"按值选择结果",TAN:"正切",TEXT:"数字转为带格式的文本",TEXTJOIN:"用分隔符连接",TIME:"生成时间",TIMEVALUE:"将文本转换为时间",TODAY:"今天的日期",TRIM:"删除多余空格",TRUNC:"截去小数",UPPER:"转为大写",VALUE:"文本转为数字",VAR:"样本方差","VAR.P":"总体方差","VAR.S":"样本方差",VARP:"总体方差",VLOOKUP:"在首列中查找",WEEKDAY:"星期几",WEEKNUM:"一年中的第几周",WORKDAY:"若干工作日后的日期","WORKDAY.INTL":"若干工作日后的日期(自定义周末)",XLOOKUP:"在任意列中查找",XOR:"奇数个为真时返回真",YEAR:"日期中的年份",YEARFRAC:"两个日期之间的年数(小数)"},r={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Excel",untitled:"Untitled",backToFiles:"Back to files",filesHeading:"Spreadsheets",newFile:"New spreadsheet",openFile:"Open a file",filesEmptyTitle:"Make your first spreadsheet",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The spreadsheet could not be made.",deleteFailed:"The spreadsheet could not be deleted.",storedOpenFailed:"This spreadsheet could not be opened.",loading:"Loading",renameFailed:"The spreadsheet could not be renamed.",conflict:"Somebody else saved this spreadsheet, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Save as Excel to keep your changes",saveToFiles:"Save to Files",noStoreClean:"No autosave here. Save as Excel to keep a copy",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,spreadsheetFile:"spreadsheet",sheetBase:"Sheet",menuFile:"File",menuEdit:"Edit",menuView:"View",menuInsert:"Insert",menuFormat:"Format",menuData:"Data",menuNew:"New",menuOpen:"Open",saveExcel:"Save as Excel (.xlsx)",saveCsv:"Download this sheet as CSV",email:"Email",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",pasteValues:"Paste values only",pasteFormats:"Paste formatting only",findReplace:"Find and replace",clearValues:"Clear contents",freeze:"Freeze",gridlines:"Gridlines",showFormulas:"Show formulas",rowsAbove:"Rows above",rowsBelow:"Rows below",columnsLeft:"Columns left",columnsRight:"Columns right",sheet:"Sheet",function:"Function",functions:"Functions",number:"Number format",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font size",alignment:"Alignment",borders:"Borders",wrapText:"Wrap text",mergeCells:"Merge cells",clearFormatting:"Clear formatting",sortAscending:"Sort A to Z",sortDescending:"Sort Z to A",filter:"Filter",hideRows:"Hide rows",hideColumns:"Hide columns",unhideRows:"Show hidden rows",unhideColumns:"Show hidden columns",deleteRows:"Delete rows",deleteColumns:"Delete columns",formatGeneral:"Automatic",formatNumber:"Number",formatPercent:"Percent",formatScientific:"Scientific",formatCurrency:"Currency",formatDate:"Date",formatTime:"Time",formatDateTime:"Date and time",formatText:"Plain text",bordersAll:"All borders",bordersOuter:"Outer borders",bordersTop:"Top border",bordersBottom:"Bottom border",bordersLeft:"Left border",bordersRight:"Right border",bordersNone:"No borders",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",alignTop:"Top",alignMiddle:"Middle",alignBottom:"Bottom",formatPainter:"Paint format",fewerDecimals:"Fewer decimal places",moreDecimals:"More decimal places",textColor:"Text color",fillColor:"Fill color",nameBox:"Selected cells",formulaBar:"Formula bar",cellEditor:"Cell contents",selectAll:"Select all",fillHandle:"Fill",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",previous:"Previous",next:"Next",close:"Close",matchCase:"Match case",wholeCell:"Whole cell",inFormulas:"In formulas",addSheet:"Add sheet",rename:"Rename",duplicate:"Duplicate",moveLeft:"Move left",moveRight:"Move right",tabColor:"Tab color",noColor:"No color",deleteSheet:"Delete sheet",deleteSheetTitle:"Delete this sheet?",sheetNameTaken:"Another sheet already has that name.",saveFailed:"Could not save the workbook. Try again.",openFailed:"Could not open that file. It may be damaged or an unsupported type.",statSum:"Sum",statAverage:"Average",statCount:"Count",statMin:"Min",statMax:"Max",blank:"(Blank)",clear:"Clear",apply:"Apply",sheetName:e=>`Sheet ${e}`,filterColumn:e=>`Filter column ${e}`,freezeRows:e=>0===e?"No frozen rows":1===e?"1 row":`${e} rows`,freezeColumns:e=>0===e?"No frozen columns":1===e?"1 column":`${e} columns`,freezeUpToRow:e=>`Up to row ${e}`,freezeUpToColumn:e=>`Up to column ${e}`,hitCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"Replaced in 1 cell":`Replaced in ${e} cells`,deleteSheetMessage:e=>`"${e}" and everything on it will be deleted. Formulas that use it will show #REF!.`,functionHelp:e=>a[e]??String(e)},l={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Excel",untitled:"未命名",backToFiles:"返回文件",filesHeading:"电子表格",newFile:"新建电子表格",openFile:"打开文件",filesEmptyTitle:"创建您的第一个电子表格",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建电子表格。",deleteFailed:"无法删除电子表格。",storedOpenFailed:"无法打开此电子表格。",loading:"正在加载",renameFailed:"无法重命名电子表格。",conflict:"其他人已保存此电子表格,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请另存为 Excel 以保留更改",saveToFiles:"保存到文件",noStoreClean:"此处不会自动保存。请另存为 Excel 以保留副本",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,spreadsheetFile:"电子表格",sheetBase:"工作表",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuInsert:"插入",menuFormat:"格式",menuData:"数据",menuNew:"新建",menuOpen:"打开",saveExcel:"另存为 Excel(.xlsx)",saveCsv:"将此工作表下载为 CSV",email:"发送邮件",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",pasteValues:"仅粘贴数值",pasteFormats:"仅粘贴格式",findReplace:"查找和替换",clearValues:"清除内容",freeze:"冻结",gridlines:"网格线",showFormulas:"显示公式",rowsAbove:"在上方插入行",rowsBelow:"在下方插入行",columnsLeft:"在左侧插入列",columnsRight:"在右侧插入列",sheet:"工作表",function:"函数",functions:"函数",number:"数字格式",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontSize:"字号",alignment:"对齐",borders:"边框",wrapText:"自动换行",mergeCells:"合并单元格",clearFormatting:"清除格式",sortAscending:"升序排序",sortDescending:"降序排序",filter:"筛选",hideRows:"隐藏行",hideColumns:"隐藏列",unhideRows:"显示隐藏的行",unhideColumns:"显示隐藏的列",deleteRows:"删除行",deleteColumns:"删除列",formatGeneral:"自动",formatNumber:"数字",formatPercent:"百分比",formatScientific:"科学计数",formatCurrency:"货币",formatDate:"日期",formatTime:"时间",formatDateTime:"日期和时间",formatText:"纯文本",bordersAll:"所有边框",bordersOuter:"外边框",bordersTop:"上边框",bordersBottom:"下边框",bordersLeft:"左边框",bordersRight:"右边框",bordersNone:"无边框",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",formatPainter:"格式刷",fewerDecimals:"减少小数位",moreDecimals:"增加小数位",textColor:"文字颜色",fillColor:"填充颜色",nameBox:"所选单元格",formulaBar:"编辑栏",cellEditor:"单元格内容",selectAll:"全选",fillHandle:"填充",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",previous:"上一个",next:"下一个",close:"关闭",matchCase:"区分大小写",wholeCell:"整个单元格",inFormulas:"在公式中",addSheet:"添加工作表",rename:"重命名",duplicate:"复制工作表",moveLeft:"左移",moveRight:"右移",tabColor:"标签颜色",noColor:"无颜色",deleteSheet:"删除工作表",deleteSheetTitle:"删除此工作表?",sheetNameTaken:"已有工作表使用该名称。",saveFailed:"无法保存工作簿,请重试。",openFailed:"无法打开该文件,文件可能已损坏或类型不受支持。",statSum:"求和",statAverage:"平均值",statCount:"计数",statMin:"最小值",statMax:"最大值",blank:"(空白)",clear:"清除",apply:"应用",sheetName:e=>`工作表 ${e}`,filterColumn:e=>`筛选 ${e} 列`,freezeRows:e=>0===e?"不冻结行":`${e} 行`,freezeColumns:e=>0===e?"不冻结列":`${e} 列`,freezeUpToRow:e=>`冻结至第 ${e} 行`,freezeUpToColumn:e=>`冻结至 ${e} 列`,hitCount:(e,t)=>`${e} / ${t}`,replacedCount:e=>`已替换 ${e} 个单元格`,deleteSheetMessage:e=>`将删除“${e}”及其全部内容。引用它的公式将显示 #REF!。`,functionHelp:e=>o[e]??String(e)};export{r as ENGLISH_WORDS,l as ZH_HANS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BUILTIN_STYLES as t,CHECK_BULLETS as e,DEFAULT_PAGE as a,REL as n,child as r,childrenOf as o,descendants as s,paraCss as c,parseParaProps as l,parseRunProps as d,parseXml as i,partText as w,readRels as m,readThemeFonts as p,readZip as f,resolveTarget as u,runCss as h,tabCss as b,tabsAttr as g}from"./chunk-D3JKD7KW.js";import{escapeHtml as $}from"efficient-shell/ui";var v={textBox:"Text box",chart:"Chart",diagram:"Diagram",equation:"Equation",picture:"Picture",object:"Object",contents:"Field"},x={text:"",html:"",editable:!0},k=()=>({default:{...x},first:{...x},even:{...x}}),y=new Set(["w:ins","w:del","w:moveFrom","w:moveTo","w:rPrChange","w:pPrChange","w:tcPrChange","w:trPrChange","w:tblPrChange","w:sectPrChange","w:cellIns","w:cellDel"]),P=new Set(["w:ins","w:del","w:moveFrom","w:moveTo"]),j={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml"},C=/^(https?:|mailto:|tel:)/i,S=t=>$(t);function M(t,e){let a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode(...t.subarray(e,e+32768));return`data:${e};base64,${btoa(a)}`}var I=(t,e)=>`${e}${++t.nextId}`,T=(t,e)=>t.src.slice(e.start,e.end),N=(t,e)=>e?T(t,e):void 0;function A(t,e){const a=[],n=new Set;let o=e;for(;o&&!n.has(o);){n.add(o);const e=t.styles.get(o);if(!e)break;a.unshift(e),o=r(e,"w:basedOn")?.attrs["w:val"]}return a}var E=t=>`"${t.replace(/["\\\n\r]/g,"")}"`;function O(t){return"w:t"===t.name||"w:delText"===t.name?t.text:"w:tab"===t.name?"\t":"w:instrText"===t.name||"w:instrDelText"===t.name?"":t.children.map(O).join("")}function B(t,e,a,n,r=""){const o=I(t,"x");return t.doc.raw.set(o,e),`<span data-raw="${o}" data-kind="${a}" contenteditable="false"${r}>${$(n)}</span>`}function L(t,e){const a=I(t,"x");return t.doc.raw.set(a,e),`<span data-raw="${a}" data-kind="mark"></span>`}function R(t,e,a){const n=a(T(t,e)),o=t=>s(e,new Set([t])).length>0,c=r(e,"wp:inline"),l=s(e,new Set(["a:blip"]))[0],d=l&&t.rels.get(l.attrs["r:embed"]),i=d&&!d.external?u(t.doc.docPath,d.target):void 0,w=i?.split(".").pop()?.toLowerCase()??"",m=i?t.doc.parts.get(i):void 0;if(m&&j[w]&&!o("wps:txbx")){const a=I(t,"x");t.doc.raw.set(a,n);const o=r(c??r(e,"wp:anchor"),"wp:extent"),s=Number(o?.attrs.cx)/12700,l=Number(o?.attrs.cy)/12700,d=s&&l?` style="width:${Math.round(100*s)/100}pt;height:${Math.round(100*l)/100}pt"`:"",i=c?"":' contenteditable="false"';return c||t.doc.notices.objects++,`<img data-raw="${a}" src="${S(t.imageUrl(m,j[w]))}"${d}${i} alt="">`}return t.doc.notices.objects++,o("wps:txbx")||o("w:txbxContent")?B(t,n,"object",`${t.labels.textBox}: ${O(e).slice(0,80)}`):o("c:chart")?B(t,n,"object",t.labels.chart):o("dgm:relIds")?B(t,n,"object",t.labels.diagram):B(t,n,"object",l?t.labels.picture:t.labels.object)}function F(t,e){const a=r(e,"w:rPr"),n=d(a,t.theme),o=N(t,a)??"",c=t=>`<w:r>${o}${t}</w:r>`;let l="";for(const a of e.children)switch(a.name){case"w:rPr":case"w:lastRenderedPageBreak":case"w:commentReference":case"w:fldChar":case"w:instrText":case"w:delInstrText":break;case"w:t":case"w:delText":l+=$(a.text);break;case"w:tab":l+="\t";break;case"w:noBreakHyphen":l+="‑";break;case"w:softHyphen":l+="";break;case"w:br":case"w:cr":"page"===a.attrs["w:type"]?l+='<span data-page-break contenteditable="false"></span>':"column"===a.attrs["w:type"]?l+=B(t,c(T(t,a)),"mark",""):l+="<br>";break;case"w:drawing":l+=R(t,a,c);break;case"mc:AlternateContent":case"w:pict":case"w:object":t.doc.notices.objects++,l+=B(t,c(T(t,a)),"object",s(a,new Set(["wps:txbx","w:txbxContent","v:textbox"])).length?`${t.labels.textBox}: ${O(s(a,new Set(["wps:txbx","w:txbxContent","v:textbox"]))[0]).slice(0,80)}`:t.labels.object);break;case"w:footnoteReference":{const e=a.attrs["w:id"],n=I(t,"x");t.doc.raw.set(n,c(T(t,a))),l+=`<span data-raw="${n}" data-kind="note" data-note="${S(e)}" contenteditable="false"></span>`;break}case"w:endnoteReference":{const e=++t.footnoteCount;t.doc.notices.footnotes++;const n=t.footnotes.get(a.attrs["w:id"]);l+=B(t,c(T(t,a)),"endnote",String(e),n?` title="${S(n)}"`:"");break}default:l+=B(t,c(T(t,a)),"mark","")}if(!l)return"";if(n.vert&&(l=`<${"sub"===n.vert?"sub":"sup"}>${l}</${"sub"===n.vert?"sub":"sup"}>`),a){const e=I(t,"r");t.doc.runs.set(e,o);const s=h(n),c=r(a,"w:rStyle")?.attrs["w:val"];l=`<span data-r="${e}"${c?` data-rstyle="${S(c)}"`:""}${s?` style="${S(s)}"`:""}>${l}</span>`}for(const e of t.openComments)l=`<span data-comment="${S(e)}" title="${S(t.comments.get(e)??"")}">${l}</span>`;return l}function D(t,e){let a="",n=0,r=-1,s=-1,c="",l="",d=!1;const i=()=>{if(r>=0){const e=J(l);a+=B(t,t.src.slice(r,s),"field",c||t.labels.contents,e?` data-field="${e}"`:"")}l="",r=-1,c="",d=!1};for(const w of e){if("w:r"===w.name){const e=o(w,"w:fldChar");if(e.length||n>0){if(0===n&&(r=w.start,d=!1),d)c+=O(w);else for(const t of o(w,"w:instrText"))l+=t.text;for(const t of e){const e=t.attrs["w:fldCharType"];"begin"===e?n++:"separate"===e&&1===n?d=!0:"end"===e&&n--}s=w.end,0===n&&i();continue}a+=F(t,w);continue}if(n>0)s=w.end;else switch(w.name){case"w:pPr":case"w:proofErr":break;case"w:commentRangeStart":t.openComments.add(w.attrs["w:id"]);break;case"w:commentRangeEnd":t.openComments.delete(w.attrs["w:id"]);break;case"w:hyperlink":{const e=w.attrs["r:id"]?t.rels.get(w.attrs["r:id"]):void 0,n=w.attrs["w:anchor"],r=e?.target??(n?`#${n}`:""),o=C.test(r)||r.startsWith("#"),s=`${e?` data-rel="${S(w.attrs["r:id"])}"`:""}${n?` data-anchor="${S(n)}"`:""}`;a+=`<a${o?` href="${S(r)}"`:""}${s}>${D(t,w.children)}</a>`;break}case"w:ins":case"w:moveTo":a+=`<ins>${D(t,w.children)}</ins>`;break;case"w:del":case"w:moveFrom":a+=`<del>${D(t,w.children)}</del>`;break;case"w:bookmarkStart":{const e=w.attrs["w:name"]??"",n=I(t,"x");t.doc.raw.set(n,T(t,w)),a+=e&&!e.startsWith("_")?`<span data-raw="${n}" data-kind="mark" data-bookmark="${S(e)}" contenteditable="false"></span>`:`<span data-raw="${n}" data-kind="mark"${e.startsWith("_Toc")?` data-toc-anchor="${S(e)}"`:""}></span>`;break}case"w:bookmarkEnd":case"w:permStart":case"w:permEnd":default:a+=L(t,T(t,w));break;case"m:oMath":case"m:oMathPara":t.doc.notices.objects++,a+=B(t,T(t,w),"object",t.labels.equation);break;case"w:fldSimple":case"w:sdt":case"w:smartTag":case"w:customXml":{const e="w:fldSimple"===w.name?J(w.attrs["w:instr"]??""):"";a+=B(t,T(t,w),"field",O(w)||t.labels.contents,e?` data-field="${e}"`:"");break}}}return n>0&&(a+=$(c)),a}function q(t){return s(t,y).length>0}function W(t,e){const a=r(e,"w:pPr"),n=r(a,"w:pStyle")?.attrs["w:val"],o=r(a,"w:numPr")??function(t,e){let a;for(const n of A(t,e))a=r(r(n,"w:pPr"),"w:numPr")??a;return a}(t,n),s=r(o,"w:numId")?.attrs["w:val"];if(!s||"0"===s)return null;const c=Number(r(o,"w:ilvl")?.attrs["w:val"]??0),l=t.numbering.get(s)?.get(c);return{numId:s,ilvl:c,ordered:l?.ordered??!1,marker:l?.marker??"",check:l?.check}}function H(t){const e=[],a=r(t,"w:pBdr");for(const t of["top","bottom","left","right"]){const n=r(a,`w:${t}`);if(!n||"nil"===n.attrs["w:val"]||"none"===n.attrs["w:val"])continue;const o=/^[0-9a-fA-F]{6}$/.test(n.attrs["w:color"]??"")?`#${n.attrs["w:color"]}`:"currentcolor";e.push(`border-${t}:${(Number(n.attrs["w:sz"])||4)/8}pt solid ${o}`)}const n=r(t,"w:shd")?.attrs["w:fill"];return n&&/^[0-9a-fA-F]{6}$/.test(n)&&e.push(`background-color:#${n}`),e.join(";")}function z(t,e,a){const n=r(e,"w:pPr"),o=r(n,"w:pStyle")?.attrs["w:val"],d=t.fieldOpen,i=function(t){let e=0;for(const a of s(t,new Set(["w:fldChar"]))){const t=a.attrs["w:fldCharType"];"begin"===t?e++:"end"===t&&e--}return e}(e),w=q(e)||d||0!==i;i>0&&(t.fieldOpen=!0),d&&i<0&&(t.fieldOpen=!1);const m=I(t,"p");t.doc.blocks.set(m,{xml:T(t,e),fingerprint:"",props:N(t,n),numId:a?.numId,ilvl:a?.ilvl});const p=a?0:function(t,e){if(!e)return 0;const a=r(t.styles.get(e),"w:name")?.attrs["w:val"]??"",n=/^heading ([1-6])$/i.exec(a);return n?Number(n[1]):0}(t,o),f=a?"li":p?`h${p}`:"p",u=l(n);a&&delete u.indentLeft,a&&delete u.firstLine;const h=[c(u),b(u),H(n)].filter(Boolean).join(";");let $=w?G(t,e):D(t,e.children);$&&!/<br>(<\/[^>]+>)*$/.test($)||($+="<br>");const v=r(n,"w:pageBreakBefore")?" data-break-before":"",x=u.tabs?` data-tabs="${g(u.tabs)}"`:"",k=e.attrs["w14:paraId"]?` data-pid="${S(e.attrs["w14:paraId"])}"`:"",y=r(n,"w:sectPr");let P="";if(y){const e=t.sectionTypes[++t.sectionIndex]??"nextPage",a=Number(r(y,"w:cols")?.attrs["w:num"]??1);P=` data-section="${S(e)}"${a>1?` data-cols="${a}"`:""}`}const j=/<span data-raw="[^"]+" data-kind="mark" data-toc-anchor="([^"]+)"/.exec($)?.[1];return`<${f} data-docx="${m}"${k}${v}${P}${p&&j?` data-bm="${j}"`:""}${o?` data-pstyle="${S(o)}"`:""}${x}${h?` style="${S(h)}"`:""}${w?' data-locked contenteditable="false"':""}>${$}</${f}>`}function G(t,e){let a="";for(const n of e.children)"w:pPr"!==n.name&&"w:rPr"!==n.name&&"w:instrText"!==n.name&&"w:delInstrText"!==n.name&&("w:ins"===n.name||"w:moveTo"===n.name?a+=`<ins>${G(t,n)}</ins>`:"w:del"===n.name||"w:moveFrom"===n.name?a+=`<del>${G(t,n)}</del>`:"w:commentRangeStart"===n.name?t.openComments.add(n.attrs["w:id"]):"w:commentRangeEnd"===n.name?t.openComments.delete(n.attrs["w:id"]):"w:t"===n.name||"w:delText"===n.name?a+=$(n.text):"w:tab"===n.name?a+="\t":"w:br"===n.name?a+="<br>":"w:drawing"===n.name||"mc:AlternateContent"===n.name||"w:pict"===n.name?a+=`<span data-kind="object">${$(t.labels.object)}</span>`:a+=G(t,n));return a}function U(t,e){const a=I(t,"t"),n=r(e,"w:tblPr"),s=r(e,"w:tblGrid"),c=o(e,"w:tr"),l=c.some(t=>r(r(t,"w:trPr"),"w:gridBefore")||r(r(t,"w:trPr"),"w:gridAfter")),d=q(e)||l;l&&t.doc.notices.objects++,t.doc.blocks.set(a,{xml:T(t,e),fingerprint:"",props:N(t,n),tblGrid:N(t,s)});const i=r(n,"w:tblStyle")?.attrs["w:val"],w=o(s,"w:gridCol").map(t=>Number(t.attrs["w:w"])/20),m=new Map,p=c.map(t=>{const e=[];let a=0;for(const n of o(t,"w:tc")){const t=r(n,"w:tcPr"),o=Number(r(t,"w:gridSpan")?.attrs["w:val"]??1),s=r(t,"w:vMerge");if(s&&"restart"!==s.attrs["w:val"]&&m.has(a))m.get(a).rowSpan++;else{const t={node:n,rowSpan:1,col:a,span:o};e.push(t),s?m.set(a,t):m.delete(a)}a+=o}return e}),f=function(t,e,a){let n=r(e,"w:tblBorders");if(!n)for(const e of A(t,a))n=r(r(e,"w:tblPr"),"w:tblBorders")??n;return!!n&&n.children.some(t=>!["nil","none"].includes(t.attrs["w:val"]))}(t,n,i),u=c.map((e,a)=>{const n=I(t,"t");t.doc.blocks.set(n,{xml:"",fingerprint:"",props:N(t,r(e,"w:trPr"))});return`<tr data-docx="${n}">${p[a].map(e=>{const a=I(t,"t"),n=r(e.node,"w:tcPr");t.doc.blocks.set(a,{xml:"",fingerprint:"",props:N(t,n)});const o=r(n,"w:shd")?.attrs["w:fill"],s=[];o&&/^[0-9a-fA-F]{6}$/.test(o)&&s.push(`background-color:#${o.toLowerCase()}`);const c=r(n,"w:vAlign")?.attrs["w:val"];return"center"===c&&s.push("vertical-align:middle"),"bottom"===c&&s.push("vertical-align:bottom"),`<td data-docx="${a}"${e.span>1?` colspan="${e.span}"`:""}${e.rowSpan>1?` rowspan="${e.rowSpan}"`:""}${s.length?` style="${s.join(";")}"`:""}>${_(t,e.node.children)}</td>`}).join("")}</tr>`}).join(""),h=w.length?`<colgroup>${w.map(t=>`<col style="width:${Math.round(100*t)/100}pt">`).join("")}</colgroup>`:"";return`<table data-docx="${a}"${i?` data-tstyle="${S(i)}"`:""}${f?"":" data-no-borders"}${d?' data-locked contenteditable="false"':""}>${h}<tbody>${u}</tbody></table>`}function _(t,e){const a=[],n=[],c=t=>{for(;n.length>t;){const t=n.pop();a.push(`</li></${t.tag}>`)}};for(const l of e){const e="w:p"===l.name?W(t,l):null;if(e){for(;n.length&&n[n.length-1].ilvl>e.ilvl;)c(n.length-1);const r=n[n.length-1],o=r&&(!(!r.check||!e.check)||r.numId===e.numId&&r.tag===(e.ordered?"ol":"ul"));r&&r.ilvl===e.ilvl&&!o&&c(n.length-1);const s=`${e.numId}:${e.ilvl}`,d=t.listCounters.get(s)??0;t.listCounters.set(s,d+1);let i=z(t,l,e);"done"===e.check&&(i=i.replace(/^<li /,"<li data-checked "));const w=n[n.length-1];if(w&&w.ilvl===e.ilvl)a.push(`</li>${i.slice(0,i.lastIndexOf("</li>"))}`);else{const t=e.ordered?"ol":"ul",r=e.marker?` style="list-style-type:${e.marker}"`:"",o=e.ordered&&d?` start="${d+1}"`:"",s=e.check?" data-checklist":` data-num-id="${S(e.numId)}"`;a.push(`<${t}${s} data-ilvl="${e.ilvl}"${o}${r}>${i.slice(0,i.lastIndexOf("</li>"))}`),n.push({tag:t,numId:e.numId,ilvl:e.ilvl,check:!!e.check})}continue}if("w:tcPr"!==l.name&&"w:sectPr"!==l.name)if(c(0),"w:p"===l.name)a.push(z(t,l,null));else if("w:tbl"===l.name)a.push(U(t,l));else if("w:sdt"===l.name&&K(l)){const e=I(t,"p");t.doc.blocks.set(e,{xml:T(t,l),fingerprint:""});const n=o(r(l,"w:sdtContent"),"w:p").map(t=>{const e=Number(/(\d)$/.exec(r(r(t,"w:pPr"),"w:pStyle")?.attrs["w:val"]??"")?.[1]??1),a=s(t,new Set(["w:hyperlink"]))[0]?.attrs["w:anchor"]??"",n=O(t).replace(/\s+/g," ").trim();return Z(e,a,n.replace(/\t?\s*\d+$/,""),/(\d+)$/.exec(n)?.[1]??"")}).join("");a.push(`<div data-docx="${e}" data-toc contenteditable="false">${n}</div>`)}else if("w:sdt"===l.name){const e=I(t,"p");t.doc.blocks.set(e,{xml:T(t,l),fingerprint:""}),t.doc.notices.objects++;const n=_(t,o(r(l,"w:sdtContent"),"w:p"));a.push(`<div data-docx="${e}" data-locked contenteditable="false">${n}</div>`)}else{const e=I(t,"p");t.doc.blocks.set(e,{xml:T(t,l),fingerprint:""}),a.push(`<div data-docx="${e}" data-locked data-hidden contenteditable="false"></div>`)}}return c(0),a.join("")}function K(t){const e=r(r(r(t,"w:sdtPr"),"w:docPartObj"),"w:docPartGallery")?.attrs["w:val"]??"";return/table of contents/i.test(e)}function Z(t,e,a,n){const r=/^[A-Za-z0-9_]+$/.test(e)?e:"";return`<p data-toc-level="${Math.min(Math.max(t,1),9)}">${r?`<a href="#${r}" data-anchor="${r}">${$(a)}</a>`:$(a)}<span data-toc-page>${$(n)}</span></p>`}function J(t){const e=t.trim().split(/\s+/)[0]?.toUpperCase();return"PAGE"===e?"page":"NUMPAGES"===e||"SECTIONPAGES"===e?"pages":""}function X(t){if("LI"!==t.tagName)return t.outerHTML;const e=t.cloneNode(!0);return Array.from(e.children).forEach(t=>{"UL"!==t.tagName&&"OL"!==t.tagName||t.remove()}),e.outerHTML}function Q(t,e=t.html){const a=document.createElement("div");a.innerHTML=e,a.querySelectorAll("[data-docx]").forEach(e=>{const a=t.blocks.get(e.getAttribute("data-docx"));a&&(a.fingerprint=X(e))})}function V(t,e){const a=e?w(t.doc.parts,e):void 0;if(!e||!a)return{text:"",html:"",editable:!0};const n=i(a),r=0===s(n,new Set(["w:sdt","mc:AlternateContent","w:pict","w:txbxContent"])).length,o={src:t.src,rels:t.rels,notices:{...t.doc.notices}};t.src=a,t.rels=new Map(m(t.doc.parts,e).map(t=>[t.id,t]));let c="";try{c=_(t,n.children)}finally{t.src=o.src,t.rels=o.rels,t.doc.notices=o.notices}return{text:Y(n),html:r?c:`<div data-locked contenteditable="false">${c}</div>`,editable:r,part:e}}function Y(t){return t.children.filter(t=>"w:p"===t.name).map(t=>{let e="",a="",n=!1;const r=t=>{for(const o of t.children)if("w:t"===o.name)n||(e+=o.text);else if("w:tab"===o.name)n||(e+=" | ");else if("w:instrText"===o.name)a+=o.text;else if("w:fldChar"===o.name){const t=o.attrs["w:fldCharType"];"separate"!==t&&"end"!==t||(a&&(e+=tt(a),a=""),n="separate"===t)}else"w:fldSimple"===o.name?e+=tt(o.attrs["w:instr"]??"")||o.children.map(O).join(""):"w:pPr"!==o.name&&"w:rPr"!==o.name&&r(o)};return r(t),e}).filter(Boolean).join(" ")}function tt(t){const e=J(t);return e?`{${e}}`:""}function et(t,e,a){return 1===t&&e?"first":t%2==0&&a?"even":"default"}function at(t){const e=document.createElement("div");e.innerHTML=t,e.querySelectorAll('[data-field="page"]').forEach(t=>t.replaceWith("{page}")),e.querySelectorAll('[data-field="pages"]').forEach(t=>t.replaceWith("{pages}")),e.querySelectorAll('img,[data-kind="object"],[data-hidden]').forEach(t=>t.remove());const a=Array.from(e.querySelectorAll("p,h1,h2,h3,h4,h5,h6,li")).map(t=>(t.textContent??"").replace(/\t/g," | ").trim()).filter(Boolean);return a.length?a.join(" "):(e.textContent??"").trim()}async function nt(t,e={}){return rt(await f(t),t,e)}function rt(f,b,g={}){const $=m(f,"").find(t=>t.type.endsWith("/officeDocument")),x=$?u("",$.target):"word/document.xml",y=w(f,x);if(!y)throw new Error("Not a Word document");const j=i(y),C=r(j,"w:body");if(!C)throw new Error("Not a Word document");const S=m(f,x),I=t=>{const e=(t=>S.find(e=>e.type===t))(t);return e?u(x,e.target):void 0},T=p(I(n.theme)?w(f,I(n.theme)):void 0),N={parts:f,docPath:x,source:b,html:"",css:"",page:{...a},headers:k(),footers:k(),titlePage:!1,evenOdd:!1,columns:1,footnotes:new Map,blocks:new Map,runs:new Map,raw:new Map,notices:{comments:0,tracked:0,objects:0,footnotes:0},styles:[],theme:T},B={src:y,doc:N,labels:g.labels??v,rels:new Map(S.map(t=>[t.id,t])),theme:T,imageUrl:g.imageUrl??M,styles:new Map,numbering:new Map,listCounters:new Map,comments:new Map,footnotes:new Map,nextId:0,footnoteCount:0,openComments:new Set,fieldOpen:!1,sectionTypes:[],sectionIndex:0},L=I(n.styles),R=L?w(f,L):void 0,F=R?i(R):void 0;for(const t of o(F,"w:style"))B.styles.set(t.attrs["w:styleId"],t);const D=new Set(B.styles.keys());for(const[e,a]of Object.entries(t))D.has(e)||B.styles.set(e,i(a.xml));const q=r(F,"w:docDefaults");N.lang=r(r(r(q,"w:rPrDefault"),"w:rPr"),"w:lang")?.attrs["w:val"],N.css=function(t,e){const a=[],n=d(r(r(e,"w:rPrDefault"),"w:rPr"),t.theme),o=l(r(r(e,"w:pPrDefault"),"w:pPr"));t.doc.defaultFont=n.font,t.doc.defaultSize=n.size;let s=n,i=o;for(const[e,w]of t.styles){const m=w.attrs["w:type"];if("paragraph"!==m&&"character"!==m&&"table"!==m)continue;let p={},f={};for(const a of A(t,e))p={...p,...d(r(a,"w:rPr"),t.theme)},f={...f,...l(r(a,"w:pPr"))};if("paragraph"===m)a.push(`.docs-page [data-pstyle=${E(e)}]{${[h(p),c(f)].filter(Boolean).join(";")}}`),"1"===w.attrs["w:default"]&&(s={...n,...p},i={...o,...f});else if("character"===m)a.push(`.docs-page [data-rstyle=${E(e)}]{${h(p)}}`);else{const t=c(f);t&&a.push(`.docs-page table[data-tstyle=${E(e)}] p{${t}}`)}}return a.unshift(`.docs-page{${h(s)}}`,`.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6,.docs-page li{${c(i)}}`),a.join("\n")}(B,q);const W=new Set(Object.keys(t));N.styles=[...B.styles.values()].filter(t=>"paragraph"===t.attrs["w:type"]&&"1"!==t.attrs["w:default"]&&(W.has(t.attrs["w:styleId"])||r(t,"w:qFormat"))&&!r(t,"w:hidden")&&!r(t,"w:semiHidden")).map(t=>({id:t.attrs["w:styleId"],name:r(t,"w:name")?.attrs["w:val"]??t.attrs["w:styleId"]}));const H=I(n.numbering),z=H?w(f,H):void 0;z&&function(t,a){const n=new Map;for(const t of o(a,"w:abstractNum")){const a=new Map;for(const n of o(t,"w:lvl")){const t=r(n,"w:numFmt")?.attrs["w:val"]??"decimal",o=r(n,"w:lvlText")?.attrs["w:val"],s="bullet"===t&&o===e.open?"open":"bullet"===t&&o===e.done?"done":void 0;a.set(Number(n.attrs["w:ilvl"]),{ordered:"bullet"!==t&&"none"!==t,marker:ot[t]??"",check:s})}n.set(t.attrs["w:abstractNumId"],a)}for(const e of o(a,"w:num")){const a=n.get(r(e,"w:abstractNumId")?.attrs["w:val"]??"");a&&t.numbering.set(e.attrs["w:numId"],a)}}(B,i(z));const G=I(n.comments),U=G?w(f,G):void 0;if(U){for(const t of o(i(U),"w:comment"))B.comments.set(t.attrs["w:id"],`${t.attrs["w:author"]??""}: ${O(t)}`);N.notices.comments=B.comments.size}const K=I(n.footnotes),Z=K?w(f,K):void 0;if(Z)for(const t of o(i(Z),"w:footnote")){const e=t.attrs["w:id"];if(B.footnotes.set(e,O(t)),t.attrs["w:type"]&&"normal"!==t.attrs["w:type"])continue;const a=0===s(t,new Set(["w:tbl","w:drawing","w:pict","mc:AlternateContent","w:sdt","m:oMath"])).length;N.footnotes.set(e,{text:O(t).trim(),xml:Z.slice(t.start,t.end),editable:a})}N.notices.tracked=s(C,P).length;const J=r(C,"w:sectPr"),X=[...s(C,new Set(["w:sectPr"])).filter(t=>t!==J),...J?[J]:[]];B.sectionTypes=X.map(t=>r(t,"w:type")?.attrs["w:val"]??"nextPage"),B.sectionIndex=0,N.columns=Math.max(1,Number(r(J,"w:cols")?.attrs["w:num"]??1)||1),N.titlePage=!!r(J,"w:titlePg")&&"0"!==r(J,"w:titlePg")?.attrs["w:val"];const Y=I(n.settings),tt=Y?w(f,Y):void 0;N.evenOdd=!!tt&&/<w:evenAndOddHeaders(?![^>]*w:val="(?:0|false)")[^>]*\/?>/.test(tt);const et=r(J,"w:pgSz"),at=r(J,"w:pgMar"),nt=(t,e,a)=>{const n=Number(t?.attrs[e]);return Number.isFinite(n)&&void 0!==t?.attrs[e]?n:a};N.page={width:nt(et,"w:w",a.width),height:nt(et,"w:h",a.height),top:Math.abs(nt(at,"w:top",a.top)),right:nt(at,"w:right",a.right),bottom:Math.abs(nt(at,"w:bottom",a.bottom)),left:nt(at,"w:left",a.left),header:nt(at,"w:header",a.header),footer:nt(at,"w:footer",a.footer)};const rt=(t,e)=>{const a=o(J,t).find(t=>(t.attrs["w:type"]??"default")===e),n=a&&B.rels.get(a.attrs["r:id"]);return n?u(x,n.target):void 0};N.html=_(B,C.children);for(const t of["default","first","even"])N.headers[t]=V(B,rt("w:headerReference",t)),N.footers[t]=V(B,rt("w:footerReference",t));N.html||(N.html="<p><br></p>"),Q(N),N.footnotesRead=new Map([...N.footnotes].map(([t,e])=>[t,e.text]));for(const t of[N.headers,N.footers])for(const e of Object.values(t))e.html&&Q(N,e.html);return N}var ot={lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero"};export{Z as tocEntryHtml,X as fingerprintOf,Q as stampFingerprints,et as headerKindFor,at as marginTextOfHtml,nt as readDocx,rt as readParts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=1048576,n=16384;function e(t){let n=t+1,e="";for(;n>0;){const t=(n-1)%26;e=String.fromCharCode(65+t)+e,n=Math.floor((n-1)/26)}return e}function r(t){let n=0;for(const e of t.toUpperCase())n=26*n+(e.charCodeAt(0)-64);return n-1}function o(t,n){return`${e(n)}${t+1}`}function s(t,n){return{r1:Math.min(t.row,n.row),c1:Math.min(t.col,n.col),r2:Math.max(t.row,n.row),c2:Math.max(t.col,n.col)}}function c(t){const n=o(t.r1,t.c1);return t.r1===t.r2&&t.c1===t.c2?n:`${n}:${o(t.r2,t.c2)}`}function u(t,n,e){return n>=t.r1&&n<=t.r2&&e>=t.c1&&e<=t.c2}function i(t,n){return t.r1<=n.r2&&t.r2>=n.r1&&t.c1<=n.c2&&t.c2>=n.c1}function l(t){const n=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})(?::\$?([A-Za-z]{1,3})\$?(\d{1,7}))?$/.exec(t.trim());if(!n)return null;const e={row:Number(n[2])-1,col:r(n[1])},o=n[3]?{row:Number(n[4])-1,col:r(n[3])}:e;return e.row<0||o.row<0?null:s(e,o)}var a=class extends Error{},f=String.raw`(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})`,h=new RegExp(`^${f}(?::${f})?(?![A-Za-z0-9_.(])`),m=/^(\$?)([A-Za-z]{1,3}):(\$?)([A-Za-z]{1,3})(?![A-Za-z0-9_.(])/,d=/^(\$?)(\d{1,7}):(\$?)(\d{1,7})(?![A-Za-z0-9_.(])/,g=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,p=/^[A-Za-z_][A-Za-z0-9_.]*/,w=/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)/i,M=/^(?:'((?:[^']|'')+)'|([A-Za-z_][A-Za-z0-9_.]*))!/;function b(t,n,e,o){return{col:r(n),row:Number(o)-1,colAbs:"$"===t,rowAbs:"$"===e}}function y(e){let o=null,s=0;const c=M.exec(e);c&&(o=void 0!==c[1]?c[1].replace(/''/g,"'"):c[2],s=c[0].length);const u=e.slice(s),i=h.exec(u);if(i){const e=b(i[1],i[2],i[3],i[4]);if(e.row<0||e.row>=t||e.col>=n)return null;const r=i[6]?b(i[5],i[6],i[7],i[8]):null;return r&&(r.row<0||r.row>=t||r.col>=n)?null:{ref:{sheet:o,a:e,b:r},length:s+i[0].length}}const l=m.exec(u);if(l){return{ref:{sheet:o,a:{col:r(l[2]),row:null,colAbs:"$"===l[1],rowAbs:!1},b:{col:r(l[4]),row:null,colAbs:"$"===l[3],rowAbs:!1}},length:s+l[0].length}}const a=d.exec(u);if(a&&Number(a[2])>0&&Number(a[4])>0){return{ref:{sheet:o,a:{col:null,row:Number(a[2])-1,colAbs:!1,rowAbs:"$"===a[1]},b:{col:null,row:Number(a[4])-1,colAbs:!1,rowAbs:"$"===a[3]}},length:s+a[0].length}}return null}var A=["<=",">=","<>","+","-","*","/","^","&","=","<",">","%","(",")",",",";"];function E(t){const n=[];let e=0;for(;e<t.length;){const r=t[e];if(/\s/.test(r)){e++;continue}const o=t.slice(e);if('"'===r){let r=e+1,o="",s=!1;for(;r<t.length;){if('"'===t[r]){if('"'===t[r+1]){o+='"',r+=2;continue}s=!0,r++;break}o+=t[r++]}if(!s)return{tokens:n,complete:!1};n.push({type:"string",value:o,start:e,end:r}),e=r;continue}if("#"===r){const t=w.exec(o);if(!t)return{tokens:n,complete:!1};n.push({type:"error",value:t[0].toUpperCase(),start:e,end:e+t[0].length}),e+=t[0].length;continue}const s=y(o);if(s){n.push({type:"ref",ref:s.ref,start:e,end:e+s.length}),e+=s.length;continue}const c=g.exec(o);if(c){n.push({type:"number",value:Number(c[0]),start:e,end:e+c[0].length}),e+=c[0].length;continue}const u=p.exec(o);if(u){n.push({type:"ident",value:u[0],start:e,end:e+u[0].length}),e+=u[0].length;continue}const i=A.find(t=>o.startsWith(t));if(!i)return{tokens:n,complete:!1};n.push({type:"op",value:i,start:e,end:e+i.length}),e+=i.length}return{tokens:n,complete:!0}}var N={"=":1,"<>":1,"<":1,">":1,"<=":1,">=":1,"&":2,"+":3,"-":3,"*":4,"/":4,"^":6},v=class{constructor(t){this.tokens=t}tokens;pos=0;peek(){return this.tokens[this.pos]}isOp(t){const n=this.peek();return"op"===n?.type&&n.value===t}run(){const t=this.expression(0);if(this.pos<this.tokens.length)throw new a("Unexpected text");return t}expression(t){let n=this.prefix();for(;;){const e=this.peek();if("op"!==e?.type)break;if("%"===e.value){this.pos++,n={kind:"percent",arg:n};continue}const r=N[e.value];if(void 0===r||r<=t)break;this.pos++,n={kind:"binary",op:e.value,left:n,right:this.expression(r)}}return n}prefix(){const t=this.peek();if(!t)throw new a("Formula ends early");switch(this.pos++,t.type){case"number":return{kind:"num",value:t.value};case"string":return{kind:"str",value:t.value};case"error":return{kind:"err",value:t.value};case"ref":return{kind:"ref",ref:t.ref};case"ident":{if(this.isOp("("))return this.call(t.value);const n=t.value.toUpperCase();return"TRUE"===n?{kind:"bool",value:!0}:"FALSE"===n?{kind:"bool",value:!1}:{kind:"err",value:"#NAME?"}}case"op":if("-"===t.value||"+"===t.value)return{kind:"unary",op:t.value,arg:this.expression(7)};if("("===t.value){const t=this.expression(0);if(!this.isOp(")"))throw new a("Missing )");return this.pos++,t}throw new a(`Unexpected ${t.value}`)}}call(t){this.pos++;const n=[];if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};for(;;){if(this.isOp(",")||this.isOp(";")||this.isOp(")")?n.push({kind:"empty"}):n.push(this.expression(0)),!this.isOp(",")&&!this.isOp(";")){if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};throw new a("Missing )")}this.pos++}}},C=new Map;function x(t){return t.length>1&&"="===t[0]}function T(t){return(null===t.col?"":`${t.colAbs?"$":""}${e(t.col)}`)+(null===t.row?"":`${t.rowAbs?"$":""}${t.row+1}`)}function $(t){return(null===(n=t.sheet)?"":/^[A-Za-z_][A-Za-z0-9_.]*$/.test(n)&&!h.test(n)?`${n}!`:`'${n.replace(/'/g,"''")}'!`)+T(t.a)+(t.b?`:${T(t.b)}`:"");var n}function R(t,n){if(!x(t))return t;const e=t.slice(1),{tokens:r}=E(e);let o="",s=0;for(const t of r){if("ref"!==t.type)continue;const r=n(t.ref);o+=e.slice(s,t.start)+(r?$(r):"#REF!"),s=t.end}return`=${o}${e.slice(s)}`}function S(e,r,o){const s=e=>{const s=null===e.row||e.rowAbs?e.row:e.row+r,c=null===e.col||e.colAbs?e.col:e.col+o;return null!==s&&(s<0||s>=t)||null!==c&&(c<0||c>=n)?null:{...e,row:s,col:c}};return R(e,t=>{const n=s(t.a),e=t.b?s(t.b):null;return!n||t.b&&!e?null:{...t,a:n,b:e}})}function O(t){return t.colAbs||t.rowAbs?t.colAbs&&t.rowAbs?{...t,colAbs:!1,rowAbs:!0}:!t.colAbs&&t.rowAbs?{...t,colAbs:!0,rowAbs:!1}:{...t,colAbs:!1,rowAbs:!1}:{...t,colAbs:!0,rowAbs:!0}}var U=t=>String(t).padStart(2,"0"),I={general:"General",number:"#,##0.00",percent:"0.00%",currency:'"$"#,##0.00',scientific:"0.00E+00",date:"yyyy-mm-dd",time:"h:mm:ss AM/PM",dateTime:"yyyy-mm-dd h:mm",text:"@"},L=864e5,D=Date.UTC(1899,11,30);function F(t,n,e){return Math.round((Date.UTC(t,n-1,e)-D)/L)}function k(t){const n=Math.floor(t),e=new Date(D+n*L),r=Math.round(86400*(t-n));return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),weekday:e.getUTCDay(),hours:Math.floor(r/3600)%24,minutes:Math.floor(r/60)%60,seconds:r%60}}var P=/\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i;function V(t){const n=[];let e="",r=!1;for(let o=0;o<t.length;o++){const s=t[o];"\\"!==s?('"'===s&&(r=!r),";"!==s||r?e+=s:(n.push(e),e="")):e+=s+(t[++o]??"")}return n.push(e),n}function z(t){return t.replace(/\\./g,"").replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"")}function G(t){return!(!t||"General"===t||"@"===t)&&/[ymdhs]/i.test(z(V(t)[0]).replace(/E\+/gi,""))}var W=["January","February","March","April","May","June","July","August","September","October","November","December"],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function H(t,n){const e=k(n),r=/AM\/PM|A\/P/i.test(z(t)),o=t.match(/"[^"]*"|\\.|\[[^\]]*\]|AM\/PM|A\/P|y+|m+|d+|h+|s+|./gi)??[];let s="";return o.forEach((t,n)=>{if('"'===t[0])s+=t.slice(1,-1);else if("\\"===t[0])s+=t.slice(1);else if("["===t[0])s+="";else if(/^AM\/PM$/i.test(t))s+=e.hours<12?"AM":"PM";else if(/^A\/P$/i.test(t))s+=e.hours<12?"A":"P";else if(/^y+$/i.test(t))s+=t.length<=2?U(e.year%100):String(e.year);else if(/^m+$/i.test(t))t.length<=2&&(t=>{for(let n=t-1;n>=0;n--){if(/^h+$/i.test(o[n]))return!0;if(/^[ymds]+$/i.test(o[n]))break}for(let n=t+1;n<o.length;n++){if(/^s+$/i.test(o[n]))return!0;if(/^[ymdh]+$/i.test(o[n]))break}return!1})(n)?s+=2===t.length?U(e.minutes):String(e.minutes):1===t.length?s+=String(e.month):2===t.length?s+=U(e.month):3===t.length?s+=W[e.month-1].slice(0,3):s+=W[e.month-1];else if(/^d+$/i.test(t))1===t.length?s+=String(e.day):2===t.length?s+=U(e.day):3===t.length?s+=j[e.weekday].slice(0,3):s+=j[e.weekday];else if(/^h+$/i.test(t)){const n=r?e.hours%12||12:e.hours;s+=2===t.length?U(n):String(n)}else/^s+$/i.test(t)?s+=2===t.length?U(e.seconds):String(e.seconds):s+=t}),s}function K(t,n){const e=/[eE]([+-])(0+|\?+|#+)$/.exec(t);if(e){const r=(t.slice(0,e.index).split(".")[1]??"").length,[o,s]=n.toExponential(r).split("e"),c=Number(s);return`${o}E${c<0?"-":"+"===e[1]?"+":""}${String(Math.abs(c)).padStart(e[2].length,"0")}`}const[r,o=""]=t.split("."),s=/,+$/.exec(r)?.[0].length??0,c=/[#0?],[#0?]/.test(r),u=(r.match(/0/g)??[]).length,i=o.replace(/[^#0?]/g,"").length,l=(o.match(/0/g)??[]).length,a=n/1e3**s,f=Math.abs(a).toFixed(Math.min(i,20));let[h,m=""]=f.split(".");for(;m.length>l&&m.endsWith("0");)m=m.slice(0,-1);return"0"===h&&0===u&&(h=""),h=h.padStart(u,"0"),c&&(h=h.replace(/\B(?=(\d{3})+(?!\d))/g,",")),m?`${h}.${m}`:(o.includes("."),h)}function X(t){if(!Number.isFinite(t))return String(t);if(0===t)return"0";const n=Math.abs(t);if(n>=1e11||n<1e-9){const[n,e]=t.toExponential(5).split("e"),r=Number(e);return`${n.replace(/\.?0+$/,"")}E${r<0?"-":"+"}${U(Math.abs(r))}`}return String(Number(t.toPrecision(10)))}var Z={black:"#000000",blue:"#0000ff",cyan:"#00ffff",green:"#00a650",magenta:"#ff00ff",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function Y(t,n){if(!n||"General"===n||"@"===n)return{text:X(t),color:null};const e=V(n);let r=e[0],o=!1;t<0&&e.length>1?(r=e[1],o=!0):0===t&&e.length>2&&(r=e[2]);const s=P.exec(r),c=s?Z[s[1].toLowerCase()]??null:null;if(/general/i.test(z(r)))return{text:r.replace(/\[[^\]]*\]/g,"").replace(/general/i,X(o?-t:t)),color:c};if(G(r))return t<0?{text:X(t),color:c}:{text:H(r,t),color:c};const u=o?Math.abs(t):t,i=function(t,n){const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|_.|\*.|[#0?][#0?,.]*(?:[eE][+-][0?#]+)?%?|%|./g)??[],r=n*100**(z(t).match(/%/g)??[]).length;let o="",s=!1;for(const t of e)if('"'===t[0])o+=t.slice(1,-1);else if("\\"===t[0])o+=t.slice(1);else if("["===t[0]){const n=/^\[\$([^-\]]*)/.exec(t);n&&(o+=n[1])}else if("_"===t[0])o+=" ";else if("*"===t[0])o+="";else if(/^[#0?]/.test(t)){const n=t.endsWith("%"),e=n?t.slice(0,-1):t;s||(o+=K(e,r),s=!0),n&&(o+="%")}else o+=t;return s?o:`${o}`}(r,Math.abs(u)),l=!/[1-9]/.test(i);return{text:!o&&t<0&&!l?`-${i}`:i,color:c}}function _(t,n){if(!n||"General"===n||"@"===n)return t;const e=V(n),r=e.length>=4?e[3]:e[0];return r.includes("@")?r.replace(/"([^"]*)"/g,"$1").replace(/\\(.)/g,"$1").replace(/@/g,t):t}function B(t,n,e){let r=t;if(!r||"General"===r){const t=null===e?0:Math.min(9,(String(e).split(".")[1]??"").length);r=t>0?`0.${"0".repeat(t)}`:"0"}return"@"===r||G(r)?r:V(r).map(t=>{const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|./g)??[];let r=-1,o=-1;return e.forEach((t,n)=>{"."===t&&-1===o&&(o=n),"0"!==t&&"#"!==t&&"?"!==t||(r=n)}),-1===r?t:(1===n?-1===o?e.splice(r+1,0,".","0"):e.splice(r+1,0,"0"):-1!==o&&(r-o===1?e.splice(o,2):e.splice(r,1)),e.join(""))}).join(";")}var Q=/^(-?)\s*([$€£¥])\s*(-?)\s*([\d,]*\.?\d+)$/,J=/^[+-]?(?:\d{1,3}(?:,\d{3})+|\d+)?(?:\.\d+)?(?:[eE][+-]?\d+)?$/,q=/^[+-]?0\d/,tt=/^[+-]?\d{16,}$/,nt=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,et=/^(\d{1,2})[/.-](\d{1,2})[/.-](\d{2}|\d{4})$/;function rt(){try{const t=new Intl.DateTimeFormat(void 0).formatToParts(new Date(2e3,11,31));return t.findIndex(t=>"day"===t.type)<t.findIndex(t=>"month"===t.type)}catch{return!0}}function ot(t,n,e){if(n<1||n>12||e<1||e>31)return!1;const r=new Date(Date.UTC(t,n-1,e));return r.getUTCMonth()===n-1&&r.getUTCDate()===e}function st(t){const n=t.trim();if(!n||q.test(n)||tt.test(n))return null;const e=Q.exec(n);if(e){const t=Number(e[4].replace(/,/g,""));if(Number.isNaN(t))return null;return{value:"-"===e[1]||"-"===e[3]?-t:t,kind:"currency",format:`"${e[2]}"#,##0${e[4].includes(".")?".00":""}`}}if(n.endsWith("%")){const t=n.slice(0,-1).trim();if(!t||!J.test(t))return null;return{value:Number(t.replace(/,/g,""))/100,kind:"percent",format:t.includes(".")?"0.00%":"0%"}}if(/\d/.test(n)&&J.test(n))return{value:Number(n.replace(/,/g,"")),kind:"number",format:n.includes(",")?n.includes(".")?"#,##0.00":"#,##0":null};const r=nt.exec(n);if(r&&ot(Number(r[1]),Number(r[2]),Number(r[3])))return{value:F(Number(r[1]),Number(r[2]),Number(r[3])),kind:"date",format:I.date};const o=et.exec(n);if(o){const t=Number(o[1]),n=Number(o[2]),e=2===o[3].length?2e3+Number(o[3]):Number(o[3]),[r,s]=rt()?[t,n]:[n,t];if(ot(e,s,r))return{value:F(e,s,r),kind:"date",format:rt()?"dd/mm/yyyy":"mm/dd/yyyy"}}return null}var ct=class{constructor(t){this.code=t}code;toString(){return this.code}},ut=t=>"object"==typeof t&&null!==t&&!(t instanceof ct),it=t=>new ct(t),lt=it("#VALUE!"),at=it("#DIV/0!"),ft=it("#NUM!"),ht=it("#N/A"),mt=it("#REF!"),dt=it("#NAME?"),gt=it("#CIRC!"),pt=it("#ERROR!"),wt=/^-?(?:0|[1-9]\d{0,14})(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Mt(t){if(""===t)return null;if("'"===t[0])return t.slice(1);if(wt.test(t))return Number(t);const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&&t}function bt(t){return ut(t)?0===t.rows||0===t.cols?null:t.at(0,0):t}function yt(t){if(null===t)return 0;if("number"==typeof t)return t;if("boolean"==typeof t)return t?1:0;if(t instanceof ct)return t;if(""===t.trim())return lt;const n=st(t);return n?n.value:lt}function At(t){return null===t?"":"number"==typeof t?X(t):"boolean"==typeof t?t?"TRUE":"FALSE":t instanceof ct?t.code:t}function Et(t){if(null===t)return!1;if("boolean"==typeof t)return t;if("number"==typeof t)return 0!==t;if(t instanceof ct)return t;const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&<}function Nt(t,n){const e=t=>"number"==typeof t?0:"string"==typeof t?1:"boolean"==typeof t?2:3,r=null===t?"string"==typeof n?"":"boolean"!=typeof n&&0:t,o=null===n?"string"==typeof t?"":"boolean"!=typeof t&&0:n,s=e(r),c=e(o);if(s!==c)return s-c;if("number"==typeof r)return r-o;if("string"==typeof r){const t=r.toLowerCase(),n=o.toLowerCase();return t<n?-1:t>n?1:0}return"boolean"==typeof r?Number(r)-Number(o):0}function vt(t,n,e){if(n instanceof ct)return n;if(e instanceof ct)return e;switch(t){case"&":return At(n)+At(e);case"=":return 0===Nt(n,e);case"<>":return 0!==Nt(n,e);case"<":return Nt(n,e)<0;case">":return Nt(n,e)>0;case"<=":return Nt(n,e)<=0;case">=":return Nt(n,e)>=0}const r=yt(n),o=yt(e);if(r instanceof ct)return r;if(o instanceof ct)return o;switch(t){case"+":return r+o;case"-":return r-o;case"*":return r*o;case"/":return 0===o?at:r/o;case"^":{const t=r**o;return Number.isFinite(t)?t:ft}}return lt}function Ct(t,n,e){return{rows:t,cols:n,at:e}}function xt(t,n,e){if(!ut(t)&&!ut(n))return e(t,n);const r=Math.max(ut(t)?t.rows:1,ut(n)?n.rows:1),o=Math.max(ut(t)?t.cols:1,ut(n)?n.cols:1),s=(t,n,e)=>{if(!ut(t))return t;const r=1===t.rows?0:n,o=1===t.cols?0:e;return r<t.rows&&o<t.cols?t.at(r,o):ht};return Ct(r,o,(r,o)=>e(s(t,r,o),s(n,r,o)))}function Tt(t,n){if(ut(t))for(let e=0;e<t.rows;e++)for(let r=0;r<t.cols;r++)n(t.at(e,r),!0);else n(t,!1)}function $t(t){const n=[];let e=null;for(const r of t)Tt(r,(t,r)=>{if(e)return;if(t instanceof ct)return void(e=t);if("number"==typeof t)return void n.push(t);if(r||null===t)return;const o=yt(t);o instanceof ct?e=o:n.push(o)});return e??n}function Rt(t){return t.replace(/[.+^${}()|[\]\\]/g,"\\$&")}function St(t){let n="";for(let e=0;e<t.length;e++){const r=t[e];"~"===r&&e+1<t.length?n+=Rt(t[++e]):n+="*"===r?"[\\s\\S]*":"?"===r?"[\\s\\S]":Rt(r)}return new RegExp(`^${n}$`,"i")}var Ot=(t,n)=>{if(void 0===t)return n??lt;const e=bt(t);return null===e&&void 0!==n?n:yt(e)},Ut=t=>{if(void 0===t)return lt;const n=bt(t);return n instanceof ct?n:At(n)},It=t=>n=>{const e=Ot(n[0]);if(e instanceof ct)return e;const r=t(e);return Number.isFinite(r)?r:ft},Lt=t=>n=>{const e=$t(n);return e instanceof ct?e:t(e)};var Dt=t=>n=>{const e=Ot(n[0]),r=Ot(n[1],0);if(e instanceof ct)return e;if(r instanceof ct)return r;return(e<0?-1:1)*function(t,n,e){const r=10**n;return e(Number((t*r).toPrecision(15)))/r}(Math.abs(e),Math.trunc(r),t)};function Ft(t,n){const e=t.length;if(e<(n?2:1))return at;const r=t.reduce((t,n)=>t+n,0)/e;return t.reduce((t,n)=>t+(n-r)**2,0)/(n?e-1:e)}function kt(t){return ut(t)?t:Ct(1,1,()=>t)}function Pt(t,n){const e=n??t[0][0];for(const[n]of t)if(n.rows!==e.rows||n.cols!==e.cols)return lt;const r=t.map(([,t])=>function(t){if("string"!=typeof t)return n=>null===t?null===n:null!==n&&0===Nt(n,t);const n=/^(<=|>=|<>|=|<|>)?([\s\S]*)$/.exec(t),e=n[1]??"=",r=n[2],o=st(r);if(o){const t=o.value;return n=>{const r="number"==typeof n;switch(e){case"=":return r&&n===t;case"<>":return!(r&&n===t);case"<":return r&&n<t;case">":return r&&n>t;case"<=":return r&&n<=t;default:return r&&n>=t}}}if("="===e||"<>"===e){if(""===r)return t=>"="===e?null===t||""===t:null!==t&&""!==t;const t=St(r);return n=>{const r=null!==n&&!(n instanceof ct)&&t.test(At(n));return"="===e?r:!r}}return t=>{if("string"!=typeof t)return!1;const n=Nt(t,r);return"<"===e?n<0:">"===e?n>0:"<="===e?n<=0:n>=0}}(t)),o=[];for(let n=0;n<e.rows;n++)for(let s=0;s<e.cols;s++)t.every(([t],e)=>r[e](t.at(n,s)))&&o.push(e.at(n,s));return o}function Vt(t){let n=0;for(const e of t){if(e instanceof ct)return e;"number"==typeof e&&(n+=e)}return n}function zt(t){let n=0,e=0;for(const r of t){if(r instanceof ct)return r;"number"==typeof r&&(n+=r,e++)}return e?n/e:at}function Gt(t,n){if((t.length-n)%2!=0||t.length-n<2)return lt;const e=[];for(let r=n;r<t.length;r+=2){const n=bt(t[r+1]);if(n instanceof ct)return n;e.push([kt(t[r]),n])}return e}function Wt(t,n,e,r=!1){const o=Math.max(n.rows,n.cols),s=t=>n.rows>=n.cols?n.at(t,0):n.at(0,t);if(0===e){const n=r&&"string"==typeof t?St(t):null;for(let e=0;e<o;e++){const r=s(e);if(n?"string"==typeof r&&n.test(r):null!==r&&!(r instanceof ct)&&0===Nt(r,t))return e}return-1}let c=-1;for(let n=0;n<o;n++){const r=s(n);if(null===r||r instanceof ct||typeof r!=typeof t)continue;const o=Nt(r,t);(1===e?o<=0:o>=0)&&(-1===c||(1===e?Nt(r,s(c))>0:Nt(r,s(c))<0))&&(c=n)}return c}function jt(t,n){const e=bt(t[0]);if(e instanceof ct)return e;if(void 0===t[1])return lt;const r=kt(t[1]),o=Ot(t[2]);if(o instanceof ct)return o;const s=void 0===t[3]||null===t[3]||Et(bt(t[3]));if(s instanceof ct)return s;const c=Math.trunc(o)-1,u=n?r.cols:r.rows,i=n?r.rows:r.cols;if(c<0)return lt;if(c>=i)return mt;const l=Wt(e,n?Ct(1,u,(t,n)=>r.at(0,n)):Ct(u,1,t=>r.at(t,0)),s?1:0,!s);return-1===l?ht:n?r.at(c,l):r.at(l,c)}function Ht(){const t=new Date;return F(t.getFullYear(),t.getMonth()+1,t.getDate())+(3600*t.getHours()+60*t.getMinutes()+t.getSeconds())/86400}var Kt=t=>n=>{const e=Ot(n[0]);return e instanceof ct?e:e<0?ft:t(k(e))};function Xt(t,n){const e=k(t),r=12*e.year+(e.month-1)+n;return{year:Math.floor(r/12),month:(r%12+12)%12+1,day:e.day}}function Zt(t,n){return new Date(Date.UTC(t,n,0)).getUTCDate()}var Yt=[!0,!1,!1,!1,!1,!1,!0],_t={1:[6,0],2:[0,1],3:[1,2],4:[2,3],5:[3,4],6:[4,5],7:[5,6],11:[0],12:[1],13:[2],14:[3],15:[4],16:[5],17:[6]};function Bt(t){const n=void 0===t?null:bt(t);if(n instanceof ct)return n;if(null===n)return Yt;if("string"==typeof n&&/^[01]{7}$/.test(n))return"1111111"===n?lt:["1"===n[6],...[...n.slice(0,6)].map(t=>"1"===t)];if("string"==typeof n&&!st(n))return lt;const e=yt(n);if(e instanceof ct)return e;const r=_t[Math.trunc(e)];return r?[0,1,2,3,4,5,6].map(t=>r.includes(t)):ft}var Qt=(t,n)=>n[k(t).weekday];function Jt(t){const n=new Set;if(void 0===t)return n;let e=null;return Tt(t,t=>{t instanceof ct?e??=t:"number"==typeof t&&n.add(Math.trunc(t))}),e??n}function qt(t,n,e){const r=Ot(t[0]),o=Ot(t[1]);if(r instanceof ct)return r;if(o instanceof ct)return o;if(n instanceof ct)return n;const s=Jt(e);if(s instanceof ct)return s;const c=Math.trunc(Math.min(r,o)),u=Math.trunc(Math.max(r,o));if(u-c>366e3)return ft;let i=0;for(let t=c;t<=u;t++)Qt(t,n)||s.has(t)||i++;return r<=o?i:-i}function tn(t,n,e){const r=Ot(t[0]),o=Ot(t[1]);if(r instanceof ct)return r;if(o instanceof ct)return o;if(n instanceof ct)return n;const s=Jt(e);if(s instanceof ct)return s;let c=Math.trunc(o);if(Math.abs(c)>1e6)return ft;const u=c<0?-1:1;let i=Math.trunc(r);for(;0!==c;)i+=u,Qt(i,n)||s.has(i)||(c-=u);return i<0?ft:i}var nn={1:0,2:1,11:1,12:2,13:3,14:4,15:5,16:6,17:0};function en(t){const n=Math.trunc(t),e=n+3-(k(n).weekday+6)%7,r=F(k(e).year,1,1);return Math.floor((e-r)/7)+1}var rn=t=>t%4==0&&t%100!=0||t%400==0;var on=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],sn=/^(\d{1,2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?\s*([ap]m)?$/i,cn=/^([a-z]{3,9})\.?\s+(\d{1,2}),?\s+(\d{4})$/i,un=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i;function ln(t){let n=t.trim();const e=n.search(/\s\d{1,2}:\d{2}/);e>0&&sn.test(n.slice(e+1).trim())&&(n=n.slice(0,e));const r=st(n);if("date"===r?.kind)return r.value;const o=cn.exec(n)??un.exec(n);if(!o)return null;const[s,c]=cn.test(n)?[Number(o[2]),o[1]]:[Number(o[1]),o[2]],u=function(t){const n=t.toLowerCase(),e=on.indexOf(n.slice(0,3));if(-1===e)return 0;const r=new Date(Date.UTC(2e3,e,1)).toLocaleString("en",{month:"long",timeZone:"UTC"}).toLowerCase();return 3===n.length||r.startsWith(n)?e+1:0}(c),i=Number(o[3]);return!u||s<1||s>Zt(i,u)?null:F(i,u,s)}var an=(t,n)=>{const e=[];for(let r=0;r<n.length;r++){const o=Ot(t[r],n[r]);if(o instanceof ct)return o;e.push(o)}return e};function fn(t,n){if(!t.length||n<0||n>1)return ft;const e=[...t].sort((t,n)=>t-n),r=n*(e.length-1),o=Math.floor(r);return o+1<e.length?e[o]+(r-o)*(e[o+1]-e[o]):e[o]}var hn=t=>n=>{const e=Gt(n,1);if(e instanceof ct)return e;const r=Pt(e,kt(n[0]));if(r instanceof ct)return r;const o=[];for(const t of r){if(t instanceof ct)return t;"number"==typeof t&&o.push(t)}return o.length?t(o):0},mn=t=>{if(void 0===t)return lt;const n=bt(t);return n instanceof ct?n:null===n?"":"string"==typeof n?n:lt};function dn(t,n){let e=n?"g":"",r=t;const o=/^\(\?([ims]+)\)/.exec(r);if(o){for(const t of new Set(o[1]))e+=t;r=r.slice(o[0].length)}try{return new RegExp(r,e)}catch{return lt}}function gn(t,n){const e=bt(t[0]??null);if("boolean"==typeof e)return lt;const r=yt(e);return r instanceof ct?r:Math.abs(Math.trunc(r))%2===n}var pn=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV","STDEVP","SUM","VAR","VARP"],wn=/^=\s*SUBTOTAL\s*\(/i,Mn={SUM:Lt(t=>t.reduce((t,n)=>t+n,0)),AVERAGE:Lt(t=>t.length?t.reduce((t,n)=>t+n,0)/t.length:at),MIN:Lt(t=>t.length?Math.min(...t):0),MAX:Lt(t=>t.length?Math.max(...t):0),PRODUCT:Lt(t=>t.length?t.reduce((t,n)=>t*n,1):0),MEDIAN:Lt(t=>{if(!t.length)return ft;const n=[...t].sort((t,n)=>t-n),e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2}),MODE:Lt(t=>{const n=new Map;let e=null,r=1;for(const o of t){const t=(n.get(o)??0)+1;n.set(o,t),t>r&&(r=t,e=o)}return e??ht}),STDEV:Lt(t=>{const n=Ft(t,!0);return n instanceof ct?n:Math.sqrt(n)}),STDEVP:Lt(t=>{const n=Ft(t,!1);return n instanceof ct?n:Math.sqrt(n)}),VAR:Lt(t=>Ft(t,!0)),VARP:Lt(t=>Ft(t,!1)),COUNT:t=>{let n=0;for(const e of t)Tt(e,(t,e)=>{"number"==typeof t?n++:e||"boolean"!=typeof t?!e&&"string"==typeof t&&st(t)&&n++:n++});return n},COUNTA:t=>{let n=0;for(const e of t)Tt(e,t=>{null!==t&&n++});return n},COUNTBLANK:t=>{let n=0;for(const e of t)Tt(e,t=>{null!==t&&""!==t||n++});return n},ABS:It(Math.abs),INT:It(Math.floor),TRUNC:Dt(Math.floor),ROUND:Dt(Math.round),ROUNDUP:Dt(Math.ceil),ROUNDDOWN:Dt(Math.floor),SIGN:It(Math.sign),SQRT:It(Math.sqrt),EXP:It(Math.exp),LN:It(Math.log),LOG10:It(Math.log10),SIN:It(Math.sin),COS:It(Math.cos),TAN:It(Math.tan),LOG:t=>{const n=Ot(t[0]),e=Ot(t[1],10);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.log(n)/Math.log(e);return Number.isFinite(r)?r:ft},MOD:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e?at:n-e*Math.floor(n/e)},POWER:t=>vt("^",bt(t[0]??null),bt(t[1]??null)),PI:()=>Math.PI,RAND:()=>Math.random(),RANDBETWEEN:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.ceil(n),o=Math.floor(e);return r>o?ft:r+Math.floor(Math.random()*(o-r+1))},CEILING:t=>{const n=Ot(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?0:Math.ceil(Number((n/e).toPrecision(15)))*e},FLOOR:t=>{const n=Ot(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?at:Math.floor(Number((n/e).toPrecision(15)))*e},MROUND:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e||0===n?0:Math.sign(n)!==Math.sign(e)?ft:Math.sign(n)*Math.round(Number(Math.abs(n/e).toPrecision(15)))*Math.abs(e)},QUOTIENT:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e?at:Math.trunc(n/e)},SUMIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],void 0!==t[2]?kt(t[2]):null);return e instanceof ct?e:Vt(e)},SUMIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,kt(t[0]));return e instanceof ct?e:Vt(e)},AVERAGEIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],void 0!==t[2]?kt(t[2]):null);return e instanceof ct?e:zt(e)},AVERAGEIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,kt(t[0]));return e instanceof ct?e:zt(e)},COUNTIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],null);return e instanceof ct?e:e.length},COUNTIFS:t=>{const n=Gt(t,0);if(n instanceof ct)return n;const e=Pt(n,null);return e instanceof ct?e:e.length},MAXIFS:hn(t=>Math.max(...t)),MINIFS:hn(t=>Math.min(...t)),SUBTOTAL:(t,n)=>{const e=Ot(t[0]);if(e instanceof ct)return e;const r=Math.trunc(e),o=pn[(r>100?r-100:r)-1];if(!o||r>11&&r<101)return lt;const s=t.slice(1).map(t=>{if(!ut(t)||!t.raw)return t;const n=t.raw.bind(t);return Ct(t.rows,t.cols,(e,r)=>wn.test(n(e,r))?null:t.at(e,r))});return s.length?Mn[o](s,n):lt},SUMPRODUCT:t=>{if(!t.length)return lt;const n=t.map(kt),{rows:e,cols:r}=n[0];if(n.some(t=>t.rows!==e||t.cols!==r))return lt;let o=0;for(let t=0;t<e;t++)for(let e=0;e<r;e++){let r=1;for(const o of n){const s=o.at(t,e);if(s instanceof ct)return s;r*="number"==typeof s?s:"boolean"==typeof s&&1===n.length?Number(s):0}o+=r}return o},LARGE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>n-t);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},SMALL:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>t-n);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},RANK:t=>{const n=Ot(t[0]),e=$t([t[1]??null]),r=Ot(t[2],0);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e.includes(n)?1+e.filter(t=>r?t<n:t>n).length:ht},PERCENTILE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:fn(n,e)},QUARTILE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.trunc(e);return r<0||r>4?ft:fn(n,r/4)},AND:t=>{let n=!1,e=!0,r=null;for(const o of t)Tt(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=Et(t);s instanceof ct?r=s:(n=!0,s||(e=!1))});return r??(n?e:lt)},OR:t=>{let n=!1,e=!1,r=null;for(const o of t)Tt(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=Et(t);s instanceof ct?r=s:(n=!0,s&&(e=!0))});return r??(n?e:lt)},XOR:t=>{let n=!1,e=null;for(const r of t)Tt(r,t=>{if(e||null===t)return;const r=Et(t);r instanceof ct?e=r:r&&(n=!n)});return e??n},NOT:t=>{const n=Et(bt(t[0]??null));return n instanceof ct?n:!n},TRUE:()=>!0,FALSE:()=>!1,CONCAT:t=>{let n="",e=null;for(const r of t)Tt(r,t=>{t instanceof ct?e??=t:n+=At(t)});return e??n},TEXTJOIN:t=>{const n=Ut(t[0]),e=Et(bt(t[1]??null));if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[];let o=null;for(const n of t.slice(2))Tt(n,t=>{if(t instanceof ct)return void(o??=t);const n=At(t);e&&""===n||r.push(n)});return o??r.join(n)},LEFT:t=>{const n=Ut(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?lt:n.slice(0,Math.trunc(e))},RIGHT:t=>{const n=Ut(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?lt:0===Math.trunc(e)?"":n.slice(-Math.trunc(e))},MID:t=>{const n=Ut(t[0]),e=Ot(t[1]),r=Ot(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e<1||r<0?lt:n.slice(Math.trunc(e)-1,Math.trunc(e)-1+Math.trunc(r))},LEN:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.length},LOWER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase()},UPPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toUpperCase()},PROPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase().replace(/(^|[^\p{L}])(\p{L})/gu,(t,n,e)=>n+e.toUpperCase())},TRIM:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.trim().replace(/ +/g," ")},REPT:t=>{const n=Ut(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:e<0||n.length*e>32767?lt:n.repeat(Math.trunc(e))},EXACT:t=>{const n=Ut(t[0]),e=Ut(t[1]);return n instanceof ct?n:e instanceof ct?e:n===e},SUBSTITUTE:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(""===e)return n;if(void 0===t[3])return n.split(e).join(r);const o=Ot(t[3]);if(o instanceof ct)return o;let s=-1;for(let t=0;t<o;t++)if(s=n.indexOf(e,s+1),-1===s)return n;return n.slice(0,s)+r+n.slice(s+e.length)},REPLACE:t=>{const n=Ut(t[0]),e=Ot(t[1]),r=Ot(t[2]),o=Ut(t[3]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:o instanceof ct?o:e<1||r<0?lt:n.slice(0,e-1)+o+n.slice(e-1+r)},FIND:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ot(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=e.indexOf(n,r-1);return-1===o?lt:o+1},SEARCH:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ot(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=new RegExp(St(n).source.slice(1,-1),"i").exec(e.slice(r-1));return o?o.index+r:lt},TEXT:t=>{const n=bt(t[0]??null),e=Ut(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r="string"==typeof n?st(n)?.value??null:null===n?0:"boolean"==typeof n?null:n;return null===r?_(At(n),e):Y(r,e).text},VALUE:t=>{const n=bt(t[0]??null);return n instanceof ct||"number"==typeof n?n:st(At(n))?.value??lt},CHAR:t=>{const n=Ot(t[0]);if(n instanceof ct)return n;const e=Math.trunc(n);return e<1||e>1114111||e>=55296&&e<=57343?lt:String.fromCodePoint(e)},CODE:t=>{const n=Ut(t[0]);return n instanceof ct?n:""===n?lt:n.codePointAt(0)},CLEAN:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.replace(/[\x00-\x1f]/g,"")},REGEXMATCH:t=>{const n=mn(t[0]),e=mn(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=dn(e,!1);return r instanceof ct?r:r.test(n)},REGEXEXTRACT:t=>{const n=mn(t[0]),e=mn(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=dn(e,!1);if(r instanceof ct)return r;const o=r.exec(n);if(!o)return ht;if(1===o.length)return o[0];const s=o.slice(1).map(t=>t??"");return 1===s.length?s[0]:Ct(1,s.length,(t,n)=>s[n])},REGEXREPLACE:t=>{const n=mn(t[0]),e=mn(t[1]),r=mn(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=dn(e,!0);return o instanceof ct?o:n.replace(o,r)},VLOOKUP:t=>jt(t,!1),HLOOKUP:t=>jt(t,!0),XLOOKUP:t=>{const n=bt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1]||void 0===t[2])return lt;const e=kt(t[1]),r=kt(t[2]),o=Ot(t[4],0);if(o instanceof ct)return o;const s=Wt(n,e,1===o?-1:-1===o?1:0,2===o);return-1===s?void 0!==t[3]&&null!==bt(t[3])?bt(t[3]):ht:e.rows>=e.cols?r.at(s,0):r.at(0,s)},MATCH:t=>{const n=bt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1])return lt;const e=kt(t[1]),r=Ot(t[2],1);if(r instanceof ct)return r;if(e.rows>1&&e.cols>1)return ht;const o=Wt(n,e,0===r?0:r<0?-1:1,0===r);return-1===o?ht:o+1},INDEX:t=>{if(void 0===t[0])return lt;const n=kt(t[0]),e=Ot(t[1],0),r=Ot(t[2],1===n.rows&&void 0===t[2]?0:1);if(e instanceof ct)return e;if(r instanceof ct)return r;const[o,s]=1===n.rows&&void 0===t[2]?[1,e]:[e,r];return o<0||s<0||o>n.rows||s>n.cols?mt:0===o?Ct(n.rows,1,t=>n.at(t,Math.max(s,1)-1)):0===s?Ct(1,n.cols,(t,e)=>n.at(o-1,e)):n.at(Math.trunc(o)-1,Math.trunc(s)-1)},ROWS:t=>void 0===t[0]?lt:kt(t[0]).rows,COLUMNS:t=>void 0===t[0]?lt:kt(t[0]).cols,TODAY:()=>Math.floor(Ht()),NOW:()=>Ht(),DATE:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=n<1900?n+1900:n;return F(o,1,1)+Math.round((Date.UTC(o,e-1,r)-Date.UTC(o,0,1))/864e5)},TIME:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:(3600*n+60*e+r)/86400%1},YEAR:Kt(t=>t.year),MONTH:Kt(t=>t.month),DAY:Kt(t=>t.day),HOUR:Kt(t=>t.hours),MINUTE:Kt(t=>t.minutes),SECOND:Kt(t=>t.seconds),WEEKDAY:t=>{const n=Ot(t[0]),e=Ot(t[1],1);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=k(n).weekday;return 1===e?r+1:2===e?(r+6)%7+1:3===e?(r+6)%7:ft},EDATE:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o,day:s}=Xt(n,Math.trunc(e));return F(r,o,Math.min(s,Zt(r,o)))},EOMONTH:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o}=Xt(n,Math.trunc(e));return F(r,o,Zt(r,o))},DAYS:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:Math.trunc(n)-Math.trunc(e)},DATEDIF:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(n>e)return ft;const o=k(n),s=k(e),c=12*(s.year-o.year)+(s.month-o.month)-(s.day<o.day?1:0);switch(r.toUpperCase()){case"D":return Math.trunc(e)-Math.trunc(n);case"M":return c;case"Y":return Math.floor(c/12);default:return ft}},NETWORKDAYS:t=>qt(t,Yt,t[2]),"NETWORKDAYS.INTL":t=>qt(t,Bt(t[2]),t[3]),WORKDAY:t=>tn(t,Yt,t[2]),"WORKDAY.INTL":t=>tn(t,Bt(t[2]),t[3]),WEEKNUM:t=>{const n=Ot(t[0]),e=Ot(t[1],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(n<0)return ft;const r=Math.trunc(e);if(21===r)return en(n);const o=nn[r];if(void 0===o)return ft;const s=Math.trunc(n),c=F(k(s).year,1,1),u=(k(c).weekday-o+7)%7;return Math.floor((s-c+u)/7)+1},ISOWEEKNUM:t=>{const n=Ot(t[0]);return n instanceof ct?n:n<0?ft:en(n)},YEARFRAC:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2],0);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:n<0||e<0?ft:function(t,n,e){const[r,o]=t<=n?[Math.trunc(t),Math.trunc(n)]:[Math.trunc(n),Math.trunc(t)],s=k(r),c=k(o),u=(t,n)=>(360*(c.year-s.year)+30*(c.month-s.month)+(n-t))/360;switch(e){case 0:{let t=s.day,n=c.day;const e=t=>2===t.month&&t.day===Zt(t.year,2);return 31===t&&31===n?(t=30,n=30):31===t?t=30:30===t&&31===n?n=30:e(s)&&e(c)?(t=30,n=30):e(s)&&(t=30),u(t,n)}case 1:if(s.year===c.year||c.year===s.year+1&&(s.month>c.month||s.month===c.month&&s.day>=c.day)){let t=!1;if(s.year===c.year)t=rn(s.year);else for(const n of[s.year,c.year]){if(!rn(n))continue;const e=F(n,2,29);e>=r&&e<=o&&(t=!0)}return(o-r)/(t?366:365)}return(o-r)/((F(c.year+1,1,1)-F(s.year,1,1))/(c.year-s.year+1));case 2:return(o-r)/360;case 3:return(o-r)/365;case 4:return u(Math.min(s.day,30),Math.min(c.day,30));default:return ft}}(n,e,Math.trunc(r))},DATEVALUE:t=>{const n=mn(t[0]);return n instanceof ct?n:ln(n)??lt},TIMEVALUE:t=>{const n=mn(t[0]);return n instanceof ct?n:function(t){const n=t.trim(),e=n.search(/\d{1,2}:\d{2}/);if(-1===e)return null;if(e>0&&null===ln(n.slice(0,e)))return null;const r=sn.exec(n.slice(e));if(!r)return null;let o=Number(r[1]);const s=Number(r[2]),c=Number(r[3]??0);if(s>59||c>=60)return null;if(r[4]){if(o<1||o>12)return null;o=o%12+("pm"===r[4].toLowerCase()?12:0)}return(3600*o+60*s+c)/86400%1}(n)??lt},ISBLANK:t=>null===bt(t[0]??null),ISNUMBER:t=>"number"==typeof bt(t[0]??null),ISTEXT:t=>"string"==typeof bt(t[0]??null),ISLOGICAL:t=>"boolean"==typeof bt(t[0]??null),ISERROR:t=>bt(t[0]??null)instanceof ct,ISNA:t=>{const n=bt(t[0]??null);return n instanceof ct&&"#N/A"===n.code},ISERR:t=>{const n=bt(t[0]??null);return n instanceof ct&&"#N/A"!==n.code},ISEVEN:t=>gn(t,0),ISODD:t=>gn(t,1),N:t=>{const n=bt(t[0]??null);return n instanceof ct||"number"==typeof n?n:"boolean"==typeof n?Number(n):0},NA:()=>ht,PMT:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);return n instanceof ct?n:0===n[1]?ft:function(t,n,e,r,o){if(0===t)return-(e+r)/n;const s=(1+t)**n;return-t*(e*s+r)/((s-1)*(1+t*o))}(n[0],n[1],n[2],n[3],n[4])},FV:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s*u+o*(1+e*c)*(u-1)/e)},PV:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s+o*(1+e*c)*(u-1)/e)/u},NPV:t=>{const n=Ot(t[0]),e=$t(t.slice(1));return n instanceof ct?n:e instanceof ct?e:e.reduce((t,e,r)=>t+e/(1+n)**(r+1),0)}};Mn.CONCATENATE=Mn.CONCAT,Mn["STDEV.S"]=Mn.STDEV,Mn["STDEV.P"]=Mn.STDEVP,Mn["VAR.S"]=Mn.VAR,Mn["VAR.P"]=Mn.VARP,Mn["CEILING.MATH"]=Mn.CEILING,Mn["FLOOR.MATH"]=Mn.FLOOR,Mn["MODE.SNGL"]=Mn.MODE,Mn["RANK.EQ"]=Mn.RANK,Mn["PERCENTILE.INC"]=Mn.PERCENTILE,Mn["QUARTILE.INC"]=Mn.QUARTILE;var bn={IF:(t,n)=>{if(t.length<2)return lt;const e=Et(bt(n(t[0])));return e instanceof ct?e:e?n(t[1]):t.length>2&&n(t[2])},IFS:(t,n)=>{if(t.length<2||t.length%2)return lt;for(let e=0;e<t.length;e+=2){const r=Et(bt(n(t[e])));if(r instanceof ct)return r;if(r)return n(t[e+1])}return ht},IFERROR:(t,n)=>{if(t.length<1)return lt;const e=bt(n(t[0]));return e instanceof ct?t[1]?n(t[1]):"":e},IFNA:(t,n)=>{if(t.length<1)return lt;const e=bt(n(t[0]));return e instanceof ct&&"#N/A"===e.code?t[1]?n(t[1]):"":e},SWITCH:(t,n)=>{if(t.length<3)return lt;const e=bt(n(t[0]));if(e instanceof ct)return e;let r=1;for(;r+1<t.length;r+=2){const o=bt(n(t[r]));if(o instanceof ct)return o;if(0===Nt(e,o))return n(t[r+1])}return r<t.length?n(t[r]):ht},CHOOSE:(t,n)=>{if(t.length<2)return lt;const e=yt(bt(n(t[0])));if(e instanceof ct)return e;const r=Math.trunc(e);return r<1||r>=t.length?lt:n(t[r])},ROW:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.row?t[0].ref.a.row+1:lt:e.row+1,COLUMN:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.col?t[0].ref.a.col+1:lt:e.col+1},yn=[...new Set([...Object.keys(Mn),...Object.keys(bn)])].filter(t=>"TRUE"!==t&&"FALSE"!==t).sort();function An(t){const n=t.map(()=>new Map),e=t.map(()=>new Set),r=new Map(t.map((t,n)=>[t.name.toLowerCase(),n]));let o=0;const s=(r,s,c)=>{const i=t[r]?.cells[s]?.[c];if(void 0===i||""===i)return null;if(!x(i))return Mt(i);const l=((t,n)=>2e4*t+n)(s,c),f=n[r].get(l);if(void 0!==f)return f;if(e[r].has(l))return gt;let h;e[r].add(l),o++;try{const t=u(function(t){const n=C.get(t);if(n){if(n instanceof a)throw n;return n}let e;try{const{tokens:n,complete:r}=E(t.slice(1));if(!r)throw new a("Unreadable text");e=new v(n).run()}catch(t){if(!(t instanceof a))throw t;e=t}if(C.size>=2e4&&C.clear(),C.set(t,e),e instanceof a)throw e;return e}(i),{sheet:r,row:s,col:c});h=bt(t),null===h&&(h=0)}catch(t){if(!(t instanceof a)){if(!(t instanceof RangeError)||o>1)throw t;return gt}h=pt}finally{o--,e[r].delete(l)}return n[r].set(l,h),h},c=(n,e)=>{let o=e.sheet;if(null!==n.sheet){const t=r.get(n.sheet.toLowerCase());if(void 0===t)return mt;o=t}const c=n.b??n.a;if(null===n.b)return s(o,n.a.row,n.a.col);const u=Math.min(n.a.row??0,c.row??0),i=Math.min(n.a.col??0,c.col??0),l=null===n.a.row?(n=>t[n].cells.length)(o)-1:Math.max(n.a.row,c.row),a=null===n.a.col?(n=>t[n].cells.reduce((t,n)=>Math.max(t,n.length),0))(o)-1:Math.max(n.a.col,c.col);return{...Ct(Math.max(0,l-u+1),Math.max(0,a-i+1),(t,n)=>s(o,u+t,i+n)),raw:(n,e)=>t[o].cells[u+n]?.[i+e]??""}},u=(t,n)=>{switch(t.kind){case"num":case"str":case"bool":return t.value;case"err":return it(t.value);case"empty":return null;case"ref":return c(t.ref,n);case"unary":return xt(u(t.arg,n),null,n=>{const e=n instanceof ct?n:yt(n);return e instanceof ct?e:"-"===t.op?-e:e});case"percent":return xt(u(t.arg,n),100,(t,n)=>vt("/",t,n));case"binary":return xt(u(t.left,n),u(t.right,n),(n,e)=>vt(t.op,n,e));case"call":{const e=bn[t.name];if(e)return e(t.args,t=>u(t,n),n);const r=Mn[t.name];return r?r(t.args.map(t=>u(t,n)),n):dt}}};let i=!1;return{value:(n,e,r)=>t[n]?(i||(i=!0,t.forEach((t,n)=>{t.cells.forEach((t,e)=>t.forEach((t,r)=>{x(t)&&s(n,e,r)}));for(let e=t.cells.length-1;e>=0;e--){const r=t.cells[e];for(let t=r.length-1;t>=0;t--)x(r[t])&&s(n,e,t)}})),s(n,e,r)):null}}var En=100,Nn=24,vn=10;function Cn(t,n=[]){return{id:crypto.randomUUID(),name:t,rowCount:Math.max(1e3,n.length+100),colCount:Math.max(26,n.reduce((t,n)=>Math.max(t,n.length),0)),cells:n,formats:{},colWidths:{},rowHeights:{},hiddenRows:[],hiddenCols:[],merges:[],frozenRows:0,frozenCols:0,filter:null}}var xn=(t,n)=>`${t}:${n}`,Tn=(t,n,e)=>t.cells[n]?.[e]??"";function $n(t,n){const e=new Set(t.map(t=>t.name.toLowerCase()));for(let r=t.length+1;;r++){const t=`${n} ${r}`;if(!e.has(t.toLowerCase()))return t}}function Rn(t){return An(t)}function Sn(t){let n=0,e=!1;for(const r of t)'"'===r?e=!e:e||"("!==r?e||")"!==r||n--:n++;return!e&&n>0?t+")".repeat(n):t}function On(t,n){if(x(t))return{raw:Sn(t),numFmt:null};if(""===t||"'"===t[0])return{raw:t,numFmt:null};if("@"===n?.numFmt)return{raw:`'${t}`,numFmt:null};const e=st(t);return e?{raw:String(e.value),numFmt:e.format}:{raw:t,numFmt:null}}function Un(t,n){if(x(t)||""===t)return t;const e=Mt(t);if("number"!=typeof e||!n?.numFmt)return t;if(G(n.numFmt)){const t=k(e),n=`${t.year}-${U(t.month)}-${U(t.day)}`;return Number.isInteger(e)?n:`${n} ${U(t.hours)}:${U(t.minutes)}:${U(t.seconds)}`}return/%/.test(n.numFmt)?`${X(100*e)}%`:t}var In={text:"",color:null,align:"left",error:!1};function Ln(t,n,e,r,o){const s=Tn(t,r,o);return""===s?In:function(t,n,e){if(null===t)return In;if(t instanceof ct)return{text:t.code,color:null,align:"center",error:!0};if("boolean"==typeof t)return{text:t?"TRUE":"FALSE",color:null,align:"center",error:!1};const r=e?.numFmt;if("number"==typeof t){if(!(r&&"General"!==r||x(n)))return{text:n,color:null,align:"right",error:!1};const{text:e,color:o}=Y(t,r??"General");return{text:e,color:o,align:"right",error:!1}}return{text:r?_(t,r):t,color:null,align:"left",error:!1}}(e.value(n,r,o),s,t.formats[xn(r,o)])}function Dn(t){let n=-1,e=-1;return t.cells.forEach((t,r)=>{for(let o=t.length-1;o>=0;o--)if(""!==t[o]){n=Math.max(n,r),e=Math.max(e,o);break}}),n<0?null:{row:n,col:e}}function Fn(t,n){if(!n.length)return t;const e=[...t.cells],r=new Set;let o=t.rowCount,s=t.colCount;for(const{row:t,col:c,raw:u}of n)if(""!==u||""!==(e[t]?.[c]??"")){for(;e.length<=t;)e.push([]);for(r.has(t)||(e[t]=[...e[t]],r.add(t));e[t].length<=c;)e[t].push("");e[t][c]=u,o=Math.max(o,t+1),s=Math.max(s,c+1)}return{...t,cells:e,rowCount:o,colCount:s}}function kn(t,n,e,r){const o=xn(n,e),s=t.formats[o],{raw:c,numFmt:u}=On(r,s),i=Fn(t,[{row:n,col:e,raw:c}]);return!u||s?.numFmt&&"General"!==s.numFmt?i:{...i,formats:{...i.formats,[o]:{...s,numFmt:u}}}}function Pn(t,n){for(let e=t.r1;e<=t.r2;e++)for(let r=t.c1;r<=t.c2;r++)n(e,r)}function Vn(t,n){const e=[];return Pn(function(t,n){const e=Math.min(n.r2,t.cells.length-1);return{...n,r2:Math.max(e,n.r1-1)}}(t,n),(n,r)=>{""!==Tn(t,n,r)&&e.push({row:n,col:r,raw:""})}),Fn(t,e)}function zn(t,n,e){const r={...t.formats},o=(t,n)=>{const o=xn(t,n),s=e(r[o]??{});Object.keys(s).length?r[o]=s:delete r[o]};return Pn((n.r2-n.r1+1)*(n.c2-n.c1+1)>2e5?{...n,r2:Math.min(n.r2,Math.max(t.cells.length,2e3))}:n,o),{...t,formats:r}}function Gn(t,n,e){const r={...t};return void 0===e||!1===e?delete r[n]:r[n]=e,r}function Wn(t,n,e){const r={...t.formats};return Pn(n,(t,o)=>{const s=xn(t,o),c=r[s]??{},u=((t,e)=>({...t===n.r1?{top:!0}:{},...t===n.r2?{bottom:!0}:{},...e===n.c1?{left:!0}:{},...e===n.c2?{right:!0}:{}}))(t,o);let i;switch(e){case"none":i={};break;case"all":i={top:!0,right:!0,bottom:!0,left:!0};break;case"outer":i={...c.border,...u};break;default:i=u[e]?{...c.border,[e]:!0}:c.border??{}}const l=Gn(c,"border",Object.keys(i).length?i:void 0);Object.keys(l).length?r[s]=l:delete r[s]}),{...t,formats:r}}function jn(t,n,e){return t.merges.find(t=>u(t,n,e))??null}function Hn(t,n){let e=n;for(let n=!0;n;){n=!1;for(const r of t.merges){if(!i(e,r))continue;const t={r1:Math.min(e.r1,r.r1),c1:Math.min(e.c1,r.c1),r2:Math.max(e.r2,r.r2),c2:Math.max(e.c2,r.c2)};t.r1===e.r1&&t.c1===e.c1&&t.r2===e.r2&&t.c2===e.c2||(e=t,n=!0)}}return e}function Kn(t,n){if(n.r1===n.r2&&n.c1===n.c2)return t;const e=[];Pn(n,(r,o)=>{r===n.r1&&o===n.c1||""===Tn(t,r,o)||e.push({row:r,col:o,raw:""})});const r=Fn(t,e);return{...r,merges:[...r.merges.filter(t=>!i(t,n)),n]}}function Xn(t,n){return{...t,merges:t.merges.filter(t=>!i(t,n))}}function Zn(t,n,e){const r=t[n].name.toLowerCase();return t.map((t,o)=>{let s=!1;const c=t.cells.map(t=>{let c=!1;const u=t.map(t=>{if(!x(t))return t;const s=R(t,t=>(null===t.sheet?o===n:t.sheet.toLowerCase()===r)?e(t):t);return s!==t&&(c=!0),s});return c&&(s=!0),c?u:t});return s?{...t,cells:c}:t})}function Yn(t,n,e){if(e>0)return t>=n?t+e:t;const r=n-e;return t>=n&&t<r?null:t>=r?t+e:t}function _n(t,n,e){const r={};for(const[o,s]of Object.entries(t)){const t=Yn(Number(o),n,e);null!==t&&(r[t]=s)}return r}function Bn(t,n,e,r){const[o,s]="row"===n?[t.r1,t.r2]:[t.c1,t.c2];let c,u;if(r>0)c=o>=e?o+r:o,u=s>=e?s+r:s;else{const t=e-r;if(c=o<e?o:o>=t?o+r:e,u=s<e?s:s>=t?s+r:e-1,c>u)return null}return"row"===n?{...t,r1:c,r2:u}:{...t,c1:c,c2:u}}function Qn(t,n,e,r,o){const s=Zn(t,n,t=>function(t,n,e,r){const o=t=>"row"===n?t.row:t.col,s=(t,e)=>"row"===n?{...t,row:e}:{...t,col:e},c=o(t.a);if(null===c)return t;if(r>0){const n=t=>t>=e?t+r:t;return{...t,a:s(t.a,n(c)),b:t.b?s(t.b,n(o(t.b))):null}}const u=-r,i=e+u;if(!t.b)return c>=e&&c<i?null:{...t,a:s(t.a,c>=i?c-u:c)};const l=Math.min(c,o(t.b)),a=Math.max(c,o(t.b)),f=l<e?l:l>=i?l-u:e,h=a<e?a:a>=i?a-u:e-1;return f>h?null:{...t,a:s(t.a,f),b:s(t.b,h)}}(t,e,r,o));return s.map((t,s)=>{if(s!==n)return t;const c="row"===e?(()=>{const n=[...t.cells];return o>0?n.length>r&&n.splice(r,0,...Array.from({length:o},()=>[])):n.splice(r,-o),n})():t.cells.map(t=>{if(t.length<=r)return t;const n=[...t];return o>0?n.splice(r,0,...Array(o).fill("")):n.splice(r,-o),n}),u={};for(const[n,s]of Object.entries(t.formats)){const[t,c]=n.split(":").map(Number),i=Yn("row"===e?t:c,r,o);null!==i&&(u["row"===e?xn(i,c):xn(t,i)]=s)}const i=t.merges.map(t=>Bn(t,e,r,o)).filter(t=>null!==t&&(t.r1!==t.r2||t.c1!==t.c2)),l=t=>t.map(t=>Yn(t,r,o)).filter(t=>null!==t),a=t.filter?Bn(t.filter.range,e,r,o):null,f=t.filter&&a?{range:a,excluded:"col"===e?_n(t.filter.excluded,r,o):t.filter.excluded}:null,h=t=>r<t?o>0?t+o:Math.max(r,t+o):t;return{...t,cells:c,formats:u,merges:i,filter:f,rowCount:"row"===e?Math.max(1,t.rowCount+o):t.rowCount,colCount:"col"===e?Math.max(1,t.colCount+o):t.colCount,rowHeights:"row"===e?_n(t.rowHeights,r,o):t.rowHeights,colWidths:"col"===e?_n(t.colWidths,r,o):t.colWidths,hiddenRows:"row"===e?l(t.hiddenRows):t.hiddenRows,hiddenCols:"col"===e?l(t.hiddenCols):t.hiddenCols,frozenRows:"row"===e?h(t.frozenRows):t.frozenRows,frozenCols:"col"===e?h(t.frozenCols):t.frozenCols}})}function Jn(t,n,e){return Zn(t,n,t=>null===t.sheet?t:{...t,sheet:e}).map((t,r)=>r===n?{...t,name:e}:t)}function qn(t,n){return Zn(t,n,t=>null===t.sheet?t:null).filter((t,e)=>e!==n)}function te(t,n,e){const r={...t[n],id:crypto.randomUUID(),name:e};return[...t.slice(0,n+1),r,...t.slice(n+1)]}function ne(t,n,e,r,o,s){const c=[];for(let t=r.r1;t<=r.r2;t++)c.push(t);const u=new Map(c.map(t=>[t,e.value(n,t,o)])),i=[...c].sort((t,n)=>{const e=u.get(t),r=u.get(n),o=null===e||""===e,c=null===r||""===r;if(o||c)return o===c?t-n:o?1:-1;if(e instanceof ct||r instanceof ct)return e instanceof ct?1:-1;const i=Nt(e,r);return(s?i:-i)||t-n}),l=[],a={...t.formats},f=new Map;return Pn(r,(n,e)=>f.set(xn(n,e),t.formats[xn(n,e)])),i.forEach((n,e)=>{const o=r.r1+e;for(let e=r.c1;e<=r.c2;e++){const r=Tn(t,n,e);l.push({row:o,col:e,raw:x(r)?S(r,o-n,0):r});const s=f.get(xn(n,e));s?a[xn(o,e)]=s:delete a[xn(o,e)]}}),{...Fn(t,l),formats:a}}function ee(t,n,e){const r=new Set,{filter:o}=t;if(!o)return r;for(const[s,c]of Object.entries(o.excluded)){if(!c.length)continue;const u=Number(s),i=new Set(c);for(let s=o.range.r1+1;s<=o.range.r2;s++)i.has(Ln(t,n,e,s,u).text)&&r.add(s)}return r}function re(t,n){if(n.r1!==n.r2||n.c1!==n.c2)return n;const e=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==Tn(t,n,o))return!1;return!0},r=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==Tn(t,o,n))return!1;return!0};let{r1:o,r2:s,c1:c,c2:u}=n;for(let n=!0;n;)n=!1,o>0&&!e(o-1,c,u)&&(o--,n=!0),s<t.rowCount-1&&!e(s+1,c,u)&&(s++,n=!0),c>0&&!r(c-1,o,s)&&(c--,n=!0),u<t.colCount-1&&!r(u+1,o,s)&&(u++,n=!0);return{r1:o,c1:c,r2:s,c2:u}}var oe=/^(.*?)(\d+)$/;function se(t,n){const e=t.length,r=t.map(t=>{if(x(t))return null;const n=Mt(t);return"number"==typeof n?n:null});if(e>=2&&r.every(t=>null!==t)){const t=(r[e-1]-r[0])/(e-1);if(r.every((n,e)=>Math.abs(n-(r[0]+t*e))<1e-9))return String(Number((r[0]+t*n).toPrecision(15)))}const o=(n%e+e)%e,s=t[o];if("number"==typeof r[o]||x(s)||""===s||"'"===s[0])return s;const c=oe.exec(s);if(c&&c[1]&&1===e){const t=Number(c[2])+n;if(t>=0)return c[1]+String(t).padStart(c[2].length,"0")}return s}function ce(t,n,e){const r=[],o={...t.formats},s=n.r2-n.r1+1,c=n.c2-n.c1+1,i=e.r1<n.r1||e.r2>n.r2;return Pn(e,(e,l)=>{if(u(n,e,l))return;let a,f,h;if(i){const r=Array.from({length:s},(e,r)=>Tn(t,n.r1+r,l)),o=e-n.r1;a=n.r1+(o%s+s)%s,f=l;const c=Tn(t,a,f);h=x(c)?S(c,e-a,0):se(r,o)}else{const r=Array.from({length:c},(r,o)=>Tn(t,e,n.c1+o)),o=l-n.c1;a=e,f=n.c1+(o%c+c)%c;const s=Tn(t,a,f);h=x(s)?S(s,0,l-f):se(r,o)}r.push({row:e,col:l,raw:h});const m=t.formats[xn(a,f)];m?o[xn(e,l)]=m:delete o[xn(e,l)]}),{...Fn(t,r),formats:o}}function ue(t,n,e,r,o){const s=[];for(let o=r.r1;o<=r.r2;o++){const c=[];for(let s=r.c1;s<=r.c2;s++){const r=Tn(t,o,s);c.push({raw:r,display:Ln(t,n,e,o,s).text,value:""===r?null:e.value(n,o,s),format:t.formats[xn(o,s)]})}s.push(c)}return{sheetId:t.id,range:r,cut:o,cells:s,text:s.map(t=>t.map(t=>{return n=t.display,/["\t\n]/.test(n)?`"${n.replace(/"/g,'""')}"`:n;var n}).join("\t")).join("\n")}}function ie(t,n,e,r){const o=n.cells.length,s=n.cells[0]?.length??0,c=e.r2-e.r1+1,u=e.c2-e.c1+1,i=c%o===0&&u%s===0,l=i?c:o,a=i?u:s,f=[],h={...t.formats};for(let t=0;t<l;t++)for(let c=0;c<a;c++){const u=n.cells[t%o][c%s],i=e.r1+t,l=e.c1+c;if("formats"!==r){let e=u.raw;"values"===r?(e=u.value instanceof ct?u.value.code:null===u.value?"":At(u.value),"number"==typeof u.value&&(e=String(u.value))):x(e)&&!n.cut&&(e=S(e,i-(n.range.r1+t%o),l-(n.range.c1+c%s))),f.push({row:i,col:l,raw:e})}"values"!==r&&(u.format?h[xn(i,l)]=u.format:delete h[xn(i,l)])}return{sheet:{...Fn(t,f),formats:h},range:{r1:e.r1,c1:e.c1,r2:e.r1+l-1,c2:e.c1+a-1}}}function le(t,n,e,r,o){const{range:s}=e,c=o.r1-s.r1,i=o.c1-s.c1,l=t[r].name,a=n!==r,f=Zn(t,n,t=>{const n=t.a.row,e=t.a.col,r=t.b?t.b.row:t.a.row,o=t.b?t.b.col:t.a.col;if(null===n||null===e||null===r||null===o)return t;if(!u(s,n,e)||!u(s,r,o))return t;const f=t=>({...t,row:t.row+c,col:t.col+i});return{...t,sheet:a?l:t.sheet,a:f(t.a),b:t.b?f(t.b):null}}),h=f.map((t,e)=>{if(e!==n)return t;const r={...t.formats};return Pn(s,(t,n)=>{delete r[xn(t,n)]}),{...Vn(t,s),formats:r}}),m={...e,cells:e.cells.map((t,e)=>t.map((t,r)=>({...t,raw:Tn(f[n],s.r1+e,s.c1+r)})))},d={r1:o.r1,c1:o.c1,r2:o.r1+e.cells.length-1,c2:o.c1+(e.cells[0]?.length??1)-1},g=ie(h[r],m,d,"all");return{sheets:h.map((t,n)=>n===r?g.sheet:t),range:g.range}}function ae(t,n){const e=n.matchCase?t:t.toLowerCase();return t=>{const r=n.matchCase?t:t.toLowerCase();return n.wholeCell?r===e:r.includes(e)}}function fe(t,n,e,r,o){if(!r)return[];const s=ae(r,o),c=[];return t.cells.forEach((r,u)=>r.forEach((r,i)=>{if(""===r)return;const l=o.inFormulas?r:Ln(t,n,e,u,i).text;s(l)&&c.push({row:u,col:i})})),c}function he(t,n,e,r){if(x(t)&&!r.inFormulas)return t;if(r.wholeCell)return ae(n,r)(t)?e:t;const o=r.matchCase?"g":"gi";return t.replace(new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o),()=>e)}function me(t,n,e,r,o){let s,c=0,u=0,i=0,l=1/0,a=-1/0;const f=Math.min(r.r2,t.cells.length-1);for(let h=r.r1;h<=f;h++){if(o.has(h))continue;const f=t.cells[h];if(!f)continue;const m=Math.min(r.c2,f.length-1);for(let o=r.c1;o<=m;o++){if(""===f[o])continue;u++;const r=e.value(n,h,o);"number"==typeof r&&(i++,c+=r,r<l&&(l=r),r>a&&(a=r),s??=t.formats[xn(h,o)]?.numFmt)}}return{sum:c,average:i?c/i:null,count:u,numbers:i,min:l,max:a,firstFormat:s}}function de(t){const n=t.replace(/^/,""),e=n.slice(0,n.search(/\r?\n|$/)),r=e.includes("\t")&&!e.includes(",")||e.includes("\t")?"\t":",",o=[];let s=[],c="",u=!1,i=0;for(;i<n.length;){const t=n[i];if(u){if('"'===t){if('"'===n[i+1]){c+='"',i+=2;continue}u=!1,i++;continue}c+=t,i++}else'"'!==t||""!==c?t!==r?("\r"===t&&"\n"===n[i+1]&&i++,"\n"!==t&&"\r"!==t?(c+=t,i++):(s.push(c),o.push(s),s=[],c="",i++)):(s.push(c),c="",i++):(u=!0,i++)}return(""!==c||s.length)&&(s.push(c),o.push(s)),o.filter(t=>t.some(t=>""!==t))}function ge(t){return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function pe(t,n,e){const r=Dn(t);if(!r)return"";const o=[];for(let s=0;s<=r.row;s++){const c=[];for(let o=0;o<=r.col;o++){const r=Tn(t,s,o),u=Ln(t,n,e,s,o).text;c.push(ge("'"===r[0]&&/^[=+\-@]/.test(u)?r:u))}o.push(c.join(","))}return o.join("\n")}function we(t,n){const e=Cn(t),r={},o=n.map((t,n)=>t.map((t,e)=>{const{raw:o,numFmt:s}=On(t);return s&&(r[xn(n,e)]={numFmt:s}),o}));return{...e,cells:o,formats:r,rowCount:Math.max(e.rowCount,o.length+100),colCount:Math.max(e.colCount,o.reduce((t,n)=>Math.max(t,n.length),0))}}function Me(t,n,e,r,o){const s=new Set;for(let c=r.r1+1;c<=r.r2;c++)s.add(Ln(t,n,e,c,o).text);return[...s].sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}export{t as MAX_ROWS,n as MAX_COLS,e as colLabel,r as colIndex,o as cellLabel,s as normalizeRange,c as rangeLabel,u as rangeContains,l as parseRangeLabel,E as tokenize,x as isFormula,$ as printRef,S as shiftFormula,O as cycleRefAbsolute,I as NUMBER_FORMATS,Y as formatNumber,B as adjustDecimals,ct as FormulaError,yn as FUNCTION_NAMES,En as DEFAULT_COL_WIDTH,Nn as DEFAULT_ROW_HEIGHT,vn as DEFAULT_FONT_SIZE,Cn as newSheet,xn as formatKey,Tn as rawAt,$n as nextSheetName,Rn as makeEvaluator,On as readEntry,Un as editText,Ln as cellDisplay,Dn as usedBounds,Fn as writeCells,kn as commitEntry,Vn as clearValues,zn as updateFormats,Gn as withFormat,Wn as applyBorders,jn as mergedAt,Hn as expandForMerges,Kn as mergeRange,Xn as unmergeRange,Qn as changeStructure,Jn as renameSheet,qn as deleteSheet,te as duplicateSheet,ne as sortRange,ee as filteredRows,re as dataRegion,ce as fillRange,ue as copyClip,ie as pasteClip,le as moveCells,fe as findCells,he as replaceInCell,me as selectionStats,de as parseCsv,pe as serializeCsv,we as sheetFromRows,Me as columnValues};
|