@silurus/ooxml 0.74.4 → 0.74.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{docx-Dv8sdixm.js → docx-DftZMp7R.js} +2 -2
- package/dist/docx.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-DkKbei1w.js → pptx-qbadwIv4.js} +209 -131
- package/dist/pptx.mjs +1 -1
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-worker-host-B-Y1DmN9.js → render-worker-host-Bcm9j4-H.js} +1 -1
- package/dist/{render-worker-host-B5otq5TA.js → render-worker-host-BqSTDaYt.js} +1 -1
- package/dist/types/docx.d.ts +24 -9
- package/dist/types/index.d.ts +47 -22
- package/dist/types/pptx.d.ts +35 -12
- package/dist/types/xlsx.d.ts +21 -4
- package/dist/{xlsx-D-UFFxVs.js → xlsx-BqMHvfsE.js} +377 -369
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { At as t, B as n, Bt as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, Ot as w, P as T, Pt as E, R as D, Rt as O, S as
|
|
3
|
-
import { a as
|
|
4
|
-
import { t as
|
|
2
|
+
import { At as t, B as n, Bt as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, Ot as w, P as T, Pt as E, R as D, Rt as O, S as k, T as A, Tt as j, U as M, Ut as ee, V as N, W as P, Y as F, Yt as I, _ as L, _t as R, at as z, b as B, d as V, et as H, f as U, h as W, i as te, jt as G, k as ne, kt as re, l as ie, lt as ae, m as oe, mt as se, n as ce, nt as le, o as K, p as ue, q as de, qt as q, r as fe, rt as pe, t as me, ut as J, v as he, vt as ge, w as _e, x as ve, xt as Y, zt as ye } from "./find-cursor-DtgyGs5V.js";
|
|
3
|
+
import { a as be, i as xe, n as Se, r as Ce, t as we } from "./visible-index-C3_3gBg-.js";
|
|
4
|
+
import { t as Te } from "./mathjax-BPjQ2C_j.js";
|
|
5
5
|
//#region packages/core/src/sparkline/renderer.ts
|
|
6
|
-
function
|
|
6
|
+
function Ee(e, t, n) {
|
|
7
7
|
let { values: r } = n;
|
|
8
8
|
if (r.length === 0 || t.w <= 0 || t.h <= 0) return;
|
|
9
9
|
let i = n.colorSeries ?? "#5B9BD5", a = Math.min(2, t.w * .08), o = Math.max(2, t.h * .2), s = t.x + a, c = t.y + o, l = Math.max(1, t.w - a * 2), u = Math.max(1, t.h - o * 2), d = r.filter((e) => typeof e == "number");
|
|
@@ -12,11 +12,11 @@ function De(e, t, n) {
|
|
|
12
12
|
m === h && (h = m + 1, --m);
|
|
13
13
|
let g = h - m, _ = (e) => c + u - (e - m) / g * u;
|
|
14
14
|
if (n.kind === "stem") {
|
|
15
|
-
|
|
15
|
+
ke(e, n, s, c, l, u);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (n.kind === "column") {
|
|
19
|
-
|
|
19
|
+
Oe(e, n, r, s, c, l, u, m, h);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (n.displayXAxis && m < 0 && h > 0) {
|
|
@@ -40,7 +40,7 @@ function De(e, t, n) {
|
|
|
40
40
|
b ? e.lineTo(i, a) : (e.moveTo(i, a), b = !0);
|
|
41
41
|
}
|
|
42
42
|
e.stroke(), e.restore();
|
|
43
|
-
let C = Math.max(1, Math.min(2.5, u * .12)), w =
|
|
43
|
+
let C = Math.max(1, Math.min(2.5, u * .12)), w = De(r, n);
|
|
44
44
|
for (let t = 0; t < v; t++) {
|
|
45
45
|
let a = r[t];
|
|
46
46
|
if (a == null) continue;
|
|
@@ -48,7 +48,7 @@ function De(e, t, n) {
|
|
|
48
48
|
(n.markers || o != null) && (e.save(), e.fillStyle = o ?? n.colorMarkers ?? i, e.beginPath(), e.arc(y(t), _(a), C, 0, Math.PI * 2), e.fill(), e.restore());
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function De(e, t) {
|
|
52
52
|
let n = e.map(() => null), r = e.map((e) => typeof e == "number" ? e : null), i = r.findIndex((e) => e != null), a = -1;
|
|
53
53
|
for (let e = r.length - 1; e >= 0; e--) if (r[e] != null) {
|
|
54
54
|
a = e;
|
|
@@ -63,10 +63,10 @@ function Oe(e, t) {
|
|
|
63
63
|
if (t.low && t.colorLow && !Number.isNaN(c)) for (let e = 0; e < r.length; e++) r[e] === c && (n[e] = t.colorLow);
|
|
64
64
|
return n;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Oe(e, t, n, r, i, a, o, s, c) {
|
|
67
67
|
let l = n.length;
|
|
68
68
|
if (l === 0) return;
|
|
69
|
-
let u = s < 0 && c > 0 ? 0 : s, d = c - s, f = (e) => i + o - (e - s) / d * o, p = f(u), m = a / l, h = Math.min(1.5, m * .15), g =
|
|
69
|
+
let u = s < 0 && c > 0 ? 0 : s, d = c - s, f = (e) => i + o - (e - s) / d * o, p = f(u), m = a / l, h = Math.min(1.5, m * .15), g = De(n, t);
|
|
70
70
|
for (let i = 0; i < l; i++) {
|
|
71
71
|
let a = n[i];
|
|
72
72
|
if (a == null) continue;
|
|
@@ -74,10 +74,10 @@ function ke(e, t, n, r, i, a, o, s, c) {
|
|
|
74
74
|
e.save(), e.fillStyle = o, e.fillRect(c, Math.min(p, s), l, Math.abs(p - s)), e.restore();
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function ke(e, t, n, r, i, a) {
|
|
78
78
|
let o = t.values.length;
|
|
79
79
|
if (o === 0) return;
|
|
80
|
-
let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d =
|
|
80
|
+
let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d = De(t.values, t);
|
|
81
81
|
for (let r = 0; r < o; r++) {
|
|
82
82
|
let i = t.values[r];
|
|
83
83
|
if (i == null || i === 0) continue;
|
|
@@ -87,16 +87,16 @@ function Ae(e, t, n, r, i, a) {
|
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region packages/core/src/text/bidi/segments.ts
|
|
90
|
-
function
|
|
90
|
+
function Ae(e, t) {
|
|
91
91
|
return e === !0 ? "rtl" : e === !1 ? "ltr" : f().computeLevels(t, "auto").paragraphLevel === 1 ? "rtl" : "ltr";
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region packages/xlsx/src/worker.ts?worker&inline
|
|
95
|
-
var
|
|
96
|
-
function
|
|
95
|
+
var je = "var e=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,n.unregister(this),e}free(){let e=this.__destroy_into_raw();y.__wbg_xlsxarchive_free(e,0)}extract_image(e){let t=f(e,y.__wbindgen_malloc,y.__wbindgen_realloc),n=v,r=y.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw p(r[2]);var a=i(r[0],r[1]).slice();return y.__wbindgen_free(r[0],r[1]*1,1),a}constructor(e,t){let r=d(e,y.__wbindgen_malloc),i=v,a=y.xlsxarchive_new(r,i,!u(t),u(t)?BigInt(0):t);if(a[2])throw p(a[1]);return this.__wbg_ptr=a[0]>>>0,n.register(this,this.__wbg_ptr,this),this}parse(){let e=y.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw p(e[2]);var t=i(e[0],e[1]).slice();return y.__wbindgen_free(e[0],e[1]*1,1),t}parse_sheet(e,t){let n=f(t,y.__wbindgen_malloc,y.__wbindgen_realloc),r=v,a=y.xlsxarchive_parse_sheet(this.__wbg_ptr,e,n,r);if(a[3])throw p(a[2]);var o=i(a[0],a[1]).slice();return y.__wbindgen_free(a[0],a[1]*1,1),o}to_markdown(){let e,t;try{let i=y.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,p(i[2]);return e=n,t=r,s(n,r)}finally{y.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);function t(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_debug_string_ab4b34d23d6778bd:function(e,t){let n=f(r(t),y.__wbindgen_malloc,y.__wbindgen_realloc),i=v;o().setInt32(e+4,i,!0),o().setInt32(e+0,n,!0)},__wbg___wbindgen_string_get_7ed5322991caaec5:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=u(r)?0:f(r,y.__wbindgen_malloc,y.__wbindgen_realloc),a=v;o().setInt32(e+4,a,!0),o().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(s(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(s(e,t))}finally{y.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=f(n,y.__wbindgen_malloc,y.__wbindgen_realloc),i=v;o().setInt32(e+4,i,!0),o().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return s(e,t)},__wbindgen_init_externref_table:function(){let e=y.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const n=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>y.__wbg_xlsxarchive_free(e>>>0,1));function r(e){let t=typeof e;if(t==`number`||t==`boolean`||e==null)return`${e}`;if(t==`string`)return`\"${e}\"`;if(t==`symbol`){let t=e.description;return t==null?`Symbol`:`Symbol(${t})`}if(t==`function`){let t=e.name;return typeof t==`string`&&t.length>0?`Function(${t})`:`Function`}if(Array.isArray(e)){let t=e.length,n=`[`;t>0&&(n+=r(e[0]));for(let i=1;i<t;i++)n+=`, `+r(e[i]);return n+=`]`,n}let n=/\\[object ([^\\]]+)\\]/.exec(toString.call(e)),i;if(n&&n.length>1)i=n[1];else return toString.call(e);if(i==`Object`)try{return`Object(`+JSON.stringify(e)+`)`}catch{return`Object`}return e instanceof Error?`${e.name}: ${e.message}\\n${e.stack}`:i}function i(e,t){return e>>>=0,l().subarray(e/1,e/1+t)}let a=null;function o(){return(a===null||a.buffer.detached===!0||a.buffer.detached===void 0&&a.buffer!==y.memory.buffer)&&(a=new DataView(y.memory.buffer)),a}function s(e,t){return e>>>=0,g(e,t)}let c=null;function l(){return(c===null||c.byteLength===0)&&(c=new Uint8Array(y.memory.buffer)),c}function u(e){return e==null}function d(e,t){let n=t(e.length*1,1)>>>0;return l().set(e,n/1),v=e.length,n}function f(e,t,n){if(n===void 0){let n=_.encode(e),r=t(n.length,1)>>>0;return l().subarray(r,r+n.length).set(n),v=n.length,r}let r=e.length,i=t(r,1)>>>0,a=l(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=l().subarray(i+o,i+r),a=_.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return v=o,i}function p(e){let t=y.__wbindgen_externrefs.get(e);return y.__externref_table_dealloc(e),t}let m=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});m.decode();let h=0;function g(e,t){return h+=t,h>=2146435072&&(m=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),m.decode(),h=t),m.decode(l().subarray(e,e+t))}const _=new TextEncoder;`encodeInto`in _||(_.encodeInto=function(e,t){let n=_.encode(e);return t.set(n),{read:e.length,written:n.length}});let v=0,y;function b(e,t){return y=e.exports,a=null,c=null,y.__wbindgen_start(),y}async function x(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function S(e){if(y!==void 0)return y;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let n=t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await x(await e,n);return b(r,i)}async function C(e){return y=void 0,a=null,c=null,S(e)}function w(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var T=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function E(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}const D=new class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw E(e)?(this._poison(),new T(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}}(S,{freeArchive:e=>e.free(),reinit:C});self.onmessage=async t=>{let n=t.data;if(n.type===`init`){D.setWasmUrl(w(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.type===`parse`){let t=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,i=new Uint8Array(n.data),a=D.run(()=>{let n=new e(i,t);return D.setArchive(n),n.parse()}).buffer,o={type:`parsed`,id:r,workbookJson:a};self.postMessage(o,[a]);return}let t=D.archive;if(n.type===`parseSheet`){if(!t)throw Error(`parseSheet before parse: no archive retained`);let e=D.run(()=>t.parse_sheet(n.sheetIndex,n.sheetName)).buffer,i={type:`parsedSheet`,id:r,worksheetJson:e};self.postMessage(i,[e]);return}if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=D.run(()=>t.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:e};self.postMessage(i,[e]);return}if(n.type===`toMarkdown`){if(!t)throw Error(`No xlsx loaded`);let e={type:`markdownRendered`,id:r,markdown:D.run(()=>t.to_markdown())};self.postMessage(e);return}}catch(e){let t={type:`error`,id:r,message:String(e)};self.postMessage(t)}};", Me = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", je], { type: "text/javascript;charset=utf-8" });
|
|
96
|
+
function Ne(e) {
|
|
97
97
|
let t;
|
|
98
98
|
try {
|
|
99
|
-
if (t =
|
|
99
|
+
if (t = Me && (self.URL || self.webkitURL).createObjectURL(Me), !t) throw "";
|
|
100
100
|
let n = new Worker(t, {
|
|
101
101
|
type: "module",
|
|
102
102
|
name: e?.name
|
|
@@ -105,7 +105,7 @@ function Pe(e) {
|
|
|
105
105
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
106
106
|
}), n;
|
|
107
107
|
} catch {
|
|
108
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
108
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(je), {
|
|
109
109
|
type: "module",
|
|
110
110
|
name: e?.name
|
|
111
111
|
});
|
|
@@ -113,19 +113,19 @@ function Pe(e) {
|
|
|
113
113
|
}
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region packages/xlsx/src/wasm/xlsx_parser_bg.wasm?url
|
|
116
|
-
var
|
|
116
|
+
var Pe = new URL("xlsx_parser_bg.wasm", import.meta.url).href;
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region packages/xlsx/src/sheet-visibility.ts
|
|
119
|
-
function
|
|
119
|
+
function Fe(e, t) {
|
|
120
120
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? "visible" : e[t].visibility ?? "visible";
|
|
121
121
|
}
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region packages/xlsx/src/phonetic.ts
|
|
124
|
-
function
|
|
124
|
+
function Ie(e) {
|
|
125
125
|
return Array.from(e);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
let a =
|
|
127
|
+
function Le(e, t, n, r, i) {
|
|
128
|
+
let a = Ie(t), o = a.length, s = [];
|
|
129
129
|
for (let t of e) {
|
|
130
130
|
let e = t.sb, c = t.eb;
|
|
131
131
|
if (!(e < c) || e >= o) continue;
|
|
@@ -141,7 +141,7 @@ function Re(e, t, n, r, i) {
|
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region packages/xlsx/src/formula.ts
|
|
144
|
-
function
|
|
144
|
+
function Re(e) {
|
|
145
145
|
return Array.isArray(e) ? e : [e];
|
|
146
146
|
}
|
|
147
147
|
function ze(e) {
|
|
@@ -457,8 +457,8 @@ function lt(e) {
|
|
|
457
457
|
}
|
|
458
458
|
function ut(e, t, n) {
|
|
459
459
|
switch (e.toUpperCase()) {
|
|
460
|
-
case "AND": return t.flatMap(
|
|
461
|
-
case "OR": return t.flatMap(
|
|
460
|
+
case "AND": return t.flatMap(Re).every((e) => He(e));
|
|
461
|
+
case "OR": return t.flatMap(Re).some((e) => He(e));
|
|
462
462
|
case "NOT": return !He(t[0]);
|
|
463
463
|
case "IF": return He(t[0]) ? t[1] ?? !0 : t[2] ?? !1;
|
|
464
464
|
case "IFERROR": return t[0] == null ? t[1] ?? 0 : t[0];
|
|
@@ -527,25 +527,25 @@ function ut(e, t, n) {
|
|
|
527
527
|
return e <= 0 ? null : Math.log10(e);
|
|
528
528
|
}
|
|
529
529
|
case "MIN": {
|
|
530
|
-
let e = t.flatMap(
|
|
530
|
+
let e = t.flatMap(Re).filter((e) => typeof e == "number");
|
|
531
531
|
return e.length ? Math.min(...e) : 0;
|
|
532
532
|
}
|
|
533
533
|
case "MAX": {
|
|
534
|
-
let e = t.flatMap(
|
|
534
|
+
let e = t.flatMap(Re).filter((e) => typeof e == "number");
|
|
535
535
|
return e.length ? Math.max(...e) : 0;
|
|
536
536
|
}
|
|
537
|
-
case "SUM": return t.flatMap(
|
|
537
|
+
case "SUM": return t.flatMap(Re).reduce((e, t) => e + (typeof t == "number" ? t : 0), 0);
|
|
538
538
|
case "AVERAGE": {
|
|
539
|
-
let e = t.flatMap(
|
|
539
|
+
let e = t.flatMap(Re).filter((e) => typeof e == "number");
|
|
540
540
|
return e.length ? e.reduce((e, t) => e + t, 0) / e.length : null;
|
|
541
541
|
}
|
|
542
|
-
case "COUNT": return t.flatMap(
|
|
543
|
-
case "COUNTA": return t.flatMap(
|
|
544
|
-
case "COUNTBLANK": return t.flatMap(
|
|
545
|
-
case "COUNTIF": return dt(
|
|
546
|
-
case "SUMIF": return ft(
|
|
542
|
+
case "COUNT": return t.flatMap(Re).filter((e) => typeof e == "number").length;
|
|
543
|
+
case "COUNTA": return t.flatMap(Re).filter((e) => e != null && e !== "").length;
|
|
544
|
+
case "COUNTBLANK": return t.flatMap(Re).filter((e) => e == null || e === "").length;
|
|
545
|
+
case "COUNTIF": return dt(Re(t[0]), t[1]);
|
|
546
|
+
case "SUMIF": return ft(Re(t[0]), t[1], t[2] === void 0 ? null : Re(t[2]));
|
|
547
547
|
case "AVERAGEIF": {
|
|
548
|
-
let e =
|
|
548
|
+
let e = Re(t[0]), n = ft(e, t[1], t[2] === void 0 ? null : Re(t[2])), r = dt(e, t[1]);
|
|
549
549
|
return r === 0 ? null : X(n) / r;
|
|
550
550
|
}
|
|
551
551
|
case "LEN": return Ue(t[0]).length;
|
|
@@ -571,7 +571,7 @@ function ut(e, t, n) {
|
|
|
571
571
|
return i < 0 ? null : i + 1;
|
|
572
572
|
}
|
|
573
573
|
case "CONCATENATE":
|
|
574
|
-
case "CONCAT": return t.flatMap(
|
|
574
|
+
case "CONCAT": return t.flatMap(Re).map((e) => e == null ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : String(e)).join("");
|
|
575
575
|
case "T": {
|
|
576
576
|
let e = ze(t[0]);
|
|
577
577
|
return typeof e == "string" ? e : "";
|
|
@@ -638,13 +638,13 @@ function pt(e) {
|
|
|
638
638
|
}
|
|
639
639
|
function mt() {
|
|
640
640
|
let e = /* @__PURE__ */ new Date();
|
|
641
|
-
return
|
|
641
|
+
return re(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
|
|
642
642
|
}
|
|
643
643
|
function ht() {
|
|
644
|
-
return
|
|
644
|
+
return re(new Date(Date.now()), !1);
|
|
645
645
|
}
|
|
646
646
|
function gt(e, t, n) {
|
|
647
|
-
return Math.floor(
|
|
647
|
+
return Math.floor(re(new Date(Date.UTC(e, t - 1, n)), !1));
|
|
648
648
|
}
|
|
649
649
|
function _t(e) {
|
|
650
650
|
return w(Math.floor(e), !1);
|
|
@@ -1395,14 +1395,14 @@ function fn(e, t, n, r, i) {
|
|
|
1395
1395
|
//#endregion
|
|
1396
1396
|
//#region packages/xlsx/src/bidi-line.ts
|
|
1397
1397
|
function pn(e, t) {
|
|
1398
|
-
return e === 2 ? !0 : e === 1 ? !1 :
|
|
1398
|
+
return e === 2 ? !0 : e === 1 ? !1 : Ae(void 0, t) === "rtl";
|
|
1399
1399
|
}
|
|
1400
1400
|
var mn = (e) => {
|
|
1401
1401
|
let t = e.text;
|
|
1402
1402
|
return typeof t == "string" ? t : void 0;
|
|
1403
1403
|
};
|
|
1404
1404
|
function hn(e, t) {
|
|
1405
|
-
let n = e === 2 ||
|
|
1405
|
+
let n = e === 2 || N(t);
|
|
1406
1406
|
return {
|
|
1407
1407
|
needBidi: n,
|
|
1408
1408
|
baseRtl: n && pn(e, t)
|
|
@@ -1450,25 +1450,25 @@ function vn(e, t) {
|
|
|
1450
1450
|
//#endregion
|
|
1451
1451
|
//#region packages/xlsx/src/vertical-text.ts
|
|
1452
1452
|
function yn(e, t, n, r, a, o = !1) {
|
|
1453
|
-
let s = t.codePointAt(0) ?? 0, c =
|
|
1453
|
+
let s = t.codePointAt(0) ?? 0, c = k(s);
|
|
1454
1454
|
if (o && i(s)) {
|
|
1455
|
-
e.save(), e.translate(n, r + a / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
1455
|
+
e.save(), e.translate(n, r + a / 2), e.textAlign = "center", e.textBaseline = "middle", he(e, () => e.fillText(t, 0, 0)), e.restore();
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
1458
|
if (c === "Tr") {
|
|
1459
|
-
let i =
|
|
1459
|
+
let i = B(s);
|
|
1460
1460
|
if (i !== null) {
|
|
1461
1461
|
e.fillText(String.fromCodePoint(i), n, r);
|
|
1462
1462
|
return;
|
|
1463
1463
|
}
|
|
1464
|
-
if (
|
|
1464
|
+
if (_e(s)) {
|
|
1465
1465
|
e.fillText(t, n, r);
|
|
1466
1466
|
return;
|
|
1467
1467
|
}
|
|
1468
1468
|
e.save(), e.translate(n, r + a / 2), e.rotate(Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
let l = c === "Tu" ?
|
|
1471
|
+
let l = c === "Tu" ? ve(s) : null;
|
|
1472
1472
|
e.fillText(l === null ? t : String.fromCodePoint(l), n, r);
|
|
1473
1473
|
}
|
|
1474
1474
|
//#endregion
|
|
@@ -1540,8 +1540,8 @@ function Rn(e, t, n, r, i, a, o) {
|
|
|
1540
1540
|
if (!(i <= 0 || a <= 0)) {
|
|
1541
1541
|
if (o) {
|
|
1542
1542
|
let a = e.createLinearGradient(n, r, n + i, r);
|
|
1543
|
-
a.addColorStop(0,
|
|
1544
|
-
} else e.fillStyle =
|
|
1543
|
+
a.addColorStop(0, Y(t, .85)), a.addColorStop(1, Y(t, .15)), e.fillStyle = a;
|
|
1544
|
+
} else e.fillStyle = Y(t);
|
|
1545
1545
|
e.fillRect(n, r, i, a);
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
@@ -1739,7 +1739,7 @@ function Hn(e, t, n, r) {
|
|
|
1739
1739
|
if (!d) return Bn.set(s, null), null;
|
|
1740
1740
|
let f = d.getContext("2d");
|
|
1741
1741
|
if (!f) return Bn.set(s, null), null;
|
|
1742
|
-
f.fillStyle =
|
|
1742
|
+
f.fillStyle = Y(r), f.fillRect(0, 0, u, u), f.fillStyle = Y(n);
|
|
1743
1743
|
for (let e = 0; e < u; e++) {
|
|
1744
1744
|
let t = l[e];
|
|
1745
1745
|
for (let n = 0; n < u; n++) t & 1 << u - 1 - n && f.fillRect(n, e, 1, 1);
|
|
@@ -1756,12 +1756,12 @@ function Un(e, t, n, r, i, a) {
|
|
|
1756
1756
|
let o = t.patternType;
|
|
1757
1757
|
if (!o || o === "none") return !1;
|
|
1758
1758
|
let s = t.fgColor ?? "000000", c = t.bgColor ?? "FFFFFF";
|
|
1759
|
-
if (o === "solid") return e.fillStyle =
|
|
1759
|
+
if (o === "solid") return e.fillStyle = Y(s), e.fillRect(n, r, i, a), !0;
|
|
1760
1760
|
let l = Hn(e, o, s, c);
|
|
1761
1761
|
if (l) e.fillStyle = l;
|
|
1762
1762
|
else {
|
|
1763
1763
|
let t = zn(o);
|
|
1764
|
-
e.fillStyle = t >= 1 ?
|
|
1764
|
+
e.fillStyle = t >= 1 ? Y(s) : qn(s, c, t);
|
|
1765
1765
|
}
|
|
1766
1766
|
return e.fillRect(n, r, i, a), !0;
|
|
1767
1767
|
}
|
|
@@ -1776,7 +1776,7 @@ function Wn(e, t, n, r, i, a) {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
for (let e of t.stops) {
|
|
1778
1778
|
let t = Math.min(1, Math.max(0, e.position));
|
|
1779
|
-
o.addColorStop(t,
|
|
1779
|
+
o.addColorStop(t, Y(e.color));
|
|
1780
1780
|
}
|
|
1781
1781
|
return o;
|
|
1782
1782
|
}
|
|
@@ -1791,7 +1791,7 @@ function qn(e, t, n) {
|
|
|
1791
1791
|
}
|
|
1792
1792
|
function Jn(e, t, n = 1, r) {
|
|
1793
1793
|
let i = Math.round(e * x * n * t);
|
|
1794
|
-
return r ? Math.max(i, Math.round(
|
|
1794
|
+
return r ? Math.max(i, Math.round(K(r, e * x * t))) : i;
|
|
1795
1795
|
}
|
|
1796
1796
|
function Yn(e, t = 1) {
|
|
1797
1797
|
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * x * t))}px ${Dn(e.name)}`;
|
|
@@ -1809,7 +1809,7 @@ function Xn(e, t, n, r, i, a, o, s, c, l) {
|
|
|
1809
1809
|
e.restore();
|
|
1810
1810
|
return;
|
|
1811
1811
|
}
|
|
1812
|
-
let m =
|
|
1812
|
+
let m = Le(t, r, o, f, (t) => Zn(e, t, i));
|
|
1813
1813
|
for (let t of m) {
|
|
1814
1814
|
let n = e.measureText(t.text).width, r = [...t.text];
|
|
1815
1815
|
if (t.spread === "distribute" && r.length > 1 && n < t.width) {
|
|
@@ -1935,7 +1935,7 @@ function ar(e, t, n) {
|
|
|
1935
1935
|
if (n === " " || T(r)) break;
|
|
1936
1936
|
e += r > 65535 ? 2 : 1;
|
|
1937
1937
|
}
|
|
1938
|
-
let n = t.slice(a, e), r =
|
|
1938
|
+
let n = t.slice(a, e), r = A(n) ? b(n) : null;
|
|
1939
1939
|
if (r && r.length > 0) {
|
|
1940
1940
|
let e = 0;
|
|
1941
1941
|
for (let t of r) i.push(n.slice(e, t)), e = t;
|
|
@@ -1989,7 +1989,7 @@ function or(e, t, n, r, i) {
|
|
|
1989
1989
|
let a = e.measureText(t).width;
|
|
1990
1990
|
if (c.length > 0 && l + a > i) {
|
|
1991
1991
|
let i = c.flatMap((e) => [...e.text]), a = nr(i, [...t]);
|
|
1992
|
-
a > 0 ? a = rr(i, a) : !
|
|
1992
|
+
a > 0 ? a = rr(i, a) : !A(t) && !A(c[c.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = ir(i, [...t]));
|
|
1993
1993
|
let o = c[c.length - 1], s = [...o.text];
|
|
1994
1994
|
a > s.length && (a = s.length);
|
|
1995
1995
|
let f = null;
|
|
@@ -2021,7 +2021,7 @@ function or(e, t, n, r, i) {
|
|
|
2021
2021
|
return;
|
|
2022
2022
|
}
|
|
2023
2023
|
e.font = Yn(cr(n), r);
|
|
2024
|
-
let c = (t) => e.measureText(t).width, u =
|
|
2024
|
+
let c = (t) => e.measureText(t).width, u = ne(t), d = t.length, f = 0;
|
|
2025
2025
|
for (; f < d;) {
|
|
2026
2026
|
let e = i - l, r = s(t, o, f, e, c, u);
|
|
2027
2027
|
if (r <= f) {
|
|
@@ -2055,7 +2055,7 @@ function or(e, t, n, r, i) {
|
|
|
2055
2055
|
r.push(e.text.slice(i, t)), i = t;
|
|
2056
2056
|
}
|
|
2057
2057
|
}
|
|
2058
|
-
for (let e of r) e === "\n" ? (g(), m++) :
|
|
2058
|
+
for (let e of r) e === "\n" ? (g(), m++) : A(e) ? v(e, t) : _(e, t);
|
|
2059
2059
|
}
|
|
2060
2060
|
return (c.length > 0 || o.length > 0) && g(), o;
|
|
2061
2061
|
}
|
|
@@ -2088,19 +2088,19 @@ function lr(e, t, n, r, i, a, o, s) {
|
|
|
2088
2088
|
let p = t[f], m = cr(p.font);
|
|
2089
2089
|
e.font = Yn(m, a);
|
|
2090
2090
|
let h = s.fontColor ?? p.font.color;
|
|
2091
|
-
e.fillStyle = h ?
|
|
2091
|
+
e.fillStyle = h ? Y(h) : "#000000";
|
|
2092
2092
|
let g = Jn(p.font.size, a), _ = 0;
|
|
2093
2093
|
p.font.vertAlign === "superscript" ? _ = -Math.round(g * .35) : p.font.vertAlign === "subscript" && (_ = Math.round(g * .1)), e.fillText(p.text, u, r + _);
|
|
2094
2094
|
let v = Jn(m.size, a);
|
|
2095
2095
|
if (p.font.underline || p.font.strike) {
|
|
2096
2096
|
let t = sr(i, r, v);
|
|
2097
2097
|
if (p.font.underline) {
|
|
2098
|
-
let n = h ?
|
|
2098
|
+
let n = h ? Y(h) : "#000000", r = p.font.underlineStyle === "double" || p.font.underlineStyle === "doubleAccounting";
|
|
2099
2099
|
Qn(e, u, u + p.width, t.underline + _, n, r, o);
|
|
2100
2100
|
}
|
|
2101
2101
|
if (p.font.strike) {
|
|
2102
2102
|
let n = t.strike + _, r = n + d(n, .5, o);
|
|
2103
|
-
e.save(), e.strokeStyle = h ?
|
|
2103
|
+
e.save(), e.strokeStyle = h ? Y(h) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(u, r), e.lineTo(u + p.width, r), e.stroke(), e.restore();
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
u += p.width;
|
|
@@ -2313,10 +2313,10 @@ function Tr(e, t, n, r, a, o, s, c, l, u, f, p, m, h) {
|
|
|
2313
2313
|
if (m <= 0 || h <= 0) return;
|
|
2314
2314
|
let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = a.length, w = o.length, T = (e, n) => t.rtl ? An(e, n, t.canvasW) : e, E = [], D = -s;
|
|
2315
2315
|
for (let e = 0; e < C; e++) E.push(D), D += a[e];
|
|
2316
|
-
let O = [],
|
|
2317
|
-
for (let e = 0; e < w; e++) O.push(
|
|
2316
|
+
let O = [], k = -c;
|
|
2317
|
+
for (let e = 0; e < w; e++) O.push(k), k += o[e];
|
|
2318
2318
|
e.save(), e.beginPath(), e.rect(T(f, m), p, m, h), e.clip();
|
|
2319
|
-
let
|
|
2319
|
+
let A = [], j = [], M = [];
|
|
2320
2320
|
for (let i of t.worksheet.mergeCells ?? []) {
|
|
2321
2321
|
let a = i.top, o = i.left;
|
|
2322
2322
|
if (a >= n && a < n + w && o >= r && o < r + C || i.bottom < n || i.top >= n + w || i.right < r || i.left >= r + C) continue;
|
|
@@ -2338,77 +2338,77 @@ function Tr(e, t, n, r, a, o, s, c, l, u, f, p, m, h) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
let m = d.totalW, h = d.totalH;
|
|
2340
2340
|
f = T(f, m);
|
|
2341
|
-
let _ = `${a}:${o}`, v = t.cellMap.get(_), { font: y, fill: D, border:
|
|
2342
|
-
if (Un(e,
|
|
2343
|
-
let t = Math.max(0, (m - 4) *
|
|
2344
|
-
Rn(e,
|
|
2345
|
-
}
|
|
2346
|
-
let
|
|
2347
|
-
if (
|
|
2348
|
-
let
|
|
2349
|
-
if (!
|
|
2350
|
-
let
|
|
2341
|
+
let _ = `${a}:${o}`, v = t.cellMap.get(_), { font: y, fill: D, border: k, xf: A } = er(g, v?.styleIndex ?? 0), M = fn(v, a, o, b, g.dxfs ?? []);
|
|
2342
|
+
if (Un(e, M.fill ?? D, f, p, m, h), M.dataBar && M.dataBar.ratio > 0) {
|
|
2343
|
+
let t = Math.max(0, (m - 4) * M.dataBar.ratio);
|
|
2344
|
+
Rn(e, M.dataBar.color, f + 2, p + 2, t, h - 4, M.dataBar.gradient);
|
|
2345
|
+
}
|
|
2346
|
+
let ee = Kr(Gr(k, a, o, d.right, d.bottom, t.cellMap, g), M.border);
|
|
2347
|
+
if (j.push(() => qr(e, ee, f, p, m, h, S)), !v) continue;
|
|
2348
|
+
let N = xt(v, g, M.numFmt, t.worksheet.date1904), P = N.text;
|
|
2349
|
+
if (!P || P === "0" && t.worksheet.showZeros === !1) continue;
|
|
2350
|
+
let F = y.bold || !!M.fontBold, I = y.italic || !!M.fontItalic, L = y.underline || !!M.fontUnderline, R = y.strike || !!M.fontStrike, z = F !== y.bold || I !== y.italic || L !== y.underline || R !== y.strike ? {
|
|
2351
2351
|
...y,
|
|
2352
|
-
bold:
|
|
2353
|
-
italic:
|
|
2354
|
-
underline:
|
|
2355
|
-
strike:
|
|
2352
|
+
bold: F,
|
|
2353
|
+
italic: I,
|
|
2354
|
+
underline: L,
|
|
2355
|
+
strike: R
|
|
2356
2356
|
} : y;
|
|
2357
|
-
e.font = Yn(
|
|
2358
|
-
let
|
|
2359
|
-
e.fillStyle =
|
|
2360
|
-
let
|
|
2357
|
+
e.font = Yn(z, x);
|
|
2358
|
+
let B = t.hyperlinkMap.get(_) ? "#0563C1" : M.fontColor ?? N.color ?? y.color;
|
|
2359
|
+
e.fillStyle = B ? Y(B) : "#000000";
|
|
2360
|
+
let V = v.value.type === "number", H = A.alignH ?? (V ? "right" : "left"), U = A.alignV ?? "bottom", W = A.indent ? Math.round(A.indent * 3 * t.mdw) : 0, te = 3 + (H === "left" || !A.alignH ? W : 0);
|
|
2361
2361
|
e.save(), e.beginPath(), e.rect(f, p, m, h), e.clip();
|
|
2362
|
-
let
|
|
2363
|
-
|
|
2364
|
-
let
|
|
2365
|
-
if (
|
|
2366
|
-
alignH:
|
|
2367
|
-
alignV:
|
|
2362
|
+
let G;
|
|
2363
|
+
H === "right" ? (G = f + m - 3, e.textAlign = "right") : H === "center" ? (G = f + m / 2, e.textAlign = "center") : (G = f + te, e.textAlign = "left");
|
|
2364
|
+
let ne = v.value.type === "text" ? v.value.runs : void 0, re = ne && ne.length > 0;
|
|
2365
|
+
if (A.wrapText && re) mr(e, ne, z, {
|
|
2366
|
+
alignH: H,
|
|
2367
|
+
alignV: U,
|
|
2368
2368
|
cx: f,
|
|
2369
2369
|
cy: p,
|
|
2370
2370
|
cellW: m,
|
|
2371
2371
|
cellH: h,
|
|
2372
|
-
leftPad:
|
|
2372
|
+
leftPad: te,
|
|
2373
2373
|
paddingX: 3,
|
|
2374
2374
|
paddingY: 2
|
|
2375
2375
|
}, x, S, {
|
|
2376
|
-
fontColor:
|
|
2377
|
-
readingOrder:
|
|
2376
|
+
fontColor: M.fontColor,
|
|
2377
|
+
readingOrder: A.readingOrder
|
|
2378
2378
|
});
|
|
2379
|
-
else if (
|
|
2380
|
-
let t = tr(e,
|
|
2381
|
-
i =
|
|
2382
|
-
for (let r = 0; r < t.length; r++) e.fillText(t[r],
|
|
2383
|
-
} else if (
|
|
2384
|
-
alignH:
|
|
2385
|
-
alignV:
|
|
2379
|
+
else if (A.wrapText) {
|
|
2380
|
+
let t = tr(e, P, m - te - 3), n = Jn(y.size, x, 1.2, y.name ?? void 0), r = t.length * n, i;
|
|
2381
|
+
i = U === "top" ? p + 2 : U === "center" ? p + (h - r) / 2 : p + h - r - 2, e.textBaseline = "top";
|
|
2382
|
+
for (let r = 0; r < t.length; r++) e.fillText(t[r], G, i + r * n);
|
|
2383
|
+
} else if (re) pr(e, ne, z, {
|
|
2384
|
+
alignH: H,
|
|
2385
|
+
alignV: U,
|
|
2386
2386
|
cx: f,
|
|
2387
2387
|
cy: p,
|
|
2388
2388
|
cellW: m,
|
|
2389
2389
|
cellH: h,
|
|
2390
|
-
leftPad:
|
|
2390
|
+
leftPad: te,
|
|
2391
2391
|
paddingX: 3,
|
|
2392
2392
|
paddingY: 2
|
|
2393
2393
|
}, x, S, {
|
|
2394
|
-
fontColor:
|
|
2395
|
-
readingOrder:
|
|
2394
|
+
fontColor: M.fontColor,
|
|
2395
|
+
readingOrder: A.readingOrder
|
|
2396
2396
|
});
|
|
2397
2397
|
else {
|
|
2398
2398
|
let t;
|
|
2399
|
-
|
|
2399
|
+
U === "top" ? (e.textBaseline = "top", t = p + 2) : U === "center" ? (e.textBaseline = "middle", t = p + h / 2) : (e.textBaseline = "bottom", t = p + h - 2), e.fillText(P, G, t);
|
|
2400
2400
|
}
|
|
2401
2401
|
e.restore();
|
|
2402
2402
|
}
|
|
2403
2403
|
for (let s = 0; s < w; s++) {
|
|
2404
2404
|
let c = n + s, w = u + O[s], D = o[s];
|
|
2405
2405
|
if (w + D <= p || w >= p + h) continue;
|
|
2406
|
-
let
|
|
2407
|
-
if (
|
|
2408
|
-
for (let t =
|
|
2409
|
-
for (let t =
|
|
2406
|
+
let k = /* @__PURE__ */ new Set(), ee = /* @__PURE__ */ new Set(), N = -1, P = (e) => {
|
|
2407
|
+
if (N >= 0 && e - N >= 2) {
|
|
2408
|
+
for (let t = N; t < e - 1; t++) k.add(t);
|
|
2409
|
+
for (let t = N + 1; t < e; t++) ee.add(t);
|
|
2410
2410
|
}
|
|
2411
|
-
|
|
2411
|
+
N = -1;
|
|
2412
2412
|
};
|
|
2413
2413
|
for (let e = 0; e <= C; e++) {
|
|
2414
2414
|
let t = !1, n = !1;
|
|
@@ -2419,114 +2419,114 @@ function Tr(e, t, n, r, a, o, s, c, l, u, f, p, m, h) {
|
|
|
2419
2419
|
t = er(g, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
|
|
2420
2420
|
}
|
|
2421
2421
|
}
|
|
2422
|
-
t ? n &&
|
|
2422
|
+
t ? n && N >= 0 && e > N ? (P(e), N = e) : N < 0 && (N = e) : P(e);
|
|
2423
2423
|
}
|
|
2424
2424
|
for (let n = 0; n < C; n++) {
|
|
2425
2425
|
let o = r + n, u = l + E[n], p = a[n];
|
|
2426
2426
|
if (u + p <= f || u >= f + m) continue;
|
|
2427
2427
|
let h = `${c}:${o}`;
|
|
2428
2428
|
if (y.has(h)) continue;
|
|
2429
|
-
let O = v.get(h),
|
|
2430
|
-
if (Un(e,
|
|
2431
|
-
let t = Math.max(0, (
|
|
2432
|
-
Rn(e,
|
|
2429
|
+
let O = v.get(h), N = O ? O.totalW : p, P = O ? O.totalH : D, F = T(u, N), I = _.get(h), { font: R, fill: z, border: B, xf: V } = er(g, I?.styleIndex ?? 0), H = fn(I, c, o, b, g.dxfs ?? []), U = H.fill ?? z, W = t.tableStyleMap.get(h), te = g.dxfs ?? [], G = (e) => e == null ? void 0 : te[e], ne = G(W?.wholeTableDxf), re = G(W?.headerRowDxf), ie = G(W?.totalRowDxf), ae = G(W?.firstColumnDxf), oe = G(W?.lastColumnDxf), se = G(W?.stripeDxf), ce = W?.isHeader && re?.fill?.fgColor ? re : W?.isTotals && ie?.fill?.fgColor ? ie : W?.isLastCol && oe?.fill?.fgColor ? oe : W?.isFirstCol && ae?.fill?.fgColor ? ae : se?.fill?.fgColor ? se : !W?.isHeader && !W?.isTotals && ne?.fill?.fgColor ? ne : void 0;
|
|
2430
|
+
if (Un(e, U, F, w, N, P) || (W && ce?.fill?.fgColor ? (e.fillStyle = Y(ce.fill.fgColor), e.fillRect(F, w, N, P)) : W && !W.isCustom && W.isBanded && (e.fillStyle = wr(W.accent), e.fillRect(F, w, N, P))), t.commentCells.has(h) && Kn(e, F, w, N, P), H.dataBar && H.dataBar.ratio > 0) {
|
|
2431
|
+
let t = Math.max(0, (N - 4) * H.dataBar.ratio);
|
|
2432
|
+
Rn(e, H.dataBar.color, F + 2, w + 2, t, P - 4, H.dataBar.gradient);
|
|
2433
2433
|
}
|
|
2434
|
-
let
|
|
2435
|
-
if (
|
|
2436
|
-
x:
|
|
2434
|
+
let le = t.sparklineMap.get(h);
|
|
2435
|
+
if (le && Ee(e, {
|
|
2436
|
+
x: F,
|
|
2437
2437
|
y: w,
|
|
2438
|
-
w:
|
|
2439
|
-
h:
|
|
2440
|
-
},
|
|
2441
|
-
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !
|
|
2442
|
-
let t =
|
|
2443
|
-
e.moveTo(t, w), e.lineTo(t, w +
|
|
2438
|
+
w: N,
|
|
2439
|
+
h: P
|
|
2440
|
+
}, le), t.worksheet.showGridlines !== !1) {
|
|
2441
|
+
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !k.has(n)) {
|
|
2442
|
+
let t = F + N + d(F + N, .5, S);
|
|
2443
|
+
e.moveTo(t, w), e.lineTo(t, w + P);
|
|
2444
2444
|
}
|
|
2445
|
-
let t = w +
|
|
2446
|
-
if (e.moveTo(
|
|
2445
|
+
let t = w + P + d(w + P, .5, S);
|
|
2446
|
+
if (e.moveTo(F, t), e.lineTo(F + N, t), s === 0) {
|
|
2447
2447
|
let t = w + d(w, .5, S);
|
|
2448
|
-
e.moveTo(
|
|
2448
|
+
e.moveTo(F, t), e.lineTo(F + N, t);
|
|
2449
2449
|
}
|
|
2450
2450
|
if (n === 0) {
|
|
2451
|
-
let t =
|
|
2452
|
-
e.moveTo(t, w), e.lineTo(t, w +
|
|
2451
|
+
let t = F + d(F, .5, S);
|
|
2452
|
+
e.moveTo(t, w), e.lineTo(t, w + P);
|
|
2453
2453
|
}
|
|
2454
2454
|
e.stroke();
|
|
2455
2455
|
}
|
|
2456
|
-
let
|
|
2457
|
-
(
|
|
2458
|
-
...
|
|
2459
|
-
left:
|
|
2460
|
-
right:
|
|
2456
|
+
let K = Kr(O ? Gr(B, c, o, O.right, O.bottom, _, g) : B, H.border);
|
|
2457
|
+
(k.has(n) || ee.has(n)) && (K = {
|
|
2458
|
+
...K,
|
|
2459
|
+
left: ee.has(n) ? null : K.left,
|
|
2460
|
+
right: k.has(n) ? null : K.right
|
|
2461
2461
|
});
|
|
2462
|
-
let
|
|
2463
|
-
if (
|
|
2464
|
-
...
|
|
2465
|
-
top: Zr(
|
|
2466
|
-
}), !
|
|
2462
|
+
let ue = _.get(`${c - 1}:${o}`), de = ue ? er(g, ue.styleIndex ?? 0).border.bottom : null;
|
|
2463
|
+
if (de?.style && (s === 0 || K.top?.style) && (K = {
|
|
2464
|
+
...K,
|
|
2465
|
+
top: Zr(K.top, de)
|
|
2466
|
+
}), !ee.has(n)) {
|
|
2467
2467
|
let e = _.get(`${c}:${o - 1}`), t = e ? er(g, e.styleIndex ?? 0).border.right : null;
|
|
2468
|
-
t?.style && (n === 0 ||
|
|
2469
|
-
...
|
|
2470
|
-
left: Zr(
|
|
2468
|
+
t?.style && (n === 0 || K.left?.style) && (K = {
|
|
2469
|
+
...K,
|
|
2470
|
+
left: Zr(K.left, t)
|
|
2471
2471
|
});
|
|
2472
2472
|
}
|
|
2473
|
-
let
|
|
2474
|
-
if (
|
|
2475
|
-
if (
|
|
2476
|
-
else if (
|
|
2473
|
+
let q = W ? Sr(W, ne, re, o) : null, fe = t.autoFilterCells.has(h), pe = () => {
|
|
2474
|
+
if (q) {
|
|
2475
|
+
if (q.kind === "dxf") qr(e, q.border, F, w, N, P, S);
|
|
2476
|
+
else if (q.kind === "accent") {
|
|
2477
2477
|
let t = .5 / S;
|
|
2478
|
-
if (e.strokeStyle =
|
|
2479
|
-
let t = w + d(w,
|
|
2480
|
-
e.moveTo(
|
|
2478
|
+
if (e.strokeStyle = q.color, e.lineWidth = q.lineWidth, e.beginPath(), e.moveTo(F, w + P - t), e.lineTo(F + N, w + P - t), q.topEdge) {
|
|
2479
|
+
let t = w + d(w, q.lineWidth, S);
|
|
2480
|
+
e.moveTo(F, t), e.lineTo(F + N, t);
|
|
2481
2481
|
}
|
|
2482
2482
|
e.stroke();
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
|
|
2485
|
+
fe && br(e, F, w, p, P);
|
|
2486
2486
|
};
|
|
2487
2487
|
if (O) {
|
|
2488
|
-
let t =
|
|
2489
|
-
|
|
2488
|
+
let t = K;
|
|
2489
|
+
j.push(() => qr(e, t, F, w, N, P, S)), pe();
|
|
2490
2490
|
} else {
|
|
2491
|
-
let t =
|
|
2492
|
-
|
|
2493
|
-
qr(e, t,
|
|
2491
|
+
let t = K;
|
|
2492
|
+
M.push(() => {
|
|
2493
|
+
qr(e, t, F, w, N, P, S), pe();
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
|
-
if (!
|
|
2497
|
-
let
|
|
2498
|
-
!
|
|
2499
|
-
let s =
|
|
2500
|
-
...
|
|
2496
|
+
if (!I) continue;
|
|
2497
|
+
let me = xt(I, g, H.numFmt, t.worksheet.date1904), J = me.text;
|
|
2498
|
+
!J || J === "0" && t.worksheet.showZeros === !1 || A.push(() => {
|
|
2499
|
+
let s = W?.isHeader ? re : W?.isTotals ? ie : W?.isLastCol && oe ? oe : W?.isFirstCol && ae ? ae : se || (W ? ne : void 0), l = W ? W.isCustom ? !!s?.font?.bold : W.isHeader || W.isTotals : !1, u = R.bold || !!H.fontBold || l, f = R.italic || !!H.fontItalic, p = R.underline || !!H.fontUnderline, m = R.strike || !!H.fontStrike, b = u !== R.bold || f !== R.italic || p !== R.underline || m !== R.strike ? {
|
|
2500
|
+
...R,
|
|
2501
2501
|
bold: u,
|
|
2502
2502
|
italic: f,
|
|
2503
2503
|
underline: p,
|
|
2504
2504
|
strike: m
|
|
2505
|
-
} :
|
|
2505
|
+
} : R;
|
|
2506
2506
|
e.font = Yn(b, x);
|
|
2507
|
-
let T = t.hyperlinkMap.get(h), E = s?.font?.color ?? null, D = T ? "#0563C1" :
|
|
2508
|
-
e.fillStyle = D ?
|
|
2509
|
-
let
|
|
2510
|
-
if (
|
|
2507
|
+
let T = t.hyperlinkMap.get(h), E = s?.font?.color ?? null, D = T ? "#0563C1" : H.fontColor ?? me.color ?? E ?? R.color;
|
|
2508
|
+
e.fillStyle = D ? Y(D) : "#000000";
|
|
2509
|
+
let k = I.value.type === "number", A = V.alignH ?? (k ? "right" : "left"), j = V.alignV ?? "bottom", M = V.indent ? Math.round(V.indent * 3 * t.mdw) : 0, ee = H.iconSet ? Math.max(8, Math.round(Math.min(N, P) * .55)) : 0, z = ee > 0 ? ee + 4 : 0, B = 3 + (A === "left" || !V.alignH ? M : 0) + z, U = N, te = F, G = n;
|
|
2510
|
+
if (A === "centerContinuous" && !O) for (let e = n + 1; e < C; e++) {
|
|
2511
2511
|
let t = `${c}:${r + e}`;
|
|
2512
2512
|
if (y.has(t) || v.has(t)) break;
|
|
2513
2513
|
let n = _.get(t);
|
|
2514
2514
|
if (n && n.value.type !== "empty" || er(g, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
2515
|
-
|
|
2515
|
+
U += a[e], G = e;
|
|
2516
2516
|
}
|
|
2517
|
-
let
|
|
2518
|
-
if (!O && !
|
|
2519
|
-
let t = e.measureText(
|
|
2517
|
+
let ce = A === "centerContinuous" ? te : F, le = A === "centerContinuous" ? U : N, K = J.includes("\n");
|
|
2518
|
+
if (!O && !V.wrapText && !V.textRotation && !k && !K) {
|
|
2519
|
+
let t = e.measureText(J).width, i = A === "centerContinuous", o = i ? t + 6 : t + B + 3, s = i ? U : N;
|
|
2520
2520
|
if (o > s) {
|
|
2521
2521
|
let e = o - s, t = 0, l = 0;
|
|
2522
|
-
if (
|
|
2523
|
-
let e = t, o = i ?
|
|
2522
|
+
if (A === "right" ? l = e : A === "center" || i ? (l = e / 2, t = e / 2) : t = e, t > 0) {
|
|
2523
|
+
let e = t, o = i ? G + 1 : n + 1;
|
|
2524
2524
|
for (let t = o; t < C && e > 0; t++) {
|
|
2525
2525
|
let n = `${c}:${r + t}`;
|
|
2526
2526
|
if (y.has(n) || v.has(n)) break;
|
|
2527
2527
|
let i = _.get(n);
|
|
2528
2528
|
if (i && i.value.type !== "empty") break;
|
|
2529
|
-
|
|
2529
|
+
le += a[t], e -= a[t];
|
|
2530
2530
|
}
|
|
2531
2531
|
}
|
|
2532
2532
|
if (l > 0) {
|
|
@@ -2536,143 +2536,143 @@ function Tr(e, t, n, r, a, o, s, c, l, u, f, p, m, h) {
|
|
|
2536
2536
|
if (y.has(n) || v.has(n)) break;
|
|
2537
2537
|
let i = _.get(n);
|
|
2538
2538
|
if (i && i.value.type !== "empty") break;
|
|
2539
|
-
|
|
2539
|
+
ce -= a[t], le += a[t], e -= a[t];
|
|
2540
2540
|
}
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
let
|
|
2545
|
-
if (
|
|
2546
|
-
let t = Math.max(1,
|
|
2544
|
+
let ue = J, de = 0;
|
|
2545
|
+
if (A === "fill" && !k && J.length > 0) {
|
|
2546
|
+
let t = Math.max(1, N - 6), n = e.measureText(J).width;
|
|
2547
2547
|
if (n > 0 && n < t) {
|
|
2548
2548
|
let e = Math.max(1, Math.floor(t / n));
|
|
2549
|
-
|
|
2549
|
+
ue = J.repeat(e);
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
|
-
if (
|
|
2553
|
-
let t = Math.max(1,
|
|
2554
|
-
n < t && (
|
|
2552
|
+
if (A === "distributed" || A === "justify" && !V.wrapText && !K) {
|
|
2553
|
+
let t = Math.max(1, N - 6), n = e.measureText(ue).width, r = Math.max(1, [...ue].length - 1);
|
|
2554
|
+
n < t && (de = Math.max(0, (t - n) / r));
|
|
2555
2555
|
}
|
|
2556
|
-
let
|
|
2557
|
-
|
|
2558
|
-
let
|
|
2559
|
-
if (
|
|
2560
|
-
let t = Jn(
|
|
2556
|
+
let q, fe;
|
|
2557
|
+
A === "right" ? (q = F + N - 3, fe = "right") : A === "center" ? (q = F + N / 2, fe = "center") : A === "centerContinuous" ? (q = te + U / 2, fe = "center") : A === "distributed" || A === "justify" && !V.wrapText && !K ? (q = F + 3, fe = "left") : (q = F + B, fe = "left");
|
|
2558
|
+
let pe = V.textRotation ?? 0, he = pe === 255, ge = pe > 0 && pe !== 255;
|
|
2559
|
+
if (H.iconSet && ee > 0 && (e.save(), e.beginPath(), e.rect(F, w, N, P), e.clip(), yr(e, H.iconSet.name, H.iconSet.index, F + 2, w + (P - ee) / 2, ee), e.restore()), e.save(), e.beginPath(), e.rect(ce, w, le, P), e.clip(), he) {
|
|
2560
|
+
let t = Jn(R.size, x, 1.1), n = [...J].length * t, r = j === "top" ? w + 2 : j === "center" ? w + (P - n) / 2 : w + P - n - 2;
|
|
2561
2561
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2562
|
-
for (let n of
|
|
2563
|
-
let a = n.codePointAt(0) ?? 0, o = i(a) &&
|
|
2564
|
-
yn(e, n,
|
|
2562
|
+
for (let n of J) {
|
|
2563
|
+
let a = n.codePointAt(0) ?? 0, o = i(a) && L(e, a);
|
|
2564
|
+
yn(e, n, F + N / 2, r, t, o), r += t;
|
|
2565
2565
|
}
|
|
2566
2566
|
e.restore();
|
|
2567
2567
|
return;
|
|
2568
2568
|
}
|
|
2569
|
-
if (
|
|
2570
|
-
let t =
|
|
2571
|
-
e.translate(
|
|
2569
|
+
if (ge) {
|
|
2570
|
+
let t = pe <= 90 ? -(pe * Math.PI / 180) : (pe - 90) * Math.PI / 180;
|
|
2571
|
+
e.translate(F + N / 2, w + P / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(J, 0, 0), e.restore();
|
|
2572
2572
|
return;
|
|
2573
2573
|
}
|
|
2574
|
-
if (
|
|
2575
|
-
let t = e.measureText(
|
|
2574
|
+
if (V.shrinkToFit) {
|
|
2575
|
+
let t = e.measureText(J).width, n = N - B - 3;
|
|
2576
2576
|
if (t > n && t > 0) {
|
|
2577
|
-
let r = n / t, i =
|
|
2577
|
+
let r = n / t, i = A === "right" ? F + N - 3 : A === "center" ? F + N / 2 : F + B;
|
|
2578
2578
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
2581
|
-
if (e.textAlign =
|
|
2582
|
-
e.letterSpacing = `${
|
|
2581
|
+
if (e.textAlign = fe, de > 0) try {
|
|
2582
|
+
e.letterSpacing = `${de}px`;
|
|
2583
2583
|
} catch {}
|
|
2584
2584
|
try {
|
|
2585
|
-
e.direction = pn(
|
|
2585
|
+
e.direction = pn(V.readingOrder, J) ? "rtl" : "ltr";
|
|
2586
2586
|
} catch {}
|
|
2587
|
-
let
|
|
2588
|
-
if (
|
|
2589
|
-
alignH:
|
|
2590
|
-
alignV:
|
|
2591
|
-
cx:
|
|
2587
|
+
let _e = I.value.type === "text" ? I.value.runs : void 0, ve = _e && _e.length > 0;
|
|
2588
|
+
if (V.wrapText && ve) mr(e, _e, b, {
|
|
2589
|
+
alignH: A,
|
|
2590
|
+
alignV: j,
|
|
2591
|
+
cx: F,
|
|
2592
2592
|
cy: w,
|
|
2593
|
-
cellW:
|
|
2594
|
-
cellH:
|
|
2595
|
-
leftPad:
|
|
2593
|
+
cellW: N,
|
|
2594
|
+
cellH: P,
|
|
2595
|
+
leftPad: B,
|
|
2596
2596
|
paddingX: 3,
|
|
2597
2597
|
paddingY: 2
|
|
2598
2598
|
}, x, S, {
|
|
2599
|
-
fontColor:
|
|
2600
|
-
readingOrder:
|
|
2599
|
+
fontColor: H.fontColor,
|
|
2600
|
+
readingOrder: V.readingOrder
|
|
2601
2601
|
});
|
|
2602
|
-
else if (
|
|
2603
|
-
let t = tr(e,
|
|
2604
|
-
|
|
2605
|
-
for (let r = 0; r < t.length; r++) e.fillText(t[r],
|
|
2606
|
-
} else if (
|
|
2607
|
-
alignH:
|
|
2608
|
-
alignV:
|
|
2609
|
-
cx:
|
|
2602
|
+
else if (V.wrapText) {
|
|
2603
|
+
let t = tr(e, J, N - B - 3), n = Jn(R.size, x, 1.2, R.name ?? void 0), r = t.length * n, i;
|
|
2604
|
+
j === "top" ? (i = w + 2, e.textBaseline = "top") : j === "center" ? (i = w + (P - r) / 2, e.textBaseline = "top") : (i = w + P - r - 2, e.textBaseline = "top");
|
|
2605
|
+
for (let r = 0; r < t.length; r++) e.fillText(t[r], q, i + r * n);
|
|
2606
|
+
} else if (ve) pr(e, _e, b, {
|
|
2607
|
+
alignH: A,
|
|
2608
|
+
alignV: j,
|
|
2609
|
+
cx: F,
|
|
2610
2610
|
cy: w,
|
|
2611
|
-
cellW:
|
|
2612
|
-
cellH:
|
|
2613
|
-
leftPad:
|
|
2611
|
+
cellW: N,
|
|
2612
|
+
cellH: P,
|
|
2613
|
+
leftPad: B,
|
|
2614
2614
|
paddingX: 3,
|
|
2615
2615
|
paddingY: 2
|
|
2616
2616
|
}, x, S, {
|
|
2617
|
-
fontColor:
|
|
2618
|
-
readingOrder:
|
|
2617
|
+
fontColor: H.fontColor,
|
|
2618
|
+
readingOrder: V.readingOrder
|
|
2619
2619
|
});
|
|
2620
2620
|
else {
|
|
2621
|
-
let t = b.vertAlign, n = Jn(
|
|
2621
|
+
let t = b.vertAlign, n = Jn(R.size, x), r = 0;
|
|
2622
2622
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
2623
2623
|
let i = t ? {
|
|
2624
2624
|
...b,
|
|
2625
2625
|
size: b.size * .65
|
|
2626
2626
|
} : b;
|
|
2627
2627
|
t && (e.font = Yn(i, x));
|
|
2628
|
-
let a = null, o = () => a ??= e.measureText(
|
|
2629
|
-
let e = Math.min(o().width,
|
|
2628
|
+
let a = null, o = () => a ??= e.measureText(J), s = () => {
|
|
2629
|
+
let e = Math.min(o().width, le - B - 3);
|
|
2630
2630
|
return {
|
|
2631
|
-
x:
|
|
2631
|
+
x: A === "right" ? F + N - 3 - e : A === "center" ? F + N / 2 - e / 2 : F + B,
|
|
2632
2632
|
width: e
|
|
2633
2633
|
};
|
|
2634
2634
|
}, c = Jn(i.size, x);
|
|
2635
2635
|
if (b.underline || T) {
|
|
2636
|
-
let { x: t, width: n } = s(), i = (
|
|
2636
|
+
let { x: t, width: n } = s(), i = (j === "top" ? w + 2 + c + 1 : j === "center" ? w + P / 2 + Math.round(c * .55) : w + P - 2 + 1) + r, a = T ? "#0563C1" : D ? Y(D) : "#000000", o = b.underlineStyle === "double" || b.underlineStyle === "doubleAccounting";
|
|
2637
2637
|
Qn(e, t, t + n, i, a, o, S);
|
|
2638
2638
|
}
|
|
2639
2639
|
if (b.strike) {
|
|
2640
|
-
let { x: t, width: n } = s(), i = (
|
|
2641
|
-
e.save(), e.strokeStyle = D ?
|
|
2640
|
+
let { x: t, width: n } = s(), i = (j === "top" ? w + 2 + Math.round(c * .5) : j === "center" ? w + P / 2 : w + P - 2 - Math.round(c * .35)) + r, a = i + d(i, .5, S);
|
|
2641
|
+
e.save(), e.strokeStyle = D ? Y(D) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
2642
2642
|
}
|
|
2643
|
-
if (
|
|
2644
|
-
let t =
|
|
2645
|
-
|
|
2646
|
-
for (let i = 0; i < t.length; i++) e.fillText(t[i],
|
|
2643
|
+
if (J.includes("\n")) {
|
|
2644
|
+
let t = J.split("\n"), n = Jn(R.size, x, 1.2, R.name ?? void 0), i = t.length * n, a;
|
|
2645
|
+
j === "top" ? (a = w + 2, e.textBaseline = "top") : j === "center" ? (a = w + (P - i) / 2, e.textBaseline = "top") : (a = w + P - i - 2, e.textBaseline = "top");
|
|
2646
|
+
for (let i = 0; i < t.length; i++) e.fillText(t[i], q, a + i * n + r);
|
|
2647
2647
|
} else {
|
|
2648
2648
|
let t;
|
|
2649
|
-
|
|
2649
|
+
j === "top" ? (e.textBaseline = "top", t = w + 2) : j === "center" ? (e.textBaseline = "middle", t = w + P / 2) : (e.textBaseline = "bottom", t = w + P - 2), e.fillText(ue, q, t + r);
|
|
2650
2650
|
}
|
|
2651
2651
|
}
|
|
2652
|
-
let
|
|
2653
|
-
if (
|
|
2654
|
-
let t = Yn(b, x), n = Zn(e,
|
|
2655
|
-
r =
|
|
2656
|
-
let i = D ?
|
|
2657
|
-
Xn(e,
|
|
2652
|
+
let ye = I.value.type === "text" ? I.value.phoneticRuns : void 0;
|
|
2653
|
+
if (I.showPhonetic && ye && ye.length > 0 && !J.includes("\n")) {
|
|
2654
|
+
let t = Yn(b, x), n = Zn(e, J, t), r;
|
|
2655
|
+
r = A === "right" ? F + N - 3 - n : A === "center" ? F + N / 2 - n / 2 : F + B;
|
|
2656
|
+
let i = D ? Y(D) : "#000000";
|
|
2657
|
+
Xn(e, ye, I.value.type === "text" ? I.value.phoneticPr : void 0, J, t, g, r, w, x, i);
|
|
2658
2658
|
}
|
|
2659
|
-
e.restore(),
|
|
2659
|
+
e.restore(), J && t.onTextRun && t.onTextRun({
|
|
2660
2660
|
sheetName: t.worksheet.name,
|
|
2661
2661
|
cellRef: vn(c, o),
|
|
2662
|
-
text:
|
|
2663
|
-
x:
|
|
2662
|
+
text: J,
|
|
2663
|
+
x: F,
|
|
2664
2664
|
y: w,
|
|
2665
|
-
width:
|
|
2666
|
-
height:
|
|
2665
|
+
width: N,
|
|
2666
|
+
height: P,
|
|
2667
2667
|
row: c,
|
|
2668
2668
|
col: o
|
|
2669
2669
|
});
|
|
2670
2670
|
});
|
|
2671
2671
|
}
|
|
2672
2672
|
}
|
|
2673
|
+
for (let e of M) e();
|
|
2673
2674
|
for (let e of j) e();
|
|
2674
2675
|
for (let e of A) e();
|
|
2675
|
-
for (let e of k) e();
|
|
2676
2676
|
e.restore();
|
|
2677
2677
|
}
|
|
2678
2678
|
var Er = /* @__PURE__ */ new WeakMap();
|
|
@@ -2718,26 +2718,26 @@ function Or(e, t, n, r, i = {}) {
|
|
|
2718
2718
|
for (let e = h; e < h + _; e++) E.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
|
|
2719
2719
|
let D = [];
|
|
2720
2720
|
for (let e = m; e < m + g; e++) D.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
|
|
2721
|
-
let { cellMap: O, cfContext:
|
|
2721
|
+
let { cellMap: O, cfContext: k, mergeSkipSet: A, autoFilterCells: j, hyperlinkMap: M, commentCells: ee, tableStyleMap: N, sparklineMap: P } = Dr(t), F = /* @__PURE__ */ new Map();
|
|
2722
2722
|
for (let e of t.mergeCells ?? []) {
|
|
2723
2723
|
let n = 0;
|
|
2724
2724
|
for (let r = e.left; r <= e.right; r++) n += u(Q(t.colWidths[r] ?? t.defaultColWidth, s));
|
|
2725
2725
|
let r = 0;
|
|
2726
2726
|
for (let n = e.top; n <= e.bottom; n++) r += u($(t.rowHeights[n] ?? t.defaultRowHeight));
|
|
2727
|
-
|
|
2727
|
+
F.set(`${e.top}:${e.left}`, {
|
|
2728
2728
|
totalW: n,
|
|
2729
2729
|
totalH: r,
|
|
2730
2730
|
right: e.right,
|
|
2731
2731
|
bottom: e.bottom
|
|
2732
2732
|
});
|
|
2733
2733
|
}
|
|
2734
|
-
let
|
|
2734
|
+
let I = {
|
|
2735
2735
|
worksheet: t,
|
|
2736
2736
|
styles: n,
|
|
2737
2737
|
cellMap: O,
|
|
2738
|
-
mergeAnchorMap:
|
|
2739
|
-
mergeSkipSet:
|
|
2740
|
-
cfContext:
|
|
2738
|
+
mergeAnchorMap: F,
|
|
2739
|
+
mergeSkipSet: A,
|
|
2740
|
+
cfContext: k,
|
|
2741
2741
|
colWidths: E,
|
|
2742
2742
|
rowHeights: D,
|
|
2743
2743
|
frozenColWidths: S,
|
|
@@ -2748,70 +2748,70 @@ function Or(e, t, n, r, i = {}) {
|
|
|
2748
2748
|
startCol: h,
|
|
2749
2749
|
cs: o,
|
|
2750
2750
|
dpr: a,
|
|
2751
|
-
autoFilterCells:
|
|
2752
|
-
hyperlinkMap:
|
|
2753
|
-
commentCells:
|
|
2754
|
-
tableStyleMap:
|
|
2755
|
-
sparklineMap:
|
|
2751
|
+
autoFilterCells: j,
|
|
2752
|
+
hyperlinkMap: M,
|
|
2753
|
+
commentCells: ee,
|
|
2754
|
+
tableStyleMap: N,
|
|
2755
|
+
sparklineMap: P,
|
|
2756
2756
|
mdw: s,
|
|
2757
2757
|
onTextRun: i.onTextRun,
|
|
2758
2758
|
rtl: t.rightToLeft === !0,
|
|
2759
2759
|
canvasW: c
|
|
2760
|
-
},
|
|
2761
|
-
b > 0 && x > 0 && Tr(e,
|
|
2762
|
-
let
|
|
2760
|
+
}, L = f, R = p, z = L + w, B = R + T, V = Math.max(0, c - z), H = Math.max(0, l - B);
|
|
2761
|
+
b > 0 && x > 0 && Tr(e, I, 1, 1, S, C, 0, 0, L, R, L, R, w, T), b > 0 && Tr(e, I, 1, h, E, C, v, 0, z, R, z, R, V, T), x > 0 && Tr(e, I, m, 1, S, D, 0, y, L, B, L, B, w, H), Tr(e, I, m, h, E, D, v, y, z, B, z, B, V, H), t.images && t.images.length > 0 && i.loadedImages && Mr(e, t, i.loadedImages, o, m, h, v, y, z, B, V, H, t.rightToLeft === !0, c), t.shapeGroups && t.shapeGroups.length > 0 && Nr(e, t, o, m, h, v, y, z, B, V, H, i.loadedImages, t.rightToLeft === !0, c), t.charts && t.charts.length > 0 && Qr(e, t, o, m, h, v, y, z, B, V, H, t.rightToLeft === !0, c), t.slicers && t.slicers.length > 0 && di(e, t, o, m, h, v, y, z, B, V, H, t.rightToLeft === !0, c), kr(e, c, l, m, h, g, _, E, D, v, y, S, C, w, T, f, p, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
2762
|
+
let U = t.rightToLeft === !0;
|
|
2763
2763
|
if (b > 0) {
|
|
2764
2764
|
e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
|
|
2765
|
-
let t =
|
|
2766
|
-
|
|
2765
|
+
let t = B + d(B, .5, a);
|
|
2766
|
+
U ? (e.moveTo(0, t), e.lineTo(c - f, t)) : (e.moveTo(f, t), e.lineTo(c, t)), e.stroke(), e.restore();
|
|
2767
2767
|
}
|
|
2768
2768
|
if (x > 0) {
|
|
2769
2769
|
e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
|
|
2770
|
-
let t =
|
|
2770
|
+
let t = U ? c - z : z, n = t + d(t, .5, a);
|
|
2771
2771
|
e.moveTo(n, p), e.lineTo(n, l), e.stroke(), e.restore();
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
2774
2774
|
function kr(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g, _, v, y, b, x, S) {
|
|
2775
|
-
let C = "#f8f9fa", w = "#e8eaed", T = "#caddf6", E = "#c8ccd0", D = "#5b9bd5", O = "#444",
|
|
2776
|
-
e.fillStyle = C, e.fillRect(
|
|
2777
|
-
let
|
|
2778
|
-
e.moveTo(
|
|
2779
|
-
let
|
|
2780
|
-
let i =
|
|
2781
|
-
e.fillStyle =
|
|
2775
|
+
let C = "#f8f9fa", w = "#e8eaed", T = "#caddf6", E = "#c8ccd0", D = "#5b9bd5", O = "#444", k = (e) => !x || e < x.start || e > x.end ? C : x.strong ? T : w, A = (e) => !x || e < x.start || e > x.end ? E : x.strong ? D : E, j = (e) => !b || e < b.start || e > b.end ? C : b.strong ? T : w, M = (e) => !b || e < b.start || e > b.end ? E : b.strong ? D : E, ee = `${Math.max(1, Math.round(11 * v))}px ${Cn}`, N = g + m, P = _ + h, F = .5 / y, I = (e, n) => S ? An(e, n, t) : e, L = S ? t - g : 0;
|
|
2776
|
+
e.fillStyle = C, e.fillRect(L, 0, g, _), e.strokeStyle = E, e.lineWidth = .5, e.beginPath();
|
|
2777
|
+
let R = L + d(L, .5, y), z = d(0, .5, y);
|
|
2778
|
+
e.moveTo(R, 0), e.lineTo(R, _), e.moveTo(L, z), e.lineTo(L + g, z), e.moveTo(L + g - F, 0), e.lineTo(L + g - F, _), e.moveTo(L, _ - F), e.lineTo(L + g, _ - F), e.stroke(), e.font = ee, e.fillStyle = O;
|
|
2779
|
+
let B = (t, n, r) => {
|
|
2780
|
+
let i = I(n, r);
|
|
2781
|
+
e.fillStyle = k(t), e.fillRect(i, 0, r, _), e.strokeStyle = A(t), e.lineWidth = .5, e.beginPath();
|
|
2782
2782
|
let a = i + d(i, .5, y), o = d(0, .5, y);
|
|
2783
|
-
e.moveTo(a, 0), e.lineTo(a, _), e.moveTo(i, _ -
|
|
2784
|
-
},
|
|
2785
|
-
let i =
|
|
2786
|
-
e.fillStyle =
|
|
2783
|
+
e.moveTo(a, 0), e.lineTo(a, _), e.moveTo(i, _ - F), e.lineTo(i + r, _ - F), e.moveTo(i, o), e.lineTo(i + r, o), e.stroke(), e.fillStyle = O, e.textAlign = "center", e.textBaseline = "middle", e.fillText(hr(t), i + r / 2, _ / 2);
|
|
2784
|
+
}, V = (t, n, r) => {
|
|
2785
|
+
let i = L;
|
|
2786
|
+
e.fillStyle = j(t), e.fillRect(i, n, g, r), e.strokeStyle = M(t), e.lineWidth = .5, e.beginPath();
|
|
2787
2787
|
let a = n + d(n, .5, y), o = i + d(i, .5, y);
|
|
2788
|
-
e.moveTo(i + g -
|
|
2788
|
+
e.moveTo(i + g - F, n), e.lineTo(i + g - F, n + r), e.moveTo(i, a), e.lineTo(i + g, a), e.moveTo(o, n), e.lineTo(o, n + r), e.stroke(), e.fillStyle = O, e.textBaseline = "middle";
|
|
2789
2789
|
let s = Math.max(2, Math.round(4 * v));
|
|
2790
2790
|
S ? (e.textAlign = "left", e.fillText(String(t), i + s, n + r / 2)) : (e.textAlign = "right", e.fillText(String(t), i + g - s, n + r / 2));
|
|
2791
2791
|
};
|
|
2792
2792
|
if (f.length > 0) {
|
|
2793
|
-
e.save(), e.beginPath(), e.rect(
|
|
2793
|
+
e.save(), e.beginPath(), e.rect(I(g, m), 0, m, _), e.clip();
|
|
2794
2794
|
let t = g;
|
|
2795
|
-
for (let e = 0; e < f.length; e++)
|
|
2795
|
+
for (let e = 0; e < f.length; e++) B(e + 1, t, f[e]), t += f[e];
|
|
2796
2796
|
e.restore();
|
|
2797
2797
|
}
|
|
2798
|
-
e.save(), e.beginPath(), e.rect(
|
|
2799
|
-
let
|
|
2798
|
+
e.save(), e.beginPath(), e.rect(I(N, t - N), 0, t - N, _), e.clip();
|
|
2799
|
+
let H = N - l;
|
|
2800
2800
|
for (let e = 0; e < s.length; e++) {
|
|
2801
2801
|
let n = s[e];
|
|
2802
|
-
|
|
2802
|
+
H + n > N && H < t && B(i + e, H, n), H += n;
|
|
2803
2803
|
}
|
|
2804
2804
|
if (e.restore(), p.length > 0) {
|
|
2805
|
-
e.save(), e.beginPath(), e.rect(
|
|
2805
|
+
e.save(), e.beginPath(), e.rect(L, _, g, h), e.clip();
|
|
2806
2806
|
let t = _;
|
|
2807
|
-
for (let e = 0; e < p.length; e++)
|
|
2807
|
+
for (let e = 0; e < p.length; e++) V(e + 1, t, p[e]), t += p[e];
|
|
2808
2808
|
e.restore();
|
|
2809
2809
|
}
|
|
2810
|
-
e.save(), e.beginPath(), e.rect(
|
|
2811
|
-
let
|
|
2810
|
+
e.save(), e.beginPath(), e.rect(L, P, g, n - P), e.clip();
|
|
2811
|
+
let U = P - u;
|
|
2812
2812
|
for (let e = 0; e < c.length; e++) {
|
|
2813
2813
|
let t = c[e];
|
|
2814
|
-
|
|
2814
|
+
U + t > P && U < n && V(r + e, U, t), U += t;
|
|
2815
2815
|
}
|
|
2816
2816
|
e.restore();
|
|
2817
2817
|
}
|
|
@@ -2834,15 +2834,15 @@ function Mr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2834
2834
|
for (let i of t.images) {
|
|
2835
2835
|
let a = n.get(bn(i.imagePath, i.duotone));
|
|
2836
2836
|
if (!a) continue;
|
|
2837
|
-
let _ = i.fromCol + 1, v = i.fromRow + 1, y = Ar(t, _, r) + i.fromColOff * r /
|
|
2838
|
-
if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) x = i.nativeExtCx * r /
|
|
2837
|
+
let _ = i.fromCol + 1, v = i.fromRow + 1, y = Ar(t, _, r) + i.fromColOff * r / G, b = jr(t, v, r) + i.fromRowOff * r / G, x, S;
|
|
2838
|
+
if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) x = i.nativeExtCx * r / G, S = i.nativeExtCy * r / G;
|
|
2839
2839
|
else {
|
|
2840
|
-
let e = i.toCol + 1, n = i.toRow + 1, a = Ar(t, e, r) + i.toColOff * r /
|
|
2840
|
+
let e = i.toCol + 1, n = i.toRow + 1, a = Ar(t, e, r) + i.toColOff * r / G, o = jr(t, n, r) + i.toRowOff * r / G;
|
|
2841
2841
|
x = a - y, S = o - b;
|
|
2842
2842
|
}
|
|
2843
2843
|
if (x <= 0 || S <= 0) continue;
|
|
2844
2844
|
let C = jn(c + (y - m) - o, x, p, f), w = l + (b - h) - s;
|
|
2845
|
-
C + x < g || C > g + u || w + S < l || w > l + d || (i.alpha != null && i.alpha < 1 ? (e.save(), e.globalAlpha = i.alpha,
|
|
2845
|
+
C + x < g || C > g + u || w + S < l || w > l + d || (i.alpha != null && i.alpha < 1 ? (e.save(), e.globalAlpha = i.alpha, H(e, a, i.srcRect, C, w, x, S), e.restore()) : H(e, a, i.srcRect, C, w, x, S));
|
|
2846
2846
|
}
|
|
2847
2847
|
e.restore();
|
|
2848
2848
|
}
|
|
@@ -2855,10 +2855,10 @@ function Nr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2855
2855
|
let _ = jn(s, l, p, f);
|
|
2856
2856
|
e.rect(_, c, l, u), e.clip();
|
|
2857
2857
|
for (let r of m) {
|
|
2858
|
-
let i = r.fromCol + 1, m = r.fromRow + 1, v = Ar(t, i, n) + r.fromColOff * n /
|
|
2859
|
-
if (r.editAs === "oneCell" && r.nativeExtCx > 0 && r.nativeExtCy > 0) b = r.nativeExtCx * n /
|
|
2858
|
+
let i = r.fromCol + 1, m = r.fromRow + 1, v = Ar(t, i, n) + r.fromColOff * n / G, y = jr(t, m, n) + r.fromRowOff * n / G, b, x;
|
|
2859
|
+
if (r.editAs === "oneCell" && r.nativeExtCx > 0 && r.nativeExtCy > 0) b = r.nativeExtCx * n / G, x = r.nativeExtCy * n / G;
|
|
2860
2860
|
else {
|
|
2861
|
-
let e = r.toCol + 1, i = r.toRow + 1, a = Ar(t, e, n) + r.toColOff * n /
|
|
2861
|
+
let e = r.toCol + 1, i = r.toRow + 1, a = Ar(t, e, n) + r.toColOff * n / G, o = jr(t, i, n) + r.toRowOff * n / G;
|
|
2862
2862
|
b = a - v, x = o - y;
|
|
2863
2863
|
}
|
|
2864
2864
|
if (b <= 0 || x <= 0) continue;
|
|
@@ -2912,14 +2912,14 @@ function Pr(e, t, n, r, i, a, o, s) {
|
|
|
2912
2912
|
}
|
|
2913
2913
|
else if (t.geom.type === "preset") {
|
|
2914
2914
|
let n = t.fillColor ?? null, r = t.strokeColor && t.strokeWidth > 0 ? () => {
|
|
2915
|
-
e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth /
|
|
2915
|
+
e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / G), e.stroke();
|
|
2916
2916
|
} : null;
|
|
2917
|
-
|
|
2917
|
+
se(e, t.geom.name, 0, 0, i, a, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, a), Wr(e, t));
|
|
2918
2918
|
} else if (t.geom.type === "image") {
|
|
2919
2919
|
let n = s?.get(bn(t.geom.imagePath, t.geom.duotone));
|
|
2920
2920
|
if (n) {
|
|
2921
2921
|
let r = t.geom.alpha;
|
|
2922
|
-
r != null && r < 1 ? (e.save(), e.globalAlpha = r,
|
|
2922
|
+
r != null && r < 1 ? (e.save(), e.globalAlpha = r, H(e, n, t.geom.srcRect, 0, 0, i, a), e.restore()) : H(e, n, t.geom.srcRect, 0, 0, i, a);
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
2925
|
t.text && Ur(e, t.text, i, a, o), e.restore();
|
|
@@ -2961,7 +2961,7 @@ async function Hr(e, t) {
|
|
|
2961
2961
|
if (n.length !== 0) {
|
|
2962
2962
|
await t.loadMathJax();
|
|
2963
2963
|
for (let e of n) if (!Fr.has(e.nodes)) try {
|
|
2964
|
-
let n = await t.mathMLToSvg(h(e.nodes, e.display)), r = await Lr(zr(
|
|
2964
|
+
let n = await t.mathMLToSvg(h(e.nodes, e.display)), r = await Lr(zr(Te(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
2965
2965
|
Fr.set(e.nodes, {
|
|
2966
2966
|
img: r,
|
|
2967
2967
|
widthEm: n.widthEm,
|
|
@@ -2974,7 +2974,7 @@ async function Hr(e, t) {
|
|
|
2974
2974
|
}
|
|
2975
2975
|
function Ur(e, t, n, r, i) {
|
|
2976
2976
|
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
2977
|
-
let a = t.lIns /
|
|
2977
|
+
let a = t.lIns / G * i, o = t.rIns / G * i, s = t.tIns / G * i, c = t.bIns / G * i, l = Math.max(0, n - a - o), u = Math.max(0, r - s - c);
|
|
2978
2978
|
if (l <= 0 || u <= 0) return;
|
|
2979
2979
|
let d = (e) => {
|
|
2980
2980
|
let t = (e.size > 0 ? e.size : On) * x * i, n = Dn(e.fontFace);
|
|
@@ -2989,15 +2989,15 @@ function Ur(e, t, n, r, i) {
|
|
|
2989
2989
|
return e.font = r, i > 0 ? i : n * .85;
|
|
2990
2990
|
}, p = t.wrap !== "none", m = [];
|
|
2991
2991
|
for (let n of t.paragraphs) {
|
|
2992
|
-
let r = n.align || "l", a = (n.marL ?? 0) /
|
|
2992
|
+
let r = n.align || "l", a = (n.marL ?? 0) / G * i, o = (n.marR ?? 0) / G * i, s = (n.indent ?? 0) / G * i, c = Math.max(0, s), u = Math.max(0, l - a - o), h = !1, g = () => h ? a : a + c, _ = () => h ? u : u - c, v = [], y = 0, b = 0, S = 0, C = !1, w = n.spaceLine?.type === "pct", T = (e) => {
|
|
2993
2993
|
let r = e;
|
|
2994
2994
|
return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val * x * i), t.autoFit === "norm" && t.lnSpcReduction != null && n.spaceLine?.type !== "pts" && (r *= 1 - t.lnSpcReduction), r;
|
|
2995
|
-
},
|
|
2995
|
+
}, E = () => {
|
|
2996
2996
|
if (b === 0) {
|
|
2997
|
-
let e = (
|
|
2998
|
-
b = Math.max(
|
|
2997
|
+
let e = (D || On) * x * i, t = Math.max(K(O, e), K(k, e)), n = e * 1.2;
|
|
2998
|
+
b = w ? n : Math.max(n, t), S = f(`${e}px ${Dn(O)}`, e);
|
|
2999
2999
|
}
|
|
3000
|
-
b =
|
|
3000
|
+
b = T(b), m.push({
|
|
3001
3001
|
segs: v,
|
|
3002
3002
|
align: r,
|
|
3003
3003
|
height: b,
|
|
@@ -3006,18 +3006,18 @@ function Ur(e, t, n, r, i) {
|
|
|
3006
3006
|
leftInset: g(),
|
|
3007
3007
|
availW: _()
|
|
3008
3008
|
}), h = !0, v = [], y = 0, b = 0, S = 0, C = !1;
|
|
3009
|
-
},
|
|
3009
|
+
}, D = 0, O, k;
|
|
3010
3010
|
for (let t of n.runs) {
|
|
3011
3011
|
if (t.type === "break") {
|
|
3012
|
-
|
|
3012
|
+
E();
|
|
3013
3013
|
continue;
|
|
3014
3014
|
}
|
|
3015
3015
|
if (t.type === "math") {
|
|
3016
3016
|
let e = Fr.get(t.nodes);
|
|
3017
3017
|
if (!e) continue;
|
|
3018
|
-
let n = (t.fontSize ?? (
|
|
3018
|
+
let n = (t.fontSize ?? (D || On)) * x * i, o = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
|
|
3019
3019
|
if (t.display) {
|
|
3020
|
-
|
|
3020
|
+
E(), m.push({
|
|
3021
3021
|
segs: [{
|
|
3022
3022
|
kind: "math",
|
|
3023
3023
|
render: e,
|
|
@@ -3027,7 +3027,7 @@ function Ur(e, t, n, r, i) {
|
|
|
3027
3027
|
descent: c
|
|
3028
3028
|
}],
|
|
3029
3029
|
align: r,
|
|
3030
|
-
height:
|
|
3030
|
+
height: T(s + c),
|
|
3031
3031
|
ascent: s,
|
|
3032
3032
|
hasMath: !0,
|
|
3033
3033
|
leftInset: a,
|
|
@@ -3035,7 +3035,7 @@ function Ur(e, t, n, r, i) {
|
|
|
3035
3035
|
}), h = !0;
|
|
3036
3036
|
continue;
|
|
3037
3037
|
}
|
|
3038
|
-
p && y + o > _() && v.length > 0 &&
|
|
3038
|
+
p && y + o > _() && v.length > 0 && E(), v.push({
|
|
3039
3039
|
kind: "math",
|
|
3040
3040
|
render: e,
|
|
3041
3041
|
color: l,
|
|
@@ -3045,13 +3045,13 @@ function Ur(e, t, n, r, i) {
|
|
|
3045
3045
|
}), y += o, b = Math.max(b, s + c), S = Math.max(S, s), C = !0;
|
|
3046
3046
|
continue;
|
|
3047
3047
|
}
|
|
3048
|
-
|
|
3049
|
-
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(
|
|
3050
|
-
b = Math.max(b,
|
|
3051
|
-
let
|
|
3052
|
-
for (let t = 0; t <
|
|
3053
|
-
t > 0 &&
|
|
3054
|
-
let r =
|
|
3048
|
+
D = t.size > 0 ? t.size : On, O = t.fontFace, k = t.fontFaceEa;
|
|
3049
|
+
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(K(t.fontFace, o), K(t.fontFaceEa, o)), l = o * 1.2, g = w ? l : Math.max(l, c);
|
|
3050
|
+
b = Math.max(b, g), S = Math.max(S, f(n, o)), e.font = n;
|
|
3051
|
+
let A = t.text.split("\n");
|
|
3052
|
+
for (let t = 0; t < A.length; t++) {
|
|
3053
|
+
t > 0 && E();
|
|
3054
|
+
let r = A[t];
|
|
3055
3055
|
if (!r) continue;
|
|
3056
3056
|
if (!p) {
|
|
3057
3057
|
let t = e.measureText(r).width;
|
|
@@ -3078,7 +3078,7 @@ function Ur(e, t, n, r, i) {
|
|
|
3078
3078
|
w: t
|
|
3079
3079
|
}), y += t;
|
|
3080
3080
|
}
|
|
3081
|
-
|
|
3081
|
+
E(), i = t, e.font = n, b = Math.max(b, g), S = Math.max(S, f(n, o));
|
|
3082
3082
|
} else i = r;
|
|
3083
3083
|
}
|
|
3084
3084
|
if (i) {
|
|
@@ -3093,7 +3093,7 @@ function Ur(e, t, n, r, i) {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
}
|
|
3095
3095
|
}
|
|
3096
|
-
|
|
3096
|
+
E();
|
|
3097
3097
|
}
|
|
3098
3098
|
let h = m.reduce((e, t) => e + t.height, 0), g = s;
|
|
3099
3099
|
t.anchor === "ctr" ? g = s + (u - h) / 2 : t.anchor === "b" && (g = s + Math.max(0, u - h));
|
|
@@ -3120,7 +3120,7 @@ function Ur(e, t, n, r, i) {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
3122
|
function Wr(e, t) {
|
|
3123
|
-
t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth /
|
|
3123
|
+
t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / G), e.stroke());
|
|
3124
3124
|
}
|
|
3125
3125
|
function Gr(e, t, n, r, i, a, o) {
|
|
3126
3126
|
if (r === n && i === t) return e;
|
|
@@ -3207,7 +3207,7 @@ function qr(e, t, n, r, i, a, o = 1) {
|
|
|
3207
3207
|
];
|
|
3208
3208
|
for (let { edge: t, x1: c, y1: l, x2: u, y2: f, kind: p } of s) {
|
|
3209
3209
|
if (!t || !t.style || t.style === "none") continue;
|
|
3210
|
-
let s = t.color ?
|
|
3210
|
+
let s = t.color ? Y(t.color) : "#000000";
|
|
3211
3211
|
if (t.style === "double" && p === "d") {
|
|
3212
3212
|
e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]);
|
|
3213
3213
|
let t = u - c, n = f - l, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
|
|
@@ -3247,7 +3247,7 @@ function Jr(e) {
|
|
|
3247
3247
|
}
|
|
3248
3248
|
}
|
|
3249
3249
|
function Yr(e) {
|
|
3250
|
-
return
|
|
3250
|
+
return j(e);
|
|
3251
3251
|
}
|
|
3252
3252
|
function Xr(e) {
|
|
3253
3253
|
switch (e) {
|
|
@@ -3275,13 +3275,13 @@ function Qr(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
3275
3275
|
if (l <= 0 || u <= 0) return;
|
|
3276
3276
|
let p = Ar(t, i, n), m = jr(t, r, n), h = jn(s, l, f, d);
|
|
3277
3277
|
for (let r of t.charts) {
|
|
3278
|
-
let i = r.fromCol + 1, g = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n /
|
|
3278
|
+
let i = r.fromCol + 1, g = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n / G, b = jr(t, g, n) + r.fromRowOff * n / G, S = Ar(t, _, n) + r.toColOff * n / G, C = jr(t, v, n) + r.toRowOff * n / G, w = S - y, T = C - b;
|
|
3279
3279
|
if (w <= 0 || T <= 0) continue;
|
|
3280
3280
|
let E = jn(s + (y - p) - a, w, f, d), D = c + (b - m) - o;
|
|
3281
3281
|
if (E + w < h || E > h + l || D + T < c || D > c + u) continue;
|
|
3282
3282
|
e.save(), e.beginPath(), e.rect(h, c, l, u), e.clip();
|
|
3283
3283
|
let O = x * n;
|
|
3284
|
-
|
|
3284
|
+
ge(e, r.chart, {
|
|
3285
3285
|
x: E,
|
|
3286
3286
|
y: D,
|
|
3287
3287
|
w,
|
|
@@ -3296,7 +3296,7 @@ function di(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
3296
3296
|
if (!p) return;
|
|
3297
3297
|
let m = Ar(t, i, n), h = jr(t, r, n), g = jn(s, l, f, d);
|
|
3298
3298
|
for (let r of p) {
|
|
3299
|
-
let i = r.fromCol + 1, p = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n /
|
|
3299
|
+
let i = r.fromCol + 1, p = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n / G, b = jr(t, p, n) + r.fromRowOff * n / G, x = Ar(t, _, n) + r.toColOff * n / G, S = jr(t, v, n) + r.toRowOff * n / G, C = x - y, w = S - b;
|
|
3300
3300
|
if (C <= 0 || w <= 0) continue;
|
|
3301
3301
|
let T = jn(s + (y - m) - a, C, f, d), E = c + (b - h) - o;
|
|
3302
3302
|
T + C < g || T > g + l || E + w < c || E > c + u || (e.save(), e.beginPath(), e.rect(g, c, l, u), e.clip(), fi(e, r.caption, r.items, T, E, C, w, n, r.style), e.restore());
|
|
@@ -3346,7 +3346,7 @@ function gi(e, t, n, r, i) {
|
|
|
3346
3346
|
//#endregion
|
|
3347
3347
|
//#region packages/xlsx/src/render-orchestrator.ts
|
|
3348
3348
|
async function _i(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
|
|
3349
|
-
let l = t === "image/svg+xml", u =
|
|
3349
|
+
let l = t === "image/svg+xml", u = le(t, o, i, a), d = () => be(e, t, s, r, {
|
|
3350
3350
|
widthPt: u.widthPt,
|
|
3351
3351
|
heightPt: u.heightPt,
|
|
3352
3352
|
offscreenFactory: c
|
|
@@ -3354,12 +3354,12 @@ async function _i(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
|
|
|
3354
3354
|
svgImagePath: n,
|
|
3355
3355
|
srcRect: o
|
|
3356
3356
|
};
|
|
3357
|
-
if (
|
|
3358
|
-
return await
|
|
3357
|
+
if (F(f)) try {
|
|
3358
|
+
return await J(f.svgImagePath, r);
|
|
3359
3359
|
} catch {
|
|
3360
|
-
return l ?
|
|
3360
|
+
return l ? J(e, r) : d();
|
|
3361
3361
|
}
|
|
3362
|
-
return l ?
|
|
3362
|
+
return l ? J(e, r) : d();
|
|
3363
3363
|
}
|
|
3364
3364
|
async function vi(e, n, r, i) {
|
|
3365
3365
|
if (!r) return;
|
|
@@ -3392,7 +3392,7 @@ async function vi(e, n, r, i) {
|
|
|
3392
3392
|
}));
|
|
3393
3393
|
}
|
|
3394
3394
|
async function yi(e, t, n, r = {}) {
|
|
3395
|
-
let i = r.fetchImage ?
|
|
3395
|
+
let i = r.fetchImage ? pe(r.fetchImage) : void 0;
|
|
3396
3396
|
try {
|
|
3397
3397
|
await bi(e, t, n, r);
|
|
3398
3398
|
} finally {
|
|
@@ -3402,8 +3402,8 @@ async function yi(e, t, n, r = {}) {
|
|
|
3402
3402
|
async function bi(e, t, n, r = {}) {
|
|
3403
3403
|
let { ws: i, styles: a, imageCache: o } = e;
|
|
3404
3404
|
await vi(i, o, r.fetchImage), e.math && Vr(i) && await Hr(i, e.math);
|
|
3405
|
-
let s = r.dpr ?? _(), c =
|
|
3406
|
-
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h),
|
|
3405
|
+
let s = r.dpr ?? _(), c = de(t) ? t.clientWidth || 800 : t.width, l = de(t) ? t.clientHeight || 600 : t.height, u = r.width ?? c, d = r.height ?? l, f = P(u * s, d * s), p = f.clamped ? s * f.scale : s, m = f.width, h = f.height;
|
|
3406
|
+
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h), de(t)) {
|
|
3407
3407
|
let e = `${u}px`, n = `${d}px`;
|
|
3408
3408
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
3409
3409
|
}
|
|
@@ -3449,7 +3449,7 @@ function* Ci(e) {
|
|
|
3449
3449
|
function wi(e) {
|
|
3450
3450
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
3451
3451
|
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= y(r.name));
|
|
3452
|
-
for (let r of
|
|
3452
|
+
for (let r of ye(Ci(e), n)) t.add(r);
|
|
3453
3453
|
return t;
|
|
3454
3454
|
}
|
|
3455
3455
|
//#endregion
|
|
@@ -3556,11 +3556,11 @@ var ki = class e {
|
|
|
3556
3556
|
googleFontFaces = [];
|
|
3557
3557
|
_mode = "main";
|
|
3558
3558
|
constructor(e, t, n) {
|
|
3559
|
-
this.worker = e, this._mode = t, this.bridge = new
|
|
3559
|
+
this.worker = e, this._mode = t, this.bridge = new M(this.worker, {
|
|
3560
3560
|
correlate: (e) => e.id,
|
|
3561
3561
|
toError: (e) => e.type === "error" ? e.message : void 0
|
|
3562
3562
|
});
|
|
3563
|
-
let r = new URL(n ??
|
|
3563
|
+
let r = new URL(n ?? Pe, location.href).href;
|
|
3564
3564
|
this.bridge.post({
|
|
3565
3565
|
type: "init",
|
|
3566
3566
|
wasmUrl: r
|
|
@@ -3575,8 +3575,8 @@ var ki = class e {
|
|
|
3575
3575
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
3576
3576
|
i = await e.arrayBuffer();
|
|
3577
3577
|
} else i = t;
|
|
3578
|
-
i = g(await
|
|
3579
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
3578
|
+
i = g(await q(i, n.password));
|
|
3579
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-Bcm9j4-H.js")).createRenderWorker() : new Ne(), r, n.wasmUrl);
|
|
3580
3580
|
return await a._load(i, n), a;
|
|
3581
3581
|
}
|
|
3582
3582
|
async _load(e, t = {}) {
|
|
@@ -3611,7 +3611,7 @@ var ki = class e {
|
|
|
3611
3611
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.tabColor ?? null) ?? [];
|
|
3612
3612
|
}
|
|
3613
3613
|
sheetVisibility(e) {
|
|
3614
|
-
return
|
|
3614
|
+
return Fe(this.parsedWorkbook?.workbook.sheets ?? [], e);
|
|
3615
3615
|
}
|
|
3616
3616
|
isHidden(e) {
|
|
3617
3617
|
return this.sheetVisibility(e) !== "visible";
|
|
@@ -3710,7 +3710,7 @@ var ki = class e {
|
|
|
3710
3710
|
return await this.renderViewport(i, e, t, r), i.transferToImageBitmap();
|
|
3711
3711
|
}
|
|
3712
3712
|
destroy() {
|
|
3713
|
-
this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.googleFontFaces.length > 0 && (
|
|
3713
|
+
this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.googleFontFaces.length > 0 && (ee(this.googleFontFaces), this.googleFontFaces = []), this.imageCache.clear(), z(this._fetchImage), xe(this._fetchImage), ae(this._fetchImage), this.imageBlobCache.clear(), this.rawData = null;
|
|
3714
3714
|
}
|
|
3715
3715
|
};
|
|
3716
3716
|
//#endregion
|
|
@@ -3789,7 +3789,7 @@ var Mi = class {
|
|
|
3789
3789
|
for (let r = 0; r < n; r++) {
|
|
3790
3790
|
let n = await this._collectSheetCells(r), i = this._sheetName(r);
|
|
3791
3791
|
for (let a of n) {
|
|
3792
|
-
let n =
|
|
3792
|
+
let n = te(fe([{ text: a.text }]), e, t);
|
|
3793
3793
|
for (let e of n) {
|
|
3794
3794
|
let t = e.slices[0], n = a.text.slice(t.start, t.end);
|
|
3795
3795
|
this._matches.push({
|
|
@@ -3805,10 +3805,10 @@ var Mi = class {
|
|
|
3805
3805
|
return this.matches();
|
|
3806
3806
|
}
|
|
3807
3807
|
next() {
|
|
3808
|
-
return this._active =
|
|
3808
|
+
return this._active = me(this._active, this._matches.length), this._activePublic();
|
|
3809
3809
|
}
|
|
3810
3810
|
prev() {
|
|
3811
|
-
return this._active =
|
|
3811
|
+
return this._active = ce(this._active, this._matches.length), this._activePublic();
|
|
3812
3812
|
}
|
|
3813
3813
|
_activePublic() {
|
|
3814
3814
|
let e = this._locationAt(this._active);
|
|
@@ -3994,17 +3994,25 @@ function aa(e) {
|
|
|
3994
3994
|
background: `color-mix(in srgb, ${e} 8%, transparent)`
|
|
3995
3995
|
};
|
|
3996
3996
|
}
|
|
3997
|
-
var oa =
|
|
3998
|
-
function
|
|
3999
|
-
let n =
|
|
3997
|
+
var oa = "color-mix(in srgb, #ffb300 8%, transparent)", sa = "color-mix(in srgb, #fb8c00 8%, transparent)";
|
|
3998
|
+
function ca(e, t = {}) {
|
|
3999
|
+
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? sa : oa);
|
|
4000
|
+
return {
|
|
4001
|
+
border: `2px solid ${r ?? n}`,
|
|
4002
|
+
background: i
|
|
4003
|
+
};
|
|
4004
|
+
}
|
|
4005
|
+
var la = /* @__PURE__ */ new WeakMap();
|
|
4006
|
+
function ua(e, t) {
|
|
4007
|
+
let n = la.get(e);
|
|
4000
4008
|
if (n) return n;
|
|
4001
4009
|
let r = {
|
|
4002
4010
|
col: new ea(e.colWidths, Q(e.defaultColWidth, t), (e) => Q(e, t), 16384),
|
|
4003
4011
|
row: new ea(e.rowHeights, $(e.defaultRowHeight), (e) => $(e), 1048576)
|
|
4004
4012
|
};
|
|
4005
|
-
return
|
|
4013
|
+
return la.set(e, r), r;
|
|
4006
4014
|
}
|
|
4007
|
-
var
|
|
4015
|
+
var da = class {
|
|
4008
4016
|
wb = null;
|
|
4009
4017
|
wrapper;
|
|
4010
4018
|
canvas;
|
|
@@ -4292,7 +4300,7 @@ var ca = class {
|
|
|
4292
4300
|
} else r.colCollapsed = r.colCollapsed ?? {}, n ? r.colCollapsed[t] = !0 : delete r.colCollapsed[t];
|
|
4293
4301
|
}
|
|
4294
4302
|
afterOutlineMutation(e) {
|
|
4295
|
-
|
|
4303
|
+
la.delete(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender();
|
|
4296
4304
|
}
|
|
4297
4305
|
buildOutlineLayoutOnly(e) {
|
|
4298
4306
|
this.rowOutlineBands = Bi(e), this.colOutlineBands = Vi(e);
|
|
@@ -4336,10 +4344,10 @@ var ca = class {
|
|
|
4336
4344
|
await this.goToSheet(this._stepSheet(-1));
|
|
4337
4345
|
}
|
|
4338
4346
|
_stepSheet(e) {
|
|
4339
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
4347
|
+
return this._hiddenSheetMode === "skip" && this.wb ? Se(this.currentSheet, e, (e) => this.wb.isHidden(e), this.sheetCount) : this.currentSheet + e;
|
|
4340
4348
|
}
|
|
4341
4349
|
_initialSheet() {
|
|
4342
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
4350
|
+
return this._hiddenSheetMode === "skip" && this.wb ? Ce(0, (e) => this.wb.isHidden(e), this.sheetCount) : 0;
|
|
4343
4351
|
}
|
|
4344
4352
|
getCellAt(e, t) {
|
|
4345
4353
|
let n = this.currentWorksheet;
|
|
@@ -4366,7 +4374,7 @@ var ca = class {
|
|
|
4366
4374
|
}
|
|
4367
4375
|
if (h === -1) return null;
|
|
4368
4376
|
} else {
|
|
4369
|
-
let e = c - d + this.scrollHost.scrollTop / r, t =
|
|
4377
|
+
let e = c - d + this.scrollHost.scrollTop / r, t = ua(n, Z(n)).row.scrollableIndexAt(e, l + 1);
|
|
4370
4378
|
if (t === null) return null;
|
|
4371
4379
|
h = t;
|
|
4372
4380
|
}
|
|
@@ -4380,7 +4388,7 @@ var ca = class {
|
|
|
4380
4388
|
}
|
|
4381
4389
|
if (g === -1) return null;
|
|
4382
4390
|
} else {
|
|
4383
|
-
let e = s - p + this.effectiveScrollLeft / r, t =
|
|
4391
|
+
let e = s - p + this.effectiveScrollLeft / r, t = ua(n, Z(n)).col.scrollableIndexAt(e, u + 1);
|
|
4384
4392
|
if (t === null) return null;
|
|
4385
4393
|
g = t;
|
|
4386
4394
|
}
|
|
@@ -4400,7 +4408,7 @@ var ca = class {
|
|
|
4400
4408
|
} else {
|
|
4401
4409
|
let e = 0;
|
|
4402
4410
|
for (let t = 1; t <= l; t++) e += o(t);
|
|
4403
|
-
let s = a(50) + e, c = this.effectiveScrollLeft / r, d =
|
|
4411
|
+
let s = a(50) + e, c = this.effectiveScrollLeft / r, d = ua(n, i).col, { index: f, partial: p } = d.indexAt(c + d.offsetOf(l + 1)), m = s - p * r;
|
|
4404
4412
|
if (t >= f) for (let e = f; e < t; e++) m += o(e);
|
|
4405
4413
|
else for (let e = t; e < f; e++) m -= o(e);
|
|
4406
4414
|
u = m;
|
|
@@ -4413,7 +4421,7 @@ var ca = class {
|
|
|
4413
4421
|
} else {
|
|
4414
4422
|
let t = 0;
|
|
4415
4423
|
for (let e = 1; e <= c; e++) t += s(e);
|
|
4416
|
-
let o = a(22) + t, l = this.scrollHost.scrollTop / r, u =
|
|
4424
|
+
let o = a(22) + t, l = this.scrollHost.scrollTop / r, u = ua(n, i).row, { index: f, partial: p } = u.indexAt(l + u.offsetOf(c + 1)), m = o - p * r;
|
|
4417
4425
|
if (e >= f) for (let t = f; t < e; t++) m += s(t);
|
|
4418
4426
|
else for (let t = e; t < f; t++) m -= s(t);
|
|
4419
4427
|
d = m;
|
|
@@ -4465,7 +4473,7 @@ var ca = class {
|
|
|
4465
4473
|
};
|
|
4466
4474
|
return null;
|
|
4467
4475
|
}
|
|
4468
|
-
let a = e - t + this.scrollHost.scrollTop / r, s =
|
|
4476
|
+
let a = e - t + this.scrollHost.scrollTop / r, s = ua(n, Z(n)).row.scrollableIndexAt(a, l + 1);
|
|
4469
4477
|
return s === null ? null : {
|
|
4470
4478
|
kind: "row",
|
|
4471
4479
|
row: s
|
|
@@ -4486,7 +4494,7 @@ var ca = class {
|
|
|
4486
4494
|
};
|
|
4487
4495
|
return null;
|
|
4488
4496
|
}
|
|
4489
|
-
let m = d - f + this.effectiveScrollLeft / r, h =
|
|
4497
|
+
let m = d - f + this.effectiveScrollLeft / r, h = ua(n, Z(n)).col.scrollableIndexAt(m, u + 1);
|
|
4490
4498
|
return h === null ? null : {
|
|
4491
4499
|
kind: "col",
|
|
4492
4500
|
col: h
|
|
@@ -4549,13 +4557,13 @@ var ca = class {
|
|
|
4549
4557
|
let e = t - a.top, o = Math.max(ra, Math.round((e - n.originScaled) / i));
|
|
4550
4558
|
r.rowHeights[n.index] = Ln(o), this.recordSizeOverride("row", n.index);
|
|
4551
4559
|
}
|
|
4552
|
-
|
|
4560
|
+
la.delete(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
|
|
4553
4561
|
}
|
|
4554
4562
|
setSelectionColor(e) {
|
|
4555
4563
|
this.opts.selectionColor = e, this.updateSelectionOverlay();
|
|
4556
4564
|
}
|
|
4557
4565
|
async setHiddenSheetMode(e) {
|
|
4558
|
-
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(
|
|
4566
|
+
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(Ce(this.currentSheet, (e) => this.wb.isHidden(e), this.sheetCount)) : this.updateTabActive(this.currentSheet);
|
|
4559
4567
|
}
|
|
4560
4568
|
get hiddenSheetMode() {
|
|
4561
4569
|
return this._hiddenSheetMode;
|
|
@@ -4563,7 +4571,7 @@ var ca = class {
|
|
|
4563
4571
|
get visibleSheetCount() {
|
|
4564
4572
|
if (!this.wb) return 0;
|
|
4565
4573
|
let e = this.wb;
|
|
4566
|
-
return
|
|
4574
|
+
return we((t) => e.isHidden(t), this.sheetCount);
|
|
4567
4575
|
}
|
|
4568
4576
|
copySelection() {
|
|
4569
4577
|
let e = this.currentWorksheet;
|
|
@@ -4647,7 +4655,7 @@ var ca = class {
|
|
|
4647
4655
|
for (let t = 1; t <= o; t++) s += n(Q(e.colWidths[t] ?? e.defaultColWidth, Z(e)));
|
|
4648
4656
|
let c = 0;
|
|
4649
4657
|
for (let t = 1; t <= a; t++) c += n($(e.rowHeights[t] ?? e.defaultRowHeight));
|
|
4650
|
-
let l = r + s, u = i + c, d =
|
|
4658
|
+
let l = r + s, u = i + c, d = ca(!1, this.opts.findHighlightColors), f = ca(!0, this.opts.findHighlightColors);
|
|
4651
4659
|
for (let e of this._find.sheetHighlights(this.currentSheet)) {
|
|
4652
4660
|
let t = this.getCellRect(e.row, e.col);
|
|
4653
4661
|
if (!t) continue;
|
|
@@ -4679,7 +4687,7 @@ var ca = class {
|
|
|
4679
4687
|
_scrollCellIntoView(e, t) {
|
|
4680
4688
|
let n = this.currentWorksheet;
|
|
4681
4689
|
if (!n) return;
|
|
4682
|
-
let r = this.opts.cellScale ?? 1, i = Z(n), a =
|
|
4690
|
+
let r = this.opts.cellScale ?? 1, i = Z(n), a = ua(n, i), o = n.freezeRows ?? 0, s = n.freezeCols ?? 0;
|
|
4683
4691
|
if (e > o) {
|
|
4684
4692
|
let t = Math.round(22 * r), i = 0;
|
|
4685
4693
|
for (let e = 1; e <= o; e++) i += Math.round($(n.rowHeights[e] ?? n.defaultRowHeight) * r);
|
|
@@ -4798,7 +4806,7 @@ var ca = class {
|
|
|
4798
4806
|
};
|
|
4799
4807
|
else return !1;
|
|
4800
4808
|
let r = this.opts.onHyperlinkClick;
|
|
4801
|
-
return r ? (r(n), !0) : (n.kind === "external" ?
|
|
4809
|
+
return r ? (r(n), !0) : (n.kind === "external" ? ie(n.url) : this.navigateInternalHyperlink(n.ref), !0);
|
|
4802
4810
|
}
|
|
4803
4811
|
navigateInternalHyperlink(e) {
|
|
4804
4812
|
let t = e.lastIndexOf("!");
|
|
@@ -4997,7 +5005,7 @@ var ca = class {
|
|
|
4997
5005
|
this._pendingZoomAnchor = Number.isFinite(n) && Number.isFinite(r) ? {
|
|
4998
5006
|
x: n,
|
|
4999
5007
|
y: r
|
|
5000
|
-
} : null, this.setScale(
|
|
5008
|
+
} : null, this.setScale(W(this.opts.cellScale ?? 1, e.deltaY));
|
|
5001
5009
|
}, { passive: !1 }), this.scrollHost.addEventListener("pointerleave", () => this.hideCommentPopup()), this.keydownHandler = (e) => {
|
|
5002
5010
|
(e.ctrlKey || e.metaKey) && e.key === "c" ? this.copySelection() : e.key === "Escape" && this.validationPanel.style.display !== "none" && this.hideValidationPanel();
|
|
5003
5011
|
}, document.addEventListener("keydown", this.keydownHandler);
|
|
@@ -5080,8 +5088,8 @@ var ca = class {
|
|
|
5080
5088
|
let e = this.effectiveScrollLeft, t = this.scrollHost.scrollTop;
|
|
5081
5089
|
if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
|
|
5082
5090
|
let n = Math.max(0, this.scrollHost.scrollHeight - this.scrollHost.clientHeight);
|
|
5083
|
-
this.scrollHost.scrollTop =
|
|
5084
|
-
let r = this.screenX(o.x, 0), s = this.maxScrollLeft, c =
|
|
5091
|
+
this.scrollHost.scrollTop = oe(t, o.y, a, i, { maxScroll: n });
|
|
5092
|
+
let r = this.screenX(o.x, 0), s = this.maxScrollLeft, c = oe(e, r, a, i, { maxScroll: s });
|
|
5085
5093
|
this.effectiveH = c, this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, s - c) : c;
|
|
5086
5094
|
} else this.effectiveH = e, this.isRtl && (this.scrollHost.scrollLeft = Math.max(0, this.maxScrollLeft - e));
|
|
5087
5095
|
}
|
|
@@ -5092,10 +5100,10 @@ var ca = class {
|
|
|
5092
5100
|
return this.opts.cellScale ?? 1;
|
|
5093
5101
|
}
|
|
5094
5102
|
zoomIn() {
|
|
5095
|
-
this.setScale(
|
|
5103
|
+
this.setScale(U(this.getScale()));
|
|
5096
5104
|
}
|
|
5097
5105
|
zoomOut() {
|
|
5098
|
-
this.setScale(
|
|
5106
|
+
this.setScale(ue(this.getScale()));
|
|
5099
5107
|
}
|
|
5100
5108
|
fitWidth() {
|
|
5101
5109
|
this._fit("width");
|
|
@@ -5106,7 +5114,7 @@ var ca = class {
|
|
|
5106
5114
|
_fit(e) {
|
|
5107
5115
|
let t = this.currentWorksheet;
|
|
5108
5116
|
if (!t) return;
|
|
5109
|
-
let { width: n, height: r } = this._naturalContentExtent(t), i =
|
|
5117
|
+
let { width: n, height: r } = this._naturalContentExtent(t), i = V({
|
|
5110
5118
|
contentWidth: n,
|
|
5111
5119
|
contentHeight: r,
|
|
5112
5120
|
containerWidth: this.canvasArea.clientWidth,
|
|
@@ -5173,7 +5181,7 @@ var ca = class {
|
|
|
5173
5181
|
for (let t = 1; t <= s; t++) c += Q(e.colWidths[t] ?? e.defaultColWidth, Z(e));
|
|
5174
5182
|
let l = 0;
|
|
5175
5183
|
for (let t = 1; t <= o; t++) l += $(e.rowHeights[t] ?? e.defaultRowHeight);
|
|
5176
|
-
let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f =
|
|
5184
|
+
let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f = ua(e, Z(e)), { index: p, partial: m } = f.col.indexAt(u + f.col.offsetOf(s + 1)), { index: h, partial: g } = f.row.indexAt(d + f.row.offsetOf(o + 1)), _ = t / i - 50 - c, v = n / i - 22 - l, y = 0;
|
|
5177
5185
|
{
|
|
5178
5186
|
let t = -m, n = p;
|
|
5179
5187
|
for (; t < _ + m && n <= 16384;) t += Q(e.colWidths[n] ?? e.defaultColWidth, Z(e)), y++, n++;
|
|
@@ -5283,13 +5291,13 @@ var ca = class {
|
|
|
5283
5291
|
destroy() {
|
|
5284
5292
|
this._destroyed = !0, this._loadGen++, this.resizeObserver?.disconnect(), this._rafId !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this._rafId), this._rafId = null), this._renderSeq++, this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this._find.invalidate(), this.wb?.destroy(), this.wrapper.remove();
|
|
5285
5293
|
}
|
|
5286
|
-
},
|
|
5287
|
-
OoxmlError: () =>
|
|
5288
|
-
XlsxViewer: () =>
|
|
5294
|
+
}, fa = /* @__PURE__ */ e({
|
|
5295
|
+
OoxmlError: () => I,
|
|
5296
|
+
XlsxViewer: () => da,
|
|
5289
5297
|
XlsxWorkbook: () => ki,
|
|
5290
|
-
autoResize: () =>
|
|
5291
|
-
openExternalHyperlink: () =>
|
|
5298
|
+
autoResize: () => R,
|
|
5299
|
+
openExternalHyperlink: () => ie,
|
|
5292
5300
|
resolveSharedStrings: () => Ti
|
|
5293
5301
|
});
|
|
5294
5302
|
//#endregion
|
|
5295
|
-
export { Ti as i,
|
|
5303
|
+
export { Ti as i, da as n, ki as r, fa as t };
|